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
SmartTreasuryBootstrap and FeeCollector rev 2 #5
Comments
I think we should also directly add another whitelisted wallet for the |
@bugduino What is the address for the rebalancer? I will add it as a white-listed address in the migration script |
Will post it in the forum so it's 'recorded' there |
I've address the points made for the
FeeCollector:
I've also added the rebalancer to the feeCollector configuration migration as discussed https://gov.idle.finance/t/update-smart-treasury-propsal-code-review/179/23 Closing this ticket for now :) |
great work @asafsilman ! When we update the beneficiaries with the new code, I think it works correctly for This one should work already, but it would be better to have all of them in the same way: Here we could move the call from line 251 to 246: And here from 269 to 266: |
unless we can set a more precise number, I would set the |
In |
Changes added in @ 9feed2c |
Please close this ticket after your review :) |
that's done, thank you!
cool as well! 👍
For this part I would avoid having a new function with almost the same code.
What do you think @asafsilman |
I think that This way the public method will work as intended, and the internal method can be used in the case of If I added a boolean to the public function is exposes the risk for the incorrect fee weights to be honoured. |
added in 730847a |
Removed convoluted code in d2b3064 |
I made a new review after changes with @gravityblast this are our new comments:
SmartTreasuryBootstrap:
You should be able to remove this line https://github.com/AsafSilman/idle-smart-treasury/blob/main/contracts/SmartTreasuryBootstrap.sol#L256 safely because it's already checked in the constructor and cannot be changed.
To make this more resilient in case of emergency
https://github.com/AsafSilman/idle-smart-treasury/blob/957ec663ba1ea51096120cdab67428c765d764eb/contracts/SmartTreasuryBootstrap.sol#L279-L284
we should also add a way to recover funds in case any of the previous methods (
swap
,initialize
orbootstrap
) fail for any reason so whenrenounced
has not been set. So we propose to remove theonlyOwner
modifier and replace therequire
statement with this onerequire((msg.sender == owner() && renounced == true) || msg.sender == timelock, "Only admin");
.FeeCollector:
Generally speaking we should consider that IDLE and WETH can be present in this contract at anytime (maybe for future fees)
so something may needs to be slightly changed.
This https://github.com/AsafSilman/idle-smart-treasury/blob/main/contracts/FeeCollector.sol#L146 should be set to 1 as in the SmartTreasuryBootstrap.
This comment https://github.com/AsafSilman/idle-smart-treasury/blob/957ec663ba1ea51096120cdab67428c765d764eb/contracts/FeeCollector.sol#L154 should probably be something like
// deposit all swapped WETH into balancer pool + the already present weth balance
.Here https://github.com/AsafSilman/idle-smart-treasury/blob/957ec663ba1ea51096120cdab67428c765d764eb/contracts/FeeCollector.sol#L168-L169 you should check that
feeBalances[0] > 0
to be sure to deposit something.When we set a new beneficiary here https://github.com/AsafSilman/idle-smart-treasury/blob/957ec663ba1ea51096120cdab67428c765d764eb/contracts/FeeCollector.sol#L213 the old allocations are not respected. A
deposit()
call should be made before and thesetSplitAllocation
should get a bool param to skip the deposit when called from here. The same problem is true for also forremoveBeneficiaryAt
andreplaceBeneficiaryAt
.Here
https://github.com/AsafSilman/idle-smart-treasury/blob/957ec663ba1ea51096120cdab67428c765d764eb/contracts/FeeCollector.sol#L376-L391
you are potentially withdrawing more IDLE and WETH if those are already present in the contract so before the
exitPool
you should loop ontreasuryTokens
and save IDLE and WETH balances, then doexitPool
and after that loop again ontreasuryTokens
and calc diff generated by exiting and transfer those tokens directly.As a side note would be great to have
uint256
instead ofuint
across all contracts and some of the unused comments removed (like this one or this)The text was updated successfully, but these errors were encountered: