-
Notifications
You must be signed in to change notification settings - Fork 376
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
♻️ Add extra protection for ERC6551 #1364
Conversation
address selfImplementation = _selfImplementation(); | ||
/// @solidity memory-safe-assembly | ||
assembly { | ||
extcodecopy(address(), 0x2c, 0x0a, 0x14) // Assumes the upper 20 bytes at 0x40 are zero. |
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.
This means upper 12 bytes, right?
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 yes.
{ | ||
_updateState(); | ||
} | ||
|
||
/// @dev Guards `_authorizeUpgrade` such that it must be used via an ERC6551Proxy. | ||
modifier onlyViaERC6551Proxy() virtual { |
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 seems like what this is really doing is notViaERC6551Clone()
. It might be worth renaming, because this will pass in all situations except that, even if not a proxy. I'm not sure if it would ever matter.
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.
Ok, I think it’s a good rename suggestion.
Description
In case the owner isn't trusted.
Checklist
Ensure you completed all of the steps below before submitting your pull request:
forge fmt
?forge test
?Pull requests with an incomplete checklist will be thrown out.