Apex Docs
  • Overview
  • How it works
    • The Basics of Perpetual Futures and Perpetual Protocol
    • APEX Limit Order Design
    • Comparison with order book exchanges
  • User Guide
    • Add xDai Chain to Your Wallet
    • Acquiring xDAI tokens
    • Getting USDC on xDai
    • Interacting with xDai
    • Spawn your smart wallet
    • Funding your smart wallet
    • Approve Spend
    • Fees
    • Creating Orders
      • Creating Limit orders
  • Order Types
    • Understanding Slippage
    • Market Orders
    • Limit Orders
    • Stop Orders
      • Stop Market
      • Stop Limit
      • Stop Market vs Stop Limit
      • Trailing Stop Orders
  • Developer Guide
    • Smart Contracts
      • Limit Order Book
      • Smart Wallet Factory
      • Smart Wallet
    • Keeper Bots
      • Overview
      • Running your own bot
      • Documentation
Powered by GitBook
On this page
  • Functions
  • spawn
  • Whitelist

Was this helpful?

  1. Developer Guide
  2. Smart Contracts

Smart Wallet Factory

PreviousLimit Order BookNextSmart Wallet

Last updated 4 years ago

Was this helpful?

The SmartWalletFactory is deployed on xDai at 0x68410B166Deb9AB9Aff99d3efFE32bd2940c84eA

The source code can be found at

Functions

spawn

function spawn()

This function is called by users to generate a smart wallet. The smart wallet is a new contract that will be deployed. The user that calls this function will become the owner of the smart wallet.

It is not possible for users to spawn multiple smart wallets.

It is possible to get the address of a users smart wallet by calling getSmartWallet(address)

Whitelist

function addToWhitelist(address _contract)
function removeFromWhitelist(address _contract)

These functions can only be called by the apex team. Smart wallets are only able to interact with whitelisted contracts.

SmartWallet.sol