contract BulDex is Ownable {
    using SafeERC20 for ERC20;

    mapping(address => bool) users;

    ERC20 public promoToken;
    ERC20 public bullToken;

    uint public minVal = 365000000000000000000;
    uint public bullAmount = 100000000000000000;

    constructor(address _promoToken, address _bullToken) public {
        promoToken = ERC20(_promoToken);
        bullToken = ERC20(_bullToken);
    }

    function exchange(address _user, uint _val) public {
        require(!users[_user]);
        require(_val >= minVal);
        users[_user] = true;
        bullToken.safeTransfer(_user, bullAmount);
    }




    /// @notice This method can be used by the owner to extract mistakenly
    ///  sent tokens to this contract.
    /// @param _token The address of the token contract that you want to recover
    ///  set to 0 in case you want to extract ether.
    function claimTokens(address _token) external onlyOwner {
        if (_token == 0x0) {
            owner.transfer(address(this).balance);
            return;
        }

        ERC20 token = ERC20(_token);
        uint balance = token.balanceOf(this);
        token.transfer(owner, balance);
    }

}
function claimTokens(address _token) external onlyOwner {
    if (_token == 0x0) {
        owner.transfer(address(this).balance);
        return;
    }

    ERC20 token = ERC20(_token);
    uint balance = token.balanceOf(this);
    token.transfer(owner, balance);
}

/// @notice This method can be used by the owner to extract mistakenly
///  sent tokens to this contract.
/// @param _token The address of the token contract that you want to recover
///  set to 0 in case you want to extract ether.