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