yieldprotocol/mentorship2022

Flash Loan Yield Bearing Vault

Opened this issue · 0 comments

Exercise name:        Flash Loan Yield Bearing Vault
Assignment #:         9
Track:                Smart contracts
Testing framework:    Foundry
Deployment framework: Foundry (forge create)
Node provider:        
Target network:       

Assignment summary

Refactor the Fractional Wrapper from assignment #4 into a Proportional Ownership Flash Loan Server, conforming to specifications ERC3156 and ERC4626.

First refactor the Fractional Wrapper into an ERC3156 Flash Loan Server. The underlying is the token available for flash lending. The fee is a constant 0.1%.

Then make the contract a proportional ownership contract. When users deposit underlying, they get a proportion of wrapper tokens which has the same relation to the wrapper contract total supply as their deposit has to the wrapper contract underlying holdings:
wrapperMinted / wrapperSupply == underlyingDeposited / underlyingInWrapper

Finally, make the contract conform to ERC4626 so that it can be automatically integrated to yield aggregators such as Yearn V3.

Additional Details

Peripheral Goals