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