Add ability to handle on ZetaChain assets issued from connected chain calls #2758
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
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 assetThe 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, aResult
object contains the list of asset with amount issued.The text was updated successfully, but these errors were encountered: