tx · AoDZsjaRaGh2uFUBtES1Jj12vgpS9SqokRcXPhw898hN

3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p:  -0.03400000 Waves

2023.03.06 22:39 [2478657] smart account 3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p > SELF 0.00000000 Waves

{ "type": 13, "id": "AoDZsjaRaGh2uFUBtES1Jj12vgpS9SqokRcXPhw898hN", "fee": 3400000, "feeAssetId": null, "timestamp": 1678131559835, "version": 2, "chainId": 84, "sender": "3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p", "senderPublicKey": "H5ZH4BkyVtNBc32qbTGZxG4iQPcMF7Sfy65QkYQGzNMQ", "proofs": [ "5M1VxhbGpYDCKLxzfm7WjEvxGG3wBetgjnWP789ULgMHjQAdAudtgXRuBot1CtxiPFvLDeUXwd4dPMyiny4MaE52" ], "script": "base64:BgJiCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgMKAQgZABNrX2luc3VyYW5jZV9hZGRyZXNzAhNrX2luc3VyYW5jZV9hZGRyZXNzAA9rX3ZhdWx0X2FkZHJlc3MCD2tfdmF1bHRfYWRkcmVzcwAPa19hZG1pbl9hZGRyZXNzAg9rX2FkbWluX2FkZHJlc3MADWtfcXVvdGVfYXNzZXQCDWtfcXVvdGVfYXNzZXQADmtfcmV3YXJkX2Fzc2V0Ag5rX3Jld2FyZF9hc3NldAAOa19zd2FwX2FkZHJlc3MCDmtfc3dhcF9hZGRyZXNzABFrX3N0YWtpbmdfYWRkcmVzcwIRa19zdGFraW5nX2FkZHJlc3MAEWtfZmFybWluZ19hZGRyZXNzAhFrX2Zhcm1pbmdfYWRkcmVzcwAQa19wcml6ZXNfYWRkcmVzcwIQa19wcml6ZXNfYWRkcmVzcwAVa19ob3VzZWtlZXBlcl9hZGRyZXNzAhVrX2h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ndCBmaW5kIGFzc2V0AQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAkAnQgCBQR0aGlzBQ9rX2FkbWluX2FkZHJlc3MDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAh2ZXJpZmllcgUHJG1hdGNoMAkBC3ZhbHVlT3JFbHNlAgkAmwgCCQERQGV4dHJOYXRpdmUoMTA2MikBBQh2ZXJpZmllcgkArAICCQCsAgIJAKwCAgIHc3RhdHVzXwkApQgBBQR0aGlzAgFfCQDYBAEIBQJ0eAJpZAcJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXmJcs8p", "height": 2478657, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: C9YvzQBgCuVq6XzToahZt99da1FRTSjgNLuKHdDgk8D7 Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let k_insurance_address = "k_insurance_address"
5+
6+let k_vault_address = "k_vault_address"
7+
8+let k_admin_address = "k_admin_address"
9+
10+let k_quote_asset = "k_quote_asset"
11+
12+let k_reward_asset = "k_reward_asset"
13+
14+let k_swap_address = "k_swap_address"
15+
16+let k_staking_address = "k_staking_address"
17+
18+let k_farming_address = "k_farming_address"
19+
20+let k_prizes_address = "k_prizes_address"
21+
22+let k_housekeeper_address = "k_housekeeper_address"
23+
24+let k_amm = "k_amm"
25+
26+let k_amm_data = "k_amm_data"
27+
28+let k_governance_asset = "k_gov_asset"
29+
30+let k_miner_address = "k_miner_address"
31+
32+let k_orders_address = "k_orders_address"
33+
34+let k_referral_address = "k_referral_address"
35+
36+let k_manager_address = "k_manager_address"
37+
38+let k_nft_manager_address = "k_nft_manager_address"
39+
40+let k_child = "k_child"
41+
42+func toCompositeKey (_key,_address) = ((_key + "_") + _address)
43+
44+
45+func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
46+
47+
48+func isNoAdmin () = (getString(this, k_admin_address) == unit)
49+
50+
51+func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined"))
52+
53+
54+func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin())
55+ then (i.caller == this)
56+ else false)
57+ then true
58+ else (i.caller == admin()))
59+ then unit
60+ else throw("Only the Admin itself can invoke this function")
61+
62+
63+func isAdmin (i) = if ((i.caller == admin()))
64+ then unit
65+ else throw("Only the Admin itself can invoke this function")
66+
67+
68+@Callable(i)
69+func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), {
70+ let address = addressFromStringValue(_adminAddress)
71+[StringEntry(k_admin_address, toString(address))]
72+ })
73+
74+
75+
76+@Callable(i)
77+func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), {
78+ let address = getAddressIfValid(_insuranceFund)
79+[StringEntry(k_insurance_address, address)]
80+ })
81+
82+
83+
84+@Callable(i)
85+func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), {
86+ let address = getAddressIfValid(_liquidityMiner)
87+[StringEntry(k_miner_address, address)]
88+ })
89+
90+
91+
92+@Callable(i)
93+func setOrders (_orders) = valueOrElse(isAdmin(i), {
94+ let address = getAddressIfValid(_orders)
95+[StringEntry(k_orders_address, address)]
96+ })
97+
98+
99+
100+@Callable(i)
101+func setReferral (_referral) = valueOrElse(isAdmin(i), {
102+ let address = getAddressIfValid(_referral)
103+[StringEntry(k_referral_address, address)]
104+ })
105+
106+
107+
108+@Callable(i)
109+func setFarming (_farming) = valueOrElse(isAdmin(i), {
110+ let address = getAddressIfValid(_farming)
111+[StringEntry(k_farming_address, address)]
112+ })
113+
114+
115+
116+@Callable(i)
117+func setManager (_manager) = valueOrElse(isAdmin(i), {
118+ let address = getAddressIfValid(_manager)
119+[StringEntry(k_manager_address, address)]
120+ })
121+
122+
123+
124+@Callable(i)
125+func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), {
126+ let address = getAddressIfValid(_housekeeper)
127+[StringEntry(k_housekeeper_address, address)]
128+ })
129+
130+
131+
132+@Callable(i)
133+func setPrizes (_prizes) = valueOrElse(isAdmin(i), {
134+ let address = getAddressIfValid(_prizes)
135+[StringEntry(k_prizes_address, address)]
136+ })
137+
138+
139+
140+@Callable(i)
141+func setNftManager (_nftManager) = valueOrElse(isAdmin(i), {
142+ let address = getAddressIfValid(_nftManager)
143+[StringEntry(k_nft_manager_address, address)]
144+ })
145+
146+
147+
148+@Callable(i)
149+func setSwap (_swap) = valueOrElse(isAdmin(i), {
150+ let address = getAddressIfValid(_swap)
151+[StringEntry(k_swap_address, address)]
152+ })
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)])
163+
164+
165+
166+@Callable(i)
167+func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), {
168+ let stakingAddress = getAddressIfValid(_stakingAddress)
169+[StringEntry(k_staking_address, _stakingAddress)]
170+ })
171+
172+
173+
174+@Callable(i)
175+func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), {
176+ let exchangeAddress = getAddressIfValid(_vaultAddress)
177+[StringEntry(k_vault_address, _vaultAddress)]
178+ })
179+
180+
181+
182+@Callable(i)
183+func addChild (_childAddress) = valueOrElse(isAdmin(i), {
184+ let childAddress = getAddressIfValid(_childAddress)
185+[BooleanEntry(toCompositeKey(k_child, _childAddress), true)]
186+ })
187+
188+
189+
190+@Callable(i)
191+func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), {
192+ let ammAddress = getAddressIfValid(_ammAddress)
193+[BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)]
194+ })
195+
196+
197+
198+@Callable(i)
199+func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))])
200+
201+
202+
203+@Callable(i)
204+func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), {
205+ let assetBytes = fromBase58String(_assetId)
206+ match assetInfo(assetBytes) {
207+ case asset: Asset =>
208+ if ((asset.decimals != 8))
209+ then throw("Invalid asset decimals, should be 8")
210+ else [StringEntry(k_governance_asset, _assetId)]
211+ case _ =>
212+ throw("Can't find asset")
213+ }
214+ })
215+
216+
217+@Verifier(tx)
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+}
224+

github/deemru/w8io/169f3d6 
18.12 ms