Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

7d14c868fe39439edffe6982b669e7b4d3eb2729eee7c262ec2494ee3e310e99
Timestamp (utc)
2020-12-09 23:51:48
Fee Paid
0.00001492 BSV
(
0.00098683 BSV
-
0.00097191 BSV
)
Fee Rate
500.3 sat/KB
Version
1
Confirmations
327,655
Size Stats
2,982 B

3 Outputs

Total Output:
0.00097191 BSV
  • jrun Run ▸ ExtraM  {"in":0,"ref":["native://Jig"],"out":["d3b7e6abc67f19af62e020053da1c83f6a39ac57b6afd772d6d26b421b3543f8"],"del":[],"cre":["n3CiECgxW1pB1rGbYiX67e4U7AnS3MpJeE"],"exec":[{"op":"DEPLOY","data":["class Token extends Jig {\n init (amount, owner) {\n this._checkAmount(amount)\n\n // The base Token class cannot be created on its own\n const extended = this.constructor !== Token\n if (!extended) throw new Error('Token must be extended')\n\n // Make sure we are calling from ourself\n const minting = caller === this.constructor\n const sending = caller && caller.constructor === this.constructor\n if (!minting && !sending) throw new Error('Must create token using mint()')\n\n this.sender = sending ? caller.owner : null\n this.amount = amount\n if (owner) this.owner = owner\n }\n\n static mint (amount, owner) {\n this.supply += amount\n return new this(amount, owner)\n }\n\n send (to, amount = this.amount) {\n this._checkAmount(amount)\n\n if (this.amount === amount) {\n this.destroy()\n } else if (this.amount > amount) {\n this.amount -= amount\n } else {\n throw new Error('Not enough funds')\n }\n\n return new this.constructor(amount, to)\n }\n\n combine (...tokens) {\n // If no tokens to combine, nothing to do\n if (!tokens.length) return this\n\n // Each token to combine must all be of this type\n const all = tokens.concat(this)\n if (all.some(token => token.constructor !== this.constructor)) {\n throw new Error('Cannot combine different token classes')\n }\n\n // Check for duplicate tokens in the array\n const countOf = token => all.reduce((count, next) => next === token ? count + 1 : count, 0)\n if (all.some(token => countOf(token) > 1)) throw new Error('Cannot combine duplicate tokens')\n\n // Destroy each token, absorbing it into this one\n tokens.forEach(token => {\n this.amount += token.amount\n token.destroy()\n })\n\n // There is no sender for combined tokens\n this.sender = null\n\n // Make sure our new amount is within safe range\n this._checkAmount(this.amount)\n\n return this\n }\n\n destroy () {\n super.destroy()\n\n this.amount = 0\n this.sender = null\n }\n\n _checkAmount (amount) {\n if (typeof amount !== 'number') throw new Error('amount is not a number')\n if (!Number.isInteger(amount)) throw new Error('amount must be an integer')\n if (amount <= 0) throw new Error('amount must be positive')\n if (amount > Number.MAX_SAFE_INTEGER) throw new Error('amount too large')\n }\n}",{"decimals":0,"deps":{"Jig":{"$jig":0}},"icon":{"emoji":null},"sealed":false,"supply":0,"symbol":null,"version":"2.0"}]}]}
    https://whatsonchain.com/tx/7d14c868fe39439edffe6982b669e7b4d3eb2729eee7c262ec2494ee3e310e99