Contract: Burn Canonical Token(PeggedTokenBridge)
Contract: Burn pegged tokens and unlock original token from cBridge
Implementation
Burning is the reverse of the minting process. Canonical tokens can be burned via the PeggedTokenBridge contract on the source chain, which will trigger the release of the original tokens from the OriginalTokenVault contract on the destination chain. For advanced users, the burn function can be called from smart contracts.
Here is the abi for the canonical / pegged token bridge contracts: https://github.com/celer-network/cBridge-typescript-client/tree/main/contract/abi/pegged/PeggedTokenBridge.sol, https://github.com/celer-network/cBridge-typescript-client/tree/main/contract/abi/pegged/OriginalTokenVault.sol
Request Parameters
token
String
Pegged token address on the pegged chain
amount
UInt256
Burn amount
withdraw_account
String
User's wallet address
nonce
UInt64
Current timestamp
If withdraw_account
is a smart contract and the token you are sending is a wrapped native gas token on the destination chain, make sure the contract can receive native gas token by implementing fallback
/ receive
functions.
TransferId Generation
When you submit on-chain burn transaction, you can also generate a transfer id for future reference. For example, it is used for getTransferStatus. It should be the same as transferId inside on-chain transaction log.
Please be aware that transfer id generation parameters are different between mint flow and burn flow.
Response
Since this function is an Ethereum on-chain transaction, the response is the corresponding transaction response.
Last updated