Deploys a new SmartWallet for the given EVM address.
The wallet will be deployed at a deterministic address based on the EVM address. If a wallet already exists at that address, this will fail.
owner_evm_address - The 20-byte Ethereum address that will own the walletThe address of the deployed SmartWallet
fn deploy(
env: soroban_sdk::Env,
owner_evm_address: soroban_sdk::BytesN<20>,
) -> soroban_sdk::Address
Returns the configured policy address.
Panics with FactoryError::PolicyNotSet if policy is not configured.
fn get_policy(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns the configured verifier address.
Panics with FactoryError::VerifierNotSet if verifier is not configured.
fn get_verifier(env: soroban_sdk::Env) -> soroban_sdk::Address
Initializes the factory with the necessary configuration.
wallet_wasm_hash - The WASM hash of the SmartWallet contractsecp256k1_verifier - Address of the deployed Secp256k1Verifierdefindex_policy - Address of the deployed DeFindexPolicydefault_wasm_hashes - Default allowed WASM hashes for new walletsfn __constructor(
env: soroban_sdk::Env,
wallet_wasm_hash: soroban_sdk::BytesN<32>,
secp256k1_verifier: soroban_sdk::Address,
defindex_policy: soroban_sdk::Address,
default_wasm_hashes: soroban_sdk::Vec>,
)
Calculates the deterministic address for a wallet based on EVM address.
This can be called before deployment to know where the wallet will be. Useful for pre-funding the wallet address before deployment.
owner_evm_address - The 20-byte Ethereum addressThe Stellar address where the wallet will be deployed
fn calculate_address(
env: soroban_sdk::Env,
owner_evm_address: soroban_sdk::BytesN<20>,
) -> soroban_sdk::Address
Deploys a wallet with custom configuration.
Allows specifying custom verifier, policy, and WASM hashes instead of using the factory defaults.
owner_evm_address - The 20-byte Ethereum addresssecp256k1_verifier - Custom verifier addressdefindex_policy - Custom policy addresswasm_hashes - Custom allowed WASM hashesfn deploy_with_config(
env: soroban_sdk::Env,
owner_evm_address: soroban_sdk::BytesN<20>,
secp256k1_verifier: soroban_sdk::Address,
defindex_policy: soroban_sdk::Address,
wasm_hashes: soroban_sdk::Vec>,
) -> soroban_sdk::Address
Returns the configured wallet WASM hash.
Panics with FactoryError::NotInitialized if factory is not initialized.
fn get_wallet_wasm_hash(env: soroban_sdk::Env) -> soroban_sdk::BytesN<32>
Returns the default WASM hashes
fn get_default_wasm_hashes(
env: soroban_sdk::Env,
) -> soroban_sdk::Vec>