create3-proxy
v0.1.4
Published
Create3 deterministic addresses for Upgradeable Proxies
Downloads
3
Readme
CREATE3 for Upgradeable Proxies
A Solidity library for deploying upgradeable proxies using the CREATE3 pattern, enabling deterministic addresses across different chains without relying on nonces or code.
Overview
CREATE3 Proxy combines the power of CREATE3 for deterministic contract deployment with the upgradeability of UUPS (Universal Upgradeable Proxy Standard) proxies. This library allows developers to deploy upgradeable contracts to the same address across multiple networks, simplifying cross-chain development and management.
Features
- Deterministic addresses across different chains
- UUPS (ERC1967) proxy pattern for upgradeability
- Gas-efficient deployment using CREATE3
- Easy-to-use interface for deploying proxies
Installation
Install with Foundry:
forge install bandohq/create3-proxy
Install with npm:
npm i create3-proxy
Install with yarn:
yarn add create3-proxy
Usage
To use the library in your project, follow these steps:
Deploy a UUPS (ERC1967) Proxy
- Import the library into your contract:
import "create3-proxy/src/CREATE3UUPSProxy.sol";
- Deploy using your implementation contract:
bytes32 salt = keccak256("my_proxy");
bytes memory creationCode = type(MyUUPSContract).creationCode;
bytes memory initializerData = abi.encodeWithSignature("myInitialize(uint256)", initialValue);
address proxy = CREATE3UUPSProxy.deploy(salt, creationCode, initializerData);
Contributing
We welcome contributions to this library. Please open an issue or submit a pull request. Read more on our contributing guidelines.
Code of Conduct
We have a code of conduct that we expect all contributors to adhere to.
Building from source
forge build
Test
forge test