tx · BRy3tyrs2Uq5MSrD5dQT9ukQF4tvTFciVg2hhr5z6HUs 3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc: -0.00700000 Waves 2022.08.08 12:06 [2175282] smart account 3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc > SELF 0.00000000 Waves
{ "type": 13, "id": "BRy3tyrs2Uq5MSrD5dQT9ukQF4tvTFciVg2hhr5z6HUs", "fee": 700000, "feeAssetId": null, "timestamp": 1659949700628, "version": 2, "chainId": 84, "sender": "3N1PSeoq2yc1MWP4pXAtVK6VUUE5zvH24gc", "senderPublicKey": "FqZgs8PK3Pxq9oFfuCik8VrHfas2rFv5KxKwyHXRBafX", "proofs": [ "B6MvVDajX3aRgFtcAgv7ruHcx4FVtznJGLKt74HjTf9vTK9oWVTexbkCtZuaV1cMAJurkkTqi9yqejBQPM4ByTA" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAEBAAAAB2dldERhdGEAAAACAAAAA2FkcgAAAANrZXkEAAAABGRhdGEEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAADYWRyBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAABQAAAARkYXRhAAAAAQAAAAFpAQAAAAZzdGF0dXMAAAACAAAAC3Bvc2l0aW9uS2V5AAAAC3BpZWxBZGRyZXNzBAAAAA9jdXN0b21lckFkZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAARY3VzdG9tZXJQdWJsaWNLZXkJAAJYAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BAAAAA9wb3NpdGlvbktleURhdGEJAQAAAAdnZXREYXRhAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAPY3VzdG9tZXJBZGRyZXNzBQAAAAtwb3NpdGlvbktleQQAAAAQcG9zaXRpb25LZXlT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IBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVCPSnU=", "height": 2175282, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 12uePdz9rM412Q1DzkbCadnv7c67KMALpxVL813JL5VJ Next: TwMkmJ7wj8yDKs2qfNjZDdGR9dJmpDHY7WLrRwTj1Cj Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | func status (positionKey,pielAddress) = { | |
17 | 17 | let customerAddress = toBase58String(i.caller.bytes) | |
18 | 18 | let customerPublicKey = toBase58String(i.callerPublicKey) | |
19 | + | let positionKeyData = getData(addressFromStringValue(customerAddress), positionKey) | |
19 | 20 | let positionKeySplit = split(positionKey, "_") | |
20 | 21 | let positionQuantity = positionKeySplit[1] | |
21 | 22 | let priceListForQuantitiesKey = (positionKeySplit[0] + "_hash") | |
46 | 47 | } | |
47 | 48 | let priceListKey = (((positionKeySplit[0] + "_") + toString(result)) + "_hash") | |
48 | 49 | let data = getData(addressFromStringValue(pielAddress), priceListKey) | |
49 | - | [StringEntry((positionKeySplit[0] + "_ | |
50 | + | [StringEntry((positionKeySplit[0] + "_PriceListKey_Data"), data), StringEntry((positionKeySplit[0] + "_Customer_Position_Data"), positionKeyData)] | |
50 | 51 | } | |
51 | 52 | ||
52 | 53 |
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 | + | let positionKeyData = getData(addressFromStringValue(customerAddress), positionKey) | |
19 | 20 | let positionKeySplit = split(positionKey, "_") | |
20 | 21 | let positionQuantity = positionKeySplit[1] | |
21 | 22 | let priceListForQuantitiesKey = (positionKeySplit[0] + "_hash") | |
22 | 23 | let priceListForQuantitiesValue = getData(addressFromStringValue(pielAddress), priceListForQuantitiesKey) | |
23 | 24 | let priceListForQuantitiesValueToList = split(priceListForQuantitiesValue, "_") | |
24 | 25 | let positionQuantityInt = parseIntValue(positionQuantity) | |
25 | 26 | func find (accum,nextValue) = { | |
26 | 27 | let priceListQuantityInt = parseIntValue(nextValue) | |
27 | 28 | if ((positionQuantityInt >= priceListQuantityInt)) | |
28 | 29 | then priceListQuantityInt | |
29 | 30 | else accum | |
30 | 31 | } | |
31 | 32 | ||
32 | 33 | let iterations = size(priceListForQuantitiesValueToList) | |
33 | 34 | let result = { | |
34 | 35 | let $l = priceListForQuantitiesValueToList | |
35 | 36 | let $s = size($l) | |
36 | 37 | let $acc0 = 0 | |
37 | 38 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
38 | 39 | then $a | |
39 | 40 | else find($a, $l[$i]) | |
40 | 41 | ||
41 | 42 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
42 | 43 | then $a | |
43 | 44 | else throw("List size exceeds 5") | |
44 | 45 | ||
45 | 46 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
46 | 47 | } | |
47 | 48 | let priceListKey = (((positionKeySplit[0] + "_") + toString(result)) + "_hash") | |
48 | 49 | let data = getData(addressFromStringValue(pielAddress), priceListKey) | |
49 | - | [StringEntry((positionKeySplit[0] + "_ | |
50 | + | [StringEntry((positionKeySplit[0] + "_PriceListKey_Data"), data), StringEntry((positionKeySplit[0] + "_Customer_Position_Data"), positionKeyData)] | |
50 | 51 | } | |
51 | 52 | ||
52 | 53 | ||
53 | 54 | @Verifier(tx) | |
54 | 55 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
55 | 56 |
github/deemru/w8io/169f3d6 73.32 ms ◑