Contract: Mint Canonical Token(OriginalTokenVaultV2)

Lock user's assets into cBridge and mint corresponding token on the destination chain

Implementation

There is no big difference between originalTokenVault and originalTokenVaultV2. However, you should use different parameters to generate transfer id.

originalTokenVaultV2!.deposit(
     pegConfig.config.org_token.token.address, 
     value,
     pegConfig.config.pegged_chain_id,
     address, 
     nonce,
)  

Request Parameters

Name
Type
Description

token

String

Token's address

amount

UInt256

locked token amount

mint_chain_id

UInt64

destination chainId to mint tokens

nonce

UInt64

Current timestamp

mint_account

String

User's wallet address

circle-exclamation

TransferId Generation

When you submit on-chain deposit 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.

Response

Since this function is an Ethereum on-chain transaction, the response is the corresponding transaction response.

Last updated