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