Skip to main content

BuilderFactory

Git Source

State Variables
​

OWNER
​

address public immutable OWNER

Functions
​

constructor
​

constructor(address owner) ;

onlyOwner
​

modifier onlyOwner() ;

_onlyOwner
​

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