Compiling the code
contract Bar {
function blockingFunction() public pure returns (bool) {
assembly {
return(0,0x20)
}
}
}
contract Foo is Bar {
function foo() public pure returns(bool) {
bool result = blockingFunction();
require(result == true, "msg");
return result;
}
}
gives me a warning
Warning: Unreachable code.
--> contracts/implementation/Foo.sol:18:9:
|
18 | require(result == true, "msg");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Warning: Unreachable code.
--> contracts/implementation/Foo.sol:19:9:
|
19 | return result;
| ^^^^^^^^^^^^^
which makes no sense to me. The blockingFunction
call seems to block the following code execution, even though it should return a boolean. Can someone tell me how to fix this? This is my hardhat.config.ts
import "@nomicfoundation/hardhat-toolbox";
import { HardhatUserConfig } from "hardhat/config";
const config: HardhatUserConfig = {
solidity: "0.8.9",
mocha: {
timeout: 100000000
}
}
export default config;