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

sui #233

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

sui #233

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/call/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ cache_forge
access_token

localnet.json

sui/build
2 changes: 1 addition & 1 deletion examples/call/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@types/node": ">=12.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@zetachain/localnet": "4.0.0-rc6",
"@zetachain/localnet": "6.0.0-rc4",
"@zetachain/toolkit": "13.0.0-rc15",
"axios": "^1.3.6",
"chai": "^4.2.0",
Expand Down
43 changes: 43 additions & 0 deletions examples/call/sui/Move.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# @generated by Move, please check-in and do not edit manually.

[move]
version = 3
manifest_digest = "82C267DC95A62359B1FF858589A2D574CFA30AA95348E2225AF3A27339241267"
deps_digest = "3C4103934B1E040BB6B23F1D610B4EF9F2F1166A50A104EADCF77467C004C600"
dependencies = [
{ id = "Sui", name = "Sui" },
{ id = "gateway", name = "gateway" },
]

[[move.package]]
id = "MoveStdlib"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/move-stdlib" }

[[move.package]]
id = "Sui"
source = { git = "https://github.com/MystenLabs/sui.git", rev = "framework/testnet", subdir = "crates/sui-framework/packages/sui-framework" }

dependencies = [
{ id = "MoveStdlib", name = "MoveStdlib" },
]

[[move.package]]
id = "gateway"
source = { git = "https://github.com/zeta-chain/protocol-contracts-sui.git", rev = "main", subdir = "" }

dependencies = [
{ id = "Sui", name = "Sui" },
]

[move.toolchain-version]
compiler-version = "1.42.2"
edition = "2024.beta"
flavor = "sui"

[env]

[env.local]
chain-id = "4f79e3ab"
original-published-id = "0xbc9e70f8123f35ad64c0b5705fe661c637b35a82b281347a873be96da8f58d51"
latest-published-id = "0xbc9e70f8123f35ad64c0b5705fe661c637b35a82b281347a873be96da8f58d51"
published-version = "1"
11 changes: 11 additions & 0 deletions examples/call/sui/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "call"
edition = "2024.beta"

[dependencies]
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/testnet" }
gateway = { git = "https://github.com/zeta-chain/protocol-contracts-sui.git", rev = "main" }

[addresses]
call = "0x0"
gateway = "_"
15 changes: 15 additions & 0 deletions examples/call/sui/sources/call.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module call::hello_world {
use sui::event;

public struct HelloEvent has copy, drop {
message: vector<u8>,
}

public entry fun hello(
gateway: &gateway::gateway::Gateway,
ctx: &mut TxContext
) {
let event = HelloEvent {message: b"Hello, Sui!"};
event::emit(event);
}
}
18 changes: 18 additions & 0 deletions examples/call/sui/tests/call_tests.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
#[test_only]
module call::call_tests;
// uncomment this line to import the module
// use call::call;

const ENotImplemented: u64 = 0;

#[test]
fun test_call() {
// pass
}

#[test, expected_failure(abort_code = ::call::call_tests::ENotImplemented)]
fun test_call_fail() {
abort ENotImplemented
}
*/
29 changes: 23 additions & 6 deletions examples/call/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1865,7 +1865,7 @@
rpc-websockets "^9.0.2"
superstruct "^2.0.2"

"@solana/web3.js@^1.95.8":
"@solana/web3.js@^1.95.4", "@solana/web3.js@^1.95.8":
version "1.98.0"
resolved "https://registry.yarnpkg.com/@solana/web3.js/-/web3.js-1.98.0.tgz#21ecfe8198c10831df6f0cfde7f68370d0405917"
integrity sha512-nz3Q5OeyGFpFCR+erX2f6JPt3sKhzhYcSycBCSPkWjzSVDh/Rr1FqTVMRe58FKO16/ivTUcuJjeS5MyBvpkbzA==
Expand Down Expand Up @@ -2320,17 +2320,21 @@
typescript "5.5.4"
zod "3.22.4"

"@zetachain/localnet@4.0.0-rc6":
version "4.0.0-rc6"
resolved "https://registry.yarnpkg.com/@zetachain/localnet/-/localnet-4.0.0-rc6.tgz#9b36f5ab0e8fac766d63cfca4b1cab6a263bdd5d"
integrity sha512-DGKspMAJZLUrgNirc3NzFYg9jRfaOyuF5ePj85D93qAA//f8lOsXpmh/6Bvq/MrEscCLpVavgVP7+ePy4KJ2Fw==
"@zetachain/localnet@6.0.0-rc4":
version "6.0.0-rc4"
resolved "https://registry.yarnpkg.com/@zetachain/localnet/-/localnet-6.0.0-rc4.tgz#eb381fb31a1b7a4e15b16b65c470191220de6b0c"
integrity sha512-rYiuQEmoopkVzKBV95PtE926Krx+lAP9vJM5bOmUqGwhtQAv/CIK0qGopoNsyNkFK9C6RWALvICO9Tj+AFCeHA==
dependencies:
"@coral-xyz/anchor" "^0.30.1"
"@inquirer/prompts" "^5.5.0"
"@solana/web3.js" "^1.95.4"
"@uniswap/v2-core" "^1.0.1"
"@uniswap/v2-periphery" "^1.1.0-beta.0"
"@zetachain/protocol-contracts" "11.0.0-rc3"
"@zetachain/protocol-contracts" "11.0.0-rc4"
ansis "^3.3.2"
bs58 "^6.0.0"
concurrently "^8.2.2"
elliptic "6.5.7"
ethers "^6.13.2"
hardhat "^2.22.8"
wait-on "^7.2.0"
Expand Down Expand Up @@ -3643,6 +3647,19 @@ [email protected]:
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"

[email protected]:
version "6.5.7"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b"
integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==
dependencies:
bn.js "^4.11.9"
brorand "^1.1.0"
hash.js "^1.0.0"
hmac-drbg "^1.0.1"
inherits "^2.0.4"
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"

elliptic@^6.5.2, elliptic@^6.5.7:
version "6.6.1"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06"
Expand Down