So I have two contracts
Contract A & Contract B
Contract A is an ERC721 that allows for the balanceOf function to be called after passing it an address. It will return response of how many NFTs the address you pass it has in the wallet.
Contract B is a ERC20 contract. I am trying to implement transfer requirements on Contract B that call for the balanceOf Contract A based on the msg.sender address you pass it & return the value to compare against >= 1 to make sure the transfer is even eligible.
Overall, trying to make Contract B check if the msg.sender has a balance of Contract A & then as long as it is >= 1, the Contract B transfer should work.
Anyone know how I would do this using require() in the transfer function on Contract B?
Below is the transfer function within Contract B that I am trying to mess with. I have tried a ton of methods & just cannot figure out the best way to implement this logic.
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(address(0xEBE7d6984917DEcceaCc089bb7E33471CCe566b8).balanceOf(msg.sender) >= 1, "You must be a member by obtaining your badge!");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
holderManage(recipient);
emit Transfer(sender, recipient, amount);
} ```