tx · DE5oQ2ypNrW6Nz2Lq7NSu5qPU6kFvbEfaxrEANvC3rDq

3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV:  -0.01000000 Waves

2021.12.08 18:42 [1825468] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves

{ "type": 13, "id": "DE5oQ2ypNrW6Nz2Lq7NSu5qPU6kFvbEfaxrEANvC3rDq", "fee": 1000000, "feeAssetId": null, "timestamp": 1638978180351, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "4VL978vns2rK8iC7SvSra2GuGZABVd7emPvv1CXxRU1KaAbgJUPoDi4LD5V9kdmH7dpobxSeMRM3hjx2H1V9VxLP" ], "script": "base64:AAIFAAAAAAAAABMIAhIAEgMKAQgSAwoBCBIDCgEIAAAAAQAAAAAFc2VwYXICAAAAAXwAAAAEAAAAAWkBAAAABXJlc2V0AAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAApsYXN0Z2FtZWlkAgAAAAEwCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAADWxhc3RjaGFsbGVuZ2UCAAAAATAFAAAAA25pbAAAAAFpAQAAAAlzdGFydGdhbWUAAAABAAAACmNoYWxsZW5nZXIEAAAAA3BtdAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABVtdXN0IHN0YWtlIHNvbWUgd2F2ZXMDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAAMY2FsbGVyQWRyZXNzCQACWAAAAAEICAU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GFsbGVuZ2UAAAAAAAAAAAACAAAACGF3YWl0aW5nCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAKY2hhbGxlbmdlLQUAAAAMY2hhbGxlbmRnZWlkCQAEuQAAAAIJAARMAAAAAgIAAAAFdW5zZXQJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAEJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAIJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAMFAAAAA25pbAUAAAAFc2VwYXIFAAAAA25pbAkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwAAAACfU8HA", "height": 1825468, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2DVNQpK7Ca1SGqhDddLFdKAe5cLYazUwyTt6iKzUKxe3 Next: F6a7T6hJRszrzNimhCMYwa3foCne9AkHbBjFtpUMnXuM Diff:
OldNewDifferences
44 let separ = "|"
55
66 @Callable(i)
7-func reset () = $Tuple2([StringEntry("lastgameid", "0")], [StringEntry("lastchallenge", "0")])
7+func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallenge", "0")]
88
99
1010
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separ = "|"
55
66 @Callable(i)
7-func reset () = $Tuple2([StringEntry("lastgameid", "0")], [StringEntry("lastchallenge", "0")])
7+func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallenge", "0")]
88
99
1010
1111 @Callable(i)
1212 func startgame (challenger) = {
1313 let pmt = if ((size(i.payments) == 1))
1414 then i.payments[0]
1515 else throw("must stake some waves")
1616 if (isDefined(pmt.assetId))
1717 then throw("works with waves only")
1818 else {
1919 let callerAdress = toBase58String(i.caller.bytes)
2020 let conditions = split(getStringValue(("challenge-" + challenger)), separ)
2121 if ((size(conditions) > 0))
2222 then if ((pmt.amount >= parseIntValue(conditions[2])))
2323 then if ((conditions[0] == "awaiting"))
2424 then {
2525 let black = if ((conditions[1] == "black"))
2626 then challenger
2727 else callerAdress
2828 let white = if ((conditions[1] == "white"))
2929 then challenger
3030 else callerAdress
3131 let gameid = toString((getIntegerValue("lastgameid") + 1))
3232 [StringEntry(("challenge-" + challenger), makeString(["answered", conditions[1], conditions[2], callerAdress], separ)), StringEntry(gameid, makeString(["ongoing", white, black, conditions[2], "0", "white", "startblock", "laststepblock"], separ)), StringEntry("lastgameid", gameid), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(conditions[2])), unit)]
3333 }
3434 else throw("no challenge awaiting")
3535 else throw("need more money")
3636 else throw("no challenge")
3737 }
3838 }
3939
4040
4141
4242 @Callable(i)
4343 func setchallenge (side) = if (if ((side == "black"))
4444 then true
4545 else (side == "white"))
4646 then {
4747 let pmt = if ((size(i.payments) == 1))
4848 then i.payments[0]
4949 else throw("must stake some waves")
5050 if (isDefined(pmt.assetId))
5151 then throw("works with waves only")
5252 else {
5353 let callerAdress = toBase58String(i.caller.bytes)
5454 let challengeid = toString((getIntegerValue("lastchallengeid") + 1))
5555 [StringEntry(("challenge-" + challengeid), makeString(["awaiting", callerAdress, side, toString(pmt.amount)], separ))]
5656 }
5757 }
5858 else throw("invalid side")
5959
6060
6161
6262 @Callable(i)
6363 func unsetchallenge (challendgeid) = {
6464 let callerAdress = toBase58String(i.caller.bytes)
6565 func getchallenge (challendgeid) = match getString(("challenge-" + challendgeid)) {
6666 case a: String =>
6767 getStringValue(("challenge-" + challendgeid))
6868 case _ =>
6969 ""
7070 }
7171
7272 let challenge = split(getchallenge(challendgeid), separ)
7373 if ((size(challenge) > 0))
7474 then if ((challenge[0] == "awaiting"))
7575 then [StringEntry(("challenge-" + challendgeid), makeString(["unset", challenge[1], challenge[2], challenge[3]], separ))]
7676 else throw("challenge not exists")
7777 else throw("challenge not exists")
7878 }
7979
8080

github/deemru/w8io/026f985 
23.81 ms