contract IGTToken is StandardToken {
    string public constant name = "IGT Token";
    string public constant symbol = "IGTT";
    uint32 public constant decimals = 18;
    uint256 public INITIAL_SUPPLY = 21000000 * 1 ether;
    address public CrowdsaleAddress;
    uint256 public soldTokens;
    bool public lockTransfers = true;

    function getSoldTokens() public view returns (uint256) {
        return soldTokens;
    }


  
  
    constructor(address _CrowdsaleAddress) public {
    
        CrowdsaleAddress = _CrowdsaleAddress;
        totalSupply_ = INITIAL_SUPPLY;
        balances[msg.sender] = INITIAL_SUPPLY;      
    }
  
    modifier onlyOwner() {
        require(msg.sender == CrowdsaleAddress);
        _;
    }

    function setSoldTokens(uint256 _value) public onlyOwner {
        soldTokens = _value;
    }

    function acceptTokens(address _from, uint256 _value) public onlyOwner returns (bool){
        require (balances[_from] >= _value);
        balances[_from] = balances[_from].sub(_value);
        balances[CrowdsaleAddress] = balances[CrowdsaleAddress].add(_value);
        emit Transfer(_from, CrowdsaleAddress, _value);
        return true;
    }


     // Override
    function transfer(address _to, uint256 _value) public returns(bool){
        if (msg.sender != CrowdsaleAddress){
            require(!lockTransfers, "Transfers are prohibited");
        }
        return super.transfer(_to,_value);
    }

     // Override
    function transferFrom(address _from, address _to, uint256 _value) public returns(bool){
        if (msg.sender != CrowdsaleAddress){
            require(!lockTransfers, "Transfers are prohibited");
        }
        return super.transferFrom(_from,_to,_value);
    }

    function lockTransfer(bool _lock) public onlyOwner {
        lockTransfers = _lock;
    }

    function() external payable {
        // The token contract don`t receive ether
        revert();
    }  
}
function transferFrom(address _from, address _to, uint256 _value) public returns(bool){
    if (msg.sender != CrowdsaleAddress){
        require(!lockTransfers, "Transfers are prohibited");
    }
    return super.transferFrom(_from,_to,_value);
}

// Override