tx · HPFxudM7jYSTqgZrQqtU1zz4bkMHkowev5niTLgS6qQx 3MwC75rhWzLpeEwLGSnF3ftHNh4fGBU48Ac: -0.03700000 Waves 2023.07.26 23:12 [2683287] smart account 3MwC75rhWzLpeEwLGSnF3ftHNh4fGBU48Ac > SELF 0.00000000 Waves
{ "type": 13, "id": "HPFxudM7jYSTqgZrQqtU1zz4bkMHkowev5niTLgS6qQx", "fee": 3700000, "feeAssetId": null, "timestamp": 1690402379230, "version": 2, "chainId": 84, "sender": "3MwC75rhWzLpeEwLGSnF3ftHNh4fGBU48Ac", "senderPublicKey": "9yW1Jko9uspFMWxZL7MsaEnTH66KnoCqj69k36PKqZq3", "proofs": [ "2W13TMCgF1ghjytNv2xDgKw1u9hD21GDxF1kGvgXUDx1NUWLkNSkXLXXZKmPiKC1NZkb3wwJetGkMhyGfabRGQgT" ], "script": "base64:BgIQCAISAwoBCBIHCgUEBAQICA0ADWtfaW5pdGlhbGl6ZWQCDWtfaW5pdGlhbGl6ZWQAFGtfY29vcmRpbmF0b3JBZGRyZXNzAhRrX2Nvb3JkaW5hdG9yQWRkcmVzcwARa19zdGFraW5nX2FkZHJlc3MCEWtfc3Rha2luZ19hZGRyZXNzABFrX2Zhcm1pbmdfYWRkcmVzcwIRa19mYXJtaW5nX2FkZHJlc3MAD2tfdmF1bHRfYWRkcmVzcwIPa192YXVsdF9hZGRyZXNzAA9rX2FkbWluX2FkZHJlc3MCD2tfYWRtaW5fYWRkcmVzcwEJc3RyVG9MaXN0AQRfc3RyAwkAAAIFBF9zdHICAAUDbmlsCQC8CQIFBF9zdHICASwBC2Nvb3JkaW5hdG9yAAkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCmCAEJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnQgCBQR0aGlzBRRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIWQ29vcmRpbmF0b3Igbm90IHNldCBIQwIbQ29vcmRpbmF0b3IgYWRkcmVzcyBpbnZhbGlk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EFJGYxXzECBQUkYWNjMAAAAAEAAgADAAQABQMJAAACBQxkb0NhbGxWYXVsdHMFDGRvQ2FsbFZhdWx0cwUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQOY29vcmRpbmF0b3JTdHIJAJ0IAgUEdGhpcwUUa19jb29yZGluYXRvckFkZHJlc3MDCQEJaXNEZWZpbmVkAQUOY29vcmRpbmF0b3JTdHIEBWFkbWluCQCdCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEFDmNvb3JkaW5hdG9yU3RyBQ9rX2FkbWluX2FkZHJlc3MDCQEJaXNEZWZpbmVkAQUFYWRtaW4JAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUFYWRtaW4JAKwCAgkArAICCQCsAgICB3N0YXR1c18JAKUIAQUEdGhpcwIBXwkA2AQBCAUCdHgCaWQHCQACAQIudW5hYmxlIHRvIHZlcmlmeTogYWRtaW4gbm90IHNldCBpbiBjb29yZGluYXRvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleSAUT58=", "height": 2683287, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4JabVZVdZKTP36r9Y8YA5bTK8H3zoauHqRXUoKWJcDD6 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | func strToList (_str) = if ((_str == "")) | |
17 | 17 | then nil | |
18 | - | else split(_str, ",") | |
18 | + | else split_4C(_str, ",") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set HC")), "Coordinator address invalid") | |
85 | 85 | ||
86 | 86 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
87 | 87 | then $a | |
88 | - | else throw("List size exceeds | |
88 | + | else throw("List size exceeds 10") | |
89 | 89 | ||
90 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
90 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
91 | 91 | } | |
92 | 92 | if ((doCallAmms == doCallAmms)) | |
93 | 93 | then { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_initialized = "k_initialized" | |
5 | 5 | ||
6 | 6 | let k_coordinatorAddress = "k_coordinatorAddress" | |
7 | 7 | ||
8 | 8 | let k_staking_address = "k_staking_address" | |
9 | 9 | ||
10 | 10 | let k_farming_address = "k_farming_address" | |
11 | 11 | ||
12 | 12 | let k_vault_address = "k_vault_address" | |
13 | 13 | ||
14 | 14 | let k_admin_address = "k_admin_address" | |
15 | 15 | ||
16 | 16 | func strToList (_str) = if ((_str == "")) | |
17 | 17 | then nil | |
18 | - | else split(_str, ",") | |
18 | + | else split_4C(_str, ",") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func coordinator () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, k_coordinatorAddress), "Coordinator not set HC")), "Coordinator address invalid") | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func adminAddress () = addressFromString(valueOrErrorMessage(getString(coordinator(), k_admin_address), "Admin address not set")) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func stakingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_staking_address), "Staking address not set")), "Staking address invalid") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func farmingAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_farming_address), "Farming address not set")), "Farming address invalid") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func vaultAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_vault_address), "Vault address not set")), "Vault address invalid") | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | @Callable(i) | |
40 | 40 | func initialize (_coordinator) = if (if (initialized()) | |
41 | 41 | then true | |
42 | 42 | else (i.caller != this)) | |
43 | 43 | then throw("Unable to initialize") | |
44 | 44 | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), BooleanEntry(k_initialized, true)] | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(i) | |
49 | 49 | func performHousekeeping (_vault,_farming,_staking,_payFunding,_spotVaults) = { | |
50 | 50 | let doAckRewardsStaking = if (_staking) | |
51 | 51 | then invoke(stakingAddress(), "ackRewards", nil, nil) | |
52 | 52 | else nil | |
53 | 53 | if ((doAckRewardsStaking == doAckRewardsStaking)) | |
54 | 54 | then { | |
55 | 55 | let doAckRewardsFarming = if (_farming) | |
56 | 56 | then invoke(farmingAddress(), "ackRewards", nil, nil) | |
57 | 57 | else nil | |
58 | 58 | if ((doAckRewardsFarming == doAckRewardsFarming)) | |
59 | 59 | then { | |
60 | 60 | let doAckRewardsVault = if (_vault) | |
61 | 61 | then invoke(vaultAddress(), "ackRewards", nil, nil) | |
62 | 62 | else nil | |
63 | 63 | if ((doAckRewardsVault == doAckRewardsVault)) | |
64 | 64 | then { | |
65 | 65 | let amms = strToList(_payFunding) | |
66 | 66 | func compute (_acc,_ammData) = { | |
67 | 67 | let parts = split_4C(_ammData, "@") | |
68 | 68 | let amm = parts[0] | |
69 | 69 | let priceUpdate = if ((size(parts) > 1)) | |
70 | 70 | then parts[1] | |
71 | 71 | else "" | |
72 | 72 | let doPayFunding = invoke(addressFromStringValue(amm), "payFunding", [priceUpdate], nil) | |
73 | 73 | if ((doPayFunding == doPayFunding)) | |
74 | 74 | then _acc | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | let doCallAmms = { | |
79 | 79 | let $l = amms | |
80 | 80 | let $s = size($l) | |
81 | 81 | let $acc0 = nil | |
82 | 82 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
83 | 83 | then $a | |
84 | 84 | else compute($a, $l[$i]) | |
85 | 85 | ||
86 | 86 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
87 | 87 | then $a | |
88 | - | else throw("List size exceeds | |
88 | + | else throw("List size exceeds 10") | |
89 | 89 | ||
90 | - | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
90 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
91 | 91 | } | |
92 | 92 | if ((doCallAmms == doCallAmms)) | |
93 | 93 | then { | |
94 | 94 | let vaults = strToList(_spotVaults) | |
95 | 95 | func compute2 (_acc,_vault) = { | |
96 | 96 | let doPayFunding = invoke(addressFromStringValue(_vault), "ackRewards", nil, nil) | |
97 | 97 | if ((doPayFunding == doPayFunding)) | |
98 | 98 | then _acc | |
99 | 99 | else throw("Strict value is not equal to itself.") | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | let doCallVaults = { | |
103 | 103 | let $l = vaults | |
104 | 104 | let $s = size($l) | |
105 | 105 | let $acc0 = nil | |
106 | 106 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
107 | 107 | then $a | |
108 | 108 | else compute2($a, $l[$i]) | |
109 | 109 | ||
110 | 110 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
111 | 111 | then $a | |
112 | 112 | else throw("List size exceeds 5") | |
113 | 113 | ||
114 | 114 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5) | |
115 | 115 | } | |
116 | 116 | if ((doCallVaults == doCallVaults)) | |
117 | 117 | then nil | |
118 | 118 | else throw("Strict value is not equal to itself.") | |
119 | 119 | } | |
120 | 120 | else throw("Strict value is not equal to itself.") | |
121 | 121 | } | |
122 | 122 | else throw("Strict value is not equal to itself.") | |
123 | 123 | } | |
124 | 124 | else throw("Strict value is not equal to itself.") | |
125 | 125 | } | |
126 | 126 | else throw("Strict value is not equal to itself.") | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Verifier(tx) | |
131 | 131 | func verify () = { | |
132 | 132 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
133 | 133 | if (isDefined(coordinatorStr)) | |
134 | 134 | then { | |
135 | 135 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
136 | 136 | if (isDefined(admin)) | |
137 | 137 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
138 | 138 | else throw("unable to verify: admin not set in coordinator") | |
139 | 139 | } | |
140 | 140 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
141 | 141 | } | |
142 | 142 |
github/deemru/w8io/026f985 28.68 ms ◑