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