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:BgJnCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgQKAggIEgMKAQgSAwoBCBoAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MAD2tfdmF1bHRfYWRkcmVzcwIPa192YXVsdF9hZGRyZXNzAA9rX2FkbWluX2FkZHJlc3MCD2tfYWRtaW5fYWRkcmVzcwANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAOa19yZXdhcmRfYXNzZXQCDmtfcmV3YXJkX2Fzc2V0AA5rX3N3YXBfYWRkcmVzcwIOa19zd2FwX2FkZHJlc3MAEWtfc3Rha2luZ19hZGRyZXNzAhFrX3N0YWtpbmdfYWRkcmVzcwARa19mYXJtaW5nX2FkZHJlc3MCEWtfZmFybWluZ19hZGRyZXNzABBrX3ByaXplc19hZGRyZXNzAhBrX3ByaXplc19hZGRyZXNzABVrX2hvdXNla2VlcGVyX2FkZHJlc3MCFWt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m5hbmNlQXNzZXQBCF9hc3NldElkCQELdmFsdWVPckVsc2UCCQEHaXNBZG1pbgEFAWkECmFzc2V0Qnl0ZXMJANkEAQUIX2Fzc2V0SWQEByRtYXRjaDAJAOwHAQUKYXNzZXRCeXRlcwMJAAECBQckbWF0Y2gwAgVBc3NldAQFYXNzZXQFByRtYXRjaDADCQECIT0CCAUFYXNzZXQIZGVjaW1hbHMACAkAAgECI0ludmFsaWQgYXNzZXQgZGVjaW1hbHMsIHNob3VsZCBiZSA4CQDMCAIJAQtTdHJpbmdFbnRyeQIFEmtfZ292ZXJuYW5jZV9hc3NldAUIX2Fzc2V0SWQFA25pbAkAAgECEENhbid0IGZpbmQgYXNzZXQBAnR4AQZ2ZXJpZnkABAckbWF0Y2gwCQCdCAIFBHRoaXMFD2tfYWRtaW5fYWRkcmVzcwMJAAECBQckbWF0Y2gwAgZTdHJpbmcECHZlcmlmaWVyBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCHZlcmlmaWVyCQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleUWzxYc=", "height": 2474328, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GKcv2oYdn8wCF25xBedSsBRTsuUioj6NnBDzBdMNYQDy Next: A3mnHrz5EAHBdCBSS3ZV2Rm3q7dFFkrRjcNoV3M3NSkU Diff:
OldNewDifferences
99
1010 let k_quote_asset = "k_quote_asset"
1111
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"
1315
1416 let k_staking_address = "k_staking_address"
1517
146148
147149
148150 @Callable(i)
149-func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), {
150- let stakingAddress = getAddressIfValid(_stakingAddress)
151-[StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)]
151+func setSwap (_swap) = valueOrElse(isAdmin(i), {
152+ let address = getAddressIfValid(_swap)
153+[StringEntry(k_swap_address, address)]
152154 })
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)])
153165
154166
155167
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_insurance_address = "k_insurance_address"
55
66 let k_vault_address = "k_vault_address"
77
88 let k_admin_address = "k_admin_address"
99
1010 let k_quote_asset = "k_quote_asset"
1111
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"
1315
1416 let k_staking_address = "k_staking_address"
1517
1618 let k_farming_address = "k_farming_address"
1719
1820 let k_prizes_address = "k_prizes_address"
1921
2022 let k_housekeeper_address = "k_housekeeper_address"
2123
2224 let k_amm = "k_amm"
2325
2426 let k_amm_data = "k_amm_data"
2527
2628 let k_governance_asset = "k_gov_asset"
2729
2830 let k_miner_address = "k_miner_address"
2931
3032 let k_orders_address = "k_orders_address"
3133
3234 let k_referral_address = "k_referral_address"
3335
3436 let k_manager_address = "k_manager_address"
3537
3638 let k_nft_manager_address = "k_nft_manager_address"
3739
3840 let k_collateral_address = "k_collateral_address"
3941
4042 let k_exchange_address = "k_exchange_address"
4143
4244 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
4345
4446
4547 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
4648
4749
4850 func isNoAdmin () = (getString(this, k_admin_address) == unit)
4951
5052
5153 func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined"))
5254
5355
5456 func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin())
5557 then (i.caller == this)
5658 else false)
5759 then true
5860 else (i.caller == admin()))
5961 then unit
6062 else throw("Only the Admin itself can invoke this function")
6163
6264
6365 func isAdmin (i) = if ((i.caller == admin()))
6466 then unit
6567 else throw("Only the Admin itself can invoke this function")
6668
6769
6870 @Callable(i)
6971 func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), {
7072 let address = addressFromStringValue(_adminAddress)
7173 [StringEntry(k_admin_address, toString(address))]
7274 })
7375
7476
7577
7678 @Callable(i)
7779 func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), {
7880 let address = getAddressIfValid(_insuranceFund)
7981 [StringEntry(k_insurance_address, address)]
8082 })
8183
8284
8385
8486 @Callable(i)
8587 func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), {
8688 let address = getAddressIfValid(_liquidityMiner)
8789 [StringEntry(k_miner_address, address)]
8890 })
8991
9092
9193
9294 @Callable(i)
9395 func setOrders (_orders) = valueOrElse(isAdmin(i), {
9496 let address = getAddressIfValid(_orders)
9597 [StringEntry(k_orders_address, address)]
9698 })
9799
98100
99101
100102 @Callable(i)
101103 func setReferral (_referral) = valueOrElse(isAdmin(i), {
102104 let address = getAddressIfValid(_referral)
103105 [StringEntry(k_referral_address, address)]
104106 })
105107
106108
107109
108110 @Callable(i)
109111 func setFarming (_farming) = valueOrElse(isAdmin(i), {
110112 let address = getAddressIfValid(_farming)
111113 [StringEntry(k_farming_address, address)]
112114 })
113115
114116
115117
116118 @Callable(i)
117119 func setManager (_manager) = valueOrElse(isAdmin(i), {
118120 let address = getAddressIfValid(_manager)
119121 [StringEntry(k_manager_address, address)]
120122 })
121123
122124
123125
124126 @Callable(i)
125127 func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), {
126128 let address = getAddressIfValid(_housekeeper)
127129 [StringEntry(k_housekeeper_address, address)]
128130 })
129131
130132
131133
132134 @Callable(i)
133135 func setPrizes (_prizes) = valueOrElse(isAdmin(i), {
134136 let address = getAddressIfValid(_prizes)
135137 [StringEntry(k_prizes_address, address)]
136138 })
137139
138140
139141
140142 @Callable(i)
141143 func setNftManager (_nftManager) = valueOrElse(isAdmin(i), {
142144 let address = getAddressIfValid(_nftManager)
143145 [StringEntry(k_nft_manager_address, address)]
144146 })
145147
146148
147149
148150 @Callable(i)
149-func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), {
150- let stakingAddress = getAddressIfValid(_stakingAddress)
151-[StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)]
151+func setSwap (_swap) = valueOrElse(isAdmin(i), {
152+ let address = getAddressIfValid(_swap)
153+[StringEntry(k_swap_address, address)]
152154 })
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)])
153165
154166
155167
156168 @Callable(i)
157169 func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), {
158170 let stakingAddress = getAddressIfValid(_stakingAddress)
159171 [StringEntry(k_staking_address, _stakingAddress)]
160172 })
161173
162174
163175
164176 @Callable(i)
165177 func setCollateralAddress (_collateralAddress) = valueOrElse(isAdmin(i), {
166178 let collateralAddress = getAddressIfValid(_collateralAddress)
167179 [StringEntry(k_collateral_address, _collateralAddress)]
168180 })
169181
170182
171183
172184 @Callable(i)
173185 func setExchangeAddress (_exchangeAddress) = valueOrElse(isAdmin(i), {
174186 let exchangeAddress = getAddressIfValid(_exchangeAddress)
175187 [StringEntry(k_exchange_address, _exchangeAddress)]
176188 })
177189
178190
179191
180192 @Callable(i)
181193 func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
182194 let exchangeAddress = getAddressIfValid(_vaultAddress)
183195 [StringEntry(k_vault_address, _vaultAddress)]
184196 })
185197
186198
187199
188200 @Callable(i)
189201 func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), {
190202 let ammAddress = getAddressIfValid(_ammAddress)
191203 [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)]
192204 })
193205
194206
195207
196208 @Callable(i)
197209 func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))])
198210
199211
200212
201213 @Callable(i)
202214 func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), {
203215 let assetBytes = fromBase58String(_assetId)
204216 match assetInfo(assetBytes) {
205217 case asset: Asset =>
206218 if ((asset.decimals != 8))
207219 then throw("Invalid asset decimals, should be 8")
208220 else [StringEntry(k_governance_asset, _assetId)]
209221 case _ =>
210222 throw("Can't find asset")
211223 }
212224 })
213225
214226
215227 @Verifier(tx)
216228 func verify () = match getString(this, k_admin_address) {
217229 case verifier: String =>
218230 valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
219231 case _ =>
220232 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
221233 }
222234

github/deemru/w8io/026f985 
42.82 ms