tx · yjbAaJCunKH8tGuYqDhUz7WsU82Jdmc1ZyGcrPzVEc1 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00100000 Waves 2023.10.31 16:05 [2822858] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "yjbAaJCunKH8tGuYqDhUz7WsU82Jdmc1ZyGcrPzVEc1", "fee": 100000, "feeAssetId": null, "timestamp": 1698757570869, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "4dY5zhHeczophXPsKQzB5Ka7n7XWk6BcZEZCM1DedTreDSYY2imdi4NDxvLX3RAuN2njDF5MKEE1hTp8Uyqe5vao" ], "script": "base64:BgIGCAISABIAAQALU3RyaW5nVmFsdWUCBTEsMiwzAgFpAQRtYWtlAAQIbWFrZUxpc3QJAMwIAgkBEUBleHRyTmF0aXZlKDEwNTgpAQIdbGlzdCBlbmRlZCBib29zdGluZ0lkczI4MjI1MzEFA25pbAQLZmlyc3RPZkxpc3QJAJEDAgUIbWFrZUxpc3QAAAkAzAgCCQELU3RyaW5nRW50cnkCAg1maXJzdCBvZiBsaXN0BQtmaXJzdE9mTGlzdAUDbmlsAWkBBW1ha2UyAAoBBGZvbGQCBWFjY3VtBG5leHQJAM0IAgUFYWNjdW0JAQ1wYXJzZUludFZhbHVlAQUEbmV4dAQEbGlzdAoAAiRsCQC1CQIFC1N0cmluZ1ZhbHVlAgEsCgACJHMJAJADAQUCJGwKAAUkYWNjMAUDbmlsCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQRmb2xkAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyAzCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADBAtmaXJzdE9mTGlzdAkAkQMCBQRsaXN0AAAFA25pbABIi4nL", "height": 2822858, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 93YDyT2TRtMSKKitpsMY9kVrjWwu81mzMewCbC7KJ9uD Next: CcB93CaBpJ6EpY8Jg6BsNxPuo1bGugqZFrgSG3ss5qUt Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let li = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "55", "56"] | |
5 | - | ||
6 | - | let hours = 1 | |
7 | - | ||
8 | - | let minutes = 10 | |
9 | - | ||
10 | - | func tryGetInteger (key) = match getInteger(this, key) { | |
11 | - | case b: Int => | |
12 | - | b | |
13 | - | case _ => | |
14 | - | 0 | |
15 | - | } | |
16 | - | ||
17 | - | ||
18 | - | func tryGetString (key) = match getString(this, key) { | |
19 | - | case b: String => | |
20 | - | b | |
21 | - | case _ => | |
22 | - | "" | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | func getAssetString (assetId) = match assetId { | |
27 | - | case b: ByteVector => | |
28 | - | toBase58String(b) | |
29 | - | case _ => | |
30 | - | "WAVES" | |
31 | - | } | |
32 | - | ||
33 | - | ||
34 | - | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
35 | - | then unit | |
36 | - | else fromBase58String(assetIdStr) | |
37 | - | ||
38 | - | ||
39 | - | func payBoostingResult (boostingId) = { | |
40 | - | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
41 | - | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
42 | - | if (if ((lastHeight != 0)) | |
43 | - | then (finishHeight > lastHeight) | |
44 | - | else false) | |
45 | - | then { | |
46 | - | let blockReward = tryGetInteger((("boosting_" + boostingId) + "_blockAmount")) | |
47 | - | let toPay = ((min([finishHeight, height]) - lastHeight) * blockReward) | |
48 | - | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId"))))] | |
49 | - | } | |
50 | - | else nil | |
51 | - | } | |
52 | - | ||
53 | - | ||
54 | - | func endedList (boostingId) = { | |
55 | - | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
56 | - | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
57 | - | let intBoostingId = parseIntValue(boostingId) | |
58 | - | if ((lastHeight >= finishHeight)) | |
59 | - | then [IntegerEntry((("list ended " + toString(height)) + boostingId), intBoostingId)] | |
60 | - | else nil | |
61 | - | } | |
62 | - | ||
4 | + | let StringValue = "1,2,3" | |
63 | 5 | ||
64 | 6 | @Callable(i) | |
65 | - | func addBoosting (poolId,days) = { | |
66 | - | let fullAmount = i.payments[0].amount | |
67 | - | let assetId = getAssetString(i.payments[0].assetId) | |
68 | - | let inv = invoke(this, "getList", nil, nil) | |
69 | - | if ((inv == inv)) | |
70 | - | then { | |
71 | - | let boostingId = "1" | |
72 | - | if ((addressFromString(poolId) == unit)) | |
73 | - | then throw("incorrect pool address") | |
74 | - | else [IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), IntegerEntry((("boosting_" + boostingId) + "_blockAmount"), (fullAmount / ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_startHeight"), height), IntegerEntry((("boosting_" + boostingId) + "_finishHeight"), (height + ((days * hours) * minutes))), IntegerEntry((("boosting_" + boostingId) + "_finishTimestamp"), (lastBlock.timestamp + ((((days * hours) * minutes) * 60) * 1000))), IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), StringEntry((("boosting_" + boostingId) + "_assetId"), assetId), StringEntry((("boosting_" + boostingId) + "_owner"), toString(i.caller)), StringEntry((("boosting_" + boostingId) + "_poolId"), poolId), StringEntry((("pool_" + poolId) + "_boostings"), ((tryGetString((("pool_" + poolId) + "_boostings")) + boostingId) + ","))] | |
75 | - | } | |
76 | - | else throw("Strict value is not equal to itself.") | |
7 | + | func make () = { | |
8 | + | let makeList = [getStringValue("list ended boostingIds2822531")] | |
9 | + | let firstOfList = makeList[0] | |
10 | + | [StringEntry("first of list", firstOfList)] | |
77 | 11 | } | |
78 | 12 | ||
79 | 13 | ||
80 | 14 | ||
81 | 15 | @Callable(i) | |
82 | - | func payBoosting (boostingId) = payBoostingResult(boostingId) | |
16 | + | func make2 () = { | |
17 | + | func fold (accum,next) = (accum :+ parseIntValue(next)) | |
83 | 18 | ||
84 | - | ||
85 | - | ||
86 | - | @Callable(i) | |
87 | - | func payBoostings () = { | |
88 | - | func f (accum,next) = { | |
89 | - | let in = invoke(this, "payBoosting", [next], nil) | |
90 | - | if ((in == in)) | |
91 | - | then in | |
92 | - | else throw("Strict value is not equal to itself.") | |
93 | - | } | |
94 | - | ||
95 | - | let payments = { | |
96 | - | let $l = li | |
19 | + | let list = { | |
20 | + | let $l = split(StringValue, ",") | |
97 | 21 | let $s = size($l) | |
98 | - | let $acc0 = | |
22 | + | let $acc0 = nil | |
99 | 23 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | 24 | then $a | |
101 | - | else | |
25 | + | else fold($a, $l[$i]) | |
102 | 26 | ||
103 | 27 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | 28 | then $a | |
105 | - | else throw("List size exceeds | |
29 | + | else throw("List size exceeds 3") | |
106 | 30 | ||
107 | - | $f0_2 | |
31 | + | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
108 | 32 | } | |
109 | - | if ((payments == payments)) | |
110 | - | then nil | |
111 | - | else throw("Strict value is not equal to itself.") | |
112 | - | } | |
113 | - | ||
114 | - | ||
115 | - | ||
116 | - | @Callable(i) | |
117 | - | func getEndedList (boostingId) = endedList(boostingId) | |
118 | - | ||
119 | - | ||
120 | - | ||
121 | - | @Callable(i) | |
122 | - | func getList () = { | |
123 | - | func f (accum,next) = { | |
124 | - | let in = invoke(this, "getEndedList", [next], nil) | |
125 | - | if ((in == in)) | |
126 | - | then in | |
127 | - | else throw("Strict value is not equal to itself.") | |
128 | - | } | |
129 | - | ||
130 | - | let end = { | |
131 | - | let $l = li | |
132 | - | let $s = size($l) | |
133 | - | let $acc0 = 0 | |
134 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | - | then $a | |
136 | - | else f($a, $l[$i]) | |
137 | - | ||
138 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | - | then $a | |
140 | - | else throw("List size exceeds 100") | |
141 | - | ||
142 | - | $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($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($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($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($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($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($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), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100) | |
143 | - | } | |
144 | - | if ((end == end)) | |
145 | - | then nil | |
146 | - | else throw("Strict value is not equal to itself.") | |
33 | + | let firstOfList = list[0] | |
34 | + | nil | |
147 | 35 | } | |
148 | 36 | ||
149 | 37 |
github/deemru/w8io/169f3d6 34.68 ms ◑