zkCRO
On this page, you can find the contracts and their interactions involved when bridging $CRO and $zkCRO to and from Ethereum (L1) and Cronos zkEVM (L2) and unbonding $zkCRO, it includes:
Notice: Cronos zkEVM is being sunset, please bridge out your assets before the network is fully decommissioned.
[L2 -> L1] Withdrawing $zkCRO from L2
[L2 -> L1] Withdrawing $zkCRO from L2
From Cronos zkEVM mainnet (L2) -> Ethereum mainnet (L1)
To withdraw $zkCRO fromCronos zkEVM mainnet -> Ethereum mainnet, we would need to interact with the following contract:
$zkCRO token contract:
Cronos zkEVM:
0x000000000000000000000000000000000000800a
zkChain Shared Bridge:
Ethereum : 0xD7f9f54194C633F36CCD5F3da84ad4a1c38cB2cB
Step 1) Initiating a withdrawal transaction
On Cronos zkEvm, call the withdraw function of zkCRO token contract:
function withdraw(address _l1Receiver) external payable;_l1Receiver
The address to recieve zkCRO on Ethereum mainnet
payable
The amount of $zkCRO to be transfer.
It will take at least 24 hours before the withdrawal can be finalized on Ethereum. Store the transaction hash from the withdrawal transaction for later steps.
Step 2) Gathering information for $zkCRO withdrawal on L1
Extra information for the L2 -> L1 transaction is required for the next step in claiming the $zkCRO on L1. This information can be gathered by finalizeWithdrawalParams, using zksync-ethers package
This takes the L2 withdrawal hash as parameters and returns the parameters required for finalizing a withdrawal in the next step.
Example outputs:
Step 3) Claiming the $zkCRO on L1
Once the transaction in Step 1 has been finalized on L1, we can claim the withdrawn $zkCRO from the zk Chain Shared Bridge contract by calling its finalizeWithdrawal function. The inputs can be found in Step 2,
_chainId
Chain id for Cronos zkEVM, which is 388
_l2BatchNumber
The L2 batch number where the withdrawal was processed, obtained in Step 2.
_l2MessageIndex
The position in the L2 logs Merkle tree of the l2Log that was sent with the message, obtained in Step 2.
_l2TxNumberInBatch
The L2 transaction number in the batch, in which the log was sent, obtained in Step 2.
_message
The L2 withdraw data, stored in an L2 -> L1 message, obtained in Step 2.
_merkleProof
The Merkle Proof, obtained in Step 2.
Once finalizeWithdrawal is completed, the withdrawn amount of $zkCRO will go into the receiver's wallet on Ethereum.
We can use zksync-ethers package isWithdrawalFinalized call to confirm whether the withdrawal transaction is finalized on the L1 network.
withdrawalHash
The transaction hash of the L2 transaction includes the withdrawal transaction from Step 1.
Unstaking $zkCRO for $CRO
To redeem $zkCRO fromEthereum mainnet and receive the underlying unstaked $CRO ( on "Cronos EVM Mainnet"), we would need to interact with the following contracts:
$zkCRO token contract
$LCRO token contract
Cronos EVM Mainnet: 0x9fae23a2700feecd5b93e43fdbc03c76aa7c08a6
vnoNFTCronos EVM Mainnet: 0xb15533a0bc7c530d692a9660785226dfd3633965
Step 1) Approving $zkCRO to be spend by zkCRO token contract
On Ethereum, approve $zkCRO to be spent by zkCRO contract with appropriate amount.
Step 2) Unstaking $zkCRO to recieve $LCRO
On Ethereum, call the unstake function on the zkCRO token contract:
_receiver
The Cronos EVM mainnet address to receive $LCRO.
_shareAmount
The amount of $zkCRO to unstake.
Once done, $LCRO token will be automatically released within 24 hours and transfer to the _receiver address of "Cronos EVM mainnet".
Step 3) Approving $LCRO spent
On Cronos EVM mainnet, approve $LCRO to be spent by $LCRO contract with appropriate amount
Step 4) Unbonding $LCRO
On Cronos EVM mainnet, call requestUnbond on the LCRO token contract,
_shareAmount
The amount of $LCRO that is to be burned to unbond
_receiver
The wallet address on ethereum to receive the receipt NFT. This NFT is needed to withdraw $CRO once the unbond period has ended
Once done you will receive an NFT (vnoNFT) in return. Wait for batch of unbonding to be processed which takes 28-32 days.
Step 5) Approving NFT to be spend by LCRO contract
On Cronos EVM mainnet, call setApprovalForAll on the vnoNFT contract, to approve to transfer of the vnoNFT obtained in Step 4)
operator
$LCRO contract address on ethereum
_approved
Set to "True" to grant approval.
Step 6) Withdrawing $CRO
On Cronos EVM mainnet, call unbond function on the LCRO token contract to burn the receipt NFT and receive the underlying unstaked $CRO.
_tokenId
The tokenId of the receipt NFT, recieved in Step 4
_receiver
The address on Cronos EVM mainnet to receive $CRO
This transaction burns the receipt NFT and sends the unstaked $CRO to the specified receiver.
Last updated