Skip to content

blue-searcher/wrapper-factory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wrapped-factory

UI: wrapper-factory.vercel.app

Factory contract to deploy wrapped tokens.

Factory

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.

Wrapper tokens

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.

About

Factory contract to deploy wrapper tokens.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published