Transaction

2a5a58c2cabf256b966f3856bb687cc5d994d95f94f72c5da454915629fae83b
( - )
224,024
2020-10-09 16:11:08
1
6,149 B

13 Outputs

Total Output:
  • jrun b1b605103eMê{"in":0,"ref":["native://Jig","19edf6825c564febba4d3aaf86c218976be7f8893a6ce7e2b38bc53ef0b291c9_o2"],"out":["4ab258416b88270881caafa8cdfb06dbee51d0e26f5f86bb936274b177e68662"],"del":[],"cre":["myofggf78ZNdr3J5vM3wjcLic9eTNnGnJA"],"exec":[{"op":"DEPLOY","data":["class MultList extends Jig {\r\n\r\n init(timestamp) {\r\n this.classname = \"MultList: \"\r\n const function_id = this.classname+\"init(): \"\r\n\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp \r\n this._checkTimestamp(timestamp)\r\n\r\n this.list = []\r\n this.timestamps = []\r\n this.list_action_numbers = []\r\n\r\n //init with a 1.0 value to make it easier to use\r\n //this.publish(1.0, timestamp) // BEWARE THIS WILL NOT WORK because this isn't deployed yet (no owner & location) so you need to do it step-by-step in init() too\r\n this.list.push(1.0)\r\n this.timestamps.push(timestamp)\r\n this.action_count = 0\r\n this.list_action_numbers.push(this.action_count)\r\n this.action=\"init\"\r\n }\r\n \r\n linkAdminCounter(admincounter){\r\n /* this should be done right after creation, we need it separate from init() because we first need to link multlist to the tokencontract and then the other way */\r\n if(this.admincounter) throw this.classname+\": already an admincounter linked: \"+this.admincounter.origin\r\n this.admincounter = admincounter\r\n this.action= \"linkAdminCounter\"\r\n }\r\n \r\n publish(newmult, timestamp) {\r\n const function_id = this.classname+\"publish(): \"\r\n\r\n if(!this.admincounter) throw(function_id+\" no admincounter contract found, please link one before publishing\")\r\n //\r\n if(this.admincounter.isRevoked()) throw new Error(function_id+\"token contract has been revoked (admincounter)\")\r\n if(this.admincounter.isBackedup()) throw new Error(function_id+\"token contract has been backedup (admincounter)\")\r\n if(this.admincounter.isFrozen()) throw new Error(function_id+\"token contract has been frozen (admincounter)\") // check frozen as last always!\r\n //\r\n if(this.owner != this.constructor.owner) throw function_id+\": Only \"+this.classname+\"'s owner may publish\"\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n\r\n this._checkNum(newmult)\r\n\r\n if(isNaN(newmult)) throw function_id+\" Error: newmult is NaN: \"+newmult\r\n if(!isFinite(newmult)) throw function_id+\" Error: newmult is not Finite: \"+newmult\r\n\r\n // all parameters checks passed\r\n\r\n this.admincounter.auth() //ensures only the tokencontract owner can publish // for run 0.6\r\n this.action_count = this.admincounter.nonce // for run 0.6\r\n \r\n this.list_action_numbers.push(this.action_count) // as an array for practicality\r\n\r\n this.list.push(newmult)\r\n this.timestamps.push(timestamp)\r\n this.action=\"publish\"\r\n\r\n }\r\n _checkNum (number) { // check that number is a positive number (but can be float)\r\n const function_id = this.classname+\": _checkNum(): \"\r\n if (typeof number !== 'number') throw(function_id+'number is not a number : '+number) // throw gives better error trace than expect()\r\n if (!(number > 0)) throw new Error(function_id+'number must be positive : '+number)\r\n if (number > Number.MAX_SAFE_INTEGER) throw new Error(function_id+'number too large : '+number)\r\n }\r\n _checkTimestamp (timestamp) {\r\n const function_id = this.classname+\": _checkTimestamp(): \"\r\n try {\r\n this._checkNum(timestamp) // applies as well to timestamp\r\n } catch(e) { throw(function_id+e) }\r\n if (!Number.isInteger(timestamp)) throw(function_id+'timestamp must be an integer : '+timestamp) //necessary because _checkNum doesn't do it\r\n if( !(timestamp > 1600939295117) ) throw(function_id+': timestamp must be older than 1600939295117 : '+timestamp) // make sure the timestamp here is in ms!!\r\n }\r\n}",{"deps":{"Jig":{"$jig":0},"expect":{"$jig":1}},"sealed":true}]}]}
    https://whatsonchain.com/tx/2a5a58c2cabf256b966f3856bb687cc5d994d95f94f72c5da454915629fae83b
Total Output: