ERC20 Wrapper
Opened this issue · 0 comments
Exercise name: ERC20 Wrapper
Assignment #: 3
Track: Smart contracts
Testing framework: Foundry
Deployment framework: Foundry (forge create)
Node provider: Infura
Target network: Arbitrum-Rinkeby
Assignment summary
A Wrapper is a common pattern where a token is issued in place for another. This is commonly done to add functionality to an existing token.
Users can send a pre-specified erc-20 token to a contract that also is an erc-20, and that we will call Wrapper. The Wrapper contract issues an equal number of Wrapper tokens to the sender.
At any point, a holder of Wrapper tokens can burn them to recover their initial deposit.
To complete this you will need two contracts, one of them a ERC20 token that will be thought of as a currency, and another one the ERC20 Wrapper that will store the currency and give Wrapper tokens to the users.
The functions used will be similar to those in the Vault, but you will notice that now we use tokens as a system of record.
Additional Details
None
Stretch Goals
Ether is not an ERC-20 token, while being the native token for Ethereum. This forces all platforms to implement Ether as an edge case. Code a Wrapper that takes Ether as it's currency.