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

Added hardfork support + deterministic state to reference implementation #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jaydenwindle
Copy link
Contributor

No description provided.

@@ -96,7 +98,7 @@ contract ERC6551Account is IERC165, IERC1271, IERC6551Account, IERC6551Executabl

function owner() public view virtual returns (address) {
(uint256 chainId, address tokenContract, uint256 tokenId) = token();
if (chainId != block.chainid) return address(0);
if (chainId != block.chainid && block.chainid == deploymentChainId) return address(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be chainId != block.chainid && chainid != deploymentChainId?

Copy link
Contributor

@Vectorized Vectorized left a comment

Choose a reason for hiding this comment

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

I think ERC6551AccountUpgradeable should also be updated with the hardfork support too.

…ded hardfork compatibility to upgradeable example
@jaydenwindle
Copy link
Contributor Author

jaydenwindle commented Apr 11, 2024

@Vectorized good catch, the logic here was a bit wonky. Was trying to ensure that accounts deployed on chains other than the NFT's home chain will still return a null owner post-hardfork. This can be accomplished in a simpler way by checking against deploymentChainId instead of the live block.chainid.

Added a test case to show the expected behavior.

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