tx · 9rs74Nh8Hivd1TitQAUGMggTbykrBNxJCfExpMUqUY4S 3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA: -0.01000000 Waves 2021.07.24 08:59 [1627326] smart account 3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA > SELF 0.00000000 Waves
{ "type": 13, "id": "9rs74Nh8Hivd1TitQAUGMggTbykrBNxJCfExpMUqUY4S", "fee": 1000000, "feeAssetId": null, "timestamp": 1627106422865, "version": 2, "chainId": 84, "sender": "3N3mV2Baor8EY7CYQ7QgAm3tL8KruH1VpKA", "senderPublicKey": "4P5V3b5K49wXNGa4M6SwDgHAMBa582FxTsF5qjWePQo3", "proofs": [ "2jwf1nRWstxuaL5eqqKjY82nr3wz9syrYjWumoaRWHQaSNaEZcThZq3W6PyL16sZvVLRUPgZ5mnkDDJHZ1rfANfG" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAAAAAABAAAAA2ludgEAAAAEcGxheQAAAAIAAAAEY2FyZAAAAAVjbGFzcwQAAAAKY3VycmVudEtleQgFAAAAA2ludgAAAAZjYWxsZXIEAAAACWJ0Y0Ftb3VudAkBAAAABXZhbHVlAAAAAQgJAAGRAAAAAggFAAAAA2ludgAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQEAAAAD2N1cnJlbnRLZXlCeXRlcwkAAlgAAAABCAgFAAAAA2ludgAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAACGNhcmROYW1lCQABLAAAAAIJAAEsAAAAAgUAAAAFY2xhc3MCAAAAAV8FAAAABGNhcmQEAAAAFWNhcmROYW1lQ3VycmVudFBsYXllcgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAVjbGFzcwIAAAABXwUAAAAEY2FyZAIAAAABXwUAAAAPY3VycmVudEtleUJ5dGVzBAAAAAZ1bmRlYWQBAAAAICanmw90haz4/543ou2eFDbzWrfwLQui7etDznfYZP5DBAAAAAljYXJkc0dhbWUJA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AZ3aW5uZXIJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAOY2FyZEluVGhlQXJlbmEFAAAACGNhcmROYW1lCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA5hcmVuYUNhcmRTY29yZQUAAAAccG9pbnRzUmVtYWluaW5nT25XaW5uaW5nQ2FyZAUAAAADbmlsAAAAAJlqRkg=", "height": 1627326, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: BaLifCGSBEWHWWZXwMXstrAascqfzapLP7F3cdKAU97R Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(inv) | |
7 | + | func play (card,class) = { | |
8 | + | let currentKey = inv.caller | |
9 | + | let btcAmount = value(inv.payments[0].amount) | |
10 | + | let currentKeyBytes = toBase58String(inv.caller.bytes) | |
11 | + | let cardName = ((class + "_") + card) | |
12 | + | let cardNameCurrentPlayer = ((((class + "_") + card) + "_") + currentKeyBytes) | |
13 | + | let undead = base58'3btiz2mNkbcFhcAww6Zn6WaRtDY3mLHf2dbJHNNbdUFk' | |
14 | + | let cardsGame = ["Undead_01", "Undead_02", "Undead_03", "Undead_04", "Undead_05", "Undead_07", "Undead_08", "Undead_09", "Undead_10"] | |
15 | + | let classGame = ["Undead"] | |
16 | + | let assetsGame = ["3btiz2mNkbcFhcAww6Zn6WaRtDY3mLHf2dbJHNNbdUFk"] | |
17 | + | let kingOftheArena = match getString(this, "kingOftheArena") { | |
18 | + | case a: String => | |
19 | + | a | |
20 | + | case _ => | |
21 | + | "" | |
22 | + | } | |
23 | + | let currentCardStatus = match getString(this, ("status_" + cardNameCurrentPlayer)) { | |
24 | + | case t: String => | |
25 | + | t | |
26 | + | case _ => | |
27 | + | "" | |
28 | + | } | |
29 | + | let currentCardScore = match getInteger(this, ("score_" + cardName)) { | |
30 | + | case t: Int => | |
31 | + | t | |
32 | + | case _ => | |
33 | + | 0 | |
34 | + | } | |
35 | + | let playerInTheArena = match getString(this, "playerInTheArena") { | |
36 | + | case t: String => | |
37 | + | t | |
38 | + | case _ => | |
39 | + | "" | |
40 | + | } | |
41 | + | let cardInTheArena = match getString(this, "cardInTheArena") { | |
42 | + | case t: String => | |
43 | + | t | |
44 | + | case _ => | |
45 | + | "" | |
46 | + | } | |
47 | + | let arenaCardScore = match getInteger(this, "arenaCardScore") { | |
48 | + | case t: Int => | |
49 | + | t | |
50 | + | case _ => | |
51 | + | 0 | |
52 | + | } | |
53 | + | if (if (!(containsElement(classGame, class))) | |
54 | + | then !(containsElement(cardsGame, card)) | |
55 | + | else false) | |
56 | + | then throw("A classe enviada não existe no game! Por favor contate o suporte!") | |
57 | + | else if ((0 > assetBalance(currentKey, undead))) | |
58 | + | 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("playerIntTheArena", 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) | |
77 | + | [StringEntry("playerIntTheArena", winner), StringEntry("cardInTheArena", cardName), IntegerEntry("arenaCardScore", pointsRemainingOnWinningCard)] | |
78 | + | } | |
79 | + | } | |
80 | + | ||
81 | + |
github/deemru/w8io/03bedc9 20.52 ms ◑![]()