tx · G9q3kNbDJhi46ThmyMyEAyGEX1kgJWsuH3zUbb46efDH

3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d:  -0.01000000 Waves

2023.03.21 17:15 [2499880] smart account 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d > SELF 0.00000000 Waves

{ "type": 13, "id": "G9q3kNbDJhi46ThmyMyEAyGEX1kgJWsuH3zUbb46efDH", "fee": 1000000, "feeAssetId": null, "timestamp": 1679408218511, "version": 2, "chainId": 84, "sender": "3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d", "senderPublicKey": "AZLzseQJi9XUNNp7cN6jwqDdSmQvDPNNqu7aQ6ujbsnJ", "proofs": [ "3aP7vpNiKHjAgrMuwxZwwXnKRggigBV6mNgt4RXp7Q9PDPrMpLB7E4uEoeTseYdQAA4qERtpPFF6QQQ4jiX2KUDf" ], "script": "base64:BgIICAISBAoCAQEMAAZzY2FsZTgAgMLXLwAMc2NhbGU4QmlnSW50CQC2AgEAgMLXLwAHc2NhbGUxOAkAtgIBAICAkLu61q3wDQAKemVyb0JpZ0ludAkAtgIBAAAABGJpZzAJALYCAQAAAARiaWcxCQC2AgEAAQAEYmlnMgkAtgIBAAIABGJpZzMJALYCAQADAARiaWc0CQC2AgEABAAFQW11bHQCAzEwMAABQQIEMTAwMAEEZ2V0RAECeHAEA3hwMAkAkQMCBQJ4cAAABAN4cDEJAJEDAgUCeHAAAQQBcwkAtwICBQN4cDAFA3hwMQMJAAACBQFzBQRiaWcwBQRiaWcwBAFhCQENcGFyc2VJbnRWYWx1ZQEFAUEEA2FubgkAaAIFAWEAAgQBcAkAvAIDBQN4cDAFA3hwMQUEYmlnMQQLeHAwX3hwMV9uX24JALwCAwUBcAUEYmlnNAUEYmlnMQQFYW5uX3MJALwCAwkAtgIBBQNhbm4FAXMFBGJpZzEEBWFubl8xCQC2AgEJAGUCBQNhbm4AAQoBCWNhbGNETmV4dAEBZAQCZGQJALwCAwUBZAUBZAUEYmln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jBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIEAWQIBQskdDAxNDgwMTUyOAJfMQQFZm91bmQIBQskdDAxNDgwMTUyOAJfMgMFBWZvdW5kBQFkCQACAQkArAICAhlEIGNhbGN1bGF0aW9uIGVycm9yLCBEID0gCQCmAwEFAWQBAWkBBGNhbGMCA3hwMAN4cDEEAUQJAQRnZXREAQkAzAgCCQC2AgEFA3hwMAkAzAgCCQC2AgEFA3hwMQUDbmlsBAZTY2FsZTgAgMLXLwQDcmVzANcICQDMCAIJAQxJbnRlZ2VyRW50cnkCAgFECQCgAwEFAUQFA25pbAECdHgBBnZlcmlmeQAGE3UHEw==", "height": 2499880, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B21f52hbzSvGsJwpqB3EokggKJLmnB1v1qrh7XRTUCoL Next: AxwQP8ehEs91CYS9sQMh8GFS3y5i9J7VBM2cQ2MgZh3J Diff:
OldNewDifferences
2828 let xp1 = xp[1]
2929 let s = (xp0 + xp1)
3030 if ((s == big0))
31- then $Tuple5(big0, big0, big0, big0, big0)
31+ then big0
3232 else {
3333 let a = parseIntValue(A)
3434 let ann = (a * 2)
5858 }
5959
6060 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
61- let $t015021550 = {
61+ let $t014801528 = {
6262 let $l = arr
6363 let $s = size($l)
6464 let $acc0 = $Tuple2(s, false)
7272
7373 $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18)
7474 }
75- let d = $t015021550._1
76- let found = $t015021550._2
75+ let d = $t014801528._1
76+ let found = $t014801528._2
7777 if (found)
78- then $Tuple5(d, p, xp0_xp1_n_n, ann_s, ann_1)
78+ then d
7979 else throw(("D calculation error, D = " + toString(d)))
8080 }
8181 }
8383
8484 @Callable(i)
8585 func calc (xp0,xp1) = {
86- let $t017491820 = getD([toBigInt(xp0), toBigInt(xp1)])
87- let d = $t017491820._1
88- let p = $t017491820._2
89- let xp0_xp1_n_n = $t017491820._3
90- let ann_s = $t017491820._4
91- let ann_1 = $t017491820._5
86+ let D = getD([toBigInt(xp0), toBigInt(xp1)])
87+ let Scale8 = 100000000
9288 let res = 1111
93-[IntegerEntry("D", toInt(d)), IntegerEntry("p", toInt(p)), IntegerEntry("xp0_xp1_n_n", toInt(xp0_xp1_n_n)), IntegerEntry("ann_s", toInt(ann_s)), IntegerEntry("ann_1", toInt(ann_1))]
89+[IntegerEntry("D", toInt(D))]
9490 }
9591
9692
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let scale8 = 100000000
55
66 let scale8BigInt = toBigInt(100000000)
77
88 let scale18 = toBigInt(1000000000000000000)
99
1010 let zeroBigInt = toBigInt(0)
1111
1212 let big0 = toBigInt(0)
1313
1414 let big1 = toBigInt(1)
1515
1616 let big2 = toBigInt(2)
1717
1818 let big3 = toBigInt(3)
1919
2020 let big4 = toBigInt(4)
2121
2222 let Amult = "100"
2323
2424 let A = "1000"
2525
2626 func getD (xp) = {
2727 let xp0 = xp[0]
2828 let xp1 = xp[1]
2929 let s = (xp0 + xp1)
3030 if ((s == big0))
31- then $Tuple5(big0, big0, big0, big0, big0)
31+ then big0
3232 else {
3333 let a = parseIntValue(A)
3434 let ann = (a * 2)
3535 let p = fraction(xp0, xp1, big1)
3636 let xp0_xp1_n_n = fraction(p, big4, big1)
3737 let ann_s = fraction(toBigInt(ann), s, big1)
3838 let ann_1 = toBigInt((ann - 1))
3939 func calcDNext (d) = {
4040 let dd = fraction(d, d, big1)
4141 let ddd = fraction(dd, d, big1)
4242 let dp = fraction(ddd, big1, xp0_xp1_n_n)
4343 fraction((ann_s + fraction(dp, big2, big1)), d, (fraction(ann_1, d, big1) + fraction(big3, dp, big1)))
4444 }
4545
4646 func calc (acc,i) = if (acc._2)
4747 then acc
4848 else {
4949 let d = acc._1
5050 let dNext = calcDNext(d)
5151 let dDiffRaw = (dNext - value(d))
5252 let dDiff = if ((big0 > dDiffRaw))
5353 then -(dDiffRaw)
5454 else dDiffRaw
5555 if ((big1 >= dDiff))
5656 then $Tuple2(dNext, true)
5757 else $Tuple2(dNext, false)
5858 }
5959
6060 let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
61- let $t015021550 = {
61+ let $t014801528 = {
6262 let $l = arr
6363 let $s = size($l)
6464 let $acc0 = $Tuple2(s, false)
6565 func $f0_1 ($a,$i) = if (($i >= $s))
6666 then $a
6767 else calc($a, $l[$i])
6868
6969 func $f0_2 ($a,$i) = if (($i >= $s))
7070 then $a
7171 else throw("List size exceeds 18")
7272
7373 $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18)
7474 }
75- let d = $t015021550._1
76- let found = $t015021550._2
75+ let d = $t014801528._1
76+ let found = $t014801528._2
7777 if (found)
78- then $Tuple5(d, p, xp0_xp1_n_n, ann_s, ann_1)
78+ then d
7979 else throw(("D calculation error, D = " + toString(d)))
8080 }
8181 }
8282
8383
8484 @Callable(i)
8585 func calc (xp0,xp1) = {
86- let $t017491820 = getD([toBigInt(xp0), toBigInt(xp1)])
87- let d = $t017491820._1
88- let p = $t017491820._2
89- let xp0_xp1_n_n = $t017491820._3
90- let ann_s = $t017491820._4
91- let ann_1 = $t017491820._5
86+ let D = getD([toBigInt(xp0), toBigInt(xp1)])
87+ let Scale8 = 100000000
9288 let res = 1111
93-[IntegerEntry("D", toInt(d)), IntegerEntry("p", toInt(p)), IntegerEntry("xp0_xp1_n_n", toInt(xp0_xp1_n_n)), IntegerEntry("ann_s", toInt(ann_s)), IntegerEntry("ann_1", toInt(ann_1))]
89+[IntegerEntry("D", toInt(D))]
9490 }
9591
9692
9793 @Verifier(tx)
9894 func verify () = true
9995

github/deemru/w8io/169f3d6 
46.30 ms