Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

d419bbac5b5ee889706c5a8eaa6ce330a413ef00318367cab2ee80edece84484
Timestamp (utc)
2020-10-11 12:53:35
Fee Paid
0.00003439 BSV
(
0.00115875 BSV
-
0.00112436 BSV
)
Fee Rate
500.1 sat/KB
Version
1
Confirmations
337,464
Size Stats
6,876 B

3 Outputs

Total Output:
0.00112436 BSV
  • jrun b1b605103eMÙ{"in":0,"ref":["native://Jig","0109e003f844f2256613dec8fe8c25d24771eda447b54afe485f7660107e2670_o2"],"out":["248290988999c4887832b4a2377ff16f93bcbb267aa3ddd5fe837f983fcedc7f"],"del":[],"cre":["mih2yrsSHRdJjjmPbHp1kfogRiDirwkPEn"],"exec":[{"op":"DEPLOY","data":["class RevokerContract extends Jig {\r\n\r\n init(){\r\n this.classname = \"RevokerContract: \"\r\n //\r\n this.is_frozen = false\r\n this.is_revoked = false\r\n this.is_backedup = false\r\n\r\n this.revoked_state = \"\"\r\n\r\n this.revoke_count = null\r\n this.new_token_contract = null\r\n }\r\n // if we add the send then we must absolutely send it immediately after creation\r\n // otherwise a hacker of the token contract would be able to send it to himself and take full control\r\n send(to, timestamp) {\r\n const function_id = this.classname+\"send(): \"\r\n //\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n //\r\n this.timestamp = timestamp\r\n this.owner = to // there is already internal run's checks on bitcoin addresses for owner\r\n }\r\n backup(new_token_contract, timestamp){\r\n const function_id = this.classname+\"backup(): \"\r\n //\r\n this._checkContractState()\r\n this._checkNewTokenContract(new_token_contract)\r\n\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n\r\n this.timestamp = timestamp\r\n this.new_token_contract = new_token_contract\r\n this.is_backedup = true\r\n this.revoked_state = \"backedup\"\r\n\r\n //new_token_contract.allow_convert_from_previous_contract(this.admincounter) // gives on sync: StateError: [jig RevokerContract] not found in the transaction txid: ...\r\n }\r\n freeze(timestamp){\r\n const function_id = this.classname+\"freeze(): \"\r\n //\r\n this._checkContractState()\r\n if(this.is_frozen) throw function_id+\"contract is already frozen\" \r\n\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n\r\n // freezes all coins but doesn't give a new contract to exchange to\r\n // useful to end the network and/or reissue tokens on a new protocol after freezing it \r\n this.timestamp = timestamp\r\n this.is_frozen = true\r\n this.revoked_state = \"frozen\"\r\n }\r\n revoke(revoke_count, new_token_contract, timestamp){\r\n const function_id = this.classname+\"revoke(): \"\r\n //\r\n this._checkContractState()\r\n this._checkRevokeCount(revoke_count)\r\n this._checkNewTokenContract(new_token_contract)\r\n\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n\r\n this.timestamp = timestamp\r\n this.revoke_count = revoke_count\r\n this.new_token_contract = new_token_contract\r\n this.is_revoked = true\r\n this.revoked_state = \"revoked\"\r\n\r\n //new_token_contract.allow_convert_from_previous_contract(this.admincounter, revoke_count) // gives on sync: StateError: [jig RevokerContract] not found in the transaction txid: ...\r\n }\r\n /*\r\n isUnused(){ // fast way to make sure the revoke contract was never used yet\r\n if(this.is_frozen == false && this.is_revoked == false && this.is_backedup == false) return true\r\n else return false\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 this contract 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 _checkContractState(){\r\n const function_id = this.classname+\"_checkContractState(): \"\r\n if(this.is_revoked) throw function_id+\"contract is already revoked\"\r\n if(this.is_backedup) throw function_id+\"contract is already backed up\"\r\n //if(this.is_frozen) throw function_id+\"contract is already frozen\" // don't check freeze so we can backup or revoke after freeze!\r\n }\r\n _checkRevokeCount (revoke_count) { // check positive integer\r\n const function_id = this.classname+\": _checkRevokeCount(): \"\r\n if (typeof revoke_count !== 'number') throw(function_id+'revoke_count is not a number : '+revoke_count) // throw gives better error trace than expect()\r\n if (!(revoke_count > 0)) throw new Error(function_id+'revoke_count must be positive : '+revoke_count)\r\n if (revoke_count > Number.MAX_SAFE_INTEGER) throw new Error(function_id+'revoke_count too large : '+revoke_count)\r\n if (!Number.isInteger(revoke_count)) throw(function_id+'revoke_count must be an integer : '+revoke_count) \r\n }\r\n _checkNewTokenContract(new_token_contract) { // idea check it is not a string\r\n const function_id = this.classname+\": _checkNewTokenContract(): \"\r\n //\r\n // checking types or instanceof Jig doesn't work , the type seems to be \"function\"\r\n // in JS typeof can return one of those 6: object, boolean, function, number, string, undefined\r\n //\r\n // brenton: you can check if typeof myjig === 'function' because for now, all function parameters coming from outside the jig have to be code jigs (modifié) \r\n if( !(typeof new_token_contract === 'object' || typeof new_token_contract === 'function') ) throw new Error(function_id+\" type of new_token_contract is wrong, should be object or function but is \"+(typeof new_token_contract))\r\n //expect(new_token_contract).toBeInstanceOf(Jig, function_id+': bad new_token_contract type, should be instance of Jig')\r\n // todo we could do more check by checking it has some keys, but rather let it too loose to have more freedom\r\n //\r\n if(new_token_contract.origin == this.admincounter.origin) throw new Error(function_id+\" cannot link a contract to itself\")\r\n }\r\n _checkTimestamp (timestamp) {\r\n const function_id = this.classname+\": _checkTimestamp(): \"\r\n if(!timestamp) throw function_id+\"timestamp missing: \"+timestamp\r\n try {\r\n this._checkRevokeCount(timestamp) // applies as well to timestamp: positive integer\r\n } catch(e) { throw(function_id+e) }\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/d419bbac5b5ee889706c5a8eaa6ce330a413ef00318367cab2ee80edece84484