Docs
Reference
Contract documentation
bridge
BridgedERC20

BridgedERC20

This contract is an upgradeable ERC20 contract that represents tokens bridged from another chain.

srcToken

address srcToken

srcChainId

uint256 srcChainId

BridgeMint

event BridgeMint(address account, uint256 amount)

BridgeBurn

event BridgeBurn(address account, uint256 amount)

init

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

Initializes the contract.

Different BridgedERC20 Contract to be deployed per unique _srcToken i.e. 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.

bridgeMintTo

function bridgeMintTo(address account, uint256 amount) public

Mints tokens to an account.

Only a TokenVault can call this function.

Parameters

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

bridgeBurnFrom

function bridgeBurnFrom(address account, uint256 amount) public

Burns tokens from an account.

Only a TokenVault 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.

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.

source

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

Gets the source token address and the source chain ID.

Return Values

NameTypeDescription
[0]addressThe source token address and the source chain ID.
[1]uint256

title: ProxiedBridgedERC20

ProxiedBridgedERC20