tx · BWCRP4mRZHArnPmGFNjENUvmECDZgarRiWnU7j4nQRbQ

3N3TMFEAyJQJo4A1buPXigTD59MnNsyYYd6:  -0.01000000 Waves

2023.06.01 18:57 [2603815] smart account 3N3TMFEAyJQJo4A1buPXigTD59MnNsyYYd6 > SELF 0.00000000 Waves

{ "type": 13, "id": "BWCRP4mRZHArnPmGFNjENUvmECDZgarRiWnU7j4nQRbQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1685635044254, "version": 2, "chainId": 84, "sender": "3N3TMFEAyJQJo4A1buPXigTD59MnNsyYYd6", "senderPublicKey": "FhejCy799Nghpx4yTc3cjA2EXpN9KC7Ekxre4f9VAN1V", "proofs": [ "2MMtPsVQLcMFe2JXR8Ef4wKpc636yn6sbhjbT7tHbE1D6Dm4UTJQ7mq7171YjfRr32jA3iXCJSebW8GXCA7YyncL" ], "script": "base64:BgIHCAISAwoBCAQADGFuc3dlcnNDb3VudAAUAAdhbnN3ZXJzCQDMCAICDkl0IGlzIGNlcnRhaW4uCQDMCAICE0l0IGlzIGRlY2lkZWRseSBzby4JAMwIAgIQV2l0aG91dCBhIGRvdWJ0LgkAzAgCAhFZZXMgLSBkZWZpbml0ZWx5LgkAzAgCAhNZb3UgbWF5IHJlbHkgb24gaXQuCQDMCAICEUFzIEkgc2VlIGl0LCB5ZXMuCQDMCAICDE1vc3QgbGlrZWx5LgkAzAgCAg1PdXRsb29rIGdvb2QuCQDMCAICBFllcy4JAMwIAgITU2lnbnMgcG9pbnQgdG8geWVzLgkAzAgCAhZSZXBseSBoYXp5LCB0cnkgYWdhaW4uCQDMCAICEEFzayBhZ2FpbiBsYXRlci4JAMwIAgIYQmV0dGVyIG5vdCB0ZWxsIHlvdSBub3cuCQDMCAICE0Nhbm5vdCBwcmVkaWN0IG5vdy4JAMwIAgIaQ29uY2VudHJhdGUgYW5kIGFzayBhZ2Fpbi4JAMwIAgISRG9uJ3QgY291bnQgb24gaXQuCQDMCAICD015IHJlcGx5IGlzIG5vLgkAzAgCAhJNeSBzb3VyY2VzIHNheSBuby4JAMwIAgIUT3V0bG9vayBub3Qgc28gZ29vZC4JAMwIAgIOVmVyeSBkb3VidGZ1bC4FA25pbAEJZ2V0QW5zd2VyAghxdWVzdGlvbg5wcmV2aW91c0Fuc3dlcgQEaGFzaAkA9wMBCQCbAwEJAKwCAgUIcXVlc3Rpb24FDnByZXZpb3VzQW5zd2VyBAVpbmRleAkAsQkBBQRoYXNoCQCRAwIFB2Fuc3dlcnMJAGoCBQVpbmRleAUMYW5zd2Vyc0NvdW50ARFnZXRQcmV2aW91c0Fuc3dlcgEHYWRkcmVzcwQHJG1hdGNoMAkAnQgCBQR0aGlzCQCsAgIFB2FkZHJlc3MCAl9hAwkAAQIFByRtYXRjaDACBlN0cmluZwQBYQUHJG1hdGNoMAUBYQUHYWRkcmVzcwEBaQEGdGVsbG1lAQhxdWVzdGlvbgQNY2FsbGVyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEBmFuc3dlcgkBCWdldEFuc3dlcgIFCHF1ZXN0aW9uCQERZ2V0UHJldmlvdXNBbnN3ZXIBBQ1jYWxsZXJBZGRyZXNzCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUNY2FsbGVyQWRkcmVzcwICX3EFCHF1ZXN0aW9uCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUNY2FsbGVyQWRkcmVzcwICX2EFBmFuc3dlcgUDbmlsAFtURyg=", "height": 2603815, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: EVvVpU3YG9No3ayFinuC6QYugZRYdLDLmbirrv9tGpCG Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 6 #-}
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)]
12+ }
13+
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 = toString(i.caller)
26+ let answer = getAnswer(question, getPreviousAnswer(callerAddress))
27+[StringEntry((callerAddress + "_q"), question), StringEntry((callerAddress + "_a"), answer)]
28+ }
29+
30+

github/deemru/w8io/026f985 
16.92 ms