Skip to content

Solidity API

SpanningERC20PresetMinterPauser

_{SpanningERC20} token, including:

  • ability for holders to burn (destroy) their tokens
  • a minter role that allows for token minting (creation)
  • a pauser role that allows to stop all token transfers

This contract uses {SpanningAccessControl} to lock permissioned functions using the different roles - head to its documentation for details.

The account that deploys the contract will be granted the minter and pauser roles, as well as the default admin role, which will let it grant both minter and pauser roles to other accounts.

Deprecated in favor of https://wizard.openzeppelin.com/[Contracts Wizard]._

MINTER_ROLE

bytes32 MINTER_ROLE

PAUSER_ROLE

bytes32 PAUSER_ROLE

constructor

constructor(string name, string symbol, address delegate) public

_Grants DEFAULT_ADMIN_ROLE, MINTER_ROLE and PAUSER_ROLE to the account that deploys the contract.

See {SpanningERC20-constructor}._

mint

function mint(address receiverAddress, uint256 amount) public virtual

_Creates amount new tokens for to.

See {ERC20-_mint}.

Requirements:

  • the caller must have the MINTER_ROLE._

mint

function mint(bytes32 receiverAddress, uint256 amount) public virtual

pause

function pause() public virtual

_Pauses all token transfers.

See {ERC20Pausable} and {Pausable-_pause}.

Requirements:

  • the caller must have the PAUSER_ROLE._

unpause

function unpause() public virtual

_Unpauses all token transfers.

See {ERC20Pausable} and {Pausable-_unpause}.

Requirements:

  • the caller must have the PAUSER_ROLE._

_beforeTokenTransfer

function _beforeTokenTransfer(bytes32 senderAddress, bytes32 receiverAddress, uint256 amount) internal virtual