Complete the code to declare an interface named IToken.
interface [1] {
function totalSupply() external view returns (uint256);
}The interface name should start with 'I' to indicate it's an interface, so 'IToken' is correct.
Complete the code to declare a function in the interface that transfers tokens.
function transfer(address to, uint256 amount) external [1];The transfer function returns a boolean indicating success, so 'returns (bool)' is correct.
Fix the error in the interface function declaration for balanceOf.
function balanceOf(address owner) external [1] returns (uint256);The balanceOf function only reads data, so it should be marked as 'view'.
Fill both blanks to declare an interface with two functions: approve and allowance.
interface IToken {
function approve(address spender, uint256 amount) external [1];
function allowance(address owner, address spender) external [2] returns (uint256);
}The approve function returns a boolean, so it uses 'returns (bool)'. The allowance function reads state, so it uses 'view'.
Fill all three blanks to declare an interface with functions: name, symbol, and decimals.
interface IToken {
function name() external [1] returns (string memory);
function symbol() external [2] returns (string memory);
function decimals() external [3] returns (uint8);
}All these functions only read data, so they should be marked as 'view'.