BridgedToken
ERC20 token created when a native token is bridged to a target chain.
bridge
address bridge
_decimals
uint8 _decimals
OnlyBridge
error OnlyBridge(address bridgeAddress)
constructor
constructor() public
Disable constructor for safety
initialize
function initialize(string _tokenName, string _tokenSymbol, uint8 _tokenDecimals) external
onlyBridge
modifier onlyBridge()
Ensures call come from the bridge.
mint
function mint(address _recipient, uint256 _amount) external
Called by the bridge to mint tokens during a bridge transaction.
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | The address to receive the minted tokens. |
_amount | uint256 | The amount of tokens to mint. |
burn
function burn(address _account, uint256 _amount) external
Called by the bridge to burn tokens during a bridge transaction. User should first have allowed the bridge to spend tokens on their behalf.
Parameters
Name | Type | Description |
---|---|---|
_account | address | The account from which tokens will be burned. |
_amount | uint256 | The amount of tokens to burn. |
decimals
function decimals() public view returns (uint8)
Overrides ERC20 default function to support tokens with different decimals.
Return Values
Name | Type | Description |
---|---|---|
[0] | uint8 | The number of decimal. |