Skip to main content

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

NameTypeDescription
amountuint256The 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);