tx · 4W3xU44M8WT9cbbVtAx7EF6fqZ7sSUgT4cyuAhxjYcBN 3MpiAn1HcNgEuRY9DMfyQvhHSAf9fvMFXXz: -0.00100000 Waves 2022.12.15 10:32 [2361125] smart account 3MpiAn1HcNgEuRY9DMfyQvhHSAf9fvMFXXz > SELF 0.00000000 Waves
{ "type": 13, "id": "4W3xU44M8WT9cbbVtAx7EF6fqZ7sSUgT4cyuAhxjYcBN", "fee": 100000, "feeAssetId": null, "timestamp": 1671089614424, "version": 2, "chainId": 84, "sender": "3MpiAn1HcNgEuRY9DMfyQvhHSAf9fvMFXXz", "senderPublicKey": "JC3FMtszsjDvAMgYdna8fWxfdBWr5TiUYhMtcmJUehyo", "proofs": [ "5goNbWbzVnwwutg1KVBeKAGQgHFtfRDjcCgM1MsrVWSAtguq7Ks5guXb7f1pqUq7dikMFMWwP3VL5eHZVTwfN3Sh" ], "script": "base64:BgIHCAISAwoBCAABAWkBCmhlbGxvV29ybGQBBG5hbWUJAMwIAgkBC1N0cmluZ0VudHJ5AgIGYW5zd2VyCQCsAgICFEhlbGxvIFdvcmxkISBIZWxsbywgBQRuYW1lBQNuaWwAI7p6zA==", "height": 2361125, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BYdwf4TngRKBbAfEADxxxUGW5d5U34y14dmnk3pc8k8P Next: 6CLrMXe47KtpKCuFESGYS65HxjLdyyDbFDNy6sH57JLZ Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
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 | ||
22 | 5 | ||
23 | 6 | @Callable(i) | |
24 | - | func tellme (question) = { | |
25 | - | let callerAddress = toString(i.caller) | |
26 | - | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | - | [StringEntry((callerAddress + "_q"), question), StringEntry((callerAddress + "_a"), answer)] | |
28 | - | } | |
7 | + | func helloWorld (name) = [StringEntry("answer", ("Hello World! Hello, " + name))] | |
29 | 8 | ||
30 | 9 |
github/deemru/w8io/169f3d6 39.87 ms ◑