tx · C3nPyi1xtrzm2sgd7XDQPCV7yhoe9g1GsTP4wqQ3LSn8 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN: -0.01000000 Waves 2021.12.04 10:19 [1819222] smart account 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN > SELF 0.00000000 Waves
{ "type": 13, "id": "C3nPyi1xtrzm2sgd7XDQPCV7yhoe9g1GsTP4wqQ3LSn8", "fee": 1000000, "feeAssetId": null, "timestamp": 1638602380628, "version": 2, "chainId": 84, "sender": "3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN", "senderPublicKey": "3TJhvM5a7VSAiRyvEVwygRkiPC9ow5nM4LQ252H4vxWK", "proofs": [ "49pHM6jdGNjs5Ccoaap4RVA8MJeZ8wHiJtBz1k2zNkzSPQyE281as4mvs64X5ofQbeAGAZzvXyYZ7DDPBiwtAf1S" ], "script": "base64:AAIDAAAAAAAAAAIIAQAAAAMAAAAADGFuc3dlcnNDb3VudAAAAAAAAAAAFAAAAAAHYW5zd2VycwkABEwAAAACAgAAAA5JdCBpcyBjZXJ0YWluLgkABEwAAAACAgAAABNJdCBpcyBkZWNpZGVkbHkgc28uCQAETAAAAAICAAAAEFdpdGhvdXQgYSBkb3VidC4JAARMAAAAAgIAAAARWWVzIC0gZGVmaW5pdGVseS4JAARMAAAAAgIAAAATWW91IG1heSByZWx5IG9uIGl0LgkABEwAAAACAgAAABFBcyBJIHNlZSBpdCwgeWVzLgkABEwAAAACAgAAAAxNb3N0IGxpa2VseS4JAARMAAAAAgIAAAANT3V0bG9vayBnb29kLgkABEwAAAACAgAAAARZZXMuCQAETAAAAAICAAAAE1NpZ25zIHBvaW50IHRvIHllcy4JAARMAAAAAgIAAAAWUmVwbHkgaGF6eSwgdHJ5IGFnYWluLgkABEwAAAACAgAAABBBc2sgYWdhaW4gbGF0ZXIuCQAETAAAAAICAAAAGEJldHRlciBub3QgdGVsbCB5b3Ugbm93LgkABEwAAAACAgAAABNDYW5ub3QgcHJlZGljdCBub3cuCQAETAAAAAICAAAAGkNvbmNlbnRyYXRlIGFuZCBhc2sgYWdhaW4uCQAETAAAAAICAAAAEkRvbid0IGNvdW50IG9uIGl0LgkABEwAAAACAgAAAA9NeSByZXBseSBpcyBuby4JAARMAAAAAgIAAAASTXkgc291cmNlcyBzYXkgbm8uCQAETAAAAAICAAAAFE91dGxvb2sgbm90IHNvIGdvb2QuCQAETAAAAAICAAAADlZlcnkgZG91YnRmdWwuBQAAAANuaWwBAAAACWdldEFuc3dlcgAAAAIAAAAIcXVlc3Rpb24AAAAOcHJldmlvdXNBbnN3ZXIEAAAABGhhc2gJAAH3AAAAAQkAAZsAAAABCQABLAAAAAIFAAAACHF1ZXN0aW9uBQAAAA5wcmV2aW91c0Fuc3dlcgQAAAAFaW5kZXgJAASxAAAAAQUAAAAEaGFzaAkAAZEAAAACBQAAAAdhbnN3ZXJzCQAAagAAAAIFAAAABWluZGV4BQAAAAxhbnN3ZXJzQ291bnQAAAAAAAAAAABooRI=", "height": 1819222, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 69JH8nYfBhgaXFnwdT9FsUQtZHxfxLvRNssZv5UgVQPJ Next: osURRcE9FcC919a4fyikXucUoEnuA7uEYXr33VyeYJJ Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let answersCount = 20 | |
5 | 5 | ||
6 | - | let | |
6 | + | let answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."] | |
7 | 7 | ||
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 | |
8 | + | func getAnswer (question,previousAnswer) = { | |
9 | + | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | + | let index = toInt(hash) | |
11 | + | answers[(index % answersCount)] | |
23 | 12 | } | |
24 | 13 | ||
25 | - | func getrecord (x) = match getString(pixxy[x]) { | |
26 | - | case a: String => | |
27 | - | a | |
28 | - | case _ => | |
29 | - | false | |
30 | - | } | |
31 | - | ||
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 nextprice = (parseIntValue(split(getStringValue(pixxy[x]), separ)[1]) + 100) | |
40 | - | [pixxy[x], makeString([callerAdress, toString(nextprice), "color", "url"], separ), "", "0"] | |
41 | - | } | |
42 | - | ||
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) | |
46 | - | } | |
47 | 14 | ||
48 | 15 |
github/deemru/w8io/026f985 21.96 ms ◑