tx · C9YvzQBgCuVq6XzToahZt99da1FRTSjgNLuKHdDgk8D7 3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p: -0.03400000 Waves 2023.05.15 13:00 [2578924] smart account 3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p > SELF 0.00000000 Waves
{ "type": 13, "id": "C9YvzQBgCuVq6XzToahZt99da1FRTSjgNLuKHdDgk8D7", "fee": 3400000, "feeAssetId": null, "timestamp": 1684144846133, "version": 2, "chainId": 84, "sender": "3MwtgysqzRmXErf8jREcrZME8KV8Ryihe6p", "senderPublicKey": "H5ZH4BkyVtNBc32qbTGZxG4iQPcMF7Sfy65QkYQGzNMQ", "proofs": [ "2erAQ2YUvnDHWozqmQqR1ZQ2es3Jn25AwchGjLzPw17q2kyu7CMANXAs4QKzAE6oMWBba9Xu5hjN3utnAXZDxnq3" ], "script": "base64:BgJsCAISAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIDCgEIGwATa19pbnN1cmFuY2VfYWRkcmVzcwITa19pbnN1cmFuY2VfYWRkcmVzcwAPa192YXVsdF9hZGRyZXNzAg9rX3ZhdWx0X2FkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAA1rX3F1b3RlX2Fzc2V0Ag1rX3F1b3RlX2Fzc2V0AA5rX3Jld2FyZF9hc3NldAIOa19yZXdhcmRfYXNzZXQADmtfc3dhcF9hZGRyZXNzAg5rX3N3YXBfYWRkcmVzcwARa19zdGFraW5nX2FkZHJlc3MCEWtfc3Rha2luZ19hZGRyZXNzABFrX2Zhcm1pbmdfYWRkcmVzcwIRa19mYXJtaW5nX2FkZHJlc3MAEGtfcHJpemVzX2FkZHJlc3MCEGtfcHJpemVzX2FkZHJlc3MAFWtfaG91c2VrZWVwZXJf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CQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQprEc4=", "height": 2578924, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AoDZsjaRaGh2uFUBtES1Jj12vgpS9SqokRcXPhw898hN Next: aDE9WbBU4Uacst5HTkxDpzt1SYyxMKn57fUiFAcUYde Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | ||
40 | 40 | let k_child = "k_child" | |
41 | 41 | ||
42 | + | let k_oracle = "k_oracle" | |
43 | + | ||
44 | + | let k_spot_address = "k_spot_address" | |
45 | + | ||
42 | 46 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
43 | 47 | ||
44 | 48 | ||
68 | 72 | @Callable(i) | |
69 | 73 | func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), { | |
70 | 74 | let address = addressFromStringValue(_adminAddress) | |
71 | - | [StringEntry(k_admin_address, toString(address))] | |
75 | + | if ((address == address)) | |
76 | + | then [StringEntry(k_admin_address, toString(address))] | |
77 | + | else throw("Strict value is not equal to itself.") | |
72 | 78 | }) | |
73 | 79 | ||
74 | 80 | ||
76 | 82 | @Callable(i) | |
77 | 83 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
78 | 84 | let address = getAddressIfValid(_insuranceFund) | |
79 | - | [StringEntry(k_insurance_address, address)] | |
85 | + | if ((address == address)) | |
86 | + | then [StringEntry(k_insurance_address, address)] | |
87 | + | else throw("Strict value is not equal to itself.") | |
80 | 88 | }) | |
81 | 89 | ||
82 | 90 | ||
84 | 92 | @Callable(i) | |
85 | 93 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
86 | 94 | let address = getAddressIfValid(_liquidityMiner) | |
87 | - | [StringEntry(k_miner_address, address)] | |
95 | + | if ((address == address)) | |
96 | + | then [StringEntry(k_miner_address, address)] | |
97 | + | else throw("Strict value is not equal to itself.") | |
88 | 98 | }) | |
89 | 99 | ||
90 | 100 | ||
92 | 102 | @Callable(i) | |
93 | 103 | func setOrders (_orders) = valueOrElse(isAdmin(i), { | |
94 | 104 | let address = getAddressIfValid(_orders) | |
95 | - | [StringEntry(k_orders_address, address)] | |
105 | + | if ((address == address)) | |
106 | + | then [StringEntry(k_orders_address, address)] | |
107 | + | else throw("Strict value is not equal to itself.") | |
96 | 108 | }) | |
97 | 109 | ||
98 | 110 | ||
100 | 112 | @Callable(i) | |
101 | 113 | func setReferral (_referral) = valueOrElse(isAdmin(i), { | |
102 | 114 | let address = getAddressIfValid(_referral) | |
103 | - | [StringEntry(k_referral_address, address)] | |
115 | + | if ((address == address)) | |
116 | + | then [StringEntry(k_referral_address, address)] | |
117 | + | else throw("Strict value is not equal to itself.") | |
104 | 118 | }) | |
105 | 119 | ||
106 | 120 | ||
108 | 122 | @Callable(i) | |
109 | 123 | func setFarming (_farming) = valueOrElse(isAdmin(i), { | |
110 | 124 | let address = getAddressIfValid(_farming) | |
111 | - | [StringEntry(k_farming_address, address)] | |
125 | + | if ((address == address)) | |
126 | + | then [StringEntry(k_farming_address, address)] | |
127 | + | else throw("Strict value is not equal to itself.") | |
112 | 128 | }) | |
113 | 129 | ||
114 | 130 | ||
116 | 132 | @Callable(i) | |
117 | 133 | func setManager (_manager) = valueOrElse(isAdmin(i), { | |
118 | 134 | let address = getAddressIfValid(_manager) | |
119 | - | [StringEntry(k_manager_address, address)] | |
135 | + | if ((address == address)) | |
136 | + | then [StringEntry(k_manager_address, address)] | |
137 | + | else throw("Strict value is not equal to itself.") | |
120 | 138 | }) | |
121 | 139 | ||
122 | 140 | ||
124 | 142 | @Callable(i) | |
125 | 143 | func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), { | |
126 | 144 | let address = getAddressIfValid(_housekeeper) | |
127 | - | [StringEntry(k_housekeeper_address, address)] | |
145 | + | if ((address == address)) | |
146 | + | then [StringEntry(k_housekeeper_address, address)] | |
147 | + | else throw("Strict value is not equal to itself.") | |
128 | 148 | }) | |
129 | 149 | ||
130 | 150 | ||
132 | 152 | @Callable(i) | |
133 | 153 | func setPrizes (_prizes) = valueOrElse(isAdmin(i), { | |
134 | 154 | let address = getAddressIfValid(_prizes) | |
135 | - | [StringEntry(k_prizes_address, address)] | |
155 | + | if ((address == address)) | |
156 | + | then [StringEntry(k_prizes_address, address)] | |
157 | + | else throw("Strict value is not equal to itself.") | |
136 | 158 | }) | |
137 | 159 | ||
138 | 160 | ||
140 | 162 | @Callable(i) | |
141 | 163 | func setNftManager (_nftManager) = valueOrElse(isAdmin(i), { | |
142 | 164 | let address = getAddressIfValid(_nftManager) | |
143 | - | [StringEntry(k_nft_manager_address, address)] | |
165 | + | if ((address == address)) | |
166 | + | then [StringEntry(k_nft_manager_address, address)] | |
167 | + | else throw("Strict value is not equal to itself.") | |
144 | 168 | }) | |
145 | 169 | ||
146 | 170 | ||
148 | 172 | @Callable(i) | |
149 | 173 | func setSwap (_swap) = valueOrElse(isAdmin(i), { | |
150 | 174 | let address = getAddressIfValid(_swap) | |
151 | - | [StringEntry(k_swap_address, address)] | |
175 | + | if ((address == address)) | |
176 | + | then [StringEntry(k_swap_address, address)] | |
177 | + | else throw("Strict value is not equal to itself.") | |
152 | 178 | }) | |
153 | 179 | ||
154 | 180 | ||
166 | 192 | @Callable(i) | |
167 | 193 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
168 | 194 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
169 | - | [StringEntry(k_staking_address, _stakingAddress)] | |
195 | + | if ((stakingAddress == stakingAddress)) | |
196 | + | then [StringEntry(k_staking_address, _stakingAddress)] | |
197 | + | else throw("Strict value is not equal to itself.") | |
198 | + | }) | |
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | @Callable(i) | |
203 | + | func setSpotAddress (_spotAddress) = valueOrElse(isAdmin(i), { | |
204 | + | let stakingAddress = getAddressIfValid(_spotAddress) | |
205 | + | if ((stakingAddress == stakingAddress)) | |
206 | + | then [StringEntry(k_spot_address, _spotAddress)] | |
207 | + | else throw("Strict value is not equal to itself.") | |
170 | 208 | }) | |
171 | 209 | ||
172 | 210 | ||
174 | 212 | @Callable(i) | |
175 | 213 | func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), { | |
176 | 214 | let exchangeAddress = getAddressIfValid(_vaultAddress) | |
177 | - | [StringEntry(k_vault_address, _vaultAddress)] | |
215 | + | if ((exchangeAddress == exchangeAddress)) | |
216 | + | then [StringEntry(k_vault_address, _vaultAddress)] | |
217 | + | else throw("Strict value is not equal to itself.") | |
218 | + | }) | |
219 | + | ||
220 | + | ||
221 | + | ||
222 | + | @Callable(i) | |
223 | + | func setOracleAddress (_oracleAddress) = valueOrElse(isAdmin(i), { | |
224 | + | let oracleAddress = getAddressIfValid(_oracleAddress) | |
225 | + | if ((oracleAddress == oracleAddress)) | |
226 | + | then [StringEntry(k_orders_address, _oracleAddress)] | |
227 | + | else throw("Strict value is not equal to itself.") | |
178 | 228 | }) | |
179 | 229 | ||
180 | 230 |
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_vault_address = "k_vault_address" | |
7 | 7 | ||
8 | 8 | let k_admin_address = "k_admin_address" | |
9 | 9 | ||
10 | 10 | let k_quote_asset = "k_quote_asset" | |
11 | 11 | ||
12 | 12 | let k_reward_asset = "k_reward_asset" | |
13 | 13 | ||
14 | 14 | let k_swap_address = "k_swap_address" | |
15 | 15 | ||
16 | 16 | let k_staking_address = "k_staking_address" | |
17 | 17 | ||
18 | 18 | let k_farming_address = "k_farming_address" | |
19 | 19 | ||
20 | 20 | let k_prizes_address = "k_prizes_address" | |
21 | 21 | ||
22 | 22 | let k_housekeeper_address = "k_housekeeper_address" | |
23 | 23 | ||
24 | 24 | let k_amm = "k_amm" | |
25 | 25 | ||
26 | 26 | let k_amm_data = "k_amm_data" | |
27 | 27 | ||
28 | 28 | let k_governance_asset = "k_gov_asset" | |
29 | 29 | ||
30 | 30 | let k_miner_address = "k_miner_address" | |
31 | 31 | ||
32 | 32 | let k_orders_address = "k_orders_address" | |
33 | 33 | ||
34 | 34 | let k_referral_address = "k_referral_address" | |
35 | 35 | ||
36 | 36 | let k_manager_address = "k_manager_address" | |
37 | 37 | ||
38 | 38 | let k_nft_manager_address = "k_nft_manager_address" | |
39 | 39 | ||
40 | 40 | let k_child = "k_child" | |
41 | 41 | ||
42 | + | let k_oracle = "k_oracle" | |
43 | + | ||
44 | + | let k_spot_address = "k_spot_address" | |
45 | + | ||
42 | 46 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
43 | 47 | ||
44 | 48 | ||
45 | 49 | func getAddressIfValid (address) = toString(valueOrErrorMessage(addressFromString(address), (("Can't parse \"" + address) + "\" as address"))) | |
46 | 50 | ||
47 | 51 | ||
48 | 52 | func isNoAdmin () = (getString(this, k_admin_address) == unit) | |
49 | 53 | ||
50 | 54 | ||
51 | 55 | func admin () = addressFromStringValue(valueOrErrorMessage(getString(this, k_admin_address), "Admin not defined")) | |
52 | 56 | ||
53 | 57 | ||
54 | 58 | func isNoAdminOrAdmin (i) = if (if (if (isNoAdmin()) | |
55 | 59 | then (i.caller == this) | |
56 | 60 | else false) | |
57 | 61 | then true | |
58 | 62 | else (i.caller == admin())) | |
59 | 63 | then unit | |
60 | 64 | else throw("Only the Admin itself can invoke this function") | |
61 | 65 | ||
62 | 66 | ||
63 | 67 | func isAdmin (i) = if ((i.caller == admin())) | |
64 | 68 | then unit | |
65 | 69 | else throw("Only the Admin itself can invoke this function") | |
66 | 70 | ||
67 | 71 | ||
68 | 72 | @Callable(i) | |
69 | 73 | func setAdmin (_adminAddress) = valueOrElse(isNoAdminOrAdmin(i), { | |
70 | 74 | let address = addressFromStringValue(_adminAddress) | |
71 | - | [StringEntry(k_admin_address, toString(address))] | |
75 | + | if ((address == address)) | |
76 | + | then [StringEntry(k_admin_address, toString(address))] | |
77 | + | else throw("Strict value is not equal to itself.") | |
72 | 78 | }) | |
73 | 79 | ||
74 | 80 | ||
75 | 81 | ||
76 | 82 | @Callable(i) | |
77 | 83 | func setInsuranceFund (_insuranceFund) = valueOrElse(isAdmin(i), { | |
78 | 84 | let address = getAddressIfValid(_insuranceFund) | |
79 | - | [StringEntry(k_insurance_address, address)] | |
85 | + | if ((address == address)) | |
86 | + | then [StringEntry(k_insurance_address, address)] | |
87 | + | else throw("Strict value is not equal to itself.") | |
80 | 88 | }) | |
81 | 89 | ||
82 | 90 | ||
83 | 91 | ||
84 | 92 | @Callable(i) | |
85 | 93 | func setLiquidityMiner (_liquidityMiner) = valueOrElse(isAdmin(i), { | |
86 | 94 | let address = getAddressIfValid(_liquidityMiner) | |
87 | - | [StringEntry(k_miner_address, address)] | |
95 | + | if ((address == address)) | |
96 | + | then [StringEntry(k_miner_address, address)] | |
97 | + | else throw("Strict value is not equal to itself.") | |
88 | 98 | }) | |
89 | 99 | ||
90 | 100 | ||
91 | 101 | ||
92 | 102 | @Callable(i) | |
93 | 103 | func setOrders (_orders) = valueOrElse(isAdmin(i), { | |
94 | 104 | let address = getAddressIfValid(_orders) | |
95 | - | [StringEntry(k_orders_address, address)] | |
105 | + | if ((address == address)) | |
106 | + | then [StringEntry(k_orders_address, address)] | |
107 | + | else throw("Strict value is not equal to itself.") | |
96 | 108 | }) | |
97 | 109 | ||
98 | 110 | ||
99 | 111 | ||
100 | 112 | @Callable(i) | |
101 | 113 | func setReferral (_referral) = valueOrElse(isAdmin(i), { | |
102 | 114 | let address = getAddressIfValid(_referral) | |
103 | - | [StringEntry(k_referral_address, address)] | |
115 | + | if ((address == address)) | |
116 | + | then [StringEntry(k_referral_address, address)] | |
117 | + | else throw("Strict value is not equal to itself.") | |
104 | 118 | }) | |
105 | 119 | ||
106 | 120 | ||
107 | 121 | ||
108 | 122 | @Callable(i) | |
109 | 123 | func setFarming (_farming) = valueOrElse(isAdmin(i), { | |
110 | 124 | let address = getAddressIfValid(_farming) | |
111 | - | [StringEntry(k_farming_address, address)] | |
125 | + | if ((address == address)) | |
126 | + | then [StringEntry(k_farming_address, address)] | |
127 | + | else throw("Strict value is not equal to itself.") | |
112 | 128 | }) | |
113 | 129 | ||
114 | 130 | ||
115 | 131 | ||
116 | 132 | @Callable(i) | |
117 | 133 | func setManager (_manager) = valueOrElse(isAdmin(i), { | |
118 | 134 | let address = getAddressIfValid(_manager) | |
119 | - | [StringEntry(k_manager_address, address)] | |
135 | + | if ((address == address)) | |
136 | + | then [StringEntry(k_manager_address, address)] | |
137 | + | else throw("Strict value is not equal to itself.") | |
120 | 138 | }) | |
121 | 139 | ||
122 | 140 | ||
123 | 141 | ||
124 | 142 | @Callable(i) | |
125 | 143 | func setHousekeeper (_housekeeper) = valueOrElse(isAdmin(i), { | |
126 | 144 | let address = getAddressIfValid(_housekeeper) | |
127 | - | [StringEntry(k_housekeeper_address, address)] | |
145 | + | if ((address == address)) | |
146 | + | then [StringEntry(k_housekeeper_address, address)] | |
147 | + | else throw("Strict value is not equal to itself.") | |
128 | 148 | }) | |
129 | 149 | ||
130 | 150 | ||
131 | 151 | ||
132 | 152 | @Callable(i) | |
133 | 153 | func setPrizes (_prizes) = valueOrElse(isAdmin(i), { | |
134 | 154 | let address = getAddressIfValid(_prizes) | |
135 | - | [StringEntry(k_prizes_address, address)] | |
155 | + | if ((address == address)) | |
156 | + | then [StringEntry(k_prizes_address, address)] | |
157 | + | else throw("Strict value is not equal to itself.") | |
136 | 158 | }) | |
137 | 159 | ||
138 | 160 | ||
139 | 161 | ||
140 | 162 | @Callable(i) | |
141 | 163 | func setNftManager (_nftManager) = valueOrElse(isAdmin(i), { | |
142 | 164 | let address = getAddressIfValid(_nftManager) | |
143 | - | [StringEntry(k_nft_manager_address, address)] | |
165 | + | if ((address == address)) | |
166 | + | then [StringEntry(k_nft_manager_address, address)] | |
167 | + | else throw("Strict value is not equal to itself.") | |
144 | 168 | }) | |
145 | 169 | ||
146 | 170 | ||
147 | 171 | ||
148 | 172 | @Callable(i) | |
149 | 173 | func setSwap (_swap) = valueOrElse(isAdmin(i), { | |
150 | 174 | let address = getAddressIfValid(_swap) | |
151 | - | [StringEntry(k_swap_address, address)] | |
175 | + | if ((address == address)) | |
176 | + | then [StringEntry(k_swap_address, address)] | |
177 | + | else throw("Strict value is not equal to itself.") | |
152 | 178 | }) | |
153 | 179 | ||
154 | 180 | ||
155 | 181 | ||
156 | 182 | @Callable(i) | |
157 | 183 | func setQuoteAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_quote_asset, _assetId)]) | |
158 | 184 | ||
159 | 185 | ||
160 | 186 | ||
161 | 187 | @Callable(i) | |
162 | 188 | func setRewardAsset (_assetId) = valueOrElse(isAdmin(i), [StringEntry(k_reward_asset, _assetId)]) | |
163 | 189 | ||
164 | 190 | ||
165 | 191 | ||
166 | 192 | @Callable(i) | |
167 | 193 | func setStakingAddress (_stakingAddress) = valueOrElse(isAdmin(i), { | |
168 | 194 | let stakingAddress = getAddressIfValid(_stakingAddress) | |
169 | - | [StringEntry(k_staking_address, _stakingAddress)] | |
195 | + | if ((stakingAddress == stakingAddress)) | |
196 | + | then [StringEntry(k_staking_address, _stakingAddress)] | |
197 | + | else throw("Strict value is not equal to itself.") | |
198 | + | }) | |
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | @Callable(i) | |
203 | + | func setSpotAddress (_spotAddress) = valueOrElse(isAdmin(i), { | |
204 | + | let stakingAddress = getAddressIfValid(_spotAddress) | |
205 | + | if ((stakingAddress == stakingAddress)) | |
206 | + | then [StringEntry(k_spot_address, _spotAddress)] | |
207 | + | else throw("Strict value is not equal to itself.") | |
170 | 208 | }) | |
171 | 209 | ||
172 | 210 | ||
173 | 211 | ||
174 | 212 | @Callable(i) | |
175 | 213 | func setVaultAddress (_vaultAddress) = valueOrElse(isAdmin(i), { | |
176 | 214 | let exchangeAddress = getAddressIfValid(_vaultAddress) | |
177 | - | [StringEntry(k_vault_address, _vaultAddress)] | |
215 | + | if ((exchangeAddress == exchangeAddress)) | |
216 | + | then [StringEntry(k_vault_address, _vaultAddress)] | |
217 | + | else throw("Strict value is not equal to itself.") | |
218 | + | }) | |
219 | + | ||
220 | + | ||
221 | + | ||
222 | + | @Callable(i) | |
223 | + | func setOracleAddress (_oracleAddress) = valueOrElse(isAdmin(i), { | |
224 | + | let oracleAddress = getAddressIfValid(_oracleAddress) | |
225 | + | if ((oracleAddress == oracleAddress)) | |
226 | + | then [StringEntry(k_orders_address, _oracleAddress)] | |
227 | + | else throw("Strict value is not equal to itself.") | |
178 | 228 | }) | |
179 | 229 | ||
180 | 230 | ||
181 | 231 | ||
182 | 232 | @Callable(i) | |
183 | 233 | func addChild (_childAddress) = valueOrElse(isAdmin(i), { | |
184 | 234 | let childAddress = getAddressIfValid(_childAddress) | |
185 | 235 | [BooleanEntry(toCompositeKey(k_child, _childAddress), true)] | |
186 | 236 | }) | |
187 | 237 | ||
188 | 238 | ||
189 | 239 | ||
190 | 240 | @Callable(i) | |
191 | 241 | func addAmm (_ammAddress,_data) = valueOrElse(isAdmin(i), { | |
192 | 242 | let ammAddress = getAddressIfValid(_ammAddress) | |
193 | 243 | [BooleanEntry(toCompositeKey(k_amm, _ammAddress), true), StringEntry(toCompositeKey(k_amm_data, _ammAddress), _data)] | |
194 | 244 | }) | |
195 | 245 | ||
196 | 246 | ||
197 | 247 | ||
198 | 248 | @Callable(i) | |
199 | 249 | func removeAmm (_ammAddress) = valueOrElse(isAdmin(i), [DeleteEntry(toCompositeKey(k_amm, _ammAddress))]) | |
200 | 250 | ||
201 | 251 | ||
202 | 252 | ||
203 | 253 | @Callable(i) | |
204 | 254 | func setGovernanceAsset (_assetId) = valueOrElse(isAdmin(i), { | |
205 | 255 | let assetBytes = fromBase58String(_assetId) | |
206 | 256 | match assetInfo(assetBytes) { | |
207 | 257 | case asset: Asset => | |
208 | 258 | if ((asset.decimals != 8)) | |
209 | 259 | then throw("Invalid asset decimals, should be 8") | |
210 | 260 | else [StringEntry(k_governance_asset, _assetId)] | |
211 | 261 | case _ => | |
212 | 262 | throw("Can't find asset") | |
213 | 263 | } | |
214 | 264 | }) | |
215 | 265 | ||
216 | 266 | ||
217 | 267 | @Verifier(tx) | |
218 | 268 | func verify () = match getString(this, k_admin_address) { | |
219 | 269 | case verifier: String => | |
220 | 270 | valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
221 | 271 | case _ => | |
222 | 272 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
223 | 273 | } | |
224 | 274 |
github/deemru/w8io/026f985 35.47 ms ◑