Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #29

Merged
merged 59 commits into from
Nov 11, 2023
Merged

Dev #29

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
af0e1f5
Update balancer gauges, start to prepay deploy scripts
dvpublic May 26, 2023
02382ce
Create scripts for redeploying of balancer strategies (to change gauges)
dvpublic May 27, 2023
e794561
Add tests for redeploy-balancer-strategies scripts
dvpublic May 27, 2023
81c404b
tetuBalHolder => rewardsRecipient, change BalancerBPTTetuUsdcStrategy…
dvpublic May 27, 2023
7d4f8ed
Update IBalancerGauge to v2
dvpublic May 27, 2023
cc39685
fix tetu-mesh staking strategy + tetubal distributor fix apr
belbix May 28, 2023
75323c0
Merge pull request #18 from tetu-io/belbix-dev
belbix May 28, 2023
c2ace7a
Fix BalancerBPT_TETU-USDC_Test test
dvpublic May 29, 2023
09dbddc
tests for new balancer gauges...
dvpublic May 29, 2023
534c17f
fix most tests for balancer strategies with new gauges
dvpublic May 30, 2023
4356626
Fix USDC-rewards case in BalancerUniversalStrategyBase. Add test to s…
dvpublic May 30, 2023
d474e2b
Skip redeploy-balancer-strategies test in npm.run.test/coverage
dvpublic May 30, 2023
e503659
move block in hardhat config (new balancer gauges)
dvpublic May 30, 2023
841331c
Merge pull request #19 from tetu-io/dev-dvpublic
belbix May 30, 2023
95d27df
Fix deploy scripts of balancer-aave3 strategies. Bump version of Bala…
dvpublic Jun 3, 2023
8b0316c
Merge branch 'dev' into dev-dvpublic
dvpublic Jun 3, 2023
7242c7e
Merge pull request #20 from tetu-io/dev-dvpublic
belbix Jun 3, 2023
6a89a03
add perf fee possibility for landing strategies
belbix Jun 5, 2023
10d40e4
add claim to compound strategy
belbix Jun 8, 2023
32da75d
veTETU-holders script
belbix Jun 20, 2023
73ee3a9
migrate to 18 node + proposal script
belbix Jun 23, 2023
1472e9b
Merge pull request #22 from tetu-io/belbix-dev
belbix Jun 23, 2023
8399334
fix project + new tetubal voting power mechanic
belbix Jun 30, 2023
c73a9e1
StrategyBalancerBoost, GaugeDepositor
a17 Jul 1, 2023
4c6829b
Merge remote-tracking branch 'origin/dev' into alien-dev
a17 Jul 1, 2023
97f7c5d
GaugeDepositor deploy script, BalancerBoostStrategyBase adopt fix, ve…
a17 Jul 3, 2023
d0d684f
review fixes
a17 Jul 3, 2023
7fbb00a
Merge pull request #23 from tetu-io/alien-dev
belbix Jul 3, 2023
441aaaa
balancer boost deploy script
a17 Jul 3, 2023
d76f9ff
balancer boost deploy change bbRatio
a17 Jul 3, 2023
be0d058
Merge pull request #24 from tetu-io/alien-dev
belbix Jul 3, 2023
e93d600
balancer boost t-usd test and deploy
a17 Jul 10, 2023
89d4350
Merge pull request #25 from tetu-io/alien-dev
belbix Jul 11, 2023
7aac9d6
simplified BalBridgedStakingStrategyBase
belbix Jul 13, 2023
20efd40
new XtetuBALDistributor epoch and xtetubal script fixes
belbix Jul 13, 2023
d3f78b7
add emergency stop logic for tetu-usdc liquidity
belbix Jul 15, 2023
f791eb3
new tetubal power logic
belbix Aug 2, 2023
03bdf17
balancer boost bpt strategy for tetubal-baleth pool
a17 Aug 3, 2023
71c94ca
little improve script
belbix Aug 3, 2023
0f28ef8
Merge pull request #26 from tetu-io/alien-dev
belbix Aug 9, 2023
f359943
Balancer Boost TetuUsdc Strategy
a17 Aug 14, 2023
fec7cb0
Merge pull request #27 from tetu-io/alien-dev
belbix Aug 15, 2023
39d0acf
BalancerBoostTetuUsdcStrategyBase simplification + xtetuBAL-airdrop p…
belbix Aug 15, 2023
bb0c1e0
xtetuBAL-airdrop improvements
belbix Aug 17, 2023
93e17de
update ci
belbix Aug 30, 2023
e0deb5d
add caviar staking strategy
AlehNat Aug 27, 2023
0184c5e
update version of the tetu-contracts
AlehNat Sep 1, 2023
25544b6
scripts update
belbix Sep 4, 2023
016bd1a
skip balancer's falling tests
AlehNat Sep 4, 2023
ff88da6
add deployment script
AlehNat Sep 4, 2023
da742e5
Merge pull request #28 from tetu-io/caviar_strategy
belbix Sep 5, 2023
4e1ad9f
new XtetuBALDistributor + scripts
belbix Sep 15, 2023
a958a93
new distributor for vetetu rewards
belbix Sep 28, 2023
9e1c9aa
do not make hw on deposit in strategies
belbix Oct 4, 2023
9cf70f6
do not make hw on deposit in strategies2
belbix Oct 4, 2023
ea2d173
BalancerBPTStrategyBase fix hw
belbix Oct 8, 2023
4d8135f
improve xtetubal dist script
belbix Oct 10, 2023
fd95166
new bribe distribution
belbix Nov 4, 2023
f559eda
new tetubal strat
belbix Nov 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-node@v2
with:
node-version: 14.x
node-version: 18.x
- uses: actions/cache@v2
id: cache
with:
Expand Down
18 changes: 17 additions & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
module.exports = {
skipFiles: ['third_party', 'test', 'tools', 'openzeppelin']
skipFiles: ['third_party', 'test', 'tools', 'openzeppelin'],
configureYulOptimizer: true,
mocha: {
grep: "@skip-on-coverage", // Find everything with this tag
invert: true // Run the grep's inverse set.
},
solcOptimizerDetails: {
peephole: false,
//inliner: false,
jumpdestRemover: false,
orderLiterals: false, // <-- TRUE! Stack too deep when false
deduplicate: false,
cse: false,
constantOptimizer: false,
yul: true,
}

};
2 changes: 2 additions & 0 deletions addresses_core_matic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ hw5 0x75766Be51F932E738dee52f3A46c394589A36233
// tetuQI vote power contract 0xDA67dBaB383A7cE922320a48D515f0Fd567AAC08

// xtetuBAL distributor 0x6DdD4dB035FC15F90D74C1E98ABa967D6b3Ce3Dd

// balancer GaugeDepositor 0x1F46804E2D4B11CE7a61E36720DF316B7343B023
6 changes: 3 additions & 3 deletions contracts/TetuProxyControlled.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

pragma solidity 0.8.4;

import "./interface/IControllable.sol";
import "./interface/IControllableExtended.sol";
import "./interface/ITetuProxy.sol";
import "./interfaces/IControllable.sol";
import "./interfaces/IControllableExtended.sol";
import "./interfaces/ITetuProxy.sol";
import "@tetu_io/tetu-contracts/contracts/base/UpgradeableProxy.sol";

/// @title EIP1967 Upgradable proxy implementation.
Expand Down
38 changes: 38 additions & 0 deletions contracts/impl/balancer/StrategyBalancerBoost.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software released under the ISC
* Internet Systems Consortium license is done at your own risk to the fullest
* extent permissible pursuant to applicable law any and all liability as well
* as all warranties, including any fitness for a particular purpose with respect
* to Tetu and/or the underlying software and the use thereof are disclaimed.
*/
pragma solidity 0.8.4;

import "../../strategies/balancer/BalancerBoostStrategyBase.sol";

contract StrategyBalancerBoost is BalancerBoostStrategyBase {

function initialize(
address controller_,
address vault_,
bytes32 poolId_,
address gauge_,
uint _bbRatio,
address depositToken_,
address gaugeDepositor_
) external initializer {
initializeStrategy(
controller_,
vault_,
poolId_,
gauge_,
_bbRatio,
depositToken_,
gaugeDepositor_
);
}

}
40 changes: 40 additions & 0 deletions contracts/impl/balancer/StrategyBalancerBoostBPT.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software released under the ISC
* Internet Systems Consortium license is done at your own risk to the fullest
* extent permissible pursuant to applicable law any and all liability as well
* as all warranties, including any fitness for a particular purpose with respect
* to Tetu and/or the underlying software and the use thereof are disclaimed.
*/
pragma solidity 0.8.4;

import "../../strategies/balancer/BalancerBoostBPTStrategyBase.sol";

contract StrategyBalancerBoostBPT is BalancerBoostBPTStrategyBase {

function initialize(
address controller_,
address vault_,
bytes32 poolId_,
address gauge_,
uint _bbRatio,
address depositToken_,
bytes32 depositBPTPoolId_,
address gaugeDepositor_
) external initializer {
initializeStrategy(
controller_,
vault_,
poolId_,
gauge_,
_bbRatio,
depositToken_,
depositBPTPoolId_,
gaugeDepositor_
);
}

}
34 changes: 34 additions & 0 deletions contracts/impl/balancer/StrategyBalancerBoostTetuUsdc.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software released under the ISC
* Internet Systems Consortium license is done at your own risk to the fullest
* extent permissible pursuant to applicable law any and all liability as well
* as all warranties, including any fitness for a particular purpose with respect
* to Tetu and/or the underlying software and the use thereof are disclaimed.
*/
pragma solidity 0.8.4;

import "../../strategies/balancer/BalancerBoostTetuUsdcStrategyBase.sol";

contract StrategyBalancerBoostTetuUsdc is BalancerBoostTetuUsdcStrategyBase {

function initialize(
address controller_,
address vault_,
address rewardsRecipient_,
address bribeReceiver_,
address gaugeDepositor_
) external initializer {
initializeStrategy(
controller_,
vault_,
rewardsRecipient_,
bribeReceiver_,
gaugeDepositor_
);
}

}
30 changes: 30 additions & 0 deletions contracts/impl/tangible/StrategyCaviarStaking.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software released under the ISC
* Internet Systems Consortium license is done at your own risk to the fullest
* extent permissible pursuant to applicable law any and all liability as well
* as all warranties, including any fitness for a particular purpose with respect
* to Tetu and/or the underlying software and the use thereof are disclaimed.
*/
pragma solidity 0.8.4;

import "../../strategies/tangible/CaviarStakingStrategyBase.sol";


contract StrategyCaviarStaking is CaviarStakingStrategyBase {

function initialize(
address controller_,
address vault_,
uint buybackRatio_
) external initializer {
initializeStrategy(
controller_,
vault_,
buybackRatio_
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
pragma solidity 0.8.4;

import "../../strategies/0vix/ZerovixStrategyBase.sol";
import "../../strategies/zerovix/ZerovixStrategyBase.sol";

contract ZerovixStrategy is ZerovixStrategyBase {
function initialize(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
pragma solidity 0.8.4;

import "../../strategies/0vix/ZerovixstMaticStrategyBase.sol";
import "../../strategies/zerovix/ZerovixstMaticStrategyBase.sol";

contract ZerovixstMaticStrategy is ZerovixstMaticStrategyBase {
function initialize(
Expand Down
File renamed without changes.
41 changes: 41 additions & 0 deletions contracts/interfaces/IBribeDistribution.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: ISC
/**
* By using this software, you understand, acknowledge and accept that Tetu
* and/or the underlying software are provided “as is” and “as available”
* basis and without warranties or representations of any kind either expressed
* or implied. Any use of this open source software released under the ISC
* Internet Systems Consortium license is done at your own risk to the fullest
* extent permissible pursuant to applicable law any and all liability as well
* as all warranties, including any fitness for a particular purpose with respect
* to Tetu and/or the underlying software and the use thereof are disclaimed.
*/

pragma solidity 0.8.4;

interface IBribeDistribution {
function VERSION() external view returns (string memory);

function acceptOwnership() external;

function autoNotify() external;

function bribe() external view returns (address);

function manualNotify(uint256 amount, bool fresh) external;

function offerOwnership(address newOwner) external;

function operator() external view returns (address);

function owner() external view returns (address);

function pendingOwner() external view returns (address);

function round() external view returns (uint256);

function setOperator(address operator_) external;

function token() external view returns (address);

function vault() external view returns (address);
}
File renamed without changes.
22 changes: 22 additions & 0 deletions contracts/interfaces/ISwapper.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.4;

interface ISwapper {

function swap(
address pool,
address tokenIn,
address tokenOut,
address recipient,
uint priceImpactTolerance
) external;

function getPrice(
address pool,
address tokenIn,
address tokenOut,
uint amount
) external view returns (uint);

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ pragma solidity 0.8.4;
interface ITetuLiquidatorController {
function governance() external view returns (address);
function isOperator(address _adr) external view returns (bool);
function changeOperatorStatus(address operator, bool status) external;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 17 additions & 6 deletions contracts/strategies/UniversalLendStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ abstract contract UniversalLendStrategy is ProxyStrategyBase {
/// Constants and variables
/// ******************************************************
uint private constant _DUST = 10_000;
address private constant _PERF_FEE_TREASURY = 0x9Cc199D4353b5FB3e6C8EEBC99f5139e0d8eA06b;

uint internal localBalance;
uint public lastHw;
bool public isProfitSharingDisabled;

/// ******************************************************
/// Initialization
Expand All @@ -45,6 +47,7 @@ abstract contract UniversalLendStrategy is ProxyStrategyBase {
__rewardTokens,
buybackRatio_
);
isProfitSharingDisabled = true;
}

// *******************************************************
Expand All @@ -60,6 +63,10 @@ abstract contract UniversalLendStrategy is ProxyStrategyBase {
}
}

function setProfitSharingDisabled(bool value) external restricted {
isProfitSharingDisabled = value;
}

/// ******************************************************
/// Do hard work
/// ******************************************************
Expand Down Expand Up @@ -152,12 +159,16 @@ abstract contract UniversalLendStrategy is ProxyStrategyBase {
uint toCompound = amount - toBuyBacks;

if (toBuyBacks != 0) {
if (silent) {
try IFeeRewardForwarder(forwarder).distribute(toBuyBacks, rt, targetVault) returns (uint r) {
targetTokenEarned += r;
} catch {}
if (isProfitSharingDisabled) {
IERC20(rt).safeTransfer(_PERF_FEE_TREASURY, toBuyBacks);
} else {
targetTokenEarned += IFeeRewardForwarder(forwarder).distribute(toBuyBacks, rt, targetVault);
if (silent) {
try IFeeRewardForwarder(forwarder).distribute(toBuyBacks, rt, targetVault) returns (uint r) {
targetTokenEarned += r;
} catch {}
} else {
targetTokenEarned += IFeeRewardForwarder(forwarder).distribute(toBuyBacks, rt, targetVault);
}
}
}

Expand Down Expand Up @@ -259,5 +270,5 @@ abstract contract UniversalLendStrategy is ProxyStrategyBase {
}

//slither-disable-next-line unused-state
uint256[48] private ______gap;
uint256[47] private ______gap;
}
2 changes: 1 addition & 1 deletion contracts/strategies/aave/Aave2StrategyBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract contract Aave2StrategyBase is UniversalLendStrategy {

/// @notice Version of the contract
/// @dev Should be incremented when contract changed
string public constant VERSION = "1.0.3";
string public constant VERSION = "1.0.4";

IStrategy.Platform public constant override platform = IStrategy.Platform.AAVE_LEND;
/// @notice Strategy type for statistical purposes
Expand Down
2 changes: 1 addition & 1 deletion contracts/strategies/aave/Aave3StrategyBaseV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract contract Aave3StrategyBaseV2 is UniversalLendStrategy {

/// @notice Version of the contract
/// @dev Should be incremented when contract changed
string public constant VERSION = "1.0.3";
string public constant VERSION = "1.0.4";

IStrategy.Platform public constant override platform = IStrategy.Platform.AAVE_LEND; // same as for AAVEv2

Expand Down
Loading
Loading