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