tx · TwMkmJ7wj8yDKs2qfNjZDdGR9dJmpDHY7WLrRwTj1Cj 3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc: -0.00700000 Waves 2022.08.08 12:13 [2175287] smart account 3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc > SELF 0.00000000 Waves
{ "type": 13, "id": "TwMkmJ7wj8yDKs2qfNjZDdGR9dJmpDHY7WLrRwTj1Cj", "fee": 700000, "feeAssetId": null, "timestamp": 1659950044195, "version": 2, "chainId": 84, "sender": "3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc", "senderPublicKey": "FqZgs8PK3Pxq9oFfuCik8VrHfas2rFv5KxKwyHXRBafX", "proofs": [ "3RKVFAv5nwSiDkSC1DDV3D937nCpt3HgHsVgk9hm7ht6bYABrxghGmC4T65AwaBsdDAt7xmrozJLqh8U3QzEhCA3" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAEBAAAAB2dldERhdGEAAAACAAAAA2FkcgAAAANrZXkEAAAABGRhdGEEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAADYWRyBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAABQAAAARkYXRhAAAAAQAAAAFpAQAAAAZzdGF0dXMAAAACAAAAC3Bvc2l0aW9uS2V5AAAAC3BpZWxBZGRyZXNzBAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAARY3VzdG9tZXJQdWJsaWNLZXkJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BAAAAA9wb3NpdGlvbktleURhdGEJAQAAAAdnZXREYXRhAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAtwb3NpdGlvbktleQQAAAAQcG9zaXRpb25LZ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B1YmxpY0tleQIAAAAMX3N0YXR1c1RleHRfBQAAAAl0aW1lc3RhbXACAAAAK1N0YWZmZWxwcmVpcyBlbnRzcHJpY2h0IGRlbSBQb3NpdGlvbnNwcmVpcy4FAAAAA25pbAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAARY3VzdG9tZXJQdWJsaWNLZXkCAAAADF9zdGF0dXNDb2RlXwUAAAAJdGltZXN0YW1wAgAAAAVlcnJvcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAARY3VzdG9tZXJQdWJsaWNLZXkCAAAADF9zdGF0dXNUZXh0XwUAAAAJdGltZXN0YW1wAgAAADFTdGFmZmVscHJlaXMgZW50c3ByaWNodCBuaWNodCBkZW0gUG9zaXRpb25zcHJlaXMuBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVGVa+8=", "height": 2175287, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BRy3tyrs2Uq5MSrD5dQT9ukQF4tvTFciVg2hhr5z6HUs Next: FmHEKjFQAW2uuXXzkabJStAUxSSne9j66Z6maWYYzZj1 Diff:
Old | New | Differences | |
---|---|---|---|
18 | 18 | let customerPublicKey = toBase58String(i.callerPublicKey) | |
19 | 19 | let positionKeyData = getData(addressFromStringValue(customerAddress), positionKey) | |
20 | 20 | let positionKeySplit = split(positionKey, "_") | |
21 | + | let timestamp = positionKeySplit[2] | |
21 | 22 | let positionQuantity = positionKeySplit[1] | |
22 | 23 | let priceListForQuantitiesKey = (positionKeySplit[0] + "_hash") | |
23 | 24 | let priceListForQuantitiesValue = getData(addressFromStringValue(pielAddress), priceListForQuantitiesKey) | |
47 | 48 | } | |
48 | 49 | let priceListKey = (((positionKeySplit[0] + "_") + toString(result)) + "_hash") | |
49 | 50 | let data = getData(addressFromStringValue(pielAddress), priceListKey) | |
50 | - | [StringEntry((positionKeySplit[0] + "_PriceListKey_Data"), data), StringEntry((positionKeySplit[0] + "_Customer_Position_Data"), positionKeyData)] | |
51 | + | if ((data == positionKeyData)) | |
52 | + | then [StringEntry(((customerPublicKey + "_statusCode_") + timestamp), "success"), StringEntry(((customerPublicKey + "_statusText_") + timestamp), "Staffelpreis entspricht dem Positionspreis.")] | |
53 | + | else [StringEntry(((customerPublicKey + "_statusCode_") + timestamp), "error"), StringEntry(((customerPublicKey + "_statusText_") + timestamp), "Staffelpreis entspricht nicht dem Positionspreis.")] | |
51 | 54 | } | |
52 | 55 | ||
53 | 56 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getData (adr,key) = { | |
5 | 5 | let data = match getString(adr, key) { | |
6 | 6 | case a: String => | |
7 | 7 | a | |
8 | 8 | case _ => | |
9 | 9 | "" | |
10 | 10 | } | |
11 | 11 | data | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(i) | |
16 | 16 | func status (positionKey,pielAddress) = { | |
17 | 17 | let customerAddress = toBase58String(i.caller.bytes) | |
18 | 18 | let customerPublicKey = toBase58String(i.callerPublicKey) | |
19 | 19 | let positionKeyData = getData(addressFromStringValue(customerAddress), positionKey) | |
20 | 20 | let positionKeySplit = split(positionKey, "_") | |
21 | + | let timestamp = positionKeySplit[2] | |
21 | 22 | let positionQuantity = positionKeySplit[1] | |
22 | 23 | let priceListForQuantitiesKey = (positionKeySplit[0] + "_hash") | |
23 | 24 | let priceListForQuantitiesValue = getData(addressFromStringValue(pielAddress), priceListForQuantitiesKey) | |
24 | 25 | let priceListForQuantitiesValueToList = split(priceListForQuantitiesValue, "_") | |
25 | 26 | let positionQuantityInt = parseIntValue(positionQuantity) | |
26 | 27 | func find (accum,nextValue) = { | |
27 | 28 | let priceListQuantityInt = parseIntValue(nextValue) | |
28 | 29 | if ((positionQuantityInt >= priceListQuantityInt)) | |
29 | 30 | then priceListQuantityInt | |
30 | 31 | else accum | |
31 | 32 | } | |
32 | 33 | ||
33 | 34 | let iterations = size(priceListForQuantitiesValueToList) | |
34 | 35 | let result = { | |
35 | 36 | let $l = priceListForQuantitiesValueToList | |
36 | 37 | let $s = size($l) | |
37 | 38 | let $acc0 = 0 | |
38 | 39 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
39 | 40 | then $a | |
40 | 41 | else find($a, $l[$i]) | |
41 | 42 | ||
42 | 43 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
43 | 44 | then $a | |
44 | 45 | else throw("List size exceeds 5") | |
45 | 46 | ||
46 | 47 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
47 | 48 | } | |
48 | 49 | let priceListKey = (((positionKeySplit[0] + "_") + toString(result)) + "_hash") | |
49 | 50 | let data = getData(addressFromStringValue(pielAddress), priceListKey) | |
50 | - | [StringEntry((positionKeySplit[0] + "_PriceListKey_Data"), data), StringEntry((positionKeySplit[0] + "_Customer_Position_Data"), positionKeyData)] | |
51 | + | if ((data == positionKeyData)) | |
52 | + | then [StringEntry(((customerPublicKey + "_statusCode_") + timestamp), "success"), StringEntry(((customerPublicKey + "_statusText_") + timestamp), "Staffelpreis entspricht dem Positionspreis.")] | |
53 | + | else [StringEntry(((customerPublicKey + "_statusCode_") + timestamp), "error"), StringEntry(((customerPublicKey + "_statusText_") + timestamp), "Staffelpreis entspricht nicht dem Positionspreis.")] | |
51 | 54 | } | |
52 | 55 | ||
53 | 56 | ||
54 | 57 | @Verifier(tx) | |
55 | 58 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
56 | 59 |
github/deemru/w8io/026f985 35.27 ms ◑