View Source: contracts/core/store/StoreBase.sol
↗ Extends: IStore, Pausable, Ownable ↘ Derived Contracts: Store
StoreBase
Constants & Variables
//public members
mapping(bytes32 => int256) public intStorage;
mapping(bytes32 => uint256) public uintStorage;
mapping(bytes32 => uint256[]) public uintsStorage;
mapping(bytes32 => address) public addressStorage;
mapping(bytes32 => mapping(address => bool)) public addressBooleanStorage;
mapping(bytes32 => string) public stringStorage;
mapping(bytes32 => bytes) public bytesStorage;
mapping(bytes32 => bytes32) public bytes32Storage;
mapping(bytes32 => bool) public boolStorage;
mapping(bytes32 => address[]) public addressArrayStorage;
mapping(bytes32 => mapping(address => uint256)) public addressArrayPositionMap;
mapping(bytes32 => bytes32[]) public bytes32ArrayStorage;
mapping(bytes32 => mapping(bytes32 => uint256)) public bytes32ArrayPositionMap;
mapping(address => bool) public pausers;
//private members
bytes32 private constant _NS_MEMBERS;
- constructor()
- setPausers(address[] accounts, bool[] statuses)
- recoverEther(address sendTo)
- recoverToken(address token, address sendTo)
- pause()
- unpause()
- isProtocolMember(address contractAddress)
- _throwIfPaused()
- _throwIfSenderNotProtocolMember()
function () internal nonpayable
Arguments
Name | Type | Description |
---|
Source Code
constructor() {
boolStorage[keccak256(abi.encodePacked(_NS_MEMBERS, msg.sender))] = true;
boolStorage[keccak256(abi.encodePacked(_NS_MEMBERS, address(this)))] = true;
}
Accepts a list of accounts and their respective statuses for addition or removal as pausers.
function setPausers(address[] accounts, bool[] statuses) external nonpayable onlyOwner whenNotPaused
Arguments
Name | Type | Description |
---|---|---|
accounts | address[] | |
statuses | bool[] |
Source Code
function setPausers(address[] calldata accounts, bool[] calldata statuses) external override onlyOwner whenNotPaused {
require(accounts.length > 0, "No pauser specified");
require(accounts.length == statuses.length, "Invalid args");
for (uint256 i = 0; i < accounts.length; i++) {
pausers[accounts[i]] = statuses[i];
}
emit PausersSet(msg.sender, accounts, statuses);
}
Recover all Ether held by the contract.
function recoverEther(address sendTo) external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
sendTo | address |
Source Code
function recoverEther(address sendTo) external onlyOwner {
// slither-disable-next-line low-level-calls
(bool success, ) = payable(sendTo).call{value: address(this).balance}(""); // solhint-disable-line avoid-low-level-calls
require(success, "Recipient may have reverted");
}
Recover all IERC-20 compatible tokens sent to this address.
function recoverToken(address token, address sendTo) external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|---|---|
token | address | IERC-20 The address of the token contract |
sendTo | address |
Source Code
function recoverToken(address token, address sendTo) external onlyOwner {
IERC20 erc20 = IERC20(token);
uint256 balance = erc20.balanceOf(address(this));
if (balance > 0) {
// slither-disable-next-line unchecked-transfer
erc20.safeTransfer(sendTo, balance);
}
}
Pauses the store
function pause() external nonpayable
Arguments
Name | Type | Description |
---|
Source Code
function pause() external {
require(pausers[msg.sender], "Forbidden");
super._pause();
}
Unpauses the store
function unpause() external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|
Source Code
function unpause() external onlyOwner {
super._unpause();
}
function isProtocolMember(address contractAddress) public view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
contractAddress | address |
Source Code
function isProtocolMember(address contractAddress) public view returns (bool) {
return boolStorage[keccak256(abi.encodePacked(_NS_MEMBERS, contractAddress))];
}
function _throwIfPaused() internal view
Arguments
Name | Type | Description |
---|
Source Code
function _throwIfPaused() internal view {
require(super.paused() == false, "Pausable: paused");
}
function _throwIfSenderNotProtocolMember() internal view
Arguments
Name | Type | Description |
---|
Source Code
function _throwIfSenderNotProtocolMember() internal view {
require(isProtocolMember(msg.sender), "Forbidden");
}
- 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