Minimal Solidity helpers for deploying contracts through Reserve's predeployed
UniversalDeployer.
pnpm add @reserve-protocol/universal-deployercontracts/UniversalDeployer.sol- deterministicCREATE2deployercontracts/DeployHelper.sol- library wrapper around the canonical deployercontracts/SaltHelper.sol- salt construction helperscontracts/interfaces/IUniversalDeployer.sol- deployer interface
The canonical deployer address used by DeployHelper is:
0x7A7371751Ccb2a38b0794182a1b812D054a5FB85
import { DeployHelper } from "@reserve-protocol/universal-deployer/contracts/DeployHelper.sol";
import { SaltHelper } from "@reserve-protocol/universal-deployer/contracts/SaltHelper.sol";
bytes32 salt = SaltHelper.getSaltUniversal(address(this));
address deployed = DeployHelper.createDeployment(salt, initCode, initializer);To forward ETH to the initializer, use the overload with an explicit value:
address deployed = DeployHelper.createDeployment(salt, initCode, initializer, msgValue);Salts must encode the calling contract address in the first 20 bytes, matching
the validation performed by UniversalDeployer.