tx · HWedUDuC3tTJDKKz4VaZQcbAQnNpxhMp9rL1WG3eiGLR 3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8: -0.03400000 Waves 2022.10.06 10:19 [2260148] smart account 3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8 > SELF 0.00000000 Waves
{ "type": 13, "id": "HWedUDuC3tTJDKKz4VaZQcbAQnNpxhMp9rL1WG3eiGLR", "fee": 3400000, "feeAssetId": null, "timestamp": 1665040782809, "version": 2, "chainId": 84, "sender": "3MzdomR4UkWKtVXq6YGouPJsYXDunjCvSJ8", "senderPublicKey": "HjRpGGPsru1jMvZDVG83rQfzQRHCWNnrpMaqTpHogxyn", "proofs": [ "3wf9KdXwZTpoYdUgPhAv7KLN1jwJzpj3y8MjYC9MXrkCgLJQLC6DqH6tRWBf3PHATTRKWowCScmxiBP1LgMYd2YG" ], "script": "base64:BgJACAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBUAE2tfaW5zdXJhbmNlX2FkZHJlc3MCE2tfaW5zdXJhbmNlX2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAPa19xdW90ZV9zdGFraW5nAg9rX3F1b3RlX3N0YWtpbmcAEWtfc3Rha2luZ19hZGRyZXNzAhFrX3N0YWtpbmdfYWRkcmVzcwARa19mYXJtaW5nX2FkZHJlc3MCEWtfZmFybWluZ19hZGRyZXNzAAVrX2FtbQIFa19hbW0ACmtfYW1tX2RhdGECCmtfYW1tX2RhdGEAEmtfZ292ZXJuYW5jZV9hc3NldAILa19nb3ZfYXNzZXQAD2tfbWluZXJfYWRkcmVzcwIPa19taW5lcl9hZGRyZXNzABBrX29yZGVyc19hZGRyZXNzAhBrX29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W5FbnRyeQIJAQ50b0NvbXBvc2l0ZUtleQIFBWtfYW1tBQtfYW1tQWRkcmVzcwYJAMwIAgkBC1N0cmluZ0VudHJ5AgkBDnRvQ29tcG9zaXRlS2V5AgUKa19hbW1fZGF0YQULX2FtbUFkZHJlc3MFBV9kYXRhBQNuaWwBaQEJcmVtb3ZlQW1tAQtfYW1tQWRkcmVzcwkBC3ZhbHVlT3JFbHNlAgkBB2lzQWRtaW4BBQFpCQDMCAIJAQtEZWxldGVFbnRyeQEJAQ50b0NvbXBvc2l0ZUtleQIFBWtfYW1tBQtfYW1tQWRkcmVzcwUDbmlsAWkBEnNldEdvdmVybmFuY2VBc3NldAEIX2Fzc2V0SWQJAQt2YWx1ZU9yRWxzZQIJAQdpc0FkbWluAQUBaQQKYXNzZXRCeXRlcwkA2QQBBQhfYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQphc3NldEJ5dGVzAwkAAQIFByRtYXRjaDACBUFzc2V0BAVhc3NldAUHJG1hdGNoMAMJAQIhPQIIBQVhc3NldAhkZWNpbWFscwAICQACAQIjSW52YWxpZCBhc3NldCBkZWNpbWFscywgc2hvdWxkIGJlIDgJAMwIAgkBC1N0cmluZ0VudHJ5AgUSa19nb3Zlcm5hbmNlX2Fzc2V0BQhfYXNzZXRJZAUDbmlsCQACAQIQQ2FuJ3QgZmluZCBhc3NldAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAJANkEAQkBDmFkbWluUHVibGljS2V5AGi3JUE=", "height": 2260148, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2yqCwgLXcMhHFWYByTydAEe1QGPEsjCbk5nfRNTT1dkj Next: 7BKd4VHsgVNBy2irbQzGudQoqtzU6xqLcAmS7hFHJKuK Diff:
Old | New | Differences | |
---|---|---|---|
26 | 26 | let k_orders_address = "k_orders_address" | |
27 | 27 | ||
28 | 28 | let k_referral_address = "k_referral_address" | |
29 | + | ||
30 | + | let k_manager_address = "k_manager_address" | |
29 | 31 | ||
30 | 32 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
31 | 33 | ||
104 | 106 | ||
105 | 107 | ||
106 | 108 | @Callable(i) | |
109 | + | func setManager (_manager) = valueOrElse(isAdmin(i), { | |
110 | + | let address = getAddressIfValid(_manager) | |
111 | + | [StringEntry(k_manager_address, address)] | |
112 | + | }) | |
113 | + | ||
114 | + | ||
115 | + | ||
116 | + | @Callable(i) | |
107 | 117 | func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), { | |
108 | 118 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
109 | 119 | [StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)] |
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_farming_address = "k_farming_address" | |
17 | 17 | ||
18 | 18 | let k_amm = "k_amm" | |
19 | 19 | ||
20 | 20 | let k_amm_data = "k_amm_data" | |
21 | 21 | ||
22 | 22 | let k_governance_asset = "k_gov_asset" | |
23 | 23 | ||
24 | 24 | let k_miner_address = "k_miner_address" | |
25 | 25 | ||
26 | 26 | let k_orders_address = "k_orders_address" | |
27 | 27 | ||
28 | 28 | let k_referral_address = "k_referral_address" | |
29 | + | ||
30 | + | let k_manager_address = "k_manager_address" | |
29 | 31 | ||
30 | 32 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
31 | 33 | ||
32 | 34 | ||
33 | 35 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
34 | 36 | ||
35 | 37 | ||
36 | 38 | func adminPublicKey () = getStringValue(this, k_admin_public_key) | |
37 | 39 | ||
38 | 40 | ||
39 | 41 | func isNoAdmin () = (getString(this, k_admin_address) == unit) | |
40 | 42 | ||
41 | 43 | ||
42 | 44 | func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined")) | |
43 | 45 | ||
44 | 46 | ||
45 | 47 | func isNoAdminOrAdmin (i) = if (if (isNoAdmin()) | |
46 | 48 | then true | |
47 | 49 | else (i.caller == admin())) | |
48 | 50 | then unit | |
49 | 51 | else throw("Only the Admin itself can invoke this function") | |
50 | 52 | ||
51 | 53 | ||
52 | 54 | func isAdmin (i) = if ((i.caller == admin())) | |
53 | 55 | then unit | |
54 | 56 | else throw("Only the Admin itself can invoke this function") | |
55 | 57 | ||
56 | 58 | ||
57 | 59 | @Callable(i) | |
58 | 60 | func setAdmin (_adminPublicKey) = valueOrElse(isNoAdminOrAdmin(i), { | |
59 | 61 | let bytes = fromBase58String(_adminPublicKey) | |
60 | 62 | let address = addressFromPublicKey(bytes) | |
61 | 63 | [StringEntry(k_admin_address, toString(address)), StringEntry(k_admin_public_key, _adminPublicKey)] | |
62 | 64 | }) | |
63 | 65 | ||
64 | 66 | ||
65 | 67 | ||
66 | 68 | @Callable(i) | |
67 | 69 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
68 | 70 | let address = getAddressIfValid(_insuranceFund) | |
69 | 71 | [StringEntry(k_insurance_address, address)] | |
70 | 72 | }) | |
71 | 73 | ||
72 | 74 | ||
73 | 75 | ||
74 | 76 | @Callable(i) | |
75 | 77 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
76 | 78 | let address = getAddressIfValid(_liquidityMiner) | |
77 | 79 | [StringEntry(k_miner_address, address)] | |
78 | 80 | }) | |
79 | 81 | ||
80 | 82 | ||
81 | 83 | ||
82 | 84 | @Callable(i) | |
83 | 85 | func setOrders (_orders) = valueOrElse(isAdmin(i), { | |
84 | 86 | let address = getAddressIfValid(_orders) | |
85 | 87 | [StringEntry(k_orders_address, address)] | |
86 | 88 | }) | |
87 | 89 | ||
88 | 90 | ||
89 | 91 | ||
90 | 92 | @Callable(i) | |
91 | 93 | func setReferral (_referral) = valueOrElse(isAdmin(i), { | |
92 | 94 | let address = getAddressIfValid(_referral) | |
93 | 95 | [StringEntry(k_referral_address, address)] | |
94 | 96 | }) | |
95 | 97 | ||
96 | 98 | ||
97 | 99 | ||
98 | 100 | @Callable(i) | |
99 | 101 | func setFarming (_farming) = valueOrElse(isAdmin(i), { | |
100 | 102 | let address = getAddressIfValid(_farming) | |
101 | 103 | [StringEntry(k_farming_address, address)] | |
102 | 104 | }) | |
103 | 105 | ||
104 | 106 | ||
105 | 107 | ||
106 | 108 | @Callable(i) | |
109 | + | func setManager (_manager) = valueOrElse(isAdmin(i), { | |
110 | + | let address = getAddressIfValid(_manager) | |
111 | + | [StringEntry(k_manager_address, address)] | |
112 | + | }) | |
113 | + | ||
114 | + | ||
115 | + | ||
116 | + | @Callable(i) | |
107 | 117 | func setQuoteAsset (_assetId,_stakingAddress) = valueOrElse(isAdmin(i), { | |
108 | 118 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
109 | 119 | [StringEntry(k_quote_asset, _assetId), StringEntry(k_quote_staking, _stakingAddress)] | |
110 | 120 | }) | |
111 | 121 | ||
112 | 122 | ||
113 | 123 | ||
114 | 124 | @Callable(i) | |
115 | 125 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
116 | 126 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
117 | 127 | [StringEntry(k_staking_address, _stakingAddress)] | |
118 | 128 | }) | |
119 | 129 | ||
120 | 130 | ||
121 | 131 | ||
122 | 132 | @Callable(i) | |
123 | 133 | func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), { | |
124 | 134 | let ammAddress = getAddressIfValid(_ammAddress) | |
125 | 135 | [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)] | |
126 | 136 | }) | |
127 | 137 | ||
128 | 138 | ||
129 | 139 | ||
130 | 140 | @Callable(i) | |
131 | 141 | func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))]) | |
132 | 142 | ||
133 | 143 | ||
134 | 144 | ||
135 | 145 | @Callable(i) | |
136 | 146 | func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), { | |
137 | 147 | let assetBytes = fromBase58String(_assetId) | |
138 | 148 | match assetInfo(assetBytes) { | |
139 | 149 | case asset: Asset => | |
140 | 150 | if ((asset.decimals != 8)) | |
141 | 151 | then throw("Invalid asset decimals, should be 8") | |
142 | 152 | else [StringEntry(k_governance_asset, _assetId)] | |
143 | 153 | case _ => | |
144 | 154 | throw("Can't find asset") | |
145 | 155 | } | |
146 | 156 | }) | |
147 | 157 | ||
148 | 158 | ||
149 | 159 | @Verifier(tx) | |
150 | 160 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(adminPublicKey())) | |
151 | 161 |
github/deemru/w8io/169f3d6 38.47 ms ◑