Transaction

da3742215da45675a044cb7145b2bbcdfd9ff609c31464838bcc923c879dfd28
Timestamp (utc)
2020-10-14 11:23:41
Fee Paid
0.00003550 BSV
(
0.00118400 BSV
-
0.00114850 BSV
)
Fee Rate
500.2 sat/KB
Version
1
Confirmations
280,778
Size Stats
7,097 B

3 Outputs

Total Output:
0.00114850 BSV
  • jrun b1b605103eM·{"in":0,"ref":["native://Jig","3d32f29e5c11f210ede6814ec16ae327902a2e872b4a8c955c2ebf9df2b2bb21_o3"],"out":["efb5333f7c826e39c86765cb3419173bd3cec251e87c7c2197a1d3bcee01e144"],"del":[],"cre":["1D4begADMhCx5Q6atEJ1m4bv38hHgRF1tr"],"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 SmartContractError(200, 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 SmartContractError(201, 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)\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 SmartContractError(202, function_id+\"contract is already frozen\") \r\n\r\n if(!timestamp) throw SmartContractError(203, 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 SmartContractError(204, 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)\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 SmartContractError(205, 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 SmartContractError(206, function_id+\"contract is already revoked\")\r\n if(this.is_backedup) throw SmartContractError(207, function_id+\"contract is already backed up\")\r\n //if(this.is_frozen) throw SmartContractError(ADD NUMBER,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 SmartContractError(208, function_id+'revoke_count is not a number : '+revoke_count) // throw gives better error trace than expect()\r\n if (!(revoke_count > 0)) throw SmartContractError(209, function_id+'revoke_count must be positive : '+revoke_count)\r\n if (revoke_count > Number.MAX_SAFE_INTEGER) throw SmartContractError(210, function_id+'revoke_count too large : '+revoke_count)\r\n if (!Number.isInteger(revoke_count)) throw SmartContractError(211, 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 SmartContractError(212, 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 SmartContractError(213, 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 SmartContractError(214, 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 SmartContractError(215, function_id+e) }\r\n if( !(timestamp > 1600939295117) ) throw SmartContractError(216, 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/da3742215da45675a044cb7145b2bbcdfd9ff609c31464838bcc923c879dfd28