tx · FmYuJTKASXeq54swy8UYfMEnKZTC16KTLLcBNzTudX4E 3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA: -0.01000000 Waves 2021.07.24 09:02 [1627329] smart account 3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA > SELF 0.00000000 Waves
{ "type": 13, "id": "FmYuJTKASXeq54swy8UYfMEnKZTC16KTLLcBNzTudX4E", "fee": 1000000, "feeAssetId": null, "timestamp": 1627106578380, "version": 2, "chainId": 84, "sender": "3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA", "senderPublicKey": "4P5V3b5K49wXNGa4M6SwDgHAMBa582FxTsF5qjWePQo3", "proofs": [ "64VvWLnT6NQhga9sqW14ZDZP9wQoearxJLDrLuFN4TUvDXwTVPjuQt16m38sBiLnjT9CihRvRTbmWAppEnjXj2R7" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAAAAAABAAAAA2ludgEAAAAEcGxheQAAAAIAAAAEY2FyZAAAAAVjbGFzcwQAAAAKY3VycmVudEtleQgFAAAAA2ludgAAAAZjYWxsZXIEAAAACWJ0Y0Ftb3VudAkBAAAABXZhbHVlAAAAAQgJAAGRAAAAAggFAAAAA2ludgAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAAD2N1cnJlbnRLZXlCeXRlcwkAAlgAAAABCAgFAAAAA2ludgAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAACGNhcmROYW1lCQABLAAAAAIJAAEsAAAAAgUAAAAFY2xhc3MCAAAAAV8FAAAABGNhcmQEAAAAFWNhcmROYW1lQ3VycmVudFBsYXllcgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAVjbGFzcwIAAAABXwUAAAAEY2FyZAIAAAABXwUAAAAPY3VycmVudEtleUJ5dGVzBAAAAAZ1bmRlYWQBAAAAICanmw90haz4/543ou2eFDbzWrfwLQui7etDznfYZP5DBAAAAAljYXJkc0dhbWUJAARMAAAA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TY29yZQUAAAAQY3VycmVudENhcmRTY29yZQUAAAADbmlsAwkAAAAAAAACBQAAABFjdXJyZW50Q2FyZFN0YXR1cwIAAAAEVXNlZAkAAAIAAAABAgAAAB1Fc3RhIGNhcnRhIGrDoSBmb2kgdXRpbGl6YWRhIQQAAAAGd2lubmVyAwkAAGYAAAACBQAAABBjdXJyZW50Q2FyZFNjb3JlBQAAAA5hcmVuYUNhcmRTY29yZQUAAAAPY3VycmVudEtleUJ5dGVzBQAAABBwbGF5ZXJJblRoZUFyZW5hBAAAAAt3aW5uaW5nQ2FyZAMJAABmAAAAAgUAAAAQY3VycmVudENhcmRTY29yZQUAAAAOYXJlbmFDYXJkU2NvcmUFAAAAD2N1cnJlbnRLZXlCeXRlcwUAAAAQcGxheWVySW5UaGVBcmVuYQQAAAAccG9pbnRzUmVtYWluaW5nT25XaW5uaW5nQ2FyZAMJAABmAAAAAgUAAAAQY3VycmVudENhcmRTY29yZQUAAAAOYXJlbmFDYXJkU2NvcmUJAABlAAAAAgUAAAAQY3VycmVudENhcmRTY29yZQUAAAAOYXJlbmFDYXJkU2NvcmUJAABlAAAAAgUAAAAOYXJlbmFDYXJkU2NvcmUFAAAAEGN1cnJlbnRDYXJkU2NvcmUJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAARcGxheWVySW50VGhlQXJlbmEFAAAABndpbm5lcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA5jYXJkSW5UaGVBcmVuYQUAAAAIY2FyZE5hbWUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADmFyZW5hQ2FyZFNjb3JlBQAAABxwb2ludHNSZW1haW5pbmdPbldpbm5pbmdDYXJkBQAAAANuaWwAAAAATmeeKQ==", "height": 1627329, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BaLifCGSBEWHWWZXwMXstrAascqfzapLP7F3cdKAU97R Next: 7fu9MsNHf9brEMAouggmcUkFcPjjHMrsLWFeFhYxEBzP Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | let cardsGame = ["Undead_01", "Undead_02", "Undead_03", "Undead_04", "Undead_05", "Undead_07", "Undead_08", "Undead_09", "Undead_10"] | |
15 | 15 | let classGame = ["Undead"] | |
16 | 16 | let assetsGame = ["3btiz2mNkbcFhcAww6Zn6WaRtDY3mLHf2dbJHNNbdUFk"] | |
17 | - | let kingOftheArena = match getString(this, "kingOftheArena") { | |
18 | - | case a: String => | |
19 | - | a | |
20 | - | case _ => | |
21 | - | "" | |
22 | - | } | |
23 | 17 | let currentCardStatus = match getString(this, ("status_" + cardNameCurrentPlayer)) { | |
24 | 18 | case t: String => | |
25 | 19 | t | |
56 | 50 | then throw("A classe enviada não existe no game! Por favor contate o suporte!") | |
57 | 51 | else if ((0 > assetBalance(currentKey, undead))) | |
58 | 52 | then throw("E necessário ter o token do deck em sua carteira! Para adquirir, realize a compra em Swap Decks.") | |
59 | - | else if ((kingOftheArena == "")) | |
60 | - | then [StringEntry("kingOftheArena", currentKeyBytes)] | |
61 | - | else if (if ((cardInTheArena == "")) | |
62 | - | then true | |
63 | - | else (playerInTheArena == "")) | |
64 | - | then [StringEntry("playerInTheArena", playerInTheArena), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", currentCardScore)] | |
65 | - | else if ((currentCardStatus == "Used")) | |
66 | - | then throw("Esta carta já foi utilizada!") | |
67 | - | else { | |
68 | - | let winner = if ((currentCardScore > arenaCardScore)) | |
69 | - | then currentKeyBytes | |
70 | - | else playerInTheArena | |
71 | - | let winningCard = if ((currentCardScore > arenaCardScore)) | |
72 | - | then currentKeyBytes | |
73 | - | else playerInTheArena | |
74 | - | let pointsRemainingOnWinningCard = if ((currentCardScore > arenaCardScore)) | |
75 | - | then (currentCardScore - arenaCardScore) | |
76 | - | else (arenaCardScore - currentCardScore) | |
53 | + | else if (if ((cardInTheArena == "")) | |
54 | + | then true | |
55 | + | else (playerInTheArena == "")) | |
56 | + | then [StringEntry("playerInTheArena", playerInTheArena), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", currentCardScore)] | |
57 | + | else if ((currentCardStatus == "Used")) | |
58 | + | then throw("Esta carta já foi utilizada!") | |
59 | + | else { | |
60 | + | let winner = if ((currentCardScore > arenaCardScore)) | |
61 | + | then currentKeyBytes | |
62 | + | else playerInTheArena | |
63 | + | let winningCard = if ((currentCardScore > arenaCardScore)) | |
64 | + | then currentKeyBytes | |
65 | + | else playerInTheArena | |
66 | + | let pointsRemainingOnWinningCard = if ((currentCardScore > arenaCardScore)) | |
67 | + | then (currentCardScore - arenaCardScore) | |
68 | + | else (arenaCardScore - currentCardScore) | |
77 | 69 | [StringEntry("playerIntTheArena", winner), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", pointsRemainingOnWinningCard)] | |
78 | - | ||
70 | + | } | |
79 | 71 | } | |
80 | 72 | ||
81 | 73 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(inv) | |
7 | 7 | func play (card,class) = { | |
8 | 8 | let currentKey = inv.caller | |
9 | 9 | let btcAmount = value(inv.payments[0].amount) | |
10 | 10 | let currentKeyBytes = toBase58String(inv.caller.bytes) | |
11 | 11 | let cardName = ((class + "_") + card) | |
12 | 12 | let cardNameCurrentPlayer = ((((class + "_") + card) + "_") + currentKeyBytes) | |
13 | 13 | let undead = base58'3btiz2mNkbcFhcAww6Zn6WaRtDY3mLHf2dbJHNNbdUFk' | |
14 | 14 | let cardsGame = ["Undead_01", "Undead_02", "Undead_03", "Undead_04", "Undead_05", "Undead_07", "Undead_08", "Undead_09", "Undead_10"] | |
15 | 15 | let classGame = ["Undead"] | |
16 | 16 | let assetsGame = ["3btiz2mNkbcFhcAww6Zn6WaRtDY3mLHf2dbJHNNbdUFk"] | |
17 | - | let kingOftheArena = match getString(this, "kingOftheArena") { | |
18 | - | case a: String => | |
19 | - | a | |
20 | - | case _ => | |
21 | - | "" | |
22 | - | } | |
23 | 17 | let currentCardStatus = match getString(this, ("status_" + cardNameCurrentPlayer)) { | |
24 | 18 | case t: String => | |
25 | 19 | t | |
26 | 20 | case _ => | |
27 | 21 | "" | |
28 | 22 | } | |
29 | 23 | let currentCardScore = match getInteger(this, ("score_" + cardName)) { | |
30 | 24 | case t: Int => | |
31 | 25 | t | |
32 | 26 | case _ => | |
33 | 27 | 0 | |
34 | 28 | } | |
35 | 29 | let playerInTheArena = match getString(this, "playerInTheArena") { | |
36 | 30 | case t: String => | |
37 | 31 | t | |
38 | 32 | case _ => | |
39 | 33 | "" | |
40 | 34 | } | |
41 | 35 | let cardInTheArena = match getString(this, "cardInTheArena") { | |
42 | 36 | case t: String => | |
43 | 37 | t | |
44 | 38 | case _ => | |
45 | 39 | "" | |
46 | 40 | } | |
47 | 41 | let arenaCardScore = match getInteger(this, "arenaCardScore") { | |
48 | 42 | case t: Int => | |
49 | 43 | t | |
50 | 44 | case _ => | |
51 | 45 | 0 | |
52 | 46 | } | |
53 | 47 | if (if (!(containsElement(classGame, class))) | |
54 | 48 | then !(containsElement(cardsGame, card)) | |
55 | 49 | else false) | |
56 | 50 | then throw("A classe enviada não existe no game! Por favor contate o suporte!") | |
57 | 51 | else if ((0 > assetBalance(currentKey, undead))) | |
58 | 52 | then throw("E necessário ter o token do deck em sua carteira! Para adquirir, realize a compra em Swap Decks.") | |
59 | - | else if ((kingOftheArena == "")) | |
60 | - | then [StringEntry("kingOftheArena", currentKeyBytes)] | |
61 | - | else if (if ((cardInTheArena == "")) | |
62 | - | then true | |
63 | - | else (playerInTheArena == "")) | |
64 | - | then [StringEntry("playerInTheArena", playerInTheArena), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", currentCardScore)] | |
65 | - | else if ((currentCardStatus == "Used")) | |
66 | - | then throw("Esta carta já foi utilizada!") | |
67 | - | else { | |
68 | - | let winner = if ((currentCardScore > arenaCardScore)) | |
69 | - | then currentKeyBytes | |
70 | - | else playerInTheArena | |
71 | - | let winningCard = if ((currentCardScore > arenaCardScore)) | |
72 | - | then currentKeyBytes | |
73 | - | else playerInTheArena | |
74 | - | let pointsRemainingOnWinningCard = if ((currentCardScore > arenaCardScore)) | |
75 | - | then (currentCardScore - arenaCardScore) | |
76 | - | else (arenaCardScore - currentCardScore) | |
53 | + | else if (if ((cardInTheArena == "")) | |
54 | + | then true | |
55 | + | else (playerInTheArena == "")) | |
56 | + | then [StringEntry("playerInTheArena", playerInTheArena), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", currentCardScore)] | |
57 | + | else if ((currentCardStatus == "Used")) | |
58 | + | then throw("Esta carta já foi utilizada!") | |
59 | + | else { | |
60 | + | let winner = if ((currentCardScore > arenaCardScore)) | |
61 | + | then currentKeyBytes | |
62 | + | else playerInTheArena | |
63 | + | let winningCard = if ((currentCardScore > arenaCardScore)) | |
64 | + | then currentKeyBytes | |
65 | + | else playerInTheArena | |
66 | + | let pointsRemainingOnWinningCard = if ((currentCardScore > arenaCardScore)) | |
67 | + | then (currentCardScore - arenaCardScore) | |
68 | + | else (arenaCardScore - currentCardScore) | |
77 | 69 | [StringEntry("playerIntTheArena", winner), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", pointsRemainingOnWinningCard)] | |
78 | - | ||
70 | + | } | |
79 | 71 | } | |
80 | 72 | ||
81 | 73 |
github/deemru/w8io/873ac7e 30.75 ms ◑![]()