tx · E42CmHak6pQ53PTAtt1uLXrNPfu8nMMe7amDSmjhPXU4 3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx: -0.01000000 Waves 2023.05.27 17:41 [2596498] smart account 3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx > SELF 0.00000000 Waves
{ "type": 13, "id": "E42CmHak6pQ53PTAtt1uLXrNPfu8nMMe7amDSmjhPXU4", "fee": 1000000, "feeAssetId": null, "timestamp": 1685198512061, "version": 2, "chainId": 84, "sender": "3N7eEzkCtBoWaNRe4ZuTPrChbnjBLKDb9Bx", "senderPublicKey": "2NK7BrUZMvnHzAoHnJfz3FuDBP5zYUNoxshB49AH2kbc", "proofs": [ "YRGTBj6ocotP3HGW5FYwaJ6adv4YTZw6fsm8NzXiRaqFJB27wNkLXaohhW99VLXREYeNL1MfvW2d6q9h31gQvPM" ], "script": "base64:BgISCAISAwoBCBIDCgEIEgQKAgEIDQAJc2VwYXJhdG9yAgEvABFrTGFzdEl0ZXJhdGlvbkxlbgIQbGFzdEl0ZXJhdGlvbkxlbgAQa0l0ZXJhdGlvbnNDb3VudAIPaXRlcmF0aW9uc0NvdW50ABFrSW5jcmVtZW50Q291bnRlcgIQaW5jcmVtZW50Q291bnRlcgAPa0N1cnJlbnRCYWxhbmNlAg5jdXJyZW50QmFsYW5jZQAJa0lzQWN0aXZlAghpc0FjdGl2ZQANTUFYX0lOQ1JFTUVOVABgABdjdXJyZW50TGFzdEl0ZXJhdGlvbkxlbgkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFBHRoaXMFEWtMYXN0SXRlcmF0aW9uTGVuAh9MYXN0IGl0ZXJhdGlvbiBzdG9yZSByZWFkIGVycm9yABZjdXJyZW50SXRlcmF0aW9uc0NvdW50CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJoIAgUEdGhpcwUQa0l0ZXJhdGlvbnNDb3VudAIaSXRlcmF0aW9uIHN0b3JlIHJlYWQgZXJyb3IAF2N1c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29sZWFuRW50cnkCBQlrSXNBY3RpdmUHBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAhZTdG9yYWdlIGlzIGluY3JlbWVudGVkAWkBDmluY3JlbWVudFN0b3JlAgVyYW5nZQNrZXkDCQBnAgUFcmFuZ2UAAAQKc3RvcmVWYWx1ZQkArAICCQCsAgIJAKUIAQgFAWkMb3JpZ2luQ2FsbGVyBQlzZXBhcmF0b3IJAKQDAQUOY3VycmVudEJhbGFuY2UEA3JlcwkA/AcEBQR0aGlzAg5pbmNyZW1lbnRTdG9yZQkAzAgCCQBlAgUFcmFuZ2UAAQkAzAgCBQNrZXkFA25pbAUDbmlsAwkAAAIFA3JlcwUDcmVzCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQNrZXkFCXNlcGFyYXRvcgkApAMBCQBkAgUFcmFuZ2UFF2N1cnJlbnRJbmNyZW1lbnRDb3VudGVyBQpzdG9yZVZhbHVlBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4FA25pbADG/EQv", "height": 2596498, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J2fTNr5LcXEGcvGQx7E1FL5HEMgQ3xXZfg4KyvoqisoP Next: Huj8U4pda59oypqYfpm2Yck5SPxp7XYZvSQuN1XEpwwS Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# 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 | + | ||
4 | 42 | ||
5 | 43 | ||
6 | 44 | @Callable(i) | |
7 | - | func | |
45 | + | func massIncrement (key) = if ((currentIterationsCount != 0)) | |
8 | 46 | then { | |
9 | - | let res = reentrantInvoke(this, "foo", [(iteration - 1)], nil) | |
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) | |
10 | 70 | if ((res == res)) | |
11 | - | then [ | |
71 | + | then [StringEntry(((key + separator) + toString((range + currentIncrementCounter))), storeValue)] | |
12 | 72 | else throw("Strict value is not equal to itself.") | |
13 | 73 | } | |
14 | 74 | else nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# 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 | + | ||
4 | 42 | ||
5 | 43 | ||
6 | 44 | @Callable(i) | |
7 | - | func | |
45 | + | func massIncrement (key) = if ((currentIterationsCount != 0)) | |
8 | 46 | then { | |
9 | - | let res = reentrantInvoke(this, "foo", [(iteration - 1)], nil) | |
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) | |
10 | 70 | if ((res == res)) | |
11 | - | then [ | |
71 | + | then [StringEntry(((key + separator) + toString((range + currentIncrementCounter))), storeValue)] | |
12 | 72 | else throw("Strict value is not equal to itself.") | |
13 | 73 | } | |
14 | 74 | else nil | |
15 | 75 | ||
16 | 76 |
github/deemru/w8io/026f985 55.72 ms ◑