tx · 5wQVJw3BmeoazZshr1ZwC1sm4CyYAmtKNrqWvKr26H3C

3MwvZvfUArAesufd1M6hYAwahLqSb2oW6kt:  -0.01000000 Waves

2021.08.26 00:53 [1674431] smart account 3MwvZvfUArAesufd1M6hYAwahLqSb2oW6kt > SELF 0.00000000 Waves

{ "type": 13, "id": "5wQVJw3BmeoazZshr1ZwC1sm4CyYAmtKNrqWvKr26H3C", "fee": 1000000, "feeAssetId": null, "timestamp": 1629928421335, "version": 2, "chainId": 84, "sender": "3MwvZvfUArAesufd1M6hYAwahLqSb2oW6kt", "senderPublicKey": "EGuGDK5PeyJ7RP9xrRRtbcDYAwhJAhfjzP67C3UL711A", "proofs": [ "2FJ9yk6K5fTZt6bFu1qkLRHGqvZ8Mqy55BYPYuaPqUkD6CB396oVPXMyMyzfBFRvayWr7TfD7xsaqpVYnKW318N6" ], "script": "base64:AAIDAAAAAAAAAOYIARIDCgEIGhIKAmExEgxhbnN3ZXJzQ291bnQaDQoCYTISB2Fuc3dlcnMaDwoCYTMSCWdldEFuc3dlchoOCgJhNBIIcXVlc3Rpb24aFAoCYTUSDnByZXZpb3VzQW5zd2VyGgoKAmE2EgRoYXNoGgsKAmE3EgVpbmRleBoXCgJhOBIRZ2V0UHJldmlvdXNBbnN3ZXIaDQoCYTkSB2FkZHJlc3MaDQoCYjESByRtYXRjaDAaBwoCYjISAWEaBwoCYjMSAWkaEwoCYjQSDWNhbGxlckFkZHJlc3MaDAoCYjUSBmFuc3dlcgAAAAQAAAAAAmExAAAAAAAAAAAUAAAAAAJhMgkABEwAAAACAgAAAA5JdCBpcyBjZXJ0YWluLgkABEwAAAACAgAAABNJdCBpcyBkZWNpZGVkbHkgc28uCQAETAAAAAICAAAAEFdpdGhvdXQgYSBkb3VidC4JAARMAAAAAgIAAAARWWVzIC0gZGVmaW5pdGVseS4JAARMAAAAAgIAAAATWW91IG1heSByZWx5IG9uIGl0LgkABEwAAAACAgAAABFBcyBJIHNlZSBpdCwgeWVzLgkABEwA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RhRW50cnkAAAACCQABLAAAAAIFAAAAAmI0AgAAAAJfcQUAAAACYTQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAACYjQCAAAAAl9hBQAAAAJiNQUAAAADbmlsAAAAAC+3Jq8=", "height": 1674431, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3zTzuFfhqGihcCYa8wKN5Tv5f1gKZYnCnaADjz7KVSL3 Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let answersCount = 20
55
66 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."]
77
88 func getAnswer (question,previousAnswer) = {
99 let hash = sha256(toBytes((question + previousAnswer)))
1010 let index = toInt(hash)
1111 answers[(index % answersCount)]
1212 }
1313
1414
1515 func getPreviousAnswer (address) = match getString(this, (address + "_a")) {
1616 case a: String =>
1717 a
1818 case _ =>
1919 address
2020 }
2121
2222
2323 @Callable(i)
2424 func tellme (question) = {
2525 let callerAddress = toBase58String(i.caller.bytes)
2626 let answer = getAnswer(question, getPreviousAnswer(callerAddress))
2727 WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)])
2828 }
2929
3030

github/deemru/w8io/026f985 
89.22 ms