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