ContractsGuardedWallet

GuardedWallet

One GuardedWallet holds the USDC for one agent and runs every outgoing payment through its policy. It has no admin and cannot be upgraded. For a plain-language overview, see Wallets.

Agent functions

FunctionWhoWhat it does
executeUSDC(address to, uint256 amount, bytes reason)Agent signerAsks to pay. The policy decides allow, escalate, deny or freeze.

Owner functions

FunctionWhat it does
setPolicy(PolicyEnvelope nextPolicy)Replaces the policy and bumps its version.
addSigner(address) / removeSigner(address)Adds or removes an agent key.
configureEscalation(address[] signers, uint8 threshold, uint64 expirySeconds)Sets the approvers, how many must sign, and how long a held payment stays open.
cancelEscalation(bytes32 escalationId)Withdraws a held payment.
addVendor(address vendor, uint8 category, uint256 perVendorCap, bytes32 metadataHash)Approves a vendor.
blockVendor(address) / removeVendor(address)Blocks or removes a vendor.
freeze(bytes reason) / unfreeze()Stops or resumes all payments.
setAnomalyFreezeThresholdBps(uint256)Sets the risk score that can freeze the wallet.
rotateModule(bytes32 module, address newModule)Replaces a module. Setting the risk oracle to zero turns risk checks off.
withdrawUSDC(address to, uint256 amount)Withdraws USDC. Owner withdrawals skip the agent policy.
sweepNonUSDC(address token, address to, uint256 amount)Recovers other tokens sent by mistake. It can never move USDC.
transferOwnership(address) then acceptOwnership()Hands the wallet to a new owner in two steps.

Called by other contracts

FunctionCaller
executeEscalatedTransfer(bytes32 escalationId, address to, uint256 amount)EscalationManager only, after approval. Re-checks the policy before paying.
triggerFreeze(bytes reason)AnomalyOracle only.