tx · DRyXAq4JA5fnrv16xUc1vE2iK9rqixipUqg1ZWgM3Pa7

3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f:  -0.04000000 Waves

2020.10.30 22:06 [1243758] smart account 3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f > SELF 0.00000000 Waves

{ "type": 13, "id": "DRyXAq4JA5fnrv16xUc1vE2iK9rqixipUqg1ZWgM3Pa7", "fee": 4000000, "feeAssetId": null, "timestamp": 1604084826759, "version": 2, "chainId": 84, "sender": "3MqvjXotwuiF933mjQm5G9v1ER6BLhakd3f", "senderPublicKey": "7KWZVWSeHmn8VUNXWRRhrbjYaEqMnyWqk7UuEa9uMTW8", "proofs": [ "4JjZBnnvRbarrRkNvgRDVG1bshdWpVZABvdDZmZUuRa1eXpPwsrGdE6jQ4vnDmZf2RLV4JMev1jbzBV1AcbghZQY" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAQAAAAdpc093bmVyAAAAAQAAAAdhZGRyZXNzCQAAAAAAAAIFAAAAB2FkZHJlc3MFAAAABHRoaXMBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAABQAAAAN2YWwBAAAAD2dldEludGVnZXJCeUtleQAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAAAAAIAAAABaQEAAAAJYWRkQW5zd2VyAAAAAQAAAAZBbnN3ZXIDCQEAAAABIQAAAAEJAQAAAAdpc093bmVyAAAAAQgFAAAAAWkAAAAG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QAAAAlEYXRhRW50cnkAAAACAgAAAAZ3aW5uZXIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAJaAAAAAQkAAZsAAAABBQAAAAVHdWVzcwIAAAAHX3Jld2FyZAkAAGUAAAACBQAAAAZyZXdhcmQFAAAABnJld2FyZAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGcmV3YXJkBQAAAAR1bml0BQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAVmYWlsXwUAAAAGQW5zd2VyAgAAAAFfCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgIAAAABXwkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAAVHdWVzcwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAQc3RhbmRhcmRWZXJpZmllcgAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5tGGWEg==", "height": 1243758, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9HQULWEHPdv5xqdv22QwgmLeh6PTgS8z559V1pzqb16D Next: none Diff:
OldNewDifferences
5252 else if ((j == toBase64String(toBytes(l))))
5353 then {
5454 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)]))
55+ ScriptResult(WriteSet([DataEntry("correct_answer", l), DataEntry("winner", toString(i.caller)), DataEntry((toBase64String(toBytes(l)) + "_reward"), (k - k))]), TransferSet([ScriptTransfer(i.caller, k, unit)]))
5656 }
5757 else WriteSet([DataEntry(((((("fail_" + j) + "_") + toString(i.caller)) + "_") + toBase58String(i.transactionId)), l)])
5858 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a (b) = (b == this)
55
66
77 func c (d) = {
88 let e = {
99 let f = getString(this, d)
1010 if ($isInstanceOf(f, "String"))
1111 then {
1212 let g = f
1313 g
1414 }
1515 else ""
1616 }
1717 e
1818 }
1919
2020
2121 func h (d) = {
2222 let e = {
2323 let f = getInteger(this, d)
2424 if ($isInstanceOf(f, "Int"))
2525 then {
2626 let g = f
2727 g
2828 }
2929 else 0
3030 }
3131 e
3232 }
3333
3434
3535 @Callable(i)
3636 func addAnswer (j) = if (!(a(i.caller)))
3737 then throw("access only by the contract owner")
3838 else if ((h((j + "_reward")) != 0))
3939 then throw("the contest is already taken")
4040 else {
4141 let k = extract(i.payment).amount
4242 WriteSet([DataEntry("hash_answer", j), DataEntry((j + "_reward"), k)])
4343 }
4444
4545
4646
4747 @Callable(i)
4848 func guessAnswer (l) = {
4949 let j = c("hash_answer")
5050 if ((h((j + "_reward")) == 0))
5151 then throw("sorry, game over")
5252 else if ((j == toBase64String(toBytes(l))))
5353 then {
5454 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)]))
55+ ScriptResult(WriteSet([DataEntry("correct_answer", l), DataEntry("winner", toString(i.caller)), DataEntry((toBase64String(toBytes(l)) + "_reward"), (k - k))]), TransferSet([ScriptTransfer(i.caller, k, unit)]))
5656 }
5757 else WriteSet([DataEntry(((((("fail_" + j) + "_") + toString(i.caller)) + "_") + toBase58String(i.transactionId)), l)])
5858 }
5959
6060
6161 @Verifier(m)
6262 func n () = sigVerify(m.bodyBytes, m.proofs[0], m.senderPublicKey)
6363

github/deemru/w8io/169f3d6 
26.28 ms