Core Components

This section outlines the foundational modules that power the Sova protocol. Each component is modular, extensible, and designed to integrate with DeFi standards and compliance requirements.

1. Registry

Purpose: Central contract for managing protocol registrations and deployments.

Key Functions:

function setStrategy(address implementation, bool allowed) external;
function setHook(address implementation, bool allowed) external;
function setAsset(address asset, bool allowed) external;
function deploy(address implementation, string memory name, string memory symbol, address asset, uint8 assetDecimals, address manager, bytes memory initData) external returns (address strategy, address token);
function isToken(address token) external view returns (bool);
function allTokens() external view returns (address[] memory);
function allStrategies() external view returns (address[] memory);

Access Control:

  • setStrategy: Requires STRATEGY_ADMIN

  • setHook: Requires RULES_ADMIN

  • setAsset: Requires PROTOCOL_ADMIN

  • deploy: Requires STRATEGY_OPERATOR

Errors:

  • ZeroAddress()

  • UnauthorizedAsset()

  • UnauthorizedStrategy()


2. Strategy

Purpose: Manages off-chain and on-chain asset flows.

Types:

  • BasicStrategy: Core abstraction

  • ReportedStrategy: Oracle-based valuation

  • GatedMintRWAStrategy: Includes approval flow for deposits

Core Functions (Basic):

Additional (ReportedStrategy):

Access Control:

  • Strategy functions: STRATEGY_ADMIN or STRATEGY_OPERATOR

Errors:

  • AlreadyInitialized()

  • InvalidAddress()

  • InvalidReporter()


3. tRWA Token

Purpose: ERC4626-compatible token representing user shares.

Types:

  • tRWA: Standard vault

  • GatedMintRWA: With escrow & two-phase minting

Key Functions:

GatedMint Functions:

Events:

  • Deposit, Withdraw, WithdrawalQueued

  • HookAdded, HookRemoved, HooksReordered

Errors:

  • HookCheckFailed(string)

  • WithdrawMoreThanMax()

  • NotStrategyAdmin()


4. Hooks & Rules Engine

Purpose: Extends the protocol with compliance logic and operational restrictions.

Types:

  • BaseHook: Abstract

  • KycRulesHook: KYC/AML enforcement

  • RulesEngine: Multi-rule aggregation

Hook Interfaces:

KYC Functions:

RulesEngine Functions:

Access Control:

  • KYC_OPERATOR, RULES_ADMIN

Errors:

  • ZeroAddress(), AddressAlreadyDenied(), InvalidArrayLength()


5. Reporters

Purpose: On-chain oracle system for asset price feeds.

Types:

  • BaseReporter: Abstract interface

  • PriceOracleReporter: Real-time oracle

Key Functions:

Access Control:

  • update: PRICE_UPDATER

  • setMaxDeviation: PROTOCOL_ADMIN

Errors:

  • StalePrice(), ExcessiveDeviation()


6. Role Manager

Purpose: Role-based permissions management.

Key Functions:

Role Constants:

Access Control:

  • setRoleAdmin: Requires PROTOCOL_ADMIN

  • Role management must be performed by an appropriate admin

Errors:

  • Unauthorized(), InvalidRole()

Last updated