A system for deploying and verifying proxy contracts with predictable storage layouts and deterministic addresses using CREATE2.
- Deploys TransparentVerifiableProxy instances using CREATE2 opcode
- Handles on-chain verification of deployed proxies
- Manages proxy upgrades through a secure ownership model
- Uses deterministic salt generation for predictable addresses
- Transparent proxy pattern with verified storage layout
- Fixed storage slots:
- Slot 0:
salt
(uint256) - Slot 1:
owner
(address)
- Slot 0:
- Immutable
creator
field (set in bytecode) - Implements secure upgrade mechanism
- Initializable to prevent implementation tampering
sequenceDiagram
participant User
participant VerifiableFactory
participant TransparentVerifiableProxy
participant Implementation
%% Deployment Flow
User->>VerifiableFactory: deployProxy(implementation, salt)
VerifiableFactory->>VerifiableFactory: Generate outerSalt (keccak256(sender, salt))
VerifiableFactory->>TransparentVerifiableProxy: CREATE2 deployment
TransparentVerifiableProxy->>TransparentVerifiableProxy: Set immutable creator
VerifiableFactory->>TransparentVerifiableProxy: initialize(salt, owner, implementation)
TransparentVerifiableProxy->>Implementation: Delegate calls
VerifiableFactory->>User: Return proxy address
%% Verification Flow
User->>VerifiableFactory: verifyContract(proxyAddress)
VerifiableFactory->>TransparentVerifiableProxy: Check contract existence
VerifiableFactory->>TransparentVerifiableProxy: Query salt and creator
VerifiableFactory->>VerifiableFactory: Reconstruct CREATE2 address
VerifiableFactory->>User: Return verification result
%% Upgrade Flow
User->>VerifiableFactory: upgradeImplementation(proxy, newImpl, data)
VerifiableFactory->>TransparentVerifiableProxy: Check caller is owner
VerifiableFactory->>TransparentVerifiableProxy: upgradeToAndCall(newImpl, data)
TransparentVerifiableProxy->>Implementation: Switch delegation target