Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

419f1a052198cc8464d9816e33c6ea9ec9025877b5a521df626fdab97a15fc2a
Timestamp (utc)
2021-01-13 05:41:42
Fee Paid
0.00003374 BSV
(
0.00997892 BSV
-
0.00994518 BSV
)
Fee Rate
510.2 sat/KB
Version
1
Confirmations
327,958
Size Stats
6,610 B

3 Outputs

Total Output:
0.00994518 BSV
  • jrun cryptofightsMÍ{"in":0,"ref":["0efb3c5ac2270473fe88020379eb7626dff98752e5f786912a89d63593cc61c4_o1","e73a45bf61cd8249622cabb0ccc44da0df7b66e731b33a6ea5a22b42755ceb45_o1","8e5d26176cc5ce4f2734e2fb8abb6da01237f5c1736839adf8a82659ecbe85d6_o1","0e660dbbccc19c47e388dbd07832821da0083f020eced33c3f49d195df5427bc_o1","be7daf36641ba33aad8f42e02adbbcb48fb88cc0c6ac6b56f4c85369dcd2dfa1_o1","507b9cffbeb94c2386e054f3d63617f7b091e0bdb1619a99c3cd04e309be45f3_o1","b61ceaab3690af8868f1b305d30b9ea37688681de59732610963091f7b8277da_o1","b2ddb06a8acf4f6e7f594d812982ef6a924390d6e898a83140aa58606b1d2d05_o1","09bd143029afaade742ebe5b7a809e44d3dbd0282294a3106a9a227fa1ba8a65_o1","589e107231b17445bc648ace9e1a852d201409a3ed42280c3f5ff4033c1a28ac_o1"],"out":["54e38fd62a7efb97ed5c3a97e6077ffdeb4536364dc81b5c51256b7d037ad91a"],"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(players, this.dice);\n this.turnCount = 0;\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 this.stage = 'open';\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._finalize(this.state.playerToAct);\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(victorIndex) {\n const victor = this.victor = {...this.battlePlayers[victorIndex]};\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.owner, 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 }\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":"de43d8c95e6dcf22e5e419d9f4a2c208ee0b2afbff6d4f60f89f7529ee2a2be9"}]}]}
    https://whatsonchain.com/tx/419f1a052198cc8464d9816e33c6ea9ec9025877b5a521df626fdab97a15fc2a