Skip to main content

Smart Contracts Overview

All ZibaXeer contracts are written in Solidity ^0.8.20 and deployed on HyperPaxeer (Chain ID 125). Every core contract uses the OpenZeppelin UUPS Proxy pattern — upgradeable via governance with no storage collisions.

Contract Registry

VaultFactory

Deploys and registers new CopyTradingVault proxies. Entry point for all vault creation. UUPS Upgradeable.

CopyTradingVault

Core vault — trade execution, follower management, and PnL settlement. UUPS Upgradeable.

VaultRegistry

Central on-chain directory of all officially deployed vaults. UUPS Upgradeable.

RiskManager

Enforces risk constraints and integrates Argus Oracle for reputation gating. UUPS Upgradeable.

RevenueSplitter

Calculates and distributes realized PnL between followers, leaders, and the protocol. UUPS Upgradeable.

ArgusOracle

On-chain bridge to the Paxeer Argus reputation scoring engine. UUPS Upgradeable.

PaxDexAdapter

Abstracts swap routing through the PaxDex Router. Non-upgradeable.

ZibaXeerToken

Protocol governance and utility token. Non-upgradeable.

Upgrade Pattern

All UUPS upgrades must go through a multi-sig wallet (e.g. Gnosis Safe) in production. Never call upgradeToAndCall directly from a single EOA.
All upgradeable contracts follow the UUPS pattern from OpenZeppelin:
// All core contracts inherit this pattern
contract VaultFactory is Initializable, OwnableUpgradeable, UUPSUpgradeable {

    /// @custom:oz-upgrades-unsafe-allow constructor
    constructor() {
        _disableInitializers(); // Prevents direct implementation initialization
    }

    function initialize(address initialOwner, ...) initializer public {
        __Ownable_init(initialOwner);
        // ...
    }

    function _authorizeUpgrade(address newImplementation)
        internal onlyOwner override {}
}
The ERC1967Proxy is used for all proxy deployments. The implementation address is stored in the standard EIP-1967 slot.

Protocol Dependency Order

Deploy contracts in this order to satisfy constructor dependencies:
1. ArgusOracle
2. RiskManager        (needs ArgusOracle)
3. VaultRegistry
4. RevenueSplitter
5. PaxDexAdapter      (needs PaxDex Router address)
6. CopyTradingVault   (implementation only — no init)
7. VaultFactory       (needs VaultRegistry, RiskManager, CopyTradingVault impl)

Detailed Documentation