tx · CjNQTyWANXVGaMb2utJFUyGscZdRAYbai5G3BeATmM8q 3NCy4rT9no9CGLr89UrnyH8s75P8JjkSap8: -0.01400000 Waves 2020.12.08 20:02 [1299958] smart account 3NCy4rT9no9CGLr89UrnyH8s75P8JjkSap8 > SELF 0.00000000 Waves
{ "type": 13, "id": "CjNQTyWANXVGaMb2utJFUyGscZdRAYbai5G3BeATmM8q", "fee": 1400000, "feeAssetId": null, "timestamp": 1607446940141, "version": 2, "chainId": 84, "sender": "3NCy4rT9no9CGLr89UrnyH8s75P8JjkSap8", "senderPublicKey": "62prNgRbWHRQAXh3a5sG95EtrJoYEsuUAgwkg3F4Kt6k", "proofs": [ "3WLCjEN2ne2qc8JPvZ4J2syXaSu97qMYKTLGWzupb7JGm2QucRx5h1knT3rEMo3TtwsVPvyDt7GGoQeAx1FcPMQb" ], "script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAABAAAAAAHYW5zd2VycwkABEwAAAACAgAAAAlUbyBwZXduZS4JAARMAAAAAgIAAAARWmRlY3lkb3dhbmllIHRhay4JAARMAAAAAgIAAAAPQmV6IHfEhXRwaWVuaWEuCQAETAAAAAICAAAAE1RhayAtIHpkZWN5ZG93YW5pZS4JAARMAAAAAgIAAAAYTW/FvGVzeiBuYSB0eW0gcG9sZWdhxIcuCQAETAAAAAICAAAAFlRhaywgamFrIGphIHRvIHdpZHrEmS4JAARMAAAAAgIAAAATTmFqcHJhd2RvcG9kb2JuaWVqLgkABEwAAAACAgAAABJEb2JyZSBwZXJzcGVrdHl3eS4JAARMAAAAAgIAAAAEVGFrLgkABEwAAAACAgAAABlabmFraSB3c2thenVqxIVjZSBuYSB0YWsuCQAETAAAAAICAAAAJk9kcG93aWVkeiBuaWVqYXNubywgc3Byw7NidWogcG9ub3duaWUuCQAETAAAAAICAAAAEVphcHl0YWogcMOzem5pZWouCQAETAAAAAICAAAAHExlcGllaiBjaSB0ZXJheiBuaWUgbcOzd2nEhy4JAARMAAAAAgIAAAAeTmllIG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fuc3dlcgAAAAEFAAAADWNhbGxlckFkZHJlc3MJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAANY2FsbGVyQWRkcmVzcwIAAAACX3EFAAAACHF1ZXN0aW9uCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADWNhbGxlckFkZHJlc3MCAAAAAl9hBQAAAAZhbnN3ZXIFAAAAA25pbAAAAADyVexm", "height": 1299958, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gb8ZmUcyCLR8EZJtesGyqWMTb6kG4VSazixu4xhE33JV Next: 9K3aLgezDfNcFfdV2PHNBbmqU2bFaBCuzG1fhMN6WzWz Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | - | func | |
24 | + | func Zadajpytanie (question) = { | |
25 | 25 | let callerAddress = toBase58String(i.caller.bytes) | |
26 | 26 | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | 27 | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let answers = ["To pewne.", "Zdecydowanie tak.", "Bez wątpienia.", "Tak - zdecydowanie.", "Możesz na tym polegać.", "Tak, jak ja to widzę.", "Najprawdopodobniej.", "Dobre perspektywy.", "Tak.", "Znaki wskazujące na tak.", "Odpowiedz niejasno, spróbuj ponownie.", "Zapytaj pózniej.", "Lepiej ci teraz nie mówić.", "Nie można teraz przewidzieć.", "Skoncentruj się i zapytaj ponownie.", "Nie licz na to.", "Moja odpowiedź brzmi: nie", "Moje źródła mówią nie.", "Perspektywa niezbyt dobra.", "Bardzo wątpliwe."] | |
5 | 5 | ||
6 | 6 | let answersCount = size(answers) | |
7 | 7 | ||
8 | 8 | func getAnswer (question,previousAnswer) = { | |
9 | 9 | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | 10 | let index = toInt(hash) | |
11 | 11 | answers[(index % answersCount)] | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
16 | 16 | case a: String => | |
17 | 17 | a | |
18 | 18 | case _ => | |
19 | 19 | address | |
20 | 20 | } | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | - | func | |
24 | + | func Zadajpytanie (question) = { | |
25 | 25 | let callerAddress = toBase58String(i.caller.bytes) | |
26 | 26 | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | 27 | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 |
github/deemru/w8io/026f985 50.42 ms ◑