Docs
Reference
Contract documentation
tokenvault
BridgedERC20

BridgedERC20

An upgradeable ERC20 contract that represents tokens bridged from another chain.

srcToken

address srcToken

srcChainId

uint256 srcChainId

BRIDGED_TOKEN_CANNOT_RECEIVE

error BRIDGED_TOKEN_CANNOT_RECEIVE()

BRIDGED_TOKEN_INVALID_PARAMS

error BRIDGED_TOKEN_INVALID_PARAMS()

init

function init(address _addressManager, address _srcToken, uint256 _srcChainId, uint8 _decimals, string _symbol, string _name) external

Initializes the contract.

Different BridgedERC20 Contract is deployed per unique _srcToken (e.g., one for USDC, one for USDT, etc.).

Parameters

NameTypeDescription
_addressManageraddressThe address manager.
_srcTokenaddressThe source token address.
_srcChainIduint256The source chain ID.
_decimalsuint8The number of decimal places of the source token.
_symbolstringThe symbol of the token.
_namestringThe name of the token.

mint

function mint(address account, uint256 amount) public

Mints tokens to an account.

Only an ERC20Vault can call this function.

Parameters

NameTypeDescription
accountaddressThe account to mint tokens to.
amountuint256The amount of tokens to mint.

burn

function burn(address account, uint256 amount) public

Burns tokens from an account.

Only an ERC20Vault can call this function.

Parameters

NameTypeDescription
accountaddressThe account to burn tokens from.
amountuint256The amount of tokens to burn.

transfer

function transfer(address to, uint256 amount) public returns (bool)

Transfers tokens from the caller to another account.

Any address can call this. Caller must have at least 'amount' to call this.

Parameters

NameTypeDescription
toaddressThe account to transfer tokens to.
amountuint256The amount of tokens to transfer.

transferFrom

function transferFrom(address from, address to, uint256 amount) public returns (bool)

Transfers tokens from one account to another account.

Any address can call this. Caller must have allowance of at least 'amount' for 'from's tokens.

Parameters

NameTypeDescription
fromaddressThe account to transfer tokens from.
toaddressThe account to transfer tokens to.
amountuint256The amount of tokens to transfer.

name

function name() public view returns (string)

Gets the name of the token.

Return Values

NameTypeDescription
[0]stringThe name of the token with the source chain ID appended.

decimals

function decimals() public view returns (uint8)

Gets the number of decimal places of the token.

Return Values

NameTypeDescription
[0]uint8The number of decimal places of the token.

canonical

function canonical() public view returns (address, uint256)

Gets the canonical token's address and chain ID.

Return Values

NameTypeDescription
[0]addressThe canonical token's address and chain ID.
[1]uint256

ProxiedBridgedERC20

Proxied version of the parent contract.