Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

40b71b1f4183c92aba42a71fe1bc99800ae230a8af4a306bc5f5a3fa10d294cc
Timestamp (utc)
2021-02-19 23:02:03
Fee Paid
0.00006738 BSV
(
0.00992223 BSV
-
0.00985485 BSV
)
Fee Rate
985 sat/KB
Version
1
Confirmations
315,679
Size Stats
6,840 B

3 Outputs

Total Output:
0.00985485 BSV
  • jrun cryptofightsM³{"in":0,"ref":["52508cf83be31a5ec0050ed46e414fcd9ebca4c6a15bfa695c06942ce3f96ac6_o1","e3c773ec17ed09e32cc39dcacdc0097875de22feae90739476f5ce5921328277_o1","384125df69ae11bcad90feee6ac9308bd186f08a8ab6bd2606719e0adecd1eee_o1","20af650ed493f124361af75c0d2131238266d3cb9098e1b819ca9ef176ed2c1c_o1","0e67d7acd5e354a1ca17e42b5bf078e5f58b9a550566ed9a24e339dc1ed8f769_o1","e3a71f1844f597ad4f8af1485f385b518c239d11c338503870d459306024df81_o1","7bdc5790e34a0a7adf4c529fdc5880f714149bad3efdf7ceb2a870286b8f05d3_o1","438bfb5abc25e9bd04217610b78df75d748f3a63153084f9b33bd871172cb492_o1","a9025a452f1e2d9a65b349260a79ed7bed3c9f048eaeb07efcc4c09a0aa800af_o1","e9c568244b6cf874b22072812cdfd51d272b4e831f5cdf3912d48745bc7c701e_o1"],"out":["b2f2470dafea623081d7ae7fb02cf237f5d66304149022180340528390b722b1"],"del":[],"cre":["n2Bd4cWhEQK1aVjb1R7EBGV9mrw3etvSdC"],"exec":[{"op":"DEPLOY","data":["class Battle extends KronoJig {\n init(validator, rules, players, id, timestamp) {\n this.validator = validator;\n this.id = this.random = id;\n this.timestamp = timestamp;\n this.rules = rules;\n\n this.battlePlayers = players.map(player => rules.joinBattle(validator, player));\n this.battlegroundTier = rules.tier;\n this.dice = new Dice(id);\n this.state = BattleUtils.buildBattleState(this.battlePlayers, this.dice);\n this.turnCount = 0;\n\n this.satoshis = 546;\n\n this.stateHash = Sha256.hashToHex(JSON.stringify(this.state));\n this.status = Constants.Status.Open;\n this.stateHistory = [];\n this.actor = players[this.state.playerToAct].pubkey;\n this.stage = 'created';\n }\n\n begin(timeout) {\n if (this.stage !== 'created') throw new Error('Invalid Stage');\n this.timeout = timeout;\n delete this.stage;\n }\n\n resolve(random, timestamp, timeout, actionIndex, clientTimestamp, sig) {\n console.log('Resolve', this.location);\n if (this.status !== Constants.Status.Open) throw new Error('Invalid Status');\n if (!BattleUtils.validateRandom(random, this.random)) throw new Error('Invalid Random');\n this.random = random;\n\n this.stateHistory[this.turnCount] = this.getState();\n const state = KronoClass.deepClone(this.state);\n state.actionLogs = [];\n this.dice = new Dice(random);\n if (timestamp < this.timeout) {\n if (actionIndex === -1) {\n this.state = BattleUtils.skipTurn(this, state, this.dice, timestamp);\n } else {\n const attacker = this.battlePlayers[this.state.playerToAct];\n const skill = attacker.skills[actionIndex];\n if (!skill) throw new Error(`${attacker.fighter.displayName} used an invalid Skill ID: ${actionIndex}`);\n this.state = skill.run(this, state, this.dice, timestamp);\n }\n } else {\n this.state = BattleUtils.skipTurn(this, state, this.dice, timestamp);\n }\n\n this.status = this.state.status;\n this.timestamp = timestamp;\n this.timeout = timeout;\n this._endTurn();\n }\n\n forfeit(message, timestamp) {\n if (this.status !== Constants.Status.Open) throw new Error('Invalid Status');\n const playerIndex = this.battlePlayers.findIndex(p => p.pubkey === message.from);\n const victorIndex = this.battlePlayers.findIndex(p => p.pubkey !== message.from);\n this.stateHistory[this.turnCount] = this.getState();\n\n const state = KronoClass.deepClone(this.state);\n state.victor = {\n pubkey: this.battlePlayers[victorIndex].pubkey,\n owner: this.battlePlayers[victorIndex].owner,\n fighter: this.battlePlayers[victorIndex].fighter,\n };\n state.actionLogs = [{\n playerIndex: playerIndex,\n actionLogMessage: `<gradient=!player${playerIndex}-color><b>${this.battlePlayers[playerIndex].fighter.displayName.toUpperCase()}</b> <gradient=!log-color> Forfeited`\n }];\n state.playerToAct = victorIndex;\n this.state = state;\n\n this.status = state.status = Constants.Status.Forfeit;\n this.timestamp = timestamp;\n this._endTurn();\n }\n\n _endTurn() {\n if (this.status !== Constants.Status.Open) {\n this.victor = {...this.battlePlayers[this.state.playerToAct]};\n this._finalize();\n }\n this.turnCount++;\n this.stateHash = Sha256.hashToHex(JSON.stringify(this.state));\n this.actor = this.battlePlayers[this.state.playerToAct].pubkey;\n }\n\n _finalize() {\n // if(![Constants.Status.Complete, Constants.Status.Forfeit].includes(this.status)) throw new Error('Invalid Status');\n const victor = this.victor;\n this.xp = Battle.LevelXPReward[victor.fighter.level];\n if(this.rules.fee) {\n console.log('Reward:', this.rules.reward);\n let coins = this.battlePlayers.map(p => p.coin);\n const coin = coins.pop();\n coin.combine(...coins);\n console.log('Coin Amount:', coin.amount);\n coin.send(victor.coinLock, this.rules.reward);\n }\n\n if (!victor.tags.includes('bot')) {\n this.rewards = this.rules.issueRewards(this.dice, this.battlegroundTier, victor.owner);\n }\n this.battlePlayers.forEach(player => new BattleToken(player.owner));\n this.owner = victor.owner;\n // this.status = Constants.Status.Finalized;\n }\n\n getState() {\n const state = {\n ...this.state,\n location: this.location,\n actor: this.actor,\n battleId: this.id,\n random: this.random,\n stateHash: this.stateHash,\n timestamp: this.timestamp,\n turnCount: this.turnCount,\n timeout: this.timeout,\n battleStatus: this.status\n };\n return state;\n }\n\n toObject(skipKeys = []) {\n return super.toObject([...skipKeys, 'tokens']);\n }\n}",{"LevelXPReward":[0,100,200,300,600,1200,2400,0,435,556,713,913,1170,1498,1919,2458,3148,4032,5164,6614,8472],"MaxRounds":100,"deps":{"Action":{"$jig":0},"BattleToken":{"$jig":1},"BattleUtils":{"$jig":2},"Constants":{"$jig":3},"Dice":{"$jig":4},"KronoClass":{"$jig":5},"KronoCoin":{"$jig":6},"KronoItem":{"$jig":7},"KronoJig":{"$jig":8},"Sha256":{"$jig":9}},"hash":"59f98338fdb4f6c6613ac25d8bbe670323238ebd63ec2cc78324b04365e812f7"}]}]}
    https://whatsonchain.com/tx/40b71b1f4183c92aba42a71fe1bc99800ae230a8af4a306bc5f5a3fa10d294cc