getting this error
Error: Transaction reverted: function returned an unexpected amount of data
at Proxy.getDecimals (contracts/proxy.sol:100)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
when using hardhat (forked mainnet/testnet). I am trying to read from a basic function decimals() of WETH.
My implementation is like this
interface ERC20 {
function decimals() external returns (uint8);
}
contract Proxy {
function getDecimals(address _addr) external returns (uint8){
return ERC20(_addr).decimals();
}
}