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