{"author":"Digix Holdings","title":"Contract (read-only) to read information from DAO","fileName":"/contracts/interactive/DaoInformation.sol","name":"DaoInformation","abi":[{"constant":true,"inputs":[],"name":"resolver","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getAddressConfig","outputs":[{"name":"_configValue","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":true,"inputs":[],"name":"currentTimeInQuarter","outputs":[{"name":"_currentT","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isMainPhase","outputs":[{"name":"_isMainPhase","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isLockingPhase","outputs":[{"name":"_isLockingPhase","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"currentQuarterNumber","outputs":[{"name":"_quarterNumber","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"readDaoInfo","outputs":[{"name":"_currentQuarterNumber","type":"uint256"},{"name":"_startOfQuarter","type":"uint256"},{"name":"_startOfMainPhase","type":"uint256"},{"name":"_startOfNextQuarter","type":"uint256"},{"name":"_isMainPhase","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"isParticipant","outputs":[{"name":"_is","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getBytesConfig","outputs":[{"name":"_configValue","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"readUserInfo","outputs":[{"name":"_isParticipant","type":"bool"},{"name":"_isModerator","type":"bool"},{"name":"_lastParticipatedQuarter","type":"uint256"},{"name":"_lockedDgdStake","type":"uint256"},{"name":"_lockedDgd","type":"uint256"},{"name":"_reputationPoints","type":"uint256"},{"name":"_quarterPoints","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getUintConfig","outputs":[{"name":"_configValue","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isDaoNotReplaced","outputs":[{"name":"_isNotReplaced","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"CONTRACT_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_proposalId","type":"bytes32"}],"name":"isProposalPaused","outputs":[{"name":"_isPausedOrStopped","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"isModerator","outputs":[{"name":"_is","type":"bool"}],"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 \"./../common/DaoCommon.sol\";\n\n/**\n@title Contract (read-only) to read information from DAO\n@dev cannot introduce more read methods in other contracts due to deployment gas limit\n@author Digix Holdings\n*/\ncontract DaoInformation is DaoCommon {\n\n    constructor(address _resolver)\n        public\n    {\n        require(init(CONTRACT_DAO_INFORMATION, _resolver));\n    }\n\n    /**\n    @notice Function to read user specific information\n    @param _user Ethereum address of the user\n    @return {\n      \"_isParticipant\": \"Boolean, true if the user is a DigixDAO participant in the current quarter\",\n      \"_isModerator\": \"Boolean, true if the user is a DigixDAO moderator in the current quarter\",\n      \"_lastParticipatedQuarter\": \"The last quarter in which this user has/had participated in DigixDAO\",\n      \"_lockedDgdStake\": \"The locked stage of this user in the current quarter\",\n      \"_lockedDgd\": \"The actual locked DGDs by this user in our contracts\",\n      \"_reputationPoints\": \"The cumulative reputation points accumulated by this user in DigixDAO\",\n      \"_quarterPoints\": \"Quarter points of this user in the current quarter\"\n    }\n    */\n    function readUserInfo(address _user)\n        public\n        constant\n        returns (\n            bool _isParticipant,\n            bool _isModerator,\n            uint256 _lastParticipatedQuarter,\n            uint256 _lockedDgdStake,\n            uint256 _lockedDgd,\n            uint256 _reputationPoints,\n            uint256 _quarterPoints\n        )\n    {\n         _lastParticipatedQuarter = daoRewardsStorage().lastParticipatedQuarter(_user);\n         (_lockedDgd, _lockedDgdStake) = daoStakeStorage().readUserDGDStake(_user);\n         _reputationPoints = daoPointsStorage().getReputation(_user);\n         _quarterPoints = daoPointsStorage().getQuarterPoint(_user, currentQuarterNumber());\n         _isParticipant = isParticipant(_user);\n         _isModerator = isModerator(_user);\n    }\n\n    /**\n    @notice Function to read DigixDAO specific information\n    @return {\n      \"_currentQuarterNumber\": \"The current quarter number of DigixDAO (starts from 1)\",\n      \"_startOfQuarter\": \"The unix timestamp when the current quarter started\",\n      \"_startOfMainPhase\": \"The unix timestamp when the main phase of current quarter has/will start\",\n      \"_startOfNextQuarter\": \"The unix timestamp when the next quarter begins\",\n      \"_isMainPhase\": \"Boolean, true if this is the main phase, false if this is the locking phase\"\n    }\n    */\n    function readDaoInfo()\n        public\n        constant\n        returns (\n            uint256 _currentQuarterNumber,\n            uint256 _startOfQuarter,\n            uint256 _startOfMainPhase,\n            uint256 _startOfNextQuarter,\n            bool _isMainPhase\n        )\n    {\n        _currentQuarterNumber = currentQuarterNumber();\n        _startOfQuarter = now.sub(currentTimeInQuarter());\n        _startOfMainPhase = _startOfQuarter.add(getUintConfig(CONFIG_LOCKING_PHASE_DURATION));\n        _startOfNextQuarter = _startOfQuarter.add(getUintConfig(CONFIG_QUARTER_DURATION));\n        _isMainPhase = isMainPhase();\n    }\n}\n","abiDocs":[{"constant":true,"inputs":[],"name":"resolver","payable":false,"stateMutability":"view","type":"function","signature":"resolver()","signatureHash":"04f3bcec"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getAddressConfig","payable":false,"stateMutability":"view","type":"function","signature":"getAddressConfig(bytes32)","signatureHash":"1d8ccd04"},{"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":true,"inputs":[],"name":"currentTimeInQuarter","outputs":[{"name":"_currentT","type":"uint256","description":"the current relative time in the quarter"}],"payable":false,"stateMutability":"view","type":"function","details":"For example: the currentTimeInQuarter of the first second of any quarter is 1","return":"_currentT the current relative time in the quarter","notice":"Get the current relative time in the quarter","signature":"currentTimeInQuarter()","signatureHash":"560a25ea"},{"constant":true,"inputs":[],"name":"isMainPhase","outputs":[{"name":"_isMainPhase","type":"bool","description":"true if it is in a main phase"}],"payable":false,"stateMutability":"view","type":"function","details":"The main phase is where all the governance activities could take plase. If the DAO is replaced, there can never be any more main phase.","return":"_isMainPhase true if it is in a main phase","notice":"Check if it is currently in a main phase.","signature":"isMainPhase()","signatureHash":"68533060"},{"constant":true,"inputs":[],"name":"isLockingPhase","outputs":[{"name":"_isLockingPhase","type":"bool","description":"true if it is in the locking phase"}],"payable":false,"stateMutability":"view","type":"function","details":"No governance activities can happen in the locking phase. The locking phase is from t=0 to t=CONFIG_LOCKING_PHASE_DURATION-1","return":"_isLockingPhase true if it is in the locking phase","notice":"Check if it is currently in the locking phase","signature":"isLockingPhase()","signatureHash":"7d6fed80"},{"constant":true,"inputs":[],"name":"currentQuarterNumber","outputs":[{"name":"_quarterNumber","type":"uint256","description":"the current quarter index"}],"payable":false,"stateMutability":"view","type":"function","details":"Quarter indexes starts from 1","return":"_quarterNumber the current quarter index","notice":"Get the current quarter index","signature":"currentQuarterNumber()","signatureHash":"7f6a26b6"},{"constant":true,"inputs":[],"name":"readDaoInfo","outputs":[{"name":"_currentQuarterNumber","type":"uint256","description":"The current quarter number of DigixDAO (starts from 1)"},{"name":"_startOfQuarter","type":"uint256","description":"The unix timestamp when the current quarter started"},{"name":"_startOfMainPhase","type":"uint256","description":"The unix timestamp when the main phase of current quarter has/will start"},{"name":"_startOfNextQuarter","type":"uint256","description":"The unix timestamp when the next quarter begins"},{"name":"_isMainPhase","type":"bool","description":"Boolean, true if this is the main phase, false if this is the locking phase"}],"payable":false,"stateMutability":"view","type":"function","return":"{ \"_currentQuarterNumber\": \"The current quarter number of DigixDAO (starts from 1)\", \"_startOfQuarter\": \"The unix timestamp when the current quarter started\", \"_startOfMainPhase\": \"The unix timestamp when the main phase of current quarter has/will start\", \"_startOfNextQuarter\": \"The unix timestamp when the next quarter begins\", \"_isMainPhase\": \"Boolean, true if this is the main phase, false if this is the locking phase\" }","notice":"Function to read DigixDAO specific information","signature":"readDaoInfo()","signatureHash":"85037335"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"isParticipant","payable":false,"stateMutability":"view","type":"function","notice":"Check if a user is a participant in the current quarter","signature":"isParticipant(address)","signatureHash":"929066f5"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getBytesConfig","payable":false,"stateMutability":"view","type":"function","signature":"getBytesConfig(bytes32)","signatureHash":"93ddad08"},{"constant":true,"inputs":[{"name":"_user","type":"address","description":"Ethereum address of the user"}],"name":"readUserInfo","outputs":[{"name":"_isParticipant","type":"bool","description":"Boolean, true if the user is a DigixDAO participant in the current quarter"},{"name":"_isModerator","type":"bool","description":"Boolean, true if the user is a DigixDAO moderator in the current quarter"},{"name":"_lastParticipatedQuarter","type":"uint256","description":"The last quarter in which this user has/had participated in DigixDAO"},{"name":"_lockedDgdStake","type":"uint256","description":"The locked stage of this user in the current quarter"},{"name":"_lockedDgd","type":"uint256","description":"The actual locked DGDs by this user in our contracts"},{"name":"_reputationPoints","type":"uint256","description":"The cumulative reputation points accumulated by this user in DigixDAO"},{"name":"_quarterPoints","type":"uint256","description":"Quarter points of this user in the current quarter"}],"payable":false,"stateMutability":"view","type":"function","return":"{ \"_isParticipant\": \"Boolean, true if the user is a DigixDAO participant in the current quarter\", \"_isModerator\": \"Boolean, true if the user is a DigixDAO moderator in the current quarter\", \"_lastParticipatedQuarter\": \"The last quarter in which this user has/had participated in DigixDAO\", \"_lockedDgdStake\": \"The locked stage of this user in the current quarter\", \"_lockedDgd\": \"The actual locked DGDs by this user in our contracts\", \"_reputationPoints\": \"The cumulative reputation points accumulated by this user in DigixDAO\", \"_quarterPoints\": \"Quarter points of this user in the current quarter\" }","notice":"Function to read user specific information","signature":"readUserInfo(address)","signatureHash":"a8dbd0cd"},{"constant":true,"inputs":[{"name":"_configKey","type":"bytes32"}],"name":"getUintConfig","payable":false,"stateMutability":"view","type":"function","signature":"getUintConfig(bytes32)","signatureHash":"b1e2b9dd"},{"constant":true,"inputs":[],"name":"isDaoNotReplaced","outputs":[{"name":"_isNotReplaced","type":"bool","description":"true if it is not replaced, false if it has already been replaced"}],"payable":false,"stateMutability":"view","type":"function","return":"_isNotReplaced true if it is not replaced, false if it has already been replaced","notice":"Check if the DAO contracts have been replaced by a new set of contracts","signature":"isDaoNotReplaced()","signatureHash":"d70d9358"},{"constant":true,"inputs":[],"name":"CONTRACT_ADDRESS","payable":false,"stateMutability":"view","type":"function","signature":"CONTRACT_ADDRESS()","signatureHash":"db4ecbc1"},{"constant":true,"inputs":[{"name":"_proposalId","type":"bytes32"}],"name":"isProposalPaused","outputs":[{"name":"_isPausedOrStopped","type":"bool","description":"true if the proposal is paused(or stopped)"}],"payable":false,"stateMutability":"view","type":"function","details":"If a proposal is paused/stopped (by the PRLs): proposer cannot call for voting, a current on-going voting round can still pass, but no funding can be withdrawn.A paused proposal can still be unpausedIf a proposal is stopped, this function also returns true","return":"_isPausedOrStopped true if the proposal is paused(or stopped)","notice":"Check if a proposal is currently paused/stopped","signature":"isProposalPaused(bytes32)","signatureHash":"f94f0f33"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"isModerator","payable":false,"stateMutability":"view","type":"function","notice":"Check if a user is a moderator in the current quarter","signature":"isModerator(address)","signatureHash":"fa6f3936"},{"inputs":[{"name":"_resolver","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]}
