@layerzerolabs/protocol-stellar-v2 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/.turbo/turbo-build.log +443 -302
  2. package/.turbo/turbo-lint.log +118 -96
  3. package/.turbo/turbo-test.log +853 -731
  4. package/Cargo.lock +120 -37
  5. package/Cargo.toml +8 -5
  6. package/contracts/common-macros/src/contract_impl.rs +44 -0
  7. package/contracts/common-macros/src/lib.rs +86 -40
  8. package/contracts/common-macros/src/ownable.rs +24 -32
  9. package/contracts/common-macros/src/storage.rs +95 -120
  10. package/contracts/common-macros/src/tests/contract_impl.rs +289 -0
  11. package/contracts/common-macros/src/tests/mod.rs +9 -0
  12. package/contracts/common-macros/src/tests/ownable.rs +151 -0
  13. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_impl__snapshot_generated_contract_impl_code.snap +85 -0
  14. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +30 -0
  15. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_only_owner_preserves_function_signature.snap +9 -0
  16. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__storage__snapshot_generated_storage_code.snap +1072 -0
  17. package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +45 -0
  18. package/contracts/common-macros/src/tests/storage.rs +485 -0
  19. package/contracts/common-macros/src/tests/test_helpers.rs +93 -0
  20. package/contracts/common-macros/src/tests/ttl_configurable.rs +34 -0
  21. package/contracts/common-macros/src/ttl_configurable.rs +31 -14
  22. package/contracts/common-macros/src/utils.rs +27 -0
  23. package/contracts/endpoint-v2/ARCHITECTURE.md +4 -4
  24. package/contracts/endpoint-v2/src/endpoint_v2.rs +18 -15
  25. package/contracts/endpoint-v2/src/interfaces/message_lib.rs +2 -3
  26. package/contracts/endpoint-v2/src/interfaces/message_lib_manager.rs +5 -3
  27. package/contracts/endpoint-v2/src/interfaces/messaging_channel.rs +2 -2
  28. package/contracts/endpoint-v2/src/interfaces/messaging_composer.rs +2 -2
  29. package/contracts/endpoint-v2/src/interfaces/send_lib.rs +4 -4
  30. package/contracts/endpoint-v2/src/lib.rs +6 -5
  31. package/contracts/endpoint-v2/src/message_lib_manager.rs +14 -6
  32. package/contracts/endpoint-v2/src/messaging_channel.rs +6 -2
  33. package/contracts/endpoint-v2/src/messaging_composer.rs +6 -2
  34. package/contracts/endpoint-v2/src/storage.rs +10 -7
  35. package/contracts/endpoint-v2/src/tests/endpoint_v2/pay_messaging_fees.rs +16 -16
  36. package/contracts/endpoint-v2/src/tests/endpoint_v2/ttl_config.rs +46 -46
  37. package/contracts/endpoint-v2/src/tests/mock.rs +2 -2
  38. package/contracts/endpoint-v2/src/util.rs +8 -2
  39. package/contracts/message-libs/block-message-lib/Cargo.toml +1 -0
  40. package/contracts/message-libs/block-message-lib/src/lib.rs +5 -5
  41. package/contracts/message-libs/message-lib-common/src/errors.rs +8 -8
  42. package/contracts/message-libs/message-lib-common/src/interfaces/dvn.rs +0 -1
  43. package/contracts/message-libs/message-lib-common/src/interfaces/mod.rs +3 -3
  44. package/contracts/message-libs/message-lib-common/src/lib.rs +0 -2
  45. package/contracts/message-libs/message-lib-common/src/packet_codec_v1.rs +4 -6
  46. package/contracts/message-libs/message-lib-common/src/tests/packet_codec_v1.rs +2 -2
  47. package/contracts/message-libs/message-lib-common/src/tests/worker_options.rs +11 -11
  48. package/contracts/message-libs/message-lib-common/src/worker_options.rs +10 -16
  49. package/contracts/message-libs/simple-message-lib/src/errors.rs +0 -4
  50. package/contracts/message-libs/simple-message-lib/src/simple_message_lib.rs +49 -34
  51. package/contracts/message-libs/simple-message-lib/src/storage.rs +3 -7
  52. package/contracts/message-libs/simple-message-lib/src/test.rs +3 -3
  53. package/contracts/message-libs/treasury/src/storage.rs +1 -2
  54. package/contracts/message-libs/treasury/src/tests/setup.rs +3 -2
  55. package/contracts/message-libs/treasury/src/tests/treasury_tests.rs +0 -13
  56. package/contracts/message-libs/treasury/src/treasury.rs +18 -21
  57. package/contracts/message-libs/uln-302/Cargo.toml +1 -0
  58. package/contracts/message-libs/uln-302/src/interfaces/mod.rs +4 -4
  59. package/contracts/message-libs/uln-302/src/interfaces/{receive.rs → receive_uln.rs} +3 -3
  60. package/contracts/message-libs/uln-302/src/interfaces/{send.rs → send_uln.rs} +8 -80
  61. package/contracts/message-libs/uln-302/src/lib.rs +5 -4
  62. package/contracts/message-libs/uln-302/src/{receive.rs → receive_uln.rs} +20 -12
  63. package/contracts/message-libs/uln-302/src/{send.rs → send_uln.rs} +19 -13
  64. package/contracts/message-libs/uln-302/src/storage.rs +1 -2
  65. package/contracts/message-libs/uln-302/src/tests/config/uln_config.rs +3 -2
  66. package/contracts/message-libs/uln-302/src/tests/send_uln302/send.rs +30 -30
  67. package/contracts/message-libs/uln-302/src/tests/setup.rs +12 -11
  68. package/contracts/message-libs/uln-302/src/tests/uln302/set_config.rs +1 -1
  69. package/contracts/message-libs/uln-302/src/{config_validation.rs → types.rs} +79 -11
  70. package/contracts/message-libs/uln-302/src/uln302.rs +15 -10
  71. package/contracts/oapp-macros/Cargo.toml +2 -8
  72. package/contracts/oapp-macros/src/lib.rs +57 -311
  73. package/contracts/oapp-macros/src/oapp_core.rs +23 -32
  74. package/contracts/oapp-macros/src/oapp_full.rs +8 -2
  75. package/contracts/oapp-macros/src/oapp_options_type3.rs +21 -36
  76. package/contracts/oapp-macros/src/oapp_receiver.rs +38 -57
  77. package/contracts/oapp-macros/src/oapp_sender.rs +12 -14
  78. package/contracts/oapp-macros/src/util.rs +14 -10
  79. package/contracts/oapps/counter/Cargo.toml +2 -1
  80. package/contracts/oapps/counter/integration_tests/utils.rs +4 -4
  81. package/contracts/oapps/counter/src/codec.rs +8 -9
  82. package/contracts/oapps/counter/src/counter.rs +156 -147
  83. package/contracts/oapps/counter/src/storage.rs +1 -2
  84. package/contracts/oapps/counter/src/tests/test_codec.rs +5 -5
  85. package/contracts/oapps/counter/src/tests/test_counter.rs +11 -13
  86. package/contracts/oapps/oapp/Cargo.toml +1 -0
  87. package/contracts/oapps/oapp/src/errors.rs +1 -1
  88. package/contracts/oapps/oapp/src/lib.rs +3 -0
  89. package/contracts/oapps/oapp/src/macro_tests/mod.rs +1 -0
  90. package/contracts/oapps/oapp/src/macro_tests/test_macros.rs +312 -0
  91. package/contracts/oapps/oapp/src/oapp_core.rs +52 -53
  92. package/contracts/oapps/oapp/src/oapp_options_type3.rs +18 -28
  93. package/contracts/oapps/oapp/src/oapp_receiver.rs +82 -31
  94. package/contracts/oapps/oapp/src/oapp_sender.rs +55 -13
  95. package/contracts/oapps/oapp/src/tests/test_oapp_core.rs +16 -3
  96. package/contracts/oapps/oapp/src/tests/test_oapp_options_type3.rs +33 -8
  97. package/contracts/oapps/oapp/src/tests/test_oapp_receiver.rs +6 -9
  98. package/contracts/oapps/oapp/src/tests/test_oapp_sender.rs +28 -15
  99. package/contracts/oapps/oft/Cargo.toml +27 -0
  100. package/contracts/oapps/oft/integration-tests/mod.rs +3 -0
  101. package/contracts/oapps/oft/integration-tests/setup.rs +320 -0
  102. package/contracts/oapps/oft/integration-tests/test_with_sml.rs +155 -0
  103. package/contracts/oapps/oft/integration-tests/utils.rs +201 -0
  104. package/contracts/oapps/oft/src/codec/mod.rs +2 -0
  105. package/contracts/oapps/oft/src/codec/oft_compose_msg_codec.rs +55 -0
  106. package/contracts/oapps/oft/src/codec/oft_msg_codec.rs +62 -0
  107. package/contracts/oapps/oft/src/constants.rs +5 -0
  108. package/contracts/oapps/oft/src/errors.rs +8 -0
  109. package/contracts/oapps/oft/src/events.rs +19 -0
  110. package/contracts/oapps/oft/src/interfaces/mint_burn_token.rs +23 -0
  111. package/contracts/oapps/oft/src/interfaces/mod.rs +3 -0
  112. package/contracts/oapps/oft/src/lib.rs +22 -0
  113. package/contracts/oapps/oft/src/macro_tests/mod.rs +2 -0
  114. package/contracts/oapps/oft/src/macro_tests/test_all_default.rs +41 -0
  115. package/contracts/oapps/oft/src/macro_tests/test_override.rs +83 -0
  116. package/contracts/oapps/oft/src/oft.rs +320 -0
  117. package/contracts/oapps/oft/src/oft_types/lock_unlock.rs +50 -0
  118. package/contracts/oapps/oft/src/oft_types/mint_burn.rs +50 -0
  119. package/contracts/oapps/oft/src/oft_types/mod.rs +10 -0
  120. package/contracts/oapps/oft/src/storage.rs +11 -0
  121. package/contracts/oapps/oft/src/tests/mod.rs +13 -0
  122. package/contracts/oapps/oft/src/tests/test_decimals.rs +89 -0
  123. package/contracts/oapps/oft/src/tests/test_lz_receive.rs +282 -0
  124. package/contracts/oapps/oft/src/tests/test_oft_compose_msg_codec.rs +68 -0
  125. package/contracts/oapps/oft/src/tests/test_oft_msg_codec.rs +136 -0
  126. package/contracts/oapps/oft/src/tests/test_oft_version.rs +13 -0
  127. package/contracts/oapps/oft/src/tests/test_quote_oft.rs +159 -0
  128. package/contracts/oapps/oft/src/tests/test_quote_send.rs +195 -0
  129. package/contracts/oapps/oft/src/tests/test_resolve_address.rs +37 -0
  130. package/contracts/oapps/oft/src/tests/test_send.rs +915 -0
  131. package/contracts/oapps/oft/src/tests/test_token.rs +47 -0
  132. package/contracts/oapps/oft/src/tests/test_utils.rs +789 -0
  133. package/contracts/oapps/oft/src/types.rs +38 -0
  134. package/contracts/oapps/oft/src/utils.rs +67 -0
  135. package/contracts/oapps/oft-mint-burn/Cargo.toml +26 -0
  136. package/contracts/oapps/oft-mint-burn/src/lib.rs +3 -0
  137. package/contracts/oapps/oft-mint-burn/src/oft.rs +28 -0
  138. package/contracts/oapps/oft-mint-burn/src/tests/mod.rs +1 -0
  139. package/contracts/utils/src/buffer_reader.rs +8 -9
  140. package/contracts/utils/src/buffer_writer.rs +11 -5
  141. package/contracts/utils/src/errors.rs +5 -5
  142. package/contracts/utils/src/ownable.rs +14 -6
  143. package/contracts/utils/src/testing_utils.rs +11 -1
  144. package/contracts/utils/src/tests/buffer_reader.rs +491 -730
  145. package/contracts/utils/src/tests/buffer_writer.rs +336 -148
  146. package/contracts/utils/src/tests/bytes_ext.rs +125 -40
  147. package/contracts/utils/src/tests/mod.rs +3 -0
  148. package/contracts/utils/src/tests/ownable.rs +379 -27
  149. package/contracts/utils/src/tests/test_helper.rs +47 -0
  150. package/contracts/utils/src/tests/testing_utils.rs +555 -0
  151. package/contracts/utils/src/tests/ttl.rs +421 -0
  152. package/contracts/utils/src/ttl.rs +29 -89
  153. package/contracts/workers/dvn/Cargo.toml +31 -0
  154. package/contracts/workers/dvn/src/auth.rs +66 -0
  155. package/contracts/workers/dvn/src/dvn.rs +143 -0
  156. package/contracts/workers/dvn/src/errors.rs +21 -0
  157. package/contracts/workers/dvn/src/events.rs +19 -0
  158. package/contracts/workers/dvn/src/interfaces/dvn.rs +12 -0
  159. package/contracts/workers/dvn/src/interfaces/mod.rs +5 -0
  160. package/contracts/workers/dvn/src/interfaces/multisig.rs +15 -0
  161. package/contracts/workers/dvn/src/lib.rs +24 -0
  162. package/contracts/workers/dvn/src/multisig.rs +127 -0
  163. package/contracts/workers/dvn/src/storage.rs +35 -0
  164. package/contracts/workers/dvn/src/tests/auth.rs +237 -0
  165. package/contracts/workers/dvn/src/tests/dvn.rs +349 -0
  166. package/contracts/workers/dvn/src/tests/key_pair.rs +66 -0
  167. package/contracts/workers/dvn/src/tests/mod.rs +5 -0
  168. package/contracts/workers/dvn/src/tests/multisig/mod.rs +3 -0
  169. package/contracts/workers/dvn/src/tests/multisig/set_signer.rs +133 -0
  170. package/contracts/workers/dvn/src/tests/multisig/set_threshold.rs +108 -0
  171. package/contracts/workers/dvn/src/tests/multisig/verify_signatures.rs +109 -0
  172. package/contracts/workers/dvn/src/tests/setup.rs +109 -0
  173. package/contracts/workers/dvn/src/types.rs +26 -0
  174. package/contracts/workers/dvn-fee-lib/Cargo.toml +24 -0
  175. package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +113 -0
  176. package/contracts/workers/dvn-fee-lib/src/errors.rs +8 -0
  177. package/contracts/workers/dvn-fee-lib/src/lib.rs +17 -0
  178. package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +282 -0
  179. package/contracts/workers/dvn-fee-lib/src/tests/mod.rs +1 -0
  180. package/contracts/workers/executor/Cargo.toml +10 -7
  181. package/contracts/workers/executor/src/errors.rs +8 -0
  182. package/contracts/workers/executor/src/events.rs +4 -7
  183. package/contracts/workers/executor/src/interfaces/executor.rs +72 -22
  184. package/contracts/workers/executor/src/interfaces/mod.rs +0 -2
  185. package/contracts/workers/executor/src/lib.rs +16 -7
  186. package/contracts/workers/executor/src/lz_executor.rs +308 -0
  187. package/contracts/workers/executor/src/storage.rs +24 -16
  188. package/contracts/workers/executor-fee-lib/Cargo.toml +22 -0
  189. package/contracts/workers/executor-fee-lib/src/errors.rs +15 -0
  190. package/contracts/workers/executor-fee-lib/src/executor_fee_lib.rs +215 -0
  191. package/contracts/workers/executor-fee-lib/src/executor_option.rs +203 -0
  192. package/contracts/workers/executor-fee-lib/src/lib.rs +7 -0
  193. package/contracts/workers/executor-helper/Cargo.toml +29 -0
  194. package/contracts/workers/executor-helper/src/executor_helper.rs +161 -0
  195. package/contracts/workers/executor-helper/src/lib.rs +11 -0
  196. package/contracts/workers/{worker-common → worker}/Cargo.toml +1 -4
  197. package/contracts/workers/worker/src/errors.rs +24 -0
  198. package/contracts/workers/worker/src/events.rs +62 -0
  199. package/contracts/workers/worker/src/interfaces/dvn_fee_lib.rs +75 -0
  200. package/contracts/workers/worker/src/interfaces/executor_fee_lib.rs +84 -0
  201. package/contracts/workers/{worker-common → worker}/src/interfaces/mod.rs +2 -2
  202. package/contracts/workers/worker/src/interfaces/price_feed.rs +85 -0
  203. package/contracts/workers/worker/src/lib.rs +14 -0
  204. package/contracts/workers/worker/src/storage.rs +63 -0
  205. package/contracts/workers/worker/src/worker.rs +459 -0
  206. package/package.json +3 -3
  207. package/sdk/dist/generated/bml.d.ts +88 -17
  208. package/sdk/dist/generated/bml.js +62 -16
  209. package/sdk/dist/generated/counter.d.ts +281 -102
  210. package/sdk/dist/generated/counter.js +93 -41
  211. package/sdk/dist/generated/endpoint.d.ts +128 -105
  212. package/sdk/dist/generated/endpoint.js +47 -45
  213. package/sdk/dist/generated/sml.d.ts +212 -69
  214. package/sdk/dist/generated/sml.js +103 -53
  215. package/sdk/dist/generated/uln302.d.ts +270 -173
  216. package/sdk/dist/generated/uln302.js +112 -64
  217. package/sdk/package.json +11 -11
  218. package/sdk/test/index.test.ts +147 -42
  219. package/sdk/test/suites/constants.ts +7 -3
  220. package/sdk/test/suites/deploy.ts +65 -42
  221. package/sdk/test/suites/localnet.ts +2 -2
  222. package/sdk/test/suites/scan.ts +28 -25
  223. package/sdk/test/utils.ts +199 -0
  224. package/sdk/tsconfig.json +93 -95
  225. package/tools/ts-bindings-gen/src/main.rs +2 -0
  226. package/contracts/common-macros/src/snapshots/common_macros__tests__tests__snapshot_generated_storage_code.snap +0 -310
  227. package/contracts/common-macros/src/tests.rs +0 -287
  228. package/contracts/oapp-macros/tests/test_macros.rs +0 -522
  229. package/contracts/workers/executor/src/executor.rs +0 -347
  230. package/contracts/workers/executor/src/interfaces/types.rs +0 -51
  231. package/contracts/workers/worker-common/src/constants.rs +0 -17
  232. package/contracts/workers/worker-common/src/errors.rs +0 -6
  233. package/contracts/workers/worker-common/src/events.rs +0 -34
  234. package/contracts/workers/worker-common/src/interfaces/executor_fee_lib.rs +0 -35
  235. package/contracts/workers/worker-common/src/interfaces/price_feed.rs +0 -40
  236. package/contracts/workers/worker-common/src/interfaces/worker.rs +0 -60
  237. package/contracts/workers/worker-common/src/lib.rs +0 -19
  238. package/contracts/workers/worker-common/src/storage.rs +0 -32
  239. package/contracts/workers/worker-common/src/worker_common.rs +0 -166
@@ -5,56 +5,73 @@
5
5
  //! - Ownable trait implementation
6
6
  //! - TtlConfigurable trait implementation with owner auth checks
7
7
 
8
- use proc_macro2::TokenStream as TokenStream2;
8
+ use proc_macro2::TokenStream;
9
9
  use quote::quote;
10
10
 
11
11
  /// Generates the TtlConfigurable trait implementation for a contract.
12
12
  ///
13
13
  /// The implementation delegates to `DefaultTtlConfigurable` and adds
14
14
  /// owner authentication checks for mutating functions.
15
- pub fn generate_ttl_configurable_impl(input: &syn::ItemStruct) -> TokenStream2 {
16
- let name = &input.ident;
15
+ pub fn generate_ttl_configurable_impl(input: TokenStream) -> TokenStream {
16
+ let item_struct: syn::ItemStruct = syn::parse2(input).unwrap_or_else(|e| panic!("failed to parse struct: {}", e));
17
+ let name = &item_struct.ident;
18
+
17
19
  let expanded = quote! {
18
20
  use utils::ttl::TtlConfigurable as _;
19
21
 
22
+ // TODO: should use custom contract_impl macro instead of soroban_sdk::contractimpl
20
23
  #[soroban_sdk::contractimpl]
21
24
  impl utils::ttl::TtlConfigurable for #name {
22
25
 
23
26
  #[common_macros::only_owner]
24
- fn set_ttl_config(
27
+ fn set_ttl_configs(
25
28
  env: &soroban_sdk::Env,
26
29
  instance: &Option<utils::ttl::TtlConfig>,
27
30
  persistent: &Option<utils::ttl::TtlConfig>,
28
- temporary: &Option<utils::ttl::TtlConfig>,
29
31
  ) {
30
- utils::ttl::DefaultTtlConfigurable::set_ttl_config(env, instance, persistent, temporary);
32
+ utils::ttl::DefaultTtlConfigurable::set_ttl_configs(env, instance, persistent);
31
33
  }
32
34
 
33
- fn ttl_config(
35
+ fn ttl_configs(
34
36
  env: &soroban_sdk::Env,
35
37
  ) -> (
36
38
  Option<utils::ttl::TtlConfig>,
37
39
  Option<utils::ttl::TtlConfig>,
38
- Option<utils::ttl::TtlConfig>,
39
40
  ) {
40
- utils::ttl::DefaultTtlConfigurable::ttl_config(env)
41
+ utils::ttl::DefaultTtlConfigurable::ttl_configs(env)
41
42
  }
42
43
 
43
44
  #[common_macros::only_owner]
44
- fn freeze_ttl_config(env: &soroban_sdk::Env) {
45
- utils::ttl::DefaultTtlConfigurable::freeze_ttl_config(env);
45
+ fn freeze_ttl_configs(env: &soroban_sdk::Env) {
46
+ utils::ttl::DefaultTtlConfigurable::freeze_ttl_configs(env);
46
47
  }
47
48
 
48
- fn is_ttl_config_frozen(env: &soroban_sdk::Env) -> bool {
49
- utils::ttl::DefaultTtlConfigurable::is_ttl_config_frozen(env)
49
+ fn is_ttl_configs_frozen(env: &soroban_sdk::Env) -> bool {
50
+ utils::ttl::DefaultTtlConfigurable::is_ttl_configs_frozen(env)
50
51
  }
51
52
  }
52
53
  };
53
54
 
55
+ let inherent_impl = quote! {
56
+ #[soroban_sdk::contractimpl]
57
+ impl #name {
58
+ /// Extends the instance TTL.
59
+ ///
60
+ /// # Arguments
61
+ ///
62
+ /// * `threshold` - The threshold to extend the TTL.
63
+ /// * `extend_to` - The TTL to extend to.
64
+ pub fn extend_instance_ttl(env: &soroban_sdk::Env, threshold: u32, extend_to: u32) {
65
+ env.storage().instance().extend_ttl(threshold, extend_to);
66
+ }
67
+ }
68
+ };
69
+
54
70
  quote! {
55
71
  #[common_macros::ownable]
56
- #input
72
+ #item_struct
57
73
 
58
74
  #expanded
75
+ #inherent_impl
59
76
  }
60
77
  }
@@ -0,0 +1,27 @@
1
+ use syn::{punctuated::Punctuated, token::Comma, FnArg, Ident, Pat, Type, TypePath};
2
+
3
+ /// Finds the `Env` argument identifier in a function signature.
4
+ pub fn find_env_ident(args: &Punctuated<FnArg, Comma>) -> Option<&Ident> {
5
+ args.iter().find_map(|arg| {
6
+ let FnArg::Typed(pat_type) = arg else { return None };
7
+ if !is_env_type(&pat_type.ty) {
8
+ return None;
9
+ }
10
+ let Pat::Ident(pat) = pat_type.pat.as_ref() else { return None };
11
+ Some(&pat.ident)
12
+ })
13
+ }
14
+
15
+ /// Expects the `Env` argument identifier in a function signature.
16
+ pub fn expect_env_ident(args: &Punctuated<FnArg, Comma>) -> &Ident {
17
+ find_env_ident(args).expect("function must have an Env argument")
18
+ }
19
+
20
+ /// Checks if a type is an `Env` type.
21
+ pub fn is_env_type(ty: &Type) -> bool {
22
+ match ty {
23
+ Type::Path(TypePath { path, .. }) => path.segments.last().is_some_and(|seg| seg.ident == "Env"),
24
+ Type::Reference(r) => is_env_type(&r.elem),
25
+ _ => false,
26
+ }
27
+ }
@@ -95,7 +95,7 @@ The main Soroban contract that implements all interfaces and delegates to intern
95
95
  #[contract]
96
96
  pub struct EndpointV2;
97
97
 
98
- #[contractimpl]
98
+ #[contract_impl]
99
99
  impl EndpointV2 {
100
100
  pub fn __constructor(env: &Env, eid: u32, native_token: &Address, owner: &Address) {
101
101
  storage::EndpointData::set_eid(env, eid);
@@ -103,13 +103,13 @@ impl EndpointV2 {
103
103
  ownable::set_owner(env, owner);
104
104
  }
105
105
 
106
- pub fn set_ttl_config(env: &Env, ...) {
106
+ pub fn set_ttl_configs(env: &Env, ...) {
107
107
  ownable::require_owner_auth(env);
108
108
  // Configure TTL settings for storage
109
109
  }
110
110
  }
111
111
 
112
- #[contractimpl]
112
+ #[contract_impl]
113
113
  impl ILayerZeroEndpointV2 for EndpointV2 {
114
114
  fn send(env: &Env, sender: &Address, params: &MessagingParams, ...) -> MessagingReceipt {
115
115
  sender.require_auth();
@@ -123,7 +123,7 @@ impl ILayerZeroEndpointV2 for EndpointV2 {
123
123
  }
124
124
  }
125
125
 
126
- #[contractimpl]
126
+ #[contract_impl]
127
127
  impl Ownable for EndpointV2 {
128
128
  // Ownership management
129
129
  }
@@ -16,20 +16,18 @@ use crate::{
16
16
  FeeRecipient, FeesAndPacket, IMessagingComposer, LayerZeroReceiverClient, MessageLibClient, MessageLibType,
17
17
  MessagingParams, OutboundPacket, ResolvedLibrary, SendLibClient, SetConfigParam, Timeout,
18
18
  };
19
- use common_macros::{only_owner, ttl_configurable};
20
- use soroban_sdk::{
21
- assert_with_error, contract, contractimpl, token::TokenClient, vec, Address, Bytes, BytesN, Env, Vec,
22
- };
19
+ use common_macros::{contract_impl, only_owner, ttl_configurable};
20
+ use soroban_sdk::{assert_with_error, contract, token::TokenClient, vec, Address, Bytes, BytesN, Env, Vec};
23
21
  use utils::option_ext::OptionExt;
24
22
 
25
23
  #[contract]
26
24
  #[ttl_configurable]
27
25
  pub struct EndpointV2;
28
26
 
29
- #[contractimpl]
27
+ #[contract_impl]
30
28
  impl EndpointV2 {
31
29
  pub fn __constructor(env: &Env, owner: &Address) {
32
- Self::__init_owner(env, owner);
30
+ Self::init_owner(env, owner);
33
31
  }
34
32
 
35
33
  /// Recovers tokens sent to this contract by mistake.
@@ -48,7 +46,7 @@ impl EndpointV2 {
48
46
  // ILayerZeroEndpointV2 Implementation
49
47
  // ============================================================================
50
48
 
51
- #[contractimpl]
49
+ #[contract_impl]
52
50
  impl ILayerZeroEndpointV2 for EndpointV2 {
53
51
  /// Quotes the messaging fee for sending a cross-chain message.
54
52
  fn quote(env: &Env, sender: &Address, params: &MessagingParams) -> MessagingFee {
@@ -161,7 +159,9 @@ impl ILayerZeroEndpointV2 for EndpointV2 {
161
159
  DelegateSet { oapp: oapp.clone(), delegate: new_delegate.clone() }.publish(env);
162
160
  }
163
161
 
164
- // === View Functions ===
162
+ // ============================================================================================
163
+ // View Functions
164
+ // ============================================================================================
165
165
 
166
166
  /// Returns the endpoint ID.
167
167
  fn eid(_env: &Env) -> u32 {
@@ -197,9 +197,9 @@ impl ILayerZeroEndpointV2 for EndpointV2 {
197
197
  }
198
198
  }
199
199
 
200
- // ============================================================================
200
+ // ============================================================================================
201
201
  // Internal Functions
202
- // ============================================================================
202
+ // ============================================================================================
203
203
 
204
204
  impl EndpointV2 {
205
205
  /// Builds an outbound packet with the given parameters.
@@ -259,7 +259,7 @@ impl EndpointV2 {
259
259
  let mut native_fee_supplied = native_token_client.balance(&this_contract);
260
260
  native_fee_recipients.iter().filter(|r| r.amount > 0).for_each(|r| {
261
261
  assert_with_error!(env, native_fee_supplied >= r.amount, EndpointError::InsufficientNativeFee);
262
- native_token_client.transfer(&this_contract, &r.address, &r.amount);
262
+ native_token_client.transfer(&this_contract, &r.to, &r.amount);
263
263
  native_fee_supplied -= r.amount;
264
264
  fee_paid.native_fee += r.amount;
265
265
  });
@@ -282,7 +282,7 @@ impl EndpointV2 {
282
282
 
283
283
  zro_fee_recipients.iter().filter(|r| r.amount > 0).for_each(|r| {
284
284
  assert_with_error!(env, zro_fee_supplied >= r.amount, EndpointError::InsufficientZROFee);
285
- zro_client.transfer(&this_contract, &r.address, &r.amount);
285
+ zro_client.transfer(&this_contract, &r.to, &r.amount);
286
286
  zro_fee_supplied -= r.amount;
287
287
  fee_paid.zro_fee += r.amount;
288
288
  });
@@ -300,6 +300,9 @@ impl EndpointV2 {
300
300
  // Include Modules
301
301
  // ============================================================================
302
302
 
303
- include!("message_lib_manager.rs");
304
- include!("messaging_channel.rs");
305
- include!("messaging_composer.rs");
303
+ #[path = "message_lib_manager.rs"]
304
+ mod message_lib_manager;
305
+ #[path = "messaging_channel.rs"]
306
+ mod messaging_channel;
307
+ #[path = "messaging_composer.rs"]
308
+ mod messaging_composer;
@@ -1,6 +1,5 @@
1
- use soroban_sdk::{contractclient, contracttype, Address, Bytes, Env, Vec};
2
-
3
1
  use crate::SetConfigParam;
2
+ use soroban_sdk::{contracttrait, contracttype, Address, Bytes, Env, Vec};
4
3
 
5
4
  /// Type of message library indicating supported operations.
6
5
  #[contracttype]
@@ -31,7 +30,7 @@ pub struct MessageLibVersion {
31
30
  }
32
31
 
33
32
  /// Interface for message libraries that handle cross-chain message verification and delivery.
34
- #[contractclient(name = "MessageLibClient")]
33
+ #[contracttrait(client_name = "MessageLibClient")]
35
34
  pub trait IMessageLib {
36
35
  /// Sets the configuration for an OApp by the Endpoint.
37
36
  ///
@@ -1,4 +1,4 @@
1
- use soroban_sdk::{contractclient, contracttype, Address, Bytes, Env, Vec};
1
+ use soroban_sdk::{contracttrait, contracttype, Address, Bytes, Env, Vec};
2
2
 
3
3
  /// Timeout configuration for receive library transitions.
4
4
  #[contracttype]
@@ -45,7 +45,7 @@ pub struct ResolvedLibrary {
45
45
  }
46
46
 
47
47
  /// EndpointV2's Interface for managing message libraries.
48
- #[contractclient(name = "MessageLibManagerClient")]
48
+ #[contracttrait(client_name = "MessageLibManagerClient")]
49
49
  pub trait IMessageLibManager {
50
50
  /// Registers a new message library with the endpoint.
51
51
  ///
@@ -136,7 +136,9 @@ pub trait IMessageLibManager {
136
136
  /// * `lib` - The library address to check
137
137
  fn is_valid_receive_library(env: &Env, receiver: &Address, src_eid: u32, lib: &Address) -> bool;
138
138
 
139
- // === OApp Control Functions ===
139
+ // ============================================================================================
140
+ // OApp Control Functions
141
+ // ============================================================================================
140
142
 
141
143
  /// Sets or removes a custom send library for an OApp.
142
144
  ///
@@ -1,7 +1,7 @@
1
- use soroban_sdk::{contractclient, Address, BytesN, Env};
1
+ use soroban_sdk::{contracttrait, Address, BytesN, Env};
2
2
 
3
3
  /// EndpointV2's Interface for managing messaging channels, nonces, and payload hashes.
4
- #[contractclient(name = "MessagingChannelClient")]
4
+ #[contracttrait(client_name = "MessagingChannelClient")]
5
5
  pub trait IMessagingChannel {
6
6
  /// Skips the next expected inbound nonce without verifying.
7
7
  ///
@@ -1,7 +1,7 @@
1
- use soroban_sdk::{contractclient, Address, Bytes, BytesN, Env};
1
+ use soroban_sdk::{contracttrait, Address, Bytes, BytesN, Env};
2
2
 
3
3
  /// EndpointV2's Interface for managing composed messages between OApps and composers.
4
- #[contractclient(name = "MessagingComposerClient")]
4
+ #[contracttrait(client_name = "MessagingComposerClient")]
5
5
  pub trait IMessagingComposer {
6
6
  /// Sends a composed message from an OApp to a composer.
7
7
  /// The OApp can send compose to multiple composers with the same GUID.
@@ -1,5 +1,5 @@
1
1
  use super::{IMessageLib, MessagingFee};
2
- use soroban_sdk::{contractclient, contracttype, Address, Bytes, BytesN, Env, Vec};
2
+ use soroban_sdk::{contracttrait, contracttype, Address, Bytes, BytesN, Env, Vec};
3
3
 
4
4
  /// Outbound packet containing all information for cross-chain transmission.
5
5
  #[contracttype]
@@ -25,8 +25,8 @@ pub struct OutboundPacket {
25
25
  #[contracttype]
26
26
  #[derive(Clone, Debug, Eq, PartialEq)]
27
27
  pub struct FeeRecipient {
28
- /// Address to receive the fee.
29
- pub address: Address,
28
+ /// The address to send the fee to.
29
+ pub to: Address,
30
30
  /// Amount of fee to pay.
31
31
  pub amount: i128,
32
32
  }
@@ -44,7 +44,7 @@ pub struct FeesAndPacket {
44
44
  }
45
45
 
46
46
  /// Interface for send libraries that handle outbound message encoding and fee calculation.
47
- #[contractclient(name = "SendLibClient")]
47
+ #[contracttrait(client_name = "SendLibClient")]
48
48
  pub trait ISendLib: IMessageLib {
49
49
  /// Quotes the fee for sending a packet without actually sending.
50
50
  ///
@@ -1,19 +1,20 @@
1
1
  #![no_std]
2
2
 
3
+ pub mod constants;
4
+ mod errors;
5
+ pub mod events;
3
6
  mod interfaces;
7
+ pub mod util;
4
8
 
9
+ pub use errors::*;
5
10
  pub use interfaces::*;
6
- pub mod util;
7
11
 
8
12
  cfg_if::cfg_if! {
9
13
  // Include implementation when NOT in library mode, OR when testutils is enabled (for tests)
10
14
  if #[cfg(any(not(feature = "library"), feature = "testutils"))] {
11
15
  mod endpoint_v2;
12
- mod errors;
13
- mod events;
14
16
  mod storage;
15
- mod constants;
16
-
17
+ // Export the contract and client for testing purposes
17
18
  pub use endpoint_v2::{EndpointV2, EndpointV2Client};
18
19
  }
19
20
  }
@@ -1,4 +1,6 @@
1
- #[contractimpl]
1
+ use super::*;
2
+
3
+ #[contract_impl(contracttrait)]
2
4
  impl IMessageLibManager for EndpointV2 {
3
5
  /// Registers a new message library with the endpoint.
4
6
  #[only_owner]
@@ -71,7 +73,9 @@ impl IMessageLibManager for EndpointV2 {
71
73
  DefaultReceiveLibraryTimeoutSet { src_eid, timeout: timeout.clone() }.publish(env);
72
74
  }
73
75
 
74
- // === OApp Control Functions ===
76
+ // ============================================================================================
77
+ // OApp Control Functions
78
+ // ============================================================================================
75
79
 
76
80
  /// Sets or removes a custom send library for an OApp to a specific destination endpoint.
77
81
  fn set_send_library(env: &Env, caller: &Address, sender: &Address, dst_eid: u32, new_lib: &Option<Address>) {
@@ -164,7 +168,9 @@ impl IMessageLibManager for EndpointV2 {
164
168
  MessageLibClient::new(env, lib).set_config(oapp, params);
165
169
  }
166
170
 
167
- // === View Functions ===
171
+ // ============================================================================================
172
+ // View Functions
173
+ // ============================================================================================
168
174
 
169
175
  /// Checks if a message library is registered.
170
176
  fn is_registered_library(env: &Env, lib: &Address) -> bool {
@@ -215,7 +221,9 @@ impl IMessageLibManager for EndpointV2 {
215
221
  EndpointStorage::default_receive_library_timeout(env, src_eid)
216
222
  }
217
223
 
218
- // === OApp View Functions ===
224
+ // ============================================================================================
225
+ // OApp View Functions
226
+ // ============================================================================================
219
227
 
220
228
  /// Returns the effective send library for an OApp and destination endpoint.
221
229
  fn get_send_library(env: &Env, sender: &Address, dst_eid: u32) -> ResolvedLibrary {
@@ -269,9 +277,9 @@ impl IMessageLibManager for EndpointV2 {
269
277
  }
270
278
  }
271
279
 
272
- // ============================================================================
280
+ // ============================================================================================
273
281
  // Internal Functions
274
- // ============================================================================
282
+ // ============================================================================================
275
283
 
276
284
  impl EndpointV2 {
277
285
  /// Requires a message library to be registered.
@@ -1,4 +1,6 @@
1
- #[contractimpl]
1
+ use super::*;
2
+
3
+ #[contract_impl(contracttrait)]
2
4
  impl IMessagingChannel for EndpointV2 {
3
5
  /// Skips the next expected inbound nonce without verifying.
4
6
  ///
@@ -77,7 +79,9 @@ impl IMessagingChannel for EndpointV2 {
77
79
  .publish(env);
78
80
  }
79
81
 
80
- // === View Functions ===
82
+ // ============================================================================================
83
+ // View Functions
84
+ // ============================================================================================
81
85
 
82
86
  /// Generates the next GUID for an outbound packet.
83
87
  fn next_guid(env: &Env, sender: &Address, dst_eid: u32, receiver: &BytesN<32>) -> BytesN<32> {
@@ -1,4 +1,6 @@
1
- #[contractimpl]
1
+ use super::*;
2
+
3
+ #[contract_impl(contracttrait)]
2
4
  impl IMessagingComposer for EndpointV2 {
3
5
  /// Sends a composed message from an OApp to a composer.
4
6
  ///
@@ -67,7 +69,9 @@ impl IMessagingComposer for EndpointV2 {
67
69
  .publish(env);
68
70
  }
69
71
 
70
- // === View Functions ===
72
+ // ============================================================================================
73
+ // View Functions
74
+ // ============================================================================================
71
75
 
72
76
  /// Returns the stored hash for a composed message, or `None` if not queued.
73
77
  fn compose_queue(env: &Env, from: &Address, to: &Address, guid: &BytesN<32>, index: u32) -> Option<BytesN<32>> {
@@ -1,9 +1,8 @@
1
1
  use crate::Timeout;
2
2
  use common_macros::storage;
3
3
  use soroban_sdk::{Address, BytesN};
4
- use utils::ttl::DefaultTtlConfigProvider;
5
4
 
6
- #[storage(DefaultTtlConfigProvider)]
5
+ #[storage]
7
6
  pub enum EndpointStorage {
8
7
  /// The ZRO token address
9
8
  #[instance(Address)]
@@ -13,7 +12,9 @@ pub enum EndpointStorage {
13
12
  #[persistent(Address)]
14
13
  Delegate { oapp: Address },
15
14
 
16
- /// === Messaging Channel ===
15
+ /// ============================================================================================
16
+ /// Messaging Channel
17
+ /// ============================================================================================
17
18
 
18
19
  /// The lazy inbound nonce for a receiver
19
20
  #[persistent(u64)]
@@ -22,7 +23,6 @@ pub enum EndpointStorage {
22
23
 
23
24
  /// The inbound payload hash for a receiver
24
25
  #[persistent(BytesN<32>)]
25
- #[no_auto_ttl_extension]
26
26
  InboundPayloadHash { receiver: Address, src_eid: u32, sender: BytesN<32>, nonce: u64 },
27
27
 
28
28
  /// The outbound nonce for a sender
@@ -30,7 +30,9 @@ pub enum EndpointStorage {
30
30
  #[default(0)]
31
31
  OutboundNonce { sender: Address, dst_eid: u32, receiver: BytesN<32> },
32
32
 
33
- /// === Message Lib Manager ===
33
+ /// ============================================================================================
34
+ /// Message Lib Manager
35
+ /// ============================================================================================
34
36
 
35
37
  /// The number of registered libraries
36
38
  #[instance(u32)]
@@ -69,10 +71,11 @@ pub enum EndpointStorage {
69
71
  #[persistent(Timeout)]
70
72
  ReceiveLibraryTimeout { receiver: Address, src_eid: u32 },
71
73
 
72
- /// === Messaging Composer ===
74
+ /// ============================================================================================
75
+ /// Messaging Composer
76
+ /// ============================================================================================
73
77
 
74
78
  /// The compose queue for a sender and receiver
75
79
  #[persistent(BytesN<32>)]
76
- #[no_auto_ttl_extension]
77
80
  ComposeQueue { from: Address, to: Address, guid: BytesN<32>, index: u32 },
78
81
  }
@@ -13,7 +13,7 @@ fn test_pay_native_fees_exact_amount() {
13
13
  context.mint_native(&endpoint_client.address, 100);
14
14
 
15
15
  let mut native_fee_recipients = Vec::new(env);
16
- native_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 100 });
16
+ native_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 100 });
17
17
  let send_result =
18
18
  FeesAndPacket { native_fee_recipients, zro_fee_recipients: Vec::new(env), encoded_packet: Bytes::new(env) };
19
19
 
@@ -50,7 +50,7 @@ fn test_pay_native_fees_with_refund() {
50
50
  context.mint_native(&endpoint_client.address, 200);
51
51
 
52
52
  let mut native_fee_recipients = Vec::new(env);
53
- native_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 100 });
53
+ native_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 100 });
54
54
  let send_result =
55
55
  FeesAndPacket { native_fee_recipients, zro_fee_recipients: Vec::new(env), encoded_packet: Bytes::new(env) };
56
56
 
@@ -91,7 +91,7 @@ fn test_pay_zro_fees_exact_amount() {
91
91
  context.mint_zro(&endpoint_client.address, 50);
92
92
 
93
93
  let mut zro_fee_recipients = Vec::new(env);
94
- zro_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 50 });
94
+ zro_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 50 });
95
95
  let send_result =
96
96
  FeesAndPacket { native_fee_recipients: Vec::new(env), zro_fee_recipients, encoded_packet: Bytes::new(env) };
97
97
 
@@ -132,7 +132,7 @@ fn test_pay_zro_fees_with_refund() {
132
132
  context.mint_zro(&endpoint_client.address, 100);
133
133
 
134
134
  let mut zro_fee_recipients = Vec::new(env);
135
- zro_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 50 });
135
+ zro_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 50 });
136
136
  let send_result =
137
137
  FeesAndPacket { native_fee_recipients: Vec::new(env), zro_fee_recipients, encoded_packet: Bytes::new(env) };
138
138
 
@@ -175,9 +175,9 @@ fn test_pay_mixed_native_and_zro_fees() {
175
175
  context.mint_zro(&endpoint_client.address, 50);
176
176
 
177
177
  let mut native_fee_recipients = Vec::new(env);
178
- native_fee_recipients.push_back(FeeRecipient { address: native_recipient.clone(), amount: 100 });
178
+ native_fee_recipients.push_back(FeeRecipient { to: native_recipient.clone(), amount: 100 });
179
179
  let mut zro_fee_recipients = Vec::new(env);
180
- zro_fee_recipients.push_back(FeeRecipient { address: zro_recipient.clone(), amount: 50 });
180
+ zro_fee_recipients.push_back(FeeRecipient { to: zro_recipient.clone(), amount: 50 });
181
181
  let send_result = FeesAndPacket { native_fee_recipients, zro_fee_recipients, encoded_packet: Bytes::new(env) };
182
182
 
183
183
  let fee = env.as_contract(&endpoint_client.address, || {
@@ -217,9 +217,9 @@ fn test_pay_multiple_recipients_same_token() {
217
217
  context.mint_native(&endpoint_client.address, 300);
218
218
 
219
219
  let mut native_fee_recipients = Vec::new(env);
220
- native_fee_recipients.push_back(FeeRecipient { address: recipient1.clone(), amount: 100 });
221
- native_fee_recipients.push_back(FeeRecipient { address: recipient2.clone(), amount: 150 });
222
- native_fee_recipients.push_back(FeeRecipient { address: recipient3.clone(), amount: 50 });
220
+ native_fee_recipients.push_back(FeeRecipient { to: recipient1.clone(), amount: 100 });
221
+ native_fee_recipients.push_back(FeeRecipient { to: recipient2.clone(), amount: 150 });
222
+ native_fee_recipients.push_back(FeeRecipient { to: recipient3.clone(), amount: 50 });
223
223
  let send_result =
224
224
  FeesAndPacket { native_fee_recipients, zro_fee_recipients: Vec::new(env), encoded_packet: Bytes::new(env) };
225
225
 
@@ -259,8 +259,8 @@ fn test_pay_fees_with_zero_amounts_skipped() {
259
259
  context.mint_native(&endpoint_client.address, 100);
260
260
 
261
261
  let mut native_fee_recipients = Vec::new(env);
262
- native_fee_recipients.push_back(FeeRecipient { address: recipient1.clone(), amount: 100 });
263
- native_fee_recipients.push_back(FeeRecipient { address: recipient2.clone(), amount: 0 }); // Zero amount
262
+ native_fee_recipients.push_back(FeeRecipient { to: recipient1.clone(), amount: 100 });
263
+ native_fee_recipients.push_back(FeeRecipient { to: recipient2.clone(), amount: 0 }); // Zero amount
264
264
  let send_result =
265
265
  FeesAndPacket { native_fee_recipients, zro_fee_recipients: Vec::new(env), encoded_packet: Bytes::new(env) };
266
266
 
@@ -293,7 +293,7 @@ fn test_panic_pay_native_fees_insufficient_balance() {
293
293
  context.mint_native(&endpoint_client.address, 50);
294
294
 
295
295
  let mut native_fee_recipients = Vec::new(env);
296
- native_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 100 });
296
+ native_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 100 });
297
297
  let send_result =
298
298
  FeesAndPacket { native_fee_recipients, zro_fee_recipients: Vec::new(env), encoded_packet: Bytes::new(env) };
299
299
 
@@ -326,7 +326,7 @@ fn test_panic_pay_zro_fees_insufficient_balance() {
326
326
  context.mint_zro(&endpoint_client.address, 25);
327
327
 
328
328
  let mut zro_fee_recipients = Vec::new(env);
329
- zro_fee_recipients.push_back(FeeRecipient { address: recipient.clone(), amount: 50 });
329
+ zro_fee_recipients.push_back(FeeRecipient { to: recipient.clone(), amount: 50 });
330
330
  let send_result =
331
331
  FeesAndPacket { native_fee_recipients: Vec::new(env), zro_fee_recipients, encoded_packet: Bytes::new(env) };
332
332
 
@@ -393,10 +393,10 @@ fn test_pay_fees_with_mixed_zero_and_nonzero_amounts() {
393
393
  context.mint_zro(&endpoint_client.address, 75);
394
394
 
395
395
  let mut native_fee_recipients = Vec::new(env);
396
- native_fee_recipients.push_back(FeeRecipient { address: recipient1.clone(), amount: 100 });
396
+ native_fee_recipients.push_back(FeeRecipient { to: recipient1.clone(), amount: 100 });
397
397
  let mut zro_fee_recipients = Vec::new(env);
398
- zro_fee_recipients.push_back(FeeRecipient { address: recipient2.clone(), amount: 0 }); // Zero ZRO
399
- zro_fee_recipients.push_back(FeeRecipient { address: recipient3.clone(), amount: 50 });
398
+ zro_fee_recipients.push_back(FeeRecipient { to: recipient2.clone(), amount: 0 }); // Zero ZRO
399
+ zro_fee_recipients.push_back(FeeRecipient { to: recipient3.clone(), amount: 50 });
400
400
  let send_result = FeesAndPacket { native_fee_recipients, zro_fee_recipients, encoded_packet: Bytes::new(env) };
401
401
 
402
402
  let fee = env.as_contract(&endpoint_client.address, || {