I’m trying to return the balance of msg.sender from an external contract, but when I try to compare pair.balanceOf() to an uint256, it tells me they are not comparable.
I’m using Solidity 0.8.0 on Remix with OpenZeppelin contracts.
interface TokenInterface {
function balanceOf(address account) view external;
}
contract Contract {
address public tokenAddress = 0xc5d63121bA479BAeb666a896e84283a1a0AefAe6;
TokenInterface token = TokenInterface(tokenAddress);
function stake(uint256 amount) public {
require(token.balanceOf(msg.sender) >= amount, "Insufficient balance.");
...
}
}
The other contract is an ERC20 built with OpenZeppelin.
Thanks and have a nice day :)