Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

4ae0fc991b09e8ae314b2f9dd9b44d5be81f86a8249fb72bca95c42eaa1da7e1
Timestamp (utc)
2020-10-14 15:48:48
Fee Paid
0.00003316 BSV
(
0.03229000 BSV
-
0.03225684 BSV
)
Fee Rate
500.1 sat/KB
Version
1
Confirmations
336,986
Size Stats
6,630 B

3 Outputs

Total Output:
0.03225684 BSV
  • jrun b1b605103eMã{"in":0,"ref":["native://Jig","b24eb9e864c19e05a286172a7fb66b6eafa1e5bff4308109cec7766a22dff2b0_o2","b24eb9e864c19e05a286172a7fb66b6eafa1e5bff4308109cec7766a22dff2b0_o3"],"out":["621a1d3209c9fee0187da1508e509d047ede160c1a017dea23399eb099c9bee2"],"del":[],"cre":["n4ex59PnyMErryf33dMCCNy3qEfmjbPBnL"],"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 SmartContractError(100, 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, then this value will be overriden by the first mult published\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.defaultval = true\r\n this.timestamps.push(timestamp)\r\n this.action_count = 0 // init at 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 SmartContractError(101, 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\r\n if(!this.admincounter) throw SmartContractError(102, function_id+\" no admincounter contract found, please link one before publishing\")\r\n //\r\n if(this.admincounter.isRevoked()) throw SmartContractError(103, function_id+\"token contract has been revoked (admincounter)\")\r\n if(this.admincounter.isBackedup()) throw SmartContractError(104, function_id+\"token contract has been backedup (admincounter)\")\r\n if(this.admincounter.isFrozen()) throw SmartContractError(105, function_id+\"token contract has been frozen (admincounter)\") // check frozen as last always!\r\n //\r\n if(this.owner != this.constructor.owner) throw SmartContractError(106, function_id+\": Only \"+this.classname+\"'s owner may publish\")\r\n if(!timestamp) throw SmartContractError(107, 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 SmartContractError(108, function_id+\" Error: newmult is NaN: \"+newmult)\r\n if(!isFinite(newmult)) throw SmartContractError(109, function_id+\" Error: newmult is not Finite: \"+newmult)\r\n\r\n //\r\n // all parameters checks passed\r\n //\r\n // if we only have the \"default\" mult of 1 from init(), let's override it (because it's useless and better for backups to not have many \"1\"s)\r\n if( this.defaultval == true ) {\r\n this.defaultval = false\r\n this.list = []\r\n this.timestamps = []\r\n this.list_action_numbers = []\r\n }\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 // we want to insert directly at the right index in the array to keep sorted timestamps\r\n //\r\n var insert_index = this._findInsertBefore(this.timestamps, timestamp)\r\n /*\r\n this.list_action_numbers.push(this.action_count) // as an array for practicality\r\n this.list.push(newmult)\r\n this.timestamps.push(timestamp)\r\n */\r\n this._insertInArray(this.action_count, this.list_action_numbers, insert_index) // as an array for practicality\r\n this._insertInArray(newmult, this.list, insert_index)\r\n this._insertInArray(timestamp, this.timestamps, insert_index)\r\n //\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 SmartContractError(110, function_id+'number is not a number : '+number) // throw gives better error trace than expect()\r\n if (!(number > 0)) throw SmartContractError(111, function_id+'number must be positive : '+number)\r\n if (number > Number.MAX_SAFE_INTEGER) throw SmartContractError(112, 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 SmartContractError(113, function_id+e) }\r\n if (!Number.isInteger(timestamp)) throw SmartContractError(114, function_id+'timestamp must be an integer : '+timestamp) //necessary because _checkNum doesn't do it\r\n if( !(timestamp > 1600939295117) ) throw SmartContractError(115, function_id+': timestamp must be older than 1600939295117 : '+timestamp) // make sure the timestamp here is in ms!!\r\n }\r\n _insertInArray (item, array, before) {\r\n if (!item) return;\r\n if (before == null || before < 0 || before > array.length - 1) {\r\n array.push(item);\r\n return array;\r\n }\r\n array.splice(before, 0, item);\r\n return array\r\n }\r\n _findInsertBefore (timestamps_array, new_timestamp) {\r\n const function_id = this.classname+\"_findInsertBefore(): \"\r\n if(!new_timestamp) throw SmartContractError(116, function_id+\"new_timestamp is \"+new_timestamp)\r\n if(!timestamps_array) throw SmartContractError(117, function_id+\"timestamps_array is \"+timestamps_array)\r\n if(timestamps_array.length == 0) return 0\r\n // timestamps_array.length > 0 from here\r\n for(var i=0; i < timestamps_array.length; i++){\r\n if(timestamps_array[i] > new_timestamp){\r\n return i\r\n }\r\n }\r\n return timestamps_array.length\r\n }\r\n}",{"deps":{"Jig":{"$jig":0},"SmartContractError":{"$jig":1},"expect":{"$jig":2}},"sealed":true}]}]}
    https://whatsonchain.com/tx/4ae0fc991b09e8ae314b2f9dd9b44d5be81f86a8249fb72bca95c42eaa1da7e1