The SimpleTokenMediator is a GlacisClient whose purpose is to transport xERC20 tokens across chains. By using the SimpleTokenMediator for xERC20, you can easily add additional bridges through a single interface & define advanced security rules based off of token payloads.
Similar to the GlacisClient, routes and quorum must be configured properly to build your firewall. You can check the GlacisClient page for more information.
The SimpleTokenMediator must also know which token it is sending across chains, which can be set with the setXERC20 function.
Parameter Name
Parameter Description
address _xERC20Token
The address of your xERC20 that this SimpleTokenMediator should bridge
The xERC20 that you control ought to also give this newly deployed SimpleTokenMediator burn & mint abilities.
The Send Function
Sending a token across chains is similar to sending a token via Glacis client, where the adapaters and fees are still defined.
Parameter Name
Parameter Description
uint256 chainId
The Glacis chain ID of the blockchain that you wish to send a token to
bytes32 to
The address of the destination contract that you are sending a token to
address[]memory adapters
An array of adapters to send the message over, such as an Axelar adapter. Can be an address if you wish to use an adapter that Glacis does not use, otherwise it can be a GMP ID stored as an address
GlacisRouter.CrossChainGas[] memory fees
An array of fees that correspond to the amount provided to each adapter. This is a parallel array to the adapters parameter. Its rules are the same as in the GlacisRouter
address refundAddress
The address to which excess native currency is sent to if an adapter deems that the user overpaid
uint256 tokenAmount
The amount tokens to send to the destination chain
By default, these messages are retriable. All messages return a bytes32 messageID and a uint256 nonce.