Integrating Badger Sett Vaults into Enzyme
An adapter for Enzyme to enable Enzyme Vault Managers to deposit capital into the Badger Sett Vaults
Problem Statement
This project enables Enzyme vault managers to deposit funds into the Badger Sett Vaults.An Enzyme vault manager is able to deposit the funds that they are managing into Badger Sett Vaults. They can also withdraw the deposited funds together with any earnings.The solution also has a price feed in order to calculate the values of the current deposited funds (the value of the shares) in the Badger Sett Vaults.This project would not make sense without the context of the Enzyme protocol. Therefore my project is done on top of a fork of the Enzyme Protocol.
Solution
I created an Enzyme adapter, a price feed, and a Badger Sett Vault wrapper contract to solve this.The one special thing about the solution is the wrapping of the Badger Sett Vaults. This was required due to Badger Sett Vault shares not being transferable in the same transaction as depositing into the vault. In order to transfer the shares, we have to wait for the next block. To mitigate this I created the wrapped Badger Sett Vault Shares that are transferable and are minted and burned 1:1 with the underlying vault. For instance, for the Badger Sett Vault Badger bBADGER shares are returned when depositing, then wbBADGER tokens are minted in the wrapper and sent to the Enzyme vault. When redeeming the wbBAGER tokens are burned and the same amount as returned wbBADGER tokens, bBADGER tokens are redeemed from the Badger Sett Vault and the returned BADGER tokens are transferred to the Enzyme Vault.I also created deployment scripts and some tests.The easiest way to view my work: https://github.com/enzymefinance/protocol/compare/current...sogasg:current
Hackathon
HackMoney 2021
2021
Contributors
- travs
1439 contributions
- GauthamN
795 contributions
- schmidsi
517 contributions
- SeanJCasey
445 contributions
- retotrinkler
296 contributions
- jennazenk
195 contributions
- fubhy
193 contributions
- luongnt95
147 contributions
- iherger
84 contributions
- gempi
39 contributions
- buendiadas
37 contributions
- asgeir-s
17 contributions
- john-0x
9 contributions
- ahmedkareem999
9 contributions
- github-actions[bot]
6 contributions
- gabrocheleau
5 contributions
- conor10
4 contributions
- makoto
4 contributions
- emilianobonassi
3 contributions
- erin-koen
3 contributions
- ChrisPaprocki
2 contributions
- clesaege
1 contributions
- marciok
1 contributions
- nud3l
1 contributions