tx · 6rRugFRTceFbkKgt8H66N3eEUf7azHNoRzXqanJVY9mY 3NBuZ23GzYDfjjNYPY1PHmpMB8Db3a6n3M5: -0.01400000 Waves 2022.02.25 15:55 [1939183] smart account 3NBuZ23GzYDfjjNYPY1PHmpMB8Db3a6n3M5 > SELF 0.00000000 Waves
{ "type": 13, "id": "6rRugFRTceFbkKgt8H66N3eEUf7azHNoRzXqanJVY9mY", "fee": 1400000, "feeAssetId": null, "timestamp": 1645793722508, "version": 2, "chainId": 84, "sender": "3NBuZ23GzYDfjjNYPY1PHmpMB8Db3a6n3M5", "senderPublicKey": "8CU89WQUg5a86jo3QstktPZCaGyvaBcVSQHDopryh6V1", "proofs": [ "2RKNYetdU7AdWAULSBHtxDx6BSXECs2vkDFztHehaE7EffHBSBkDXaf8ADQSh8Cg3SBg6EqtAhanYrRfAjePBLbR" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAEAAAAAAHV0FWRUxFVAAAAAAABfXhAAAAAAAFUEFVTEkAAAAAAAAPQkAAAAAACEJJR1BBVUxJCQABNgAAAAEAAAAAAAAPQkAAAAAACFBSSUNFTEVUAAAAAAAAD0JAAAAAAARNVUxUAAAAAAAF9eEAAAAAAAlCSUdNVUxUMTYJAAE2AAAAAQAAI4byb8EAAAAAAAAJTVVMVFNDQUxFAAAAAAAAAAAIAAAAAAdTQ0FMRTE2AAAAAAAAAAAQAAAAAANTRVACAAAAAl9fAAAAAAVIQUxGOAAAAAAAAvrwgAAAAAALRVVMRVJOVU1CRVIAAAAAABAzxNYAAAAABnNjYWxlNgAAAAAAAA9CQAAAAAAMc2NhbGU2QmlnSW50CQABNgAAAAEAAAAAAAAPQkAAAAAADHNjYWxlOEJpZ0ludAkAATYAAAABAAAAAAAF9eEAAQAAAAV0b1gxNgAAAAIAAAAHb3JpZ1ZhbAAAAA1vcmlnU2NhbGVNdWx0CQABPAAAAAMJAAE2AAAAAQUAAAAHb3JpZ1ZhbAUAAAAJQklHTVVMVDE2CQABNgAAAAEFAAAADW9yaWdTY2FsZU11bHQBAAAAB2Zyb21YMTYAAAACAAAAA3ZhbAAAAA9yZXN1bHRTY2FsZU11bHQJAAGgAAAAAQkAATwAAAADBQAAAAN2YWwJAAE2AAAAAQUAAAAPcmVzdWx0U2NhbGVNdWx0BQAAAAlCSUdNVUxUMTYAAAABAAAAAWkBAAAAEWNhbGNTd2FwTGltaXRNQVRIAAAAAQAAAAtnTnNidEFtb3VudAQAAAAVdXNkblN3YXBEZWxheUR1cmF0aW9uAAAAAAAAAAACBAAAABJnTnNidEFtb3VudFNjYWxlMTYJAQAAAAV0b1gxNgAAAAIFAAAAC2dOc2J0QW1vdW50BQAAAAZzY2FsZTYEAAAACGV1bGVyWDE2CQEAAAAFdG9YMTYAAAACBQAAAAtFVUxFUk5VTUJFUgUAAAAETVVMVAQAAAAMbGltaXRQb3dQYXJ0CQAAdgAAAAYFAAAAEmdOc2J0QW1vdW50U2NhbGUxNgAAAAAAAAAAEAUAAAAIZXVsZXJYMTYAAAAAAAAAABAAAAAAAAAAAAgFAAAABERPV04EAAAABWxpbWl0CQABPAAAAAMJAAE2AAAAAQUAAAAVdXNkblN3YXBEZWxheUR1cmF0aW9uBQAAAAxsaW1pdFBvd1BhcnQFAAAADHNjYWxlOEJpZ0ludAkABRQAAAACBQAAAANuaWwJAAGgAAAAAQUAAAAFbGltaXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleasPm+c=", "height": 1939183, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DDFFrxNRGzvLgardas7671s5bPLUVBv6ic3EBjXxTvPU Next: 65kK58X4k1yxS26fMCyYwCYroC1fynSo95W55HgC3mLP Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let WAVELET = 100000000 | |
5 | + | ||
6 | + | let PAULI = 1000000 | |
7 | + | ||
8 | + | let BIGPAULI = toBigInt(1000000) | |
9 | + | ||
10 | + | let PRICELET = 1000000 | |
11 | + | ||
12 | + | let MULT = 100000000 | |
13 | + | ||
14 | + | let BIGMULT16 = toBigInt(10000000000000000) | |
15 | + | ||
16 | + | let MULTSCALE = 8 | |
17 | + | ||
18 | + | let SCALE16 = 16 | |
19 | + | ||
20 | + | let SEP = "__" | |
21 | + | ||
22 | + | let HALF8 = 50000000 | |
23 | + | ||
24 | + | let EULERNUMBER = 271828182 | |
25 | + | ||
26 | + | let scale6 = 1000000 | |
27 | + | ||
28 | + | let scale6BigInt = toBigInt(1000000) | |
29 | + | ||
30 | + | let scale8BigInt = toBigInt(100000000) | |
31 | + | ||
32 | + | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult)) | |
33 | + | ||
34 | + | ||
35 | + | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16)) | |
4 | 36 | ||
5 | 37 | ||
6 | 38 | @Callable(i) | |
7 | - | func call () = { | |
8 | - | let inv = invoke(addressFromStringValue("3MsNbupKQ1Zf5yVo952AkFiKu2rh4oevWeC"), "lockNeutrinoSP", ["3NBuZ23GzYDfjjNYPY1PHmpMB8Db3a6n3M5", 100], [AttachedPayment(fromBase58String("25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 100000)]) | |
9 | - | if ((inv == inv)) | |
10 | - | then [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", "")] | |
11 | - | else throw("Strict value is not equal to itself.") | |
12 | - | } | |
13 | - | ||
14 | - | ||
15 | - | ||
16 | - | @Callable(i) | |
17 | - | func callUnlock () = { | |
18 | - | let inv = invoke(addressFromStringValue("3MsNbupKQ1Zf5yVo952AkFiKu2rh4oevWeC"), "unlockNeutrino", [100000, "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"], nil) | |
19 | - | if ((inv == inv)) | |
20 | - | then [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", "")] | |
21 | - | else throw("Strict value is not equal to itself.") | |
22 | - | } | |
23 | - | ||
24 | - | ||
25 | - | ||
26 | - | @Callable(i) | |
27 | - | func checkBalancest () = { | |
28 | - | let payment = value(i.payments[0]) | |
29 | - | let availableWaves = wavesBalance(this).available | |
30 | - | let availablePlusPayment = (availableWaves + payment.amount) | |
31 | - | let txId = toBase58String(i.transactionId) | |
32 | - | [IntegerEntry(("payment " + txId), payment.amount), IntegerEntry(("before " + txId), availableWaves), IntegerEntry(("after " + txId), availablePlusPayment)] | |
39 | + | func calcSwapLimitMATH (gNsbtAmount) = { | |
40 | + | let usdnSwapDelayDuration = 2 | |
41 | + | let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6) | |
42 | + | let eulerX16 = toX16(EULERNUMBER, MULT) | |
43 | + | let limitPowPart = pow(gNsbtAmountScale16, 16, eulerX16, 16, 8, DOWN) | |
44 | + | let limit = fraction(toBigInt(usdnSwapDelayDuration), limitPowPart, scale8BigInt) | |
45 | + | $Tuple2(nil, toInt(limit)) | |
33 | 46 | } | |
34 | 47 | ||
35 | 48 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let WAVELET = 100000000 | |
5 | + | ||
6 | + | let PAULI = 1000000 | |
7 | + | ||
8 | + | let BIGPAULI = toBigInt(1000000) | |
9 | + | ||
10 | + | let PRICELET = 1000000 | |
11 | + | ||
12 | + | let MULT = 100000000 | |
13 | + | ||
14 | + | let BIGMULT16 = toBigInt(10000000000000000) | |
15 | + | ||
16 | + | let MULTSCALE = 8 | |
17 | + | ||
18 | + | let SCALE16 = 16 | |
19 | + | ||
20 | + | let SEP = "__" | |
21 | + | ||
22 | + | let HALF8 = 50000000 | |
23 | + | ||
24 | + | let EULERNUMBER = 271828182 | |
25 | + | ||
26 | + | let scale6 = 1000000 | |
27 | + | ||
28 | + | let scale6BigInt = toBigInt(1000000) | |
29 | + | ||
30 | + | let scale8BigInt = toBigInt(100000000) | |
31 | + | ||
32 | + | func toX16 (origVal,origScaleMult) = fraction(toBigInt(origVal), BIGMULT16, toBigInt(origScaleMult)) | |
33 | + | ||
34 | + | ||
35 | + | func fromX16 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), BIGMULT16)) | |
4 | 36 | ||
5 | 37 | ||
6 | 38 | @Callable(i) | |
7 | - | func call () = { | |
8 | - | let inv = invoke(addressFromStringValue("3MsNbupKQ1Zf5yVo952AkFiKu2rh4oevWeC"), "lockNeutrinoSP", ["3NBuZ23GzYDfjjNYPY1PHmpMB8Db3a6n3M5", 100], [AttachedPayment(fromBase58String("25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 100000)]) | |
9 | - | if ((inv == inv)) | |
10 | - | then [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", "")] | |
11 | - | else throw("Strict value is not equal to itself.") | |
12 | - | } | |
13 | - | ||
14 | - | ||
15 | - | ||
16 | - | @Callable(i) | |
17 | - | func callUnlock () = { | |
18 | - | let inv = invoke(addressFromStringValue("3MsNbupKQ1Zf5yVo952AkFiKu2rh4oevWeC"), "unlockNeutrino", [100000, "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"], nil) | |
19 | - | if ((inv == inv)) | |
20 | - | then [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", "")] | |
21 | - | else throw("Strict value is not equal to itself.") | |
22 | - | } | |
23 | - | ||
24 | - | ||
25 | - | ||
26 | - | @Callable(i) | |
27 | - | func checkBalancest () = { | |
28 | - | let payment = value(i.payments[0]) | |
29 | - | let availableWaves = wavesBalance(this).available | |
30 | - | let availablePlusPayment = (availableWaves + payment.amount) | |
31 | - | let txId = toBase58String(i.transactionId) | |
32 | - | [IntegerEntry(("payment " + txId), payment.amount), IntegerEntry(("before " + txId), availableWaves), IntegerEntry(("after " + txId), availablePlusPayment)] | |
39 | + | func calcSwapLimitMATH (gNsbtAmount) = { | |
40 | + | let usdnSwapDelayDuration = 2 | |
41 | + | let gNsbtAmountScale16 = toX16(gNsbtAmount, scale6) | |
42 | + | let eulerX16 = toX16(EULERNUMBER, MULT) | |
43 | + | let limitPowPart = pow(gNsbtAmountScale16, 16, eulerX16, 16, 8, DOWN) | |
44 | + | let limit = fraction(toBigInt(usdnSwapDelayDuration), limitPowPart, scale8BigInt) | |
45 | + | $Tuple2(nil, toInt(limit)) | |
33 | 46 | } | |
34 | 47 | ||
35 | 48 | ||
36 | 49 | @Verifier(tx) | |
37 | 50 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
38 | 51 |
github/deemru/w8io/169f3d6 31.33 ms ◑