tx · GsZVgVYzVkqUYWw7dWLdXDBns2F73HPrVvqjHPgwfTCr 3NAGFVwpzyGaGLbR29hvXLnY3ysZmeWogdX: -0.01000000 Waves 2022.05.18 11:58 [2056887] smart account 3NAGFVwpzyGaGLbR29hvXLnY3ysZmeWogdX > SELF 0.00000000 Waves
{ "type": 13, "id": "GsZVgVYzVkqUYWw7dWLdXDBns2F73HPrVvqjHPgwfTCr", "fee": 1000000, "feeAssetId": null, "timestamp": 1652864356809, "version": 2, "chainId": 84, "sender": "3NAGFVwpzyGaGLbR29hvXLnY3ysZmeWogdX", "senderPublicKey": "5qA7HQ72BFr7ggPCXMRPR5wx7Woi4RL8EZBGkRSbbF8Y", "proofs": [ "57UAHhQ5v9vxUZwrWa1hHr1jKmHHXTjgcsL2zHiQCW35YdXmBzoZfpSeemimXyCEXut3LvEx2RXT82A72XbXSEmx" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAAAAAAEAAAABaQEAAAAUaW52b2tlX3dpdGhfcGF5bWVudHMAAAAABAAAAANyZXMJAAP8AAAABAkBAAAAB0FkZHJlc3MAAAABAQAAABoBVN8y89xZoQm+eHIXvGf1tpIGwsRTRhkr4gIAAAANcmVjdl9wYXltZW50cwkABEwAAAACAAAAAAAAAAACBQAAAANuaWwJAARMAAAAAgkBAAAAD0F0dGFjaGVkUGF5bWVudAAAAAIFAAAABHVuaXQAAAAAAAAAAAEJAARMAAAAAgkBAAAAD0F0dGFjaGVkUGF5bWVudAAAAAIFAAAABHVuaXQAAAAAAAAAAAEFAAAAA25pbAMJAAAAAAAAAgUAAAADcmVzBQAAAANyZXMJAAUUAAAAAgUAAAADbmlsBQAAAANyZXMJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAG9A3XA=", "height": 2056887, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3CxaSG5WeqJHXscRW6WA58pULaWnfUDpwpLGf1YXdyU3 Next: 9mDUUfjQJUZFXjv2J3dCjeJ31QLcFmRPkdkPKR8hwip Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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 = toBase58String(i.caller.bytes) | |
26 | - | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | - | [StringEntry((callerAddress + "_q"), question), StringEntry((callerAddress + "_a"), answer)] | |
7 | + | func invoke_with_payments () = { | |
8 | + | let res = invoke(Address(base58'3NAGFVwpzyGaGLbR29hvXLnY3ysZmeWogdX'), "recv_payments", [2], [AttachedPayment(unit, 1), AttachedPayment(unit, 1)]) | |
9 | + | if ((res == res)) | |
10 | + | then $Tuple2(nil, res) | |
11 | + | else throw("Strict value is not equal to itself.") | |
28 | 12 | } | |
29 | - | ||
30 | - | ||
31 | - | ||
32 | - | @Callable(i) | |
33 | - | func recv_payments (payments_counter) = if ((payments_counter >= 100)) | |
34 | - | then $Tuple2(nil, payments_counter) | |
35 | - | else { | |
36 | - | let res = invoke(this, "recv_payments", [(payments_counter + 2)], [AttachedPayment(unit, 1), AttachedPayment(unit, 1), AttachedPayment(unit, 1), AttachedPayment(unit, 1), AttachedPayment(unit, 1), AttachedPayment(unit, 1)]) | |
37 | - | if ((res == res)) | |
38 | - | then $Tuple2(nil, match res { | |
39 | - | case res: Int => | |
40 | - | res | |
41 | - | case _ => | |
42 | - | -1 | |
43 | - | }) | |
44 | - | else throw("Strict value is not equal to itself.") | |
45 | - | } | |
46 | 13 | ||
47 | 14 |
github/deemru/w8io/169f3d6 29.85 ms ◑![]()