Smart Contract Overview
고지 사항: 이 백서는 영어 버전이 공식 문서입니다. 다른 언어 버전은 참고용입니다。
Architecture
섹션 제목: “Architecture”┌─────────────────────────────────────────────────────────────────┐│ PIPO SMART CONTRACT ARCHITECTURE │├─────────────────────────────────────────────────────────────────┤│ ││ ┌─────────────────────────────────────────────────────────┐ ││ │ CORE CONTRACTS │ ││ ├─────────────────────────────────────────────────────────┤ ││ │ │ ││ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ ││ │ │ WarrantToken │ │ AMM Pool │ │ Settlement │ │ ││ │ │ Factory │ │ Factory │ │ Engine │ │ ││ │ └──────────────┘ └──────────────┘ └──────────────┘ │ ││ │ │ ││ │ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │ ││ │ │ Oracle │ │ Collateral │ │ Registry │ │ ││ │ │ Contract │ │ Vault │ │ Contract │ │ ││ │ └──────────────┘ └──────────────┘ └──────────────┘ │ ││ │ │ ││ └─────────────────────────────────────────────────────────┘ ││ ││ ┌─────────────────────────────────────────────────────────┐ ││ │ PERIPHERAL CONTRACTS │ ││ ├─────────────────────────────────────────────────────────┤ ││ │ Router │ Multicall │ Timelock │ ProxyAdmin │ Points │ ││ └─────────────────────────────────────────────────────────┘ ││ │└─────────────────────────────────────────────────────────────────┘Core Contracts
섹션 제목: “Core Contracts”WarrantToken
섹션 제목: “WarrantToken”// ERC-20 Extended for warrant-specific functionalitycontract PIPOWarrant is ERC20, ERC20Permit { string public underlying; // "SPACEX" WarrantType public warrantType; // CALL or PUT uint256 public strike; // Strike valuation uint256 public expiry; // Expiry timestamp uint256 public notional; // Notional per token ($1)
mapping(uint256 => Window) public exerciseWindows;
function exercise(uint256 amount) external; function isExercisable() external view returns (bool); function getIntrinsicValue() external view returns (uint256);}AMM Pool
섹션 제목: “AMM Pool”// Constant Product Market Makercontract PIPOPool { IERC20 public warrant; IERC20 public usdc;
uint256 public reserveWarrant; uint256 public reserveUsdc;
function swap( uint256 amountIn, uint256 amountOutMin, address tokenIn, address to, uint256 deadline ) external returns (uint256 amountOut);
function addLiquidity( uint256 amountWarrant, uint256 amountUsdc, uint256 minLpTokens ) external returns (uint256 lpTokens);
function removeLiquidity( uint256 lpTokens, uint256 minWarrant, uint256 minUsdc ) external returns (uint256, uint256);}Settlement Engine
섹션 제목: “Settlement Engine”// Handles exercise and settlementcontract PIPOSettlement { function submitExercise( address warrant, uint256 amount ) external returns (uint256 exerciseId);
function processSettlement( uint256 exerciseId ) external;
function calculatePayout( address warrant, uint256 amount, uint256 oraclePrice ) external view returns (uint256);}Oracle Contract
섹션 제목: “Oracle Contract”// Price oracle with committee governancecontract PIPOOracle { struct Price { uint256 valuation; uint256 timestamp; uint256 confidence; bytes32 sourceHash; }
mapping(string => Price) public prices; mapping(address => bool) public committee;
function updatePrice( string calldata underlying, uint256 valuation, bytes calldata signatures ) external;
function getPrice(string calldata underlying) external view returns (uint256);}Collateral Vault
섹션 제목: “Collateral Vault”// USDC vault for put warrant backingcontract PIPOVault { mapping(address => uint256) public deposits; // warrant => USDC
function deposit(address warrant, uint256 amount) external; function withdraw(address warrant, uint256 amount) external; function settle(address warrant, address to, uint256 amount) external; function verifyReserve(address warrant) external view returns (bool);}Deployment
섹션 제목: “Deployment”Network
섹션 제목: “Network”| Network | Purpose | Status |
|---|---|---|
| BSC | Primary deployment | Production |
| Base | Secondary deployment | Production |
| Testnet | Testing | Staging |
Addresses (Example)
섹션 제목: “Addresses (Example)”BSC Mainnet:├── WarrantFactory: 0x...├── PoolFactory: 0x...├── Settlement: 0x...├── Oracle: 0x...├── Vault: 0x...├── Router: 0x...└── Timelock: 0x...Security
섹션 제목: “Security”Audits
섹션 제목: “Audits”| Auditor | Scope | Status |
|---|---|---|
| [Firm 1] | Core contracts | Completed |
| [Firm 2] | Core contracts | Completed |
| [Firm 3] | Oracle/Settlement | Planned |
Security Features
섹션 제목: “Security Features”- Multi-sig admin (3/5)
- Timelock on upgrades (48h)
- Pausable contracts
- Reentrancy guards
- Access control (roles)
- Bug bounty program
Upgrades
섹션 제목: “Upgrades”Proxy Pattern
섹션 제목: “Proxy Pattern”Upgrade Process:├── Proposal submitted├── 48-hour timelock├── Multi-sig execution (3/5)├── New implementation deployed└── Proxy updatedEmergency Pause
섹션 제목: “Emergency Pause”Emergency Pause:├── Any pause role holder can trigger├── Immediate effect├── Requires 2/3 to unpause└── 72-hour max pause (then multi-sig review)