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