Skip to main content

BuilderFactory (V2)

Source reference for public revision e3b9d12. For deployed configuration, select the pool's engine on the parameter page.

Git Source

State Variables
​

OWNER
​

address public immutable OWNER

Functions
​

constructor
​

Constructs a new BuilderFactory instance

Reverts if owner is the zero address

constructor(address owner) ;

Parameters

NameTypeDescription
owneraddressThe address that will have permission to deploy new builder wallets

onlyOwner
​

Modifier function to check if caller is the factory owner

modifier onlyOwner() ;

_onlyOwner
​

Internal function to check if caller is the factory owner

Reverts with "NOT_OWNER" if msg.sender is not the OWNER

function _onlyOwner() internal view;

deployBuilder
​

Deploys a BuilderWallet contract using CREATE2.

function deployBuilder(uint48 builderCode, address builderAdmin) external onlyOwner returns (address wallet);

Parameters

NameTypeDescription
builderCodeuint48The uint256 used as the CREATE2 salt (must match caller's referral code).
builderAdminaddressThe EOA/multisig allowed to sweep tokens from the wallet.

Returns

NameTypeDescription
walletaddressThe deployed wallet address (deterministic).

predictBuilderWallet
​

Computes the CREATE2 address for (builderCode, builderAdmin).

Must match the formula used in the RiskEngine.

function predictBuilderWallet(uint48 builderCode) external view returns (address);

Events
​

BuilderWalletDeployed
​

Emitted when a new builder wallet is deployed

event BuilderWalletDeployed(uint48 indexed builderCode, address indexed wallet, address indexed builderAdmin);

Parameters

NameTypeDescription
builderCodeuint48The builder code used as salt
walletaddressThe address of the deployed wallet
builderAdminaddressThe admin address for the wallet