tx · 6zK6RvLbiRZvALH9AvRih6AafosnAV1XYARcQMm7BC3C 3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37: -0.01000000 Waves 2023.03.17 23:05 [2494453] smart account 3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37 > SELF 0.00000000 Waves
{ "type": 13, "id": "6zK6RvLbiRZvALH9AvRih6AafosnAV1XYARcQMm7BC3C", "fee": 1000000, "feeAssetId": null, "timestamp": 1679083514314, "version": 2, "chainId": 84, "sender": "3N7hFU6dFSFKGGwDyF9WJ1jVsrB9w8RHT37", "senderPublicKey": "J6bcbr8r9usSLYw72NzzrKVCvKDDLe1uDx8bnWp3uFAV", "proofs": [ "VWanWCVUBGmUaPEPZRofh6jNHdrUtmnMtJ5GzQiL2NCxZ7wTET5io7dPUhTh7sh4tcHBjBJLzH9LMYymvAjKtmJ" ], "script": "base64:BgIHCAISAwoBCAMAB01VTFQzNlgJAKcDAQIlMTAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAHTVVMVDE4WAkApwMBAhMxMDAwMDAwMDAwMDAwMDAwMDAwAARFMThYCQCnAwECEzI3MTgyODE4Mjg0NTkwNDUyMzUBAWkBBWdhbW1hAQZ6U3RyMTgEA3oxOAkApwMBBQZ6U3RyMTgEA3ozNgkAuQICBQN6MTgFB01VTFQxOFgKAQVjaGFpbgIDYWNjAWkJALgCAgkAtwICBQN6MzYJALkCAgkAtgIBCQBlAgkAZAIFAWkFAWkAAQUHTVVMVDM2WAkAvAIDCQC5AgIJALYCAQkAaAIFAWkFAWkFB01VTFQzNlgFB01VTFQzNlgFA2FjYwQBZgoAAiRsCQDMCAIAFAkAzAgCABMJAMwIAgASCQDMCAIAEQkAzAgCABAJAMwIAgAPCQDMCAIADgkAzAgCAA0JAMwIAgAMCQDMCAIACwkAzAgCAAoJAMwIAgAJCQDMCAIACAkAzAgCAAcJAMwIAgAGCQDMCAIABQkAzAgCAAQJAMwIAgADCQDMCAIAAgkAzAgCAAEFA25pbAoAAiRzCQCQAwEFAiRsCgAFJGFjYzAFB01VTFQzNlgKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBBWNoYWluAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhRMaXN0IHNpemUgZXhjZWVkcyAyMAkBBSRmMF8yAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgUFJGFjYzAAAAABAAIAAwAEAAUABgAHAAgACQAKAAsADAANAA4ADwAQABEAEgATABQJAJQKAgUDbmlsCQCmAwEJALwCAwkAdgYFBEUxOFgAEgkAvgIBBQN6MTgAEgASBQZIQUxGVVAFB01VTFQzNlgFAWYA8og1EQ==", "height": 2494453, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AG7BYyXbzFoAAwTSSoS6nLeStXq55svKGMF49TuSGqgs Next: 7mJT3ffejiDjPU1shELCEosjWsvCwqkBbDtLVR9Bm8YF Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let MULT36X = parseBigIntValue("1000000000000000000000000000000000000") | |
5 | + | ||
4 | 6 | let MULT18X = parseBigIntValue("1000000000000000000") | |
5 | 7 | ||
6 | 8 | let E18X = parseBigIntValue("2718281828459045235") | |
7 | 9 | ||
8 | 10 | @Callable(i) | |
9 | - | func gamma (zStr) = { | |
10 | - | let z18 = parseBigIntValue(zStr) | |
11 | - | func chain (acc,i) = ((z18 + (toBigInt(((i + i) - 1)) * MULT18X)) - fraction((toBigInt((i * i)) * MULT18X), MULT18X, acc)) | |
11 | + | func gamma (zStr18) = { | |
12 | + | let z18 = parseBigIntValue(zStr18) | |
13 | + | let z36 = (z18 * MULT18X) | |
14 | + | func chain (acc,i) = ((z36 + (toBigInt(((i + i) - 1)) * MULT36X)) - fraction((toBigInt((i * i)) * MULT36X), MULT36X, acc)) | |
12 | 15 | ||
13 | 16 | let f = { | |
14 | 17 | let $l = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] | |
15 | 18 | let $s = size($l) | |
16 | - | let $acc0 = | |
19 | + | let $acc0 = MULT36X | |
17 | 20 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
18 | 21 | then $a | |
19 | 22 | else chain($a, $l[$i]) | |
24 | 27 | ||
25 | 28 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
26 | 29 | } | |
27 | - | $Tuple2(nil, toString(fraction(pow(E18X, 18, -(z18), 18, 18, HALFUP), | |
30 | + | $Tuple2(nil, toString(fraction(pow(E18X, 18, -(z18), 18, 18, HALFUP), MULT36X, f))) | |
28 | 31 | } | |
29 | 32 | ||
30 | 33 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let MULT36X = parseBigIntValue("1000000000000000000000000000000000000") | |
5 | + | ||
4 | 6 | let MULT18X = parseBigIntValue("1000000000000000000") | |
5 | 7 | ||
6 | 8 | let E18X = parseBigIntValue("2718281828459045235") | |
7 | 9 | ||
8 | 10 | @Callable(i) | |
9 | - | func gamma (zStr) = { | |
10 | - | let z18 = parseBigIntValue(zStr) | |
11 | - | func chain (acc,i) = ((z18 + (toBigInt(((i + i) - 1)) * MULT18X)) - fraction((toBigInt((i * i)) * MULT18X), MULT18X, acc)) | |
11 | + | func gamma (zStr18) = { | |
12 | + | let z18 = parseBigIntValue(zStr18) | |
13 | + | let z36 = (z18 * MULT18X) | |
14 | + | func chain (acc,i) = ((z36 + (toBigInt(((i + i) - 1)) * MULT36X)) - fraction((toBigInt((i * i)) * MULT36X), MULT36X, acc)) | |
12 | 15 | ||
13 | 16 | let f = { | |
14 | 17 | let $l = [20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1] | |
15 | 18 | let $s = size($l) | |
16 | - | let $acc0 = | |
19 | + | let $acc0 = MULT36X | |
17 | 20 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
18 | 21 | then $a | |
19 | 22 | else chain($a, $l[$i]) | |
20 | 23 | ||
21 | 24 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
22 | 25 | then $a | |
23 | 26 | else throw("List size exceeds 20") | |
24 | 27 | ||
25 | 28 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
26 | 29 | } | |
27 | - | $Tuple2(nil, toString(fraction(pow(E18X, 18, -(z18), 18, 18, HALFUP), | |
30 | + | $Tuple2(nil, toString(fraction(pow(E18X, 18, -(z18), 18, 18, HALFUP), MULT36X, f))) | |
28 | 31 | } | |
29 | 32 | ||
30 | 33 |
github/deemru/w8io/026f985 21.67 ms ◑