tx · aDE9WbBU4Uacst5HTkxDpzt1SYyxMKn57fUiFAcUYde 3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p: -0.03400000 Waves 2023.05.24 17:20 [2592175] smart account 3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p > SELF 0.00000000 Waves
{ "type": 13, "id": "aDE9WbBU4Uacst5HTkxDpzt1SYyxMKn57fUiFAcUYde", "fee": 3400000, "feeAssetId": null, "timestamp": 1684938119133, "version": 2, "chainId": 84, "sender": "3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p", "senderPublicKey": "H5ZH4BkyVtNBc32qbTGZxG4iQPcMF7Sfy65QkYQGzNMQ", "proofs": [ "5G1LaieoMAwPaWSYYr19WCx4rZuZ6J1RoCu5UfH4Xim2jkyJc8qULsyLmT23weuYjej1uGKdfWeYAcZdku3UU433" ], "script": "base64:BgJsCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIGwATa19pbnN1cmFuY2VfYWRkcmVzcwITa19pbnN1cmFuY2VfYWRkcmVzcwAPa192YXVsdF9hZGRyZXNzAg9rX3ZhdWx0X2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAA1rX3F1b3RlX2Fzc2V0Ag1rX3F1b3RlX2Fzc2V0AA5rX3Jld2FyZF9hc3NldAIOa19yZXdhcmRfYXNzZXQADmtfc3dhcF9hZGRyZXNzAg5rX3N3YXBfYWRkcmVzcwARa19zdGFraW5nX2FkZHJlc3MCEWtfc3Rha2luZ19hZGRyZXNzABFrX2Zhcm1pbmdfYWRkcmVzcwIRa19mYXJtaW5nX2FkZHJlc3MAEGtfcHJpemVzX2FkZHJlc3MCEGtfcHJpemVzX2FkZHJlc3MAFWtfaG91c2VrZWVwZXJfYWRk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mllcgkArAICCQCsAgIJAKwCAgIHc3RhdHVzXwkApQgBBQR0aGlzAgFfCQDYBAEIBQJ0eAJpZAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXl0fnC7", "height": 2592175, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C9YvzQBgCuVq6XzToahZt99da1FRTSjgNLuKHdDgk8D7 Next: 5GMN87jBCvZyBoEcQ2fzoBtxoD76sCXH4yKNuTAPFw2o Diff:
Old | New | Differences | |
---|---|---|---|
223 | 223 | func setOracleAddress (_oracleAddress) = valueOrElse(isAdmin(i), { | |
224 | 224 | let oracleAddress = getAddressIfValid(_oracleAddress) | |
225 | 225 | if ((oracleAddress == oracleAddress)) | |
226 | - | then [StringEntry(k_ | |
226 | + | then [StringEntry(k_oracle, _oracleAddress)] | |
227 | 227 | else throw("Strict value is not equal to itself.") | |
228 | 228 | }) | |
229 | 229 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_insurance_address = "k_insurance_address" | |
5 | 5 | ||
6 | 6 | let k_vault_address = "k_vault_address" | |
7 | 7 | ||
8 | 8 | let k_admin_address = "k_admin_address" | |
9 | 9 | ||
10 | 10 | let k_quote_asset = "k_quote_asset" | |
11 | 11 | ||
12 | 12 | let k_reward_asset = "k_reward_asset" | |
13 | 13 | ||
14 | 14 | let k_swap_address = "k_swap_address" | |
15 | 15 | ||
16 | 16 | let k_staking_address = "k_staking_address" | |
17 | 17 | ||
18 | 18 | let k_farming_address = "k_farming_address" | |
19 | 19 | ||
20 | 20 | let k_prizes_address = "k_prizes_address" | |
21 | 21 | ||
22 | 22 | let k_housekeeper_address = "k_housekeeper_address" | |
23 | 23 | ||
24 | 24 | let k_amm = "k_amm" | |
25 | 25 | ||
26 | 26 | let k_amm_data = "k_amm_data" | |
27 | 27 | ||
28 | 28 | let k_governance_asset = "k_gov_asset" | |
29 | 29 | ||
30 | 30 | let k_miner_address = "k_miner_address" | |
31 | 31 | ||
32 | 32 | let k_orders_address = "k_orders_address" | |
33 | 33 | ||
34 | 34 | let k_referral_address = "k_referral_address" | |
35 | 35 | ||
36 | 36 | let k_manager_address = "k_manager_address" | |
37 | 37 | ||
38 | 38 | let k_nft_manager_address = "k_nft_manager_address" | |
39 | 39 | ||
40 | 40 | let k_child = "k_child" | |
41 | 41 | ||
42 | 42 | let k_oracle = "k_oracle" | |
43 | 43 | ||
44 | 44 | let k_spot_address = "k_spot_address" | |
45 | 45 | ||
46 | 46 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func isNoAdmin () = (getString(this, k_admin_address) == unit) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined")) | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin()) | |
59 | 59 | then (i.caller == this) | |
60 | 60 | else false) | |
61 | 61 | then true | |
62 | 62 | else (i.caller == admin())) | |
63 | 63 | then unit | |
64 | 64 | else throw("Only the Admin itself can invoke this function") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func isAdmin (i) = if ((i.caller == admin())) | |
68 | 68 | then unit | |
69 | 69 | else throw("Only the Admin itself can invoke this function") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | @Callable(i) | |
73 | 73 | func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), { | |
74 | 74 | let address = addressFromStringValue(_adminAddress) | |
75 | 75 | if ((address == address)) | |
76 | 76 | then [StringEntry(k_admin_address, toString(address))] | |
77 | 77 | else throw("Strict value is not equal to itself.") | |
78 | 78 | }) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | 82 | @Callable(i) | |
83 | 83 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
84 | 84 | let address = getAddressIfValid(_insuranceFund) | |
85 | 85 | if ((address == address)) | |
86 | 86 | then [StringEntry(k_insurance_address, address)] | |
87 | 87 | else throw("Strict value is not equal to itself.") | |
88 | 88 | }) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
94 | 94 | let address = getAddressIfValid(_liquidityMiner) | |
95 | 95 | if ((address == address)) | |
96 | 96 | then [StringEntry(k_miner_address, address)] | |
97 | 97 | else throw("Strict value is not equal to itself.") | |
98 | 98 | }) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func setOrders (_orders) = valueOrElse(isAdmin(i), { | |
104 | 104 | let address = getAddressIfValid(_orders) | |
105 | 105 | if ((address == address)) | |
106 | 106 | then [StringEntry(k_orders_address, address)] | |
107 | 107 | else throw("Strict value is not equal to itself.") | |
108 | 108 | }) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | 112 | @Callable(i) | |
113 | 113 | func setReferral (_referral) = valueOrElse(isAdmin(i), { | |
114 | 114 | let address = getAddressIfValid(_referral) | |
115 | 115 | if ((address == address)) | |
116 | 116 | then [StringEntry(k_referral_address, address)] | |
117 | 117 | else throw("Strict value is not equal to itself.") | |
118 | 118 | }) | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | ||
122 | 122 | @Callable(i) | |
123 | 123 | func setFarming (_farming) = valueOrElse(isAdmin(i), { | |
124 | 124 | let address = getAddressIfValid(_farming) | |
125 | 125 | if ((address == address)) | |
126 | 126 | then [StringEntry(k_farming_address, address)] | |
127 | 127 | else throw("Strict value is not equal to itself.") | |
128 | 128 | }) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | ||
132 | 132 | @Callable(i) | |
133 | 133 | func setManager (_manager) = valueOrElse(isAdmin(i), { | |
134 | 134 | let address = getAddressIfValid(_manager) | |
135 | 135 | if ((address == address)) | |
136 | 136 | then [StringEntry(k_manager_address, address)] | |
137 | 137 | else throw("Strict value is not equal to itself.") | |
138 | 138 | }) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(i) | |
143 | 143 | func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), { | |
144 | 144 | let address = getAddressIfValid(_housekeeper) | |
145 | 145 | if ((address == address)) | |
146 | 146 | then [StringEntry(k_housekeeper_address, address)] | |
147 | 147 | else throw("Strict value is not equal to itself.") | |
148 | 148 | }) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func setPrizes (_prizes) = valueOrElse(isAdmin(i), { | |
154 | 154 | let address = getAddressIfValid(_prizes) | |
155 | 155 | if ((address == address)) | |
156 | 156 | then [StringEntry(k_prizes_address, address)] | |
157 | 157 | else throw("Strict value is not equal to itself.") | |
158 | 158 | }) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | ||
162 | 162 | @Callable(i) | |
163 | 163 | func setNftManager (_nftManager) = valueOrElse(isAdmin(i), { | |
164 | 164 | let address = getAddressIfValid(_nftManager) | |
165 | 165 | if ((address == address)) | |
166 | 166 | then [StringEntry(k_nft_manager_address, address)] | |
167 | 167 | else throw("Strict value is not equal to itself.") | |
168 | 168 | }) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | ||
172 | 172 | @Callable(i) | |
173 | 173 | func setSwap (_swap) = valueOrElse(isAdmin(i), { | |
174 | 174 | let address = getAddressIfValid(_swap) | |
175 | 175 | if ((address == address)) | |
176 | 176 | then [StringEntry(k_swap_address, address)] | |
177 | 177 | else throw("Strict value is not equal to itself.") | |
178 | 178 | }) | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Callable(i) | |
183 | 183 | func setQuoteAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_quote_asset, _assetId)]) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | 187 | @Callable(i) | |
188 | 188 | func setRewardAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_reward_asset, _assetId)]) | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | ||
192 | 192 | @Callable(i) | |
193 | 193 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
194 | 194 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
195 | 195 | if ((stakingAddress == stakingAddress)) | |
196 | 196 | then [StringEntry(k_staking_address, _stakingAddress)] | |
197 | 197 | else throw("Strict value is not equal to itself.") | |
198 | 198 | }) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(i) | |
203 | 203 | func setSpotAddress (_spotAddress) = valueOrElse(isAdmin(i), { | |
204 | 204 | let stakingAddress = getAddressIfValid(_spotAddress) | |
205 | 205 | if ((stakingAddress == stakingAddress)) | |
206 | 206 | then [StringEntry(k_spot_address, _spotAddress)] | |
207 | 207 | else throw("Strict value is not equal to itself.") | |
208 | 208 | }) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | 213 | func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), { | |
214 | 214 | let exchangeAddress = getAddressIfValid(_vaultAddress) | |
215 | 215 | if ((exchangeAddress == exchangeAddress)) | |
216 | 216 | then [StringEntry(k_vault_address, _vaultAddress)] | |
217 | 217 | else throw("Strict value is not equal to itself.") | |
218 | 218 | }) | |
219 | 219 | ||
220 | 220 | ||
221 | 221 | ||
222 | 222 | @Callable(i) | |
223 | 223 | func setOracleAddress (_oracleAddress) = valueOrElse(isAdmin(i), { | |
224 | 224 | let oracleAddress = getAddressIfValid(_oracleAddress) | |
225 | 225 | if ((oracleAddress == oracleAddress)) | |
226 | - | then [StringEntry(k_ | |
226 | + | then [StringEntry(k_oracle, _oracleAddress)] | |
227 | 227 | else throw("Strict value is not equal to itself.") | |
228 | 228 | }) | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | ||
232 | 232 | @Callable(i) | |
233 | 233 | func addChild (_childAddress) = valueOrElse(isAdmin(i), { | |
234 | 234 | let childAddress = getAddressIfValid(_childAddress) | |
235 | 235 | [BooleanEntry(toCompositeKey(k_child, _childAddress), true)] | |
236 | 236 | }) | |
237 | 237 | ||
238 | 238 | ||
239 | 239 | ||
240 | 240 | @Callable(i) | |
241 | 241 | func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), { | |
242 | 242 | let ammAddress = getAddressIfValid(_ammAddress) | |
243 | 243 | [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)] | |
244 | 244 | }) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | 248 | @Callable(i) | |
249 | 249 | func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))]) | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | ||
253 | 253 | @Callable(i) | |
254 | 254 | func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), { | |
255 | 255 | let assetBytes = fromBase58String(_assetId) | |
256 | 256 | match assetInfo(assetBytes) { | |
257 | 257 | case asset: Asset => | |
258 | 258 | if ((asset.decimals != 8)) | |
259 | 259 | then throw("Invalid asset decimals, should be 8") | |
260 | 260 | else [StringEntry(k_governance_asset, _assetId)] | |
261 | 261 | case _ => | |
262 | 262 | throw("Can't find asset") | |
263 | 263 | } | |
264 | 264 | }) | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | @Verifier(tx) | |
268 | 268 | func verify () = match getString(this, k_admin_address) { | |
269 | 269 | case verifier: String => | |
270 | 270 | valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
271 | 271 | case _ => | |
272 | 272 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
273 | 273 | } | |
274 | 274 |
github/deemru/w8io/026f985 35.53 ms ◑