-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: mdt/fixed-storage-pattern
Are you sure you want to change the base?
test storage persistence after registry upgrade #2
Conversation
src/VerifiableFactory.sol
Outdated
// 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@@ -9,8 +9,6 @@ interface IProxy { | |||
function salt() external view returns (uint256); | |||
|
|||
function owner() external view returns (address); | |||
|
|||
function creator() external view returns (address); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.