tx · 3joZm6WZC1uK5FggpbXWkrNiMEbVwUN8cd2Nt4o3qegx 3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3: -0.00100000 Waves 2022.08.09 17:59 [2177080] smart account 3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3 > SELF 0.00000000 Waves
{ "type": 13, "id": "3joZm6WZC1uK5FggpbXWkrNiMEbVwUN8cd2Nt4o3qegx", "fee": 100000, "feeAssetId": null, "timestamp": 1660057226063, "version": 2, "chainId": 84, "sender": "3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3", "senderPublicKey": "HgKeKH88GY1mp5NpcZUDMRa9iw9LS79HZAnRt3ntaXpE", "proofs": [ "2d6uSTDh9pwr3hFT7Fty1Zhcrdw2WEg9GPFauNGborKTaaRBoaPZiD3nQ14iFbCyGojTFbu39ixuP5ooZcdZeeDJ" ], "script": "base64:BgIHCAISAwoBAQUACE1JTl9USUNLAJjsyf///////wEACE1BWF9USUNLCQEBLQEFCE1JTl9USUNLAARCQVNFCQC2AgEAkU4ADUJBU0VfREVDSU1BTFMABAAIREVDSU1BTFMAEgEBaQESZ2V0U3FydFJhdGlvQXRUaWNrAQR0aWNrBAdhYnNUaWNrAwkAZgIAAAUEdGljawkAaAIFBHRpY2sA////////////AQUEdGljawQDZXJyAwkAZgIFBHRpY2sFCE1BWF9USUNLCQACAQIMaW52YWxpZCB0aWNrBQR1bml0AwkAAAIFA2VycgUDZXJyBAZwcmljZTEJAHYGBQRCQVNFBQ1CQVNFX0RFQ0lNQUxTCQC2AgEAAQAAABIFBERPV04EBnByaWNlMgkAdgYFBEJBU0UFDUJBU0VfREVDSU1BTFMJALYCAQDq2eb///////8BAAAAEgUERE9XTgQGcHJpY2UzCQB2BgUEQkFTRQUNQkFTRV9ERUNJTUFMUwkAtgIBAJamGQAAABIFBERPV04EBnByaWNlNAkAdgYJALYCAQCRTgAECQC2AgEAAgAAABIFBERPV04EBnByaWNlNQkAbAYAFAABAP///////////wEAAAAEBQRET1dOBAZwcmljZTYJAHYGCQC2AgEAFAABCQC2AgEA////////////AQAAAAQFBERPV04JAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCAgdwcmljZV8xCQCmAwEFBnByaWNlMQkAzAgCCQELU3RyaW5nRW50cnkCAgdwcmljZV8yCQCmAwEFBnByaWNlMgkAzAgCCQELU3RyaW5nRW50cnkCAgdwcmljZV8zCQCmAwEFBnByaWNlMwkAzAgCCQELU3RyaW5nRW50cnkCAgdwcmljZV80CQCmAwEFBnByaWNlNAkAzAgCCQEMSW50ZWdlckVudHJ5AgIHcHJpY2VfNQUGcHJpY2U1CQDMCAIJAQtTdHJpbmdFbnRyeQICB3ByaWNlXzYJAKYDAQUGcHJpY2U2BQNuaWwFBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABigCvW4=", "height": 2177080, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 46Gyx9Ndq3iyXvpKbUMehmpGXY2cshVmyY9a2nud53jH Next: 6dniRdu6hRKbZYSV7bxrtXdw8jRMwmoBVeEnbRb4mV1P Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | if ((err == err)) | |
23 | 23 | then { | |
24 | 24 | let price1 = pow(BASE, BASE_DECIMALS, toBigInt(1), 0, 18, DOWN) | |
25 | - | let price2 = pow(BASE, BASE_DECIMALS, toBigInt(- | |
26 | - | let price3 = pow(BASE, BASE_DECIMALS, toBigInt( | |
25 | + | let price2 = pow(BASE, BASE_DECIMALS, toBigInt(-414486), 0, 18, DOWN) | |
26 | + | let price3 = pow(BASE, BASE_DECIMALS, toBigInt(414486), 0, 18, DOWN) | |
27 | 27 | let price4 = pow(toBigInt(10001), 4, toBigInt(2), 0, 18, DOWN) | |
28 | 28 | let price5 = pow(20, 1, -1, 0, 4, DOWN) | |
29 | 29 | let price6 = pow(toBigInt(20), 1, toBigInt(-1), 0, 4, DOWN) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MIN_TICK = -887272 | |
5 | 5 | ||
6 | 6 | let MAX_TICK = -(MIN_TICK) | |
7 | 7 | ||
8 | 8 | let BASE = toBigInt(10001) | |
9 | 9 | ||
10 | 10 | let BASE_DECIMALS = 4 | |
11 | 11 | ||
12 | 12 | let DECIMALS = 18 | |
13 | 13 | ||
14 | 14 | @Callable(i) | |
15 | 15 | func getSqrtRatioAtTick (tick) = { | |
16 | 16 | let absTick = if ((0 > tick)) | |
17 | 17 | then (tick * -1) | |
18 | 18 | else tick | |
19 | 19 | let err = if ((tick > MAX_TICK)) | |
20 | 20 | then throw("invalid tick") | |
21 | 21 | else unit | |
22 | 22 | if ((err == err)) | |
23 | 23 | then { | |
24 | 24 | let price1 = pow(BASE, BASE_DECIMALS, toBigInt(1), 0, 18, DOWN) | |
25 | - | let price2 = pow(BASE, BASE_DECIMALS, toBigInt(- | |
26 | - | let price3 = pow(BASE, BASE_DECIMALS, toBigInt( | |
25 | + | let price2 = pow(BASE, BASE_DECIMALS, toBigInt(-414486), 0, 18, DOWN) | |
26 | + | let price3 = pow(BASE, BASE_DECIMALS, toBigInt(414486), 0, 18, DOWN) | |
27 | 27 | let price4 = pow(toBigInt(10001), 4, toBigInt(2), 0, 18, DOWN) | |
28 | 28 | let price5 = pow(20, 1, -1, 0, 4, DOWN) | |
29 | 29 | let price6 = pow(toBigInt(20), 1, toBigInt(-1), 0, 4, DOWN) | |
30 | 30 | $Tuple2([StringEntry("price_1", toString(price1)), StringEntry("price_2", toString(price2)), StringEntry("price_3", toString(price3)), StringEntry("price_4", toString(price4)), IntegerEntry("price_5", price5), StringEntry("price_6", toString(price6))], unit) | |
31 | 31 | } | |
32 | 32 | else throw("Strict value is not equal to itself.") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Verifier(tx) | |
37 | 37 | func verify () = true | |
38 | 38 |
github/deemru/w8io/026f985 34.18 ms ◑