SafeProxyFactory
The SafeProxyFactory
contract is used to deploy SafeProxy
contracts. The SafeProxyFactory
contract provides various functions to deploy a SafeProxy
contract which are given below.
The address of the proxy depends on the address of the SafeProxyFactory
contract, intializer
data, and the salt used to deploy the proxy.
Functions available to deploy a SafeProxy
contract
createProxyWithNonce
_10function createProxyWithNonce(address _singleton, bytes memory initializer, uint256 saltNonce) public returns (SafeProxy proxy);
Deploys a new proxy with the given singleton and nonce. Optionally executes a call to the new proxy. Emits ProxyCreation
event on successful proxy creation.
createChainSpecificProxyWithNonce
_10function createChainSpecificProxyWithNonce(address _singleton, bytes memory initializer, uint256 saltNonce) public returns (SafeProxy proxy);
Deploys a chain-specific proxy with _singleton
and saltNonce
, ensuring it cannot be replayed on other networks. Emits ProxyCreation
event on successful proxy creation.
createProxyWithCallback
_10function createProxyWithCallback(address _singleton, bytes memory initializer, uint256 saltNonce, IProxyCreationCallback callback) public returns (SafeProxy proxy);
Deploys a new proxy, executes an optional call to the proxy, and invokes a specified callback. Emits ProxyCreation
event on successful proxy creation.
Events
ProxyCreation
_10event ProxyCreation(SafeProxy indexed proxy, address singleton);
Emitted when a new proxy contract is successfully created.