tx · GNzbwJZw4z1PxH3WR4XJYeN95gg8HAofVR7F6tnvWbSt 3MybHSP1eXJEiVdt5gGbSARELfnswzWNncE: -0.10000000 Waves 2022.07.07 13:41 [2129159] smart account 3MybHSP1eXJEiVdt5gGbSARELfnswzWNncE > SELF 0.00000000 Waves
{ "type": 13, "id": "GNzbwJZw4z1PxH3WR4XJYeN95gg8HAofVR7F6tnvWbSt", "fee": 10000000, "feeAssetId": null, "timestamp": 1657190508031, "version": 1, "sender": "3MybHSP1eXJEiVdt5gGbSARELfnswzWNncE", "senderPublicKey": "BMnqNXbEHPAHtmFm2M7k3GtvHJf18eFAPzo9aVd3WU87", "proofs": [ "4zXe5Bu8iGa5AptmuLGbp2U8LW8MBqxSbFDGB4QGY9ZD3AY2EgHcRUBt6vtEcmo3UHdBQbeMfmrJXN7UdgGWJQrM" ], "script": "base64:AAIFAAAAAAAAADUIAhIAEgMKAQESABIDCgEIEgQKAggIEgQKAggIEgASBgoECAgIARIDCgEIEgMKAQQSAwoBCAAAACYAAAAAC01BWF9SRVdBUkRTAAAAAAAAAAAFAAAAAAVvd25lcgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAFb3duZXIAAAAABXRva2VuCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAV0b2tlbgAAAAAHcmV3YXJkcwkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAHcmV3YXJkcwAAAAAMcmV3YXJkc19saXN0CQAEtQAAAAIFAAAAB3Jld2FyZHMCAAAAASwAAAAABnBlcmlvZAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAGcGVyaW9kAAAAAAlpc19raWxsZWQJAQAAABFAZXh0ck5hdGl2ZSgxMDUxKQAAAAIFAAAABHRoaXMCAAAACWlzX2tpbGxlZAAA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QIAAAAKU2FtZSBzdGF0ZQQAAAAMc3RvcF9hY3Rpb25zAwUAAAAKX2lzX2tpbGxlZAkBAAAADHN0b3BfcmV3YXJkcwAAAAAFAAAAA25pbAkABE4AAAACCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACAgAAAAlpc19raWxsZWQFAAAACl9pc19raWxsZWQFAAAAA25pbAUAAAAMc3RvcF9hY3Rpb25zAAAAA21zZwEAAAAKc2V0X2NvbmZpZwAAAAEAAAAHX2NvbmZpZwMJAQAAAAIhPQAAAAIIBQAAAANtc2cAAAAGY2FsbGVyBQAAAAVvd25lcgkAAAIAAAABAgAAAApPd25lciBvbmx5CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABmNvbmZpZwkBAAAADGNoZWNrQWRkcmVzcwAAAAEFAAAAB19jb25maWcFAAAAA25pbAAAAAD6WTDN", "chainId": 84, "height": 2129159, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let MAX_REWARDS = 5 | |
5 | + | ||
6 | + | let owner = addressFromStringValue(getStringValue(this, "owner")) | |
7 | + | ||
8 | + | let token = getStringValue(this, "token") | |
9 | + | ||
10 | + | let rewards = getStringValue(this, "rewards") | |
11 | + | ||
12 | + | let rewards_list = split(rewards, ",") | |
13 | + | ||
14 | + | let period = getIntegerValue(this, "period") | |
15 | + | ||
16 | + | let is_killed = getBooleanValue(this, "is_killed") | |
17 | + | ||
18 | + | let configAddress = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "config"), "no settings defined")), "bad settings address") | |
19 | + | ||
20 | + | let HEIGHT = height | |
21 | + | ||
22 | + | let sync_height_key = "sync_height" | |
23 | + | ||
24 | + | let sync_height = valueOrElse(getInteger(this, sync_height_key), 0) | |
25 | + | ||
26 | + | let token_amount_key = "tokens" | |
27 | + | ||
28 | + | let token_amount = valueOrElse(getInteger(this, token_amount_key), 0) | |
29 | + | ||
30 | + | func user_amount_key (user) = (user + "_amount") | |
31 | + | ||
32 | + | ||
33 | + | func user_amount (user) = valueOrElse(getInteger(this, user_amount_key(user)), 0) | |
34 | + | ||
35 | + | ||
36 | + | func user_asset_adjusted_key (user,asset) = (((user + "_") + asset) + "_adjusted") | |
37 | + | ||
38 | + | ||
39 | + | func user_asset_adjusted (user,asset) = valueOrElse(getInteger(this, user_asset_adjusted_key(user, asset)), 0) | |
40 | + | ||
41 | + | ||
42 | + | func user_asset_claimed_key (user,asset) = (((user + "_") + asset) + "_claimed") | |
43 | + | ||
44 | + | ||
45 | + | func user_asset_claimed (user,asset) = valueOrElse(getInteger(this, user_asset_claimed_key(user, asset)), 0) | |
46 | + | ||
47 | + | ||
48 | + | func asset_reward_key (asset) = (asset + "_reward") | |
49 | + | ||
50 | + | ||
51 | + | func asset_reward (asset) = valueOrElse(getInteger(this, asset_reward_key(asset)), 0) | |
52 | + | ||
53 | + | ||
54 | + | func asset_speed_key (asset) = (asset + "_speed") | |
55 | + | ||
56 | + | ||
57 | + | func asset_speed (asset) = valueOrElse(getInteger(this, asset_speed_key(asset)), 0) | |
58 | + | ||
59 | + | ||
60 | + | func asset_left_key (asset) = (asset + "_left") | |
61 | + | ||
62 | + | ||
63 | + | func asset_left (asset) = valueOrElse(getInteger(this, asset_left_key(asset)), 0) | |
64 | + | ||
65 | + | ||
66 | + | func asset_control_key (asset) = (asset + "_control") | |
67 | + | ||
68 | + | ||
69 | + | func asset_control (asset) = valueOrElse(getInteger(this, asset_control_key(asset)), 0) | |
70 | + | ||
71 | + | ||
72 | + | func checkAddress (a58) = { | |
73 | + | let a = addressFromStringValue(a58) | |
74 | + | toString(a) | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | func checkAsset (asset58) = if ((asset58 == "WAVES")) | |
79 | + | then "WAVES" | |
80 | + | else { | |
81 | + | let asset = valueOrErrorMessage(fromBase58String(asset58), ("Wrong asset encoding: " + asset58)) | |
82 | + | let info = valueOrErrorMessage(assetInfo(asset), ("Wrong asset info: " + asset58)) | |
83 | + | if ((info == info)) | |
84 | + | then asset58 | |
85 | + | else throw("Strict value is not equal to itself.") | |
86 | + | } | |
87 | + | ||
88 | + | ||
89 | + | func asset (a) = if ((a == "WAVES")) | |
90 | + | then unit | |
91 | + | else fromBase58String(a) | |
92 | + | ||
93 | + | ||
94 | + | func asset_string (a) = match a { | |
95 | + | case b: ByteVector => | |
96 | + | toBase58String(b) | |
97 | + | case _ => | |
98 | + | "WAVES" | |
99 | + | } | |
100 | + | ||
101 | + | ||
102 | + | func asset_balance (a) = if ((a == "WAVES")) | |
103 | + | then wavesBalance(this).available | |
104 | + | else assetBalance(this, fromBase58String(a)) | |
105 | + | ||
106 | + | ||
107 | + | func stop_rewards () = { | |
108 | + | func fold (acc,asset) = (acc ++ [IntegerEntry(asset_speed_key(asset), 0)]) | |
109 | + | ||
110 | + | let $l = rewards_list | |
111 | + | let $s = size($l) | |
112 | + | let $acc0 = nil | |
113 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
114 | + | then $a | |
115 | + | else fold($a, $l[$i]) | |
116 | + | ||
117 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
118 | + | then $a | |
119 | + | else throw("List size exceeds 5") | |
120 | + | ||
121 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
122 | + | } | |
123 | + | ||
124 | + | ||
125 | + | func checkpoint_asset (acc,asset) = { | |
126 | + | let _asset_reward = asset_reward(asset) | |
127 | + | let _asset_speed = asset_speed(asset) | |
128 | + | let _asset_left = asset_left(asset) | |
129 | + | let estimate_reward = ((HEIGHT - sync_height) * _asset_speed) | |
130 | + | let real_reward = if ((estimate_reward > _asset_left)) | |
131 | + | then _asset_left | |
132 | + | else estimate_reward | |
133 | + | let claim_asset_reward = (_asset_reward + real_reward) | |
134 | + | let claim_asset_left = (_asset_left - real_reward) | |
135 | + | let claim_asset_speed = if ((claim_asset_left > 0)) | |
136 | + | then _asset_speed | |
137 | + | else 0 | |
138 | + | let reward_action = if ((claim_asset_reward == _asset_reward)) | |
139 | + | then nil | |
140 | + | else [IntegerEntry(asset_reward_key(asset), claim_asset_reward)] | |
141 | + | let _asset_balance = asset_balance(asset) | |
142 | + | let _asset_control = asset_control(asset) | |
143 | + | if ((_asset_control > _asset_balance)) | |
144 | + | then throw(((((asset + " balance leakage detected: ") + toString(_asset_control)) + " > ") + toString(_asset_balance))) | |
145 | + | else { | |
146 | + | let period_new_balance = (_asset_balance - _asset_control) | |
147 | + | let period_asset_balance = (claim_asset_left + period_new_balance) | |
148 | + | let period_asset_speed = (period_asset_balance / period) | |
149 | + | if (if ((claim_asset_speed >= period_asset_speed)) | |
150 | + | then (claim_asset_left >= period_new_balance) | |
151 | + | else false) | |
152 | + | then { | |
153 | + | let speed_action = if ((claim_asset_speed == _asset_speed)) | |
154 | + | then nil | |
155 | + | else [IntegerEntry(asset_speed_key(asset), claim_asset_speed)] | |
156 | + | let left_action = if ((claim_asset_left == _asset_left)) | |
157 | + | then nil | |
158 | + | else [IntegerEntry(asset_left_key(asset), claim_asset_left)] | |
159 | + | (((acc ++ reward_action) ++ speed_action) ++ left_action) | |
160 | + | } | |
161 | + | else { | |
162 | + | let period_asset_left = (period_asset_speed * period) | |
163 | + | let period_asset_dust = (period_asset_balance - period_asset_left) | |
164 | + | let period_asset_contol = (_asset_balance - period_asset_dust) | |
165 | + | ((acc ++ reward_action) ++ [IntegerEntry(asset_speed_key(asset), period_asset_speed), IntegerEntry(asset_left_key(asset), period_asset_left), IntegerEntry(asset_control_key(asset), period_asset_contol)]) | |
166 | + | } | |
167 | + | } | |
168 | + | } | |
169 | + | ||
170 | + | ||
171 | + | func sync () = if (is_killed) | |
172 | + | then nil | |
173 | + | else invoke(this, "checkpoint", nil, nil) | |
174 | + | ||
175 | + | ||
176 | + | func checkpoint_actions () = { | |
177 | + | let sync_action = if ((sync_height == HEIGHT)) | |
178 | + | then nil | |
179 | + | else [IntegerEntry(sync_height_key, HEIGHT)] | |
180 | + | (sync_action ++ { | |
181 | + | let $l = rewards_list | |
182 | + | let $s = size($l) | |
183 | + | let $acc0 = nil | |
184 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
185 | + | then $a | |
186 | + | else checkpoint_asset($a, $l[$i]) | |
187 | + | ||
188 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
189 | + | then $a | |
190 | + | else throw("List size exceeds 5") | |
191 | + | ||
192 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
193 | + | }) | |
194 | + | } | |
195 | + | ||
196 | + | ||
197 | + | func update_user (user,change) = { | |
198 | + | let new_user_amount = (user_amount(user) + change) | |
199 | + | if ((0 > new_user_amount)) | |
200 | + | then throw(((("Bad amount: " + toString(change)) + ", available amount: ") + toString(user_amount(user)))) | |
201 | + | else { | |
202 | + | let new_token_amount = (token_amount + change) | |
203 | + | if ((new_token_amount > asset_balance(token))) | |
204 | + | then throw(((("Token balance leakage detected: " + toString(new_token_amount)) + " > ") + toString(asset_balance(token)))) | |
205 | + | else { | |
206 | + | let s = sync() | |
207 | + | if ((s == s)) | |
208 | + | then { | |
209 | + | func fold (acc,asset) = (acc ++ { | |
210 | + | let _asset_reward = asset_reward(asset) | |
211 | + | let _user_asset_adjusted = user_asset_adjusted(user, asset) | |
212 | + | let new_asset_reward = if ((token_amount == 0)) | |
213 | + | then _asset_reward | |
214 | + | else fraction(_asset_reward, new_token_amount, token_amount) | |
215 | + | let new_user_asset_adjusted = (_user_asset_adjusted + (if ((new_token_amount == 0)) | |
216 | + | then _asset_reward | |
217 | + | else -(fraction(new_asset_reward, change, new_token_amount)))) | |
218 | + | let reward_action = if ((_asset_reward == new_asset_reward)) | |
219 | + | then nil | |
220 | + | else [IntegerEntry(asset_reward_key(asset), new_asset_reward)] | |
221 | + | let adjust_action = if ((_user_asset_adjusted == new_user_asset_adjusted)) | |
222 | + | then nil | |
223 | + | else [IntegerEntry(user_asset_adjusted_key(user, asset), new_user_asset_adjusted)] | |
224 | + | (reward_action ++ adjust_action) | |
225 | + | }) | |
226 | + | ||
227 | + | let stop_actions = if ((new_token_amount == 0)) | |
228 | + | then stop_rewards() | |
229 | + | else nil | |
230 | + | (([IntegerEntry(token_amount_key, new_token_amount), IntegerEntry(user_amount_key(user), new_user_amount)] ++ { | |
231 | + | let $l = rewards_list | |
232 | + | let $s = size($l) | |
233 | + | let $acc0 = nil | |
234 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
235 | + | then $a | |
236 | + | else fold($a, $l[$i]) | |
237 | + | ||
238 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
239 | + | then $a | |
240 | + | else throw("List size exceeds 5") | |
241 | + | ||
242 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
243 | + | }) ++ stop_actions) | |
244 | + | } | |
245 | + | else throw("Strict value is not equal to itself.") | |
246 | + | } | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | func checkRewardsList (_rewards,_token) = { | |
252 | + | let _rewards_list = split(_rewards, ",") | |
253 | + | if ((size(_rewards_list) > MAX_REWARDS)) | |
254 | + | then throw("Too many rewards") | |
255 | + | else { | |
256 | + | func fold (acc,asset) = if ((checkAsset(asset) == _token)) | |
257 | + | then throw("Reward cannot be the token") | |
258 | + | else if (containsElement(acc, asset)) | |
259 | + | then throw("Duplicated reward in list") | |
260 | + | else (acc ++ [asset]) | |
261 | + | ||
262 | + | makeString({ | |
263 | + | let $l = _rewards_list | |
264 | + | let $s = size($l) | |
265 | + | let $acc0 = nil | |
266 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
267 | + | then $a | |
268 | + | else fold($a, $l[$i]) | |
269 | + | ||
270 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
271 | + | then $a | |
272 | + | else throw("List size exceeds 5") | |
273 | + | ||
274 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
275 | + | }, ",") | |
276 | + | } | |
277 | + | } | |
278 | + | ||
279 | + | ||
280 | + | @Callable(msg) | |
281 | + | func deposit () = if ((size(msg.payments) != 1)) | |
282 | + | then throw("Wrong payments, should be 1 payment") | |
283 | + | else { | |
284 | + | let payment = msg.payments[0] | |
285 | + | if ((asset_string(payment.assetId) != token)) | |
286 | + | then throw(((("Wrong token: " + asset_string(payment.assetId)) + " != ") + token)) | |
287 | + | else if ((0 >= payment.amount)) | |
288 | + | then throw("Wrong amount, should be positive") | |
289 | + | else update_user(toString(msg.caller), payment.amount) | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | ||
294 | + | @Callable(msg) | |
295 | + | func withdraw (amount) = if ((size(msg.payments) != 0)) | |
296 | + | then throw("Wrong payments, should be empty") | |
297 | + | else if ((0 >= amount)) | |
298 | + | then throw("Wrong amount, should be positive") | |
299 | + | else (update_user(toString(msg.caller), -(amount)) ++ [ScriptTransfer(msg.caller, amount, asset(token))]) | |
300 | + | ||
301 | + | ||
302 | + | ||
303 | + | @Callable(msg) | |
304 | + | func claim () = if ((size(msg.payments) != 0)) | |
305 | + | then throw("Wrong payments, should be empty") | |
306 | + | else { | |
307 | + | let s = if ((token_amount > 0)) | |
308 | + | then sync() | |
309 | + | else nil | |
310 | + | if ((s == s)) | |
311 | + | then { | |
312 | + | let user = toString(msg.caller) | |
313 | + | func fold (acc,asset) = (acc ++ { | |
314 | + | let _asset_reward = asset_reward(asset) | |
315 | + | let accumulated = (user_asset_adjusted(user, asset) + (if ((token_amount == 0)) | |
316 | + | then 0 | |
317 | + | else fraction(_asset_reward, user_amount(user), token_amount))) | |
318 | + | let claimed = user_asset_claimed(user, asset) | |
319 | + | let amount = (accumulated - claimed) | |
320 | + | if ((amount == 0)) | |
321 | + | then nil | |
322 | + | else if ((0 > amount)) | |
323 | + | then throw(((asset + " bad claim amount detected: ") + toString(amount))) | |
324 | + | else { | |
325 | + | let _asset_control = asset_control(asset) | |
326 | + | [ScriptTransfer(msg.caller, amount, asset(asset)), IntegerEntry(user_asset_claimed_key(user, asset), (claimed + amount)), IntegerEntry(asset_control_key(asset), (_asset_control - amount))] | |
327 | + | } | |
328 | + | }) | |
329 | + | ||
330 | + | let claim_actions = { | |
331 | + | let $l = rewards_list | |
332 | + | let $s = size($l) | |
333 | + | let $acc0 = nil | |
334 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
335 | + | then $a | |
336 | + | else fold($a, $l[$i]) | |
337 | + | ||
338 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
339 | + | then $a | |
340 | + | else throw("List size exceeds 5") | |
341 | + | ||
342 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
343 | + | } | |
344 | + | if ((size(claim_actions) == 0)) | |
345 | + | then throw("Nothing to claim") | |
346 | + | else claim_actions | |
347 | + | } | |
348 | + | else throw("Strict value is not equal to itself.") | |
349 | + | } | |
350 | + | ||
351 | + | ||
352 | + | ||
353 | + | @Callable(msg) | |
354 | + | func claimable_tokens (user) = $Tuple2(nil, user_amount(user)) | |
355 | + | ||
356 | + | ||
357 | + | ||
358 | + | @Callable(msg) | |
359 | + | func claimed_reward (user,asset) = $Tuple2(nil, user_asset_claimed(user, asset)) | |
360 | + | ||
361 | + | ||
362 | + | ||
363 | + | @Callable(msg) | |
364 | + | func claimable_reward (user,asset) = { | |
365 | + | let s = if ((token_amount > 0)) | |
366 | + | then sync() | |
367 | + | else nil | |
368 | + | if ((s == s)) | |
369 | + | then { | |
370 | + | let _asset_reward = asset_reward(asset) | |
371 | + | let accumulated = (user_asset_adjusted(user, asset) + (if ((token_amount == 0)) | |
372 | + | then 0 | |
373 | + | else fraction(_asset_reward, user_amount(user), token_amount))) | |
374 | + | let claimed = user_asset_claimed(user, asset) | |
375 | + | let amount = (accumulated - claimed) | |
376 | + | $Tuple2(nil, amount) | |
377 | + | } | |
378 | + | else throw("Strict value is not equal to itself.") | |
379 | + | } | |
380 | + | ||
381 | + | ||
382 | + | ||
383 | + | @Callable(msg) | |
384 | + | func checkpoint () = if (is_killed) | |
385 | + | then throw("Checkpoint is killed") | |
386 | + | else if (if ((token_amount == 0)) | |
387 | + | then (msg.caller != this) | |
388 | + | else false) | |
389 | + | then throw("Checkpoint unavailable") | |
390 | + | else checkpoint_actions() | |
391 | + | ||
392 | + | ||
393 | + | ||
394 | + | @Callable(msg) | |
395 | + | func init (_owner,_token,_rewards,_period) = if (!(isDataStorageUntouched(this))) | |
396 | + | then throw("Already initialized") | |
397 | + | else if ((msg.caller != this)) | |
398 | + | then throw("Self initialization only") | |
399 | + | else if ((0 >= _period)) | |
400 | + | then throw("Bad period") | |
401 | + | else [StringEntry("owner", checkAddress(_owner)), StringEntry("token", checkAsset(_token)), StringEntry("rewards", checkRewardsList(_rewards, _token)), IntegerEntry("period", _period), BooleanEntry("is_killed", false)] | |
402 | + | ||
403 | + | ||
404 | + | ||
405 | + | @Callable(msg) | |
406 | + | func add_reward (reward) = if ((msg.caller != owner)) | |
407 | + | then throw("Owner only") | |
408 | + | else [StringEntry("rewards", checkRewardsList(((rewards + ",") + reward), token))] | |
409 | + | ||
410 | + | ||
411 | + | ||
412 | + | @Callable(msg) | |
413 | + | func set_killed (_is_killed) = if ((msg.caller != owner)) | |
414 | + | then throw("Owner only") | |
415 | + | else if ((is_killed == _is_killed)) | |
416 | + | then throw("Same state") | |
417 | + | else { | |
418 | + | let stop_actions = if (_is_killed) | |
419 | + | then stop_rewards() | |
420 | + | else nil | |
421 | + | ([BooleanEntry("is_killed", _is_killed)] ++ stop_actions) | |
422 | + | } | |
423 | + | ||
424 | + | ||
425 | + | ||
426 | + | @Callable(msg) | |
427 | + | func set_config (_config) = if ((msg.caller != owner)) | |
428 | + | then throw("Owner only") | |
429 | + | else [StringEntry("config", checkAddress(_config))] | |
430 | + | ||
431 | + |
github/deemru/w8io/169f3d6 24.89 ms ◑