contract PaymentAddress is Ownable {
    address public collector;

    event PaymentMade(
        address indexed _payer,
        address indexed _collector,
        uint256 _value
    );
    event ClaimedTokens(
        address indexed _token,
        address indexed _collector,
        uint256 _amount
    );

    constructor(address _collector, address _owner) public {
        collector = _collector;
        _transferOwnership(_owner);
    }

    function() external payable {
        emit PaymentMade(msg.sender, collector, msg.value);
        // https://diligence.consensys.net/blog/2019/09/stop-using-soliditys-transfer-now/
        (bool success, ) = collector.call.value(msg.value)("");
        require(success, "Eth forward failed.");
    }

    /// @notice This method can be used by the controller to extract tokens to this contract.
    /// @param _token The address of the token contract that you want to recover
    function claimTokens(address _token) public onlyOwner {
        ERC20 erc20token = ERC20(_token);
        uint256 balance = erc20token.balanceOf(address(this));

        require(
            erc20token.transfer(collector, balance),
            "Token transfer could not be executed."
        );

        emit ClaimedTokens(_token, collector, balance);
    }
}
function claimTokens(address _token) public onlyOwner {
    ERC20 erc20token = ERC20(_token);
    uint256 balance = erc20token.balanceOf(address(this));

    require(
        erc20token.transfer(collector, balance),
        "Token transfer could not be executed."
    );

    emit ClaimedTokens(_token, collector, balance);
}

/// @notice This method can be used by the controller to extract tokens to this contract.
/// @param _token The address of the token contract that you want to recover