Question: My goal is to compare my `IERC20` contract with my `address repaymentCurrency` in a require statement:

`require(currency == listing.loanDetails.repaymentCurrency, "Error");`

However, I keep getting the following error:

`TypeError: Operator == not compatible with types contract IERC20 and address`

Any ideas about what's going on?

Here are my structs:

```
struct Listing {
      Loan loanDetails;
      address lenderAddress;
    }

    struct Loan {
      address[] erc20acceptedAddresses; // @dev Borrowers can include a list fo ERC20 tokens they'll accept from the lender
      uint256[] erc20repaymentAmounts; // @dev Front-end calculates how much of ERC20 tokens shoould be paid back
      address repaymentCurrency;
    }

```

Here is my currency interface:

```
IERC20 currency = IERC20(listing.loanDetails.erc20acceptedAddresses[_erc20repaymentIndex]);

```

Answer: 
getPrice() isn't returning a number you want from the mock, somewhere in the vicinity of 2B. Think this is a bug with the Ganache implementation- performing the calculation (minimumUSD \* precision) / price
in getEntranceFee() gives you a number less than 1- and, since Solidity can't handle floats, Solidity simply sees it as a 0, and the whole thing errors out.
The problem seems to be related to the version of Ganache:
If you use the ganache GUI, you get the miscalculation regarding the entree fee and gas estimation error.
If you start the ganache-cli locally, in another window, it works, both the calculation and the call of withdraw() :

> 
> ganache-cli --accounts 10 --hardfork istanbul --gasPrice 2000000000 --gasLimit 6721975 --mnemonic brownie --port 8545
> 
> 
> 

I am using ganache@7.0.3 installed from npm -g install ganache

It works also if you start hardhat node in another window, with the following definition in hardhat-config.js :

> 
> networks: {
> hardhat: {
> initialBaseFeePerGas: 0,
> accounts: {
> mnemonic: "test test test test test test test test test test test junk",
> path: "m/44'/60'/0'/0",
> count: 10,
> accountsBalance: "100000000000000000000",
> },
> },
> }
> 
> 
> 

> 
> BrownieFundMeProject is the active project.
> 
> 
> Running 'scripts/fund\_and\_withdraw.py::main'...
> 25000000000000001
> The current entry fee is 25000000000000001
> Funding
> Transaction sent: >0xcd8f0db14647958c4902dcce05b2baf41f1a6604999867f4bd726df02273dc68
> Gas price: 2.0 gwei Gas limit: 99258 Nonce: 5
> FundMe.fund confirmed Block: 6 Gas used: 90235 (90.91%)
> 
> 
> Transaction sent: >0xab399fb117adac26e2a381e6fab907880a1bc796d64a26f6f7915925fd6b90d5
> Gas price: 2.0 gwei Gas limit: 76963 Nonce: 6
> FundMe.withdraw confirmed Block: 7 Gas used: 24967 (32.44%)
> 
> 
> 

So it looks like a bug in Ganache GUI.