@layerzerolabs/protocol-stellar-v2 0.2.10 → 0.2.11
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.
- package/.turbo/turbo-build.log +245 -199
- package/.turbo/turbo-lint.log +79 -107
- package/.turbo/turbo-test.log +1017 -841
- package/Cargo.lock +13 -5
- package/contracts/common-macros/src/contract_impl.rs +6 -3
- package/contracts/common-macros/src/error.rs +9 -17
- package/contracts/common-macros/src/event.rs +4 -4
- package/contracts/common-macros/src/lib.rs +2 -2
- package/contracts/common-macros/src/ownable.rs +9 -5
- package/contracts/common-macros/src/tests/contract_impl.rs +178 -86
- package/contracts/common-macros/src/tests/error.rs +168 -0
- package/contracts/common-macros/src/tests/mod.rs +2 -4
- package/contracts/common-macros/src/tests/ownable.rs +37 -60
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__contract_impl__snapshot_generated_contract_impl_code.snap +16 -6
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__error__snapshot_generated_contract_error_code.snap +20 -0
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_generated_ownable_code.snap +3 -1
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ownable__snapshot_only_owner_preserves_function_signature.snap +12 -2
- package/contracts/common-macros/src/tests/snapshots/common_macros__tests__ttl_configurable__snapshot_generated_ttl_configurable_code.snap +5 -1
- package/contracts/common-macros/src/tests/utils.rs +267 -0
- package/contracts/common-macros/src/ttl_configurable.rs +15 -12
- package/contracts/common-macros/src/utils.rs +35 -6
- package/contracts/message-libs/uln-302/src/receive_uln.rs +1 -1
- package/contracts/message-libs/uln-302/src/send_uln.rs +2 -2
- package/contracts/message-libs/uln-302/src/uln302.rs +2 -2
- package/contracts/oapp-macros/src/oapp_core.rs +1 -1
- package/contracts/oapps/oft/integration-tests/setup.rs +4 -3
- package/contracts/oapps/oft/src/default_oft_impl.rs +146 -0
- package/contracts/oapps/oft/src/extensions/mod.rs +3 -0
- package/contracts/oapps/oft/src/extensions/oft_fee.rs +164 -0
- package/contracts/oapps/oft/src/extensions/pausable.rs +50 -0
- package/contracts/oapps/oft/src/extensions/rate_limiter.rs +198 -0
- package/contracts/oapps/oft/src/lib.rs +2 -3
- package/contracts/oapps/oft/src/oft.rs +16 -85
- package/contracts/oapps/oft/src/oft_types/mint_burn.rs +1 -1
- package/contracts/oapps/oft/src/tests/extensions/mod.rs +11 -0
- package/contracts/oapps/oft/src/tests/extensions/setup.rs +888 -0
- package/contracts/oapps/oft/src/tests/extensions/test_oft_fee.rs +749 -0
- package/contracts/oapps/oft/src/tests/extensions/test_pausable.rs +432 -0
- package/contracts/oapps/oft/src/tests/extensions/test_rate_limiter.rs +1078 -0
- package/contracts/oapps/oft/src/tests/mod.rs +2 -0
- package/contracts/oapps/oft/src/tests/test_utils.rs +24 -6
- package/contracts/oapps/{oft-mint-burn → oft-std}/Cargo.toml +1 -8
- package/contracts/oapps/oft-std/src/lib.rs +5 -0
- package/contracts/oapps/oft-std/src/oft.rs +59 -0
- package/contracts/utils/src/ownable.rs +2 -2
- package/contracts/utils/src/tests/ownable.rs +0 -63
- package/contracts/utils/src/ttl.rs +19 -1
- package/contracts/workers/dvn/src/auth.rs +91 -27
- package/contracts/workers/dvn/src/dvn.rs +22 -20
- package/contracts/workers/dvn/src/interfaces/dvn.rs +48 -3
- package/contracts/workers/dvn/src/interfaces/multisig.rs +41 -0
- package/contracts/workers/dvn/src/lib.rs +6 -8
- package/contracts/workers/dvn/src/multisig.rs +6 -3
- package/contracts/workers/dvn/src/tests/auth.rs +1 -1
- package/contracts/workers/dvn/src/tests/dvn.rs +3 -4
- package/contracts/workers/dvn-fee-lib/Cargo.toml +2 -1
- package/contracts/workers/dvn-fee-lib/src/dvn_fee_lib.rs +4 -3
- package/contracts/workers/dvn-fee-lib/src/tests/dvn_fee_lib.rs +8 -6
- package/contracts/workers/executor/src/interfaces/executor.rs +5 -2
- package/contracts/workers/executor/src/lz_executor.rs +6 -6
- package/contracts/workers/price-feed/Cargo.toml +21 -0
- package/contracts/workers/price-feed/src/errors.rs +9 -0
- package/contracts/workers/price-feed/src/events.rs +30 -0
- package/contracts/workers/price-feed/src/lib.rs +11 -0
- package/contracts/workers/price-feed/src/price_feed.rs +265 -0
- package/contracts/workers/price-feed/src/storage.rs +42 -0
- package/contracts/workers/price-feed/src/types.rs +59 -0
- package/contracts/workers/worker/src/interfaces/dvn_fee_lib.rs +2 -1
- package/package.json +3 -3
- package/sdk/dist/generated/bml.js +3 -1
- package/sdk/dist/generated/counter.d.ts +102 -0
- package/sdk/dist/generated/counter.js +13 -1
- package/sdk/dist/generated/endpoint.js +3 -1
- package/sdk/dist/generated/sml.js +3 -1
- package/sdk/dist/generated/uln302.js +3 -1
- package/sdk/package.json +1 -1
- package/contracts/oapps/oft/src/macro_tests/mod.rs +0 -2
- package/contracts/oapps/oft/src/macro_tests/test_all_default.rs +0 -41
- package/contracts/oapps/oft/src/macro_tests/test_override.rs +0 -83
- package/contracts/oapps/oft-mint-burn/src/lib.rs +0 -3
- package/contracts/oapps/oft-mint-burn/src/oft.rs +0 -28
- package/contracts/oapps/oft-mint-burn/src/tests/mod.rs +0 -1
- package/contracts/workers/dvn/src/types.rs +0 -26
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
use soroban_sdk::contracttype;
|
|
2
|
+
use worker::Price;
|
|
3
|
+
|
|
4
|
+
/// Arbitrum-specific price extension
|
|
5
|
+
#[contracttype]
|
|
6
|
+
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
7
|
+
pub struct ArbitrumPriceExt {
|
|
8
|
+
/// Gas overhead per L2 transaction
|
|
9
|
+
pub gas_per_l2_tx: u64,
|
|
10
|
+
|
|
11
|
+
/// Gas cost per byte of L1 calldata (for Arbitrum's L1 data posting)
|
|
12
|
+
pub gas_per_l1_calldata_byte: u32,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/// Parameter for updating a single price
|
|
16
|
+
#[contracttype]
|
|
17
|
+
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
18
|
+
pub struct UpdatePrice {
|
|
19
|
+
/// Destination endpoint ID
|
|
20
|
+
pub eid: u32,
|
|
21
|
+
|
|
22
|
+
/// Price information for the destination
|
|
23
|
+
pub price: Price,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// Parameter for updating Arbitrum price with extension
|
|
27
|
+
#[contracttype]
|
|
28
|
+
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
29
|
+
pub struct UpdatePriceExt {
|
|
30
|
+
/// Destination endpoint ID (should be an Arbitrum endpoint)
|
|
31
|
+
pub eid: u32,
|
|
32
|
+
|
|
33
|
+
/// Price information for the destination
|
|
34
|
+
pub price: Price,
|
|
35
|
+
|
|
36
|
+
/// Arbitrum-specific pricing extension
|
|
37
|
+
pub extend: ArbitrumPriceExt,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Fee model type for different chain architectures
|
|
41
|
+
#[contracttype]
|
|
42
|
+
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
43
|
+
#[repr(u32)]
|
|
44
|
+
pub enum ModelType {
|
|
45
|
+
Default = 0,
|
|
46
|
+
ArbStack = 1,
|
|
47
|
+
OpStack = 2,
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/// Parameter for setting EID to model type mapping
|
|
51
|
+
#[contracttype]
|
|
52
|
+
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
53
|
+
pub struct SetEidToModelTypeParam {
|
|
54
|
+
/// Destination endpoint ID
|
|
55
|
+
pub dst_eid: u32,
|
|
56
|
+
|
|
57
|
+
/// Fee model type for this destination
|
|
58
|
+
pub model_type: ModelType,
|
|
59
|
+
}
|
|
@@ -67,9 +67,10 @@ pub trait IDvnFeeLib {
|
|
|
67
67
|
/// - Price ratios between source and destination chains
|
|
68
68
|
///
|
|
69
69
|
/// # Arguments
|
|
70
|
+
/// * `dvn` - The DVN contract address
|
|
70
71
|
/// * `params` - Fee calculation parameters
|
|
71
72
|
///
|
|
72
73
|
/// # Returns
|
|
73
74
|
/// The calculated fee in native token units (stroops for Stellar).
|
|
74
|
-
fn get_fee(env: &Env, params: &DvnFeeParams) -> i128;
|
|
75
|
+
fn get_fee(env: &Env, dvn: &Address, params: &DvnFeeParams) -> i128;
|
|
75
76
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/protocol-stellar-v2",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/node": "^22.18.6",
|
|
7
7
|
"tsx": "^4.19.3",
|
|
8
8
|
"typescript": "^5.8.2",
|
|
9
|
-
"@layerzerolabs/common-node-utils": "0.2.
|
|
10
|
-
"@layerzerolabs/vm-tooling-stellar": "0.2.
|
|
9
|
+
"@layerzerolabs/common-node-utils": "0.2.11",
|
|
10
|
+
"@layerzerolabs/vm-tooling-stellar": "0.2.11"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"access": "restricted",
|
|
@@ -103,7 +103,9 @@ export class Client extends ContractClient {
|
|
|
103
103
|
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gb3duZXJzaGlwIGlzIHJlbm91bmNlZC4AAAAAAAAAAAAST3duZXJzaGlwUmVub3VuY2VkAAAAAAABAAAAEk93bmVyc2hpcFJlbm91bmNlZAAAAAAAAQAAAAAAAAAJb2xkX293bmVyAAAAAAAAEwAAAAAAAAAC",
|
|
104
104
|
"AAAAAgAAAAAAAAAAAAAAFURlZmF1bHRPd25hYmxlU3RvcmFnZQAAAAAAAAEAAAAAAAAAAAAAAAVPd25lcgAAAA==",
|
|
105
105
|
"AAAAAQAAAFdBIHBhaXIgb2YgVFRMIHZhbHVlczogdGhyZXNob2xkICh3aGVuIHRvIHRyaWdnZXIgZXh0ZW5zaW9uKSBhbmQgZXh0ZW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export interface Client {
|
|
|
473
473
|
*/
|
|
474
474
|
simulate?: boolean;
|
|
475
475
|
}) => Promise<AssembledTransaction<null>>;
|
|
476
|
+
/**
|
|
477
|
+
* Construct and simulate a set_ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
478
|
+
*/
|
|
479
|
+
set_ttl_configs: ({ instance, persistent }: {
|
|
480
|
+
instance: Option<TtlConfig>;
|
|
481
|
+
persistent: Option<TtlConfig>;
|
|
482
|
+
}, txnOptions?: {
|
|
483
|
+
/**
|
|
484
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
485
|
+
*/
|
|
486
|
+
fee?: number;
|
|
487
|
+
/**
|
|
488
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
489
|
+
*/
|
|
490
|
+
timeoutInSeconds?: number;
|
|
491
|
+
/**
|
|
492
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
493
|
+
*/
|
|
494
|
+
simulate?: boolean;
|
|
495
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
496
|
+
/**
|
|
497
|
+
* Construct and simulate a ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
498
|
+
*/
|
|
499
|
+
ttl_configs: (txnOptions?: {
|
|
500
|
+
/**
|
|
501
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
502
|
+
*/
|
|
503
|
+
fee?: number;
|
|
504
|
+
/**
|
|
505
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
506
|
+
*/
|
|
507
|
+
timeoutInSeconds?: number;
|
|
508
|
+
/**
|
|
509
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
510
|
+
*/
|
|
511
|
+
simulate?: boolean;
|
|
512
|
+
}) => Promise<AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>>;
|
|
513
|
+
/**
|
|
514
|
+
* Construct and simulate a freeze_ttl_configs transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
515
|
+
*/
|
|
516
|
+
freeze_ttl_configs: (txnOptions?: {
|
|
517
|
+
/**
|
|
518
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
519
|
+
*/
|
|
520
|
+
fee?: number;
|
|
521
|
+
/**
|
|
522
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
523
|
+
*/
|
|
524
|
+
timeoutInSeconds?: number;
|
|
525
|
+
/**
|
|
526
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
527
|
+
*/
|
|
528
|
+
simulate?: boolean;
|
|
529
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
530
|
+
/**
|
|
531
|
+
* Construct and simulate a is_ttl_configs_frozen transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
532
|
+
*/
|
|
533
|
+
is_ttl_configs_frozen: (txnOptions?: {
|
|
534
|
+
/**
|
|
535
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
536
|
+
*/
|
|
537
|
+
fee?: number;
|
|
538
|
+
/**
|
|
539
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
540
|
+
*/
|
|
541
|
+
timeoutInSeconds?: number;
|
|
542
|
+
/**
|
|
543
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
544
|
+
*/
|
|
545
|
+
simulate?: boolean;
|
|
546
|
+
}) => Promise<AssembledTransaction<boolean>>;
|
|
547
|
+
/**
|
|
548
|
+
* Construct and simulate a extend_instance_ttl transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
549
|
+
* Extends the instance TTL.
|
|
550
|
+
*
|
|
551
|
+
* # Arguments
|
|
552
|
+
*
|
|
553
|
+
* * `threshold` - The threshold to extend the TTL.
|
|
554
|
+
* * `extend_to` - The TTL to extend to.
|
|
555
|
+
*/
|
|
556
|
+
extend_instance_ttl: ({ threshold, extend_to }: {
|
|
557
|
+
threshold: u32;
|
|
558
|
+
extend_to: u32;
|
|
559
|
+
}, txnOptions?: {
|
|
560
|
+
/**
|
|
561
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
562
|
+
*/
|
|
563
|
+
fee?: number;
|
|
564
|
+
/**
|
|
565
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
566
|
+
*/
|
|
567
|
+
timeoutInSeconds?: number;
|
|
568
|
+
/**
|
|
569
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
570
|
+
*/
|
|
571
|
+
simulate?: boolean;
|
|
572
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
476
573
|
/**
|
|
477
574
|
* Construct and simulate a quote transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
478
575
|
*/
|
|
@@ -977,6 +1074,11 @@ export declare class Client extends ContractClient {
|
|
|
977
1074
|
owner: (json: string) => AssembledTransaction<Option<string>>;
|
|
978
1075
|
transfer_ownership: (json: string) => AssembledTransaction<null>;
|
|
979
1076
|
renounce_ownership: (json: string) => AssembledTransaction<null>;
|
|
1077
|
+
set_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
1078
|
+
ttl_configs: (json: string) => AssembledTransaction<readonly [Option<TtlConfig>, Option<TtlConfig>]>;
|
|
1079
|
+
freeze_ttl_configs: (json: string) => AssembledTransaction<null>;
|
|
1080
|
+
is_ttl_configs_frozen: (json: string) => AssembledTransaction<boolean>;
|
|
1081
|
+
extend_instance_ttl: (json: string) => AssembledTransaction<null>;
|
|
980
1082
|
quote: (json: string) => AssembledTransaction<MessagingFee>;
|
|
981
1083
|
increment: (json: string) => AssembledTransaction<null>;
|
|
982
1084
|
set_ordered_nonce: (json: string) => AssembledTransaction<null>;
|
|
@@ -74,6 +74,11 @@ export class Client extends ContractClient {
|
|
|
74
74
|
"AAAAAAAAAAAAAAAFb3duZXIAAAAAAAAAAAAAAQAAA+gAAAAT",
|
|
75
75
|
"AAAAAAAAAAAAAAASdHJhbnNmZXJfb3duZXJzaGlwAAAAAAABAAAAAAAAAAluZXdfb3duZXIAAAAAAAATAAAAAA==",
|
|
76
76
|
"AAAAAAAAAAAAAAAScmVub3VuY2Vfb3duZXJzaGlwAAAAAAAAAAAAAA==",
|
|
77
|
+
"AAAAAAAAAAAAAAAPc2V0X3R0bF9jb25maWdzAAAAAAIAAAAAAAAACGluc3RhbmNlAAAD6AAAB9AAAAAJVHRsQ29uZmlnAAAAAAAAAAAAAApwZXJzaXN0ZW50AAAAAAPoAAAH0AAAAAlUdGxDb25maWcAAAAAAAAA",
|
|
78
|
+
"AAAAAAAAAAAAAAALdHRsX2NvbmZpZ3MAAAAAAAAAAAEAAAPtAAAAAgAAA+gAAAfQAAAACVR0bENvbmZpZwAAAAAAA+gAAAfQAAAACVR0bENvbmZpZwAAAA==",
|
|
79
|
+
"AAAAAAAAAAAAAAASZnJlZXplX3R0bF9jb25maWdzAAAAAAAAAAAAAA==",
|
|
80
|
+
"AAAAAAAAAAAAAAAVaXNfdHRsX2NvbmZpZ3NfZnJvemVuAAAAAAAAAAAAAAEAAAAB",
|
|
81
|
+
"AAAAAAAAAH5FeHRlbmRzIHRoZSBpbnN0YW5jZSBUVEwuCgojIEFyZ3VtZW50cwoKKiBgdGhyZXNob2xkYCAtIFRoZSB0aHJlc2hvbGQgdG8gZXh0ZW5kIHRoZSBUVEwuCiogYGV4dGVuZF90b2AgLSBUaGUgVFRMIHRvIGV4dGVuZCB0by4AAAAAABNleHRlbmRfaW5zdGFuY2VfdHRsAAAAAAIAAAAAAAAACXRocmVzaG9sZAAAAAAAAAQAAAAAAAAACWV4dGVuZF90bwAAAAAAAAQAAAAA",
|
|
77
82
|
"AAAAAAAAAAAAAAANX19jb25zdHJ1Y3RvcgAAAAAAAAMAAAAAAAAABW93bmVyAAAAAAAAEwAAAAAAAAAIZW5kcG9pbnQAAAATAAAAAAAAAAhkZWxlZ2F0ZQAAABMAAAAA",
|
|
78
83
|
"AAAAAAAAAAAAAAAFcXVvdGUAAAAAAAAEAAAAAAAAAAdkc3RfZWlkAAAAAAQAAAAAAAAACG1zZ190eXBlAAAABAAAAAAAAAAHb3B0aW9ucwAAAAAOAAAAAAAAAApwYXlfaW5fenJvAAAAAAABAAAAAQAAB9AAAAAMTWVzc2FnaW5nRmVl",
|
|
79
84
|
"AAAAAAAAAAAAAAAJaW5jcmVtZW50AAAAAAAABQAAAAAAAAAGY2FsbGVyAAAAAAATAAAAAAAAAAdkc3RfZWlkAAAAAAQAAAAAAAAACG1zZ190eXBlAAAABAAAAAAAAAAHb3B0aW9ucwAAAAAOAAAAAAAAAANmZWUAAAAH0AAAAAxNZXNzYWdpbmdGZWUAAAAA",
|
|
@@ -144,13 +149,20 @@ export class Client extends ContractClient {
|
|
|
144
149
|
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gb3duZXJzaGlwIGlzIHJlbm91bmNlZC4AAAAAAAAAAAAST3duZXJzaGlwUmVub3VuY2VkAAAAAAABAAAAEk93bmVyc2hpcFJlbm91bmNlZAAAAAAAAQAAAAAAAAAJb2xkX293bmVyAAAAAAAAEwAAAAAAAAAC",
|
|
145
150
|
"AAAAAgAAAAAAAAAAAAAAFURlZmF1bHRPd25hYmxlU3RvcmFnZQAAAAAAAAEAAAAAAAAAAAAAAAVPd25lcgAAAA==",
|
|
146
151
|
"AAAAAQAAAFdBIHBhaXIgb2YgVFRMIHZhbHVlczogdGhyZXNob2xkICh3aGVuIHRvIHRyaWdnZXIgZXh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SON = {
|
|
151
158
|
owner: (this.txFromJSON),
|
|
152
159
|
transfer_ownership: (this.txFromJSON),
|
|
153
160
|
renounce_ownership: (this.txFromJSON),
|
|
161
|
+
set_ttl_configs: (this.txFromJSON),
|
|
162
|
+
ttl_configs: (this.txFromJSON),
|
|
163
|
+
freeze_ttl_configs: (this.txFromJSON),
|
|
164
|
+
is_ttl_configs_frozen: (this.txFromJSON),
|
|
165
|
+
extend_instance_ttl: (this.txFromJSON),
|
|
154
166
|
quote: (this.txFromJSON),
|
|
155
167
|
increment: (this.txFromJSON),
|
|
156
168
|
set_ordered_nonce: (this.txFromJSON),
|
|
@@ -155,7 +155,9 @@ export class Client extends ContractClient {
|
|
|
155
155
|
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gb3duZXJzaGlwIGlzIHJlbm91bmNlZC4AAAAAAAAAAAAST3duZXJzaGlwUmVub3VuY2VkAAAAAAABAAAAEk93bmVyc2hpcFJlbm91bmNlZAAAAAAAAQAAAAAAAAAJb2xkX293bmVyAAAAAAAAEwAAAAAAAAAC",
|
|
156
156
|
"AAAAAgAAAAAAAAAAAAAAFURlZmF1bHRPd25hYmxlU3RvcmFnZQAAAAAAAAEAAAAAAAAAAAAAAAVPd25lcgAAAA==",
|
|
157
157
|
"AAAAAQAAAFdBIHBhaXIgb2YgVFRMIHZhbHVlczogdGhyZXNob2xkICh3aGVuIHRvIHRyaWdnZXIgZXh0ZW5zaW9uKSBhbmQgZXh0ZW5kX3RvICh0YXJnZXQgVFRMKS4AAAAAAAAAAAlUdGxDb25maWcAAAAAAAACAAAAKFRhcmdldCBUVEwgYWZ0ZXIgZXh0ZW5zaW9uIChpbiBsZWRnZXJzKS4AAAAJZXh0ZW5kX3RvAAAAAAAABAAAADNUVEwgdGhyZXNob2xkIHRoYXQgdHJpZ2dlcnMgZXh0ZW5zaW9uIChpbiBsZWRnZXJzKS4AAAAACXRocmVzaG9sZAAAAAAAAAQ=",
|
|
158
|
-
"AAAAAgAAAAAAAAAAAAAAEFR0bENvbmZpZ1N0b3JhZ2UAAAADAAAAAAAAAAAAAAAGRnJvemVuAAAAAAAAAAAAAAAAAAhJbnN0YW5jZQAAAAAAAAAAAAAAClBlcnNpc3RlbnQAAA=="
|
|
158
|
+
"AAAAAgAAAAAAAAAAAAAAEFR0bENvbmZpZ1N0b3JhZ2UAAAADAAAAAAAAAAAAAAAGRnJvemVuAAAAAAAAAAAAAAAAAAhJbnN0YW5jZQAAAAAAAAAAAAAAClBlcnNpc3RlbnQAAA==",
|
|
159
|
+
"AAAABQAAACdFdmVudCBlbWl0dGVkIHdoZW4gVFRMIGNvbmZpZ3MgYXJlIHNldC4AAAAAAAAAAA1UdGxDb25maWdzU2V0AAAAAAAAAQAAAA1UdGxDb25maWdzU2V0AAAAAAAAAgAAAAAAAAAIaW5zdGFuY2UAAAPoAAAH0AAAAAlUdGxDb25maWcAAAAAAAAAAAAAAAAAAApwZXJzaXN0ZW50AAAAAAPoAAAH0AAAAAlUdGxDb25maWcAAAAAAAAAAAAAAg==",
|
|
160
|
+
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gVFRMIGNvbmZpZ3MgYXJlIGZyb3plbi4AAAAAAAAAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAEAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAAAAAAC"]), options);
|
|
159
161
|
this.options = options;
|
|
160
162
|
}
|
|
161
163
|
fromJSON = {
|
|
@@ -148,7 +148,9 @@ export class Client extends ContractClient {
|
|
|
148
148
|
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gb3duZXJzaGlwIGlzIHJlbm91bmNlZC4AAAAAAAAAAAAST3duZXJzaGlwUmVub3VuY2VkAAAAAAABAAAAEk93bmVyc2hpcFJlbm91bmNlZAAAAAAAAQAAAAAAAAAJb2xkX293bmVyAAAAAAAAEwAAAAAAAAAC",
|
|
149
149
|
"AAAAAgAAAAAAAAAAAAAAFURlZmF1bHRPd25hYmxlU3RvcmFnZQAA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AAAAAAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAEAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAAAAAAC"]), options);
|
|
152
154
|
this.options = options;
|
|
153
155
|
}
|
|
154
156
|
fromJSON = {
|
|
@@ -192,7 +192,9 @@ export class Client extends ContractClient {
|
|
|
192
192
|
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gb3duZXJzaGlwIGlzIHJlbm91bmNlZC4AAAAAAAAAAAAST3duZXJzaGlwUmVub3VuY2VkAAAAAAABAAAAEk93bmVyc2hpcFJlbm91bmNlZAAAAAAAAQAAAAAAAAAJb2xkX293bmVyAAAAAAAAEwAAAAAAAAAC",
|
|
193
193
|
"AAAAAgAAAAAAAAAAAAAAFURlZmF1bHRPd25hYmxlU3RvcmFnZQAAAAAAAAEAAAAAAAAAAAAAAAVPd25lcgAAAA==",
|
|
194
194
|
"AAAAAQAAAFdBIHBhaXIgb2YgVFRMIHZhbHVlczogdGhyZXNob2xkICh3aGVuIHRvIHRyaWdnZXIgZXh0ZW5zaW9uKSBhbmQgZXh0ZW5kX3RvICh0YXJnZXQgVFRMKS4AAAAAAAAAAAlUdGxDb25maWcAAAAAAAACAAAAKFRhcmdldCBUVEwgYWZ0ZXIgZXh0ZW5zaW9uIChpbiBsZWRnZXJzKS4AAAAJZXh0ZW5kX3RvAAAAAAAABAAAADNUVEwgdGhyZXNob2xkIHRoYXQgdHJpZ2dlcnMgZXh0ZW5zaW9uIChpbiBsZWRnZXJzKS4AAAAACXRocmVzaG9sZAAAAAAAAAQ=",
|
|
195
|
-
"AAAAAgAAAAAAAAAAAAAAEFR0bENvbmZpZ1N0b3JhZ2UAAAADAAAAAAAAAAAAAAAGRnJvemVuAAAAAAAAAAAAAAAAAAhJbnN0YW5jZQAAAAAAAAAAAAAAClBlcnNpc3RlbnQAAA=="
|
|
195
|
+
"AAAAAgAAAAAAAAAAAAAAEFR0bENvbmZpZ1N0b3JhZ2UAAAADAAAAAAAAAAAAAAAGRnJvemVuAAAAAAAAAAAAAAAAAAhJbnN0YW5jZQAAAAAAAAAAAAAAClBlcnNpc3RlbnQAAA==",
|
|
196
|
+
"AAAABQAAACdFdmVudCBlbWl0dGVkIHdoZW4gVFRMIGNvbmZpZ3MgYXJlIHNldC4AAAAAAAAAAA1UdGxDb25maWdzU2V0AAAAAAAAAQAAAA1UdGxDb25maWdzU2V0AAAAAAAAAgAAAAAAAAAIaW5zdGFuY2UAAAPoAAAH0AAAAAlUdGxDb25maWcAAAAAAAAAAAAAAAAAAApwZXJzaXN0ZW50AAAAAAPoAAAH0AAAAAlUdGxDb25maWcAAAAAAAAAAAAAAg==",
|
|
197
|
+
"AAAABQAAACpFdmVudCBlbWl0dGVkIHdoZW4gVFRMIGNvbmZpZ3MgYXJlIGZyb3plbi4AAAAAAAAAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAEAAAAQVHRsQ29uZmlnc0Zyb3plbgAAAAAAAAAC"]), options);
|
|
196
198
|
this.options = options;
|
|
197
199
|
}
|
|
198
200
|
fromJSON = {
|
package/sdk/package.json
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
//! Test OFT with default `__lz_receive` pattern.
|
|
2
|
-
//!
|
|
3
|
-
//! This demonstrates the simplest OFT usage where:
|
|
4
|
-
//! - `#[oapp]` provides OApp functionality (including OAppOptionsType3)
|
|
5
|
-
//! - User implements `OFTInner` trait for internal methods (`__debit`, `__credit`)
|
|
6
|
-
//! - User implements `OFT` trait (with default implementations)
|
|
7
|
-
//! - Default `__lz_receive` is provided by `OFTInner` trait
|
|
8
|
-
|
|
9
|
-
extern crate self as oft;
|
|
10
|
-
|
|
11
|
-
use oft::oft::{OFTInner, OFT};
|
|
12
|
-
use oft::types::OFTReceipt;
|
|
13
|
-
use soroban_sdk::{contractimpl, Address};
|
|
14
|
-
|
|
15
|
-
#[oapp_macros::oapp]
|
|
16
|
-
pub struct TestOFT;
|
|
17
|
-
|
|
18
|
-
#[contractimpl(contracttrait)]
|
|
19
|
-
impl OFT for TestOFT {}
|
|
20
|
-
|
|
21
|
-
// Internal methods - NOT exposed as contract endpoints
|
|
22
|
-
impl OFTInner for TestOFT {
|
|
23
|
-
fn __debit(
|
|
24
|
-
_env: &soroban_sdk::Env,
|
|
25
|
-
_sender: &Address,
|
|
26
|
-
amount_ld: i128,
|
|
27
|
-
_min_amount_ld: i128,
|
|
28
|
-
_dst_eid: u32,
|
|
29
|
-
) -> OFTReceipt {
|
|
30
|
-
OFTReceipt { amount_sent_ld: amount_ld, amount_received_ld: amount_ld }
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
fn __credit(_env: &soroban_sdk::Env, _to: &Address, amount_ld: i128, _src_eid: u32) -> i128 {
|
|
34
|
-
amount_ld
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
#[test]
|
|
39
|
-
fn test_all_default() {
|
|
40
|
-
assert!(true);
|
|
41
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
//! Test OFT with manual OApp implementations.
|
|
2
|
-
//!
|
|
3
|
-
//! This demonstrates overriding OApp traits while using the OFT pattern.
|
|
4
|
-
|
|
5
|
-
extern crate self as oft;
|
|
6
|
-
|
|
7
|
-
use endpoint_v2::{EndpointV2, Origin};
|
|
8
|
-
use oapp::{
|
|
9
|
-
oapp_core::{oapp_initialize, OAppCore},
|
|
10
|
-
oapp_options_type3::{EnforcedOptionParam, OAppOptionsType3},
|
|
11
|
-
oapp_receiver::OAppReceiver,
|
|
12
|
-
};
|
|
13
|
-
use common_macros::contract_impl;
|
|
14
|
-
use oapp_macros::oapp_manual_impl;
|
|
15
|
-
use oft::oft::{OFTInner, OFT};
|
|
16
|
-
use oft::types::OFTReceipt;
|
|
17
|
-
use soroban_sdk::{contractimpl, testutils::Address as _, Address, Bytes, BytesN, Env, Vec};
|
|
18
|
-
|
|
19
|
-
#[oapp_macros::oapp]
|
|
20
|
-
#[oapp_manual_impl(core, options_type3, receiver)]
|
|
21
|
-
pub struct TestOFT;
|
|
22
|
-
|
|
23
|
-
#[contract_impl]
|
|
24
|
-
impl TestOFT {
|
|
25
|
-
pub fn __constructor(env: &Env, owner: &Address, endpoint: &Address, delegate: &Option<Address>) {
|
|
26
|
-
oapp_initialize::<Self>(env, owner, endpoint, delegate);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Implement OAppReceiver trait with custom behavior
|
|
31
|
-
#[contractimpl(contracttrait)]
|
|
32
|
-
impl OAppReceiver for TestOFT {
|
|
33
|
-
fn lz_receive(
|
|
34
|
-
env: &Env,
|
|
35
|
-
executor: &Address,
|
|
36
|
-
origin: &Origin,
|
|
37
|
-
guid: &BytesN<32>,
|
|
38
|
-
message: &Bytes,
|
|
39
|
-
extra_data: &Bytes,
|
|
40
|
-
value: i128,
|
|
41
|
-
) {
|
|
42
|
-
oapp::oapp_receiver::verify_and_clear_payload::<Self>(env, executor, origin, guid, message, value);
|
|
43
|
-
Self::__lz_receive(env, executor, origin, guid, message, extra_data, value);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Implement OFTInner trait - NOT exposed as contract endpoints
|
|
48
|
-
impl OFTInner for TestOFT {
|
|
49
|
-
fn __debit(_env: &Env, _sender: &Address, amount_ld: i128, _min_amount_ld: i128, _dst_eid: u32) -> OFTReceipt {
|
|
50
|
-
OFTReceipt { amount_sent_ld: amount_ld, amount_received_ld: amount_ld }
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
fn __credit(_env: &Env, _to: &Address, amount_ld: i128, _src_eid: u32) -> i128 {
|
|
54
|
-
amount_ld
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#[contractimpl(contracttrait)]
|
|
59
|
-
impl OAppCore for TestOFT {
|
|
60
|
-
fn oapp_version(_env: &Env) -> (u64, u64) {
|
|
61
|
-
(100, 1)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
#[contractimpl(contracttrait)]
|
|
66
|
-
impl OAppOptionsType3 for TestOFT {}
|
|
67
|
-
|
|
68
|
-
#[contractimpl(contracttrait)]
|
|
69
|
-
impl OFT for TestOFT {}
|
|
70
|
-
|
|
71
|
-
#[test]
|
|
72
|
-
fn test_macro_compiles() {
|
|
73
|
-
let env = Env::default();
|
|
74
|
-
let owner = Address::generate(&env);
|
|
75
|
-
let endpoint = env.register(EndpointV2, (&owner,));
|
|
76
|
-
let delegate: Option<Address> = None;
|
|
77
|
-
let oft = env.register(TestOFT, (&owner, &endpoint, &delegate));
|
|
78
|
-
|
|
79
|
-
let oft_client = TestOFTClient::new(&env, &oft);
|
|
80
|
-
let (major, minor) = oft_client.oapp_version();
|
|
81
|
-
assert_eq!(major, 100);
|
|
82
|
-
assert_eq!(minor, 1);
|
|
83
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
use oapp_macros::oapp;
|
|
2
|
-
use oft::oft::{oft_initialize, OFTInner, OFT};
|
|
3
|
-
use oft::oft_types::mint_burn;
|
|
4
|
-
use oft::types::OFTReceipt;
|
|
5
|
-
use soroban_sdk::{contractimpl, Address, Env};
|
|
6
|
-
|
|
7
|
-
#[oapp]
|
|
8
|
-
pub struct OFTMintBurn;
|
|
9
|
-
|
|
10
|
-
#[contractimpl]
|
|
11
|
-
impl OFTMintBurn {
|
|
12
|
-
pub fn __constructor(env: &Env, token: &Address, owner: &Address, endpoint: &Address, delegate: &Option<Address>) {
|
|
13
|
-
oft_initialize::<Self>(env, owner, token, endpoint, delegate)
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
#[contractimpl(contracttrait)]
|
|
18
|
-
impl OFT for OFTMintBurn {}
|
|
19
|
-
|
|
20
|
-
impl OFTInner for OFTMintBurn {
|
|
21
|
-
fn __debit(env: &Env, sender: &Address, amount_ld: i128, min_amount_ld: i128, dst_eid: u32) -> OFTReceipt {
|
|
22
|
-
mint_burn::debit::<Self>(env, sender, amount_ld, min_amount_ld, dst_eid)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
fn __credit(env: &Env, to: &Address, amount_ld: i128, src_eid: u32) -> i128 {
|
|
26
|
-
mint_burn::credit::<Self>(env, to, amount_ld, src_eid)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
use soroban_sdk::{contracttype, BytesN, Vec};
|
|
2
|
-
|
|
3
|
-
#[contracttype]
|
|
4
|
-
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
5
|
-
pub struct DstConfig {
|
|
6
|
-
pub gas: u128,
|
|
7
|
-
pub multiplier_bps: u32,
|
|
8
|
-
pub floor_margin_usd: u128,
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
#[contracttype]
|
|
12
|
-
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
13
|
-
pub struct DstConfigParam {
|
|
14
|
-
pub dst_eid: u32,
|
|
15
|
-
pub config: DstConfig,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
#[contracttype]
|
|
19
|
-
#[derive(Clone, Debug, Eq, PartialEq)]
|
|
20
|
-
pub struct TransactionAuthData {
|
|
21
|
-
pub vid: u32,
|
|
22
|
-
pub expiration: u64,
|
|
23
|
-
pub signatures: Vec<BytesN<65>>,
|
|
24
|
-
pub admin: BytesN<32>,
|
|
25
|
-
pub admin_signature: BytesN<64>,
|
|
26
|
-
}
|