CCIP: Issuance and Redemption

Token Issuance Steps

  1. A user sends tokens to Uniswap.

  2. The tokens are converted into ETH.

  3. The ETH is transferred to the CCIP smart contract.

  4. On the other chain, wrapped ETH is received by the factory and sent to Uniswap.

  5. ETH is converted into the underlying assets of the index in a single transaction.

  6. With the new total assets in the vault, the Factory contract on the previous chain uses the value per token from before the transaction to make new index tokens.

CCIP Issuance explained

In the issuance action, we obtain the user-input amount of Ether and begin purchasing the underlying assets available on the current network. However, for those assets not accessible on this network, we retain their data to transmit them to other chains.

Each asset has its own chain selector, identified for the relevant blockchain. After acquiring underlying assets on the current chain, we convert Ether to cross-chain tokens to facilitate the transfer of tokens to other chains.

Subsequently, we send cross-chain tokens and data to each network to acquire underlying assets on that chain. On the target chain, there exists a receive function that accepts tokens and data, with each action type corresponding to a specific asset. For instance, in action type 0, we discern it as issuance, and on the target network, we convert the received cross-chain token to the underlying asset.

Finally, we dispatch a message to the main chain to confirm the receipt of tokens and completion of the swap. The ultimate step involves finalising the issuance on the main chain, ensuring that the swap is completed for all underlying assets across all chains, and subsequently minting index tokens for users.

CCIP Redemption explained

In the redemption action, the user initiates the process by burning index tokens. Subsequently, the smart contract calculates the burn percentage based on the burn amount and total supply, determining the share of underlying assets that need to be burned.

Similar to the issuance process, we then commence swapping those underlying assets available on the current network, converting a portion of each asset to Ethereum on the current network.

For assets not present on the current network, we dispatch a message to the cross-chain factory and perform the swap of underlying assets on the target chain. Following the token swap on the target chain, we transfer tokens from the target chain back to the current chain to maintain old Ethereum tokens in a state variable. In the final step, we conclude the redemption process by sending tokens to the user as the requester and marking the redemption request as completed.

Last updated