Upgradeability
The contract uses UUPS proxy pattern for safe upgrades.
Universal Upgradeable Proxy Standard. The upgrade logic lives in the implementation contract, not the proxy.
Benefits:
Upgrade logic can be removed permanently
User → Proxy → Implementation
↓
State
Proxy holds all state (balances, markets, positions)
Implementation holds all logic
Upgrades replace implementation, keep state
Current Implementation
Upgrade Process
New implementation deployed
Multisig proposes upgrade
Timelock period (48 hours)
Multisig executes upgrade
Proxy points to new implementation
Upgrades controlled by multisig:
No single person can upgrade unilaterally.
Safety Measures
New implementations must maintain storage layout:
Changing layout = corrupted state.
Can only be called once. Prevents re-initialization attacks.
Only owner (multisig) can authorize upgrades.
Renouncing Upgradeability
Future option: renounce upgrade capability permanently.
Once deployed, no more upgrades ever. Full immutability.