centrifuge / apps

Monorepo for Centrifuge frontends, including Centrifuge App, onboarding api, and Fabric design system.
GNU Lesser General Public License v3.0
27 stars 16 forks source link

Feat: Cross-chain Token Transfers + Token Variant Amalgamation #2405

Closed mustermeiszer closed 1 month ago

mustermeiszer commented 1 month ago

Goal

Allow users to send tokens

UI

NOTE: ONLY show other networks IF the user is using an EVM-compatible wallet NOTE: Sending to other networks MUST still be possible

Design Figma Files

Actions

NOTE: The UI can freely decide which underlying assets of an AMALGAMATED_ASSET to use for all tokenMux-actions

Token Balance Queries

ON Centrifuge Chain

ON EVM Chain

Send Actions

This action needs to select two networks SendingNetwork and ReceivingNetwork. The SendingNetwork is implicitly chosen by the user, depending on which account on which network the user chooses to click the CTA for. The RecivingNetwork can be chosen in the dialog.

ON Centrifuge Chain

IF AMALGAMATED_ASSET

ELSE

ON EVM Chains

Receive Actions

Receiving will only display the current address the user is connected with. The network and hence the account representation is implicitly chosen by the user, depending on which account on which network the user chooses to click the CTA for.

Redeem Actions

This action selects the network depending on which account on which network the user chooses to click the CTA for. It is important to show the user that he is redeeming in USD-Value. Highlight, that this is an approximate amount depending on the last token price and how many tranche tokens will be used for that.

ON Centrifuge Chain → call investments.update_redeem_order(..)

ON EVM Chains → call erc7540.requestRedeem(..)

Investment Actions

This action selects the network depending on which account on which network the user chooses to click the CTA for.

ON Centrifuge Chain

Currently, the user needs to have the pool currency to invest. But there are special currencies called CurrencyId::LocalAsset(id) that can

IF a pool has a LocalAsset(id) as its currency the UI MUST

For investing the UI needs to generate a batch of

ON EVM Chains → call erc7540.requestDeposit(..)

mustermeiszer commented 1 month ago

The MVP of this ticket should be

ON Centrifuge Chain

ON Evm Chains

hieronx commented 1 month ago

IF destination == CentrifugeChain || other EVM Chain → call poolManager.transferTrancheTokens(..)

Best to do this after https://github.com/centrifuge/apps/issues/2331 is done, and use CentrifugeRouter.transferTrancheTokens. That way gas is also automatically paid.

mustermeiszer commented 1 month ago

closed in favor of #2408