Skip to content

Conversation

@ws4charlie
Copy link
Contributor

@ws4charlie ws4charlie commented Oct 31, 2025

The contents of this PR:

  1. Add a contracts folder to contain both gateway and example packages. Update the path in workflow accordingly.
  2. Add copied (from node) source code of sui example package to protocol-contracts-sui.
  3. Removed the Gateway object reference from example package's on_call method to fix deployment error.
  4. Added published-at field to the gateway package Move.toml file.

@ws4charlie ws4charlie requested review from a team as code owners October 31, 2025 15:39
Copy link
Member

@lumtis lumtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point I think we should rather change the structure to be this way

├── contracts/
│   ├── gateway/
│   │   ├── Move.toml
│   │   └── sources/
│   ├── example/
│   │   ├── Move.toml
│   │   └── sources/

@fadeev
Copy link
Member

fadeev commented Nov 3, 2025

Should this be replacing the existing Sui withdraw and call example?

https://github.com/zeta-chain/example-contracts/tree/main/examples/call/sui/sources

@fadeev
Copy link
Member

fadeev commented Nov 3, 2025

Currently, we're encoding the payload for withdraw and call like so:

https://github.com/zeta-chain/example-contracts/blob/3c74e5953f4aacdb5a234ad7bf2b61b3dae80660/examples/call/sui/setup/encodeCallArgs.ts

Is this compatible to how it's done in this example?

@lumtis
Copy link
Member

lumtis commented Nov 4, 2025

Currently, we're encoding the payload for withdraw and call like so:

https://github.com/zeta-chain/example-contracts/blob/3c74e5953f4aacdb5a234ad7bf2b61b3dae80660/examples/call/sui/setup/encodeCallArgs.ts

Is this compatible to how it's done in this example?

No compatibility will be broken because MessageContext object will be passed. But currently we might revisit and change this new interface because of a bug

@ws4charlie ws4charlie requested a review from lumtis November 4, 2025 19:23
) {
// check if the message is "revert" and revert with faked ENonceMismatch if so
if (data == b"revert") {
assert!(false, ENonceMismatch);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt nonce mismatch come from gateway and not related to example contract? maybe im missing some context

let actual_sender = message_context_sender(message_context);
assert!(authenticated_sender == actual_sender, EUnauthorizedSender);

// check if the target package is my own package
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this checking if its coming from gateway? maybe some clarification on my own package would be great

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider moving Sui E2E test packages from 'node' to this repository

5 participants