tx · A3mnHrz5EAHBdCBSS3ZV2Rm3q7dFFkrRjcNoV3M3NSkU
3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ: -0.03400000 Waves
2023.03.06 22:41 [2478659] smart account 3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ > SELF 0.00000000 Waves
{
"type": 13,
"id": "A3mnHrz5EAHBdCBSS3ZV2Rm3q7dFFkrRjcNoV3M3NSkU",
"fee": 3400000,
"feeAssetId": null,
"timestamp": 1678131668686,
"version": 2,
"chainId": 84,
"sender": "3MxXA443AARoS3rQ9RNdPeBur74yBTCTyxJ",
"senderPublicKey": "Dhf95pPhxwKtWsqgf6tyeDW2xpQA7TvM8nTwbwgqKjkd",
"proofs": [
"4ATw6Cjy73U34Y6oCSTThrJCTJJr9gxtsZjji46QNCBRuU5BPmAGLGJQ4yB3uyUgg95PhSeDQA2YwtvXBHFJQTVb"
],
"script": "base64:BgJiCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgMKAQgZABNrX2luc3VyYW5jZV9hZGRyZXNzAhNrX2luc3VyYW5jZV9hZGRyZXNzAA9rX3ZhdWx0X2FkZHJlc3MCD2tfdmF1bHRfYWRkcmVzcwAPa19hZG1pbl9hZGRyZXNzAg9rX2FkbWluX2FkZHJlc3MADWtfcXVvdGVfYXNzZXQCDWtfcXVvdGVfYXNzZXQADmtfcmV3YXJkX2Fzc2V0Ag5rX3Jld2FyZF9hc3NldAAOa19zd2FwX2FkZHJlc3MCDmtfc3dhcF9hZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwAQa19wcml6ZXNfYWRkcmVzcwIQa19wcml6ZXNfYWRkcmVzcwAVa19ob3Vz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hc3NldElkBQNuaWwJAAIBAhBDYW4ndCBmaW5kIGFzc2V0AQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAkAnQgCBQR0aGlzBQ9rX2FkbWluX2FkZHJlc3MDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAh2ZXJpZmllcgUHJG1hdGNoMAkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQh2ZXJpZmllcgkArAICCQCsAgIJAKwCAgIHc3RhdHVzXwkApQgBBQR0aGlzAgFfCQDYBAEIBQJ0eAJpZAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmJcs8p",
"height": 2478659,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Gq3wnqz1kuA29QcKk11eXYWU9X7NFgExjmPDNWj5ptTA
Next: BCFxDKf8SdvMJgTPVuQite3YhH73AJS2MbE1KdbVPjJV
Diff:
Old | New | | Differences |
---|
37 | 37 | | |
---|
38 | 38 | | let r = "k_nft_manager_address" |
---|
39 | 39 | | |
---|
40 | | - | let s = "k_collateral_address" |
---|
| 40 | + | let s = "k_child" |
---|
41 | 41 | | |
---|
42 | | - | let t = "k_exchange_address" |
---|
43 | | - | |
---|
44 | | - | func u (v,w) = ((v + "_") + w) |
---|
| 42 | + | func t (u,v) = ((u + "_") + v) |
---|
45 | 43 | | |
---|
46 | 44 | | |
---|
47 | | - | func x (y) = toString(valueOrErrorMessage(addressFromString(y), (("Can't parse \"" + y) + "\" as address"))) |
---|
| 45 | + | func w (x) = toString(valueOrErrorMessage(addressFromString(x), (("Can't parse \"" + x) + "\" as address"))) |
---|
48 | 46 | | |
---|
49 | 47 | | |
---|
50 | | - | func z () = (getString(this, c) == unit) |
---|
| 48 | + | func y () = (getString(this, c) == unit) |
---|
51 | 49 | | |
---|
52 | 50 | | |
---|
53 | | - | func A () = addressFromStringValue(valueOrErrorMessage(getString(this, c), "Admin not defined")) |
---|
| 51 | + | func z () = addressFromStringValue(valueOrErrorMessage(getString(this, c), "Admin not defined")) |
---|
54 | 52 | | |
---|
55 | 53 | | |
---|
56 | | - | func B (C) = if (if (if (z()) |
---|
57 | | - | then (C.caller == this) |
---|
| 54 | + | func A (B) = if (if (if (y()) |
---|
| 55 | + | then (B.caller == this) |
---|
58 | 56 | | else false) |
---|
59 | 57 | | then true |
---|
60 | | - | else (C.caller == A())) |
---|
| 58 | + | else (B.caller == z())) |
---|
61 | 59 | | then unit |
---|
62 | 60 | | else throw("Only the Admin itself can invoke this function") |
---|
63 | 61 | | |
---|
64 | 62 | | |
---|
65 | | - | func D (C) = if ((C.caller == A())) |
---|
| 63 | + | func C (B) = if ((B.caller == z())) |
---|
66 | 64 | | then unit |
---|
67 | 65 | | else throw("Only the Admin itself can invoke this function") |
---|
68 | 66 | | |
---|
69 | 67 | | |
---|
70 | | - | @Callable(C) |
---|
71 | | - | func setAdmin (E) = valueOrElse(B(C), { |
---|
72 | | - | let y = addressFromStringValue(E) |
---|
73 | | - | [StringEntry(c, toString(y))] |
---|
| 68 | + | @Callable(B) |
---|
| 69 | + | func setAdmin (D) = valueOrElse(A(B), { |
---|
| 70 | + | let x = addressFromStringValue(D) |
---|
| 71 | + | [StringEntry(c, toString(x))] |
---|
74 | 72 | | }) |
---|
75 | 73 | | |
---|
76 | 74 | | |
---|
77 | 75 | | |
---|
78 | | - | @Callable(C) |
---|
79 | | - | func setInsuranceFund (F) = valueOrElse(D(C), { |
---|
80 | | - | let y = x(F) |
---|
81 | | - | [StringEntry(a, y)] |
---|
| 76 | + | @Callable(B) |
---|
| 77 | + | func setInsuranceFund (E) = valueOrElse(C(B), { |
---|
| 78 | + | let x = w(E) |
---|
| 79 | + | [StringEntry(a, x)] |
---|
82 | 80 | | }) |
---|
83 | 81 | | |
---|
84 | 82 | | |
---|
85 | 83 | | |
---|
86 | | - | @Callable(C) |
---|
87 | | - | func setLiquidityMiner (G) = valueOrElse(D(C), { |
---|
88 | | - | let y = x(G) |
---|
89 | | - | [StringEntry(n, y)] |
---|
| 84 | + | @Callable(B) |
---|
| 85 | + | func setLiquidityMiner (F) = valueOrElse(C(B), { |
---|
| 86 | + | let x = w(F) |
---|
| 87 | + | [StringEntry(n, x)] |
---|
90 | 88 | | }) |
---|
91 | 89 | | |
---|
92 | 90 | | |
---|
93 | 91 | | |
---|
94 | | - | @Callable(C) |
---|
95 | | - | func setOrders (H) = valueOrElse(D(C), { |
---|
96 | | - | let y = x(H) |
---|
97 | | - | [StringEntry(o, y)] |
---|
| 92 | + | @Callable(B) |
---|
| 93 | + | func setOrders (G) = valueOrElse(C(B), { |
---|
| 94 | + | let x = w(G) |
---|
| 95 | + | [StringEntry(o, x)] |
---|
98 | 96 | | }) |
---|
99 | 97 | | |
---|
100 | 98 | | |
---|
101 | 99 | | |
---|
102 | | - | @Callable(C) |
---|
103 | | - | func setReferral (I) = valueOrElse(D(C), { |
---|
104 | | - | let y = x(I) |
---|
105 | | - | [StringEntry(p, y)] |
---|
| 100 | + | @Callable(B) |
---|
| 101 | + | func setReferral (H) = valueOrElse(C(B), { |
---|
| 102 | + | let x = w(H) |
---|
| 103 | + | [StringEntry(p, x)] |
---|
106 | 104 | | }) |
---|
107 | 105 | | |
---|
108 | 106 | | |
---|
109 | 107 | | |
---|
110 | | - | @Callable(C) |
---|
111 | | - | func setFarming (J) = valueOrElse(D(C), { |
---|
112 | | - | let y = x(J) |
---|
113 | | - | [StringEntry(h, y)] |
---|
| 108 | + | @Callable(B) |
---|
| 109 | + | func setFarming (I) = valueOrElse(C(B), { |
---|
| 110 | + | let x = w(I) |
---|
| 111 | + | [StringEntry(h, x)] |
---|
114 | 112 | | }) |
---|
115 | 113 | | |
---|
116 | 114 | | |
---|
117 | 115 | | |
---|
118 | | - | @Callable(C) |
---|
119 | | - | func setManager (K) = valueOrElse(D(C), { |
---|
120 | | - | let y = x(K) |
---|
121 | | - | [StringEntry(q, y)] |
---|
| 116 | + | @Callable(B) |
---|
| 117 | + | func setManager (J) = valueOrElse(C(B), { |
---|
| 118 | + | let x = w(J) |
---|
| 119 | + | [StringEntry(q, x)] |
---|
122 | 120 | | }) |
---|
123 | 121 | | |
---|
124 | 122 | | |
---|
125 | 123 | | |
---|
126 | | - | @Callable(C) |
---|
127 | | - | func setHousekeeper (L) = valueOrElse(D(C), { |
---|
128 | | - | let y = x(L) |
---|
129 | | - | [StringEntry(j, y)] |
---|
| 124 | + | @Callable(B) |
---|
| 125 | + | func setHousekeeper (K) = valueOrElse(C(B), { |
---|
| 126 | + | let x = w(K) |
---|
| 127 | + | [StringEntry(j, x)] |
---|
130 | 128 | | }) |
---|
131 | 129 | | |
---|
132 | 130 | | |
---|
133 | 131 | | |
---|
134 | | - | @Callable(C) |
---|
135 | | - | func setPrizes (M) = valueOrElse(D(C), { |
---|
136 | | - | let y = x(M) |
---|
137 | | - | [StringEntry(i, y)] |
---|
| 132 | + | @Callable(B) |
---|
| 133 | + | func setPrizes (L) = valueOrElse(C(B), { |
---|
| 134 | + | let x = w(L) |
---|
| 135 | + | [StringEntry(i, x)] |
---|
138 | 136 | | }) |
---|
139 | 137 | | |
---|
140 | 138 | | |
---|
141 | 139 | | |
---|
142 | | - | @Callable(C) |
---|
143 | | - | func setNftManager (N) = valueOrElse(D(C), { |
---|
144 | | - | let y = x(N) |
---|
145 | | - | [StringEntry(r, y)] |
---|
| 140 | + | @Callable(B) |
---|
| 141 | + | func setNftManager (M) = valueOrElse(C(B), { |
---|
| 142 | + | let x = w(M) |
---|
| 143 | + | [StringEntry(r, x)] |
---|
146 | 144 | | }) |
---|
147 | 145 | | |
---|
148 | 146 | | |
---|
149 | 147 | | |
---|
150 | | - | @Callable(C) |
---|
151 | | - | func setSwap (O) = valueOrElse(D(C), { |
---|
152 | | - | let y = x(O) |
---|
153 | | - | [StringEntry(f, y)] |
---|
| 148 | + | @Callable(B) |
---|
| 149 | + | func setSwap (N) = valueOrElse(C(B), { |
---|
| 150 | + | let x = w(N) |
---|
| 151 | + | [StringEntry(f, x)] |
---|
154 | 152 | | }) |
---|
155 | 153 | | |
---|
156 | 154 | | |
---|
157 | 155 | | |
---|
158 | | - | @Callable(C) |
---|
159 | | - | func setQuoteAsset (P) = valueOrElse(D(C), [StringEntry(d, P)]) |
---|
| 156 | + | @Callable(B) |
---|
| 157 | + | func setQuoteAsset (O) = valueOrElse(C(B), [StringEntry(d, O)]) |
---|
160 | 158 | | |
---|
161 | 159 | | |
---|
162 | 160 | | |
---|
163 | | - | @Callable(C) |
---|
164 | | - | func setRewardAsset (P) = valueOrElse(D(C), [StringEntry(e, P)]) |
---|
| 161 | + | @Callable(B) |
---|
| 162 | + | func setRewardAsset (O) = valueOrElse(C(B), [StringEntry(e, O)]) |
---|
165 | 163 | | |
---|
166 | 164 | | |
---|
167 | 165 | | |
---|
168 | | - | @Callable(C) |
---|
169 | | - | func setStakingAddress (Q) = valueOrElse(D(C), { |
---|
170 | | - | let R = x(Q) |
---|
171 | | - | [StringEntry(g, Q)] |
---|
| 166 | + | @Callable(B) |
---|
| 167 | + | func setStakingAddress (P) = valueOrElse(C(B), { |
---|
| 168 | + | let Q = w(P) |
---|
| 169 | + | [StringEntry(g, P)] |
---|
172 | 170 | | }) |
---|
173 | 171 | | |
---|
174 | 172 | | |
---|
175 | 173 | | |
---|
176 | | - | @Callable(C) |
---|
177 | | - | func setCollateralAddress (S) = valueOrElse(D(C), { |
---|
178 | | - | let T = x(S) |
---|
179 | | - | [StringEntry(s, S)] |
---|
| 174 | + | @Callable(B) |
---|
| 175 | + | func setVaultAddress (R) = valueOrElse(C(B), { |
---|
| 176 | + | let S = w(R) |
---|
| 177 | + | [StringEntry(b, R)] |
---|
180 | 178 | | }) |
---|
181 | 179 | | |
---|
182 | 180 | | |
---|
183 | 181 | | |
---|
184 | | - | @Callable(C) |
---|
185 | | - | func setExchangeAddress (U) = valueOrElse(D(C), { |
---|
186 | | - | let V = x(U) |
---|
187 | | - | [StringEntry(t, U)] |
---|
| 182 | + | @Callable(B) |
---|
| 183 | + | func addChild (T) = valueOrElse(C(B), { |
---|
| 184 | + | let U = w(T) |
---|
| 185 | + | [BooleanEntry(t(s, T), true)] |
---|
188 | 186 | | }) |
---|
189 | 187 | | |
---|
190 | 188 | | |
---|
191 | 189 | | |
---|
192 | | - | @Callable(C) |
---|
193 | | - | func setVaultAddress (W) = valueOrElse(D(C), { |
---|
194 | | - | let V = x(W) |
---|
195 | | - | [StringEntry(b, W)] |
---|
| 190 | + | @Callable(B) |
---|
| 191 | + | func addAmm (V,W) = valueOrElse(C(B), { |
---|
| 192 | + | let X = w(V) |
---|
| 193 | + | [BooleanEntry(t(k, V), true), StringEntry(t(l, V), W)] |
---|
196 | 194 | | }) |
---|
197 | 195 | | |
---|
198 | 196 | | |
---|
199 | 197 | | |
---|
200 | | - | @Callable(C) |
---|
201 | | - | func addAmm (X,Y) = valueOrElse(D(C), { |
---|
202 | | - | let Z = x(X) |
---|
203 | | - | [BooleanEntry(u(k, X), true), StringEntry(u(l, X), Y)] |
---|
204 | | - | }) |
---|
| 198 | + | @Callable(B) |
---|
| 199 | + | func removeAmm (V) = valueOrElse(C(B), [DeleteEntry(t(k, V))]) |
---|
205 | 200 | | |
---|
206 | 201 | | |
---|
207 | 202 | | |
---|
208 | | - | @Callable(C) |
---|
209 | | - | func removeAmm (X) = valueOrElse(D(C), [DeleteEntry(u(k, X))]) |
---|
210 | | - | |
---|
211 | | - | |
---|
212 | | - | |
---|
213 | | - | @Callable(C) |
---|
214 | | - | func setGovernanceAsset (P) = valueOrElse(D(C), { |
---|
215 | | - | let aa = fromBase58String(P) |
---|
216 | | - | let ab = assetInfo(aa) |
---|
217 | | - | if ($isInstanceOf(ab, "Asset")) |
---|
| 203 | + | @Callable(B) |
---|
| 204 | + | func setGovernanceAsset (O) = valueOrElse(C(B), { |
---|
| 205 | + | let Y = fromBase58String(O) |
---|
| 206 | + | let Z = assetInfo(Y) |
---|
| 207 | + | if ($isInstanceOf(Z, "Asset")) |
---|
218 | 208 | | then { |
---|
219 | | - | let ac = ab |
---|
220 | | - | if ((ac.decimals != 8)) |
---|
| 209 | + | let aa = Z |
---|
| 210 | + | if ((aa.decimals != 8)) |
---|
221 | 211 | | then throw("Invalid asset decimals, should be 8") |
---|
222 | | - | else [StringEntry(m, P)] |
---|
| 212 | + | else [StringEntry(m, O)] |
---|
223 | 213 | | } |
---|
224 | 214 | | else throw("Can't find asset") |
---|
225 | 215 | | }) |
---|
226 | 216 | | |
---|
227 | 217 | | |
---|
228 | | - | @Verifier(ad) |
---|
229 | | - | func ae () = { |
---|
230 | | - | let ab = getString(this, c) |
---|
231 | | - | if ($isInstanceOf(ab, "String")) |
---|
| 218 | + | @Verifier(ab) |
---|
| 219 | + | func ac () = { |
---|
| 220 | + | let Z = getString(this, c) |
---|
| 221 | + | if ($isInstanceOf(Z, "String")) |
---|
232 | 222 | | then { |
---|
233 | | - | let af = ab |
---|
234 | | - | valueOrElse(getBoolean(addressFromStringValue(af), ((("status_" + toString(this)) + "_") + toBase58String(ad.id))), false) |
---|
| 223 | + | let ad = Z |
---|
| 224 | + | valueOrElse(getBoolean(addressFromStringValue(ad), ((("status_" + toString(this)) + "_") + toBase58String(ab.id))), false) |
---|
235 | 225 | | } |
---|
236 | | - | else sigVerify(ad.bodyBytes, ad.proofs[0], ad.senderPublicKey) |
---|
| 226 | + | else sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) |
---|
237 | 227 | | } |
---|
238 | 228 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "k_insurance_address" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "k_vault_address" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "k_admin_address" |
---|
9 | 9 | | |
---|
10 | 10 | | let d = "k_quote_asset" |
---|
11 | 11 | | |
---|
12 | 12 | | let e = "k_reward_asset" |
---|
13 | 13 | | |
---|
14 | 14 | | let f = "k_swap_address" |
---|
15 | 15 | | |
---|
16 | 16 | | let g = "k_staking_address" |
---|
17 | 17 | | |
---|
18 | 18 | | let h = "k_farming_address" |
---|
19 | 19 | | |
---|
20 | 20 | | let i = "k_prizes_address" |
---|
21 | 21 | | |
---|
22 | 22 | | let j = "k_housekeeper_address" |
---|
23 | 23 | | |
---|
24 | 24 | | let k = "k_amm" |
---|
25 | 25 | | |
---|
26 | 26 | | let l = "k_amm_data" |
---|
27 | 27 | | |
---|
28 | 28 | | let m = "k_gov_asset" |
---|
29 | 29 | | |
---|
30 | 30 | | let n = "k_miner_address" |
---|
31 | 31 | | |
---|
32 | 32 | | let o = "k_orders_address" |
---|
33 | 33 | | |
---|
34 | 34 | | let p = "k_referral_address" |
---|
35 | 35 | | |
---|
36 | 36 | | let q = "k_manager_address" |
---|
37 | 37 | | |
---|
38 | 38 | | let r = "k_nft_manager_address" |
---|
39 | 39 | | |
---|
40 | | - | let s = "k_collateral_address" |
---|
| 40 | + | let s = "k_child" |
---|
41 | 41 | | |
---|
42 | | - | let t = "k_exchange_address" |
---|
43 | | - | |
---|
44 | | - | func u (v,w) = ((v + "_") + w) |
---|
| 42 | + | func t (u,v) = ((u + "_") + v) |
---|
45 | 43 | | |
---|
46 | 44 | | |
---|
47 | | - | func x (y) = toString(valueOrErrorMessage(addressFromString(y), (("Can't parse \"" + y) + "\" as address"))) |
---|
| 45 | + | func w (x) = toString(valueOrErrorMessage(addressFromString(x), (("Can't parse \"" + x) + "\" as address"))) |
---|
48 | 46 | | |
---|
49 | 47 | | |
---|
50 | | - | func z () = (getString(this, c) == unit) |
---|
| 48 | + | func y () = (getString(this, c) == unit) |
---|
51 | 49 | | |
---|
52 | 50 | | |
---|
53 | | - | func A () = addressFromStringValue(valueOrErrorMessage(getString(this, c), "Admin not defined")) |
---|
| 51 | + | func z () = addressFromStringValue(valueOrErrorMessage(getString(this, c), "Admin not defined")) |
---|
54 | 52 | | |
---|
55 | 53 | | |
---|
56 | | - | func B (C) = if (if (if (z()) |
---|
57 | | - | then (C.caller == this) |
---|
| 54 | + | func A (B) = if (if (if (y()) |
---|
| 55 | + | then (B.caller == this) |
---|
58 | 56 | | else false) |
---|
59 | 57 | | then true |
---|
60 | | - | else (C.caller == A())) |
---|
| 58 | + | else (B.caller == z())) |
---|
61 | 59 | | then unit |
---|
62 | 60 | | else throw("Only the Admin itself can invoke this function") |
---|
63 | 61 | | |
---|
64 | 62 | | |
---|
65 | | - | func D (C) = if ((C.caller == A())) |
---|
| 63 | + | func C (B) = if ((B.caller == z())) |
---|
66 | 64 | | then unit |
---|
67 | 65 | | else throw("Only the Admin itself can invoke this function") |
---|
68 | 66 | | |
---|
69 | 67 | | |
---|
70 | | - | @Callable(C) |
---|
71 | | - | func setAdmin (E) = valueOrElse(B(C), { |
---|
72 | | - | let y = addressFromStringValue(E) |
---|
73 | | - | [StringEntry(c, toString(y))] |
---|
| 68 | + | @Callable(B) |
---|
| 69 | + | func setAdmin (D) = valueOrElse(A(B), { |
---|
| 70 | + | let x = addressFromStringValue(D) |
---|
| 71 | + | [StringEntry(c, toString(x))] |
---|
74 | 72 | | }) |
---|
75 | 73 | | |
---|
76 | 74 | | |
---|
77 | 75 | | |
---|
78 | | - | @Callable(C) |
---|
79 | | - | func setInsuranceFund (F) = valueOrElse(D(C), { |
---|
80 | | - | let y = x(F) |
---|
81 | | - | [StringEntry(a, y)] |
---|
| 76 | + | @Callable(B) |
---|
| 77 | + | func setInsuranceFund (E) = valueOrElse(C(B), { |
---|
| 78 | + | let x = w(E) |
---|
| 79 | + | [StringEntry(a, x)] |
---|
82 | 80 | | }) |
---|
83 | 81 | | |
---|
84 | 82 | | |
---|
85 | 83 | | |
---|
86 | | - | @Callable(C) |
---|
87 | | - | func setLiquidityMiner (G) = valueOrElse(D(C), { |
---|
88 | | - | let y = x(G) |
---|
89 | | - | [StringEntry(n, y)] |
---|
| 84 | + | @Callable(B) |
---|
| 85 | + | func setLiquidityMiner (F) = valueOrElse(C(B), { |
---|
| 86 | + | let x = w(F) |
---|
| 87 | + | [StringEntry(n, x)] |
---|
90 | 88 | | }) |
---|
91 | 89 | | |
---|
92 | 90 | | |
---|
93 | 91 | | |
---|
94 | | - | @Callable(C) |
---|
95 | | - | func setOrders (H) = valueOrElse(D(C), { |
---|
96 | | - | let y = x(H) |
---|
97 | | - | [StringEntry(o, y)] |
---|
| 92 | + | @Callable(B) |
---|
| 93 | + | func setOrders (G) = valueOrElse(C(B), { |
---|
| 94 | + | let x = w(G) |
---|
| 95 | + | [StringEntry(o, x)] |
---|
98 | 96 | | }) |
---|
99 | 97 | | |
---|
100 | 98 | | |
---|
101 | 99 | | |
---|
102 | | - | @Callable(C) |
---|
103 | | - | func setReferral (I) = valueOrElse(D(C), { |
---|
104 | | - | let y = x(I) |
---|
105 | | - | [StringEntry(p, y)] |
---|
| 100 | + | @Callable(B) |
---|
| 101 | + | func setReferral (H) = valueOrElse(C(B), { |
---|
| 102 | + | let x = w(H) |
---|
| 103 | + | [StringEntry(p, x)] |
---|
106 | 104 | | }) |
---|
107 | 105 | | |
---|
108 | 106 | | |
---|
109 | 107 | | |
---|
110 | | - | @Callable(C) |
---|
111 | | - | func setFarming (J) = valueOrElse(D(C), { |
---|
112 | | - | let y = x(J) |
---|
113 | | - | [StringEntry(h, y)] |
---|
| 108 | + | @Callable(B) |
---|
| 109 | + | func setFarming (I) = valueOrElse(C(B), { |
---|
| 110 | + | let x = w(I) |
---|
| 111 | + | [StringEntry(h, x)] |
---|
114 | 112 | | }) |
---|
115 | 113 | | |
---|
116 | 114 | | |
---|
117 | 115 | | |
---|
118 | | - | @Callable(C) |
---|
119 | | - | func setManager (K) = valueOrElse(D(C), { |
---|
120 | | - | let y = x(K) |
---|
121 | | - | [StringEntry(q, y)] |
---|
| 116 | + | @Callable(B) |
---|
| 117 | + | func setManager (J) = valueOrElse(C(B), { |
---|
| 118 | + | let x = w(J) |
---|
| 119 | + | [StringEntry(q, x)] |
---|
122 | 120 | | }) |
---|
123 | 121 | | |
---|
124 | 122 | | |
---|
125 | 123 | | |
---|
126 | | - | @Callable(C) |
---|
127 | | - | func setHousekeeper (L) = valueOrElse(D(C), { |
---|
128 | | - | let y = x(L) |
---|
129 | | - | [StringEntry(j, y)] |
---|
| 124 | + | @Callable(B) |
---|
| 125 | + | func setHousekeeper (K) = valueOrElse(C(B), { |
---|
| 126 | + | let x = w(K) |
---|
| 127 | + | [StringEntry(j, x)] |
---|
130 | 128 | | }) |
---|
131 | 129 | | |
---|
132 | 130 | | |
---|
133 | 131 | | |
---|
134 | | - | @Callable(C) |
---|
135 | | - | func setPrizes (M) = valueOrElse(D(C), { |
---|
136 | | - | let y = x(M) |
---|
137 | | - | [StringEntry(i, y)] |
---|
| 132 | + | @Callable(B) |
---|
| 133 | + | func setPrizes (L) = valueOrElse(C(B), { |
---|
| 134 | + | let x = w(L) |
---|
| 135 | + | [StringEntry(i, x)] |
---|
138 | 136 | | }) |
---|
139 | 137 | | |
---|
140 | 138 | | |
---|
141 | 139 | | |
---|
142 | | - | @Callable(C) |
---|
143 | | - | func setNftManager (N) = valueOrElse(D(C), { |
---|
144 | | - | let y = x(N) |
---|
145 | | - | [StringEntry(r, y)] |
---|
| 140 | + | @Callable(B) |
---|
| 141 | + | func setNftManager (M) = valueOrElse(C(B), { |
---|
| 142 | + | let x = w(M) |
---|
| 143 | + | [StringEntry(r, x)] |
---|
146 | 144 | | }) |
---|
147 | 145 | | |
---|
148 | 146 | | |
---|
149 | 147 | | |
---|
150 | | - | @Callable(C) |
---|
151 | | - | func setSwap (O) = valueOrElse(D(C), { |
---|
152 | | - | let y = x(O) |
---|
153 | | - | [StringEntry(f, y)] |
---|
| 148 | + | @Callable(B) |
---|
| 149 | + | func setSwap (N) = valueOrElse(C(B), { |
---|
| 150 | + | let x = w(N) |
---|
| 151 | + | [StringEntry(f, x)] |
---|
154 | 152 | | }) |
---|
155 | 153 | | |
---|
156 | 154 | | |
---|
157 | 155 | | |
---|
158 | | - | @Callable(C) |
---|
159 | | - | func setQuoteAsset (P) = valueOrElse(D(C), [StringEntry(d, P)]) |
---|
| 156 | + | @Callable(B) |
---|
| 157 | + | func setQuoteAsset (O) = valueOrElse(C(B), [StringEntry(d, O)]) |
---|
160 | 158 | | |
---|
161 | 159 | | |
---|
162 | 160 | | |
---|
163 | | - | @Callable(C) |
---|
164 | | - | func setRewardAsset (P) = valueOrElse(D(C), [StringEntry(e, P)]) |
---|
| 161 | + | @Callable(B) |
---|
| 162 | + | func setRewardAsset (O) = valueOrElse(C(B), [StringEntry(e, O)]) |
---|
165 | 163 | | |
---|
166 | 164 | | |
---|
167 | 165 | | |
---|
168 | | - | @Callable(C) |
---|
169 | | - | func setStakingAddress (Q) = valueOrElse(D(C), { |
---|
170 | | - | let R = x(Q) |
---|
171 | | - | [StringEntry(g, Q)] |
---|
| 166 | + | @Callable(B) |
---|
| 167 | + | func setStakingAddress (P) = valueOrElse(C(B), { |
---|
| 168 | + | let Q = w(P) |
---|
| 169 | + | [StringEntry(g, P)] |
---|
172 | 170 | | }) |
---|
173 | 171 | | |
---|
174 | 172 | | |
---|
175 | 173 | | |
---|
176 | | - | @Callable(C) |
---|
177 | | - | func setCollateralAddress (S) = valueOrElse(D(C), { |
---|
178 | | - | let T = x(S) |
---|
179 | | - | [StringEntry(s, S)] |
---|
| 174 | + | @Callable(B) |
---|
| 175 | + | func setVaultAddress (R) = valueOrElse(C(B), { |
---|
| 176 | + | let S = w(R) |
---|
| 177 | + | [StringEntry(b, R)] |
---|
180 | 178 | | }) |
---|
181 | 179 | | |
---|
182 | 180 | | |
---|
183 | 181 | | |
---|
184 | | - | @Callable(C) |
---|
185 | | - | func setExchangeAddress (U) = valueOrElse(D(C), { |
---|
186 | | - | let V = x(U) |
---|
187 | | - | [StringEntry(t, U)] |
---|
| 182 | + | @Callable(B) |
---|
| 183 | + | func addChild (T) = valueOrElse(C(B), { |
---|
| 184 | + | let U = w(T) |
---|
| 185 | + | [BooleanEntry(t(s, T), true)] |
---|
188 | 186 | | }) |
---|
189 | 187 | | |
---|
190 | 188 | | |
---|
191 | 189 | | |
---|
192 | | - | @Callable(C) |
---|
193 | | - | func setVaultAddress (W) = valueOrElse(D(C), { |
---|
194 | | - | let V = x(W) |
---|
195 | | - | [StringEntry(b, W)] |
---|
| 190 | + | @Callable(B) |
---|
| 191 | + | func addAmm (V,W) = valueOrElse(C(B), { |
---|
| 192 | + | let X = w(V) |
---|
| 193 | + | [BooleanEntry(t(k, V), true), StringEntry(t(l, V), W)] |
---|
196 | 194 | | }) |
---|
197 | 195 | | |
---|
198 | 196 | | |
---|
199 | 197 | | |
---|
200 | | - | @Callable(C) |
---|
201 | | - | func addAmm (X,Y) = valueOrElse(D(C), { |
---|
202 | | - | let Z = x(X) |
---|
203 | | - | [BooleanEntry(u(k, X), true), StringEntry(u(l, X), Y)] |
---|
204 | | - | }) |
---|
| 198 | + | @Callable(B) |
---|
| 199 | + | func removeAmm (V) = valueOrElse(C(B), [DeleteEntry(t(k, V))]) |
---|
205 | 200 | | |
---|
206 | 201 | | |
---|
207 | 202 | | |
---|
208 | | - | @Callable(C) |
---|
209 | | - | func removeAmm (X) = valueOrElse(D(C), [DeleteEntry(u(k, X))]) |
---|
210 | | - | |
---|
211 | | - | |
---|
212 | | - | |
---|
213 | | - | @Callable(C) |
---|
214 | | - | func setGovernanceAsset (P) = valueOrElse(D(C), { |
---|
215 | | - | let aa = fromBase58String(P) |
---|
216 | | - | let ab = assetInfo(aa) |
---|
217 | | - | if ($isInstanceOf(ab, "Asset")) |
---|
| 203 | + | @Callable(B) |
---|
| 204 | + | func setGovernanceAsset (O) = valueOrElse(C(B), { |
---|
| 205 | + | let Y = fromBase58String(O) |
---|
| 206 | + | let Z = assetInfo(Y) |
---|
| 207 | + | if ($isInstanceOf(Z, "Asset")) |
---|
218 | 208 | | then { |
---|
219 | | - | let ac = ab |
---|
220 | | - | if ((ac.decimals != 8)) |
---|
| 209 | + | let aa = Z |
---|
| 210 | + | if ((aa.decimals != 8)) |
---|
221 | 211 | | then throw("Invalid asset decimals, should be 8") |
---|
222 | | - | else [StringEntry(m, P)] |
---|
| 212 | + | else [StringEntry(m, O)] |
---|
223 | 213 | | } |
---|
224 | 214 | | else throw("Can't find asset") |
---|
225 | 215 | | }) |
---|
226 | 216 | | |
---|
227 | 217 | | |
---|
228 | | - | @Verifier(ad) |
---|
229 | | - | func ae () = { |
---|
230 | | - | let ab = getString(this, c) |
---|
231 | | - | if ($isInstanceOf(ab, "String")) |
---|
| 218 | + | @Verifier(ab) |
---|
| 219 | + | func ac () = { |
---|
| 220 | + | let Z = getString(this, c) |
---|
| 221 | + | if ($isInstanceOf(Z, "String")) |
---|
232 | 222 | | then { |
---|
233 | | - | let af = ab |
---|
234 | | - | valueOrElse(getBoolean(addressFromStringValue(af), ((("status_" + toString(this)) + "_") + toBase58String(ad.id))), false) |
---|
| 223 | + | let ad = Z |
---|
| 224 | + | valueOrElse(getBoolean(addressFromStringValue(ad), ((("status_" + toString(this)) + "_") + toBase58String(ab.id))), false) |
---|
235 | 225 | | } |
---|
236 | | - | else sigVerify(ad.bodyBytes, ad.proofs[0], ad.senderPublicKey) |
---|
| 226 | + | else sigVerify(ab.bodyBytes, ab.proofs[0], ab.senderPublicKey) |
---|
237 | 227 | | } |
---|
238 | 228 | | |
---|