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

Message passing: allow to call contract on external chain from ZetaChain #1804

Closed
Tracked by #1799
lumtis opened this issue Feb 23, 2024 · 2 comments
Closed
Tracked by #1799
Assignees

Comments

@lumtis
Copy link
Member

lumtis commented Feb 23, 2024

Support calling contract on external chain with message passing (Zeta CCTX) initiation from ZetaChain.

My part for supporting this would be to support custom message for the Zeta CCTX creation in evm_hook.go (this is the location where the CCTX is initiated when observing event on ZetaChain).
Currently the message is always empty

msg := types.NewMsgVoteOnObservedInboundTx(
	"",
	emittingContract.Hex(),
	senderChain.ChainId,
	txOrigin, toAddr,
	receiverChain.ChainId,
	amount,
	"",
	event.Raw.TxHash.String(),
	event.Raw.BlockNumber,
	90000,
	common.CoinType_Zeta,
	"",
	event.Raw.Index,
)

Another part of the implementation is supporting revert on ZetaChain with the message passing interface.
If the oubound observation fail and the source chain is ZetaChain, then the revert interface is used

onZetaRevert
@kingpinXD
Copy link
Contributor

The onZetaRevert should be called when the original calling zEvm address is a contract.
If the original address were an account, it would make sense to mint it back to the user address. I think we can add that to the scope of this task ?

Presently. The CCTX is set to be aborted in the current logic, and nothing is refunded automatically. I am unsure if there was any specific reason for implementing it like this initially.

@lumtis
Copy link
Member Author

lumtis commented Apr 5, 2024

Yes, I think we should refund the address directly in this case. We already have some logic in the code to check if it is a EOA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants