tx · E14XpEgHZ8rQ9vwEhiqp7TCTUF8zwYHcZ2TVsQwdVqSb

3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8:  -0.03400000 Waves

2022.09.02 16:55 [2211593] smart account 3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8 > SELF 0.00000000 Waves

{ "type": 13, "id": "E14XpEgHZ8rQ9vwEhiqp7TCTUF8zwYHcZ2TVsQwdVqSb", "fee": 3400000, "feeAssetId": null, "timestamp": 1662126924300, "version": 2, "chainId": 84, "sender": "3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8", "senderPublicKey": "HjRpGGPsru1jMvZDVG83rQfzQRHCWNnrpMaqTpHogxyn", "proofs": [ "5hwcudc2i2H9fGnFortMMR1GnvzvhMAxsw7x8wBZxxNazrm5drvsGb52mqB2afNeHY1jqoNCPaK9tWK1FUdbLDj3" ], "script": "base64:BgIxCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBIAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAPa19xdW90ZV9zdGFraW5nAg9rX3F1b3RlX3N0YWtpbmcAEWtfc3Rha2luZ19hZGRyZXNzAhFrX3N0YWtpbmdfYWRkcmVzcwAFa19hbW0CBWtfYW1tAAprX2FtbV9kYXRhAgprX2FtbV9kYXRhABJrX2dvdmVybmFuY2VfYXNzZXQCC2tfZ292X2Fzc2V0AA9rX21pbmVyX2FkZHJlc3MCD2tfbWluZXJfYWRkcmVzcwAQa19vcmRlcnNfYWRkcmVzcwIQa19vcmRlcnNfYWRkcmVzcwEOdG9Db21wb3NpdGVLZXkCBF9rZXkIX2FkZHJlc3MJAK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kAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBDmFkbWluUHVibGljS2V5AKS9cJc=", "height": 2211593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CpDsHpT6TGNofqk5mfFCLfBXPS3EHugUkb4X3UwXz7Vc Next: HQfEp4eLmJpc6KvDNaB6wfTBwg4q3FHvQt15u6zBr8fz 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_admin_address = "k_admin_address"
77
88 let k_admin_public_key = "k_admin_public_key"
99
1010 let k_quote_asset = "k_quote_asset"
1111
1212 let k_quote_staking = "k_quote_staking"
1313
1414 let k_staking_address = "k_staking_address"
1515
1616 let k_amm = "k_amm"
1717
1818 let k_amm_data = "k_amm_data"
1919
2020 let k_governance_asset = "k_gov_asset"
2121
2222 let k_miner_address = "k_miner_address"
2323
2424 let k_orders_address = "k_orders_address"
2525
2626 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
2727
2828
2929 func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address")))
3030
3131
3232 func adminPublicKey () = getStringValue(this, k_admin_public_key)
3333
3434
3535 func isNoAdmin () = (getString(this, k_admin_address) == unit)
3636
3737
3838 func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined"))
3939
4040
4141 func isNoAdminOrAdmin (i) = if (if (isNoAdmin())
4242 then true
4343 else (i.caller == admin()))
4444 then unit
4545 else throw("Only the Admin itself can invoke this function")
4646
4747
4848 func isAdmin (i) = if ((i.caller == admin()))
4949 then unit
5050 else throw("Only the Admin itself can invoke this function")
5151
5252
5353 @Callable(i)
5454 func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), {
5555 let bytes = fromBase58String(_adminPublicKey)
5656 let address = addressFromPublicKey(bytes)
5757 [StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)]
5858 })
5959
6060
6161
6262 @Callable(i)
6363 func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), {
6464 let address = getAddressIfValid(_insuranceFund)
6565 [StringEntry(k_insurance_address, address)]
6666 })
6767
6868
6969
7070 @Callable(i)
7171 func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), {
7272 let address = getAddressIfValid(_liquidityMiner)
7373 [StringEntry(k_miner_address, address)]
7474 })
7575
7676
7777
7878 @Callable(i)
7979 func setOrders (_orders) = valueOrElse(isAdmin(i), {
8080 let address = getAddressIfValid(_orders)
8181 [StringEntry(k_orders_address, address)]
8282 })
8383
8484
8585
8686 @Callable(i)
8787 func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), {
8888 let stakingAddress = getAddressIfValid(_stakingAddress)
8989 [StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)]
9090 })
9191
9292
9393
9494 @Callable(i)
9595 func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), {
9696 let stakingAddress = getAddressIfValid(_stakingAddress)
9797 [StringEntry(k_staking_address, _stakingAddress)]
9898 })
9999
100100
101101
102102 @Callable(i)
103103 func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), {
104104 let ammAddress = getAddressIfValid(_ammAddress)
105105 [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)]
106106 })
107107
108108
109109
110110 @Callable(i)
111111 func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))])
112112
113113
114114
115115 @Callable(i)
116116 func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), {
117117 let assetBytes = fromBase58String(_assetId)
118118 match assetInfo(assetBytes) {
119119 case asset: Asset =>
120120 if ((asset.decimals != 8))
121121 then throw("Invalid asset decimals, should be 8")
122122 else [StringEntry(k_governance_asset, _assetId)]
123123 case _ =>
124124 throw("Can't find asset")
125125 }
126126 })
127127
128128
129129 @Verifier(tx)
130130 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey()))
131131

github/deemru/w8io/026f985 
36.03 ms