tx · DfP7TK3LyqzVc8rPHPvsYGdsJWRgakB31z4xEK97vevq

3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8:  -0.03400000 Waves

2023.04.17 19:59 [2538833] smart account 3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8 > SELF 0.00000000 Waves

{ "type": 13, "id": "DfP7TK3LyqzVc8rPHPvsYGdsJWRgakB31z4xEK97vevq", "fee": 3400000, "feeAssetId": null, "timestamp": 1681750803365, "version": 2, "chainId": 84, "sender": "3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8", "senderPublicKey": "HjRpGGPsru1jMvZDVG83rQfzQRHCWNnrpMaqTpHogxyn", "proofs": [ "5insn4xLVYzTfCXr3juC7D24Z41HhmKsnnmk5X3CxYxwxf3tbdW3d9y582zxozwBWp4Vm7vuZXzqzWnBW9qqmuNJ" ], "script": "base64:BgJiCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgMKAQgZABNrX2luc3VyYW5jZV9hZGRyZXNzAhNrX2luc3VyYW5jZV9hZGRyZXNzAA9rX3ZhdWx0X2FkZHJlc3MCD2tfdmF1bHRfYWRkcmVzcwAPa19hZG1pbl9hZGRyZXNzAg9rX2FkbWluX2FkZHJlc3MADWtfcXVvdGVfYXNzZXQCDWtfcXVvdGVfYXNzZXQADmtfcmV3YXJkX2Fzc2V0Ag5rX3Jld2FyZF9hc3NldAAOa19zd2FwX2FkZHJlc3MCDmtfc3dhcF9hZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwAQa19wcml6ZXNfYWRkcmVzcwIQa19wcml6ZXNfYWRkcmVzcwAVa19ob3VzZWtlZXBlcl9hZGRyZXNzAh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DYW4ndCBmaW5kIGFzc2V0AQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAkAnQgCBQR0aGlzBQ9rX2FkbWluX2FkZHJlc3MDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAh2ZXJpZmllcgUHJG1hdGNoMAkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQh2ZXJpZmllcgkArAICCQCsAgIJAKwCAgIHc3RhdHVzXwkApQgBBQR0aGlzAgFfCQDYBAEIBQJ0eAJpZAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmJcs8p", "height": 2538833, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: TyLj6wFsizsbhkPksHmB9B1F72QRNPYJbowNnSZBveT Next: none Diff:
OldNewDifferences
77
88 let k_admin_address = "k_admin_address"
99
10-let k_admin_public_key = "k_admin_public_key"
11-
1210 let k_quote_asset = "k_quote_asset"
1311
14-let k_quote_staking = "k_quote_staking"
12+let k_reward_asset = "k_reward_asset"
13+
14+let k_swap_address = "k_swap_address"
1515
1616 let k_staking_address = "k_staking_address"
1717
3737
3838 let k_nft_manager_address = "k_nft_manager_address"
3939
40-let k_collateral_address = "k_collateral_address"
41-
42-let k_exchange_address = "k_exchange_address"
40+let k_child = "k_child"
4341
4442 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
4543
4644
4745 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
48-
49-
50-func adminPublicKey () = getStringValue(this, k_admin_public_key)
5146
5247
5348 func isNoAdmin () = (getString(this, k_admin_address) == unit)
5651 func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined"))
5752
5853
59-func isNoAdminOrAdmin (i) = if (if (isNoAdmin())
54+func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin())
55+ then (i.caller == this)
56+ else false)
6057 then true
6158 else (i.caller == admin()))
6259 then unit
6966
7067
7168 @Callable(i)
72-func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), {
73- let bytes = fromBase58String(_adminPublicKey)
74- let address = addressFromPublicKey(bytes)
75-[StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)]
69+func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), {
70+ let address = addressFromStringValue(_adminAddress)
71+[StringEntry(k_admin_address, toString(address))]
7672 })
7773
7874
150146
151147
152148 @Callable(i)
153-func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), {
154- let stakingAddress = getAddressIfValid(_stakingAddress)
155-[StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)]
149+func setSwap (_swap) = valueOrElse(isAdmin(i), {
150+ let address = getAddressIfValid(_swap)
151+[StringEntry(k_swap_address, address)]
156152 })
153+
154+
155+
156+@Callable(i)
157+func setQuoteAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_quote_asset, _assetId)])
158+
159+
160+
161+@Callable(i)
162+func setRewardAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_reward_asset, _assetId)])
157163
158164
159165
166172
167173
168174 @Callable(i)
169-func setCollateralAddress (_collateralAddress) = valueOrElse(isAdmin(i), {
170- let collateralAddress = getAddressIfValid(_collateralAddress)
171-[StringEntry(k_collateral_address, _collateralAddress)]
175+func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
176+ let exchangeAddress = getAddressIfValid(_vaultAddress)
177+[StringEntry(k_vault_address, _vaultAddress)]
172178 })
173179
174180
175181
176182 @Callable(i)
177-func setExchangeAddress (_exchangeAddress) = valueOrElse(isAdmin(i), {
178- let exchangeAddress = getAddressIfValid(_exchangeAddress)
179-[StringEntry(k_exchange_address, _exchangeAddress)]
180- })
181-
182-
183-
184-@Callable(i)
185-func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
186- let exchangeAddress = getAddressIfValid(_vaultAddress)
187-[StringEntry(k_vault_address, _vaultAddress)]
183+func addChild (_childAddress) = valueOrElse(isAdmin(i), {
184+ let childAddress = getAddressIfValid(_childAddress)
185+[BooleanEntry(toCompositeKey(k_child, _childAddress), true)]
188186 })
189187
190188
217215
218216
219217 @Verifier(tx)
220-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey()))
218+func verify () = match getString(this, k_admin_address) {
219+ case verifier: String =>
220+ valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
221+ case _ =>
222+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
223+}
221224
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
10-let k_admin_public_key = "k_admin_public_key"
11-
1210 let k_quote_asset = "k_quote_asset"
1311
14-let k_quote_staking = "k_quote_staking"
12+let k_reward_asset = "k_reward_asset"
13+
14+let k_swap_address = "k_swap_address"
1515
1616 let k_staking_address = "k_staking_address"
1717
1818 let k_farming_address = "k_farming_address"
1919
2020 let k_prizes_address = "k_prizes_address"
2121
2222 let k_housekeeper_address = "k_housekeeper_address"
2323
2424 let k_amm = "k_amm"
2525
2626 let k_amm_data = "k_amm_data"
2727
2828 let k_governance_asset = "k_gov_asset"
2929
3030 let k_miner_address = "k_miner_address"
3131
3232 let k_orders_address = "k_orders_address"
3333
3434 let k_referral_address = "k_referral_address"
3535
3636 let k_manager_address = "k_manager_address"
3737
3838 let k_nft_manager_address = "k_nft_manager_address"
3939
40-let k_collateral_address = "k_collateral_address"
41-
42-let k_exchange_address = "k_exchange_address"
40+let k_child = "k_child"
4341
4442 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
4543
4644
4745 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
48-
49-
50-func adminPublicKey () = getStringValue(this, k_admin_public_key)
5146
5247
5348 func isNoAdmin () = (getString(this, k_admin_address) == unit)
5449
5550
5651 func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined"))
5752
5853
59-func isNoAdminOrAdmin (i) = if (if (isNoAdmin())
54+func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin())
55+ then (i.caller == this)
56+ else false)
6057 then true
6158 else (i.caller == admin()))
6259 then unit
6360 else throw("Only the Admin itself can invoke this function")
6461
6562
6663 func isAdmin (i) = if ((i.caller == admin()))
6764 then unit
6865 else throw("Only the Admin itself can invoke this function")
6966
7067
7168 @Callable(i)
72-func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), {
73- let bytes = fromBase58String(_adminPublicKey)
74- let address = addressFromPublicKey(bytes)
75-[StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)]
69+func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), {
70+ let address = addressFromStringValue(_adminAddress)
71+[StringEntry(k_admin_address, toString(address))]
7672 })
7773
7874
7975
8076 @Callable(i)
8177 func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), {
8278 let address = getAddressIfValid(_insuranceFund)
8379 [StringEntry(k_insurance_address, address)]
8480 })
8581
8682
8783
8884 @Callable(i)
8985 func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), {
9086 let address = getAddressIfValid(_liquidityMiner)
9187 [StringEntry(k_miner_address, address)]
9288 })
9389
9490
9591
9692 @Callable(i)
9793 func setOrders (_orders) = valueOrElse(isAdmin(i), {
9894 let address = getAddressIfValid(_orders)
9995 [StringEntry(k_orders_address, address)]
10096 })
10197
10298
10399
104100 @Callable(i)
105101 func setReferral (_referral) = valueOrElse(isAdmin(i), {
106102 let address = getAddressIfValid(_referral)
107103 [StringEntry(k_referral_address, address)]
108104 })
109105
110106
111107
112108 @Callable(i)
113109 func setFarming (_farming) = valueOrElse(isAdmin(i), {
114110 let address = getAddressIfValid(_farming)
115111 [StringEntry(k_farming_address, address)]
116112 })
117113
118114
119115
120116 @Callable(i)
121117 func setManager (_manager) = valueOrElse(isAdmin(i), {
122118 let address = getAddressIfValid(_manager)
123119 [StringEntry(k_manager_address, address)]
124120 })
125121
126122
127123
128124 @Callable(i)
129125 func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), {
130126 let address = getAddressIfValid(_housekeeper)
131127 [StringEntry(k_housekeeper_address, address)]
132128 })
133129
134130
135131
136132 @Callable(i)
137133 func setPrizes (_prizes) = valueOrElse(isAdmin(i), {
138134 let address = getAddressIfValid(_prizes)
139135 [StringEntry(k_prizes_address, address)]
140136 })
141137
142138
143139
144140 @Callable(i)
145141 func setNftManager (_nftManager) = valueOrElse(isAdmin(i), {
146142 let address = getAddressIfValid(_nftManager)
147143 [StringEntry(k_nft_manager_address, address)]
148144 })
149145
150146
151147
152148 @Callable(i)
153-func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), {
154- let stakingAddress = getAddressIfValid(_stakingAddress)
155-[StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)]
149+func setSwap (_swap) = valueOrElse(isAdmin(i), {
150+ let address = getAddressIfValid(_swap)
151+[StringEntry(k_swap_address, address)]
156152 })
153+
154+
155+
156+@Callable(i)
157+func setQuoteAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_quote_asset, _assetId)])
158+
159+
160+
161+@Callable(i)
162+func setRewardAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_reward_asset, _assetId)])
157163
158164
159165
160166 @Callable(i)
161167 func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), {
162168 let stakingAddress = getAddressIfValid(_stakingAddress)
163169 [StringEntry(k_staking_address, _stakingAddress)]
164170 })
165171
166172
167173
168174 @Callable(i)
169-func setCollateralAddress (_collateralAddress) = valueOrElse(isAdmin(i), {
170- let collateralAddress = getAddressIfValid(_collateralAddress)
171-[StringEntry(k_collateral_address, _collateralAddress)]
175+func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
176+ let exchangeAddress = getAddressIfValid(_vaultAddress)
177+[StringEntry(k_vault_address, _vaultAddress)]
172178 })
173179
174180
175181
176182 @Callable(i)
177-func setExchangeAddress (_exchangeAddress) = valueOrElse(isAdmin(i), {
178- let exchangeAddress = getAddressIfValid(_exchangeAddress)
179-[StringEntry(k_exchange_address, _exchangeAddress)]
180- })
181-
182-
183-
184-@Callable(i)
185-func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
186- let exchangeAddress = getAddressIfValid(_vaultAddress)
187-[StringEntry(k_vault_address, _vaultAddress)]
183+func addChild (_childAddress) = valueOrElse(isAdmin(i), {
184+ let childAddress = getAddressIfValid(_childAddress)
185+[BooleanEntry(toCompositeKey(k_child, _childAddress), true)]
188186 })
189187
190188
191189
192190 @Callable(i)
193191 func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), {
194192 let ammAddress = getAddressIfValid(_ammAddress)
195193 [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)]
196194 })
197195
198196
199197
200198 @Callable(i)
201199 func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))])
202200
203201
204202
205203 @Callable(i)
206204 func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), {
207205 let assetBytes = fromBase58String(_assetId)
208206 match assetInfo(assetBytes) {
209207 case asset: Asset =>
210208 if ((asset.decimals != 8))
211209 then throw("Invalid asset decimals, should be 8")
212210 else [StringEntry(k_governance_asset, _assetId)]
213211 case _ =>
214212 throw("Can't find asset")
215213 }
216214 })
217215
218216
219217 @Verifier(tx)
220-func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey()))
218+func verify () = match getString(this, k_admin_address) {
219+ case verifier: String =>
220+ valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false)
221+ case _ =>
222+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
223+}
221224

github/deemru/w8io/169f3d6 
45.27 ms