Skip to content

Solidity API

SpanningERC20PresetMinterPauserUpgradeable

_{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

__SpanningERC20PresetMinterPauser_init

function __SpanningERC20PresetMinterPauser_init(string name, string symbol, address delegate) internal

Creates the instance and assigns required values.

NameTypeDescription
namestring- Desired name for the token
symbolstring- Desired symbol for the token
delegateaddress- Legacy (local) address for the Spanning Delegate

__SpanningERC20PresetMinterPauser_init_unchained

function __SpanningERC20PresetMinterPauser_init_unchained(string name, string symbol, address delegate) internal

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

__gap

uint256[50] __gap

This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps We use a standard of 50 storage slots. The amount referenced below is based on: 50 - numberOfClassMemberVariables.