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