Skip to main content

BuilderWallet (V2)

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

Git Source

State Variables
​

BUILDER_FACTORY
​

address public immutable BUILDER_FACTORY

builderAdmin
​

address public builderAdmin

Functions
​

constructor
​

Constructs a new BuilderWallet instance

constructor(address builderFactory) ;

Parameters

NameTypeDescription
builderFactoryaddressThe address of the BuilderFactory contract that deployed this wallet

init
​

Initializes the builder wallet with a builder admin address

Can only be called once. Reverts if already initialized or if _builderAdmin is the zero address

function init(address _builderAdmin) external;

Parameters

NameTypeDescription
_builderAdminaddressThe address that will be set as the builder admin with permission to sweep tokens

sweep
​

Transfers all tokens of a given type from this wallet to a specified address

Only callable by the builder admin. Emits TokensSwept event even if balance is zero

function sweep(address token, address to) external;

Parameters

NameTypeDescription
tokenaddressThe address of the token to sweep from the wallet
toaddressThe destination address to receive the swept tokens

execute
​

Executes an arbitrary call from this wallet

Only callable by the builder admin

function execute(address target, uint256 value, bytes calldata data) external returns (bytes memory result);

Parameters

NameTypeDescription
targetaddressThe address to call
valueuint256The amount of ETH to send with the call
databytesThe calldata to send to the target

Returns

NameTypeDescription
resultbytesThe return data from the call

isValidSignature
​

Validates a signature according to ERC-1271

Handles both EOA and smart contract admins via SignatureChecker

function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4);

Parameters

NameTypeDescription
hashbytes32The hash of the data being signed
signaturebytesThe signature bytes

Returns

NameTypeDescription
<none>bytes4magicValue 0x1626ba7e if valid, 0xffffffff if invalid

receive
​

Allows the wallet to receive ETH

receive() external payable;

Events
​

BuilderWalletInitialized
​

Emitted when the builder wallet is initialized

event BuilderWalletInitialized(address indexed builderAdmin);

Parameters

NameTypeDescription
builderAdminaddressThe address of the builder admin

TokensSwept
​

Emitted when tokens are swept from the wallet

event TokensSwept(address indexed token, address indexed to, uint256 amount);

Parameters

NameTypeDescription
tokenaddressThe address of the token swept
toaddressThe address that received the tokens
amountuint256The amount of tokens swept

Executed
​

Emitted when a call is executed from the wallet

event Executed(address indexed target, uint256 value, bytes data);

Parameters

NameTypeDescription
targetaddressThe address of the contract called
valueuint256The amount of ETH sent with the call
databytesThe calldata sent to the target