Wallet Factory
Sequence Wallets are created using the Factory contract, when called it creates child MinimalUpgradeableProxies contracts, which are in essence the "boot" code of all Sequence wallets.
Factory API
deploy
function deploy(
address _mainModule,
bytes32 _salt
) public payable returns (address _contract)
Creates a child MinimalUpgradeableProxy using CREATE2, the proxy initially points to the provided _mainModule
.
No initialize code is executed.
Parameters:
Name | Type | Description |
---|---|---|
_mainModule | address | Initial implementation for the new proxy contract, expected to point to a valid Sequence wallet implementation with support for counter-factual initialization. |
_salt | bytes32 | Arbitrary value to be used as create2 salt. Sequence's mainModule uses the salt to obtain a hash with the initial configuration for the wallet (See ImageHash). |
Return Values:
Name | Type | Description |
---|---|---|
_contract | address | Address of the created proxy contract. |
Counter factual addresses
Sequence wallets are counter-factual by design, this means that the wallet's address can be known before the wallet is deployed; any two combinations of the mainModule
and salt
values will result in the same wallet address.
This property alongside the use of NanoUniversalDeployer or UniversalDeployer is the reason why Sequence wallets can obtain the same address on multiple chains.