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