tx · 9HQULWEHPdv5xqdv22QwgmLeh6PTgS8z559V1pzqb16D 3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f: -0.04000000 Waves 2020.10.30 15:07 [1243341] smart account 3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f > SELF 0.00000000 Waves
{ "type": 13, "id": "9HQULWEHPdv5xqdv22QwgmLeh6PTgS8z559V1pzqb16D", "fee": 4000000, "feeAssetId": null, "timestamp": 1604059663075, "version": 2, "chainId": 84, "sender": "3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f", "senderPublicKey": "7KWZVWSeHmn8VUNXWRRhrbjYaEqMnyWqk7UuEa9uMTW8", "proofs": [ "HfoiecYk55qjufPBqdmFdHDFQwQh5GqADip2MYziGJiJzRXkjPvpX9xnWbV7751UeDT1TCrXgiueqpTxG1za11D" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAABQAAAAN2YWwBAAAAD2dldEludGVnZXJCeUtleQAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAAAAAIAAAABaQEAAAAJYWRkQW5zd2VyAAAAAQAAAAZBbnN3ZXIDCQEAAAABIQAAAAEJAQAAAAdpc093bmVyAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAAAgAA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kAAAACAgAAAAZ3aW5uZXIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAJaAAAAAQkAAZsAAAABBQAAAAVHdWVzcwIAAAAHX3Jld2FyZAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGcmV3YXJkBQAAAAR1bml0BQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAVmYWlsXwUAAAAGQW5zd2VyAgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgIAAAABXwkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAAVHdWVzcwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAQc3RhbmRhcmRWZXJpZmllcgAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5SwEZuA==", "height": 1243341, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DRyXAq4JA5fnrv16xUc1vE2iK9rqixipUqg1ZWgM3Pa7 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func a (b) = (b == this) | |
5 | + | ||
6 | + | ||
7 | + | func c (d) = { | |
8 | + | let e = { | |
9 | + | let f = getString(this, d) | |
10 | + | if ($isInstanceOf(f, "String")) | |
11 | + | then { | |
12 | + | let g = f | |
13 | + | g | |
14 | + | } | |
15 | + | else "" | |
16 | + | } | |
17 | + | e | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | func h (d) = { | |
22 | + | let e = { | |
23 | + | let f = getInteger(this, d) | |
24 | + | if ($isInstanceOf(f, "Int")) | |
25 | + | then { | |
26 | + | let g = f | |
27 | + | g | |
28 | + | } | |
29 | + | else 0 | |
30 | + | } | |
31 | + | e | |
32 | + | } | |
33 | + | ||
34 | + | ||
35 | + | @Callable(i) | |
36 | + | func addAnswer (j) = if (!(a(i.caller))) | |
37 | + | then throw("access only by the contract owner") | |
38 | + | else if ((h((j + "_reward")) != 0)) | |
39 | + | then throw("the contest is already taken") | |
40 | + | else { | |
41 | + | let k = extract(i.payment).amount | |
42 | + | WriteSet([DataEntry("hash_answer", j), DataEntry((j + "_reward"), k)]) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | @Callable(i) | |
48 | + | func guessAnswer (l) = { | |
49 | + | let j = c("hash_answer") | |
50 | + | if ((h((j + "_reward")) == 0)) | |
51 | + | then throw("sorry, game over") | |
52 | + | else if ((j == toBase64String(toBytes(l)))) | |
53 | + | then { | |
54 | + | let k = h((toBase64String(toBytes(l)) + "_reward")) | |
55 | + | ScriptResult(WriteSet([DataEntry("correct_answer", l), DataEntry("winner", toString(i.caller)), DataEntry((toBase64String(toBytes(l)) + "_reward"), 0)]), TransferSet([ScriptTransfer(i.caller, k, unit)])) | |
56 | + | } | |
57 | + | else WriteSet([DataEntry(((((("fail_" + j) + "_") + toString(i.caller)) + "_") + toBase58String(i.transactionId)), l)]) | |
58 | + | } | |
59 | + | ||
60 | + | ||
61 | + | @Verifier(m) | |
62 | + | func n () = sigVerify(m.bodyBytes, m.proofs[0], m.senderPublicKey) | |
63 | + |
github/deemru/w8io/169f3d6 21.02 ms ◑