Open yilmazbingo opened 1 year ago
I got an issue compiling my contract in hardhat. I copied the code to Remix and got the same error. This part of the code has an issue:
function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) { require(key.token0 < key.token1); // errror message points this line pool = address( uint256( keccak256( abi.encodePacked( hex'ff', factory, keccak256(abi.encode(key.token0, key.token1, key.fee)), POOL_INIT_CODE_HASH ) ) ) );
for pool=adress I get this error: "TypeError: Explicit type conversion not allowed from "uint256" to "address".".
pool=adress
keccak256 returns bytes32, it is wrapped by uint256 and that is wrapped by address. everything seems fine. I do not know what is causing issue
keccak256
bytes32
uint256
address
Your using a compiler version after 0.7.6, 0.8.0 introduces this change, you can either fix it or upgrade to 0.7.6
I got an issue compiling my contract in hardhat. I copied the code to Remix and got the same error. This part of the code has an issue:
for
pool=adress
I get this error: "TypeError: Explicit type conversion not allowed from "uint256" to "address".".keccak256
returnsbytes32
, it is wrapped byuint256
and that is wrapped byaddress
. everything seems fine. I do not know what is causing issue