tx · 9kTedHVJK4fWtQEenvG3nvZjirYfihoYPtK5tmZN1vhc 3N76KUacWfHQVxPDUer7zLgFtEAgCQSmmsd: -0.01000000 Waves 2023.06.15 18:08 [2623918] smart account 3N76KUacWfHQVxPDUer7zLgFtEAgCQSmmsd > SELF 0.00000000 Waves
{ "type": 13, "id": "9kTedHVJK4fWtQEenvG3nvZjirYfihoYPtK5tmZN1vhc", "fee": 1000000, "feeAssetId": null, "timestamp": 1686841725598, "version": 2, "chainId": 84, "sender": "3N76KUacWfHQVxPDUer7zLgFtEAgCQSmmsd", "senderPublicKey": "DNDe2ziQMdDJSijzg5hDggeA1yxxwiAdqiu2hKo6dPSb", "proofs": [ "5nQFUQxHv3yeM926j72MpHCyYHQ4TzQ4qvnHmV14Ec6FXKidxXbztceNoDh18kUu9puErTTmrZ55RKE85APcKoJr" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAEY2FsbAAAAAAEAAAAGHh0blJld2FyZEFtb3VudEZvclBlcmlvZAAAAAAAAALTPAQAAAAPdG90YWxTdXJmU3Rha2VkAAAAAAJUC+QABAAAAAVNVUxUOAAAAAAABfXhAAQAAAAGTVVMVDEwAAAAAAJUC+QABAAAAA1maXJzdEZyYWN0aW9uCQEAAAAIZnJhY3Rpb24AAAAEBQAAABh4dG5SZXdhcmRBbW91bnRGb3JQZXJpb2QFAAAABU1VTFQ4BQAAAA90b3RhbFN1cmZTdGFrZWQFAAAABkhBTEZVUAQAAAAQYmFja3dhcmRGcmFjdGlvbgkBAAAACGZyYWN0aW9uAAAABAUAAAANZmlyc3RGcmFjdGlvbgUAAAAPdG90YWxTdXJmU3Rha2VkBQAAAAVNVUxUOAUAAAAGSEFMRlVQBAAAAA5maXJzdEZyYWN0aW9uMgkBAAAACGZyYWN0aW9uAAAABAUAAAAYeHRuUmV3YXJkQW1vdW50Rm9yUGVyaW9kBQAAAAZNVUxUMTAFAAAAD3RvdGFsU3VyZlN0YWtlZAUAAAAGSEFMRlVQBAAAABFiYWNrd2FyZEZyYWN0aW9uMgkBAAAACGZyYWN0aW9uAAAABAUAAAAOZmlyc3RGcmFjdGlvbjIFAAAAD3RvdGFsU3VyZlN0YWtlZAUAAAAGTVVMVDEwBQAAAAZIQUxGVVAJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAC01VTFQ4UmVzdWx0BQAAABBiYWNrd2FyZEZyYWN0aW9uCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxNVUxUMTBSZXN1bHQFAAAAEWJhY2t3YXJkRnJhY3Rpb24yBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleYAjP5k=", "height": 2623918, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3GG2khXKdwueXNWeXZPHcXQWpUnK9jAc5HJQMQxW4N4J Next: 6GJ8Pw5Ro7dUHhFnybAmm4PsvrDsAMq79TfKoMVPHLPd Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func testFoldArray () = { | |
5 | - | let array = [1, 2, 3, 4, 5] | |
6 | - | func sum (accum,next) = (accum + next) | |
7 | - | ||
8 | - | let $l = array | |
9 | - | let $s = size($l) | |
10 | - | let $acc0 = 0 | |
11 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
12 | - | then $a | |
13 | - | else sum($a, $l[$i]) | |
14 | - | ||
15 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
16 | - | then $a | |
17 | - | else throw("List size exceeds 15") | |
18 | - | ||
19 | - | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
20 | - | } | |
21 | 4 | ||
22 | 5 | ||
23 | 6 | @Callable(i) | |
24 | - | func call () = [IntegerEntry("foldResult", testFoldArray())] | |
7 | + | func call () = { | |
8 | + | let xtnRewardAmountForPeriod = 185148 | |
9 | + | let totalSurfStaked = 10000000000 | |
10 | + | let MULT8 = 100000000 | |
11 | + | let MULT10 = 10000000000 | |
12 | + | let firstFraction = fraction(xtnRewardAmountForPeriod, MULT8, totalSurfStaked, HALFUP) | |
13 | + | let backwardFraction = fraction(firstFraction, totalSurfStaked, MULT8, HALFUP) | |
14 | + | let firstFraction2 = fraction(xtnRewardAmountForPeriod, MULT10, totalSurfStaked, HALFUP) | |
15 | + | let backwardFraction2 = fraction(firstFraction2, totalSurfStaked, MULT10, HALFUP) | |
16 | + | [IntegerEntry("MULT8Result", backwardFraction), IntegerEntry("MULT10Result", backwardFraction2)] | |
17 | + | } | |
25 | 18 | ||
26 | 19 | ||
27 | 20 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func testFoldArray () = { | |
5 | - | let array = [1, 2, 3, 4, 5] | |
6 | - | func sum (accum,next) = (accum + next) | |
7 | - | ||
8 | - | let $l = array | |
9 | - | let $s = size($l) | |
10 | - | let $acc0 = 0 | |
11 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
12 | - | then $a | |
13 | - | else sum($a, $l[$i]) | |
14 | - | ||
15 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
16 | - | then $a | |
17 | - | else throw("List size exceeds 15") | |
18 | - | ||
19 | - | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
20 | - | } | |
21 | 4 | ||
22 | 5 | ||
23 | 6 | @Callable(i) | |
24 | - | func call () = [IntegerEntry("foldResult", testFoldArray())] | |
7 | + | func call () = { | |
8 | + | let xtnRewardAmountForPeriod = 185148 | |
9 | + | let totalSurfStaked = 10000000000 | |
10 | + | let MULT8 = 100000000 | |
11 | + | let MULT10 = 10000000000 | |
12 | + | let firstFraction = fraction(xtnRewardAmountForPeriod, MULT8, totalSurfStaked, HALFUP) | |
13 | + | let backwardFraction = fraction(firstFraction, totalSurfStaked, MULT8, HALFUP) | |
14 | + | let firstFraction2 = fraction(xtnRewardAmountForPeriod, MULT10, totalSurfStaked, HALFUP) | |
15 | + | let backwardFraction2 = fraction(firstFraction2, totalSurfStaked, MULT10, HALFUP) | |
16 | + | [IntegerEntry("MULT8Result", backwardFraction), IntegerEntry("MULT10Result", backwardFraction2)] | |
17 | + | } | |
25 | 18 | ||
26 | 19 | ||
27 | 20 | @Verifier(tx) | |
28 | 21 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
29 | 22 |
github/deemru/w8io/169f3d6 24.42 ms ◑