tx · 93YYbojFfdGD8WFPRYQi8D4HTd42sCowboh2Xo9B9E4c

3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj:  -0.01000000 Waves

2021.12.23 14:51 [1846873] smart account 3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj > SELF 0.00000000 Waves

{ "type": 13, "id": "93YYbojFfdGD8WFPRYQi8D4HTd42sCowboh2Xo9B9E4c", "fee": 1000000, "feeAssetId": null, "timestamp": 1640260310135, "version": 2, "chainId": 84, "sender": "3MyVUAzWpL91WbpgccHK5Arq5hu2xN2hXrj", "senderPublicKey": "Dvg2md8dJaE7kjnrJpoXiK7eSTQQ9kJRnVM58d3H4piA", "proofs": [ "3yoFcKjcvmidE6MxjU9gxf8QBdknRgWeczqNBz73c7zR8KkxpR8XF8ctVA8cLTYtmZicEVuFXAXnRuijScF45sAa" ], "script": "base64:AAIFAAAAAAAAAAkIAhIFCgMICAgAAAAFAAAAAAZuQ29pbnMJAAE2AAAAAQAAAAAAAAAAAgAAAAAKYVByZWNpc2lvbgkAATYAAAABAAAAAAAF9eEAAAAAAAp6ZXJvQmlnSW50CQABNgAAAAEAAAAAAAAAAAAAAAAAD3RhcmdldFByZWNpc2lvbgkAATYAAAABAAAAAAAAAAABAQAAAANhYnMAAAABAAAAA3ZhbAMJAAE/AAAAAgUAAAAKemVyb0JpZ0ludAUAAAADdmFsCQABPgAAAAEFAAAAA3ZhbAUAAAADdmFsAAAAAQAAAAFpAQAAAAVjYWxjRAAAAAMAAAAFeDFTdHIAAAAFeDJTdHIAAAAGYW1wU3RyBAAAAAJ4MQkAAacAAAABBQAAAAV4MVN0cgQAAAACeDIJAAGnAAAAAQUAAAAFeDJTdHIEAAAAA2FtcAkAAacAAAABBQAAAAZhbXBTdHIEAAAAAXMJAAE3AAAAAgUAAAACeDEFAAAAAngyAwkAAAAAAAACBQAAAAFzBQAAAAp6ZXJvQmlnSW50CQAFFAAAAAIFAAAAA25pbAkAAaYAAAABBQAAAAp6ZXJvQ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SRmMF8yAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkAAAIAAAABAgAAABNMaXN0IHNpemUgZXhjZWVkcyA1CQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQQAAAAFZE5leHQIBQAAAAkkdDA5MDc5NTcAAAACXzEEAAAABWRQcmV2CAUAAAAJJHQwOTA3OTU3AAAAAl8yBAAAAAVkRGlmZgkBAAAAA2FicwAAAAEJAAE4AAAAAgUAAAAFZE5leHQJAQAAAAV2YWx1ZQAAAAEFAAAABWRQcmV2AwkAAUAAAAACBQAAAA90YXJnZXRQcmVjaXNpb24FAAAABWREaWZmCQAFFAAAAAIFAAAAA25pbAkAAaYAAAABBQAAAAVkTmV4dAkAAAIAAAABCQABLAAAAAICAAAAEEJST0tFTiEgZERpZmYgPSAJAAGmAAAAAQUAAAAFZERpZmYAAAAA2LuU4A==", "height": 1846873, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 271APKeYbUAo1eYFEJPMdHQVCT11nVYTjtFvqMXXzRxu Next: 4CMv25V7KA8iF9WzN8iWHWHtwFRpV4kCGMXdQTUXa1yL Diff:
OldNewDifferences
5252 let dPrev = $t0907957._2
5353 let dDiff = abs((dNext - value(dPrev)))
5454 if ((targetPrecision >= dDiff))
55- then $Tuple2(nil, [toString(dNext), toString(value(dPrev))])
55+ then $Tuple2(nil, toString(dNext))
5656 else throw(("BROKEN! dDiff = " + toString(dDiff)))
5757 }
5858 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let nCoins = toBigInt(2)
55
66 let aPrecision = toBigInt(100000000)
77
88 let zeroBigInt = toBigInt(0)
99
1010 let targetPrecision = toBigInt(1)
1111
1212 func abs (val) = if ((zeroBigInt > val))
1313 then -(val)
1414 else val
1515
1616
1717 @Callable(i)
1818 func calcD (x1Str,x2Str,ampStr) = {
1919 let x1 = parseBigIntValue(x1Str)
2020 let x2 = parseBigIntValue(x2Str)
2121 let amp = parseBigIntValue(ampStr)
2222 let s = (x1 + x2)
2323 if ((s == zeroBigInt))
2424 then $Tuple2(nil, toString(zeroBigInt))
2525 else {
2626 let ann = (amp * nCoins)
2727 let arr = [1, 2, 3, 4, 5]
2828 func calc (acc,cur) = {
2929 let $t0673693 = acc
3030 let d = $t0673693._1
3131 let dPrev = $t0673693._2
3232 let dp = (((d * d) * d) / (((x1 * x2) * nCoins) * nCoins))
3333 let dNext = (((((ann * s) / aPrecision) + (dp * nCoins)) * d) / ((((ann - aPrecision) * d) / aPrecision) + ((nCoins + toBigInt(1)) * dp)))
3434 $Tuple2(dNext, d)
3535 }
3636
3737 let $t0907957 = {
3838 let $l = arr
3939 let $s = size($l)
4040 let $acc0 = $Tuple2(s, unit)
4141 func $f0_1 ($a,$i) = if (($i >= $s))
4242 then $a
4343 else calc($a, $l[$i])
4444
4545 func $f0_2 ($a,$i) = if (($i >= $s))
4646 then $a
4747 else throw("List size exceeds 5")
4848
4949 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
5050 }
5151 let dNext = $t0907957._1
5252 let dPrev = $t0907957._2
5353 let dDiff = abs((dNext - value(dPrev)))
5454 if ((targetPrecision >= dDiff))
55- then $Tuple2(nil, [toString(dNext), toString(value(dPrev))])
55+ then $Tuple2(nil, toString(dNext))
5656 else throw(("BROKEN! dDiff = " + toString(dDiff)))
5757 }
5858 }
5959
6060

github/deemru/w8io/169f3d6 
37.09 ms