tx · 83GsDA8yYuEj2ncaReeMuNm2aoxzEkhghE32ZSAcLsni 3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki: -0.00100000 Waves 2024.07.06 00:05 [3181222] smart account 3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki > SELF 0.00000000 Waves
{ "type": 13, "id": "83GsDA8yYuEj2ncaReeMuNm2aoxzEkhghE32ZSAcLsni", "fee": 100000, "feeAssetId": null, "timestamp": 1720213547277, "version": 2, "chainId": 84, "sender": "3Mvqg45GNNEhYssByz8tT6BECpZd8wKyuki", "senderPublicKey": "Em3xR3qCDVUJh4RYP61j2iaMKdEHYvyYEA4kmBMKQHLd", "proofs": [ "2uU6EP3c5nF8UaGJgyFTgSx4niaUtewvvYn53qDeNpgtNeXE1erur1aTwd8gJAJyxpoMbYzfJLoyzmr7AhtmR1Ab" ], "script": "base64:BgIICAISBAoCCAEAAQFpAQlzdG9yZURhdGECBm5ld0tleQhuZXdWYWx1ZQQEc2xvdAkAmggCBQR0aGlzBQZuZXdLZXkDCQEJaXNEZWZpbmVkAQUEc2xvdAkAAgECEktleSBhbHJlYWR5IGV4aXN0cwkAzAgCCQEMSW50ZWdlckVudHJ5AgUGbmV3S2V5BQhuZXdWYWx1ZQUDbmlsAQJ0eAEGdmVyaWZ5AAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIPRGF0YVRyYW5zYWN0aW9uBANkdHgFByRtYXRjaDAJAAIBAjFUaGlzIHRyYW5zYWN0aW9uIGlzIHByb2hpYml0ZWQgdG8gdGhlIGRBcHAgb3duZXIhCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5RaU5gA==", "height": 3181222, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BmerCmHPTxMrQ3qi7wznssXqoNcTfjMQigDYsR7aATWJ Next: AyFGwsQDkFzXTv7fJXaiwFv9wCWJvd8PQbZCgKgVFbw9 Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let answersCount = 20 | |
5 | 4 | ||
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 | 5 | ||
8 | - | func getAnswer (question,previousAnswer) = { | |
9 | - | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | - | let index = toInt(hash) | |
11 | - | answers[(index % answersCount)] | |
6 | + | @Callable(i) | |
7 | + | func storeData (newKey,newValue) = { | |
8 | + | let slot = getInteger(this, newKey) | |
9 | + | if (isDefined(slot)) | |
10 | + | then throw("Key already exists") | |
11 | + | else [IntegerEntry(newKey, newValue)] | |
12 | 12 | } | |
13 | 13 | ||
14 | 14 | ||
15 | - | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
16 | - | case a: String => | |
17 | - | a | |
15 | + | @Verifier(tx) | |
16 | + | func verify () = match tx { | |
17 | + | case dtx: DataTransaction => | |
18 | + | throw("This transaction is prohibited to the dApp owner!") | |
18 | 19 | case _ => | |
19 | - | | |
20 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
20 | 21 | } | |
21 | - | ||
22 | - | ||
23 | - | @Callable(i) | |
24 | - | func tellme (question) = { | |
25 | - | let callerAddress = toBase58String(i.caller.bytes) | |
26 | - | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | - | [StringEntry((callerAddress + "_q"), question), StringEntry((callerAddress + "_a"), answer)] | |
28 | - | } | |
29 | - | ||
30 | 22 |
github/deemru/w8io/169f3d6 44.12 ms ◑