-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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 clone variant with per-instance immutable arguments #5109
Add clone variant with per-instance immutable arguments #5109
Conversation
🦋 Changeset detectedLatest commit: c9aa715 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
If you need an ERC1967 minimal proxy with immutable args, this is the formulation of the init code. abi.encodePacked(
hex"61",
uint16(args.length + 0x3d),
hex"3d8160233d3973",
implementation,
hex"60095155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3",
args
) For minimalism, this does not emit the |
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.
Mostly looks good, but I'd rather have WithImmutableArgs
as a suffix (e.g. predictDeterministicAddressWithImmutableArgs
instead of predictWithImmutableArgsDeterministicAddress
)
a56b8bc
to
959b36a
Compare
This reverts commit c85adcc.
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.
Before merging we've been discussing how the code size limit error for the clone contract should be.
Our guidelines indicate to follow the ERC6093 rationale for custom errors, I'm personally fine with EIP170ContractCodeSizeLimit
but it's missing the "error prefix". I'd like to propose the following:
EIP170ExceededContractSizeLimit
(same rationale as in other errors likeERC20ExceededCap
orERC4626ExceededMaxWithdraw
)CloneArgumentsTooLong
(similar rationale toStringTooLong
)
Perhaps we may go even more generic and just have a generic InitcodeSizeExceeded
in Errors.sol
.
wdyt @Amxx ?
My preference goes for If you get
|
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.
Sounds good.
I think CloneArgumentsTooLong
is good enough and I don't want to block this anymore. Ideally, I'd like the naming to meet our guidelines for custom errors and be CloneTooLongArguments
but I understand you dislike it because it's not as clearly readable as the current naming. I agree, though.
I'm approving since I don't have a major issue and error backwards compatibility is not guaranteed anyway.
Notes about EOF:
extcodecopy
on the caller.PR Checklist
npx changeset add
)