tx · 5FdWbfp9b2oXJaACjQw8MSipgvYqUcQ3n3gpfDdGREus 3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj: -0.01000000 Waves 2021.12.23 13:47 [1846803] smart account 3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj > SELF 0.00000000 Waves
{ "type": 13, "id": "5FdWbfp9b2oXJaACjQw8MSipgvYqUcQ3n3gpfDdGREus", "fee": 1000000, "feeAssetId": null, "timestamp": 1640256532003, "version": 2, "chainId": 84, "sender": "3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj", "senderPublicKey": "Dvg2md8dJaE7kjnrJpoXiK7eSTQQ9kJRnVM58d3H4piA", "proofs": [ "3dc81TC2BFv1AjC5ketTzxseuwH3hnJV7tbKFmNuj7ZMMLtinnYJBg1YLG1QQVBzTHtuhzSagDpB1WN92qvHkWH4" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMICAgAAAAFAAAAAAZuQ29pbnMJAAE2AAAAAQAAAAAAAAAAAgAAAAAKYVByZWNpc2lvbgkAATYAAAABAAAAAAAAAABkAAAAAAp6ZXJvQmlnSW50CQABNgAAAAEAAAAAAAAAAAAAAAAAD3RhcmdldFByZWNpc2lvbgkAATYAAAABAAAAAAAAAAABAQAAAANhYnMAAAABAAAAA3ZhbAMJAAE/AAAAAgUAAAAKemVyb0JpZ0ludAUAAAADdmFsCQABPgAAAAEFAAAAA3ZhbAUAAAADdmFsAAAAAQAAAAFpAQAAAAVjYWxjRAAAAAMAAAAFeDFTdHIAAAAFeDJTdHIAAAAGYW1wU3RyBAAAAAJ4MQkAAacAAAABBQAAAAV4MVN0cgQAAAACeDIJAAGnAAAAAQUAAAAFeDJTdHIEAAAAA2FtcAkAAacAAAABBQAAAAZhbXBTdHIEAAAAAXMJAAE3AAAAAgUAAAACeDEFAAAAAngyAwkAAAAAAAACBQAAAAFzBQAAAAp6ZXJvQmlnSW50CQAFFAAAAAIFAAAAA25pbAkAAaYAAAABBQAAAAp6ZX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AAAABSRmMF8yAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkAAAIAAAABAgAAABNMaXN0IHNpemUgZXhjZWVkcyA1CQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQQAAAAFZE5leHQIBQAAAAkkdDA4OTk5NDkAAAACXzEEAAAABWRQcmV2CAUAAAAJJHQwODk5OTQ5AAAAAl8yAwkAAUAAAAACBQAAAA90YXJnZXRQcmVjaXNpb24JAQAAAANhYnMAAAABCQABOAAAAAIFAAAABWROZXh0CQEAAAAFdmFsdWUAAAABBQAAAAVkUHJldgkABRQAAAACBQAAAANuaWwJAAGmAAAAAQUAAAAFZE5leHQJAQAAAAV0aHJvdwAAAAAAAAAAdcsxQg==", "height": 1846803, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4uvC5wuyzkkPpqfitjAvF7pCtDfjAu4d2cbnSVcyKjen Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let nCoins = toBigInt(2) | |
5 | + | ||
6 | + | let aPrecision = toBigInt(100) | |
7 | + | ||
8 | + | let zeroBigInt = toBigInt(0) | |
9 | + | ||
10 | + | let targetPrecision = toBigInt(1) | |
11 | + | ||
12 | + | func abs (val) = if ((zeroBigInt > val)) | |
13 | + | then -(val) | |
14 | + | else val | |
15 | + | ||
16 | + | ||
17 | + | @Callable(i) | |
18 | + | func calcD (x1Str,x2Str,ampStr) = { | |
19 | + | let x1 = parseBigIntValue(x1Str) | |
20 | + | let x2 = parseBigIntValue(x2Str) | |
21 | + | let amp = parseBigIntValue(ampStr) | |
22 | + | let s = (x1 + x2) | |
23 | + | if ((s == zeroBigInt)) | |
24 | + | then $Tuple2(nil, toString(zeroBigInt)) | |
25 | + | else { | |
26 | + | let ann = (amp * nCoins) | |
27 | + | let arr = [1, 2, 3, 4, 5] | |
28 | + | func calc (acc,cur) = { | |
29 | + | let $t0665685 = acc | |
30 | + | let d = $t0665685._1 | |
31 | + | let dPrev = $t0665685._2 | |
32 | + | let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins)) | |
33 | + | let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp))) | |
34 | + | $Tuple2(dNext, d) | |
35 | + | } | |
36 | + | ||
37 | + | let $t0899949 = { | |
38 | + | let $l = arr | |
39 | + | let $s = size($l) | |
40 | + | let $acc0 = $Tuple2(s, unit) | |
41 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
42 | + | then $a | |
43 | + | else calc($a, $l[$i]) | |
44 | + | ||
45 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
46 | + | then $a | |
47 | + | else throw("List size exceeds 5") | |
48 | + | ||
49 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
50 | + | } | |
51 | + | let dNext = $t0899949._1 | |
52 | + | let dPrev = $t0899949._2 | |
53 | + | if ((targetPrecision >= abs((dNext - value(dPrev))))) | |
54 | + | then $Tuple2(nil, toString(dNext)) | |
55 | + | else throw() | |
56 | + | } | |
57 | + | } | |
58 | + | ||
59 | + |
github/deemru/w8io/169f3d6 42.13 ms ◑