View Source: contracts/core/ProtoBase.sol
↗ Extends: AccessControl, Pausable, Recoverable ↘ Derived Contracts: Protocol
ProtoBase
- constructor(IStore store)
- _setAccessPolicy()
- setupRole(bytes32 role, bytes32 adminRole, address account)
- pause()
- unpause()
function (IStore store) internal nonpayable Recoverable
Arguments
Name | Type | Description |
---|---|---|
store | IStore |
Source Code
constructor(IStore store) Recoverable(store) {
_setAccessPolicy();
}
function _setAccessPolicy() private nonpayable
Arguments
Name | Type | Description |
---|
Source Code
function _setAccessPolicy() private {
_setRoleAdmin(AccessControlLibV1.NS_ROLES_ADMIN, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_COVER_MANAGER, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_LIQUIDITY_MANAGER, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_GOVERNANCE_ADMIN, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_GOVERNANCE_AGENT, AccessControlLibV1.NS_ROLES_GOVERNANCE_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_UPGRADE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_RECOVERY_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_PAUSE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
_setRoleAdmin(AccessControlLibV1.NS_ROLES_UNPAUSE_AGENT, AccessControlLibV1.NS_ROLES_ADMIN);
_setupRole(AccessControlLibV1.NS_ROLES_ADMIN, msg.sender);
}
function setupRole(bytes32 role, bytes32 adminRole, address account) external nonpayable nonReentrant
Arguments
Name | Type | Description |
---|---|---|
role | bytes32 | |
adminRole | bytes32 | |
account | address |
Source Code
function setupRole(
bytes32 role,
bytes32 adminRole,
address account
) external nonReentrant {
s.mustNotBePaused();
AccessControlLibV1.mustBeAdmin(s);
_setRoleAdmin(role, adminRole);
if (account != address(0)) {
_setupRole(role, account);
}
}
Pauses this contract.
Individual protocol contracts infer to the protocol's "paused state".
So, if the protocol is paused, all other contracts are automatically
paused without having to do anything special.
In Neptune Mutual Protocol, pause
and unpause
features are
considered to have different risk exposures.
The pauser role is considered to be low-risk role while
the unpauser is believed to be highly critical.
In other words, pausing the protocol is believed to be less riskier than unpausing it.
The only (private) key that is ever allowed to be programmatically used is the
pause agents.
function pause() external nonpayable nonReentrant whenNotPaused
Arguments
Name | Type | Description |
---|
Source Code
function pause() external nonReentrant whenNotPaused {
AccessControlLibV1.mustBePauseAgent(s);
super._pause();
}
Unpauses or resumes this contract.
Individual protocol contracts infer to the protocol's "paused state".
So, if the protocol is paused, all other contracts are automatically
paused without having to do anything special.
In Neptune Mutual Protocol, pause
and unpause
features are
considered to have different risk exposures.
The pauser role is considered to be low-risk role while
the unpauser is believed to be highly critical.
In other words, pausing the protocol is believed to be less riskier than unpausing it.
The only (private) key that is ever allowed to be programmatically used is the
pause agents.
function unpause() external nonpayable nonReentrant whenPaused
Arguments
Name | Type | Description |
---|
Source Code
function unpause() external nonReentrant whenPaused {
AccessControlLibV1.mustBeUnpauseAgent(s);
super._unpause();
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundDaiDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundDaiDelegator
- Finalization
- ForceEther
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICompoundERC20DelegatorLike
- ICover
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- ILiquidityEngine
- IMember
- INeptuneRouterV1
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceOracle
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockLiquidityEngineUser
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NeptuneRouterV1
- NPM
- NpmDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- POT
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness