tx · 6wt8HkEaoY6Jg2sUwNatpiX5v8cB8Q4XP9kRRXXQgq5j 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00100000 Waves 2023.11.09 15:25 [2835806] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "6wt8HkEaoY6Jg2sUwNatpiX5v8cB8Q4XP9kRRXXQgq5j", "fee": 100000, "feeAssetId": null, "timestamp": 1699532713148, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "3CpfLdj9PEosvWy3bgCsyWTarnbZJjXqzEZ72xxbGhkd8tmguLCwSZHSqbPwtjrDxMT6pEprZxZfLc1JFhaReTqS" ], "script": "base64:BgIECAISAAIBDXRyeUdldEludGVnZXIBA2tleQQHJG1hdGNoMAkAmggCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIDSW50BAFiBQckbWF0Y2gwBQFiAAABDHRyeUdldFN0cmluZwEDa2V5BAckbWF0Y2gwCQCdCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAWIFByRtYXRjaDAFAWICAAEBaQEIcmVnaXN0ZXIACQDMCAIJAQxJbnRlZ2VyRW50cnkCAhFBbW91bnQgUmVnaXN0ZXJlZAkAZAIJAQ10cnlHZXRJbnRlZ2VyAQIRQW1vdW50IFJlZ2lzdGVyZWQAAQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgICEFJlZ2lzdGVyIGFkZHJlc3MJAKQDAQkAZAIJAQ10cnlHZXRJbnRlZ2VyAQIRQW1vdW50IFJlZ2lzdGVyZWQAAQkApQgBCAUBaQZjYWxsZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQClCAEIBQFpBmNhbGxlcgISQWRkcmVzcyByZWdpc3RlcmVkCQClCAEIBQFpBmNhbGxlcgUDbmlsAJgvjlM=", "height": 2835806, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H3Mm9JdSBucVBsB4ppr9rA1Ne1Nk2iGUBpoR7C5qxZpK Next: ArbuQpGVzN7qbX8C5Nfc2BmGyLHp6ZoFR1mfnjYHCngf Diff:
Old | New | Differences | |
---|---|---|---|
1 | 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 | 4 | func tryGetInteger (key) = match getInteger(this, key) { | |
11 | 5 | case b: Int => | |
12 | 6 | b | |
23 | 17 | } | |
24 | 18 | ||
25 | 19 | ||
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) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
47 | - | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 1) | |
48 | - | let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
49 | - | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId) + "_boostings")) | |
50 | - | let sizeStr = size(getPoolBoostings) | |
51 | - | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
52 | - | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - (sizeStr - findIndex))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))) | |
53 | - | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId")))), StringEntry("getFinishedPoolId", getFinishedPoolId), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))), StringEntry((("pool_" + getFinishedPoolId) + "_boostings"), removeEndedBoostingID)] | |
54 | - | } | |
55 | - | else nil | |
56 | - | } | |
57 | - | ||
58 | - | ||
59 | - | func endedBoostingIds (boostingId) = { | |
60 | - | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
61 | - | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
62 | - | if ((lastHeight >= finishHeight)) | |
63 | - | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
64 | - | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((tryGetString((("list ongoing boosts " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
65 | - | } | |
66 | - | ||
67 | - | ||
68 | 20 | @Callable(i) | |
69 | - | func addBoosting (poolId,days) = if ((1 > days)) | |
70 | - | then throw("amount of days has to be between 1 and 365") | |
71 | - | else if ((days > 365)) | |
72 | - | then throw("amount of days has to be between 1 and 365") | |
73 | - | else if (false) | |
74 | - | then throw("under maintenance until further notice") | |
75 | - | else { | |
76 | - | let fullAmount = i.payments[0].amount | |
77 | - | if ((1440 > (fullAmount / days))) | |
78 | - | then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset")) | |
79 | - | else { | |
80 | - | let assetId = getAssetString(i.payments[0].assetId) | |
81 | - | if ((height == tryGetInteger("height"))) | |
82 | - | then throw("wait 1 minute") | |
83 | - | else { | |
84 | - | let entry = if ((size(tryGetString((("pool_" + poolId) + "_boostings"))) > 11)) | |
85 | - | then throw("max 5 boosts per pool") | |
86 | - | else invoke(this, "entryEnded", nil, nil) | |
87 | - | if ((entry == entry)) | |
88 | - | then { | |
89 | - | let boostingId = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 112)) | |
90 | - | then throw("wait till other boosts are finished") | |
91 | - | else take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1) | |
92 | - | if ((addressFromString(poolId) == unit)) | |
93 | - | then throw("incorrect pool address") | |
94 | - | else [IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), 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) + ","))] | |
95 | - | } | |
96 | - | else throw("Strict value is not equal to itself.") | |
97 | - | } | |
98 | - | } | |
99 | - | } | |
100 | - | ||
101 | - | ||
102 | - | ||
103 | - | @Callable(i) | |
104 | - | func payBoosting (boostingId) = payBoostingResult(boostingId) | |
105 | - | ||
106 | - | ||
107 | - | ||
108 | - | @Callable(i) | |
109 | - | func payBoostings () = { | |
110 | - | func f (accum,next) = { | |
111 | - | let in = invoke(this, "payBoosting", [next], nil) | |
112 | - | if ((in == in)) | |
113 | - | then in | |
114 | - | else throw("Strict value is not equal to itself.") | |
115 | - | } | |
116 | - | ||
117 | - | let payments = { | |
118 | - | let $l = li | |
119 | - | let $s = size($l) | |
120 | - | let $acc0 = 0 | |
121 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
122 | - | then $a | |
123 | - | else f($a, $l[$i]) | |
124 | - | ||
125 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
126 | - | then $a | |
127 | - | else throw("List size exceeds 56") | |
128 | - | ||
129 | - | $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($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) | |
130 | - | } | |
131 | - | if ((payments == payments)) | |
132 | - | then nil | |
133 | - | else throw("Strict value is not equal to itself.") | |
134 | - | } | |
135 | - | ||
136 | - | ||
137 | - | ||
138 | - | @Callable(i) | |
139 | - | func endedBoostings (boostingId) = endedBoostingIds(boostingId) | |
140 | - | ||
141 | - | ||
142 | - | ||
143 | - | @Callable(i) | |
144 | - | func entryEnded () = { | |
145 | - | func f (accum,next) = { | |
146 | - | let in = invoke(this, "endedBoostings", [next], nil) | |
147 | - | if ((in == in)) | |
148 | - | then in | |
149 | - | else throw("Strict value is not equal to itself.") | |
150 | - | } | |
151 | - | ||
152 | - | let end = { | |
153 | - | let $l = li | |
154 | - | let $s = size($l) | |
155 | - | let $acc0 = 0 | |
156 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | - | then $a | |
158 | - | else f($a, $l[$i]) | |
159 | - | ||
160 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | - | then $a | |
162 | - | else throw("List size exceeds 56") | |
163 | - | ||
164 | - | $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($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) | |
165 | - | } | |
166 | - | if ((end == end)) | |
167 | - | then [IntegerEntry("height", height)] | |
168 | - | else throw("Strict value is not equal to itself.") | |
169 | - | } | |
170 | - | ||
171 | - | ||
172 | - | ||
173 | - | @Callable(i) | |
174 | - | func deleteEntr (poolId) = [DeleteEntry((("pool_" + poolId) + "_boostings"))] | |
175 | - | ||
176 | - | ||
177 | - | ||
178 | - | @Callable(i) | |
179 | - | func checkStr (boostingId) = { | |
180 | - | let getFinishedPoolId1 = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
181 | - | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId1) + "_boostings")) | |
182 | - | let sizeStr = size(getPoolBoostings) | |
183 | - | if ((indexOf(getPoolBoostings, boostingId) == unit)) | |
184 | - | then nil | |
185 | - | else { | |
186 | - | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
187 | - | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - (sizeStr - findIndex))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))) | |
188 | - | [StringEntry("getFinishedPoolId", getFinishedPoolId1), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + 2)))), StringEntry((("pool_" + getFinishedPoolId1) + "_boostings"), removeEndedBoostingID)] | |
189 | - | } | |
190 | - | } | |
21 | + | func register () = [IntegerEntry("Amount Registered", (tryGetInteger("Amount Registered") + 1)), StringEntry(("Register address" + toString((tryGetInteger("Amount Registered") + 1))), toString(i.caller)), StringEntry((toString(i.caller) + "Address registered"), toString(i.caller))] | |
191 | 22 | ||
192 | 23 |
Old | New | Differences | |
---|---|---|---|
1 | 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 | 4 | func tryGetInteger (key) = match getInteger(this, key) { | |
11 | 5 | case b: Int => | |
12 | 6 | b | |
13 | 7 | case _ => | |
14 | 8 | 0 | |
15 | 9 | } | |
16 | 10 | ||
17 | 11 | ||
18 | 12 | func tryGetString (key) = match getString(this, key) { | |
19 | 13 | case b: String => | |
20 | 14 | b | |
21 | 15 | case _ => | |
22 | 16 | "" | |
23 | 17 | } | |
24 | 18 | ||
25 | 19 | ||
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) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
47 | - | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 1) | |
48 | - | let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
49 | - | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId) + "_boostings")) | |
50 | - | let sizeStr = size(getPoolBoostings) | |
51 | - | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
52 | - | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - (sizeStr - findIndex))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))) | |
53 | - | [IntegerEntry((("boosting_" + boostingId) + "_lastHeight"), height), ScriptTransfer(addressFromStringValue(tryGetString((("boosting_" + boostingId) + "_poolId"))), toPay, getAssetBytes(tryGetString((("boosting_" + boostingId) + "_assetId")))), StringEntry("getFinishedPoolId", getFinishedPoolId), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))), StringEntry((("pool_" + getFinishedPoolId) + "_boostings"), removeEndedBoostingID)] | |
54 | - | } | |
55 | - | else nil | |
56 | - | } | |
57 | - | ||
58 | - | ||
59 | - | func endedBoostingIds (boostingId) = { | |
60 | - | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
61 | - | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
62 | - | if ((lastHeight >= finishHeight)) | |
63 | - | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
64 | - | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((tryGetString((("list ongoing boosts " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
65 | - | } | |
66 | - | ||
67 | - | ||
68 | 20 | @Callable(i) | |
69 | - | func addBoosting (poolId,days) = if ((1 > days)) | |
70 | - | then throw("amount of days has to be between 1 and 365") | |
71 | - | else if ((days > 365)) | |
72 | - | then throw("amount of days has to be between 1 and 365") | |
73 | - | else if (false) | |
74 | - | then throw("under maintenance until further notice") | |
75 | - | else { | |
76 | - | let fullAmount = i.payments[0].amount | |
77 | - | if ((1440 > (fullAmount / days))) | |
78 | - | then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset")) | |
79 | - | else { | |
80 | - | let assetId = getAssetString(i.payments[0].assetId) | |
81 | - | if ((height == tryGetInteger("height"))) | |
82 | - | then throw("wait 1 minute") | |
83 | - | else { | |
84 | - | let entry = if ((size(tryGetString((("pool_" + poolId) + "_boostings"))) > 11)) | |
85 | - | then throw("max 5 boosts per pool") | |
86 | - | else invoke(this, "entryEnded", nil, nil) | |
87 | - | if ((entry == entry)) | |
88 | - | then { | |
89 | - | let boostingId = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 112)) | |
90 | - | then throw("wait till other boosts are finished") | |
91 | - | else take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1) | |
92 | - | if ((addressFromString(poolId) == unit)) | |
93 | - | then throw("incorrect pool address") | |
94 | - | else [IntegerEntry((("boosting_" + boostingId) + "_days"), days), IntegerEntry((("boosting_" + boostingId) + "_totalAmount"), fullAmount), IntegerEntry((("boosting_" + boostingId) + "_dailyAmount"), (fullAmount / days)), 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) + ","))] | |
95 | - | } | |
96 | - | else throw("Strict value is not equal to itself.") | |
97 | - | } | |
98 | - | } | |
99 | - | } | |
100 | - | ||
101 | - | ||
102 | - | ||
103 | - | @Callable(i) | |
104 | - | func payBoosting (boostingId) = payBoostingResult(boostingId) | |
105 | - | ||
106 | - | ||
107 | - | ||
108 | - | @Callable(i) | |
109 | - | func payBoostings () = { | |
110 | - | func f (accum,next) = { | |
111 | - | let in = invoke(this, "payBoosting", [next], nil) | |
112 | - | if ((in == in)) | |
113 | - | then in | |
114 | - | else throw("Strict value is not equal to itself.") | |
115 | - | } | |
116 | - | ||
117 | - | let payments = { | |
118 | - | let $l = li | |
119 | - | let $s = size($l) | |
120 | - | let $acc0 = 0 | |
121 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
122 | - | then $a | |
123 | - | else f($a, $l[$i]) | |
124 | - | ||
125 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
126 | - | then $a | |
127 | - | else throw("List size exceeds 56") | |
128 | - | ||
129 | - | $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($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) | |
130 | - | } | |
131 | - | if ((payments == payments)) | |
132 | - | then nil | |
133 | - | else throw("Strict value is not equal to itself.") | |
134 | - | } | |
135 | - | ||
136 | - | ||
137 | - | ||
138 | - | @Callable(i) | |
139 | - | func endedBoostings (boostingId) = endedBoostingIds(boostingId) | |
140 | - | ||
141 | - | ||
142 | - | ||
143 | - | @Callable(i) | |
144 | - | func entryEnded () = { | |
145 | - | func f (accum,next) = { | |
146 | - | let in = invoke(this, "endedBoostings", [next], nil) | |
147 | - | if ((in == in)) | |
148 | - | then in | |
149 | - | else throw("Strict value is not equal to itself.") | |
150 | - | } | |
151 | - | ||
152 | - | let end = { | |
153 | - | let $l = li | |
154 | - | let $s = size($l) | |
155 | - | let $acc0 = 0 | |
156 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | - | then $a | |
158 | - | else f($a, $l[$i]) | |
159 | - | ||
160 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | - | then $a | |
162 | - | else throw("List size exceeds 56") | |
163 | - | ||
164 | - | $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($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) | |
165 | - | } | |
166 | - | if ((end == end)) | |
167 | - | then [IntegerEntry("height", height)] | |
168 | - | else throw("Strict value is not equal to itself.") | |
169 | - | } | |
170 | - | ||
171 | - | ||
172 | - | ||
173 | - | @Callable(i) | |
174 | - | func deleteEntr (poolId) = [DeleteEntry((("pool_" + poolId) + "_boostings"))] | |
175 | - | ||
176 | - | ||
177 | - | ||
178 | - | @Callable(i) | |
179 | - | func checkStr (boostingId) = { | |
180 | - | let getFinishedPoolId1 = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
181 | - | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId1) + "_boostings")) | |
182 | - | let sizeStr = size(getPoolBoostings) | |
183 | - | if ((indexOf(getPoolBoostings, boostingId) == unit)) | |
184 | - | then nil | |
185 | - | else { | |
186 | - | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
187 | - | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - (sizeStr - findIndex))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))) | |
188 | - | [StringEntry("getFinishedPoolId", getFinishedPoolId1), StringEntry("getPoolBoostings", getPoolBoostings), IntegerEntry("findIndex", findIndex), IntegerEntry("sizeStr", sizeStr), StringEntry("left string", take(getPoolBoostings, (sizeStr - (sizeStr - findIndex)))), StringEntry("right string", takeRight(getPoolBoostings, (sizeStr - (findIndex + 2)))), StringEntry((("pool_" + getFinishedPoolId1) + "_boostings"), removeEndedBoostingID)] | |
189 | - | } | |
190 | - | } | |
21 | + | func register () = [IntegerEntry("Amount Registered", (tryGetInteger("Amount Registered") + 1)), StringEntry(("Register address" + toString((tryGetInteger("Amount Registered") + 1))), toString(i.caller)), StringEntry((toString(i.caller) + "Address registered"), toString(i.caller))] | |
191 | 22 | ||
192 | 23 |
github/deemru/w8io/026f985 59.76 ms ◑