-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Description
Problem:
Passing constructor args affect the initcode.
So if two contracts (e.g. Delegation and EntryPoint) wants to store the implementation of each other in immutable bytecode, this can't be done.
Solution:
- Make a registry that allows for:
// Always returns true on success. Replaces the existing value if one exists.
// If a value already exist, only it's creator can replace it.
function set(bytes32 key, bytes memory value) public returns (bool)
// Reverts if there's no `key`.
function get(bytes32 key) public view returns (bytes memory)
// Reverts if there's no `key`.
// Only the creator of a value can clear it.
function clear(bytes32 key) public returns (bool)This registry doesn't need to support compat.
As to why it only supports bytes, we believe it's generally cheaper to force devs to abi.encode and send it in a single call.
- Add these to LibTransient.
function registrySet(bytes32 key, bytes memory value) internal
function registryGet(bytes32 key) internal view returns (bytes memory)
function registryClear(bytes32 key) internal - Now that the contracts do not have constructor args anymore (can retrieve from the registry), it's initcode will be constant and this means its create2 address can be precomputed agnostic of any constructor args.
Metadata
Metadata
Assignees
Labels
No labels