tx · WuUEuiqNd1TFUBJtDZTkM3aNw2YZKEdJPSb23EJ4gsP 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d: -0.01000000 Waves 2022.06.09 16:39 [2088909] smart account 3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d > SELF 0.00000000 Waves
{ "type": 13, "id": "WuUEuiqNd1TFUBJtDZTkM3aNw2YZKEdJPSb23EJ4gsP", "fee": 1000000, "feeAssetId": null, "timestamp": 1654782001749, "version": 2, "chainId": 84, "sender": "3N5HkfGrou8T5NyAuZVncnAdVuGmSHuMQ5d", "senderPublicKey": "AZLzseQJi9XUNNp7cN6jwqDdSmQvDPNNqu7aQ6ujbsnJ", "proofs": [ "2hK6Y5LFe7CNkKVaPcpkd7HdyJDnRAznungLrMzkBjB3rCytvNVsftekaUK6NA3JgnSdkpP6nyssPUrVAPZVKt94" ], "script": "base64:AAIFAAAAAAAAAAsIAhIHCgUBAQEBAQAAAAAAAAABAAAAAWkBAAAABGNhbGMAAAAFAAAACGFtb3VudEluAAAADmFzc2V0SW5CYWxhbmNlAAAAD2Fzc2V0T3V0QmFsYW5jZQAAAA13ZWlnaHRBc3NldEluAAAADndlaWdodEFzc2V0T3V0BAAAAAZTY2FsZTgAAAAAAAX14QAEAAAAB3Bvd0Jhc2UJAAE9AAAABAkAATYAAAABBQAAAA5hc3NldEluQmFsYW5jZQkAATYAAAABCQAAaAAAAAIFAAAABlNjYWxlOAUAAAAGU2NhbGU4CQABNgAAAAEJAABkAAAAAgUAAAAOYXNzZXRJbkJhbGFuY2UFAAAACGFtb3VudEluBQAAAAZIQUxGVVAEAAAAC3Bvd0V4cG9uZW50CQABNgAAAAEJAABrAAAAAwUAAAANd2VpZ2h0QXNzZXRJbgAAAAAAAAAnEAUAAAAOd2VpZ2h0QXNzZXRPdXQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQIAAAAEa2V5NQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAHcG93QmFzZQkAAaAAAAABBQAAAAdwb3dCYXNlCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAtwb3dFeHBvbmVudAkAAaAAAAABBQAAAAtwb3dFeHBvbmVudAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAaXrnCl", "height": 2088909, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4PU9xiKpZxtAJtqH1QGDAy6tPjyJBvZBXzQ8LKnQfCS6 Next: DwsH2kvrHfrFnsXCzC5W1PPCmBWUdQmMYFpHijBnCKdH Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func calc () = { | |
8 | - | let ssss = 12345678 | |
9 | - | let sss2 = $Tuple4("Hello Waves", 42, true, ssss) | |
10 | - | [DeleteEntry("bin"), DeleteEntry("bool"), DeleteEntry("int"), DeleteEntry("str"), DeleteEntry("key3")] | |
7 | + | func calc (amountIn,assetInBalance,assetOutBalance,weightAssetIn,weightAssetOut) = { | |
8 | + | let Scale8 = 100000000 | |
9 | + | let powBase = fraction(toBigInt(assetInBalance), toBigInt((Scale8 * Scale8)), toBigInt((assetInBalance + amountIn)), HALFUP) | |
10 | + | let powExponent = toBigInt(fraction(weightAssetIn, 10000, weightAssetOut)) | |
11 | + | [DeleteEntry("key5"), IntegerEntry("powBase", toInt(powBase)), IntegerEntry("powExponent", toInt(powExponent))] | |
11 | 12 | } | |
12 | 13 | ||
13 | 14 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func calc () = { | |
8 | - | let ssss = 12345678 | |
9 | - | let sss2 = $Tuple4("Hello Waves", 42, true, ssss) | |
10 | - | [DeleteEntry("bin"), DeleteEntry("bool"), DeleteEntry("int"), DeleteEntry("str"), DeleteEntry("key3")] | |
7 | + | func calc (amountIn,assetInBalance,assetOutBalance,weightAssetIn,weightAssetOut) = { | |
8 | + | let Scale8 = 100000000 | |
9 | + | let powBase = fraction(toBigInt(assetInBalance), toBigInt((Scale8 * Scale8)), toBigInt((assetInBalance + amountIn)), HALFUP) | |
10 | + | let powExponent = toBigInt(fraction(weightAssetIn, 10000, weightAssetOut)) | |
11 | + | [DeleteEntry("key5"), IntegerEntry("powBase", toInt(powBase)), IntegerEntry("powExponent", toInt(powExponent))] | |
11 | 12 | } | |
12 | 13 | ||
13 | 14 | ||
14 | 15 | @Verifier(tx) | |
15 | 16 | func verify () = true | |
16 | 17 |
github/deemru/w8io/169f3d6 42.58 ms ◑