tx · 7sHDZV4g4VBfLgRa3SkmRmme1a6BLN6PRLw1ef49AfRp 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN: -0.01000000 Waves 2021.12.04 15:36 [1819536] smart account 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN > SELF 0.00000000 Waves
{ "type": 13, "id": "7sHDZV4g4VBfLgRa3SkmRmme1a6BLN6PRLw1ef49AfRp", "fee": 1000000, "feeAssetId": null, "timestamp": 1638621378191, "version": 2, "chainId": 84, "sender": "3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN", "senderPublicKey": "3TJhvM5a7VSAiRyvEVwygRkiPC9ow5nM4LQ252H4vxWK", "proofs": [ "3pGg9fJt2ohDYdaxHYhn11Vov35KgK5wjX8eUd2ZHHNfEnVCb496oM3r471oyDKGdoXJ2hMsdaJF4FsKwpzVmQ8u" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAAAgAAAAAGbWFzdGVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUPUYGSQjhSwi99Mcha5hyYJjHFzCelkk9AAAAAAVzZXBhcgIAAAAFfHx8fHwAAAABAAAAAWkBAAAABXBhaW50AAAAAQAAAAVpZGF0YQQAAAAMY2FsbGVyQWRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXBpeHh5CQAEtQAAAAIFAAAABWlkYXRhBQAAAAVzZXBhcgQAAAAGbnVtYmVyCQABkAAAAAEFAAAABXBpeHh5BAAAAAdyZWNvcmRzBQAAAANuaWwKAQAAAAd2YWxpZHh5AAAAAQAAAAF4BAAAAAckbWF0Y2gwCQAEtgAAAAEJAAGRAAAAAgUAAAAFcGl4eHkFAAAAAXgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAMDCQAAZgAAAAIJAQAAAA1wYXJzZUludFZhbHVlAAAAAQkAAZEAAAACBQAAAAVwaXh4eQUAAAABeAD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AQAAAAAAAAAAAwUAAAAEdW5pdAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAACAAAAAAAAAAAACQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAACAAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAABm1hc3RlcgkBAAAADXBhcnNlSW50VmFsdWUAAAABCQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAACAAAAAAAAAAADBQAAAAR1bml0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAMAAAAAAAAAAAAJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAMAAAAAAAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAGbWFzdGVyCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAMAAAAAAAAAAAMFAAAABHVuaXQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAAZEAAAACCQABkQAAAAIFAAAAA2FsbAAAAAAAAAAABAAAAAAAAAAAAAkAAZEAAAACCQABkQAAAAIFAAAAA2FsbAAAAAAAAAAABAAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAZtYXN0ZXIJAQAAAA1wYXJzZUludFZhbHVlAAAAAQkAAZEAAAACCQABkQAAAAIFAAAAA2FsbAAAAAAAAAAABAAAAAAAAAAAAwUAAAAEdW5pdAUAAAADbmlsBQAAAAR1bml0AAAAAFM73Ok=", "height": 1819536, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: osURRcE9FcC919a4fyikXucUoEnuA7uEYXr33VyeYJJ Next: GFF4yai6QA57xNNhYbQZPakBFgw8bciA6cQ9z1n5xYxt Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let master = Address(base58'3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx') | |
5 | 5 | ||
6 | - | let | |
6 | + | let separ = "|||||" | |
7 | 7 | ||
8 | - | func getAnswer (question,previousAnswer) = { | |
9 | - | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | - | let index = toInt(hash) | |
11 | - | answers[(index % answersCount)] | |
8 | + | @Callable(i) | |
9 | + | func paint (idata) = { | |
10 | + | let callerAdress = toBase58String(i.caller.bytes) | |
11 | + | let pixxy = split(idata, separ) | |
12 | + | let number = size(pixxy) | |
13 | + | let records = nil | |
14 | + | func validxy (x) = match parseInt(pixxy[x]) { | |
15 | + | case a: Int => | |
16 | + | if (if ((parseIntValue(pixxy[x]) > -1)) | |
17 | + | then (1000 > parseIntValue(pixxy[x])) | |
18 | + | else false) | |
19 | + | then parseInt(pixxy[x]) | |
20 | + | else false | |
21 | + | case _ => | |
22 | + | false | |
12 | 23 | } | |
13 | 24 | ||
25 | + | func getrecord (x) = match getString(pixxy[x]) { | |
26 | + | case a: String => | |
27 | + | a | |
28 | + | case _ => | |
29 | + | false | |
30 | + | } | |
14 | 31 | ||
15 | - | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
16 | - | case a: String => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | address | |
20 | - | } | |
32 | + | func makerecord (x) = if ((x > (number - 1))) | |
33 | + | then ["--", "--"] | |
34 | + | else if ((validxy(x) == false)) | |
35 | + | then ["--", "--"] | |
36 | + | else if ((getrecord(x) == false)) | |
37 | + | then [pixxy[x], makeString([callerAdress, "100", "color", "url"], separ), "", "100"] | |
38 | + | else { | |
39 | + | let price = parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) | |
40 | + | [pixxy[x], makeString([callerAdress, toString((price + 100)), "color", "url"], separ), "", toString(price)] | |
41 | + | } | |
21 | 42 | ||
22 | - | ||
23 | - | @Callable(i) | |
24 | - | func tellme (question) = { | |
25 | - | let callerAddress = toBase58String(i.caller.bytes) | |
26 | - | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | - | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) | |
43 | + | let payment = 0 | |
44 | + | let all = [makerecord(0), makerecord(1), makerecord(2), makerecord(3), makerecord(4)] | |
45 | + | $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) | |
28 | 46 | } | |
29 | 47 | ||
30 | 48 |
github/deemru/w8io/026f985 44.03 ms ◑