WrappedAsset

Contract that represent the asset from the other chain

ERC20 token that is used to represent the native token value on the other chains.

Modifiers:

onlyRole(role)
onlyMinter()

Events:

Transfer(from, to, value)
Approval(owner, spender, value)
RoleAdminChanged(role, previousAdminRole, newAdminRole)
RoleGranted(role, account, sender)
RoleRevoked(role, account, sender)

Functions:

totalSupply()
balanceOf(account)
transfer(recipient, amount)
allowance(owner, spender)
approve(spener, amount)
transferFrom(sender, recipient, amount)
supportsInterface(interfaceId)
hasRole(role, account)
getRoleAdmin(role)
grantRole(role, account)
revokeRole(role, account)
renounceRole(role, account)
mint(receiver, amount)
burn(amount)
permit(owner, spender, value, deadline, v, r, s)
_setupRole(role, account)
_setRoleAdmin(role, adminRole)
_checkRole(role, account)

Events

Transfer

event Transfer(address indexed from, address indexed to, uint256 value);

Emits once the tokens are transferred from one account to another.

Approval

event Approval(address indexed owner, address indexed spender, uint256 value);

Emits once the tokens are approved to be transferred by another account.

Read-Only Functions

MINTER_ROLE

function MINTER_ROLE() external view returns (bytes32);

Returns minter's role identifier.

DOMAIN_SEPARATOR

function DOMAIN_SEPARATOR() external view returns (bytes32);

Returns domain separator.

PERMIT_TYPEHASH

function PERMIT_TYPEHASH() external view returns (bytes32);

Returns permit type hash.

name

function name() external view returns (string memory);

Returns the name of the token.

symbol

function symbol() external view returns (string memory);

Returns the symbol of the token, a shorter version of the name.

decimals

function decimals() external view returns (uint8);

Returns the number of decimals used to get its user representation.

totalSupply

function totalSupply() external view returns (uint256);

Returns the amount of tokens in existence.

balanceOf

function balanceOf(address _account) external view returns (uint256);

Returns the amount of tokens owned by the account.

allowance

function allowance(address _owner, address _spender)
external view returns (uint256);

Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of the owner. This is zero by default.

nonces

function nonces(address _owner) external view returns (uint256);

Returns user's nonce.

Parameter

Type

Description

_owner

address

Owner's address

Modifiers

onlyMinter

modifier onlyMinter();

Throws if called by any account other than the minter.

State-Changing Functions

transfer

function transfer(address _recipient, uint256 _amount)
external
returns (bool);

Moves the tokens from the caller's account to the recepient.

Parameter

Type

Description

_recipient

address

Receiver address

_amount

uint256

Amount of token's to be transferred

transferFrom

function transferFrom(address _sender, address _recipient, uint256 _amount)
external
returns (bool);

Moves the tokens from the sender account to the recipient.

Parameter

Type

Description

_sender

address

Sender address

_recipient

address

Receiver address

_amount

uint256

Amount of token's to be transferred

approve

function approve(address _spender, uint256 _amount)
external;

Allows the spender to spend up to the amount of the caller's tokens.

Parameter

Type

Description

_spender

address

Approved spender address

_amount

uint256

Amount of token's to be minted

mint

function mint(address _receiver, uint256 _amount)
external;

Issues new tokens.

Parameter

Type

Description

_receiver

address

Receiver address

_amount

uint256

Amount of token's to be minted

burn

function burn(uint256 _amount) external;

Remove tokens from supply.

Parameter

Type

Description

_amount

uint256

Amount of token's to be burnt

permit

function permit(
address _owner,
address _spender,
uint256 _value,
uint256 _deadline,
uint8 _v,
bytes32 _r,
bytes32 _s
) external;

A function permit extending ERC-20 which allows for approvals to be made via secp256k1 signatures.

Type

Description

_owner

address

Owner address

_spender

address

Approved spender address

_value

uint256

Amount of token's to be approved

_deadline

uint256

Time until the signature is valid

_v

uint8

Version byte

_r

bytes32

Signature component

_s

bytes32

Signature component