👈How to roll out tokens

ERC20 tokens

As a counterpart of Rollin, we can transfer ERC20 assets from Cycle to any destination layer that Cycle supports, which is defined as rollout. A demonstration of rolling-out ERC20 tokens by using SDK is illustrated below.

async function rollout(
    tokenId: number,
    amount: BigNumberish,
    receiverAddress: string
) {
    const client = await getZkEvmClient()
    const erc20Token = client.customERC20(tokenId)
    const result = await erc20Token.withdraw(amount, receiverAddress)
    const txHash = await result.getTransactionHash()
    const receipt = await result.getReceipt()
}type

When the rolling-out transaction is fully processed, the token balance of the from-address in Cycle will be reduced as we expected; but on the other hand, the to-address in the destination chain will not have a balance increase. To get the rolling-out assets, we need to claim it on the destination chain.

Last updated