{"author":"Digix Holdings","title":"Contract to manage the admin roles in DAO (founders, prls, kyc admins)","fileName":"/contracts/interactive/DaoIdentity.sol","name":"DaoIdentity","abi":[{"constant":true,"inputs":[],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"key","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_key","type":"bytes32"}],"name":"get_contract","outputs":[{"name":"_contract","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_group_id","type":"uint256"},{"name":"_user","type":"address"},{"name":"_doc","type":"bytes32"}],"name":"addGroupUser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_doc","type":"bytes32"},{"name":"_id_expiration","type":"uint256"}],"name":"updateKyc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"}],"name":"removeGroupUser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}],"bin":false,"opcodes":false,"source":"pragma solidity ^0.4.24;\n\nimport \"../storage/DaoIdentityStorage.sol\";\nimport \"../common/IdentityCommon.sol\";\n\n\n/**\n@title Contract to manage the admin roles in DAO (founders, prls, kyc admins)\n@author Digix Holdings\n*/\ncontract DaoIdentity is IdentityCommon {\n\n    /**\n    @notice Constructor (create initial roles, groups)\n    @param _resolver Address of Contract Resolver\n    */\n    constructor(address _resolver)\n        public\n    {\n        require(init(CONTRACT_DAO_IDENTITY, _resolver));\n        // create the three roles and the three corresponding groups\n        // the root role, and root group are already created, with only the contract deployer in it\n        // After deployment, the contract deployer will call addGroupUser to add a multi-sig to be another root\n        // The multi-sig will then call removeGroupUser to remove the contract deployer from root role\n        // From then on, the multi-sig will be the only root account\n        identity_storage().create_role(ROLES_FOUNDERS, \"founders\");\n        identity_storage().create_role(ROLES_PRLS, \"prls\");\n        identity_storage().create_role(ROLES_KYC_ADMINS, \"kycadmins\");\n        identity_storage().create_group(ROLES_FOUNDERS, \"founders_group\", \"\"); // group_id = 2\n        identity_storage().create_group(ROLES_PRLS, \"prls_group\", \"\"); // group_id = 3\n        identity_storage().create_group(ROLES_KYC_ADMINS, \"kycadmins_group\", \"\"); // group_id = 4\n    }\n\n    /**\n    @notice Function to add an address to a group (only root can call this function)\n    @param _group_id ID of the group to be added in\n    @param _user Ethereum address of the user\n    @param _doc hash of IPFS doc containing details of this user\n    */\n    function addGroupUser(uint256 _group_id, address _user, bytes32 _doc)\n        public\n        if_root()\n    {\n        identity_storage().update_add_user_to_group(_group_id, _user, _doc);\n    }\n\n    /**\n    @notice Function to remove a user from group (only root can call this)\n    @param _user Ethereum address of the user to be removed from their group\n    */\n    function removeGroupUser(address _user)\n        public\n        if_root()\n    {\n        identity_storage().update_remove_group_user(_user);\n    }\n\n    /**\n    @notice Function to update the KYC data of user (expiry data of valid KYC) (can only be called by the KYC ADMIN role)\n    @param _user Ethereum address of the user\n    @param _doc hash of the IPFS doc containing kyc information about this user\n    @param _id_expiration expiry date of the KYC\n    */\n    function updateKyc(address _user, bytes32 _doc, uint256 _id_expiration)\n        public\n        if_kyc_admin()\n    {\n        identity_storage().update_kyc(_user, _doc, _id_expiration);\n    }\n}\n","abiDocs":[{"constant":true,"inputs":[],"name":"resolver","payable":false,"stateMutability":"view","type":"function","signature":"resolver()","signatureHash":"04f3bcec"},{"constant":true,"inputs":[],"name":"key","payable":false,"stateMutability":"view","type":"function","signature":"key()","signatureHash":"3943380c"},{"constant":true,"inputs":[{"name":"_key","type":"bytes32","description":"the resolver key to look up"}],"name":"get_contract","outputs":[{"name":"_contract","type":"address","description":"the address of the contract"}],"payable":false,"stateMutability":"view","type":"function","details":"Get the address of a contract","return":"_contract the address of the contract","signature":"get_contract(bytes32)","signatureHash":"3f83acff"},{"constant":false,"inputs":[{"name":"_group_id","type":"uint256","description":"ID of the group to be added in"},{"name":"_user","type":"address","description":"Ethereum address of the user"},{"name":"_doc","type":"bytes32","description":"hash of IPFS doc containing details of this user"}],"name":"addGroupUser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","notice":"Function to add an address to a group (only root can call this function)","signature":"addGroupUser(uint256,address,bytes32)","signatureHash":"737988e3"},{"constant":false,"inputs":[{"name":"_user","type":"address","description":"Ethereum address of the user"},{"name":"_doc","type":"bytes32","description":"hash of the IPFS doc containing kyc information about this user"},{"name":"_id_expiration","type":"uint256","description":"expiry date of the KYC"}],"name":"updateKyc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","notice":"Function to update the KYC data of user (expiry data of valid KYC) (can only be called by the KYC ADMIN role)","signature":"updateKyc(address,bytes32,uint256)","signatureHash":"944ae971"},{"constant":false,"inputs":[{"name":"_user","type":"address","description":"Ethereum address of the user to be removed from their group"}],"name":"removeGroupUser","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function","notice":"Function to remove a user from group (only root can call this)","signature":"removeGroupUser(address)","signatureHash":"c86ee925"},{"constant":true,"inputs":[],"name":"CONTRACT_ADDRESS","payable":false,"stateMutability":"view","type":"function","signature":"CONTRACT_ADDRESS()","signatureHash":"db4ecbc1"},{"inputs":[{"name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]}
