-
Notifications
You must be signed in to change notification settings - Fork 2
Yuki - SetToken can't be unlocked early. #38
Comments
The risk here is a stale Debating if we should include this or not. |
Should raiseTargetPercentage be part of the check for unlocking early? I'm thinking it doesn't since that's only used when needing to |
since we can't set the raiseAssetTarget to zero, this is a valid issue. will fix |
Yea I agree with the assessment and looks like the fix is more or less clear. |
The remediation for this issue is open for review here IndexCoop/index-protocol#25 The changes are to
|
Fix looks good. Manger can now set |
Yuki
high
SetToken can't be unlocked early.
Summary
SetToken can't be unlocked early
Vulnerability Detail
The function unlock() is used to unlock the setToken after rebalancing, as how it is right now there are two ways to unlock the setToken.
The main problem occurs as the value of raiseTargetPercentage isn't reset after rebalancing. The other thing is that the function setRaiseTargetPercentage can't be used to fix this issue as it doesn't allow giving raiseTargetPercentage a zero value.
A setToken can use the AuctionModule to rebalance multiple times, duo to the fact that raiseTargetPercentage value isn't reset after every rebalancing. Once changed with the help of the function setRaiseTargetPercentage this value will only be non zero for every next rebalancing. A setToken can be unlocked early only if all other requirements are met and the raiseTargetPercentage equals zero.
This problem prevents for a setToken to be unlocked early on the next rebalances, once the value of the variable raiseTargetPercentage is set to non zero.
On every rebalance a manager should be able to keep the value of raiseTargetPercentage to zero (so the setToken can be unlocked early), or increase it at any time with the function setRaiseTargetPercentage.
Impact
Once the value of raiseTargetPercentage is set to non zero, every next rebalancing of the setToken won't be eligible for unlocking early. As the value of raiseTargetPercentage isn't reset after every rebalance and neither the manager can set it back to zero with the function setRaiseTargetPercentage().
Code Snippet
https://github.com/sherlock-audit/2023-06-Index/blob/main/index-protocol/contracts/protocol/modules/v1/AuctionRebalanceModuleV1.sol#L389
Tool used
Manual Review
Recommendation
Recommend to reset the value raiseTargetPercentage after every rebalancing.
The text was updated successfully, but these errors were encountered: