Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

9a59be77471f3f0625bfae00cdf254592e9dbc684a4e51e4616c917606eee5a8
Timestamp (utc)
2021-06-07 10:17:10
Fee Paid
0.00006559 BSV
(
0.06640043 BSV
-
0.06633484 BSV
)
Fee Rate
500 sat/KB
Version
1
Confirmations
299,875
Size Stats
13,116 B

6 Outputs

Total Output:
0.06633484 BSV
  • jrunMÞ1{"in":0,"ref":["native://Jig","f97d4ac2a3d6f5ed09fad4a4f341619dc5a3773d9844ff95c99c5d4f8388de2f_o1"],"out":["ba2c403d4879b661c7704b997ea2b4aa3719b1f6f9bd4eb942c81c7645b90054","c965463da1ebd21b3aba8b835e1e3cd6e1aa9999fcd9fa766375b597b44838f6","8f46689f7572ffca6b73f8f45341c1777742731bf4f42fba030cbda3f78e7ae5","acecf44a0884ecf43339d8daac5422e496ce534de702da619a30f404141b6fcc"],"del":[],"cre":["mzrgrGpxHoKgWB7b5g3Dj8GRS1V1Qtjywn","mzrgrGpxHoKgWB7b5g3Dj8GRS1V1Qtjywn","mzrgrGpxHoKgWB7b5g3Dj8GRS1V1Qtjywn","mzrgrGpxHoKgWB7b5g3Dj8GRS1V1Qtjywn"],"exec":[{"op":"DEPLOY","data":["class LIN_BaseJig extends Jig {\n init(opts) {\n super.init()\n this.className = \"LIN_BaseJig\";\n this.name = opts.name || \"\";\n this.setTitle(opts.title, opts.description);\n }\n id(){ return this.origin; }\n setTitle(t, d){\n this.title = t || \"\";\n this.description = d || \"\";\n }\n deposit(val){\n this.satoshis += val || 0;\n }\n withdraw(val){\n this.satoshis -= val || 0;\n }\n balance(){\n return this.satoshis || 0;\n }\n send(to){\n this.owner = to;\n }\n}",{"deps":{"Jig":{"$jig":0}},"title":"LIN_BaseJig","version":"0.1.0"},"class LIN_BucketContract extends LIN_BaseJig {\n init(opts) {\n super.init(opts);\n this.className = \"LIN_BucketContract\";\n this.children = [];\n this._c_at = opts.c_at || -1;\n this._dstr_at = -1;\n }\n newChild(opts, dsp_to){\n const jig = new LIN_LicenseContract(opts, dsp_to || opts.dsp_to || \"\");\n this.children.push(jig)\n return jig;\n }\n\n getChild(idx){\n return this.children[idx];\n }\n\n debugChild(idx) {\n console.log(\"LIN_BucketContract debug child: \", idx);\n this.children[idx].debug();\n }\n\n\n getCanA(){ return this.children.filter(c=>c.canA()) }\n cntCanA(){ return (this.getCanA() || []).length; }\n\n getCanDsp(){ return this.children.filter(c=>c.canDsp()) }\n cntCanDsp(){ return (this.getCanDsp() || []).length; }\n\n getCanP(){ return this.children.filter(c=>c.canP()) }\n cntCanP(){ return (this.getCanP() || []).length; }\n\n getX(){ return this.children.filter(c=>c.isX()) }\n cntX(){ return (this.getX() || []).length; }\n\n getVld(){ return this.children.filter(c=>c.isVld()) }\n cntVld(){ return (this.getVld() || []).length; }\n\n send() {\n throw new Error(\"Can not send a bucket\")\n }\n\n deposit() {\n throw new Error(\"Can not deposit on a bucket\")\n }\n\n withdraw() {\n throw new Error(\"Can not withdraw from a bucket\")\n }\n\n destroy(cdt){\n expect(this.cntVld()).toBe(0, \"Can not destroy a bucket with valid licenses.\")\n this._dstr_at = cdt;\n super.destroy(cdt);\n }\n\n}",{"deps":{"LIN_BaseJig":{"$jig":2},"LIN_LicenseContract":{"$jig":4},"expect":{"$jig":1}},"title":"LIN_BucketContract","version":"0.1.0"},"class LIN_LicenseContract extends LIN_BaseJig {\n init(opts, dsp_to) {\n opts = opts || {};\n super.init(opts);\n\n // Constants\n this.className = \"LIN_LicenseContract\";\n\n // Expectations\n expect(caller).toBeInstanceOf(LIN_BucketContract)\n expect(opts.c_at).toBeInteger(\"Creation date is invalid\")\n\n //\n this.parent = {\n origin: caller.origin,\n location: caller.location,\n owner: caller.owner\n };\n\n // Configurations\n this.cnf(opts);\n\n // Privates\n this._c_at = opts.c_at;\n this._a_at = -1;\n this._d_at = -1;\n this._dstr_at = -1;\n this._cnc_at = -1;\n this._vrf_at = -1;\n this._c_cnt = 0;\n this._p_h = [];\n this._p_l_a = -1;\n this._p_c_x_at = -1;\n this._x_at = -1;\n \n if (dsp_to > \"\") this.dispatch(opts.c_at, dsp_to);\n\n }\n\n cnf(opts){\n // Validations\n if (!opts.c_id) throw new Error(\"Creation date in missing\");\n if (!opts.p_ad) throw new Error(\"Payment address is missing\");\n if (!Array.isArray(opts.p_ad)) throw new Error(\"Payments must be an array\");\n \n // Configuration\n this.setTitle(opts.title, opts.description);\n this.c_id = opts.c_id || \"\";\n this.c_lft = opts.c_lft || -1;\n this.cclb = opts.cclb === false ? false : true;\n this.trsf = opts.trsf === false ? false : true;\n this.verfbl = opts.verfbl === true ? true : false;\n //\n this.p_ad = opts.p_ad || [\"\", 1.0];\n this.p_c_max = opts.p_c_max || -1;\n this.p_c_tu = opts.p_c_tu || 60 * 60;\n this.p_c_pr = opts.p_c_pr || 1000;\n this.p_c_min = opts.p_c_min || 1;\n\n this.pld = opts.pld || {};\n }\n\n exp(){\n return {\n name: this.name,\n title: this.title,\n description: this.description,\n c_id: this.c_id,\n c_lft: this.c_lft,\n cclb: this.cclb,\n trsf: this.trsf,\n p_ad: this.p_ad,\n p_c_max: this.p_c_max,\n p_c_tu: this.p_c_tu,\n p_c_pr: this.p_c_pr,\n p_c_min: this.p_c_min,\n pld: this.pld,\n verfbl: this.verfbl\n }\n }\n\n // Values\n minDep() { return this.p_c_min * this.p_c_pr; }\n minTuSz() { return this.p_c_min * this.p_c_tu; }\n reqMinDep() {\n const dbt = (this.p_c_min - this._c_cnt) * this.p_c_pr;\n return ( dbt < 0 ) ? 0 : dbt;\n }\n dbtSz() {\n const dpsz = !this.isA() ? this.reqMinDep() - this.satoshis : this.p_c_pr - this.satoshis;\n return dpsz < 0 ? 0 : dpsz;\n }\n lifeTm() { \n const mts = this.minTuSz();\n return (this.c_lft > mts) ? this.c_lft : mts; \n }\n lifeTmLft(cdt) { \n const lf = this._x_at - cdt; \n return (lf < 0) ? 0 : lf;\n }\n lifeLft(cdt) { \n const lf = this._p_c_x_at - cdt; \n return (lf < 0) ? 0 : lf;\n }\n\n // Conditions\n isParOwn() { return this.owner == this.parent.owner; }\n isA() { return this._a_at > 0; }\n isCnc() { return this._cnc_at > 0; }\n isD() { return this._d_at > 0; }\n isDstr() { return this.owner == null; }\n isX(cdt) { return (this._x_at > 0 && this._x_at < cdt) || (this.isPCX(cdt) && this._c_cnt == this.p_c_max); }\n isPCX(cdt) { return this._p_c_x_at > 0 && this._p_c_x_at < cdt; }\n isGteMin() { return this._c_cnt >= this.p_c_min; }\n isLtMax() { return this.p_c_max <= 0 || this._c_cnt < this.p_c_max; }\n isLteMax() { return this.p_c_max <= 0 || this._c_cnt <= this.p_c_max; }\n hasLifeTmNext(cdt){ \n return this._x_at == -1 || (this.lifeTmLft(cdt) >= (this.lifeLft(cdt) + this.p_c_tu)); \n }\n\n hasPayBal() {\n return this.isA() ? this.satoshis >= this.p_c_pr : this.satoshis >= this.minDep();\n }\n canA(){\n return this.isD() && !this.isA() && !this.isParOwn() && !this.isCnc();\n }\n canP() {\n return !this.isParOwn()\n && this.isA()\n && !this.isX()\n && this.isLtMax()\n && this.hasPayBal();\n }\n canCnc(){\n return !this.isDstr()\n && (\n (this.isParOwn() && (!this.isD() || (this.isD() && this.isCnc())))\n || (\n this.cclb \n && (\n !this.isA()\n || \n (this.isA() && !this.isX() && this.isGteMin())\n )\n )\n );\n }\n canDsp(){\n return this.isParOwn() && !this.isA() && !this.isCnc() && !this.isX();\n }\n canS(){\n return this.trsf && !this.isParOwn() && !this.isX() && !this.isCnc();\n }\n canDep(){\n return !this.isParOwn() && !this.isX() && !this.isCnc();\n }\n canW(){\n return this.satoshis > 0\n && (\n this.isParOwn() \n || !this.isA()\n || (!this.isX() && !this.isCnc())\n );\n }\n canDstr(){\n return !this.isDstr() && this.isParOwn();\n }\n isVld(cdt){\n return this.isA() && !this.isX(cdt) && !this.isPCX(cdt) && this.isLteMax();\n }\n \n _ensureNotPCX(cdt, msg) { if (this.isPCX(cdt)) throw new Error(msg || \"License round is expired\"); }\n _ensureNotX(cdt, msg) { if (this.isX(cdt)) throw new Error(msg || \"License is expired\"); }\n _ensureNotCnc(msg) { if (this.isCnc()) throw new Error(msg || \"License is cancelled\"); }\n _ensureGteMin(msg) { if (!this.isGteMin()) throw new Error(msg || \"License did not reached the minimum to activate\"); }\n _ensureLtMax(msg) { if (!this.isLtMax()) throw new Error(msg || \"Maximum payments reached\"); }\n \n _next(st) { \n this._ensureLtMax();\n this._c_cnt += st || 1;\n }\n\n //\n \n dispatch(cdt, newOwner) {\n expect(this.isParOwn()).toBe(true, \"Only creator can dispatch licenses\")\n expect(this.isA()).toBe(false, \"Can not dispatch activated licenses\")\n this.owner = newOwner;\n this._d_at = cdt;\n this._cnc_at = -1;\n }\n\n //\n \n deposit(cdt, val) {\n expect(this.isParOwn()).toBe(false, \"Owners can not deposit\")\n this._ensureNotX(cdt);\n this.satoshis += val;\n }\n \n withdraw() {\n if (this.satoshis == 0) throw new Error(\"Insuficient balance\");\n if (this.isParOwn()){\n this.satoshis = 0;\n return;\n } else if (!this.isA()){\n this.satoshis = 0;\n return;\n }\n const dsz = this.reqMinDep();\n if (this.satoshis <= dsz) {\n throw new Error(\"Balance equal or below minimum\");\n }\n this.satoshis = (dsz > 0) ? dsz : 0;\n }\n\n activate(cdt, pld) {\n expect(this.isParOwn()).toBe(false, \"Owner can not activate licenses\")\n this._ensureNotX(cdt);\n expect(this.isA()).toBe(false, \"License already activated\")\n if (this.dbtSz() > 0) throw new Error(\"Needs the minimum deposit to activate\");\n \n this._payExec(cdt, this.reqMinDep(), \"Activation payment\");\n \n this._a_at = cdt;\n if (this.c_lft > 0){\n this._x_at = cdt + this.lifeTm();\n }\n this._p_c_x_at = cdt + this.minTuSz();\n this.pld = pld || this.pld;\n \n this._next(this.p_c_min);\n }\n\n pay(cdt) {\n expect(this.isParOwn()).toBe(false, \"Owners can not pay licenses\")\n expect(this.isA()).toBe(true, \"Can not pay non active licenses\")\n this._ensureNotX(cdt);\n this._ensureLtMax();\n expect(this.hasLifeTmNext(cdt)).toBe(true, \"Contract lifetime next to expire\")\n\n this._payExec(cdt, this.p_c_pr, \"Recycle payment\");\n \n if (this._p_c_x_at < cdt)\n this._p_c_x_at = cdt + this.p_c_tu;\n else\n this._p_c_x_at += this.p_c_tu;\n\n this._next(1);\n }\n\n _payExec(cdt, value, title) {\n if (!this.hasPayBal()) throw new Error(\"Insuficient balance\")\n this._p_h.push([cdt, this.p_c_pr]);\n this._p_l_a = cdt;\n new LIN_Payment(this.parent.owner, value, title, this.title + \" - \" + this.description)\n this.satoshis -= value;\n }\n\n send(cdt, addr) {\n expect(this.isParOwn()).toBe(false, \"Use dispatch license as an owner\")\n this._ensureNotX(cdt);\n this._ensureNotCnc(\"Can not send cancelled licenses\");\n if (!this.trsf) throw new Error(\"License can not transfer\");\n this.owner = addr;\n if (this.verfbl) this._vrf_at = -1;\n }\n\n cancel(cdt) {\n if (this.isParOwn() && (!this.isD() || (this.isD() && this.isCnc()))) {\n this.destroy(cdt)\n return;\n }\n expect(this.cclb).toBe(true, \"Not cancellable license\");\n if (!this.isA()){\n this.satoshis = 0;\n this.returnOwner(cdt);\n return;\n }\n this._ensureNotX(cdt);\n this._ensureGteMin(\"Can not cancel license below minimum\");\n let penaltyFee = parseInt((this.satoshis / 2).toString().split(\".\")[0],10);\n new LIN_Payment(this.parent.owner, penaltyFee, \"Cancel penalty\")\n this.satoshis = 0;\n this.returnOwner(cdt);\n }\n\n returnOwner(cdt) {\n expect(this.owner).not.toBe(null, \"Already destroyed\");\n expect(this.owner).not.toBe(this.parent.owner, \"Already owned\");\n this.owner = this.parent.owner;\n this._cnc_at = cdt;\n }\n \n destroy(cdt){\n expect(this.isParOwn()).toBe(true, \"Only the creator can destroy licenses\")\n this._dstr_at = cdt;\n super.destroy(cdt);\n }\n \n}",{"deps":{"LIN_BaseJig":{"$dup":["3","deps","LIN_BaseJig"]},"LIN_BucketContract":{"$jig":3},"LIN_Payment":{"$jig":5},"expect":{"$dup":["3","deps","expect"]}},"title":"LIN_LicenseContract","version":"0.1.0"},"class LIN_Payment extends Jig {\n init(owner, satoshis, title, descr) {\n expect(caller).toBeInstanceOf(LIN_LicenseContract, \"Only licenses can make payments\")\n this.className = \"LIN_Payment\";\n this.owner = owner\n this.satoshis = satoshis\n this.name = \"Payment Received!\"\n this.title = title || caller.title;\n this.description = descr || caller.description;\n this.from = {\n origin: caller.origin,\n location: caller.location,\n owner: caller.owner\n }\n }\n redeem(cdt){\n this.satoshis = 0;\n this._redeem_at = cdt;\n this.destroy();\n }\n}",{"deps":{"Jig":{"$dup":["1","deps","Jig"]},"LIN_LicenseContract":{"$dup":["3","deps","LIN_LicenseContract"]},"expect":{"$dup":["3","deps","expect"]}},"title":"LIN_Payment","version":"0.1.0"}]}]}
    https://whatsonchain.com/tx/9a59be77471f3f0625bfae00cdf254592e9dbc684a4e51e4616c917606eee5a8
Total Output:
0.06633484 BSV