tx · ALRoUu2Rjw7UGiSNch45uv6aTcfarucUWgtuhg2VquEs 3NCzUsFn22SqL6SiuFpRSo8VRj6XpBzNCTK: -0.00800000 Waves 2022.06.24 12:13 [2110297] smart account 3NCzUsFn22SqL6SiuFpRSo8VRj6XpBzNCTK > SELF 0.00000000 Waves
{ "type": 13, "id": "ALRoUu2Rjw7UGiSNch45uv6aTcfarucUWgtuhg2VquEs", "fee": 800000, "feeAssetId": null, "timestamp": 1656062037787, "version": 2, "chainId": 84, "sender": "3NCzUsFn22SqL6SiuFpRSo8VRj6XpBzNCTK", "senderPublicKey": "8tc6RQVnwQMdDY1k9GxP7EvBttrJT2a6GeBMQHEsKnW7", "proofs": [ "2z7TFBQhHn8uPdiupd5sfnrbpz8BJjQUxjybtm16HSmH8hgoKYvFN3vzn2hsZVgr78BbFpHt8nMX6Xg4aeB7j6gN" ], "script": "base64:AAIFAAAAAAAAAAgIAhIAEgASAAAAAAYAAAAABWZhcm1zCQAETAAAAAICAAAABGJldGEJAARMAAAAAgIAAAAEbWV0YQkABEwAAAACAgAAAAR6ZXRhBQAAAANuaWwBAAAABmdldFN0cgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAABAAAABmdldEludAAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAAAVzdGFrZQAAAAIAAAAEZmFybQAAAAZhbW91bnQEAAAAB2Fzc2V0SWQJAAJZAAAAAQkBAAAABmdldFN0cgAAAAEJAAEsAAAAAgUAAAAEZmFybQIAAAADX2lkBAAAAARkQXBwCQEAAAAGZ2V0U3RyAAAAA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5kZXJQdWJsaWNLZXk4Pi0b", "height": 2110297, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G6MKMGnAMhxre7ziz84y4cf2m3wBsiWhuLK9sKEwfo8b Next: 7e2fyHr9YGe9mn5g4xa83T7C5Mc4aE6iVNAifoS4VRrc Diff:
Old | New | Differences | |
---|---|---|---|
55 | 55 | ||
56 | 56 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
57 | 57 | then $a | |
58 | - | else throw("List size exceeds | |
58 | + | else throw("List size exceeds 3") | |
59 | 59 | ||
60 | - | $f0_2 | |
60 | + | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
61 | 61 | })] | |
62 | 62 | else throw("Private Farm. Access prohibited!") | |
63 | 63 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let farms = ["beta", "meta", "zeta"] | |
5 | 5 | ||
6 | 6 | func getStr (key) = match getString(this, key) { | |
7 | 7 | case b: String => | |
8 | 8 | b | |
9 | 9 | case _ => | |
10 | 10 | "" | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getInt (key) = match getInteger(this, key) { | |
15 | 15 | case b: Int => | |
16 | 16 | b | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func stake (farm,amount) = { | |
23 | 23 | let assetId = fromBase58String(getStr((farm + "_id"))) | |
24 | 24 | let dApp = getStr((farm + "_st")) | |
25 | 25 | let balance = assetBalance(this, assetId) | |
26 | 26 | if ((amount == -1)) | |
27 | 27 | then invoke(Address(fromBase58String(dApp)), "stakeFarmTokens", [false], [AttachedPayment(assetId, balance)]) | |
28 | 28 | else if ((balance >= amount)) | |
29 | 29 | then invoke(Address(fromBase58String(dApp)), "stakeFarmTokens", [false], [AttachedPayment(assetId, amount)]) | |
30 | 30 | else throw(((("Low balance: " + toString(balance)) + " and need: ") + toString(amount))) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func check (pbk) = { | |
35 | 35 | let pbk_st = toBase58String(pbk) | |
36 | 36 | let points = getStringValue("points") | |
37 | 37 | contains(points, pbk_st) | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func iter (acc,farm) = if ((acc == 0)) | |
42 | 42 | then stake(farm, -1) | |
43 | 43 | else 0 | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func StakeAll () = if (check(i.callerPublicKey)) | |
48 | 48 | then [IntegerEntry("stake", { | |
49 | 49 | let $l = farms | |
50 | 50 | let $s = size($l) | |
51 | 51 | let $acc0 = 0 | |
52 | 52 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
53 | 53 | then $a | |
54 | 54 | else iter($a, $l[$i]) | |
55 | 55 | ||
56 | 56 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
57 | 57 | then $a | |
58 | - | else throw("List size exceeds | |
58 | + | else throw("List size exceeds 3") | |
59 | 59 | ||
60 | - | $f0_2 | |
60 | + | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
61 | 61 | })] | |
62 | 62 | else throw("Private Farm. Access prohibited!") | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(i) | |
67 | 67 | func UnstakeAll () = if (check(i.callerPublicKey)) | |
68 | 68 | then throw("Welcome") | |
69 | 69 | else throw("Private Farm. Access prohibited!") | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func ClaimAll () = if (check(i.callerPublicKey)) | |
75 | 75 | then throw("Welcome") | |
76 | 76 | else throw("Private Farm. Access prohibited!") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Verifier(tx) | |
80 | 80 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
81 | 81 |
github/deemru/w8io/169f3d6 57.33 ms ◑