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