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 addressArrayAddressPositionMap;
//private members
bytes32 private constant _NS_MEMBERS;
- constructor()
- 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;
}
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 {
// @suppress-pausable Can only be called by the owner
// @suppress-reentrancy Can only be called by the owner
// slither-disable-next-line arbitrary-send
payable(sendTo).transfer(address(this).balance);
}
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 {
// @suppress-pausable Can only be called by the owner
// @suppress-reentrancy Can only be called by the owner
// @suppress-address-trust-issue Although the token can't be trusted, the owner has to check the token code manually.
IERC20 erc20 = IERC20(token);
uint256 balance = erc20.balanceOf(address(this));
require(erc20.transfer(sendTo, balance), "Transfer failed");
}
function pause() external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|
Source Code
function pause() external onlyOwner {
// @suppress-reentrancy Can only be called by the owner
super._pause();
}
function unpause() external nonpayable onlyOwner
Arguments
Name | Type | Description |
---|
Source Code
function unpause() external onlyOwner {
// @suppress-reentrancy Can only be called by the owner
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(), "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
- 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