Skip to content

Wallets

The platform supports deterministic wallet deployment for embedded wallet experiences. Traders can use proxy or safe wallets that are deployed to deterministic addresses based on the signer.

Deterministic Wallet

The DeterministicWallet contract is the implementation behind both proxy and safe wallet types. It's a signer-owned wallet that can execute arbitrary calls and is designed for trading through the CTFExchange.

Key features:

  • Owner (signer) can execute calls through the wallet
  • Supports ERC-1155 token receiving
  • Deterministic address based on signer + factory

Proxy Factory

The PolyProxyFactory deploys minimal proxy wallets (EIP-1167 clones) pointing to the DeterministicWallet implementation.

solidity
function createDeterministicWallet(address signer) external returns (address)
function getAddress(address signer) external view returns (address)

The wallet address is deterministic — you can predict it before deployment using getAddress.

Safe Factory

The PolySafeFactory deploys Gnosis Safe-style wallets with the DeterministicWallet as the master copy.

solidity
function createDeterministicWallet(address signer) external returns (address)
function getAddress(address signer) external view returns (address)

Choosing a Wallet Type

TypeUse CaseSignature Type
EOADirect wallet tradingEOA
ProxyEmbedded wallet, lower gasPOLY_PROXY
SafeMulti-sig capable, more featuresPOLY_GNOSIS_SAFE

Approval Setup

After deploying a wallet, approvals must be set for the exchange to interact with the wallet's tokens:

bash
forge script script/SetupWalletApprovals.s.sol:SetupWalletApprovals \
  --rpc-url $RPC_URL --broadcast

This sets:

  • ERC-20 collateral approval for the exchange
  • ERC-1155 conditional token approval for the exchange