tx · EJdy4hgTuy1MnGiBhiUEazBqjshYxoFXoiViSyrbbCtH 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN: -0.01000000 Waves 2021.12.03 21:11 [1818450] smart account 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN > SELF 0.00000000 Waves
{ "type": 13, "id": "EJdy4hgTuy1MnGiBhiUEazBqjshYxoFXoiViSyrbbCtH", "fee": 1000000, "feeAssetId": null, "timestamp": 1638555107499, "version": 2, "chainId": 84, "sender": "3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN", "senderPublicKey": "3TJhvM5a7VSAiRyvEVwygRkiPC9ow5nM4LQ252H4vxWK", "proofs": [ "24b8Qa8eVFyDHHqHAtgieiFaUUmFYR16MQHqovVLyCy785VnPJ8rAm3YUoEqhjWWZCGtMKVSQD5NbS9LYVgkyXip" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAGbWFzdGVyAgAAACMzTXVXNHQxakNYSHQ4V1JzSFZMVWFyMzJFbnZKeFphUVdBeAAAAAAFc2VwYXICAAAABXx8fHx8AAAAAQAAAAFpAQAAAAVwYWludAAAAAEAAAAFaWRhdGEEAAAADGNhbGxlckFkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAVwaXh4eQkABLUAAAACBQAAAAVpZGF0YQUAAAAFc2VwYXIEAAAABm51bWJlcgkAAZAAAAABBQAAAAVwaXh4eQQAAAAHcmVjb3JkcwUAAAADbmlsCgEAAAAHdmFsaWR4eQAAAAEAAAABeAQAAAAHJG1hdGNoMAkABLYAAAABCQABkQAAAAIFAAAABXBpeHh5BQAAAAF4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDADAwkAAGYAAAACCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEJAAGRAAAAAgUAAAAFcGl4eHkFAAAAAXgA//////////8JAABmAAAAAgAAAAAAA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AABBQAAAANuaWwFAAAABHVuaXQAAAAAZ58cFA==", "height": 1818450, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E6VmVzusyxqNG875Sz1xGZkEbWiMD1K2BkfVZa7tp5QZ Next: CQGq16gFx6uAwDyPJCnNF9kR6k1W7NQorceeapsbEF5T Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | func paint (idata) = { | |
10 | 10 | let callerAdress = toBase58String(i.caller.bytes) | |
11 | 11 | let pixxy = split(idata, separ) | |
12 | + | let number = size(pixxy) | |
12 | 13 | let records = nil | |
13 | 14 | func validxy (x) = match parseInt(pixxy[x]) { | |
14 | 15 | case a: Int => | |
28 | 29 | false | |
29 | 30 | } | |
30 | 31 | ||
31 | - | func makerecord (x) = if ((validxy(x) == false)) | |
32 | - | then ["--", "--"] | |
33 | - | else if ((getrecord(x) == false)) | |
34 | - | then [pixxy[x], makeString([callerAdress, "100", "color", "url"], separ)] | |
35 | - | else { | |
36 | - | let price = (parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) + 100) | |
37 | - | [pixxy[x], makeString([callerAdress, toString(price), "color", "url"], separ)] | |
38 | - | } | |
32 | + | func makerecord (x) = { | |
33 | + | let xx = max([x, (number - 1)]) | |
34 | + | if ((validxy(xx) == false)) | |
35 | + | then ["--", "--"] | |
36 | + | else if ((getrecord(xx) == false)) | |
37 | + | then [pixxy[xx], makeString([callerAdress, "100", "color", "url"], separ)] | |
38 | + | else { | |
39 | + | let price = (parseIntValue(split(getStringValue(pixxy[xx]), separ)[1]) + 100) | |
40 | + | [pixxy[xx], makeString([callerAdress, toString(price), "color", "url"], separ)] | |
41 | + | } | |
42 | + | } | |
39 | 43 | ||
40 | 44 | let all = [makerecord(0), makerecord(1), makerecord(2), makerecord(3), makerecord(4)] | |
41 | 45 | $Tuple2([StringEntry(all[0][0], all[0][1]), StringEntry(all[1][0], all[1][1]), StringEntry(all[2][0], all[2][1]), StringEntry(all[3][0], all[3][1]), StringEntry(all[4][0], all[4][1])], unit) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let master = "3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx" | |
5 | 5 | ||
6 | 6 | let separ = "|||||" | |
7 | 7 | ||
8 | 8 | @Callable(i) | |
9 | 9 | func paint (idata) = { | |
10 | 10 | let callerAdress = toBase58String(i.caller.bytes) | |
11 | 11 | let pixxy = split(idata, separ) | |
12 | + | let number = size(pixxy) | |
12 | 13 | let records = nil | |
13 | 14 | func validxy (x) = match parseInt(pixxy[x]) { | |
14 | 15 | case a: Int => | |
15 | 16 | if (if ((parseIntValue(pixxy[x]) > -1)) | |
16 | 17 | then (1000 > parseIntValue(pixxy[x])) | |
17 | 18 | else false) | |
18 | 19 | then parseInt(pixxy[x]) | |
19 | 20 | else false | |
20 | 21 | case _ => | |
21 | 22 | false | |
22 | 23 | } | |
23 | 24 | ||
24 | 25 | func getrecord (x) = match getString(pixxy[x]) { | |
25 | 26 | case a: String => | |
26 | 27 | a | |
27 | 28 | case _ => | |
28 | 29 | false | |
29 | 30 | } | |
30 | 31 | ||
31 | - | func makerecord (x) = if ((validxy(x) == false)) | |
32 | - | then ["--", "--"] | |
33 | - | else if ((getrecord(x) == false)) | |
34 | - | then [pixxy[x], makeString([callerAdress, "100", "color", "url"], separ)] | |
35 | - | else { | |
36 | - | let price = (parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) + 100) | |
37 | - | [pixxy[x], makeString([callerAdress, toString(price), "color", "url"], separ)] | |
38 | - | } | |
32 | + | func makerecord (x) = { | |
33 | + | let xx = max([x, (number - 1)]) | |
34 | + | if ((validxy(xx) == false)) | |
35 | + | then ["--", "--"] | |
36 | + | else if ((getrecord(xx) == false)) | |
37 | + | then [pixxy[xx], makeString([callerAdress, "100", "color", "url"], separ)] | |
38 | + | else { | |
39 | + | let price = (parseIntValue(split(getStringValue(pixxy[xx]), separ)[1]) + 100) | |
40 | + | [pixxy[xx], makeString([callerAdress, toString(price), "color", "url"], separ)] | |
41 | + | } | |
42 | + | } | |
39 | 43 | ||
40 | 44 | let all = [makerecord(0), makerecord(1), makerecord(2), makerecord(3), makerecord(4)] | |
41 | 45 | $Tuple2([StringEntry(all[0][0], all[0][1]), StringEntry(all[1][0], all[1][1]), StringEntry(all[2][0], all[2][1]), StringEntry(all[3][0], all[3][1]), StringEntry(all[4][0], all[4][1])], unit) | |
42 | 46 | } | |
43 | 47 | ||
44 | 48 |
github/deemru/w8io/026f985 23.30 ms ◑