View Source: contracts/core/governance/resolution/Resolvable.sol
↗ Extends: Finalization, IResolvable ↘ Derived Contracts: Unstakable
Resolvable
Enables governance agents to resolve a contract undergoing reporting. Provides a cool-down period of 24-hours during when governance admins can perform emergency resolution to defend against governance attacks.
- resolve(bytes32 key, uint256 incidentDate)
- emergencyResolve(bytes32 key, uint256 incidentDate, bool decision)
- _resolve(bytes32 key, uint256 incidentDate, bool decision, bool emergency)
function resolve(bytes32 key, uint256 incidentDate) external nonpayable nonReentrant
Arguments
Name | Type | Description |
---|---|---|
key | bytes32 | |
incidentDate | uint256 |
Source Code
function resolve(bytes32 key, uint256 incidentDate) external override nonReentrant {
s.mustNotBePaused();
AccessControlLibV1.mustBeGovernanceAgent(s);
s.mustBeReportingOrDisputed(key);
s.mustBeValidIncidentDate(key, incidentDate);
s.mustBeAfterReportingPeriod(key);
bool decision = s.getCoverStatus(key) == CoverUtilV1.CoverStatus.IncidentHappened;
_resolve(key, incidentDate, decision, false);
}
function emergencyResolve(bytes32 key, uint256 incidentDate, bool decision) external nonpayable nonReentrant
Arguments
Name | Type | Description |
---|---|---|
key | bytes32 | |
incidentDate | uint256 | |
decision | bool |
Source Code
function emergencyResolve(
bytes32 key,
uint256 incidentDate,
bool decision
) external override nonReentrant {
s.mustNotBePaused();
AccessControlLibV1.mustBeGovernanceAdmin(s);
s.mustBeValidIncidentDate(key, incidentDate);
s.mustBeAfterReportingPeriod(key);
_resolve(key, incidentDate, decision, true);
}
function _resolve(bytes32 key, uint256 incidentDate, bool decision, bool emergency) private nonpayable
Arguments
Name | Type | Description |
---|---|---|
key | bytes32 | |
incidentDate | uint256 | |
decision | bool | |
emergency | bool |
Source Code
function _resolve(
bytes32 key,
uint256 incidentDate,
bool decision,
bool emergency
) private {
CoverUtilV1.CoverStatus status = decision ? CoverUtilV1.CoverStatus.Claimable : CoverUtilV1.CoverStatus.FalseReporting;
uint256 claimBeginsFrom = 0; // solhint-disable-line
uint256 claimExpiresAt = 0;
if (decision) {
claimBeginsFrom = block.timestamp + 24 hours; // solhint-disable-line
claimExpiresAt = claimBeginsFrom + s.getClaimPeriod();
s.setUintByKeys(ProtoUtilV1.NS_CLAIM_BEGIN_TS, key, claimBeginsFrom);
s.setUintByKeys(ProtoUtilV1.NS_CLAIM_EXPIRY_TS, key, claimExpiresAt);
}
s.setStatus(key, status);
s.updateStateAndLiquidity(key);
emit Resolved(key, incidentDate, decision, emergency, claimBeginsFrom, claimExpiresAt);
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Controller
- Cover
- CoverBase
- CoverLibV1
- CoverProvision
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundERC20Delegator
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- Finalization
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICommission
- ICompoundERC20DelegatorLike
- ICover
- ICoverProvision
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- IMember
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceDiscovery
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- Migrations
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockStore
- MockVault
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PriceDiscovery
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- WithFlashLoan
- Witness