tx · FtC6vZ9Qf14HLwX56gyeaX6mayYHZA7E9KGbf3AVtYHN

3N3RjwfE3DxSbC9qTP8wwZynUSpxWEzmWqF:  -0.01000000 Waves

2023.08.21 18:58 [2720584] smart account 3N3RjwfE3DxSbC9qTP8wwZynUSpxWEzmWqF > SELF 0.00000000 Waves

{ "type": 13, "id": "FtC6vZ9Qf14HLwX56gyeaX6mayYHZA7E9KGbf3AVtYHN", "fee": 1000000, "feeAssetId": null, "timestamp": 1692633546801, "version": 2, "chainId": 84, "sender": "3N3RjwfE3DxSbC9qTP8wwZynUSpxWEzmWqF", "senderPublicKey": "9eruQ7h8XgHQRMnKTNw2tWZDTUGNaE4GMMBMEPaS2Vmr", "proofs": [ "5zBQUi88s8Cibxoxzk8z7rGTzTvZYtMDaveXnRjTFqSZbFwdHDAGaCTemWD6k8Sp2va4bHbdYfdRgjupJqaUBVy8" ], "script": "base64:BgIHCAISAwoBAQABAWkBA2ZvbwEJaXRlcmF0aW9uAwkAZgIFCWl0ZXJhdGlvbgAABANyZXMJAP0HBAUEdGhpcwIDZm9vCQDMCAIJAGUCBQlpdGVyYXRpb24AAQUDbmlsBQNuaWwDCQAAAgUDcmVzBQNyZXMJAMwIAgkBDEludGVnZXJFbnRyeQICBXZhbHVlBQlpdGVyYXRpb24FA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgUDbmlsALRQqQo=", "height": 2720584, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 62MyNCNJ3eXHTGrZQVhgwfZssCjh3ukfTo9JKENSwbEw Next: 6UN4HGx9CCwpXXq7JAfHKL1diMTQHvVGc945grbZLBpJ Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let separator = "/"
5-
6-let kLastIterationLen = "lastIterationLen"
7-
8-let kIterationsCount = "iterationsCount"
9-
10-let kIncrementCounter = "incrementCounter"
11-
12-let kCurrentBalance = "currentBalance"
13-
14-let kIsActive = "isActive"
15-
16-let MAX_INCREMENT = 96
17-
18-let currentLastIterationLen = valueOrErrorMessage(getInteger(this, kLastIterationLen), "Last iteration store read error")
19-
20-let currentIterationsCount = valueOrErrorMessage(getInteger(this, kIterationsCount), "Iteration store read error")
21-
22-let currentIncrementCounter = valueOrErrorMessage(getInteger(this, kIncrementCounter), "Increment store read error")
23-
24-let currentBalance = valueOrErrorMessage(getInteger(this, kCurrentBalance), "Balance store read error")
25-
26-let range = valueOrErrorMessage(getInteger(this, "usersCounter"), "Range store read error")
27-
28-let isActiveStatus = valueOrElse(getBoolean(this, kIsActive), false)
29-
30-@Callable(i)
31-func enableMassIncrement (key) = if (isActiveStatus)
32- then throw("Function blocked")
33- else {
34- let iterationsCount = fraction(1, range, MAX_INCREMENT)
35- let lastIterationLen = (range % MAX_INCREMENT)
36- let currentBalanceBefore = getStringValue(this, ((key + separator) + toString((range - 1))))
37- let valueArray = split(currentBalanceBefore, separator)
38- let currentBalanceInt = (parseIntValue(valueArray[1]) + 1)
39-[IntegerEntry(kLastIterationLen, lastIterationLen), IntegerEntry(kIterationsCount, iterationsCount), IntegerEntry(kIncrementCounter, 0), IntegerEntry(kCurrentBalance, currentBalanceInt)]
40- }
41-
424
435
446 @Callable(i)
45-func massIncrement (key) = if ((currentIterationsCount != 0))
7+func foo (iteration) = if ((iteration > 0))
468 then {
47- let res1 = reentrantInvoke(this, "incrementStore", [MAX_INCREMENT, key], nil)
48- if ((res1 == res1))
49- then [IntegerEntry(kIncrementCounter, (currentIncrementCounter + MAX_INCREMENT)), IntegerEntry(kIterationsCount, (currentIterationsCount - 1)), BooleanEntry(kIsActive, true)]
50- else throw("Strict value is not equal to itself.")
51- }
52- else if (if ((currentIterationsCount == 0))
53- then (currentLastIterationLen != 0)
54- else false)
55- then {
56- let res2 = reentrantInvoke(this, "incrementStore", [currentLastIterationLen, key], nil)
57- if ((res2 == res2))
58- then [IntegerEntry(kIncrementCounter, (currentIncrementCounter + currentLastIterationLen)), IntegerEntry(kLastIterationLen, 0), BooleanEntry(kIsActive, false)]
59- else throw("Strict value is not equal to itself.")
60- }
61- else throw("Storage is incremented")
62-
63-
64-
65-@Callable(i)
66-func incrementStore (range,key) = if ((range >= 0))
67- then {
68- let storeValue = ((toString(i.originCaller) + separator) + toString(currentBalance))
69- let res = invoke(this, "incrementStore", [(range - 1), key], nil)
9+ let res = reentrantInvoke(this, "foo", [(iteration - 1)], nil)
7010 if ((res == res))
71- then [StringEntry(((key + separator) + toString((range + currentIncrementCounter))), storeValue)]
11+ then [IntegerEntry("value", iteration)]
7212 else throw("Strict value is not equal to itself.")
7313 }
7414 else nil
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let separator = "/"
5-
6-let kLastIterationLen = "lastIterationLen"
7-
8-let kIterationsCount = "iterationsCount"
9-
10-let kIncrementCounter = "incrementCounter"
11-
12-let kCurrentBalance = "currentBalance"
13-
14-let kIsActive = "isActive"
15-
16-let MAX_INCREMENT = 96
17-
18-let currentLastIterationLen = valueOrErrorMessage(getInteger(this, kLastIterationLen), "Last iteration store read error")
19-
20-let currentIterationsCount = valueOrErrorMessage(getInteger(this, kIterationsCount), "Iteration store read error")
21-
22-let currentIncrementCounter = valueOrErrorMessage(getInteger(this, kIncrementCounter), "Increment store read error")
23-
24-let currentBalance = valueOrErrorMessage(getInteger(this, kCurrentBalance), "Balance store read error")
25-
26-let range = valueOrErrorMessage(getInteger(this, "usersCounter"), "Range store read error")
27-
28-let isActiveStatus = valueOrElse(getBoolean(this, kIsActive), false)
29-
30-@Callable(i)
31-func enableMassIncrement (key) = if (isActiveStatus)
32- then throw("Function blocked")
33- else {
34- let iterationsCount = fraction(1, range, MAX_INCREMENT)
35- let lastIterationLen = (range % MAX_INCREMENT)
36- let currentBalanceBefore = getStringValue(this, ((key + separator) + toString((range - 1))))
37- let valueArray = split(currentBalanceBefore, separator)
38- let currentBalanceInt = (parseIntValue(valueArray[1]) + 1)
39-[IntegerEntry(kLastIterationLen, lastIterationLen), IntegerEntry(kIterationsCount, iterationsCount), IntegerEntry(kIncrementCounter, 0), IntegerEntry(kCurrentBalance, currentBalanceInt)]
40- }
41-
424
435
446 @Callable(i)
45-func massIncrement (key) = if ((currentIterationsCount != 0))
7+func foo (iteration) = if ((iteration > 0))
468 then {
47- let res1 = reentrantInvoke(this, "incrementStore", [MAX_INCREMENT, key], nil)
48- if ((res1 == res1))
49- then [IntegerEntry(kIncrementCounter, (currentIncrementCounter + MAX_INCREMENT)), IntegerEntry(kIterationsCount, (currentIterationsCount - 1)), BooleanEntry(kIsActive, true)]
50- else throw("Strict value is not equal to itself.")
51- }
52- else if (if ((currentIterationsCount == 0))
53- then (currentLastIterationLen != 0)
54- else false)
55- then {
56- let res2 = reentrantInvoke(this, "incrementStore", [currentLastIterationLen, key], nil)
57- if ((res2 == res2))
58- then [IntegerEntry(kIncrementCounter, (currentIncrementCounter + currentLastIterationLen)), IntegerEntry(kLastIterationLen, 0), BooleanEntry(kIsActive, false)]
59- else throw("Strict value is not equal to itself.")
60- }
61- else throw("Storage is incremented")
62-
63-
64-
65-@Callable(i)
66-func incrementStore (range,key) = if ((range >= 0))
67- then {
68- let storeValue = ((toString(i.originCaller) + separator) + toString(currentBalance))
69- let res = invoke(this, "incrementStore", [(range - 1), key], nil)
9+ let res = reentrantInvoke(this, "foo", [(iteration - 1)], nil)
7010 if ((res == res))
71- then [StringEntry(((key + separator) + toString((range + currentIncrementCounter))), storeValue)]
11+ then [IntegerEntry("value", iteration)]
7212 else throw("Strict value is not equal to itself.")
7313 }
7414 else nil
7515
7616

github/deemru/w8io/169f3d6 
34.91 ms