Converting ERC20 to ICRC
Last updated
Last updated
The sequence diagram details the process involved in converting the wrapped ICRC on the EVM chains back to ICRC on IC is shown below:
The detailed breakdown of each step in the sequence is as follows:
User Interaction:
The user initiates the bridging process by calling the bridge(target_ic, amount, recipient)
function on the BitoBridge Helper smart contract.
The BitoBridge Helper confirms the request by sending an 'ok' response back to the user.
Event Emission:
The BitoBridge Helper emits an event Bridge(target_ic, amount, recipient, from)
which is picked up by the RPC Nodes.
Event Listening and Processing:
The Minter continuously listens for events from RPC nodes. This listening process runs in a loop, with checks occurring every three minutes.
Once an event is detected, BitoBridge Minter gets the information.
BitoBridge Minter Activation:
Upon receiving the event data, the BitoBridge Minter processes the details and interacts with the BitoBridge Hub to initiate the token bridging process.
BitoBridge Hub to ICRC Ledger:
The BitoBridge Hub sends a request to the ICRC Ledger to bridge tokens to IC specified in the initial user request.
This involves the BitoBridge Hub requesting the ICRC Ledger to transfer tokens to the user's account on IC.
Token Transfer and Confirmation:
The ICRC Ledger processes the transfer request and updates the block index, which is crucial for tracking the transaction on the blockchain.
The ICRC Ledger confirms the successful transfer by sending the updated block index back to the BitoBridge Hub.