Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

487e7246323be56d856247cb3b5ce72da3d27acc28fe2176b168158136c40a5e
Timestamp (utc)
2021-05-08 22:44:49
Fee Paid
0.00003307 BSV
(
0.00870324 BSV
-
0.00867017 BSV
)
Fee Rate
511.4 sat/KB
Version
1
Confirmations
306,672
Size Stats
6,466 B

3 Outputs

Total Output:
0.00867017 BSV
  • jrun cryptofightsM={"in":0,"ref":["fdecb45524eb099302ce3f49664d37517855f0737e1e41772ab896032d7b6b55_o1"],"out":["ab18c2541589780967141ffa8d02a3866753ab45d3514afa9ea263be3874c41d"],"del":[],"cre":["n2Bd4cWhEQK1aVjb1R7EBGV9mrw3etvSdC"],"exec":[{"op":"DEPLOY","data":["class Fighter extends FyxJig {\n init(owner, race, abilityScores, appearance, metadata = {}) {\n Fighter.validateStartingScores(race, abilityScores);\n this.race = race;\n this.abilityScores = abilityScores;\n this.appearance = appearance;\n this.metadata = {\n ...metadata,\n publisher: 'FYX'\n };\n\n this.xp = 0;\n this.hpBonus = 0;\n this.level = 1;\n\n this.skills = [\n this.constructor.config.SkillType.Attack,\n this.constructor.config.SkillType.Focus,\n this.constructor.config.SkillType.Hide,\n Fighter.initialSkills[race]\n ];\n\n this.owner = owner;\n }\n\n setSatoshis(satoshis) {\n this.satoshis = satoshis;\n }\n\n static validateStartingScores(race, abilityScores) {\n const costs = {\n 1: 1,\n 2: 2,\n 3: 4,\n 4: 7,\n 5: 11,\n 6: 16\n };\n\n let cost = 0;\n abilityScores.forEach((score, ability) => {\n const start = Fighter.initialScores[race][ability];\n const upgrade = score - start;\n if (upgrade < 0) throw new Error('Invalid Ability Scores');\n if (upgrade > 0) {\n const points = costs[upgrade];\n if (!points) throw new Error('Invalid Ability Scores');\n cost += points;\n }\n });\n if (cost === 15) return true;\n throw new Error('Invalid Ability Scores');\n }\n\n transfer(recipient) {\n this.owner = recipient;\n }\n\n recordVictory(battle) {\n if (battle.constructor.owner !== Fighter.owner) throw new Error('Unauthorized battle');\n if (battle.validator !== this.constructor.config.pubkey) {\n console.log('Validator:', battle.validator);\n console.log('Config.pubkey:', this.constructor.config.pubkey);\n throw new Error('Unauthorized validator');\n }\n if (battle.victor.fighter !== this) throw new Error('Stolen Valor!');\n\n this.xp += battle.xp;\n battle.destroy();\n }\n\n levelUp(ability, skillType) {\n if (this.xp < this.constructor.config.LevelUpXP[this.level]) {\n throw new Error('Inadequite XP');\n }\n this.level++;\n if (this.constructor.config.SkillLevels.includes(this.level)) {\n if (!skillType) {\n throw new Error('Requested skill at Index ' + skillType + ' is not found!');\n }\n let skillInfo = this.constructor.config.SkillData[skillType];\n if ((this.level - 1) < skillInfo.requiredLevel) {\n throw new Error(`Player doesn't meet skill level up requirements to unlock ${skillType}. Player is low level`);\n }\n skillInfo.requiredSkills.forEach(st => {\n if (!this.skills.includes(st)) {\n throw new Error(`Player doesn't meet skill level up requirements unlock ${skillType}. Missing ${st}`);\n }\n });\n\n this._applySkill(skillType);\n skillInfo.unlockableSkills.forEach(st => {\n this._applySkill(st);\n });\n }\n\n if (this.constructor.config.AbilityScoreLevels.includes(this.level)) {\n this.abilityScores[ability]++;\n }\n \n this.hpBonus += 4; \n }\n\n _applySkill(skillType) {\n // TODO validate prerequesite for skillType\n this.skills.push(skillType);\n }\n\n static setConfig(key, value) {\n this.config[key] = value;\n }\n\n}",{"config":{"Default":{"Address":{"payToScriptHash":196,"pubKeyHash":111},"Bip32":{"privKey":70615956,"pubKey":70617039},"Block":{"magicNum":4108710900,"maxNBits":486604799},"MaxSize":33554432,"Msg":{"magicNum":4108710900,"versionBytesNum":70015},"Port":18333,"PrivKey":{"versionByteNum":239},"TxBuilder":{"dust":546,"feePerKbNum":500},"Workers":{"timeout":60000}},"Mainnet":{"Address":{"payToScriptHash":5,"pubKeyHash":0},"Bip32":{"privKey":76066276,"pubKey":76067358},"Block":{"magicNum":3823236072,"maxNBits":486604799},"MaxSize":33554432,"Msg":{"magicNum":3823236072,"versionBytesNum":70015},"Port":8333,"PrivKey":{"versionByteNum":128},"TxBuilder":{"$dup":["1","config","Default","TxBuilder"]},"Workers":{"$dup":["1","config","Default","Workers"]}},"Regtest":{"Address":{"payToScriptHash":196,"pubKeyHash":111},"Bip32":{"privKey":70615956,"pubKey":70617039},"Block":{"magicNum":3669344250,"maxNBits":545259519},"MaxSize":33554432,"Msg":{"magicNum":3669344250,"versionBytesNum":70015},"Port":18444,"PrivKey":{"versionByteNum":239},"TxBuilder":{"$dup":["1","config","Default","TxBuilder"]},"Workers":{"$dup":["1","config","Default","Workers"]}},"STN":{"Address":{"payToScriptHash":196,"pubKeyHash":111},"Bip32":{"privKey":70615956,"pubKey":70617039},"Block":{"magicNum":4224632057,"maxNBits":486604799},"MaxSize":33554432,"Msg":{"magicNum":4224632057,"versionBytesNum":70015},"Port":9333,"PrivKey":{"versionByteNum":239},"TxBuilder":{"$dup":["1","config","Default","TxBuilder"]},"Workers":{"$dup":["1","config","Default","Workers"]}},"Testnet":{"Address":{"$dup":["1","config","Default","Address"]},"Bip32":{"$dup":["1","config","Default","Bip32"]},"Block":{"$dup":["1","config","Default","Block"]},"MaxSize":33554432,"Msg":{"$dup":["1","config","Default","Msg"]},"Port":18333,"PrivKey":{"$dup":["1","config","Default","PrivKey"]},"TxBuilder":{"$dup":["1","config","Default","TxBuilder"]},"Workers":{"$dup":["1","config","Default","Workers"]}}},"deps":{"FyxJig":{"$jig":0}},"hash":"f60473b1fc944c7d76da2c04a88f1de3c43a9ee0124e10367069346bd195895d","initialScores":{"0":[8,8,8],"1":[9,7,7],"2":[7,7,7]},"initialSkills":{"0":33,"1":31,"2":32},"metadata":{"app":"Cryptofights","emoji":"👤","name":"Fighter","publisher":"FYX"},"transferrable":true}]}]}
    https://whatsonchain.com/tx/487e7246323be56d856247cb3b5ce72da3d27acc28fe2176b168158136c40a5e