Wrapped Bitcorn ($WBTCN) Implementation
GitHub Repoβ
The Wrapped Bitcorn ($WBTCN) implementation is available on the following repo.
Overviewβ
- Minimalist and modern Wrapped Bitcorn implementation adapted from Wrapped Ether.
- Inherits:
ERC20
- Inspired by Solmate WETH and WETH9.
Functionsβ
depositβ
Deposit native BTCN and mint WBTCN.
function deposit() public payable virtual;
Mints WBTCN tokens equivalent to the value of native BTCN sent to the contract.
withdrawβ
Burn WBTCN tokens and withdraw native BTCN.
function withdraw(uint256 amount) public virtual;
Parametersβ
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of WBTCN tokens to burn. |
receiveβ
Automatically deposits native BTCN sent directly to the contract address.
receive() external payable virtual;
Eventsβ
Depositβ
event Deposit(address indexed from, uint256 amount);
Withdrawalβ
event Withdrawal(address indexed to, uint256 amount);