docs(ensv2): correct VerifiableFactory verifyContract signature and address prediction - #588
Open
estmcmxci wants to merge 1 commit into
Open
docs(ensv2): correct VerifiableFactory verifyContract signature and address prediction#588estmcmxci wants to merge 1 commit into
estmcmxci wants to merge 1 commit into
Conversation
…ddress prediction Two corrections to verifiable-factory.mdx, both checked against ensdomains/verifiable-factory `main` and the Sepolia ENSv2 beta deployment. 1. verifyContract is `(address proxy) returns (address implementation)`, not `(proxy, expectedImplementation) returns (bool)`. It returns the attested implementation and reverts with VerificationFailed(proxy) on failure. 2. predictProxyAddress built the wrong initcode: it appended abi.encode(factoryAddress, outerSalt) to an opaque proxyBytecode. The creation code (CloneProxyBytecode.creationCode) is the ERC-1167 runtime over proxyLogic() with the raw 32-byte outerSalt appended; the factory address is not part of it. The corrected snippet reproduces a live Sepolia deployment: predicted 0xeda43c6884FD83bbb7774F2e27B6e2d6fb97D282 == ProxyDeployed in tx 0x23c4f73bd438ca597e60cd07c2bfb9d1c1cec92eb42e6b6e18fc2873560f4ccf. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RNB6BYTHTTFPKdYbe1XMXp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two corrections to
src/pages/ensv2/verifiable-factory.mdx, found while building an ENSv2 plugin against the Sepolia beta. Both are checked againstensdomains/verifiable-factorymainand the deployed factory at0x10dC6333CDFe1FCEf624c6e0a8221b91804Cd7ef.1.
verifyContractsignatureThe page documents
verifyContract(address proxy, address expectedImplementation) → bool. The contract is:It returns the attested implementation, and reverts with
VerificationFailed(proxy)when the proxy is not a contract, does not implementgetVerifiableProxyData(), or the CREATE2 reconstruction does not match — it never returnsfalse. A caller wanting a specific implementation compares the returned address. (src/VerifiableFactory.sol,verifyContract.)2.
predictProxyAddresscomputes the wrong addressThe snippet builds
initCode = proxyBytecode ‖ abi.encode(factoryAddress, outerSalt). The actual creation code (src/CloneProxyBytecode.sol,creationCode(logic, salt)) is the ERC-1167 minimal-proxy runtime over the factory'sproxyLogic(), with the raw 32-byteouterSaltappended:The factory address is not part of the initcode, and the salt is appended raw rather than ABI-encoded — so the documented snippet yields an address that will never be deployed. The corrected snippet also takes
proxyLogic(read fromVerifiableFactory.proxyLogic()) instead of an opaqueproxyBytecode, and notes thatdeployermust be the eventualdeployProxycaller sinceouterSaltmixes inmsg.sender.Verification
The corrected formula reproduces a real deployment on Sepolia. For
deployer = owner = 0x0943142F488fb694141841bF46e17Be2bB5C7EE1with the documentedkeccak256("OwnedResolver", owner, 0)salt:0xeda43c6884FD83bbb7774F2e27B6e2d6fb97D282ProxyDeployed.proxyAddressin tx0x23c4f73b…560f4ccf:0xeda43c6884FD83bbb7774F2e27B6e2d6fb97D282verifyContract(0xeda43c…)→0x9EAe5C2730a7dD16BDD1DeE6421a1B91e3B0365e(PermissionedResolverImpl)The same construction matches the repo's own tested helper (
test/integration/fixtures/deployVerifiableProxy.ts) andscript/setup.ts.🤖 Generated with Claude Code