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