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