Pausing Mechanism
Where does pausing apply?
- Forges' functions, which could be from the most general (all forges), to the specific yield contract (with a forgeId, underlyingAsset, and expiry)
- Markets, which could be from the most general (all markets), to the specific market
- LiquidityMining contracts
Contract States
Contracts with pausing functionality will have 3 states:
- Normal — everything works per normal
- Paused — all functions will stop working, until unpaused
- Emergency Mode — the contracts must be paused first before reaching this state.
- For an affected yield contract, users can only call a function to withdraw their reasonable fund left in the contract
- For an affected market, users can only call a function to withdraw their reasonable fund left in the contract
PausingManager contract
There will be a PausingManager
contract to manage the pausing mechanism. The PausingManager points to 3 other contracts:
- ForgeEmergencyHandler — logic on how users could withdraw their fund from a forge
- MarketEmergencyHandler — logic on how users could withdraw their fund from a market
- LiquidityMiningHandler — logic on how users could withdraw their fund from a liquidity mining contract
These 3 addresses could be changed by the Governance Multisig (meaning the strategy for distributing the funds could be changed), with a timelock of 7 days to take into effect.
Pausing Admins
There are pausing admins
, who could trigger "paused" state for specific market/yield contract. The other things to note are:
- Only the Governance can unpause or trigger the emergency state for specific market/yield contract
- Governance could set/unset the pausing admins.
- Governance could change the ForgeEmergencyHandler, MarketEmergencyHandler and LiqMiningEmergencyHandler addresses, which would have a 7 day timelock before the change is executed.
- Governance could turn off the feature to pause/put into emergency forever
- Governance role could lock the addresses of theForgeEmergencyHandler and MarketEmergencyHandler, and LiqMiningEmergencyHandler contracts.