tx · 2pC7cXemRrYe6v3eioQtev8bAS7hL5Je22JehRx8uXrb 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN: -0.01000000 Waves 2021.12.03 10:59 [1817828] smart account 3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN > SELF 0.00000000 Waves
{ "type": 13, "id": "2pC7cXemRrYe6v3eioQtev8bAS7hL5Je22JehRx8uXrb", "fee": 1000000, "feeAssetId": null, "timestamp": 1638518363692, "version": 2, "chainId": 84, "sender": "3N377MSFzFdwxW97ENpfqfZLYSnGzSMWvNN", "senderPublicKey": "3TJhvM5a7VSAiRyvEVwygRkiPC9ow5nM4LQ252H4vxWK", "proofs": [ "5pHjr1fgDf66sczXs4Mh5gYYrnpPLzeHoZAPeY23PPqa9kNcUnwiktw4xRECnufqjZLaaFTPcSUaJ7d5ZdE3T1b5" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAQAAAAAIaXNhdXRob3IGAAAAAQAAAAFpAQAAAAZjcmVhdGUAAAABAAAAAnh5AwUAAAAIaXNhdXRob3IJAAUUAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAAlgAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkFAAAAAnh5BQAAAANuaWwFAAAABHVuaXQJAAACAAAAAQIAAAAg0JLRiyDQvdC1INC80L7QttC10YLQtSB0byBjcmVhdGUAAAAAk1w1Ug==", "height": 1817828, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6qRySk6AwNCmhCF8PcfGDdQFsKJDtearZ76qVpEPnWAb Next: CEj8vPVCyZnAyxRDaFcQyq9sukcoQKSCXvKP6cEBRNA7 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let answersCount = 20 | |
5 | - | ||
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 | - | ||
8 | - | func getAnswer (question,previousAnswer) = { | |
9 | - | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | - | let index = toInt(hash) | |
11 | - | answers[(index % answersCount)] | |
12 | - | } | |
13 | - | ||
14 | - | ||
15 | - | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
16 | - | case a: String => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | address | |
20 | - | } | |
21 | - | ||
4 | + | let isauthor = true | |
22 | 5 | ||
23 | 6 | @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)]) | |
28 | - | } | |
7 | + | func create (xy) = if (isauthor) | |
8 | + | then $Tuple2([IntegerEntry(toBase58String(i.callerPublicKey), xy)], unit) | |
9 | + | else throw("Вы не можете to create") | |
29 | 10 | ||
30 | 11 |
github/deemru/w8io/026f985 20.74 ms ◑