contract NSilkRoadCoinToken is standardToken,Owned {
    using SafeMath for uint;

    string constant public name="NSilkRoadCoinToken";
    string constant public symbol="NSRC";
    uint256 constant public decimals=6;
    
    uint256 public totalSupply = 0;
    uint256 constant public topTotalSupply = 21*10**7*10**decimals;
    uint256 public FoundationSupply = percent(30);
	uint256 public TeamSupply = percent(25);
    uint256 public ownerSupply = topTotalSupply - FoundationSupply - TeamSupply;
    
    /// @dev Fallback to calling deposit when ether is sent directly to contract.
    function() public payable {}
    
    /// @dev initial function
    function NSilkRoadCoinToken() public {
        owner = msg.sender;
        mintTokens(owner, ownerSupply);
    }
    
    /// @dev Issue new tokens
    function mintTokens(address _to, uint256 _amount) internal {
        require (balances[_to] + _amount >= balances[_to]);     // Check for overflows
        balances[_to] = balances[_to].add(_amount);             // Set minted coins to target
        totalSupply = totalSupply.add(_amount);
        require(totalSupply <= topTotalSupply);
        Transfer(0x0, _to, _amount);                            // Create Transfer event from 0x
    }
    
    /// @dev Get time
    function getTime() internal constant returns(uint256) {
        return now;
    }
    
    /// @dev set initial message
    function setInitialVaribles(
        address _FoundationAddress,
        address _TeamAddress
        )
        public
        onlyOwner 
    {
        FoundationAddress = _FoundationAddress;
        TeamAddress = _TeamAddress;
    }
    
    /// @dev withDraw Ether to a Safe Wallet
    function withDraw(address _walletAddress) public payable onlyOwner {
        require (_walletAddress != address(0));
        _walletAddress.transfer(this.balance);
    }
    
    /// @dev allocate Token
    function transferMultiAddress(address[] _recivers, uint256[] _values) public onlyOwner {
        require (_recivers.length == _values.length);
        for(uint256 i = 0; i < _recivers.length ; i++){
            address reciver = _recivers[i];
            uint256 value = _values[i];
            require (balances[msg.sender] >= value);           // Throw if sender has insufficient balance
            require (balances[reciver] + value >= balances[reciver]);  // Throw if owerflow detected
            balances[msg.sender] -= value;                     // Deduct senders balance
            balances[reciver] += value;                            // Add recivers blaance
            Transfer(msg.sender, reciver, value);                  // Raise Transfer event
        }
    }
    
    /// @dev calcute the tokens
    function percent(uint256 percentage) internal pure returns (uint256) {
        return percentage.mul(topTotalSupply).div(100);
    }
    
    /// @dev allocate token for Foundation Address
    function allocateFoundationToken() public onlyOwner {
        require(TeamAddress != address(0));
        require(balances[FoundationAddress] == 0);
        mintTokens(FoundationAddress, FoundationSupply);
        FoundationAddressFreezeTime = now;
    }
    
    /// @dev allocate token for Team Address
    function allocateTeamToken() public onlyOwner {
        require(TeamAddress != address(0));
        require(balances[TeamAddress] == 0);
        mintTokens(TeamAddress, TeamSupply);
    }
}
function percent(uint256 percentage) internal pure returns (uint256) {
    return percentage.mul(topTotalSupply).div(100);
}

/// @dev calcute the tokens