Skip to content

Commit

Permalink
Hexens - Audit: Issue 2-5: Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
riordant committed Jan 30, 2024
1 parent b9a298f commit 73c85a8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion script/mainnet/StrategiesInitial.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -728,8 +728,13 @@ contract StrategiesInitial {
constantsJson().getInt256(string.concat(".strategies.", CONVEX_STFRXETH_KEY, ".negativeYieldLimit"))
);

bool extraRewards =
constantsJson().getBool(string.concat(".strategies.", CONVEX_STFRXETH_KEY, ".extraRewards"));

proxy = payable(_newProxy(address(implementation), contracts.proxyAdmin));
ConvexStFrxEthStrategy(proxy).initialize(CONVEX_STFRXETH_KEY, positiveYieldLimit, negativeYieldLimit);
ConvexStFrxEthStrategy(proxy).initialize(
CONVEX_STFRXETH_KEY, positiveYieldLimit, negativeYieldLimit, extraRewards
);
}

if (register) {
Expand Down
13 changes: 8 additions & 5 deletions src/strategies/convex/ConvexStFrxEthStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ contract ConvexStFrxEthStrategy is StrategyManualYieldVerifier, Strategy, Curve2
ISwapper private immutable _swapper;

uint96 private constant _pid = 161;
bool private constant _extraRewards = false;
IBooster private constant _booster = IBooster(0xF403C135812408BFbE8713b5A23a04b3D48AAE31);
address private constant _pool = 0x4d9f9D15101EEC665F77210cB999639f760F831E;
IBaseRewardPool private constant _crvRewards = IBaseRewardPool(0xC3D0B8170E105d6476fE407934492930CAc3BDAC);
Expand All @@ -116,6 +115,7 @@ contract ConvexStFrxEthStrategy is StrategyManualYieldVerifier, Strategy, Curve2

// curve _tokens
address[] private _tokens;
bool private _extraRewards;

constructor(
IAssetGroupRegistry assetGroupRegistry_,
Expand All @@ -126,10 +126,12 @@ contract ConvexStFrxEthStrategy is StrategyManualYieldVerifier, Strategy, Curve2
_swapper = swapper_;
}

function initialize(string memory strategyName_, int128 positiveYieldLimit_, int128 negativeYieldLimit_)
external
initializer
{
function initialize(
string memory strategyName_,
int128 positiveYieldLimit_,
int128 negativeYieldLimit_,
bool extraRewards_
) external initializer {
__Strategy_init(strategyName_, NULL_ASSET_GROUP_ID);

address[] memory assetGroupTokens = _assetGroupRegistry.listAssetGroup(assetGroupId());
Expand All @@ -140,6 +142,7 @@ contract ConvexStFrxEthStrategy is StrategyManualYieldVerifier, Strategy, Curve2

_setPositiveYieldLimit(positiveYieldLimit_);
_setNegativeYieldLimit(negativeYieldLimit_);
_extraRewards = extraRewards_;

_tokens = new address[](2);
_tokens[0] = _coins(0);
Expand Down
2 changes: 1 addition & 1 deletion test/forked/strategies/ConvexStFrxEthStrategy.unit.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ contract ConvexStFrxEthStrategyTest is TestFixture, ForkTestFixture {
);

convexStrategy.initialize(
"convex-stfrxeth-strategy", int128(YIELD_FULL_PERCENT_INT), int128(-YIELD_FULL_PERCENT_INT)
"convex-stfrxeth-strategy", int128(YIELD_FULL_PERCENT_INT), int128(-YIELD_FULL_PERCENT_INT), false
);

vm.prank(address(strategyRegistry));
Expand Down

0 comments on commit 73c85a8

Please sign in to comment.