Skip to content

reserve-protocol/universal-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reserve Universal Deployer

Minimal Solidity helpers for deploying contracts through Reserve's predeployed UniversalDeployer.

Install

pnpm add @reserve-protocol/universal-deployer

Contracts

  • contracts/UniversalDeployer.sol - deterministic CREATE2 deployer
  • contracts/DeployHelper.sol - library wrapper around the canonical deployer
  • contracts/SaltHelper.sol - salt construction helpers
  • contracts/interfaces/IUniversalDeployer.sol - deployer interface

The canonical deployer address used by DeployHelper is:

0x7A7371751Ccb2a38b0794182a1b812D054a5FB85

Usage

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors