tx · HTJhaWR3RwXkEVsmcxm5VGm3xi3DCvyLvzaTPah2QrNj

3Mz8aZoSQ1oqC4kBfA6Gx94edw2RNRMsa73:  -0.01000000 Waves

2023.02.13 13:49 [2447742] smart account 3Mz8aZoSQ1oqC4kBfA6Gx94edw2RNRMsa73 > SELF 0.00000000 Waves

{ "type": 13, "id": "HTJhaWR3RwXkEVsmcxm5VGm3xi3DCvyLvzaTPah2QrNj", "fee": 1000000, "feeAssetId": null, "timestamp": 1676285382870, "version": 2, "chainId": 84, "sender": "3Mz8aZoSQ1oqC4kBfA6Gx94edw2RNRMsa73", "senderPublicKey": "EJp3vJd3QL2izBZE187Ft6SJzWycrN8WhNZBw5FJqbux", "proofs": [ "567s6dUtcWMiak2GzobScxopSYpFsUAz2Saf5mnydpExZVXHptSB3am3Qc89r2AusHYtPJwxJdNZWE4ZHxybxKcX" ], "script": "base64:BQoBAAAADGdldE93bmVyQWRkcgAAAAAEAAAABW93bmVyCQAEHQAAAAIFAAAABHRoaXMCAAAABW93bmVyAwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAFb3duZXIJAAACAAAAAQIAAAAKaW5pdCBmaXJzdAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQkBAAAABXZhbHVlAAAAAQUAAAAFb3duZXIGlBiNxg==", "height": 2447742, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JCAeU4aqUG9br6Jwe1opH5FofPSMm77itYjAiQcepwpv Next: PPVT3jaL1aNyyxxYSgxWPcvZtmkw73Yz1jdXFofTf7H Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
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)]
1+{-# STDLIB_VERSION 5 #-}
2+{-# CONTENT_TYPE EXPRESSION #-}
3+func getOwnerAddr () = {
4+ let owner = getString(this, "owner")
5+ if (!(isDefined(owner)))
6+ then throw("init first")
7+ else addressFromStringValue(value(owner))
128 }
139
14-
15-func getPreviousAnswer (address) = match getString(this, (address + "_a")) {
16- case a: String =>
17- a
18- case _ =>
19- address
20-}
21-
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)])
28- }
29-
30-
10+true

github/deemru/w8io/026f985 
46.65 ms