Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to handle on ZetaChain assets issued from connected chain calls #2758

Open
lumtis opened this issue Aug 20, 2024 · 0 comments
Open
Labels
feature:idea An early idea for a feature. Used as reference to follow new feature integrations feature:smart-contracts Related to extending smart contracts capability and interactions with ZEVM

Comments

@lumtis
Copy link
Member

lumtis commented Aug 20, 2024

This feature idea is an extension of #2736 would reuse lot of the components and therefore would depend on it.

Is your feature request related to a problem? Please describe.

#2736 adds the ability to react to the result of a smart contract call which is the returned data of the smart contract.

Many dapp, DeFi applications have side effects outside of returned values, where assets are issued for example.

This idea is about giving the ability to handle assets issued from arbitrary smart contract calls, and fully enable the vision of chain abstraction.

Example:
You perform a Uniswap swap, the receive tokens will be issued on an address on Ethereum. In the current model, these tokens will remains on Ethereum, even with a CCTX supported to abstract chain usage, interactions from Ethrereum will still be necessary to use the tokens.

This feature allows to tells the CCTX to claim back the exchanged tokens into ZetaChain and process those here.

Example of what it can enable: the user can initiate from Polygon a swap on Ethereum Uniswap and receive PEPE, the PEPE are withdrawn back to Polygon (let's say with support multichain ZRC20s here)

Describe the solution you'd like

Extend mainly the interface introduced in #2736

One idea is to extend the ResultOptions to tells which asset to watch for for issued asset

ResultOptions{
    address resultReceiver; // will receive the asset back on ZetaChain
    bool callOnResult; // eventually we just want to receive the asset and not perform any calls
    address[] assetsToWatch; // in this example will describe a list of ERC20 to wathc for issued assets
}

The Gateway contracts check the different of ERC20 balance in the smart contract call, emit in the event the asset that have been issued to its address, and send the asset to the ERC20 custody contract (if whitelisted)

In the onResult hook, a Result object contains the list of asset with amount issued.

@lumtis lumtis added feature:idea An early idea for a feature. Used as reference to follow new feature integrations feature:smart-contracts Related to extending smart contracts capability and interactions with ZEVM labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:idea An early idea for a feature. Used as reference to follow new feature integrations feature:smart-contracts Related to extending smart contracts capability and interactions with ZEVM
Projects
None yet
Development

No branches or pull requests

1 participant