Smart Treasury - Update 1
Hi everyone, it’s been a while since I’ve given an update on the forum, so I thought it was best to summarise the progress for the development of the smart contract over the past week in a forum post.
Over the past week I have been developing the smart contract for the smart treasury, as mentioned in the this post [Grant] - Develop a Smart Treasury, there are two components which are required for the smart treasury.
- The FeeCollector Smart Contract
- The Bootstrapping Smart Contract
A prototype for both of these contracts is now available on the github repository: GitHub Repo. I have also deployed a initial test smart treasury to kovan, which can be inspected here Link. (The swap fee is incorrect though) This initial prototype has some technical differences from the initial design which was suggested in the grant, and I hope to be able to go through the changes in this post.
Smart Contract Updates
Fee Collector
- The Fee Collector only supports up to 15 deposit tokens, to cap gas costs
- The Fee Collector swaps directly into WETH
- The Fee Collector holds the Balancer Smart Pool Token, and can withdraw the token, or the underlying
Bootstrap
- Initial weights no longer 99/1. Instead weights will be determined as ratio of initial IDLE deposit, and FeeTreasury deposit. Weights will still gradually update to 90/10 for the initial bootstrap. (This is over a 3 month period, perhaps this can be reduced?)
- Price oracle for IDLE/WETH value will be set by multisig rather than on-chain. Direct on-chain oracles are unreliable, and vulnerable to manipulation, this change reduces the surface area of attack. The only use for the oracle would be to configure the initial weights of the pool in anycase.
- The owner of the bootstrap contract will be deligated to the idle multisig before governance vote.
- After which the multisig will call
swap()
,initialise()
,bootstrap()
,renounce()
in that order.
- After which the multisig will call
The use of the multisig is mainly a gas saving measure, as the on-chain proposal would likely run out of gas if it were to execute all of these functions from one transaction.
Where to go from here
The initial prototype is ready, but that doesn’t mean its ready for proposal yet, I will be continuing to test the smart contract and writing unit tests and integration tests, and adding better documentation. In addition to this (with some help from @william) I will be testing the proposal to submit on-chain.
Before this happens perhaps a new grant should be created to audit the code before it goes on-chain (as suggested by @Teo in his post IdleGov Biweekly Update – 12/28/2020 [BW2].
We can also go through the process of having $IDLE listed on balancer, so that it will show up on their UI once the pool is deployed. This should also allow the pool to be eligable for $BAL rewards.
I will create a new system diagram in the coming days to illustrate how IDLE, FeeCollector, and SmartTreasury interact, in addition to the deployment steps so the development process is as transparent as can be for the community.
Hope everyone is enjoying their Christmas break, and looking forward to reading your comments .