Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: uint256 to address explicit type conversion error #402

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AyaneBTC
Copy link

Any version of solidity greater than 0.8.0 won't allow you to convert from/to uint256<->address, so the following contracts will encounter error when compiling with newer version of solidity.

TypeError: Explicit type conversion not allowed from "uint256" to "address".
  --> @uniswap/v3-periphery/contracts/libraries/PoolAddress.sol:35:16:
   |
35 |         pool = address(
   |                ^ (Relevant source part starts here and spans across multiple lines).

So, we need to first convert uint256 to uint160 and then to address.

Copy link

@walker112171 walker112171 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yt

Copy link

@walker112171 walker112171 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants