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:BgIxCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBIAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAPa19xdW90ZV9zdGFraW5nAg9rX3F1b3RlX3N0YWtpbmcAEWtfc3Rha2luZ19hZGRyZXNzAhFrX3N0YWtpbmdfYWRkcmVzcwAFa19hbW0CBWtfYW1tAAprX2FtbV9kYXRhAgprX2FtbV9kYXRhABJrX2dvdmVybmFuY2VfYXNzZXQCC2tfZ292X2Fzc2V0AA9rX21pbmVyX2FkZHJlc3MCD2tfbWluZXJfYWRkcmVzcwAQa19vcmRlcnNfYWRkcmVzcwIQa19vcmRlcnNfYWRkcmVzcwEOdG9Db21wb3NpdGVLZXkCBF9rZXkIX2FkZHJlc3MJAKw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AkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBDmFkbWluUHVibGljS2V5AKS9cJc=", "height": 2211593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CpDsHpT6TGNofqk5mfFCLfBXPS3EHugUkb4X3UwXz7Vc Next: HQfEp4eLmJpc6KvDNaB6wfTBwg4q3FHvQt15u6zBr8fz Full:
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_admin_address = "k_admin_address" | |
7 | 7 | ||
8 | 8 | let k_admin_public_key = "k_admin_public_key" | |
9 | 9 | ||
10 | 10 | let k_quote_asset = "k_quote_asset" | |
11 | 11 | ||
12 | 12 | let k_quote_staking = "k_quote_staking" | |
13 | 13 | ||
14 | 14 | let k_staking_address = "k_staking_address" | |
15 | 15 | ||
16 | 16 | let k_amm = "k_amm" | |
17 | 17 | ||
18 | 18 | let k_amm_data = "k_amm_data" | |
19 | 19 | ||
20 | 20 | let k_governance_asset = "k_gov_asset" | |
21 | 21 | ||
22 | 22 | let k_miner_address = "k_miner_address" | |
23 | 23 | ||
24 | 24 | let k_orders_address = "k_orders_address" | |
25 | 25 | ||
26 | 26 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func adminPublicKey () = getStringValue(this, k_admin_public_key) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func isNoAdmin () = (getString(this, k_admin_address) == unit) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined")) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func isNoAdminOrAdmin (i) = if (if (isNoAdmin()) | |
42 | 42 | then true | |
43 | 43 | else (i.caller == admin())) | |
44 | 44 | then unit | |
45 | 45 | else throw("Only the Admin itself can invoke this function") | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func isAdmin (i) = if ((i.caller == admin())) | |
49 | 49 | then unit | |
50 | 50 | else throw("Only the Admin itself can invoke this function") | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), { | |
55 | 55 | let bytes = fromBase58String(_adminPublicKey) | |
56 | 56 | let address = addressFromPublicKey(bytes) | |
57 | 57 | [StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)] | |
58 | 58 | }) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(i) | |
63 | 63 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
64 | 64 | let address = getAddressIfValid(_insuranceFund) | |
65 | 65 | [StringEntry(k_insurance_address, address)] | |
66 | 66 | }) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(i) | |
71 | 71 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
72 | 72 | let address = getAddressIfValid(_liquidityMiner) | |
73 | 73 | [StringEntry(k_miner_address, address)] | |
74 | 74 | }) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(i) | |
79 | 79 | func setOrders (_orders) = valueOrElse(isAdmin(i), { | |
80 | 80 | let address = getAddressIfValid(_orders) | |
81 | 81 | [StringEntry(k_orders_address, address)] | |
82 | 82 | }) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | @Callable(i) | |
87 | 87 | func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), { | |
88 | 88 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
89 | 89 | [StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)] | |
90 | 90 | }) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | ||
94 | 94 | @Callable(i) | |
95 | 95 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
96 | 96 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
97 | 97 | [StringEntry(k_staking_address, _stakingAddress)] | |
98 | 98 | }) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Callable(i) | |
103 | 103 | func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), { | |
104 | 104 | let ammAddress = getAddressIfValid(_ammAddress) | |
105 | 105 | [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)] | |
106 | 106 | }) | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(i) | |
111 | 111 | func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))]) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | 116 | func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), { | |
117 | 117 | let assetBytes = fromBase58String(_assetId) | |
118 | 118 | match assetInfo(assetBytes) { | |
119 | 119 | case asset: Asset => | |
120 | 120 | if ((asset.decimals != 8)) | |
121 | 121 | then throw("Invalid asset decimals, should be 8") | |
122 | 122 | else [StringEntry(k_governance_asset, _assetId)] | |
123 | 123 | case _ => | |
124 | 124 | throw("Can't find asset") | |
125 | 125 | } | |
126 | 126 | }) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | @Verifier(tx) | |
130 | 130 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey())) | |
131 | 131 |
github/deemru/w8io/026f985 36.03 ms ◑