Skip to content

Commit b4a2c4a

Browse files
committed
sui: update executor requests with NTT v1 and CCTP v2 helpers
1 parent 89dfb2b commit b4a2c4a

File tree

4 files changed

+86
-2
lines changed

4 files changed

+86
-2
lines changed

sui/DEPLOYMENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Executor Requests: [0xc030df7a3eed1494fa4b64aa8ab63a79041cf1114f4ff2b7ab5aca1c68
1212

1313
## Testnet
1414

15+
### July 15, 2025
16+
17+
Executor Requests: [0x8e5ec98738885325294060fd067fde47e10313bedc531d0500b24a752be41788](https://suiscan.xyz/testnet/object/0x8e5ec98738885325294060fd067fde47e10313bedc531d0500b24a752be41788/contracts)
18+
1519
### April 10, 2025
1620

1721
Executor: [0x4000cfe2955d8355b3d3cf186f854fea9f787a457257056926fde1ec977670eb](https://suiscan.xyz/testnet/object/0x4000cfe2955d8355b3d3cf186f854fea9f787a457257056926fde1ec977670eb/contracts)

sui/executor_requests/Move.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ flavor = "sui"
6363

6464
[env.testnet]
6565
chain-id = "4c78adac"
66-
original-published-id = "0x2d9ccf3cce3f7dce408e5455e90b80a8161ad9673d1366c2a5def60ad93657a8"
67-
latest-published-id = "0x2d9ccf3cce3f7dce408e5455e90b80a8161ad9673d1366c2a5def60ad93657a8"
66+
original-published-id = "0x8e5ec98738885325294060fd067fde47e10313bedc531d0500b24a752be41788"
67+
latest-published-id = "0x8e5ec98738885325294060fd067fde47e10313bedc531d0500b24a752be41788"
6868
published-version = "1"
6969

7070
[env.mainnet]

sui/executor_requests/sources/executor_requests.move

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ module executor_requests::executor_requests {
44
use executor::bytes;
55

66
const REQ_VAA_V1: vector<u8> = b"ERV1";
7+
const REQ_NTT_V1: vector<u8> = b"ERN1";
78
const REQ_CCTP_V1: vector<u8> = b"ERC1";
9+
const REQ_CCTP_V2: vector<u8> = b"ERC2";
810

911
const E_INVALID_VEC_LENGTH: u64 = 0;
1012

@@ -22,6 +24,21 @@ module executor_requests::executor_requests {
2224
ret
2325
}
2426

27+
public fun make_ntt_v1_request(
28+
source_chain: u16,
29+
source_manager: vector<u8>,
30+
message_id: vector<u8>
31+
): vector<u8> {
32+
assert!(source_manager.length() == 32,E_INVALID_VEC_LENGTH);
33+
assert!(message_id.length() == 32,E_INVALID_VEC_LENGTH);
34+
let mut ret = vector::empty();
35+
ret.append(REQ_NTT_V1);
36+
bytes::push_u16_be(&mut ret, source_chain);
37+
ret.append(source_manager);
38+
ret.append(message_id);
39+
ret
40+
}
41+
2542
public fun make_cctp_v1_request(
2643
src_domain: u32,
2744
nonce: u64,
@@ -32,4 +49,11 @@ module executor_requests::executor_requests {
3249
bytes::push_u64_be(&mut ret, nonce);
3350
ret
3451
}
52+
53+
public fun make_cctp_v2_request(): vector<u8> {
54+
let mut ret = vector::empty();
55+
ret.append(REQ_CCTP_V2);
56+
bytes::push_u8(&mut ret, 1);
57+
ret
58+
}
3559
}

sui/executor_requests/tests/executor_requests_tests.move

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ module executor_requests::executor_requests_tests {
1414
assert!(res == x"455256312712000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c76000000000000001d", 0);
1515
}
1616

17+
#[test]
18+
fun test_make_ntt_v1_request() {
19+
let res = executor_requests::make_ntt_v1_request(
20+
10002,
21+
x"000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c76",
22+
x"0000000000000000000000000000000000000000000000000000000000000001",
23+
);
24+
assert!(res == x"45524E312712000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c760000000000000000000000000000000000000000000000000000000000000001", 0);
25+
}
26+
1727
#[test]
1828
fun test_make_cctp_v1_request() {
1929
let res = executor_requests::make_cctp_v1_request(
@@ -23,6 +33,12 @@ module executor_requests::executor_requests_tests {
2333
assert!(res == x"455243310000000600000000000018c8", 0);
2434
}
2535

36+
#[test]
37+
fun test_make_cctp_v2_request() {
38+
let res = executor_requests::make_cctp_v2_request();
39+
assert!(res == x"4552433201", 0);
40+
}
41+
2642
#[test]
2743
#[expected_failure(abort_code = executor_requests::E_INVALID_VEC_LENGTH)]
2844
fun test_make_vaa_v1_request_fail_with_emitter_too_short() {
@@ -42,5 +58,45 @@ module executor_requests::executor_requests_tests {
4258
29
4359
);
4460
}
61+
62+
#[test]
63+
#[expected_failure(abort_code = executor_requests::E_INVALID_VEC_LENGTH)]
64+
fun test_make_ntt_v1_request_fail_with_address_too_short() {
65+
executor_requests::make_ntt_v1_request(
66+
10002,
67+
x"000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c",
68+
x"0000000000000000000000000000000000000000000000000000000000000001"
69+
);
70+
}
71+
72+
#[test]
73+
#[expected_failure(abort_code = executor_requests::E_INVALID_VEC_LENGTH)]
74+
fun test_make_ntt_v1_request_fail_with_address_too_long() {
75+
executor_requests::make_ntt_v1_request(
76+
10002,
77+
x"000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c7600",
78+
x"0000000000000000000000000000000000000000000000000000000000000001"
79+
);
80+
}
81+
82+
#[test]
83+
#[expected_failure(abort_code = executor_requests::E_INVALID_VEC_LENGTH)]
84+
fun test_make_ntt_v1_request_fail_with_message_id_too_short() {
85+
executor_requests::make_ntt_v1_request(
86+
10002,
87+
x"000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c76",
88+
x"00000000000000000000000000000000000000000000000000000000000000"
89+
);
90+
}
91+
92+
#[test]
93+
#[expected_failure(abort_code = executor_requests::E_INVALID_VEC_LENGTH)]
94+
fun test_make_ntt_v1_request_fail_with_message_id_too_long() {
95+
executor_requests::make_ntt_v1_request(
96+
10002,
97+
x"000000000000000000000000d4a6a72a025599fd7357c0f157c718d0f5e38c76",
98+
x"000000000000000000000000000000000000000000000000000000000000000100"
99+
);
100+
}
45101

46102
}

0 commit comments

Comments
 (0)