Skip to content

Commit

Permalink
refactor: named return values in balances logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lekhovitsky committed Jun 2, 2023
1 parent 6c5051d commit 3f0d3f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions contracts/libraries/BalancesLogic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ library BalancesLogic {
/// @dev Compares current balances to previously saved expected balances.
/// @param creditAccount Credit Account to check
/// @param expected Expected balances after all operations
/// @return False if at least one balance is lower than expected, true otherwise
function compareBalances(address creditAccount, Balance[] memory expected) internal view returns (bool) {
/// @return success False if at least one balance is lower than expected, true otherwise
function compareBalances(address creditAccount, Balance[] memory expected) internal view returns (bool success) {
uint256 len = expected.length;
unchecked {
for (uint256 i = 0; i < len; ++i) {
Expand Down Expand Up @@ -90,14 +90,14 @@ library BalancesLogic {
/// @param enabledTokensMaskAfter Mask of enabled tokens on the account after operations
/// @param forbiddenBalances Array of balances of forbidden tokens (received from `storeForbiddenBalances`)
/// @param forbiddenTokenMask Mask of forbidden tokens
/// @return False if new forbidden tokens were enabled or balance of at least one forbidden token has increased, true otherwise
/// @return success False if new forbidden tokens were enabled or balance of at least one forbidden token has increased, true otherwise
function checkForbiddenBalances(
address creditAccount,
uint256 enabledTokensMaskBefore,
uint256 enabledTokensMaskAfter,
BalanceWithMask[] memory forbiddenBalances,
uint256 forbiddenTokenMask
) internal view returns (bool) {
) internal view returns (bool success) {
uint256 forbiddenTokensOnAccount = enabledTokensMaskAfter & forbiddenTokenMask;
if (forbiddenTokensOnAccount == 0) return true; // U:[BLL-4]

Expand Down

0 comments on commit 3f0d3f4

Please sign in to comment.