Dagora ERC20 Wizard

Below is the technical documentation for the Dagora ERC20 wizard contract.

DagoraERC20

a template for creating new ERC20 contracts.

isPaused

bool isPaused

Boolean to determine if the contract is paused.

default value is false, contract is not paused on deployment.

maxSupply

uint256 maxSupply

The maximum number of tokens that can be minted.

constructor

constructor(string _name, string _symbol, address _newOwner, uint256 initialSupply, uint256 _maxSupply) public

The Contract that will be used to check if the user is a member.

Parameters

NameTypeDescription

_name

string

The name of the token.

_symbol

string

The symbol of the token.

_newOwner

address

The address that will be the owner of the contract.

initialSupply

uint256

The initial supply of the token to be minted to the _newOwner.

_maxSupply

uint256

The maximum supply of the token.

mint

function mint(address to, uint256 amount) external

OnlyOwner function to mint tokens.

Parameters

NameTypeDescription

to

address

The address that will receive the tokens.

amount

uint256

The amount of tokens to be minted.

burn

function burn(address from, uint256 amount) external

OnlyOwner function to burn tokens.

Parameters

NameTypeDescription

from

address

The address that will have the tokens burned.

amount

uint256

The amount of tokens to be burned.

togglePaused

function togglePaused() external

OnlyOwner function to toggle the paused state of the contract.

_beforeTokenTransfer

function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual

check before every token transfer if the contract is paused.

_This function overrides the beforeTokenTransfer function from the ERC20 contract, and will fail if the contract is paused.

Parameters

NameTypeDescription

from

address

The address that will send the tokens.

to

address

The address that will receive the tokens.

amount

uint256

The amount of tokens to be transferred.

typeOf

function typeOf() public pure returns (string)

Function to get the type of the contract.

Return Values

NameTypeDescription

[0]

string

string The type of the contract.

version

function version() public pure returns (string)

Function to get the version of the contract.

Return Values

NameTypeDescription

[0]

string

string The version of the contract.

Last updated

Logo