tx · 3EDoMavUgGSjtjUoh3YWjn6298Mjc6E92hgD6eR7RNL3 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez: -0.00800000 Waves 2023.11.08 12:20 [2834192] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves
{ "type": 13, "id": "3EDoMavUgGSjtjUoh3YWjn6298Mjc6E92hgD6eR7RNL3", "fee": 800000, "feeAssetId": null, "timestamp": 1699435287373, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "4wYueUj3U2KXdeeuRK6NFk9DrooeoDphsFhWCJkHb1cfgNL4JxtVLLX1YBkTLS3VmqFq4c953L4T1JtRb7uuuMD" ], "script": "base64:BgIbCAISBAoCCAESAwoBCBIAEgMKAQgSABIDCgEICQACbGkJAMwIAgIBMQkAzAgCAgEyCQDMCAICATMJAMwIAgIBNAkAzAgCAgE1CQDMCAICATYJAMwIAgIBNwkAzAgCAgE4CQDMCAICATkJAMwIAgICMTAJAMwIAgICMTEJAMwIAgICMTIJAMwIAgICMTMJAMwIAgICMTQJAMwIAgICMTUJAMwIAgICMTYJAMwIAgICMTcJAMwIAgICMTgJAMwIAgICMTkJAMwIAgICMjAJAMwIAgICMjEJAMwIAgICMjIJAMwIAgICMjMJAMwIAgICMjQJAMwIAgICMjUJAMwIAgICMjYJAMwIAgICMjcJAMwIAgICMjgJAMwIAgICMjkJAMwIAgICMzAJAMwIAgICMzEJAMwIAgICMzIJAMwIAgICMzMJAMwIAgICMzQJAMwIAgICMzUJAMwIAgICMzYJAMwIAgICMzcJAMwIAgICMzgJAMwIAgICMzkJAMwIAgICNDAJAMwIAgICNDEJAMwIAgICNDIJAMwIAgICNDMJAMwIAgICNDQJAMwIAgICNDUJAMwIAgICNDYJAMwIAgICNDcJAMwIAgICNDgJAMwIAgICNDk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FjYzAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgDCQAAAgUDZW5kBQNlbmQJAMwIAgkBDEludGVnZXJFbnRyeQICBmhlaWdodAUGaGVpZ2h0BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEKZGVsZXRlRW50cgEGcG9vbElkCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgVwb29sXwUGcG9vbElkAgpfYm9vc3RpbmdzBQNuaWwADCUY9w==", "height": 2834192, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AG4uBoCjs4TNUi2No4zSUyZQKerKBRh1oJqUrV7fqZ8z Next: FWud1Dwk6YnPfNiqGFX9tvcMKtSVPK5br8CirJduDHXe Diff:
Old | New | Differences | |
---|---|---|---|
50 | 50 | then { | |
51 | 51 | let blockReward = (tryGetInteger((("boosting_" + boostingId) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
52 | 52 | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 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)] | |
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 | 54 | } | |
55 | 55 | else nil | |
56 | 56 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 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 | 5 | ||
6 | 6 | let hours = 1 | |
7 | 7 | ||
8 | 8 | let minutes = 10 | |
9 | 9 | ||
10 | 10 | func tryGetInteger (key) = match getInteger(this, key) { | |
11 | 11 | case b: Int => | |
12 | 12 | b | |
13 | 13 | case _ => | |
14 | 14 | 0 | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func tryGetString (key) = match getString(this, key) { | |
19 | 19 | case b: String => | |
20 | 20 | b | |
21 | 21 | case _ => | |
22 | 22 | "" | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getAssetString (assetId) = match assetId { | |
27 | 27 | case b: ByteVector => | |
28 | 28 | toBase58String(b) | |
29 | 29 | case _ => | |
30 | 30 | "WAVES" | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES")) | |
35 | 35 | then unit | |
36 | 36 | else fromBase58String(assetIdStr) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func payBoostingResult (boostingId) = { | |
40 | 40 | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
41 | 41 | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
42 | 42 | let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId")) | |
43 | 43 | let getPoolBoostings = tryGetString((("pool_" + getFinishedPoolId) + "_boostings")) | |
44 | 44 | let sizeStr = size(getPoolBoostings) | |
45 | 45 | let findIndex = value(indexOf(getPoolBoostings, boostingId)) | |
46 | 46 | let removeEndedBoostingID = (take(getPoolBoostings, (sizeStr - (sizeStr - findIndex))) + takeRight(getPoolBoostings, (sizeStr - (findIndex + 1)))) | |
47 | 47 | if (if ((lastHeight != 0)) | |
48 | 48 | then (finishHeight > lastHeight) | |
49 | 49 | else false) | |
50 | 50 | then { | |
51 | 51 | let blockReward = (tryGetInteger((("boosting_" + boostingId) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes)) | |
52 | 52 | let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 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)] | |
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 | 54 | } | |
55 | 55 | else nil | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func endedBoostingIds (boostingId) = { | |
60 | 60 | let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight")) | |
61 | 61 | let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight")) | |
62 | 62 | if ((lastHeight >= finishHeight)) | |
63 | 63 | then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
64 | 64 | else [StringEntry((("list ongoing boosts " + toString(height)) + " boostingIds"), ((tryGetString((("list ongoing boosts " + toString(height)) + " boostingIds")) + boostingId) + ","))] | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(i) | |
69 | 69 | func addBoosting (poolId,days) = if ((1 > days)) | |
70 | 70 | then throw("amount of days has to be between 1 and 365") | |
71 | 71 | else if ((days > 365)) | |
72 | 72 | then throw("amount of days has to be between 1 and 365") | |
73 | 73 | else if (false) | |
74 | 74 | then throw("under maintenance until further notice") | |
75 | 75 | else { | |
76 | 76 | let fullAmount = i.payments[0].amount | |
77 | 77 | if ((1440 > (fullAmount / days))) | |
78 | 78 | then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset")) | |
79 | 79 | else { | |
80 | 80 | let assetId = getAssetString(i.payments[0].assetId) | |
81 | 81 | if ((height == tryGetInteger("height"))) | |
82 | 82 | then throw("wait 1 minute") | |
83 | 83 | else { | |
84 | 84 | let entry = if ((size(tryGetString((("pool_" + poolId) + "_boostings"))) > 11)) | |
85 | 85 | then throw("max 5 boosts per pool") | |
86 | 86 | else invoke(this, "entryEnded", nil, nil) | |
87 | 87 | if ((entry == entry)) | |
88 | 88 | then { | |
89 | 89 | let boostingId = if ((size((("list ongoing boosts " + toString(height)) + " boostingIds")) > 3)) | |
90 | 90 | then throw("wait till other boosts are finished") | |
91 | 91 | else take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1) | |
92 | 92 | if ((addressFromString(poolId) == unit)) | |
93 | 93 | then throw("incorrect pool address") | |
94 | 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 | 95 | } | |
96 | 96 | else throw("Strict value is not equal to itself.") | |
97 | 97 | } | |
98 | 98 | } | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(i) | |
104 | 104 | func payBoosting (boostingId) = payBoostingResult(boostingId) | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | ||
108 | 108 | @Callable(i) | |
109 | 109 | func payBoostings () = { | |
110 | 110 | func f (accum,next) = { | |
111 | 111 | let in = invoke(this, "payBoosting", [next], nil) | |
112 | 112 | if ((in == in)) | |
113 | 113 | then in | |
114 | 114 | else throw("Strict value is not equal to itself.") | |
115 | 115 | } | |
116 | 116 | ||
117 | 117 | let payments = { | |
118 | 118 | let $l = li | |
119 | 119 | let $s = size($l) | |
120 | 120 | let $acc0 = 0 | |
121 | 121 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
122 | 122 | then $a | |
123 | 123 | else f($a, $l[$i]) | |
124 | 124 | ||
125 | 125 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
126 | 126 | then $a | |
127 | 127 | else throw("List size exceeds 56") | |
128 | 128 | ||
129 | 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 | 130 | } | |
131 | 131 | if ((payments == payments)) | |
132 | 132 | then nil | |
133 | 133 | else throw("Strict value is not equal to itself.") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(i) | |
139 | 139 | func endedBoostings (boostingId) = endedBoostingIds(boostingId) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | ||
143 | 143 | @Callable(i) | |
144 | 144 | func entryEnded () = { | |
145 | 145 | func f (accum,next) = { | |
146 | 146 | let in = invoke(this, "endedBoostings", [next], nil) | |
147 | 147 | if ((in == in)) | |
148 | 148 | then in | |
149 | 149 | else throw("Strict value is not equal to itself.") | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | let end = { | |
153 | 153 | let $l = li | |
154 | 154 | let $s = size($l) | |
155 | 155 | let $acc0 = 0 | |
156 | 156 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | 157 | then $a | |
158 | 158 | else f($a, $l[$i]) | |
159 | 159 | ||
160 | 160 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | 161 | then $a | |
162 | 162 | else throw("List size exceeds 56") | |
163 | 163 | ||
164 | 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 | 165 | } | |
166 | 166 | if ((end == end)) | |
167 | 167 | then [IntegerEntry("height", height)] | |
168 | 168 | else throw("Strict value is not equal to itself.") | |
169 | 169 | } | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | ||
173 | 173 | @Callable(i) | |
174 | 174 | func deleteEntr (poolId) = [DeleteEntry((("pool_" + poolId) + "_boostings"))] | |
175 | 175 | ||
176 | 176 |
github/deemru/w8io/026f985 53.58 ms ◑