Skip to main content

Bitcorn ($BTCN) Implementation

GitHub Repo​

The Bitcorn implementation is available on the following repo.

Overview​

  • Simple, extensible modern ERC20
  • Flexible minting and burning permissions leveraging RolesAuthority paradigm
  • Emergency pausing
  • All governance permissions are permanently burnable
  • Upgradeable via UUPS proxy

Inherits: Initializable, ERC20Upgradeable, ERC20PermitUpgradeable, ERC20PausableUpgradeable, UUPSUpgradeable, AuthNoOwner

Functions​

constructor​

constructor();

initialize​

Initializes the contract with default values and an initial authority.

function initialize(address initialAuthority) public initializer;

Parameters​

NameTypeDescription
initialAuthorityaddressThe address to be set as the initial authority.

mint​

Mints amount tokens to the caller's address.

function mint(uint256 amount) public requiresAuth;

Parameters​

NameTypeDescription
amountuint256The amount of tokens to mint.

mintTo​

Mints amount tokens to address to. Arbitrary address mint rights allow for increased gas efficiency.

function mintTo(address to, uint256 amount) public requiresAuth;

Parameters​

NameTypeDescription
toaddressThe address to mint tokens to.
amountuint256The amount of tokens to mint.

burn​

Burns amount tokens from the caller's address.

function burn(uint256 amount) public requiresAuth;

Parameters​

NameTypeDescription
amountuint256The amount of tokens to burn.

burnFrom​

Burns amount tokens from a specified address.

function burnFrom(address from, uint256 amount) public requiresAuth;

Parameters​

NameTypeDescription
fromaddressThe address to burn tokens from.
amountuint256The amount of tokens to burn.

pause​

Pauses all token transfers.

function pause() public requiresAuth;

unpause​

Unpauses all token transfers.

function unpause() public requiresAuth;

_authorizeUpgrade​

function _authorizeUpgrade(address newImplementation) internal override requiresAuth;

_beforeTokenTransfer​

function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20Upgradeable, ERC20PausableUpgradeable);