tx · GZEjeJwgszDe4pCv5UL6qi6aZb6gYSknPMrhqtPAQTzs 3N22BYqtPzVTSgJBrhE8yYUSZPRCmkXmtcP: -0.05000000 Waves 2021.09.28 01:15 [1721943] smart account 3N22BYqtPzVTSgJBrhE8yYUSZPRCmkXmtcP > SELF 0.00000000 Waves
{ "type": 13, "id": "GZEjeJwgszDe4pCv5UL6qi6aZb6gYSknPMrhqtPAQTzs", "fee": 5000000, "feeAssetId": null, "timestamp": 1632780979032, "version": 2, "chainId": 84, "sender": "3N22BYqtPzVTSgJBrhE8yYUSZPRCmkXmtcP", "senderPublicKey": "2uZLPvTfcSdSqd6m8q85ZpiWEmxSkGWzb5ocbziqSzCj", "proofs": [ "52pwuGjbcP1bZLb3s5p1Q6H7xz5Q9qaBbuRmJaoxanTa6WPA9DKYHC76jcZ5SmXtp4Kw7AtKWbHTpEUic13B5Neo" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgMKAQgSBwoFCAQCARgSCgoICAQCARgRFBIAAAAEAQAAABFrZXlBY2N1bXVsYXRlZEZlZQAAAAACAAAAEiVzX19hY2N1bXVsYXRlZEZlZQAAAAAGc2NhbGU4AAAAAAAF9eEAAAAAAAhCVUZTQ0FMRQkAATYAAAABAA3gtrOnZAAAAQAAAB1jb252ZXJ0UHJpY2VBc3NldEludG9JZG9Bc3NldAAAAAUAAAAQcHJpY2VBc3NldEFtb3VudAAAAA5wcmljZUFzc2V0TVVMVAAAAAVwcmljZQAAAAlwcmljZU1VTFQAAAAMaWRvQXNzZXRNVUxUBAAAAApiUHJpY2VNVUxUCQABNgAAAAEFAAAADnByaWNlQXNzZXRNVUxUBAAAAA5iUHJpY2VBc3NldEJVRgkAATwAAAADCQABNgAAAAEFAAAAEHByaWNlQXNzZXRBbW91bnQFAAAACEJVRlNDQUxFBQAAAApiUHJpY2VNVUxUBAAAAA9iQW1vdW50QXNzZXRCVUYJAAE8AAAAAwUAAAAOYlByaWNlQXNzZXRCVUYFAAAACmJQcmljZU1VTF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EAAAAMQm9vbGVhbkVudHJ5AAAAAgIAAAAObGlzdEJvb2xQYXJhbTEJAAGRAAAAAgUAAAAIYXJnc0Jvb2wAAAAAAAAAAAAJAARMAAAAAgkBAAAADEJvb2xlYW5FbnRyeQAAAAICAAAADmxpc3RCb29sUGFyYW0yCQABkQAAAAIFAAAACGFyZ3NCb29sAAAAAAAAAAABCQAETAAAAAIJAQAAAAtCaW5hcnlFbnRyeQAAAAICAAAAEGxpc3RCaW5hcnlQYXJhbTMJAAGRAAAAAgUAAAAKYXJnc0JpbmFyeQAAAAAAAAAAAAkABEwAAAACCQEAAAALQmluYXJ5RW50cnkAAAACAgAAABBsaXN0QmluYXJ5UGFyYW0zCQABkQAAAAIFAAAACmFyZ3NCaW5hcnkAAAAAAAAAAAEFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5NKrWjg==", "height": 1721943, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Du6JpR7vpKTcQhTBhSDeTaXkJHm2Mv84oGWjQcsrcjsS Next: 8rEmQeouSYbjJ44mZBLT36Vfwzz3Yrun3NndQvudgWon Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | func keyAccumulatedFee () = "%s__accumulatedFee" | |
5 | 5 | ||
6 | 6 | ||
7 | + | let scale8 = 100000000 | |
8 | + | ||
9 | + | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | + | ||
11 | + | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
12 | + | let bPriceMULT = toBigInt(priceAssetMULT) | |
13 | + | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceMULT) | |
14 | + | let bAmountAssetBUF = fraction(bPriceAssetBUF, bPriceMULT, toBigInt(price)) | |
15 | + | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
16 | + | } | |
17 | + | ||
18 | + | ||
7 | 19 | @Callable(i) | |
8 | 20 | func ordinal () = { | |
21 | + | let amountAssetAmt = 1000000000 | |
22 | + | let priceAssetAmt = 30000000000 | |
23 | + | let bAmountAssetBUF = fraction(toBigInt(amountAssetAmt), BUFSCALE, toBigInt(scale8)) | |
24 | + | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmt), BUFSCALE, toBigInt(scale8)) | |
9 | 25 | let partA = pow(toBigInt(1000000000), 0, toBigInt(5), 1, 0, DOWN) | |
10 | 26 | let partB = pow(toBigInt(30000000000), 0, toBigInt(5), 1, 0, DOWN) | |
11 | 27 | let result = (partA * partB) | |
12 | - | let partABigInt = pow( | |
13 | - | let partBBigInt = pow( | |
28 | + | let partABigInt = pow(bAmountAssetBUF, 0, toBigInt(5), 1, 0, DOWN) | |
29 | + | let partBBigInt = pow(bPriceAssetBUF, 0, toBigInt(5), 1, 0, DOWN) | |
14 | 30 | let res2 = (partABigInt * partBBigInt) | |
15 | - | let result2 = (res2 | |
31 | + | let result2 = fraction(res2, toBigInt(scale8), BUFSCALE) | |
16 | 32 | [IntegerEntry("ordinal", toInt(result)), IntegerEntry("bigInt", toInt(result2))] | |
17 | 33 | } | |
18 | 34 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func keyAccumulatedFee () = "%s__accumulatedFee" | |
5 | 5 | ||
6 | 6 | ||
7 | + | let scale8 = 100000000 | |
8 | + | ||
9 | + | let BUFSCALE = toBigInt(1000000000000000000) | |
10 | + | ||
11 | + | func convertPriceAssetIntoIdoAsset (priceAssetAmount,priceAssetMULT,price,priceMULT,idoAssetMULT) = { | |
12 | + | let bPriceMULT = toBigInt(priceAssetMULT) | |
13 | + | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmount), BUFSCALE, bPriceMULT) | |
14 | + | let bAmountAssetBUF = fraction(bPriceAssetBUF, bPriceMULT, toBigInt(price)) | |
15 | + | toInt(fraction(bAmountAssetBUF, toBigInt(idoAssetMULT), BUFSCALE)) | |
16 | + | } | |
17 | + | ||
18 | + | ||
7 | 19 | @Callable(i) | |
8 | 20 | func ordinal () = { | |
21 | + | let amountAssetAmt = 1000000000 | |
22 | + | let priceAssetAmt = 30000000000 | |
23 | + | let bAmountAssetBUF = fraction(toBigInt(amountAssetAmt), BUFSCALE, toBigInt(scale8)) | |
24 | + | let bPriceAssetBUF = fraction(toBigInt(priceAssetAmt), BUFSCALE, toBigInt(scale8)) | |
9 | 25 | let partA = pow(toBigInt(1000000000), 0, toBigInt(5), 1, 0, DOWN) | |
10 | 26 | let partB = pow(toBigInt(30000000000), 0, toBigInt(5), 1, 0, DOWN) | |
11 | 27 | let result = (partA * partB) | |
12 | - | let partABigInt = pow( | |
13 | - | let partBBigInt = pow( | |
28 | + | let partABigInt = pow(bAmountAssetBUF, 0, toBigInt(5), 1, 0, DOWN) | |
29 | + | let partBBigInt = pow(bPriceAssetBUF, 0, toBigInt(5), 1, 0, DOWN) | |
14 | 30 | let res2 = (partABigInt * partBBigInt) | |
15 | - | let result2 = (res2 | |
31 | + | let result2 = fraction(res2, toBigInt(scale8), BUFSCALE) | |
16 | 32 | [IntegerEntry("ordinal", toInt(result)), IntegerEntry("bigInt", toInt(result2))] | |
17 | 33 | } | |
18 | 34 | ||
19 | 35 | ||
20 | 36 | ||
21 | 37 | @Callable(i) | |
22 | 38 | func callMeDapp (stringParam1) = { | |
23 | 39 | let caller = i.caller | |
24 | 40 | [StringEntry("stringParam1", stringParam1), BooleanEntry("boolParam2", false)] | |
25 | 41 | } | |
26 | 42 | ||
27 | 43 | ||
28 | 44 | ||
29 | 45 | @Callable(i) | |
30 | 46 | func callMe (stringParam1,boolParam2,binaryParam3,intParam4,argsStr) = { | |
31 | 47 | let caller = i.caller | |
32 | 48 | [StringEntry("stringParam1", stringParam1), BooleanEntry("boolParam2", boolParam2), BinaryEntry("binaryParam3", binaryParam3), IntegerEntry("intParam4", intParam4), StringEntry("listStringParam1", argsStr[0]), StringEntry("listStringParam2", argsStr[1])] | |
33 | 49 | } | |
34 | 50 | ||
35 | 51 | ||
36 | 52 | ||
37 | 53 | @Callable(i) | |
38 | 54 | func callMe2 (stringParam1,boolParam2,binaryParam3,intParam4,argsStr,argsInt,argsBool,argsBinary) = { | |
39 | 55 | let caller = i.caller | |
40 | 56 | [StringEntry("stringParam1", stringParam1), BooleanEntry("boolParam2", boolParam2), BinaryEntry("binaryParam3", binaryParam3), IntegerEntry("intParam4", intParam4), StringEntry("listStringParam1", argsStr[0]), StringEntry("listStringParam2", argsStr[1]), IntegerEntry("listIntParam1", argsInt[0]), IntegerEntry("listIntParam2", argsInt[1]), BooleanEntry("listBoolParam1", argsBool[0]), BooleanEntry("listBoolParam2", argsBool[1]), BinaryEntry("listBinaryParam3", argsBinary[0]), BinaryEntry("listBinaryParam3", argsBinary[1])] | |
41 | 57 | } | |
42 | 58 | ||
43 | 59 | ||
44 | 60 | @Verifier(tx) | |
45 | 61 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
46 | 62 |
github/deemru/w8io/169f3d6 48.54 ms ◑