View Source: contracts/core/store/Store.sol
↗ Extends: StoreBase
Store
- setAddress(bytes32 k, address v)
- setAddressBoolean(bytes32 k, address a, bool v)
- setUint(bytes32 k, uint256 v)
- addUint(bytes32 k, uint256 v)
- subtractUint(bytes32 k, uint256 v)
- setUints(bytes32 k, uint256[] v)
- setString(bytes32 k, string v)
- setBytes(bytes32 k, bytes v)
- setBool(bytes32 k, bool v)
- setInt(bytes32 k, int256 v)
- setBytes32(bytes32 k, bytes32 v)
- setAddressArrayItem(bytes32 k, address v)
- deleteAddress(bytes32 k)
- deleteUint(bytes32 k)
- deleteUints(bytes32 k)
- deleteString(bytes32 k)
- deleteBytes(bytes32 k)
- deleteBool(bytes32 k)
- deleteInt(bytes32 k)
- deleteBytes32(bytes32 k)
- deleteAddressArrayItem(bytes32 k, address v)
- deleteAddressArrayItemByIndex(bytes32 k, uint256 i)
- getAddressValues(bytes32[] keys)
- getAddress(bytes32 k)
- getAddressBoolean(bytes32 k, address a)
- getUintValues(bytes32[] keys)
- getUint(bytes32 k)
- getUints(bytes32 k)
- getString(bytes32 k)
- getBytes(bytes32 k)
- getBool(bytes32 k)
- getInt(bytes32 k)
- getBytes32(bytes32 k)
- getAddressArray(bytes32 k)
- getAddressArrayItemPosition(bytes32 k, address toFind)
- getAddressArrayItemByIndex(bytes32 k, uint256 i)
- countAddressArrayItems(bytes32 k)
function setAddress(bytes32 k, address v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | address |
Source Code
function setAddress(bytes32 k, address v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
addressStorage[k] = v;
}
function setAddressBoolean(bytes32 k, address a, bool v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
a | address | |
v | bool |
Source Code
function setAddressBoolean(
bytes32 k,
address a,
bool v
) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
addressBooleanStorage[k][a] = v;
}
function setUint(bytes32 k, uint256 v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | uint256 |
Source Code
function setUint(bytes32 k, uint256 v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
uintStorage[k] = v;
}
function addUint(bytes32 k, uint256 v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | uint256 |
Source Code
function addUint(bytes32 k, uint256 v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
uint256 existing = uintStorage[k];
uintStorage[k] = existing + v;
}
function subtractUint(bytes32 k, uint256 v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | uint256 |
Source Code
function subtractUint(bytes32 k, uint256 v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
uint256 existing = uintStorage[k];
uintStorage[k] = existing - v;
}
function setUints(bytes32 k, uint256[] v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | uint256[] |
Source Code
function setUints(bytes32 k, uint256[] memory v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
uintsStorage[k] = v;
}
function setString(bytes32 k, string v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | string |
Source Code
function setString(bytes32 k, string calldata v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
stringStorage[k] = v;
}
function setBytes(bytes32 k, bytes v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | bytes |
Source Code
function setBytes(bytes32 k, bytes calldata v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
bytesStorage[k] = v;
}
function setBool(bytes32 k, bool v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | bool |
Source Code
function setBool(bytes32 k, bool v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
if (v) {
boolStorage[k] = v;
return;
}
delete boolStorage[k];
}
function setInt(bytes32 k, int256 v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | int256 |
Source Code
function setInt(bytes32 k, int256 v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
intStorage[k] = v;
}
function setBytes32(bytes32 k, bytes32 v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | bytes32 |
Source Code
function setBytes32(bytes32 k, bytes32 v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
bytes32Storage[k] = v;
}
function setAddressArrayItem(bytes32 k, address v) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | address |
Source Code
function setAddressArrayItem(bytes32 k, address v) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
if (addressArrayAddressPositionMap[k][v] == 0) {
addressArrayStorage[k].push(v);
addressArrayAddressPositionMap[k][v] = addressArrayStorage[k].length;
}
}
function deleteAddress(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteAddress(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete addressStorage[k];
}
function deleteUint(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteUint(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete uintStorage[k];
}
function deleteUints(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteUints(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete uintsStorage[k];
}
function deleteString(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteString(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete stringStorage[k];
}
function deleteBytes(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteBytes(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete bytesStorage[k];
}
function deleteBool(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteBool(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete boolStorage[k];
}
function deleteInt(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteInt(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete intStorage[k];
}
function deleteBytes32(bytes32 k) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function deleteBytes32(bytes32 k) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
delete bytes32Storage[k];
}
function deleteAddressArrayItem(bytes32 k, address v) public nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
v | address |
Source Code
function deleteAddressArrayItem(bytes32 k, address v) public override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
require(addressArrayAddressPositionMap[k][v] > 0, "Not found");
uint256 i = addressArrayAddressPositionMap[k][v] - 1;
uint256 count = addressArrayStorage[k].length;
if (i + 1 != count) {
addressArrayStorage[k][i] = addressArrayStorage[k][count - 1];
address theThenLastAddress = addressArrayStorage[k][i];
addressArrayAddressPositionMap[k][theThenLastAddress] = i + 1;
}
addressArrayStorage[k].pop();
delete addressArrayAddressPositionMap[k][v];
}
function deleteAddressArrayItemByIndex(bytes32 k, uint256 i) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
i | uint256 |
Source Code
function deleteAddressArrayItemByIndex(bytes32 k, uint256 i) external override {
_throwIfPaused();
_throwIfSenderNotProtocolMember();
require(i < addressArrayStorage[k].length, "Invalid index");
address v = addressArrayStorage[k][i];
deleteAddressArrayItem(k, v);
}
function getAddressValues(bytes32[] keys) external view
returns(values address[])
Arguments
Name | Type | Description |
---|---|---|
keys | bytes32[] |
Source Code
function getAddressValues(bytes32[] memory keys) external view override returns (address[] memory values) {
values = new address[](keys.length);
for (uint256 i = 0; i < keys.length; i++) {
values[i] = addressStorage[keys[i]];
}
}
function getAddress(bytes32 k) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getAddress(bytes32 k) external view override returns (address) {
return addressStorage[k];
}
function getAddressBoolean(bytes32 k, address a) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
a | address |
Source Code
function getAddressBoolean(bytes32 k, address a) external view override returns (bool) {
return addressBooleanStorage[k][a];
}
function getUintValues(bytes32[] keys) external view
returns(values uint256[])
Arguments
Name | Type | Description |
---|---|---|
keys | bytes32[] |
Source Code
function getUintValues(bytes32[] memory keys) external view override returns (uint256[] memory values) {
values = new uint256[](keys.length);
for (uint256 i = 0; i < keys.length; i++) {
values[i] = uintStorage[keys[i]];
}
}
function getUint(bytes32 k) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getUint(bytes32 k) external view override returns (uint256) {
return uintStorage[k];
}
function getUints(bytes32 k) external view
returns(uint256[])
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getUints(bytes32 k) external view override returns (uint256[] memory) {
return uintsStorage[k];
}
function getString(bytes32 k) external view
returns(string)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getString(bytes32 k) external view override returns (string memory) {
return stringStorage[k];
}
function getBytes(bytes32 k) external view
returns(bytes)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getBytes(bytes32 k) external view override returns (bytes memory) {
return bytesStorage[k];
}
function getBool(bytes32 k) external view
returns(bool)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getBool(bytes32 k) external view override returns (bool) {
return boolStorage[k];
}
function getInt(bytes32 k) external view
returns(int256)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getInt(bytes32 k) external view override returns (int256) {
return intStorage[k];
}
function getBytes32(bytes32 k) external view
returns(bytes32)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getBytes32(bytes32 k) external view override returns (bytes32) {
return bytes32Storage[k];
}
function getAddressArray(bytes32 k) external view
returns(address[])
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function getAddressArray(bytes32 k) external view override returns (address[] memory) {
return addressArrayStorage[k];
}
function getAddressArrayItemPosition(bytes32 k, address toFind) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
toFind | address |
Source Code
function getAddressArrayItemPosition(bytes32 k, address toFind) external view override returns (uint256) {
return addressArrayAddressPositionMap[k][toFind];
}
function getAddressArrayItemByIndex(bytes32 k, uint256 i) external view
returns(address)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 | |
i | uint256 |
Source Code
function getAddressArrayItemByIndex(bytes32 k, uint256 i) external view override returns (address) {
require(addressArrayStorage[k].length > i, "Invalid index");
return addressArrayStorage[k][i];
}
function countAddressArrayItems(bytes32 k) external view
returns(uint256)
Arguments
Name | Type | Description |
---|---|---|
k | bytes32 |
Source Code
function countAddressArrayItems(bytes32 k) external view override returns (uint256) {
return addressArrayStorage[k].length;
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- console
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundDaiDelegator
- 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
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceDiscovery
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NPM
- NPMDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- 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
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness