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.
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.
function createDeterministicWallet(address signer) external returns (address)
function getAddress(address signer) external view returns (address)Choosing a Wallet Type
| Type | Use Case | Signature Type |
|---|---|---|
| EOA | Direct wallet trading | EOA |
| Proxy | Embedded wallet, lower gas | POLY_PROXY |
| Safe | Multi-sig capable, more features | POLY_GNOSIS_SAFE |
Approval Setup
After deploying a wallet, approvals must be set for the exchange to interact with the wallet's tokens:
forge script script/SetupWalletApprovals.s.sol:SetupWalletApprovals \
--rpc-url $RPC_URL --broadcastThis sets:
- ERC-20 collateral approval for the exchange
- ERC-1155 conditional token approval for the exchange