tx · 7wux38rZdW27DZqpVSCdLyUnKf1Vz96ST24zmTKrf1Cr

3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez:  -0.00700000 Waves

2023.11.08 11:30 [2834143] smart account 3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez > SELF 0.00000000 Waves

{ "type": 13, "id": "7wux38rZdW27DZqpVSCdLyUnKf1Vz96ST24zmTKrf1Cr", "fee": 700000, "feeAssetId": null, "timestamp": 1699432229642, "version": 2, "chainId": 84, "sender": "3MqEAEVk1NcbRAuEPAX7nyzUqMHbhvRofez", "senderPublicKey": "Brp6cacBXyKUcZr5Uc6VDKsnFcaEeQ8nQzrZQyobDsuf", "proofs": [ "2X2cxDYmnE7YxhEXL5NSvo636KAerW84iopK6269X8kpt2yk4jWGQHLiGQDtrD9FysGieWvk3kBjBd5TG489FM7C" ], "script": "base64:BgIYCAISBAoCCAESAwoBCBIAEgMKAQgSABIACQACbGkJAMwIAgIBMQkAzAgCAgEyCQDMCAICATMJAMwIAgIBNAkAzAgCAgE1CQDMCAICATYJAMwIAgIBNwkAzAgCAgE4CQDMCAICATkJAMwIAgICMTAJAMwIAgICMTEJAMwIAgICMTIJAMwIAgICMTMJAMwIAgICMTQJAMwIAgICMTUJAMwIAgICMTYJAMwIAgICMTcJAMwIAgICMTgJAMwIAgICMTkJAMwIAgICMjAJAMwIAgICMjEJAMwIAgICMjIJAMwIAgICMjMJAMwIAgICMjQJAMwIAgICMjUJAMwIAgICMjYJAMwIAgICMjcJAMwIAgICMjgJAMwIAgICMjkJAMwIAgICMzAJAMwIAgICMzEJAMwIAgICMzIJAMwIAgICMzMJAMwIAgICMzQJAMwIAgICMzUJAMwIAgICMzYJAMwIAgICMzcJAMwIAgICMzgJAMwIAgICMzkJAMwIAgICNDAJAMwIAgICNDEJAMwIAgICNDIJAMwIAgICNDMJAMwIAgICNDQJAMwIAgICNDUJAMwIAgICNDYJAMwIAgICNDcJAMwIAgICNDgJAMwIAgICNDkJAMwIAgIC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ABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQAFQAWABcAGAAZABoAGwAcAB0AHgAfACAAIQAiACMAJAAlACYAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgDCQAAAgUDZW5kBQNlbmQJAMwIAgkBDEludGVnZXJFbnRyeQICBmhlaWdodAUGaGVpZ2h0BQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEUZmlyc3RFbmRlZEJvb3N0aW5nSWQABAhTdHJWYWx1ZQkArwICCQEMdHJ5R2V0U3RyaW5nAQkArAICCQCsAgICC2xpc3QgZW5kZWQgCQCkAwEFBmhlaWdodAIMIGJvb3N0aW5nSWRzAAEJAMwIAgkBC1N0cmluZ0VudHJ5AgIFZmlyc3QFCFN0clZhbHVlBQNuaWwAUgGGoA==", "height": 2834143, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4MGF2L8p4r6Xqb6SH3B8jxrvErdFCno9qmR5LgQ4EEfh Next: ABZJApoav1djP3Q64dvmHhpTDBBHf38dSLwmbhoBPpAx Diff:
OldNewDifferences
8585 let get = invoke(this, "firstEndedBoostingId", nil, nil)
8686 if ((get == get))
8787 then {
88- let boostingId = toString(tryGetInteger("first"))
88+ let boostingId = tryGetString("first")
8989 if ((addressFromString(poolId) == unit))
9090 then throw("incorrect pool address")
9191 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) + ","))]
171171
172172 @Callable(i)
173173 func firstEndedBoostingId () = {
174- func fold (accum,next) = (accum :+ parseIntValue(next))
175-
176- let StringValue = dropRight(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1)
177- let list = {
178- let $l = split_4C(StringValue, ",")
179- let $s = size($l)
180- let $acc0 = nil
181- func $f0_1 ($a,$i) = if (($i >= $s))
182- then $a
183- else fold($a, $l[$i])
184-
185- func $f0_2 ($a,$i) = if (($i >= $s))
186- then $a
187- else throw("List size exceeds 56")
188-
189- $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)
190- }
191- let firstOfList = list[0]
192-[IntegerEntry("first", firstOfList)]
174+ let StrValue = take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1)
175+[StringEntry("first", StrValue)]
193176 }
194177
195178
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 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"]
55
66 let hours = 1
77
88 let minutes = 10
99
1010 func tryGetInteger (key) = match getInteger(this, key) {
1111 case b: Int =>
1212 b
1313 case _ =>
1414 0
1515 }
1616
1717
1818 func tryGetString (key) = match getString(this, key) {
1919 case b: String =>
2020 b
2121 case _ =>
2222 ""
2323 }
2424
2525
2626 func getAssetString (assetId) = match assetId {
2727 case b: ByteVector =>
2828 toBase58String(b)
2929 case _ =>
3030 "WAVES"
3131 }
3232
3333
3434 func getAssetBytes (assetIdStr) = if ((assetIdStr == "WAVES"))
3535 then unit
3636 else fromBase58String(assetIdStr)
3737
3838
3939 func payBoostingResult (boostingId) = {
4040 let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight"))
4141 let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight"))
4242 let getFinishedPoolId = tryGetString((("boosting_" + boostingId) + "_poolId"))
4343 let getPoolBoostings = dropRight(tryGetString((("pool_" + getFinishedPoolId) + "_boostings")), 1)
4444 let findIndex = value(indexOf(getPoolBoostings, boostingId))
4545 if (if ((lastHeight != 0))
4646 then (finishHeight > lastHeight)
4747 else false)
4848 then {
4949 let blockReward = (tryGetInteger((("boosting_" + boostingId) + "_totalAmount")) / ((tryGetInteger((("boosting_" + boostingId) + "_days")) * hours) * minutes))
5050 let toPay = fraction((min([finishHeight, height]) - lastHeight), blockReward, 1)
5151 [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)]
5252 }
5353 else nil
5454 }
5555
5656
5757 func endedBoostingIds (boostingId) = {
5858 let lastHeight = tryGetInteger((("boosting_" + boostingId) + "_lastHeight"))
5959 let finishHeight = tryGetInteger((("boosting_" + boostingId) + "_finishHeight"))
6060 if ((lastHeight >= finishHeight))
6161 then [StringEntry((("list ended " + toString(height)) + " boostingIds"), ((tryGetString((("list ended " + toString(height)) + " boostingIds")) + boostingId) + ","))]
6262 else nil
6363 }
6464
6565
6666 @Callable(i)
6767 func addBoosting (poolId,days) = if ((1 > days))
6868 then throw("amount of days has to be between 1 and 365")
6969 else if ((days > 365))
7070 then throw("amount of days has to be between 1 and 365")
7171 else if (false)
7272 then throw("under maintenance until further notice")
7373 else {
7474 let fullAmount = i.payments[0].amount
7575 if ((1440 > (fullAmount / days)))
7676 then throw((("boosting amount too small, minimum is " + toString((1440 * days))) + " of the smallest unit of payment asset"))
7777 else {
7878 let assetId = getAssetString(i.payments[0].assetId)
7979 if ((height == tryGetInteger("height")))
8080 then throw("wait 1 minute")
8181 else {
8282 let entry = invoke(this, "entryEnded", nil, nil)
8383 if ((entry == entry))
8484 then {
8585 let get = invoke(this, "firstEndedBoostingId", nil, nil)
8686 if ((get == get))
8787 then {
88- let boostingId = toString(tryGetInteger("first"))
88+ let boostingId = tryGetString("first")
8989 if ((addressFromString(poolId) == unit))
9090 then throw("incorrect pool address")
9191 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) + ","))]
9292 }
9393 else throw("Strict value is not equal to itself.")
9494 }
9595 else throw("Strict value is not equal to itself.")
9696 }
9797 }
9898 }
9999
100100
101101
102102 @Callable(i)
103103 func payBoosting (boostingId) = payBoostingResult(boostingId)
104104
105105
106106
107107 @Callable(i)
108108 func payBoostings () = {
109109 func f (accum,next) = {
110110 let in = invoke(this, "payBoosting", [next], nil)
111111 if ((in == in))
112112 then in
113113 else throw("Strict value is not equal to itself.")
114114 }
115115
116116 let payments = {
117117 let $l = li
118118 let $s = size($l)
119119 let $acc0 = 0
120120 func $f0_1 ($a,$i) = if (($i >= $s))
121121 then $a
122122 else f($a, $l[$i])
123123
124124 func $f0_2 ($a,$i) = if (($i >= $s))
125125 then $a
126126 else throw("List size exceeds 56")
127127
128128 $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)
129129 }
130130 if ((payments == payments))
131131 then nil
132132 else throw("Strict value is not equal to itself.")
133133 }
134134
135135
136136
137137 @Callable(i)
138138 func endedBoostings (boostingId) = endedBoostingIds(boostingId)
139139
140140
141141
142142 @Callable(i)
143143 func entryEnded () = {
144144 func f (accum,next) = {
145145 let in = invoke(this, "endedBoostings", [next], nil)
146146 if ((in == in))
147147 then in
148148 else throw("Strict value is not equal to itself.")
149149 }
150150
151151 let end = {
152152 let $l = li
153153 let $s = size($l)
154154 let $acc0 = 0
155155 func $f0_1 ($a,$i) = if (($i >= $s))
156156 then $a
157157 else f($a, $l[$i])
158158
159159 func $f0_2 ($a,$i) = if (($i >= $s))
160160 then $a
161161 else throw("List size exceeds 56")
162162
163163 $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)
164164 }
165165 if ((end == end))
166166 then [IntegerEntry("height", height)]
167167 else throw("Strict value is not equal to itself.")
168168 }
169169
170170
171171
172172 @Callable(i)
173173 func firstEndedBoostingId () = {
174- func fold (accum,next) = (accum :+ parseIntValue(next))
175-
176- let StringValue = dropRight(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1)
177- let list = {
178- let $l = split_4C(StringValue, ",")
179- let $s = size($l)
180- let $acc0 = nil
181- func $f0_1 ($a,$i) = if (($i >= $s))
182- then $a
183- else fold($a, $l[$i])
184-
185- func $f0_2 ($a,$i) = if (($i >= $s))
186- then $a
187- else throw("List size exceeds 56")
188-
189- $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)
190- }
191- let firstOfList = list[0]
192-[IntegerEntry("first", firstOfList)]
174+ let StrValue = take(tryGetString((("list ended " + toString(height)) + " boostingIds")), 1)
175+[StringEntry("first", StrValue)]
193176 }
194177
195178

github/deemru/w8io/026f985 
101.59 ms