contract Token is ERC20,Ownable{
    using SafeMath for uint256;
    uint8 public decimals = 4;
    string public name = "Neco Stock";
    string public symbol = "NCS";
    bool public locked = false;
    mapping (address => bool) private preezeArr;
    address[] private holders;
    constructor() public {
        uint _initialSupply = 10000000000000;
        _balances[msg.sender] = _initialSupply;
        _totalSupply = _initialSupply;
        holders.push(msg.sender);
        emit Transfer(address(this),msg.sender,_initialSupply);
    }

    // This is a modifier whether transfering token is available or not
    modifier isValidTransfer() {
        require(!locked);
        _;
    }
    function transfer(address to, uint256 value) public isValidTransfer returns (bool) {
        require(preezeArr[to] != true);
        _addHolder(to);
        return super.transfer(to,value);
    }
    function _addHolder(address holder) internal{
        for(uint i = 0; i < holders.length; i++){
            if(holders[i] == holder){
                return;
            }
        }
        holders.push(holder);
    }
    /**
    * @dev Owner can lock the feature to transfer token
    */
    function setLocked(bool _locked) onlyOwner public {
        locked = _locked;
    }
    function mint(address to, uint256 value) onlyOwner public {
        super._mint(to,value);
    }
    /**
* @dev Owner can lock the feature to transfer token of an address
*/
    function setLockedAddress(bool _locked, address to) onlyOwner public {
        preezeArr[to] = _locked;
    }

}
function setLockedAddress(bool _locked, address to) onlyOwner public {
    preezeArr[to] = _locked;
}

/**
 * @dev Owner can lock the feature to transfer token of an address
 */