UNPKG

@gooddollar/goodcontracts

Version:
852 lines (851 loc) 199 kB
{ "contractName": "IdentityGuard", "abi": [ { "inputs": [ { "internalType": "contract Identity", "name": "_identity", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" }, { "constant": true, "inputs": [], "name": "identity", "outputs": [ { "internalType": "contract Identity", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "contract Identity", "name": "_identity", "type": "address" } ], "name": "setIdentity", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract Identity\",\"name\":\"_identity\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"identity\",\"outputs\":[{\"internalType\":\"contract Identity\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contract Identity\",\"name\":\"_identity\",\"type\":\"address\"}],\"name\":\"setIdentity\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"isOwner()\":{\"return\":\"true if `msg.sender` is the owner of the contract.\"},\"owner()\":{\"return\":\"the address of the owner.\"},\"renounceOwnership()\":{\"details\":\"Allows the current owner to relinquish control of the contract.\"},\"transferOwnership(address)\":{\"details\":\"Allows the current owner to transfer control of the contract to a newOwner.\",\"params\":{\"newOwner\":\"The address to transfer ownership to.\"}}}},\"userdoc\":{\"methods\":{\"renounceOwnership()\":{\"notice\":\"Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore.\"}}}},\"settings\":{\"compilationTarget\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityGuard.sol\":\"IdentityGuard\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/dao/schemes/SchemeGuard.sol\":{\"keccak256\":\"0x32e1b2a172e2c22a6aa757bfcb0722cc67f64c5c2e48df3dec2737903516d565\",\"urls\":[\"bzz-raw://bee57a8eba08348e93a0c18f3ab534e67865c0fa27afe27f5cf234bd5f248915\",\"dweb:/ipfs/Qmd8aveHWcUkYWMyJrJRZPyVXj8MAMBfpBFo6g4Z2VJeo3\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/Identity.sol\":{\"keccak256\":\"0x282184478f1d618d3523b28a84a7f7003dfdc99cad120e5e358d2cce1f5fb491\",\"urls\":[\"bzz-raw://67e17ecb57b24c4fb801abc2c52c3148af3b967e28da4fb7e074d18efb7a57c1\",\"dweb:/ipfs/QmfZ8jXhdTHtxr3gfByRj4HnXnGynX7SLZWWGR8k768aGB\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityAdminRole.sol\":{\"keccak256\":\"0x8e82c45eefe0da77d017144dfad12602c68124297035937901cdd08ce48c57ff\",\"urls\":[\"bzz-raw://e20e606342b3b35f41a081294cf3f716fe7e27e81d3090daa37c5208f4ef4bc3\",\"dweb:/ipfs/QmVEhHpiwVsksnPyHkfNa5LpTBLxoP9kj5NRZUBv456ewK\"]},\"/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityGuard.sol\":{\"keccak256\":\"0xcc395c0e8f812201b5ed1f45e7272120ee5ffe73bfe13e325dfd872aef235b22\",\"urls\":[\"bzz-raw://58f93e4b9f48ec31ac151208e4f9e6b356cc23dfc9585d846bc09bf35d6ff7be\",\"dweb:/ipfs/QmdxJHUCaFx8N66kkDhYdA4k6d2V91yBRG6sombuPxBq7X\"]},\"@daostack/arc/contracts/controller/Avatar.sol\":{\"keccak256\":\"0x4e4fb9d3bc21f42fbfc6a01e9f8aa483a59e9f447b0d604f55b587a81ec09ef4\",\"urls\":[\"bzz-raw://9d3c1c7575cf6075ea1d89921f09b9b8e322b208dacaf0446cd4f64506c999f0\",\"dweb:/ipfs/QmVGDDHAR2ByuQpbgV7BBKXGEAcbaWvejpEZYzHgaagBFK\"]},\"@daostack/arc/contracts/controller/ControllerInterface.sol\":{\"keccak256\":\"0x933e92612c90f292c7b59908958b003f1a13d90b97bed0572b566353c20974dc\",\"urls\":[\"bzz-raw://ce1fcf85b744fcce2dbd4205e3943e9b4ec36a5f0330d4bbf61e65f1a3e0e470\",\"dweb:/ipfs/QmUWiLkBDdekhpy93nTzBtxDHL6yNh6sTUM9G8VbsHcBzy\"]},\"@daostack/arc/contracts/controller/DAOToken.sol\":{\"keccak256\":\"0x9b213e4e3ceeffcfc1c962a43b70b8d763d8091a2dd713fc1989b97bb68786e6\",\"urls\":[\"bzz-raw://51d1d6e85fd90f45395a16b7a3c703c4636e836041f2a13f806e4222ef2e59c1\",\"dweb:/ipfs/QmQjeCeFf7TJzsYjT5scyZUDDixBA8Yy8YppgBuxcKPDnP\"]},\"@daostack/arc/contracts/globalConstraints/GlobalConstraintInterface.sol\":{\"keccak256\":\"0xc006c4591ec10b845a56e13f6791db2c428610953034686d52b2a934b6c8f36f\",\"urls\":[\"bzz-raw://19495cd88280e54d7ddcd043ffeff75e6d3777a0c42debcd61cae448e9497ea0\",\"dweb:/ipfs/QmYxWz7CgFmmddrcVXJKfob5Ktwykc2imNVUwLSR5WR8bJ\"]},\"@daostack/arc/contracts/libs/SafeERC20.sol\":{\"keccak256\":\"0xf6727d432f67046145b078f40c1cc4f6be7b0d12a6678ecaf457edf7550d244c\",\"urls\":[\"bzz-raw://5dba7734c4fed446c084a707761cbc66ba22b8b93ef53c8d4a22a76b6e271690\",\"dweb:/ipfs/QmP2VpPKUqLh4ZZs6LaxHVpCN1zCmiorygL9bMub4mbYCw\"]},\"@daostack/infra/contracts/Reputation.sol\":{\"keccak256\":\"0x3d226dac0fe7d758f0287fb28bc25fcec1f69d19888ae3a550fa49856d61c482\",\"urls\":[\"bzz-raw://8856852c8fe0ba1c9aab326f0a9a6e7f31a238de2778fa5188e6fc399f7eb352\",\"dweb:/ipfs/QmVH4ppR9Dk7v8yxaSgeArdMv9gBBVoQxEf4E3UsqQ4rY2\"]},\"openzeppelin-solidity/contracts/access/Roles.sol\":{\"keccak256\":\"0x659ba0f9a3392cd50a8a5fafaf5dfd8c6a0878f6a4613bceff4e90dceddcd865\",\"urls\":[\"bzz-raw://4ca6617349a9b36fd82e9442a8e445ce9021a174e4399d1457ddc894ee3f5df3\",\"dweb:/ipfs/QmcmyB4cNazZ1sw963Afaijt67M9bDgwmGXCgQajGTD4tm\"]},\"openzeppelin-solidity/contracts/access/roles/PauserRole.sol\":{\"keccak256\":\"0x6506133e295a7199df2ac5dfc52853d9d767f68450b6d0193e9d8056b164ce86\",\"urls\":[\"bzz-raw://9c03592a9e6b1377e401b74eccf175a250232b5a341347d3fc5cb50e9bc86ba2\",\"dweb:/ipfs/QmYAr1yXT89hNUMJ37aiBpD9HtYfBDqmueVCzphRuuU7oZ\"]},\"openzeppelin-solidity/contracts/lifecycle/Pausable.sol\":{\"keccak256\":\"0x3b0ed31deeba7e3c6cfbbe8092a6b427084ee390800a06acdea5c17c8185d606\",\"urls\":[\"bzz-raw://bbdbf9d3754fcdcc85aec0432fabcec914317b1c2081b43753442ed53853a34a\",\"dweb:/ipfs/QmVHWQBn5xQkQEHhyGNEeS5gjjALZEk5ZfcjFt7kL6MoLy\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/ownership/Ownable.sol\":{\"keccak256\":\"0x980de387a1a020a498f53d00f89fecebb12c949a17e8f160093c0303ede2b786\",\"urls\":[\"bzz-raw://f07a2c393caa85f62f0aaa461e3edd50aa59371d4209778ba0558d7f8b4b856c\",\"dweb:/ipfs/QmeN3ZiYGSjCnQFeYaJNgoXjF9eDue1g3e9pqManRkeBtV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20.sol\":{\"keccak256\":\"0xba431353cb4fe70777ac026231eb5468e41aa1e81240a2b8136917acc5fff4dc\",\"urls\":[\"bzz-raw://f40c91ca270bdc9b156f339081a0fc2bbcf73cf5f62b8c73ba555df753ff6619\",\"dweb:/ipfs/QmT8y2VVjGaFdGphpcXrgvdPi2EgF9LuCDgJiJ89LvpFRV\"]},\"openzeppelin-solidity/contracts/token/ERC20/ERC20Burnable.sol\":{\"keccak256\":\"0xa3e68fd7f987c8fbdaf4867d428a69a15f3cf2f69709a5b0a0fbef750b0e6fbc\",\"urls\":[\"bzz-raw://50b1ff986d3b2793850a66c8429d9886fdfb134b1509b3e98714e3e2a71e24f5\",\"dweb:/ipfs/QmSQBYPeY9tbR3ciGRNQqvcWKnNiuxtVMq2MsPWpLwuGGm\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506040516104403803806104408339818101604052602081101561003357600080fd5b5051600080546001600160a01b03191633178082556040516001600160a01b039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36001600160a01b0381166100d9576040805162461bcd60e51b815260206004820152601960248201527f537570706c696564206964656e74697479206973206e756c6c00000000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055610338806101086000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80632c159a1a146100675780635d5bf1781461008b578063715018a6146100b35780638da5cb5b146100bb5780638f32d59b146100c3578063f2fde38b146100df575b600080fd5b61006f610105565b604080516001600160a01b039092168252519081900360200190f35b6100b1600480360360208110156100a157600080fd5b50356001600160a01b0316610114565b005b6100b16101fd565b61006f610258565b6100cb610267565b604080519115158252519081900360200190f35b6100b1600480360360208110156100f557600080fd5b50356001600160a01b0316610278565b6001546001600160a01b031681565b61011c610267565b61012557600080fd5b806001600160a01b031663223668446040518163ffffffff1660e01b815260040160206040518083038186803b15801561015e57600080fd5b505afa158015610172573d6000803e3d6000fd5b505050506040513d602081101561018857600080fd5b50516101db576040805162461bcd60e51b815260206004820152601a60248201527f4964656e74697479206973206e6f742072656769737465726564000000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610205610267565b61020e57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b610280610267565b61028957600080fd5b61029281610295565b50565b6001600160a01b0381166102a857600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fea265627a7a72315820eecacb7824c1feca050cd0dc093443c978c61784e1f33c8dc0e25d60f6a80d3a64736f6c63430005100032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632c159a1a146100675780635d5bf1781461008b578063715018a6146100b35780638da5cb5b146100bb5780638f32d59b146100c3578063f2fde38b146100df575b600080fd5b61006f610105565b604080516001600160a01b039092168252519081900360200190f35b6100b1600480360360208110156100a157600080fd5b50356001600160a01b0316610114565b005b6100b16101fd565b61006f610258565b6100cb610267565b604080519115158252519081900360200190f35b6100b1600480360360208110156100f557600080fd5b50356001600160a01b0316610278565b6001546001600160a01b031681565b61011c610267565b61012557600080fd5b806001600160a01b031663223668446040518163ffffffff1660e01b815260040160206040518083038186803b15801561015e57600080fd5b505afa158015610172573d6000803e3d6000fd5b505050506040513d602081101561018857600080fd5b50516101db576040805162461bcd60e51b815260206004820152601a60248201527f4964656e74697479206973206e6f742072656769737465726564000000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b610205610267565b61020e57600080fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b610280610267565b61028957600080fd5b61029281610295565b50565b6001600160a01b0381166102a857600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fea265627a7a72315820eecacb7824c1feca050cd0dc093443c978c61784e1f33c8dc0e25d60f6a80d3a64736f6c63430005100032", "sourceMap": "238:2667:11:-;;;426:148;8:9:-1;5:2;;;30:1;27;20:12;5:2;426:148:11;;;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;426:148:11;515:6:77;:19;;-1:-1:-1;;;;;;515:19:77;524:10;515:19;;;;549:40;;-1:-1:-1;;;;;582:6:77;;;;;515;549:40;;515:6;;549:40;-1:-1:-1;;;;;483:24:11;;475:62;;;;;-1:-1:-1;;;475:62:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;547:8;:20;;-1:-1:-1;;;;;;547:20:11;-1:-1:-1;;;;;547:20:11;;;;;;;;;;238:2667;;;-1:-1:-1;238:2667:11;;", "deployedSourceMap": "238:2667:11:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;238:2667:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;278:24;;;:::i;:::-;;;;-1:-1:-1;;;;;278:24:11;;;;;;;;;;;;;;2735:168;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2735:168:11;-1:-1:-1;;;;;2735:168:11;;:::i;:::-;;1347:137:77;;;:::i;659:77::-;;;:::i;979:90::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;1655:107;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1655:107:77;-1:-1:-1;;;;;1655:107:77;;:::i;278:24:11:-;;;-1:-1:-1;;;;;278:24:11;;:::o;2735:168::-;863:9:77;:7;:9::i;:::-;855:18;;;;;;2811:9:11;-1:-1:-1;;;;;2811:22:11;;:24;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2811:24:11;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2811:24:11;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2811:24:11;2803:63;;;;;-1:-1:-1;;;2803:63:11;;;;;;;;;;;;;;;;;;;;;;;;;;;;2876:8;:20;;-1:-1:-1;;;;;;2876:20:11;-1:-1:-1;;;;;2876:20:11;;;;;;;;;;2735:168::o;1347:137:77:-;863:9;:7;:9::i;:::-;855:18;;;;;;1445:1;1429:6;;1408:40;;-1:-1:-1;;;;;1429:6:77;;;;1408:40;;1445:1;;1408:40;1475:1;1458:19;;-1:-1:-1;;;;;;1458:19:77;;;1347:137::o;659:77::-;697:7;723:6;-1:-1:-1;;;;;723:6:77;659:77;:::o;979:90::-;1019:4;1056:6;-1:-1:-1;;;;;1056:6:77;1042:10;:20;;979:90::o;1655:107::-;863:9;:7;:9::i;:::-;855:18;;;;;;1727:28;1746:8;1727:18;:28::i;:::-;1655:107;:::o;1906:183::-;-1:-1:-1;;;;;1979:22:77;;1971:31;;;;;;2038:6;;;2017:38;;-1:-1:-1;;;;;2017:38:77;;;;2038:6;;;2017:38;;;2065:6;:17;;-1:-1:-1;;;;;;2065:17:77;-1:-1:-1;;;;;2065:17:77;;;;;;;;;;1906:183::o", "source": "pragma solidity >0.5.4;\n\nimport \"./Identity.sol\";\n\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\n\n/* @title The IdentityGuard contract\n * @dev Contract containing an identity and\n * modifiers to ensure proper access\n */\ncontract IdentityGuard is Ownable {\n Identity public identity;\n\n /* @dev Constructor. Checks if identity is a zero address\n * @param _identity The identity contract.\n */\n constructor(Identity _identity) public {\n require(_identity != Identity(0), \"Supplied identity is null\");\n identity = _identity;\n }\n\n /* @dev Modifier that requires the sender to be not blacklisted\n */\n modifier onlyNotBlacklisted() {\n require(!identity.isBlacklisted(msg.sender), \"Caller is blacklisted\");\n _;\n }\n\n /* @dev Modifier that requires the given address to be not blacklisted\n * @param _account The address to be checked\n */\n modifier requireNotBlacklisted(address _account) {\n require(!identity.isBlacklisted(_account), \"Receiver is blacklisted\");\n _;\n }\n\n /* @dev Modifier that requires the sender to be whitelisted\n */\n modifier onlyWhitelisted() {\n require(identity.isWhitelisted(msg.sender), \"is not whitelisted\");\n _;\n }\n\n /* @dev Modifier that requires the given address to be whitelisted\n * @param _account the given address\n */\n modifier requireWhitelisted(address _account) {\n require(identity.isWhitelisted(_account), \"is not whitelisted\");\n _;\n }\n\n /* @dev Modifier that requires the sender to be an approved DAO contract\n */\n modifier onlyDAOContract() {\n require(identity.isDAOContract(msg.sender), \"is not whitelisted contract\");\n _;\n }\n\n /* @dev Modifier that requires the given address to be whitelisted\n * @param _account the given address\n */\n modifier requireDAOContract(address _contract) {\n require(identity.isDAOContract(_contract), \"is not whitelisted contract\");\n _;\n }\n\n /* @dev Modifier that requires the sender to have been whitelisted\n * before or on the given date\n * @param date The time sender must have been added before\n */\n modifier onlyAddedBefore(uint256 date) {\n require(\n identity.lastAuthenticated(msg.sender) <= date,\n \"Was not added within period\"\n );\n _;\n }\n\n /* @dev Modifier that requires sender to be an identity admin\n */\n modifier onlyIdentityAdmin() {\n require(identity.isIdentityAdmin(msg.sender), \"not IdentityAdmin\");\n _;\n }\n\n /* @dev Allows owner to set a new identity contract if\n * the given identity contract has been registered as a scheme\n */\n function setIdentity(Identity _identity) public onlyOwner {\n require(_identity.isRegistered(), \"Identity is not registered\");\n identity = _identity;\n }\n}\n", "sourcePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityGuard.sol", "ast": { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/IdentityGuard.sol", "exportedSymbols": { "IdentityGuard": [ 2667 ] }, "id": 2668, "nodeType": "SourceUnit", "nodes": [ { "id": 2509, "literals": [ "solidity", ">", "0.5", ".4" ], "nodeType": "PragmaDirective", "src": "0:23:11" }, { "absolutePath": "/Users/hadar/workspace/GoodDollar/GoodBootstrap/packages/contracts/contracts/identity/Identity.sol", "file": "./Identity.sol", "id": 2510, "nodeType": "ImportDirective", "scope": 2668, "sourceUnit": 2381, "src": "25:24:11", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "file": "openzeppelin-solidity/contracts/ownership/Ownable.sol", "id": 2511, "nodeType": "ImportDirective", "scope": 2668, "sourceUnit": 21418, "src": "51:63:11", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 2512, "name": "Ownable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 21417, "src": "264:7:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Ownable_$21417", "typeString": "contract Ownable" } }, "id": 2513, "nodeType": "InheritanceSpecifier", "src": "264:7:11" } ], "contractDependencies": [ 21417 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 2667, "linearizedBaseContracts": [ 2667, 21417 ], "name": "IdentityGuard", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 2515, "name": "identity", "nodeType": "VariableDeclaration", "scope": 2667, "src": "278:24:11", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" }, "typeName": { "contractScope": null, "id": 2514, "name": "Identity", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2380, "src": "278:8:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "value": null, "visibility": "public" }, { "body": { "id": 2533, "nodeType": "Block", "src": "465:109:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" }, "id": 2525, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2521, "name": "_identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2517, "src": "483:9:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 2523, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "505:1:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 2522, "name": "Identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2380, "src": "496:8:11", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Identity_$2380_$", "typeString": "type(contract Identity)" } }, "id": 2524, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "496:11:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "src": "483:24:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "537570706c696564206964656e74697479206973206e756c6c", "id": 2526, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "509:27:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_358ec423a6aab9a5d4c35f720720679c6304d239f245ff9dc7471e239e838ee8", "typeString": "literal_string \"Supplied identity is null\"" }, "value": "Supplied identity is null" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_358ec423a6aab9a5d4c35f720720679c6304d239f245ff9dc7471e239e838ee8", "typeString": "literal_string \"Supplied identity is null\"" } ], "id": 2520, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "475:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2527, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "475:62:11", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2528, "nodeType": "ExpressionStatement", "src": "475:62:11" }, { "expression": { "argumentTypes": null, "id": 2531, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2529, "name": "identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2515, "src": "547:8:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 2530, "name": "_identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2517, "src": "558:9:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "src": "547:20:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "id": 2532, "nodeType": "ExpressionStatement", "src": "547:20:11" } ] }, "documentation": null, "id": 2534, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 2518, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2517, "name": "_identity", "nodeType": "VariableDeclaration", "scope": 2534, "src": "438:18:11", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" }, "typeName": { "contractScope": null, "id": 2516, "name": "Identity", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2380, "src": "438:8:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "value": null, "visibility": "internal" } ], "src": "437:20:11" }, "returnParameters": { "id": 2519, "nodeType": "ParameterList", "parameters": [], "src": "465:0:11" }, "scope": 2667, "src": "426:148:11", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 2547, "nodeType": "Block", "src": "686:97:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2542, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "704:35:11", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 2539, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22171, "src": "728:3:11", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 2540, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "728:10:11", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "expression": { "argumentTypes": null, "id": 2537, "name": "identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2515, "src": "705:8:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "id": 2538, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "isBlacklisted", "nodeType": "MemberAccess", "referencedDeclaration": 2363, "src": "705:22:11", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view external returns (bool)" } }, "id": 2541, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "705:34:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "43616c6c657220697320626c61636b6c6973746564", "id": 2543, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "741:23:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_f3043479e2644f870f5163160ac40a870c7d330667ff16c449eeb0b238de4f66", "typeString": "literal_string \"Caller is blacklisted\"" }, "value": "Caller is blacklisted" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_f3043479e2644f870f5163160ac40a870c7d330667ff16c449eeb0b238de4f66", "typeString": "literal_string \"Caller is blacklisted\"" } ], "id": 2536, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "696:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2544, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "696:69:11", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2545, "nodeType": "ExpressionStatement", "src": "696:69:11" }, { "id": 2546, "nodeType": "PlaceholderStatement", "src": "775:1:11" } ] }, "documentation": null, "id": 2548, "name": "onlyNotBlacklisted", "nodeType": "ModifierDefinition", "parameters": { "id": 2535, "nodeType": "ParameterList", "parameters": [], "src": "683:2:11" }, "src": "656:127:11", "visibility": "internal" }, { "body": { "id": 2562, "nodeType": "Block", "src": "970:97:11", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2557, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "988:33:11", "subExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 2555, "name": "_account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2550, "src": "1012:8:11", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 2553, "name": "identity", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2515, "src": "989:8:11", "typeDescriptions": { "typeIdentifier": "t_contract$_Identity_$2380", "typeString": "contract Identity" } }, "id": 2554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "isBlacklisted", "nodeType": "MemberAccess", "referencedDeclaration": 2363, "src": "989:22:11", "typeDescriptions": { "typeIdentifier": "t_function_external_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view external returns (bool)" } }, "id": 2556, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "989:32:11", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "526563656976657220697320626c61636b6c6973746564", "id": 2558, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "1023:25:11", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_6389232170914050dd145bd52377a3ccba0a00b71a0d28ad45f90068f369021f", "typeString": "literal_string \"Receiver is blacklisted\"" }, "value": "Receiver is blacklisted" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_6389232170914050dd145bd52377a3ccba0a00b71a0d28ad45f90068f369021f", "typeString": "literal_string \"Receiver is blacklisted\"" } ], "id": 2552, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 22174, 22175 ], "referencedDeclaration": 22175, "src": "980:7:11", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2559, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "980:69:11", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2560, "nodeType": "ExpressionStatement", "src": "980:69:11" }, { "id": 2561, "nodeType": "PlaceholderStatement", "src": "1059:1:11" } ] }, "documentation": null, "id": 2563, "name": "requireNotBlacklisted", "nodeType": "ModifierDefinition", "parameters": { "id": 2551, "nodeType": "ParameterList", "parameters": [ { "constant": false,