tx · 5vQniaBX6SHML2A5pUj53nqVzXW7BHLDpETGUb7VT7At 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6: -0.01000000 Waves 2021.12.05 12:03 [1820758] smart account 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6 > SELF 0.00000000 Waves
{ "type": 13, "id": "5vQniaBX6SHML2A5pUj53nqVzXW7BHLDpETGUb7VT7At", "fee": 1000000, "feeAssetId": null, "timestamp": 1638695023159, "version": 2, "chainId": 84, "sender": "3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6", "senderPublicKey": "2LizaCNygFYwGFKe34vvFHgJc4ckK7MpzRzziRNn56Cu", "proofs": [ "2X8J95Cp1Cvxtm6mQCei3ZUrtMB4XAU8VNEv2JWKeU21qmUyvcTWm4KUiNDsXMGfzPBZyLLqBoukwQs7cExCKPyc" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAAAwAAAAAGbWFzdGVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUPUYGSQjhSwi99Mcha5hyYJjHFzCelkk9AAAAAAVzZXBhcgIAAAAFfHx8fHwAAAAACWluaXRwcmljZQIAAAAGMTAwMDAwAAAAAQAAAAFpAQAAAAVwYWludAAAAAEAAAAFaWRhdGEEAAAADGNhbGxlckFkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwaXh4eQkABLUAAAACBQAAAAVpZGF0YQUAAAAFc2VwYXIEAAAABm51bWJlcgkAAZcAAAABCQAETAAAAAIAAAAAAAAAAAUJAARMAAAAAgkAAZAAAAABBQAAAAVwaXh4eQUAAAADbmlsBAAAAAxlbXB0eWNvbW1hbmQJAARMAAAAAgIAAAACLS0JAARMAAAAAgIAAAACLS0JAARMAAAAAgIAAAACLS0JAARMAAAAAgIAAAABMAUAAAADbmlsBAAAAAluZXdyZWNvcmQJAARMAAAAAgUAAAAMY2FsbGVyQWRyZXNzCQAETAAAAAIFAAAACWluaX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AAQAAAAAAAAAAAAJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAQAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAGbWFzdGVyCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAQAAAAAAAAAAAMFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQAAZQAAAAIIBQAAAANwbXQAAAAGYW1vdW50CQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEFAAAAB3BheW1lbnQFAAAABHVuaXQFAAAAA25pbAUAAAAEdW5pdAAAAABhk1MX", "height": 1820758, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GA5hRdmTHGfgFJjYVfvodgviQpQ7rVitKU6k81Y6M1eU Next: H7Hrvbzic1ZBB5ZSXtkHtRHVbK9tXtFiy7bwoJTwEk3X Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | else if ((getrecord(x) == "")) | |
40 | 40 | then [pixxy[x], makeString(newrecord, separ), "reciever=master", initprice] | |
41 | 41 | else { | |
42 | - | let price = parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) | |
43 | - | [pixxy[x], makeString([callerAdress, toString((price + parseIntValue(initprice))), "color", "url"], separ), "", toString(price)] | |
42 | + | let oldrecord = split(getStringValue(pixxy[x]), separ) | |
43 | + | let price = parseIntValue(oldrecord[1]) | |
44 | + | let receiver = oldrecord[0] | |
45 | + | [pixxy[x], makeString([callerAdress, toString((price + parseIntValue(initprice))), "color", "url"], separ), receiver, toString(price)] | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | let all = [command(0), command(1), command(2), command(3), command(4)] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let master = Address(base58'3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx') | |
5 | 5 | ||
6 | 6 | let separ = "|||||" | |
7 | 7 | ||
8 | 8 | let initprice = "100000" | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func paint (idata) = { | |
12 | 12 | let callerAdress = toBase58String(i.caller.bytes) | |
13 | 13 | let pixxy = split(idata, separ) | |
14 | 14 | let number = min([5, size(pixxy)]) | |
15 | 15 | let emptycommand = ["--", "--", "--", "0"] | |
16 | 16 | let newrecord = [callerAdress, initprice, "color", "url"] | |
17 | 17 | func validxy (x) = match parseInt(pixxy[x]) { | |
18 | 18 | case a: Int => | |
19 | 19 | if (if ((parseIntValue(pixxy[x]) > -1)) | |
20 | 20 | then (1000 > parseIntValue(pixxy[x])) | |
21 | 21 | else false) | |
22 | 22 | then parseIntValue(pixxy[x]) | |
23 | 23 | else -1 | |
24 | 24 | case _ => | |
25 | 25 | -1 | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | func getrecord (x) = match getString(pixxy[x]) { | |
29 | 29 | case a: String => | |
30 | 30 | getStringValue(pixxy[x]) | |
31 | 31 | case _ => | |
32 | 32 | "" | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | func command (x) = if (if ((x > (number - 1))) | |
36 | 36 | then true | |
37 | 37 | else (0 > validxy(x))) | |
38 | 38 | then emptycommand | |
39 | 39 | else if ((getrecord(x) == "")) | |
40 | 40 | then [pixxy[x], makeString(newrecord, separ), "reciever=master", initprice] | |
41 | 41 | else { | |
42 | - | let price = parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) | |
43 | - | [pixxy[x], makeString([callerAdress, toString((price + parseIntValue(initprice))), "color", "url"], separ), "", toString(price)] | |
42 | + | let oldrecord = split(getStringValue(pixxy[x]), separ) | |
43 | + | let price = parseIntValue(oldrecord[1]) | |
44 | + | let receiver = oldrecord[0] | |
45 | + | [pixxy[x], makeString([callerAdress, toString((price + parseIntValue(initprice))), "color", "url"], separ), receiver, toString(price)] | |
44 | 46 | } | |
45 | 47 | ||
46 | 48 | let all = [command(0), command(1), command(2), command(3), command(4)] | |
47 | 49 | let payment = toString(((((parseIntValue(all[0][3]) + parseIntValue(all[1][3])) + parseIntValue(all[2][3])) + parseIntValue(all[3][3])) + parseIntValue(all[4][3]))) | |
48 | 50 | let pmt = if ((size(i.payments) == 1)) | |
49 | 51 | then i.payments[0] | |
50 | 52 | else throw(((("Attached payment is required: " + payment) + " peymentstr=") + payment)) | |
51 | 53 | if (isDefined(pmt.assetId)) | |
52 | 54 | then throw("works with waves only") | |
53 | 55 | else if ((parseIntValue(payment) > pmt.amount)) | |
54 | 56 | then throw(((("you give: " + toString(pmt.amount)) + ", but deal needs: ") + payment)) | |
55 | 57 | else $Tuple2([StringEntry(all[0][0], all[0][1]), ScriptTransfer(master, parseIntValue(all[0][3]), unit), StringEntry(all[1][0], all[1][1]), ScriptTransfer(master, parseIntValue(all[1][3]), unit), StringEntry(all[2][0], all[2][1]), ScriptTransfer(master, parseIntValue(all[2][3]), unit), StringEntry(all[3][0], all[3][1]), ScriptTransfer(master, parseIntValue(all[3][3]), unit), StringEntry(all[4][0], all[4][1]), ScriptTransfer(master, parseIntValue(all[4][3]), unit), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(payment)), unit)], unit) | |
56 | 58 | } | |
57 | 59 | ||
58 | 60 |
github/deemru/w8io/169f3d6 50.57 ms ◑