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

test storage persistence after registry upgrade #2

Open
wants to merge 6 commits into
base: mdt/fixed-storage-pattern
Choose a base branch
from

Conversation

mdtanrikulu
Copy link
Contributor

No description provided.

@mdtanrikulu mdtanrikulu requested a review from Arachnid November 20, 2024 15:50
// reconstruct the address using CREATE2 and verify it matches
bytes32 outerSalt = keccak256(abi.encode(msg.sender, salt));
function _verifyContract(address proxy, address creator, address owner, uint256 salt) private view returns (bool) {
// verify the creator matches this factory
Copy link
Member

Choose a reason for hiding this comment

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

Is there any need for this check, or for the proxy to be able to return the creator? If it doesn't match, the address will not validate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh right, since creator is the part of the address creation, this is unnecessary. gonna remove it.

@mdtanrikulu mdtanrikulu requested a review from Arachnid November 21, 2024 16:09
@@ -9,8 +9,6 @@ interface IProxy {
function salt() external view returns (uint256);

function owner() external view returns (address);

function creator() external view returns (address);
Copy link
Member

Choose a reason for hiding this comment

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

It looks like you deleted it from the interface but not from the code?

Thinking about it, it may still be useful to have; otherwise there's no way to know which factory to check if all you have is an instance.

Copy link
Contributor Author

@mdtanrikulu mdtanrikulu Nov 21, 2024

Choose a reason for hiding this comment

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

the interface here is only under the VerifiableFactory scope, the actual creator is a public immutable variable which will have the auto-generated getter interface, do we need to have it explicitly under VerifiableFactory if not in use?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, good point. No, but we should be having the proxy implement the same interface we use here - otherwise there could be a mismatch between what the proxy implements and the interface specifies and we wouldn't know at compile-time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

surely, both salt and the owner implements exactly as stated here. Then I will create a common interface shared between Proxy contract and Factory contract, just to be sure there won't be any mismatch for the future changes.

@mdtanrikulu mdtanrikulu requested a review from Arachnid November 21, 2024 17:54
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