コンテンツにスキップ

Smart Contract Overview

免責事項: このホワイトペーパーは英語版が正式な文書となります。他言語の翻訳は参照用です。


┌─────────────────────────────────────────────────────────────────┐
│ 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 │ │
│ └─────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

// ERC-20 Extended for warrant-specific functionality
contract 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);
}
// Constant Product Market Maker
contract 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);
}
// Handles exercise and settlement
contract 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);
}
// Price oracle with committee governance
contract 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);
}
// USDC vault for put warrant backing
contract 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);
}

NetworkPurposeStatus
BSCPrimary deploymentProduction
BaseSecondary deploymentProduction
TestnetTestingStaging
BSC Mainnet:
├── WarrantFactory: 0x...
├── PoolFactory: 0x...
├── Settlement: 0x...
├── Oracle: 0x...
├── Vault: 0x...
├── Router: 0x...
└── Timelock: 0x...

AuditorScopeStatus
[Firm 1]Core contractsCompleted
[Firm 2]Core contractsCompleted
[Firm 3]Oracle/SettlementPlanned
  • Multi-sig admin (3/5)
  • Timelock on upgrades (48h)
  • Pausable contracts
  • Reentrancy guards
  • Access control (roles)
  • Bug bounty program

Upgrade Process:
├── Proposal submitted
├── 48-hour timelock
├── Multi-sig execution (3/5)
├── New implementation deployed
└── Proxy updated
Emergency Pause:
├── Any pause role holder can trigger
├── Immediate effect
├── Requires 2/3 to unpause
└── 72-hour max pause (then multi-sig review)