tx · LLJ8oPNXnt73fvCmuyMHFJqP4Va7qV9E1nyaXHTjFun 3N5817sxSDYjf2ZLXWeg7CeTTL5eb5RUGfZ: -0.01000000 Waves 2021.07.23 03:01 [1625538] smart account 3N5817sxSDYjf2ZLXWeg7CeTTL5eb5RUGfZ > SELF 0.00000000 Waves
{ "type": 13, "id": "LLJ8oPNXnt73fvCmuyMHFJqP4Va7qV9E1nyaXHTjFun", "fee": 1000000, "feeAssetId": null, "timestamp": 1626998512810, "version": 2, "chainId": 84, "sender": "3N5817sxSDYjf2ZLXWeg7CeTTL5eb5RUGfZ", "senderPublicKey": "J7rxZzeYSPADJy4erG5pvXRfkEStFn2ytek6F4Xx2VPY", "proofs": [ "4U6cp1Qkn8fMa9tZLnTeHqdPFAGt94QSK352wp5agK6qi2Bpik6g2EJb3u2Qg8HVWj8ZseiLHJVCsXsciC2LrE5J" ], "script": "base64:AAIDAAAAAAAAABAIARIMCgoBAQEBAQEBAQEBAAAAAgEAAAAKcmFuZG9taXplcgAAAAEAAAADaW52BAAAAAhsYXN0UGxheQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzAgAAAARnYW1lAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AQAAABNTb2xkaWVySHVudGVyQm9zc3YxCQAAAgAAAAECAAAAC01hdGNoIGVycm9yBAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAIbGFzdFBsYXkIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hdHVyZQkAAZoAAAABCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAkAAZoAAAABCAUAAA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b2xkaWVyMDIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAACXNvbGRpZXIwMwUAAAAJc29sZGllcjAzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAlzb2xkaWVyMDQFAAAACXNvbGRpZXIwNAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAIaHVudGVyMDEFAAAACGh1bnRlcjAxCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAhodW50ZXIwMgUAAAAIaHVudGVyMDIJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAACGh1bnRlcjAzBQAAAAhodW50ZXIwMwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAIaHVudGVyMDQFAAAACGh1bnRlcjA0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAZib3NzMDEFAAAABmJvc3MwMQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAGYm9zczAyBQAAAAZib3NzMDIFAAAAA25pbAQAAAANcGxheUdhbWVTdGFydAkBAAAACHBsYXlHYW1lAAAAAwUAAAAPY3VycmVudEtleUJ5dGVzCAUAAAAJYnRjQW1vdW50AAAABmFtb3VudAkABLEAAAABBQAAAAhyYW5kaGFzaAUAAAANcGxheUdhbWVTdGFydAAAAAC/Ta/p", "height": 1625538, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6n49im8RPRiNuUdQ9D6tozggzDwEwtPPPfVd5JPaZDRb Next: EXH3Y6TGykBF2bQayp279tjXnagEgLUTdvCgmLgnn4Q2 Diff:
Old | New | Differences | |
---|---|---|---|
23 | 23 | case _ => | |
24 | 24 | "" | |
25 | 25 | } | |
26 | - | WriteSet([DataEntry("playerWaiting", ""), DataEntry("btcAmount", | |
26 | + | WriteSet([DataEntry("playerWaiting", ""), DataEntry("btcAmount", soldiersAndHunters)]) | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func randomizer (inv) = { | |
5 | 5 | let lastPlay = match getBinary(this, "game") { | |
6 | 6 | case s: ByteVector => | |
7 | 7 | s | |
8 | 8 | case _: Unit => | |
9 | 9 | base58'GGvfcHWwd2azCVLaeeQzr6Ccyn' | |
10 | 10 | case _ => | |
11 | 11 | throw("Match error") | |
12 | 12 | } | |
13 | 13 | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
14 | 14 | sha256(rand) | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func playGame (currentKeyBytes,amountBtc,randomNumber) = { | |
19 | 19 | let soldiersAndHunters = toString((randomNumber % 4)) | |
20 | 20 | let soldiersBatle = match getInteger(this, ("soldier" + soldiersAndHunters)) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | "" | |
25 | 25 | } | |
26 | - | WriteSet([DataEntry("playerWaiting", ""), DataEntry("btcAmount", | |
26 | + | WriteSet([DataEntry("playerWaiting", ""), DataEntry("btcAmount", soldiersAndHunters)]) | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(inv) | |
31 | 31 | func play (soldier01,soldier02,soldier03,soldier04,hunter01,hunter02,hunter03,hunter04,boss01,boss02) = { | |
32 | 32 | let randhash = randomizer(inv) | |
33 | 33 | let currentKey = inv.caller | |
34 | 34 | let btcAmount = extract(inv.payment) | |
35 | 35 | let deckCards = [soldier01, soldier02, soldier03, soldier04, hunter01, hunter02, hunter03, hunter04, boss01, boss02] | |
36 | 36 | let currentKeyBytes = toBase58String(inv.caller.bytes) | |
37 | 37 | let undead = base58'DdM4S3gFdTGCTPeNH1xRE3KjaUNDosoXCKvEY76VfP4o' | |
38 | 38 | let kingOftheArena = match getString(this, "kingOftheArena") { | |
39 | 39 | case a: String => | |
40 | 40 | a | |
41 | 41 | case _ => | |
42 | 42 | "" | |
43 | 43 | } | |
44 | 44 | if ((0 > assetBalance(currentKey, undead))) | |
45 | 45 | then throw("E necessário ter o token do deck em sua carteira! Para adquirir, realize a troca em Swap Decks.") | |
46 | 46 | else if ((kingOftheArena == "")) | |
47 | 47 | then WriteSet([DataEntry("kingOftheArena", currentKeyBytes), DataEntry("btcAmount", btcAmount.amount), DataEntry("soldier01", soldier01), DataEntry("soldier02", soldier02), DataEntry("soldier03", soldier03), DataEntry("soldier04", soldier04), DataEntry("hunter01", hunter01), DataEntry("hunter02", hunter02), DataEntry("hunter03", hunter03), DataEntry("hunter04", hunter04), DataEntry("boss01", boss01), DataEntry("boss02", boss02)]) | |
48 | 48 | else { | |
49 | 49 | let playGameStart = playGame(currentKeyBytes, btcAmount.amount, toInt(randhash)) | |
50 | 50 | playGameStart | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 |
github/deemru/w8io/169f3d6 59.76 ms ◑