Burn
Last updated
Last updated
To withdraw user's original token on original chain, FE(front-end) needs to do the following things:
Get basic pegged configs through cBridge gateway. The same as general token transfer
Check user's on-chain token allowance for cBridge PeggedTokenBridge contract. If the allowance is not enough for burn, trigger the corresponding on-chain approve flow
Submit on-chain burn request to cBridge PeggedTokenBridge contract on pegged chain
Get transfer status repeatedly to check whether the burn/withdraw is complete.
If bridge_version given by pegged_pair_config is 2, you should submit transaction using abi. Otherwise, use . The parameters of burn function are different since PeggedTokenBridgeV2 supports .
Unlike PeggedTokenBridge, you can burn canonical token on pegged chain where PeggedTokenBridgeV2 is deployed and Celer SGN will mint corresponding tokens on another pegged chain if both pegged chains share the same and the same . In this scenario, the user can skip interaction with OriginalTokenVault and have a better experience for his assets transfer.