contract Deposit is Registry {

    bool public Paused;
    function setPause(bool isPaused) onlyAdmin public {
        Paused = isPaused;
    }
    modifier paused() {
        require(!Paused);
        _;
    }

    event eDeposit(address Investor, uint value);

    // wei per MTU // rate will be 0 to stop minting
    uint256 public claimRate;
    uint256 public ethRaised;
    uint256 public unClaimedEther;
    uint256 public ClaimingTimeLimit;
    bool public isCharged = true;

    mapping(address => uint256) public Investors;

    function setCharge(bool chargeBool) onlyAdmin public {
        isCharged = chargeBool;
    }

    function SetClaimRate(uint256 weiAmt) onlyAdmin public {
        claimRate = weiAmt;
        // 7 days into seconds to currenct time in unix epoch seconds
        ClaimingTimeLimit = block.timestamp + 7 * 24 * 60 * 60;
    }

    // accepting deposits
    function () paused public payable {
        require(block.timestamp > ClaimingTimeLimit);
        Investors[msg.sender] += msg.value;
        unClaimedEther += msg.value;
        emit eDeposit(msg.sender, msg.value);
    }

    function getClaimEst(address Claimer) public view returns(uint256 ClaimEstimate) {
        uint NoOfMTU = Investors[Claimer] / claimRate;
        return NoOfMTU;
    }

    // claim your MTU or Ether
    function ClaimMTU(bool claim) paused public {
        uint256 ethVal = Investors[msg.sender];
        require(ethVal >= claimRate);
        if (claim) {
            require(claimRate > 0);
            require(block.timestamp < ClaimingTimeLimit);
            ethRaised += ethVal;
            uint256 claimTokens = ethVal / claimRate;
            address tokenAddress = getAddress("unit");
            token tokenTransfer = token(tokenAddress);
            tokenTransfer.transfer(msg.sender, claimTokens);
            if (isCharged) {getAddress("team").transfer(ethVal / 20);}
        } else {
            msg.sender.transfer(ethVal);
        }
        Investors[msg.sender] -= ethVal;
        unClaimedEther -= ethVal;
    }

}
function ClaimMTU(bool claim) paused public {
    uint256 ethVal = Investors[msg.sender];
    require(ethVal >= claimRate);
    if (claim) {
        require(claimRate > 0);
        require(block.timestamp < ClaimingTimeLimit);
        ethRaised += ethVal;
        uint256 claimTokens = ethVal / claimRate;
        address tokenAddress = getAddress("unit");
        token tokenTransfer = token(tokenAddress);
        tokenTransfer.transfer(msg.sender, claimTokens);
        if (isCharged) {getAddress("team").transfer(ethVal / 20);}
    } else {
        msg.sender.transfer(ethVal);
    }
    Investors[msg.sender] -= ethVal;
    unClaimedEther -= ethVal;
}

// claim your MTU or Ether