Skip to content

Commit

Permalink
Cosmetic (fix some private variable names).
Browse files Browse the repository at this point in the history
  • Loading branch information
barakman committed Jan 12, 2021
1 parent dd69a44 commit 78603a9
Showing 1 changed file with 15 additions and 15 deletions.
Expand Up @@ -21,9 +21,9 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
bytes32 public constant ROLE_SEEDER = keccak256("ROLE_SEEDER");
bytes32 public constant ROLE_OWNER = keccak256("ROLE_OWNER");

mapping(IDSToken => uint256) private _totalPoolAmount;
mapping(IDSToken => mapping(IERC20Token => uint256)) private _totalReserveAmount;
mapping(IDSToken => mapping(IERC20Token => mapping(address => uint256))) private _totalProviderAmount;
mapping(IDSToken => uint256) private _totalPoolAmounts;
mapping(IDSToken => mapping(IERC20Token => uint256)) private _totalReserveAmounts;
mapping(IDSToken => mapping(IERC20Token => mapping(address => uint256))) private _totalProviderAmounts;

mapping(address => EnumerableSet.AddressSet) private _providerPools;

Expand Down Expand Up @@ -66,9 +66,9 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
uint256 poolAmount,
uint256 reserveAmount
) external override ownerOnly {
_totalPoolAmount[poolToken] = _totalPoolAmount[poolToken].add(poolAmount);
_totalReserveAmount[poolToken][reserveToken] = _totalReserveAmount[poolToken][reserveToken].add(reserveAmount);
_totalProviderAmount[poolToken][reserveToken][provider] = _totalProviderAmount[poolToken][reserveToken][
_totalPoolAmounts[poolToken] = _totalPoolAmounts[poolToken].add(poolAmount);
_totalReserveAmounts[poolToken][reserveToken] = _totalReserveAmounts[poolToken][reserveToken].add(reserveAmount);
_totalProviderAmounts[poolToken][reserveToken][provider] = _totalProviderAmounts[poolToken][reserveToken][
provider
]
.add(reserveAmount);
Expand All @@ -91,9 +91,9 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
uint256 poolAmount,
uint256 reserveAmount
) external override ownerOnly {
_totalPoolAmount[poolToken] = _totalPoolAmount[poolToken].sub(poolAmount);
_totalReserveAmount[poolToken][reserveToken] = _totalReserveAmount[poolToken][reserveToken].sub(reserveAmount);
_totalProviderAmount[poolToken][reserveToken][provider] = _totalProviderAmount[poolToken][reserveToken][
_totalPoolAmounts[poolToken] = _totalPoolAmounts[poolToken].sub(poolAmount);
_totalReserveAmounts[poolToken][reserveToken] = _totalReserveAmounts[poolToken][reserveToken].sub(reserveAmount);
_totalProviderAmounts[poolToken][reserveToken][provider] = _totalProviderAmounts[poolToken][reserveToken][
provider
]
.sub(reserveAmount);
Expand Down Expand Up @@ -128,7 +128,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
* @return total amount of protected pool tokens
*/
function totalPoolAmount(IDSToken poolToken) external view override returns (uint256) {
return _totalPoolAmount[poolToken];
return _totalPoolAmounts[poolToken];
}

/**
Expand All @@ -139,7 +139,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
* @return total amount of protected reserve tokens
*/
function totalReserveAmount(IDSToken poolToken, IERC20Token reserveToken) external view override returns (uint256) {
return _totalReserveAmount[poolToken][reserveToken];
return _totalReserveAmounts[poolToken][reserveToken];
}

/**
Expand All @@ -155,7 +155,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
IERC20Token reserveToken,
address provider
) external view override returns (uint256) {
return _totalProviderAmount[poolToken][reserveToken][provider];
return _totalProviderAmounts[poolToken][reserveToken][provider];
}

/**
Expand Down Expand Up @@ -184,7 +184,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
function seedPoolAmounts(IDSToken[] calldata tokens, uint256[] calldata amounts) external seederOnly {
uint256 length = tokens.length;
for (uint256 i = 0; i < length; i++) {
_totalPoolAmount[tokens[i]] = amounts[i];
_totalPoolAmounts[tokens[i]] = amounts[i];
}
}

Expand All @@ -203,7 +203,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
) external seederOnly {
uint256 length = tokens.length;
for (uint256 i = 0; i < length; i++) {
_totalReserveAmount[tokens[i]][reserves[i]] = amounts[i];
_totalReserveAmounts[tokens[i]][reserves[i]] = amounts[i];
}
}

Expand All @@ -224,7 +224,7 @@ contract LiquidityProtectionStats is ILiquidityProtectionStats, AccessControl, U
) external seederOnly {
uint256 length = tokens.length;
for (uint256 i = 0; i < length; i++) {
_totalProviderAmount[tokens[i]][reserves[i]][providers[i]] = amounts[i];
_totalProviderAmounts[tokens[i]][reserves[i]][providers[i]] = amounts[i];
_providerPools[providers[i]].add(address(tokens[i]));
}
}
Expand Down

0 comments on commit 78603a9

Please sign in to comment.