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