Architecture
HyperFun Architecture
Overview
Code Layout
contracts/src/v3/individual/
├── HyperFunFactory.sol # Vault factory + global settings
├── HyperFunToken.sol # Core vault + ERC20 token + AMM
└── HyperFunTrading.sol # L1 trading moduleContract Architecture
Core Responsibilities
HyperFunFactory
Function
Description
HyperFunToken (VaultCore)
Category
Functions
HyperFunTrading
Category
Functions
UUPS Proxy Pattern
How It Works
Implementation Slots
Upgrade Authority
Contract
Who Can Upgrade
Deployment Flow
1. Deploy Factory
2. Create Vault
Fund Flow
Buy Flow
Sell Flow (Normal)
Sell Flow (Pending Sell)
Rebalance Flow
L1 Communication
CoreWriter Actions
Action Encoding Example
Precompiles (Read L1 State)
Address
Name
Returns
HIP-3 Support (V46)
What is HIP-3?
Why Special Functions?
HIP-3 Functions
Standard vs HIP-3 Comparison
Feature
Standard (< 100000)
HIP-3 (>= 100000)
Security Model
Roles
Role
Who
Permissions
Protections
Protection
Description
Access Control Modifiers
Contract Addresses
System Contracts
Contract
Address
Production Factory
Testing Factory
Global Settings Reference
Factory Defaults
Constants
Version History
Version
Changes
File Dependencies
Last updated