tx · CPr39sQjAkQAMmGCEKrgHtPT6PBenPYHxpzkidP6apCm
3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves
2021.12.08 16:42 [1825353] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{
"type": 13,
"id": "CPr39sQjAkQAMmGCEKrgHtPT6PBenPYHxpzkidP6apCm",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1638970978461,
"version": 2,
"chainId": 84,
"sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV",
"senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7",
"proofs": [
"Jq1zDJ5KbPquiTv1nAHL7J1sVrKhQmzDXhMrtEmhWX2V2UVoAHTBPbgHdP7RYEWZhC5UEgWmMCKEqyYkq4BuMCP"
],
"script": "base64:AAIFAAAAAAAAAAoIAhIECgIIARIAAAAAAQAAAAAFc2VwYXICAAAAAXwAAAACAAAAAWkBAAAADHNldGNoYWxsZW5nZQAAAAIAAAAEc2lkZQAAAAVzdGFrZQMDCQAAAAAAAAIFAAAABHNpZGUCAAAABWJsYWNrBgkAAAAAAAACBQAAAARzaWRlAgAAAAV3aGl0ZQQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAFW11c3Qgc3Rha2Ugc29tZSB3YXZlcwMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAVd29ya3Mgd2l0aCB3YXZlcyBvbmx5BAAAAAxjYWxsZXJBZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAACmNoYWxsZW5nZS0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ADbmlsBQAAAAVzZXBhcgUAAAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAABbKlZI=",
"height": 1825353,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: AXxde6oZozrM59jxSXSHjj1MfcD1AT8Fi75VgJy31btq
Next: 63aM1jzYWZQa5B18BH9SgJHfrUYH73njzfnrWWq6bWkU
Diff:
Old | New | | Differences |
---|
25 | 25 | | @Callable(i) |
---|
26 | 26 | | func unsetchallenge () = { |
---|
27 | 27 | | let callerAdress = toBase58String(i.caller.bytes) |
---|
28 | | - | func getchallenge (challendger) = match getString(challendger) { |
---|
| 28 | + | func getchallenge (challendger) = match getString(("challenge-" + challendger)) { |
---|
29 | 29 | | case a: String => |
---|
30 | 30 | | getStringValue(("challenge-" + challendger)) |
---|
31 | 31 | | case _ => |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let separ = "|" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func setchallenge (side,stake) = if (if ((side == "black")) |
---|
8 | 8 | | then true |
---|
9 | 9 | | else (side == "white")) |
---|
10 | 10 | | then { |
---|
11 | 11 | | let pmt = if ((size(i.payments) == 1)) |
---|
12 | 12 | | then i.payments[0] |
---|
13 | 13 | | else throw("must stake some waves") |
---|
14 | 14 | | if (isDefined(pmt.assetId)) |
---|
15 | 15 | | then throw("works with waves only") |
---|
16 | 16 | | else { |
---|
17 | 17 | | let callerAdress = toBase58String(i.caller.bytes) |
---|
18 | 18 | | [StringEntry(("challenge-" + callerAdress), makeString(["awaiting", side, toString(pmt.amount)], separ))] |
---|
19 | 19 | | } |
---|
20 | 20 | | } |
---|
21 | 21 | | else throw("invalid side") |
---|
22 | 22 | | |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | @Callable(i) |
---|
26 | 26 | | func unsetchallenge () = { |
---|
27 | 27 | | let callerAdress = toBase58String(i.caller.bytes) |
---|
28 | | - | func getchallenge (challendger) = match getString(challendger) { |
---|
| 28 | + | func getchallenge (challendger) = match getString(("challenge-" + challendger)) { |
---|
29 | 29 | | case a: String => |
---|
30 | 30 | | getStringValue(("challenge-" + challendger)) |
---|
31 | 31 | | case _ => |
---|
32 | 32 | | "" |
---|
33 | 33 | | } |
---|
34 | 34 | | |
---|
35 | 35 | | let challenge = split(getchallenge(("challenge-" + callerAdress)), separ) |
---|
36 | 36 | | if ((size(challenge) == 1)) |
---|
37 | 37 | | then if ((challenge[0] == "awaiting")) |
---|
38 | 38 | | then [StringEntry(("challenge-" + callerAdress), makeString(["unset", challenge[1], challenge[2]], separ))] |
---|
39 | 39 | | else throw("challenge not exists") |
---|
40 | 40 | | else throw("challenge not exists") |
---|
41 | 41 | | } |
---|
42 | 42 | | |
---|
43 | 43 | | |
---|