Skip to Content
KryptWarden Developers
Smart contracts

Factory contract

KryptWardenFactory deploys wallets and keeps a registry of them.

Testnet ID: CBZF662RUYLPS3UCSRQ2XJHMF6YMFZKHBUXHAIDRYNDAAUXWAGEV5XPR

Functions

FunctionAuthReturnsNotes
deploy_wallet(owner: Address, salt: BytesN<32>)ownerAddressDeploys a wallet from the current WASM hash, with owner and the factory's USDC token
get_wallets_by_owner(owner: Address)noneVec<Address>Every wallet deployed for this owner, oldest first
get_all_wallets()noneVec<Address>Every wallet the factory has deployed
get_wallet_wasm_hash()noneBytesN<32>The code new wallets get
get_usdc_token()noneAddressThe USDC contract wallets are tied to
set_wallet_wasm_hash(new_wasm_hash)factory admin()Affects future deployments only; existing wallets upgrade themselves

The wallet's address is derived from sha256(owner XDR ‖ salt), so two owners using the same salt never collide. Use fresh random bytes for each wallet.

Events

EventFields
WalletDeployedowner, wallet
WalletWasmUpdatednew_wasm_hash

Errors

CodeName
200NotInitialized
201RenounceDisabled

Example

stellar contract invoke --network testnet --source owner \
  --id CBZF662RUYLPS3UCSRQ2XJHMF6YMFZKHBUXHAIDRYNDAAUXWAGEV5XPR \
  -- deploy_wallet --owner G...your-address --salt $(openssl rand -hex 32)

For a TypeScript version, see Create a wallet.

On this page