tx · Gp3nELeVBXaAKv8PxWAxuYDjr3RBd4douC4cAm9K5YtJ 3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3: -0.00200000 Waves 2022.08.11 13:35 [2179709] smart account 3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3 > SELF 0.00000000 Waves
{ "type": 13, "id": "Gp3nELeVBXaAKv8PxWAxuYDjr3RBd4douC4cAm9K5YtJ", "fee": 200000, "feeAssetId": null, "timestamp": 1660214169923, "version": 2, "chainId": 84, "sender": "3N1Kt6er9nzzrv8DYLUNybdUdKhto6buhu3", "senderPublicKey": "HgKeKH88GY1mp5NpcZUDMRa9iw9LS79HZAnRt3ntaXpE", "proofs": [ "5GbdJgRXCJ47dNHXn2piDtcmiwD8FYFZkZro7pScRUWLj7GEFnuDHHL2Urq4Y8fcHRYk1ni2dWtenSg98cqZ8rkN" ], "script": "base64:BgIMCAISAwoBARIDCgEIBQAITUlOX1RJQ0sAmOzJ////////AQAITUFYX1RJQ0sJAQEtAQUITUlOX1RJQ0sABEJBU0UJALYCAQCRTgANQkFTRV9ERUNJTUFMUwAEAAhERUNJTUFMUwASAgFpARJnZXRTcXJ0UmF0aW9BdFRpY2sBBHRpY2sEB2Fic1RpY2sDCQBmAgAABQR0aWNrCQBoAgUEdGljawD///////////8BBQR0aWNrBANlcnIDCQBmAgUEdGljawUITUFYX1RJQ0sJAAIBAgxpbnZhbGlkIHRpY2sFBHVuaXQDCQAAAgUDZXJyBQNlcnIEBnByaWNlMQkAdgYFBEJBU0UFDUJBU0VfREVDSU1BTFMJALYCAQABAAAAEgUERE9XTgQGcHJpY2UyCQB2BgUEQkFTRQUNQkFTRV9ERUNJTUFMUwkAtgIBAOrZ5v///////wEAAAASBQRET1dOBAZwcmljZTMJAHYGBQRCQVNFBQ1CQVNFX0RFQ0lNQUxTCQC2AgEAlqYZAAAAEgUERE9XTgQGcHJpY2U0CQB2BgkAtgIBAJFOAAQJALYCAQACAAAAEgUERE9XTgQGcHJpY2U1CQBsBgAUAAEA////////////AQAAAAQFBERPV04EBnByaWNlNgkAdgYJALYCAQAUAAEJALYCAQD///////////8BAAAABAUERE9XTgkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQICB3ByaWNlXzEJAKYDAQUGcHJpY2UxCQDMCAIJAQtTdHJpbmdFbnRyeQICB3ByaWNlXzIJAKYDAQUGcHJpY2UyCQDMCAIJAQtTdHJpbmdFbnRyeQICB3ByaWNlXzMJAKYDAQUGcHJpY2UzCQDMCAIJAQtTdHJpbmdFbnRyeQICB3ByaWNlXzQJAKYDAQUGcHJpY2U0CQDMCAIJAQxJbnRlZ2VyRW50cnkCAgdwcmljZV81BQZwcmljZTUJAMwIAgkBC1N0cmluZ0VudHJ5AgIHcHJpY2VfNgkApgMBBQZwcmljZTYJAMwIAgkBDEJvb2xlYW5FbnRyeQICCWJvb2xfdHJ1ZQYJAMwIAgkBC1N0cmluZ0VudHJ5AgIIYm9vbF9zdHIJAKUDAQYFA25pbAUEdW5pdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpARJnZXRUaWNrQXRTcXJ0UmF0aW8BBnByaWNlXwQFcHJpY2UJAKcDAQUGcHJpY2VfBAR0aWNrCQB3BgUFcHJpY2UFCERFQ0lNQUxTBQRCQVNFBQ1CQVNFX0RFQ0lNQUxTAAAFBERPV04JAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCAgR0aWNrCQCmAwEFBHRpY2sFA25pbAUEdW5pdAECdHgBBnZlcmlmeQAGOhK5mA==", "height": 2179709, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AGhRoG6yxq3bMyDAGEWYN1ExAZVUyRu8n2tBXtHJdS79 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
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 | - | $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) | |
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)), BooleanEntry("bool_true", true), StringEntry("bool_str", toString(true))], unit) | |
31 | 31 | } | |
32 | 32 | else throw("Strict value is not equal to itself.") | |
33 | 33 | } |
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 | 25 | let price2 = pow(BASE, BASE_DECIMALS, toBigInt(-414486), 0, 18, DOWN) | |
26 | 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 | - | $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) | |
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)), BooleanEntry("bool_true", true), StringEntry("bool_str", toString(true))], unit) | |
31 | 31 | } | |
32 | 32 | else throw("Strict value is not equal to itself.") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | 38 | func getTickAtSqrtRatio (price_) = { | |
39 | 39 | let price = parseBigIntValue(price_) | |
40 | 40 | let tick = log(price, DECIMALS, BASE, BASE_DECIMALS, 0, DOWN) | |
41 | 41 | $Tuple2([StringEntry("tick", toString(tick))], unit) | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Verifier(tx) | |
46 | 46 | func verify () = true | |
47 | 47 |
github/deemru/w8io/026f985 34.20 ms ◑