Files
linea-monorepo/contracts/docs/api/tokenBridge/BridgedToken.md
The Dark Jester adb097aff4 [Chore] Export contract ABI and use solidity-docgen export (#323)
* export contract ABI and use solidity-docgen export

* add docgen dependency

* lint fixing
2024-11-21 06:49:31 -08:00

1.6 KiB

Solidity API

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.