Transaction

8e73316419cd0a3d76315d676a0de1ac11ed974db071a195927ef1cd1c92ccfc
( - )
224,991
2020-10-08 01:33:14
1
5,054 B

3 Outputs

Total Output:
  • jrun b1b605103eM¼{"in":0,"ref":["native://Jig","cab03f284dd7e84231896990a0f421dc3dbb4a6d2c45857370778f40f65e16e8_o2"],"out":["d014e7b99138161eb34421abad2bf88286660b8bc3e3913450681339f2a4705a"],"del":[],"cre":["mr9zdspVwjQBCsRQ464ct8M2wJgaL7CcaQ"],"exec":[{"op":"DEPLOY","data":["class Blacklist extends Jig {\r\n \r\n init(timestamp) {\r\n this.classname = \"Blacklist: \"\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 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 blacklist(address, timestamp) {\r\n const function_id = this.classname+\"blacklist(): \"\r\n\r\n // checks\r\n if(!this.admincounter) throw(function_id+\" no admincounter contract found, please link one before blacklisting\")\r\n //\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(!timestamp) throw this.classname+\": publish: timestamp missing: \"+timestamp\r\n this._checkTimestamp(timestamp)\r\n\r\n if(this.owner != this.constructor.owner) throw function_id+\" Only \"+this.classname+\" owner may manage blacklist\"\r\n if(typeof address != \"string\") throw function_id+' address to blacklist must be a string: '+address\r\n if(address == this.owner) throw function_id+\" you cannot blacklist your own administration address\"\r\n if(address.length < 26) throw function_id+\" address is too short: \"+address.length\r\n if(!address.match(\"^[A-Za-z0-9]+$\")) throw function_id+\" wrong character in address: \"+address\r\n if(this.list.includes(address)) throw function_id+\" address is already in blacklist\"\r\n\r\n // all parameters checks passed\r\n if(!this.admincounter){\r\n throw(function_id+\" no admincounter contract found, please link one before publishing\")\r\n }\r\n else {\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(address)\r\n this.timestamps.push(timestamp)\r\n this.action=\"blacklist\"\r\n }\r\n // beware allowing remove introduces a security breach if an hacker can unblacklist his address and send some of his tokens to others to taint them\r\n //remove(address){\r\n // expect(address).toBeString(this.classname+': address to blacklist must be a string')\r\n // if(!this.list.has(address)) throw this.classname+\": address to remove is not in blacklist\" \r\n // this.list.delete(address)\r\n //}\r\n isBlacklisted(address){\r\n if(this.list.includes(address)) return true\r\n else return false\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/8e73316419cd0a3d76315d676a0de1ac11ed974db071a195927ef1cd1c92ccfc