DeBridgeToken
ERC20 token that is used as wrapped asset to represent the native token value on the other chains.

Variables

MINTER_ROLE

1
bytes32 public constant MINTER_ROLE;
Copied!
Minter role identifier

PAUSER_ROLE

1
bytes32 public constant PAUSER_ROLE;
Copied!
Pauser role identifier

DOMAIN_SEPARATOR

1
bytes32 public DOMAIN_SEPARATOR;
Copied!
Domain separator as described in EIP-712​

PERMIT_TYPEHASH

1
bytes32 public constant PERMIT_TYPEHASH;
Copied!
Typehash as described in EIP-712. =keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");

nonces

1
mapping(address => uint256) public nonces;
Copied!
Transfers counter

_decimals

1
uint8 internal _decimals;
Copied!
Asset's decimals

Functions

initialize

1
function initialize(
2
string name_,
3
string symbol_,
4
uint8 decimals_,
5
address admin,
6
address[] minters
7
) public
Copied!
Constructor that initializes the most important configurations.

Parameters:

Name
Type
Description
name_
string
Asset's name.
symbol_
string
Asset's symbol.
decimals_
uint8
Asset's decimals.
admin
address
Address to set as asset's admin.
minters
address[]
The accounts allowed to int new tokens.

mint

1
function mint(
2
address _receiver,
3
uint256 _amount
4
) external
Copied!
Issues new tokens.

Parameters:

Name
Type
Description
_receiver
address
Token's receiver.
_amount
uint256
Amount to be minted.

burn

1
function burn(
2
uint256 _amount
3
) external
Copied!
Destroys existing tokens.

Parameters:

Name
Type
Description
_amount
uint256
Amount to be burnt.

permit

1
function permit(
2
address _owner,
3
address _spender,
4
uint256 _value,
5
uint256 _deadline,
6
uint8 _v,
7
bytes32 _r,
8
bytes32 _s
9
) external
Copied!
Approves the spender by signature.

Parameters:

Name
Type
Description
_owner
address
Token's owner.
_spender
address
Account to be approved.
_value
uint256
Amount to be approved.
_deadline
uint256
The permit valid until.
_v
uint8
Signature part.
_r
bytes32
Signature part.
_s
bytes32
Signature part.

decimals

1
function decimals(
2
) public returns (uint8)
Copied!
Asset's decimals

pause

1
function pause(
2
) public
Copied!
Pauses all token transfers. The caller must have the PAUSER_ROLE.

unpause

1
function unpause(
2
) public
Copied!
Unpauses all token transfers. The caller must have the PAUSER_ROLE.

_beforeTokenTransfer

1
function _beforeTokenTransfer(
2
address from,
3
address to,
4
uint256 amount
5
) internal
Copied!