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
Name | Type | Description |
---|---|---|
initialAuthority | address | The address to be set as the initial authority. |
mint
Mints amount
tokens to the caller's address.
function mint(uint256 amount) public requiresAuth;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The 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
Name | Type | Description |
---|---|---|
to | address | The address to mint tokens to. |
amount | uint256 | The amount of tokens to mint. |
burn
Burns amount
tokens from the caller's address.
function burn(uint256 amount) public requiresAuth;
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of tokens to burn. |
burnFrom
Burns amount
tokens from a specified address.
function burnFrom(address from, uint256 amount) public requiresAuth;
Parameters
Name | Type | Description |
---|---|---|
from | address | The address to burn tokens from. |
amount | uint256 | The 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);