UI: wrapper-factory.vercel.app
Factory contract to deploy wrapped tokens.
WrapperFactory.deploy() function deploys an ERC20 which can be exchanged at a fixed ratio to the supplied token. The wrapper token balances are handled as shares of deposited token, so it can handle both standard and rebasing ERC20 tokens. The ratio will obviously change over time for rebasing tokens.
Can be used to create WOOFY-style and wstETH-style tokens.
The ratio parameter should be set to 10**18 in order to have a 1:1 exchange rate.
Each wrapper token deployed by the factory contract share the same interface.
State changing functions:
wrap(uint256 _tokenAmount, address _receiver)unwrap(uint256 _wrapperAmount, address _receiver)
View functions:
getWrapAmountOut(uint256 _tokenAmount)getUnwrapAmountOut(uint256 _wrapperAmount)
Inspired by Generalized Wrapper-token Factory post.
Deployed on Goerli Testnet.