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