contract YT is StandardToken {
    address public owner;
	string public name = 'youbi token';
	string public symbol = 'YT';
	uint public decimals = 18;
	uint public INITIAL_SUPPLY = 10000000000000000000000000;
	
	// 6mon + 1year + 2year + 3year + 3.5year = 10year
	uint public maxMintTimes = 182 + 365 + 730 + 1095 + 1278;
	uint public nowMintTimes = 1;
	
	function YT() {
		totalSupply = INITIAL_SUPPLY;
		balances[msg.sender] = INITIAL_SUPPLY;
		owner = msg.sender;
	}
	
	// computer mintAmount
	function comMintAmount() public returns (uint amount){
		if(nowMintTimes <= 182){
		    return totalSupply * 10 / 100 / 31; // 10% per month
		}else if(nowMintTimes <= 182 + 365){
		    return totalSupply * 8 / 100 / 31; // 8% per month
		}else if(nowMintTimes <= 182 + 365 + 730){
		    return totalSupply * 5 / 100 / 31; // 5% per month
		}else if(nowMintTimes <= 182 + 365 + 730 + 1095){
		    return totalSupply * 3 / 100 / 31; // 3% per month
		}else if(nowMintTimes <= 182 + 365 + 730 + 1095 + 1278){
		    return totalSupply * 2 / 100 / 30; // 2% per month
		}else{
		    return 0;
		}
	}
	
	// mint tokens per day
    function mintToken() public returns (bool success){
        require(msg.sender == owner);
        require(totalSupply < 1000000000000000000000000000);
        require(nowMintTimes <= maxMintTimes);
        
        uint mintAmount = comMintAmount();
        balances[owner] += mintAmount;
        totalSupply += mintAmount;
        nowMintTimes += 1;
        Transfer(0, owner, mintAmount);
        return true;
    }

}
function comMintAmount() public returns (uint amount){
	if(nowMintTimes <= 182){
	    return totalSupply * 10 / 100 / 31; // 10% per month
	}else if(nowMintTimes <= 182 + 365){
	    return totalSupply * 8 / 100 / 31; // 8% per month
	}else if(nowMintTimes <= 182 + 365 + 730){
	    return totalSupply * 5 / 100 / 31; // 5% per month
	}else if(nowMintTimes <= 182 + 365 + 730 + 1095){
	    return totalSupply * 3 / 100 / 31; // 3% per month
	}else if(nowMintTimes <= 182 + 365 + 730 + 1095 + 1278){
	    return totalSupply * 2 / 100 / 30; // 2% per month
	}else{
	    return 0;
	}
}

// computer mintAmount