From 5e660bffec987b3d31aba3f11b5c4e35f689f646 Mon Sep 17 00:00:00 2001 From: 0xLucian <0xluciandev@gmail.com> Date: Wed, 11 Oct 2023 12:29:54 +0300 Subject: [PATCH] fix: format code --- contracts/Comptroller.sol | 99 +++----------- contracts/ComptrollerInterface.sol | 25 +--- contracts/ExponentialNoError.sol | 6 +- contracts/Lens/PoolLens.sol | 50 +++---- contracts/Pool/PoolRegistry.sol | 6 +- contracts/Rewards/RewardsDistributor.sol | 12 +- contracts/RiskFund/ProtocolShareReserve.sol | 14 +- contracts/RiskFund/RiskFund.sol | 10 +- contracts/Shortfall/Shortfall.sol | 6 +- contracts/VToken.sol | 63 ++------- contracts/VTokenInterfaces.sol | 29 +--- contracts/WhitePaperInterestRateModel.sol | 6 +- contracts/lib/ApproveOrRevert.sol | 6 +- contracts/lib/TokenDebtTracker.sol | 18 +-- contracts/test/ERC20.sol | 44 +----- contracts/test/EvilToken.sol | 6 +- contracts/test/FaucetToken.sol | 12 +- contracts/test/FeeToken.sol | 6 +- contracts/test/MockDeflationaryToken.sol | 18 +-- contracts/test/Mocks/MockPancakeSwap.sol | 128 ++++-------------- contracts/test/Mocks/MockToken.sol | 6 +- contracts/test/SafeMath.sol | 30 +--- contracts/test/VTokenHarness.sol | 24 +--- contracts/test/lib/ApproveOrRevertHarness.sol | 6 +- .../test/lib/TokenDebtTrackerHarness.sol | 12 +- 25 files changed, 134 insertions(+), 508 deletions(-) diff --git a/contracts/Comptroller.sol b/contracts/Comptroller.sol index 9d2de5830..eb473cded 100644 --- a/contracts/Comptroller.sol +++ b/contracts/Comptroller.sol @@ -269,11 +269,7 @@ contract Comptroller is * @custom:error SupplyCapExceeded error is thrown if the total supply exceeds the cap after minting * @custom:access Not restricted */ - function preMintHook( - address vToken, - address minter, - uint256 mintAmount - ) external override { + function preMintHook(address vToken, address minter, uint256 mintAmount) external override { _checkActionPauseState(vToken, Action.MINT); if (!markets[vToken].isListed) { @@ -313,11 +309,7 @@ contract Comptroller is * @custom:error PriceError is thrown if the oracle returns an incorrect price for some asset * @custom:access Not restricted */ - function preRedeemHook( - address vToken, - address redeemer, - uint256 redeemTokens - ) external override { + function preRedeemHook(address vToken, address redeemer, uint256 redeemTokens) external override { _checkActionPauseState(vToken, Action.REDEEM); _checkRedeemAllowed(vToken, redeemer, redeemTokens); @@ -346,11 +338,7 @@ contract Comptroller is * @custom:access Not restricted if vToken is enabled as collateral, otherwise only vToken */ /// disable-eslint - function preBorrowHook( - address vToken, - address borrower, - uint256 borrowAmount - ) external override { + function preBorrowHook(address vToken, address borrower, uint256 borrowAmount) external override { _checkActionPauseState(vToken, Action.BORROW); if (!markets[vToken].isListed) { @@ -574,12 +562,7 @@ contract Comptroller is * @custom:error PriceError is thrown if the oracle returns an incorrect price for some asset * @custom:access Not restricted */ - function preTransferHook( - address vToken, - address src, - address dst, - uint256 transferTokens - ) external override { + function preTransferHook(address vToken, address src, address dst, uint256 transferTokens) external override { _checkActionPauseState(vToken, Action.TRANSFER); // Currently the only consideration is whether or not @@ -920,11 +903,7 @@ contract Comptroller is * @param paused The new paused state (true=paused, false=unpaused) * @custom:access Controlled by AccessControlManager */ - function setActionsPaused( - VToken[] calldata marketsList, - Action[] calldata actionsList, - bool paused - ) external { + function setActionsPaused(VToken[] calldata marketsList, Action[] calldata actionsList, bool paused) external { _checkAccessAllowed("setActionsPaused(address[],uint256[],bool)"); uint256 marketsCount = marketsList.length; @@ -1012,15 +991,9 @@ contract Comptroller is * @return liquidity Account liquidity in excess of liquidation threshold requirements, * @return shortfall Account shortfall below liquidation threshold requirements */ - function getAccountLiquidity(address account) - external - view - returns ( - uint256 error, - uint256 liquidity, - uint256 shortfall - ) - { + function getAccountLiquidity( + address account + ) external view returns (uint256 error, uint256 liquidity, uint256 shortfall) { AccountLiquiditySnapshot memory snapshot = _getCurrentLiquiditySnapshot(account, _getLiquidationThreshold); return (NO_ERROR, snapshot.liquidity, snapshot.shortfall); } @@ -1033,15 +1006,9 @@ contract Comptroller is * @return liquidity Account liquidity in excess of collateral requirements, * @return shortfall Account shortfall below collateral requirements */ - function getBorrowingPower(address account) - external - view - returns ( - uint256 error, - uint256 liquidity, - uint256 shortfall - ) - { + function getBorrowingPower( + address account + ) external view returns (uint256 error, uint256 liquidity, uint256 shortfall) { AccountLiquiditySnapshot memory snapshot = _getCurrentLiquiditySnapshot(account, _getCollateralFactor); return (NO_ERROR, snapshot.liquidity, snapshot.shortfall); } @@ -1062,15 +1029,7 @@ contract Comptroller is address vTokenModify, uint256 redeemTokens, uint256 borrowAmount - ) - external - view - returns ( - uint256 error, - uint256 liquidity, - uint256 shortfall - ) - { + ) external view returns (uint256 error, uint256 liquidity, uint256 shortfall) { AccountLiquiditySnapshot memory snapshot = _getHypotheticalLiquiditySnapshot( account, VToken(vTokenModify), @@ -1289,11 +1248,7 @@ contract Comptroller is * @param action Action id to pause/unpause * @param paused The new paused state (true=paused, false=unpaused) */ - function _setActionPaused( - address market, - Action action, - bool paused - ) internal { + function _setActionPaused(address market, Action action, bool paused) internal { require(markets[market].isListed, "cannot pause a market that is not listed"); _actionPaused[market][action] = paused; emit ActionPausedMarket(VToken(market), action, paused); @@ -1305,11 +1260,7 @@ contract Comptroller is * @param redeemer Account redeeming the tokens * @param redeemTokens The number of tokens to redeem */ - function _checkRedeemAllowed( - address vToken, - address redeemer, - uint256 redeemTokens - ) internal { + function _checkRedeemAllowed(address vToken, address redeemer, uint256 redeemTokens) internal { Market storage market = markets[vToken]; if (!market.isListed) { @@ -1346,11 +1297,10 @@ contract Comptroller is * without calculating accumulated interest. * @return snapshot Account liquidity snapshot */ - function _getCurrentLiquiditySnapshot(address account, function(VToken) internal view returns (Exp memory) weight) - internal - view - returns (AccountLiquiditySnapshot memory snapshot) - { + function _getCurrentLiquiditySnapshot( + address account, + function(VToken) internal view returns (Exp memory) weight + ) internal view returns (AccountLiquiditySnapshot memory snapshot) { return _getHypotheticalLiquiditySnapshot(account, VToken(address(0)), 0, 0, weight); } @@ -1472,15 +1422,10 @@ contract Comptroller is * @return borrowBalance Borrowed amount, including the interest * @return exchangeRateMantissa Stored exchange rate */ - function _safeGetAccountSnapshot(VToken vToken, address user) - internal - view - returns ( - uint256 vTokenBalance, - uint256 borrowBalance, - uint256 exchangeRateMantissa - ) - { + function _safeGetAccountSnapshot( + VToken vToken, + address user + ) internal view returns (uint256 vTokenBalance, uint256 borrowBalance, uint256 exchangeRateMantissa) { uint256 err; (err, vTokenBalance, borrowBalance, exchangeRateMantissa) = vToken.getAccountSnapshot(user); if (err != 0) { diff --git a/contracts/ComptrollerInterface.sol b/contracts/ComptrollerInterface.sol index ce00ae3c5..d1879f90a 100644 --- a/contracts/ComptrollerInterface.sol +++ b/contracts/ComptrollerInterface.sol @@ -20,23 +20,11 @@ interface ComptrollerInterface { /*** Policy Hooks ***/ - function preMintHook( - address vToken, - address minter, - uint256 mintAmount - ) external; + function preMintHook(address vToken, address minter, uint256 mintAmount) external; - function preRedeemHook( - address vToken, - address redeemer, - uint256 redeemTokens - ) external; + function preRedeemHook(address vToken, address redeemer, uint256 redeemTokens) external; - function preBorrowHook( - address vToken, - address borrower, - uint256 borrowAmount - ) external; + function preBorrowHook(address vToken, address borrower, uint256 borrowAmount) external; function preRepayHook(address vToken, address borrower) external; @@ -55,12 +43,7 @@ interface ComptrollerInterface { address borrower ) external; - function preTransferHook( - address vToken, - address src, - address dst, - uint256 transferTokens - ) external; + function preTransferHook(address vToken, address src, address dst, uint256 transferTokens) external; function isComptroller() external view returns (bool); diff --git a/contracts/ExponentialNoError.sol b/contracts/ExponentialNoError.sol index a4c5e6b9d..ed39c6a48 100644 --- a/contracts/ExponentialNoError.sol +++ b/contracts/ExponentialNoError.sol @@ -46,11 +46,7 @@ contract ExponentialNoError { * @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer. */ // solhint-disable-next-line func-name-mixedcase - function mul_ScalarTruncateAddUInt( - Exp memory a, - uint256 scalar, - uint256 addend - ) internal pure returns (uint256) { + function mul_ScalarTruncateAddUInt(Exp memory a, uint256 scalar, uint256 addend) internal pure returns (uint256) { Exp memory product = mul_(a, scalar); return add_(truncate(product), addend); } diff --git a/contracts/Lens/PoolLens.sol b/contracts/Lens/PoolLens.sol index 54124238f..de29c8b31 100644 --- a/contracts/Lens/PoolLens.sol +++ b/contracts/Lens/PoolLens.sol @@ -177,11 +177,10 @@ contract PoolLens is ExponentialNoError { * @param comptroller The Comptroller implementation address * @return PoolData structure containing the details of the pool */ - function getPoolByComptroller(address poolRegistryAddress, address comptroller) - external - view - returns (PoolData memory) - { + function getPoolByComptroller( + address poolRegistryAddress, + address comptroller + ) external view returns (PoolData memory) { PoolRegistryInterface poolRegistryInterface = PoolRegistryInterface(poolRegistryAddress); return getPoolDataFromVenusPool(poolRegistryAddress, poolRegistryInterface.getPoolByComptroller(comptroller)); } @@ -208,11 +207,10 @@ contract PoolLens is ExponentialNoError { * @param asset The underlying asset of vToken * @return A list of Comptroller contracts */ - function getPoolsSupportedByAsset(address poolRegistryAddress, address asset) - external - view - returns (address[] memory) - { + function getPoolsSupportedByAsset( + address poolRegistryAddress, + address asset + ) external view returns (address[] memory) { PoolRegistryInterface poolRegistryInterface = PoolRegistryInterface(poolRegistryAddress); return poolRegistryInterface.getPoolsSupportedByAsset(asset); } @@ -222,11 +220,9 @@ contract PoolLens is ExponentialNoError { * @param vTokens The list of vToken addresses * @return An array containing the price data for each asset */ - function vTokenUnderlyingPriceAll(VToken[] calldata vTokens) - external - view - returns (VTokenUnderlyingPrice[] memory) - { + function vTokenUnderlyingPriceAll( + VToken[] calldata vTokens + ) external view returns (VTokenUnderlyingPrice[] memory) { uint256 vTokenCount = vTokens.length; VTokenUnderlyingPrice[] memory res = new VTokenUnderlyingPrice[](vTokenCount); for (uint256 i; i < vTokenCount; ++i) { @@ -241,14 +237,13 @@ contract PoolLens is ExponentialNoError { * @param comptrollerAddress address * @return Pending rewards array */ - function getPendingRewards(address account, address comptrollerAddress) - external - view - returns (RewardSummary[] memory) - { + function getPendingRewards( + address account, + address comptrollerAddress + ) external view returns (RewardSummary[] memory) { VToken[] memory markets = ComptrollerInterface(comptrollerAddress).getAllMarkets(); RewardsDistributor[] memory rewardsDistributors = ComptrollerViewInterface(comptrollerAddress) - .getRewardDistributors(); + .getRewardDistributors(); RewardSummary[] memory rewardSummary = new RewardSummary[](rewardsDistributors.length); for (uint256 i; i < rewardsDistributors.length; ++i) { RewardSummary memory reward; @@ -333,11 +328,10 @@ contract PoolLens is ExponentialNoError { * @param venusPool The VenusPool Object from PoolRegistry * @return Enriched PoolData */ - function getPoolDataFromVenusPool(address poolRegistryAddress, PoolRegistry.VenusPool memory venusPool) - public - view - returns (PoolData memory) - { + function getPoolDataFromVenusPool( + address poolRegistryAddress, + PoolRegistry.VenusPool memory venusPool + ) public view returns (PoolData memory) { // Get tokens in the Pool ComptrollerInterface comptrollerInstance = ComptrollerInterface(venusPool.comptroller); @@ -447,10 +441,10 @@ contract PoolLens is ExponentialNoError { // Market borrow and supply state we will modify update in-memory, in order to not modify storage RewardTokenState memory borrowState; (borrowState.index, borrowState.block, borrowState.lastRewardingBlock) = rewardsDistributor - .rewardTokenBorrowState(address(markets[i])); + .rewardTokenBorrowState(address(markets[i])); RewardTokenState memory supplyState; (supplyState.index, supplyState.block, supplyState.lastRewardingBlock) = rewardsDistributor - .rewardTokenSupplyState(address(markets[i])); + .rewardTokenSupplyState(address(markets[i])); Exp memory marketBorrowIndex = Exp({ mantissa: markets[i].borrowIndex() }); // Update market supply and borrow index in-memory diff --git a/contracts/Pool/PoolRegistry.sol b/contracts/Pool/PoolRegistry.sol index 3b33ade1f..4a5b0e16e 100644 --- a/contracts/Pool/PoolRegistry.sol +++ b/contracts/Pool/PoolRegistry.sol @@ -292,11 +292,7 @@ contract PoolRegistry is Ownable2StepUpgradeable, AccessControlledV8, PoolRegist return numberOfPools_; } - function _transferIn( - IERC20Upgradeable token, - address from, - uint256 amount - ) internal returns (uint256) { + function _transferIn(IERC20Upgradeable token, address from, uint256 amount) internal returns (uint256) { uint256 balanceBefore = token.balanceOf(address(this)); token.safeTransferFrom(from, address(this), amount); uint256 balanceAfter = token.balanceOf(address(this)); diff --git a/contracts/Rewards/RewardsDistributor.sol b/contracts/Rewards/RewardsDistributor.sol index c19a3fe4e..667dc5328 100644 --- a/contracts/Rewards/RewardsDistributor.sol +++ b/contracts/Rewards/RewardsDistributor.sol @@ -396,11 +396,7 @@ contract RewardsDistributor is ExponentialNoError, Ownable2StepUpgradeable, Acce * @param supplySpeed New supply-side REWARD TOKEN speed for market * @param borrowSpeed New borrow-side REWARD TOKEN speed for market */ - function _setRewardTokenSpeed( - VToken vToken, - uint256 supplySpeed, - uint256 borrowSpeed - ) internal { + function _setRewardTokenSpeed(VToken vToken, uint256 supplySpeed, uint256 borrowSpeed) internal { require(comptroller.isMarketListed(vToken), "rewardToken market is not listed"); if (rewardTokenSupplySpeeds[address(vToken)] != supplySpeed) { @@ -467,11 +463,7 @@ contract RewardsDistributor is ExponentialNoError, Ownable2StepUpgradeable, Acce * @param borrower The address of the borrower to distribute REWARD TOKEN to * @param marketBorrowIndex The current global borrow index of vToken */ - function _distributeBorrowerRewardToken( - address vToken, - address borrower, - Exp memory marketBorrowIndex - ) internal { + function _distributeBorrowerRewardToken(address vToken, address borrower, Exp memory marketBorrowIndex) internal { RewardToken storage borrowState = rewardTokenBorrowState[vToken]; uint256 borrowIndex = borrowState.index; uint256 borrowerIndex = rewardTokenBorrowerIndex[vToken][borrower]; diff --git a/contracts/RiskFund/ProtocolShareReserve.sol b/contracts/RiskFund/ProtocolShareReserve.sol index 0b08b1d4d..bc4733c99 100644 --- a/contracts/RiskFund/ProtocolShareReserve.sol +++ b/contracts/RiskFund/ProtocolShareReserve.sol @@ -69,11 +69,7 @@ contract ProtocolShareReserve is ExponentialNoError, ReserveHelpers, IProtocolSh * @return Number of total released tokens * @custom:error ZeroAddressNotAllowed is thrown when asset address is zero */ - function releaseFunds( - address comptroller, - address asset, - uint256 amount - ) external nonReentrant returns (uint256) { + function releaseFunds(address comptroller, address asset, uint256 amount) external nonReentrant returns (uint256) { ensureNonzeroAddress(asset); require(amount <= _poolsAssetsReserves[comptroller][asset], "ProtocolShareReserve: Insufficient pool balance"); @@ -102,10 +98,10 @@ contract ProtocolShareReserve is ExponentialNoError, ReserveHelpers, IProtocolSh * @param comptroller Comptroller address(pool) * @param asset Asset address. */ - function updateAssetsState(address comptroller, address asset) - public - override(IProtocolShareReserve, ReserveHelpers) - { + function updateAssetsState( + address comptroller, + address asset + ) public override(IProtocolShareReserve, ReserveHelpers) { super.updateAssetsState(comptroller, asset); } } diff --git a/contracts/RiskFund/RiskFund.sol b/contracts/RiskFund/RiskFund.sol index aebf91bea..3c9bf21dd 100644 --- a/contracts/RiskFund/RiskFund.sol +++ b/contracts/RiskFund/RiskFund.sol @@ -207,12 +207,10 @@ contract RiskFund is AccessControlledV8, ExponentialNoError, ReserveHelpers, Max * @param amount Amount to be transferred to auction contract. * @return Number reserved tokens. */ - function transferReserveForAuction(address comptroller, uint256 amount) - external - override - nonReentrant - returns (uint256) - { + function transferReserveForAuction( + address comptroller, + uint256 amount + ) external override nonReentrant returns (uint256) { address shortfall_ = shortfall; require(msg.sender == shortfall_, "Risk fund: Only callable by Shortfall contract"); require( diff --git a/contracts/Shortfall/Shortfall.sol b/contracts/Shortfall/Shortfall.sol index 6a609c08a..79e61d5e1 100644 --- a/contracts/Shortfall/Shortfall.sol +++ b/contracts/Shortfall/Shortfall.sol @@ -181,11 +181,7 @@ contract Shortfall is Ownable2StepUpgradeable, AccessControlledV8, ReentrancyGua * @param auctionStartBlock The block number when auction started * @custom:event Emits BidPlaced event on success */ - function placeBid( - address comptroller, - uint256 bidBps, - uint256 auctionStartBlock - ) external nonReentrant { + function placeBid(address comptroller, uint256 bidBps, uint256 auctionStartBlock) external nonReentrant { Auction storage auction = auctions[comptroller]; require(auction.startBlock == auctionStartBlock, "auction has been restarted"); diff --git a/contracts/VToken.sol b/contracts/VToken.sol index 8d56450fe..527f9e5fd 100644 --- a/contracts/VToken.sol +++ b/contracts/VToken.sol @@ -142,11 +142,7 @@ contract VToken is * @custom:error TransferNotAllowed is thrown if trying to transfer to self * @custom:access Not restricted */ - function transferFrom( - address src, - address dst, - uint256 amount - ) external override nonReentrant returns (bool) { + function transferFrom(address src, address dst, uint256 amount) external override nonReentrant returns (bool) { _transferTokens(msg.sender, src, dst, amount); return true; } @@ -468,11 +464,7 @@ contract VToken is * @custom:error HealBorrowUnauthorized is thrown when the request does not come from Comptroller * @custom:access Only Comptroller */ - function healBorrow( - address payer, - address borrower, - uint256 repayAmount - ) external override nonReentrant { + function healBorrow(address payer, address borrower, uint256 repayAmount) external override nonReentrant { if (repayAmount != 0) { comptroller.preRepayHook(address(this), borrower); } @@ -561,11 +553,7 @@ contract VToken is * @custom:error LiquidateSeizeLiquidatorIsBorrower is thrown when trying to liquidate self * @custom:access Not restricted */ - function seize( - address liquidator, - address borrower, - uint256 seizeTokens - ) external override nonReentrant { + function seize(address liquidator, address borrower, uint256 seizeTokens) external override nonReentrant { _seize(msg.sender, liquidator, borrower, seizeTokens); } @@ -649,16 +637,13 @@ contract VToken is * @return borrowBalance Amount owed in terms of underlying * @return exchangeRate Stored exchange rate */ - function getAccountSnapshot(address account) + function getAccountSnapshot( + address account + ) external view override - returns ( - uint256 error, - uint256 vTokenBalance, - uint256 borrowBalance, - uint256 exchangeRate - ) + returns (uint256 error, uint256 vTokenBalance, uint256 borrowBalance, uint256 exchangeRate) { return (NO_ERROR, accountTokens[account], _borrowBalanceStored(account), _exchangeRateStored()); } @@ -794,11 +779,7 @@ contract VToken is * @param minter The address of the account which is supplying the assets * @param mintAmount The amount of the underlying asset to supply */ - function _mintFresh( - address payer, - address minter, - uint256 mintAmount - ) internal { + function _mintFresh(address payer, address minter, uint256 mintAmount) internal { /* Fail if mint not allowed */ comptroller.preMintHook(address(this), minter, mintAmount); @@ -851,11 +832,7 @@ contract VToken is * @param redeemTokensIn The number of vTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero) * @param redeemAmountIn The number of underlying tokens to receive from redeeming vTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero) */ - function _redeemFresh( - address redeemer, - uint256 redeemTokensIn, - uint256 redeemAmountIn - ) internal { + function _redeemFresh(address redeemer, uint256 redeemTokensIn, uint256 redeemAmountIn) internal { require(redeemTokensIn == 0 || redeemAmountIn == 0, "one of redeemTokensIn or redeemAmountIn must be zero"); /* Verify market's block number equals current block number */ @@ -985,11 +962,7 @@ contract VToken is * @param repayAmount the amount of underlying tokens being returned, or type(uint256).max for the full outstanding amount * @return (uint) the actual repayment amount. */ - function _repayBorrowFresh( - address payer, - address borrower, - uint256 repayAmount - ) internal returns (uint256) { + function _repayBorrowFresh(address payer, address borrower, uint256 repayAmount) internal returns (uint256) { /* Fail if repayBorrow not allowed */ comptroller.preRepayHook(address(this), borrower); @@ -1152,12 +1125,7 @@ contract VToken is * @param borrower The account having collateral seized * @param seizeTokens The number of vTokens to seize */ - function _seize( - address seizerContract, - address liquidator, - address borrower, - uint256 seizeTokens - ) internal { + function _seize(address seizerContract, address liquidator, address borrower, uint256 seizeTokens) internal { /* Fail if seize not allowed */ comptroller.preSeizeHook(address(this), seizerContract, liquidator, borrower); @@ -1172,7 +1140,7 @@ contract VToken is * liquidatorTokensNew = accountTokens[liquidator] + seizeTokens */ uint256 liquidationIncentiveMantissa = ComptrollerViewInterface(address(comptroller)) - .liquidationIncentiveMantissa(); + .liquidationIncentiveMantissa(); uint256 numerator = mul_(seizeTokens, Exp({ mantissa: protocolSeizeShareMantissa })); uint256 protocolSeizeTokens = div_(numerator, Exp({ mantissa: liquidationIncentiveMantissa })); uint256 liquidatorSeizeTokens = seizeTokens - protocolSeizeTokens; @@ -1361,12 +1329,7 @@ contract VToken is * @param dst The address of the destination account * @param tokens The number of tokens to transfer */ - function _transferTokens( - address spender, - address src, - address dst, - uint256 tokens - ) internal { + function _transferTokens(address spender, address src, address dst, uint256 tokens) internal { /* Fail if transfer not allowed */ comptroller.preTransferHook(address(this), src, dst, tokens); diff --git a/contracts/VTokenInterfaces.sol b/contracts/VTokenInterfaces.sol index 7b6c58f53..7483e68b8 100644 --- a/contracts/VTokenInterfaces.sol +++ b/contracts/VTokenInterfaces.sol @@ -293,11 +293,7 @@ abstract contract VTokenInterface is VTokenStorage { VTokenInterface vTokenCollateral ) external virtual returns (uint256); - function healBorrow( - address payer, - address borrower, - uint256 repayAmount - ) external virtual; + function healBorrow(address payer, address borrower, uint256 repayAmount) external virtual; function forceLiquidateBorrow( address liquidator, @@ -307,19 +303,11 @@ abstract contract VTokenInterface is VTokenStorage { bool skipCloseFactorCheck ) external virtual; - function seize( - address liquidator, - address borrower, - uint256 seizeTokens - ) external virtual; + function seize(address liquidator, address borrower, uint256 seizeTokens) external virtual; function transfer(address dst, uint256 amount) external virtual returns (bool); - function transferFrom( - address src, - address dst, - uint256 amount - ) external virtual returns (bool); + function transferFrom(address src, address dst, uint256 amount) external virtual returns (bool); function accrueInterest() external virtual returns (uint256); @@ -353,16 +341,7 @@ abstract contract VTokenInterface is VTokenStorage { function balanceOf(address owner) external view virtual returns (uint256); - function getAccountSnapshot(address account) - external - view - virtual - returns ( - uint256, - uint256, - uint256, - uint256 - ); + function getAccountSnapshot(address account) external view virtual returns (uint256, uint256, uint256, uint256); function borrowRatePerBlock() external view virtual returns (uint256); diff --git a/contracts/WhitePaperInterestRateModel.sol b/contracts/WhitePaperInterestRateModel.sol index ef14dca95..015d62d6b 100644 --- a/contracts/WhitePaperInterestRateModel.sol +++ b/contracts/WhitePaperInterestRateModel.sol @@ -31,11 +31,7 @@ contract WhitePaperInterestRateModel is InterestRateModel { * @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by EXP_SCALE) * @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by EXP_SCALE) */ - constructor( - uint256 blocksPerYear_, - uint256 baseRatePerYear, - uint256 multiplierPerYear - ) { + constructor(uint256 blocksPerYear_, uint256 baseRatePerYear, uint256 multiplierPerYear) { require(blocksPerYear_ != 0, "Invalid blocks per year"); baseRatePerBlock = baseRatePerYear / blocksPerYear_; multiplierPerBlock = multiplierPerYear / blocksPerYear_; diff --git a/contracts/lib/ApproveOrRevert.sol b/contracts/lib/ApproveOrRevert.sol index c13d4460f..8ea61ae4b 100644 --- a/contracts/lib/ApproveOrRevert.sol +++ b/contracts/lib/ApproveOrRevert.sol @@ -17,11 +17,7 @@ library ApproveOrRevert { /// @param token The contract address of the token which will be transferred /// @param spender The spender contract address /// @param amount The value of the transfer - function approveOrRevert( - IERC20Upgradeable token, - address spender, - uint256 amount - ) internal { + function approveOrRevert(IERC20Upgradeable token, address spender, uint256 amount) internal { bytes memory callData = abi.encodeCall(token.approve, (spender, amount)); // solhint-disable-next-line avoid-low-level-calls diff --git a/contracts/lib/TokenDebtTracker.sol b/contracts/lib/TokenDebtTracker.sol index c183be6cc..aac79291c 100644 --- a/contracts/lib/TokenDebtTracker.sol +++ b/contracts/lib/TokenDebtTracker.sol @@ -110,11 +110,7 @@ abstract contract TokenDebtTracker is Initializable { * @param amount The amount to transfer * @custom:error InsufficientBalance The contract doesn't have enough balance to transfer */ - function _transferOutOrTrackDebt( - IERC20Upgradeable token, - address to, - uint256 amount - ) internal { + function _transferOutOrTrackDebt(IERC20Upgradeable token, address to, uint256 amount) internal { uint256 balance = token.balanceOf(address(this)); if (balance < amount) { revert InsufficientBalance(address(token), address(this), amount, balance); @@ -129,11 +125,7 @@ abstract contract TokenDebtTracker is Initializable { * @param to The recipient of the transfer * @param amount The amount to transfer */ - function _transferOutOrTrackDebtSkippingBalanceCheck( - IERC20Upgradeable token, - address to, - uint256 amount - ) internal { + function _transferOutOrTrackDebtSkippingBalanceCheck(IERC20Upgradeable token, address to, uint256 amount) internal { // We can't use safeTransfer here because we can't try-catch internal calls bool success = _tryTransferOut(token, to, amount); if (!success) { @@ -152,11 +144,7 @@ abstract contract TokenDebtTracker is Initializable { * @param amount The amount to transfer * @return true if the transfer succeeded, false otherwise */ - function _tryTransferOut( - IERC20Upgradeable token, - address to, - uint256 amount - ) private returns (bool) { + function _tryTransferOut(IERC20Upgradeable token, address to, uint256 amount) private returns (bool) { bytes memory callData = abi.encodeCall(token.transfer, (to, amount)); // solhint-disable-next-line avoid-low-level-calls diff --git a/contracts/test/ERC20.sol b/contracts/test/ERC20.sol index cabcd78c8..9dbc4d2a7 100644 --- a/contracts/test/ERC20.sol +++ b/contracts/test/ERC20.sol @@ -19,21 +19,13 @@ interface ERC20Base { abstract contract ERC20 is ERC20Base { function transfer(address to, uint256 value) external virtual returns (bool); - function transferFrom( - address from, - address to, - uint256 value - ) external virtual returns (bool); + function transferFrom(address from, address to, uint256 value) external virtual returns (bool); } abstract contract ERC20NS is ERC20Base { function transfer(address to, uint256 value) external virtual; - function transferFrom( - address from, - address to, - uint256 value - ) external virtual; + function transferFrom(address from, address to, uint256 value) external virtual; } /** @@ -51,12 +43,7 @@ contract StandardToken is ERC20 { mapping(address => mapping(address => uint256)) public override allowance; mapping(address => uint256) public override balanceOf; - constructor( - uint256 _initialAmount, - string memory _tokenName, - uint8 _decimalUnits, - string memory _tokenSymbol - ) { + constructor(uint256 _initialAmount, string memory _tokenName, uint8 _decimalUnits, string memory _tokenSymbol) { totalSupply = _initialAmount; balanceOf[msg.sender] = _initialAmount; name = _tokenName; @@ -71,11 +58,7 @@ contract StandardToken is ERC20 { return true; } - function transferFrom( - address src, - address dst, - uint256 amount - ) external virtual override returns (bool) { + function transferFrom(address src, address dst, uint256 amount) external virtual override returns (bool) { allowance[src][msg.sender] = allowance[src][msg.sender].sub(amount, "Insufficient allowance"); balanceOf[src] = balanceOf[src].sub(amount, "Insufficient balance"); balanceOf[dst] = balanceOf[dst].add(amount, "Balance overflow"); @@ -105,12 +88,7 @@ contract NonStandardToken is ERC20NS { mapping(address => mapping(address => uint256)) public override allowance; mapping(address => uint256) public override balanceOf; - constructor( - uint256 _initialAmount, - string memory _tokenName, - uint8 _decimalUnits, - string memory _tokenSymbol - ) { + constructor(uint256 _initialAmount, string memory _tokenName, uint8 _decimalUnits, string memory _tokenSymbol) { totalSupply = _initialAmount; balanceOf[msg.sender] = _initialAmount; name = _tokenName; @@ -124,11 +102,7 @@ contract NonStandardToken is ERC20NS { emit Transfer(msg.sender, dst, amount); } - function transferFrom( - address src, - address dst, - uint256 amount - ) external override { + function transferFrom(address src, address dst, uint256 amount) external override { allowance[src][msg.sender] = allowance[src][msg.sender].sub(amount, "Insufficient allowance"); balanceOf[src] = balanceOf[src].sub(amount, "Insufficient balance"); balanceOf[dst] = balanceOf[dst].add(amount, "Balance overflow"); @@ -173,11 +147,7 @@ contract ERC20Harness is StandardToken { return true; } - function transferFrom( - address src, - address dst, - uint256 amount - ) external override returns (bool success) { + function transferFrom(address src, address dst, uint256 amount) external override returns (bool success) { // Added for testing purposes if (failTransferFromAddresses[src]) { return false; diff --git a/contracts/test/EvilToken.sol b/contracts/test/EvilToken.sol index 6d72af717..103c751d2 100644 --- a/contracts/test/EvilToken.sol +++ b/contracts/test/EvilToken.sol @@ -37,11 +37,7 @@ contract EvilToken is FaucetToken { return true; } - function transferFrom( - address src, - address dst, - uint256 amount - ) external override returns (bool) { + function transferFrom(address src, address dst, uint256 amount) external override returns (bool) { if (fail) { return false; } diff --git a/contracts/test/FaucetToken.sol b/contracts/test/FaucetToken.sol index 93779e038..1a607c303 100644 --- a/contracts/test/FaucetToken.sol +++ b/contracts/test/FaucetToken.sol @@ -147,22 +147,14 @@ contract FaucetTokenReEntrantHarness { return true; } - function _approve( - address owner, - address spender, - uint256 amount - ) internal { + function _approve(address owner, address spender, uint256 amount) internal { require(spender != address(0), "FaucetToken: approve to the zero address"); require(owner != address(0), "FaucetToken: approve from the zero address"); allowance_[owner][spender] = amount; emit Approval(owner, spender, amount); } - function _transfer( - address src, - address dst, - uint256 amount - ) internal { + function _transfer(address src, address dst, uint256 amount) internal { require(dst != address(0), "FaucetToken: transfer to the zero address"); balanceOf_[src] = balanceOf_[src].sub(amount); balanceOf_[dst] = balanceOf_[dst].add(amount); diff --git a/contracts/test/FeeToken.sol b/contracts/test/FeeToken.sol index 67972d963..0879624d9 100644 --- a/contracts/test/FeeToken.sol +++ b/contracts/test/FeeToken.sol @@ -37,11 +37,7 @@ contract FeeToken is FaucetToken { return true; } - function transferFrom( - address src, - address dst, - uint256 amount - ) public override returns (bool) { + function transferFrom(address src, address dst, uint256 amount) public override returns (bool) { uint256 fee = amount.mul(basisPointFee).div(10000); uint256 net = amount.sub(fee); balanceOf[owner] = balanceOf[owner].add(fee); diff --git a/contracts/test/MockDeflationaryToken.sol b/contracts/test/MockDeflationaryToken.sol index 5403cf2e6..4845c3141 100644 --- a/contracts/test/MockDeflationaryToken.sol +++ b/contracts/test/MockDeflationaryToken.sol @@ -43,11 +43,7 @@ contract MockDeflatingToken { return true; } - function transferFrom( - address from, - address to, - uint256 value - ) external returns (bool) { + function transferFrom(address from, address to, uint256 value) external returns (bool) { if (allowance[from][msg.sender] != type(uint256).max) { allowance[from][msg.sender] = allowance[from][msg.sender] - value; } @@ -89,20 +85,12 @@ contract MockDeflatingToken { emit Transfer(from, address(0), value); } - function _approve( - address owner, - address spender, - uint256 value - ) private { + function _approve(address owner, address spender, uint256 value) private { allowance[owner][spender] = value; emit Approval(owner, spender, value); } - function _transfer( - address from, - address to, - uint256 value - ) private { + function _transfer(address from, address to, uint256 value) private { uint256 burnAmount = value / 100; _burn(from, burnAmount); uint256 transferAmount = value - burnAmount; diff --git a/contracts/test/Mocks/MockPancakeSwap.sol b/contracts/test/Mocks/MockPancakeSwap.sol index 6894dd396..8c7f44fae 100644 --- a/contracts/test/Mocks/MockPancakeSwap.sol +++ b/contracts/test/Mocks/MockPancakeSwap.sol @@ -10,32 +10,19 @@ pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { - function safeApprove( - address token, - address to, - uint256 value - ) internal { + function safeApprove(address token, address to, uint256 value) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: APPROVE_FAILED"); } - function safeTransfer( - address token, - address to, - uint256 value - ) internal { + function safeTransfer(address token, address to, uint256 value) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FAILED"); } - function safeTransferFrom( - address token, - address from, - address to, - uint256 value - ) internal { + function safeTransferFrom(address token, address from, address to, uint256 value) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "TransferHelper: TRANSFER_FROM_FAILED"); @@ -67,13 +54,7 @@ interface IPancakeRouter01 { uint256 amountBMin, address to, uint256 deadline - ) - external - returns ( - uint256 amountA, - uint256 amountB, - uint256 liquidity - ); + ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); function addLiquidityETH( address token, @@ -82,14 +63,7 @@ interface IPancakeRouter01 { uint256 amountETHMin, address to, uint256 deadline - ) - external - payable - returns ( - uint256 amountToken, - uint256 amountETH, - uint256 liquidity - ); + ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); function removeLiquidity( address tokenA, @@ -183,11 +157,7 @@ interface IPancakeRouter01 { uint256 deadline ) external payable returns (uint256[] memory amounts); - function quote( - uint256 amountA, - uint256 reserveA, - uint256 reserveB - ) external pure returns (uint256 amountB); + function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) external pure returns (uint256 amountB); function getAmountOut( uint256 amountIn, @@ -335,11 +305,7 @@ interface IPancakePair { function transfer(address to, uint256 value) external returns (bool); - function transferFrom( - address from, - address to, - uint256 value - ) external returns (bool); + function transferFrom(address from, address to, uint256 value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); @@ -377,14 +343,7 @@ interface IPancakePair { function token1() external view returns (address); - function getReserves() - external - view - returns ( - uint112 reserve0, - uint112 reserve1, - uint32 blockTimestampLast - ); + function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint256); @@ -396,12 +355,7 @@ interface IPancakePair { function burn(address to) external returns (uint256 amount0, uint256 amount1); - function swap( - uint256 amount0Out, - uint256 amount1Out, - address to, - bytes calldata data - ) external; + function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external; function skim(address to) external; @@ -427,11 +381,7 @@ library PancakeLibrary { } // calculates the CREATE2 address for a pair without making any external calls - function pairFor( - address factory, - address tokenA, - address tokenB - ) internal pure returns (address pair) { + function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address( uint256( @@ -461,11 +411,7 @@ library PancakeLibrary { } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset - function quote( - uint256 amountA, - uint256 reserveA, - uint256 reserveB - ) internal pure returns (uint256 amountB) { + function quote(uint256 amountA, uint256 reserveA, uint256 reserveB) internal pure returns (uint256 amountB) { require(amountA > 0, "PancakeLibrary: INSUFFICIENT_AMOUNT"); require(reserveA > 0 && reserveB > 0, "PancakeLibrary: INSUFFICIENT_LIQUIDITY"); amountB = amountA.mul(reserveB) / reserveA; @@ -555,11 +501,7 @@ interface IERC20 { function transfer(address to, uint256 value) external returns (bool); - function transferFrom( - address from, - address to, - uint256 value - ) external returns (bool); + function transferFrom(address from, address to, uint256 value) external returns (bool); } // File: contracts\interfaces\IWETH.sol @@ -641,17 +583,7 @@ contract PancakeRouter is IPancakeRouter02 { uint256 amountBMin, address to, uint256 deadline - ) - external - virtual - override - ensure(deadline) - returns ( - uint256 amountA, - uint256 amountB, - uint256 liquidity - ) - { + ) external virtual override ensure(deadline) returns (uint256 amountA, uint256 amountB, uint256 liquidity) { (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired, amountAMin, amountBMin); address pair = PancakeLibrary.pairFor(factory, tokenA, tokenB); TransferHelper.safeTransferFrom(tokenA, msg.sender, pair, amountA); @@ -672,11 +604,7 @@ contract PancakeRouter is IPancakeRouter02 { virtual override ensure(deadline) - returns ( - uint256 amountToken, - uint256 amountETH, - uint256 liquidity - ) + returns (uint256 amountToken, uint256 amountETH, uint256 liquidity) { (amountToken, amountETH) = _addLiquidity( token, @@ -815,11 +743,7 @@ contract PancakeRouter is IPancakeRouter02 { // **** SWAP **** // requires the initial amount to have already been sent to the first pair - function _swap( - uint256[] memory amounts, - address[] memory path, - address _to - ) internal virtual { + function _swap(uint256[] memory amounts, address[] memory path, address _to) internal virtual { for (uint256 i; i < path.length - 1; i++) { (address input, address output) = (path[i], path[i + 1]); PancakeLibrary.sortTokens(input, output); @@ -1047,23 +971,17 @@ contract PancakeRouter is IPancakeRouter02 { return PancakeLibrary.getAmountIn(amountOut, reserveIn, reserveOut); } - function getAmountsOut(uint256 amountIn, address[] memory path) - public - view - virtual - override - returns (uint256[] memory amounts) - { + function getAmountsOut( + uint256 amountIn, + address[] memory path + ) public view virtual override returns (uint256[] memory amounts) { return PancakeLibrary.getAmountsOut(factory, amountIn, path); } - function getAmountsIn(uint256 amountOut, address[] memory path) - public - view - virtual - override - returns (uint256[] memory amounts) - { + function getAmountsIn( + uint256 amountOut, + address[] memory path + ) public view virtual override returns (uint256[] memory amounts) { return PancakeLibrary.getAmountsIn(factory, amountOut, path); } } diff --git a/contracts/test/Mocks/MockToken.sol b/contracts/test/Mocks/MockToken.sol index 2615a27d4..ced5e3e4f 100644 --- a/contracts/test/Mocks/MockToken.sol +++ b/contracts/test/Mocks/MockToken.sol @@ -8,11 +8,7 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract MockToken is ERC20 { uint8 private immutable _decimals; - constructor( - string memory name_, - string memory symbol_, - uint8 decimals_ - ) ERC20(name_, symbol_) { + constructor(string memory name_, string memory symbol_, uint8 decimals_) ERC20(name_, symbol_) { _decimals = decimals_; } diff --git a/contracts/test/SafeMath.sol b/contracts/test/SafeMath.sol index 33ca62cf2..569e8e8a7 100644 --- a/contracts/test/SafeMath.sol +++ b/contracts/test/SafeMath.sol @@ -44,11 +44,7 @@ library SafeMath { * Requirements: * - Addition cannot overflow. */ - function add( - uint256 a, - uint256 b, - string memory errorMessage - ) internal pure returns (uint256) { + function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c; unchecked { c = a + b; @@ -78,11 +74,7 @@ library SafeMath { * Requirements: * - Subtraction cannot underflow. */ - function sub( - uint256 a, - uint256 b, - string memory errorMessage - ) internal pure returns (uint256) { + function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; @@ -122,11 +114,7 @@ library SafeMath { * Requirements: * - Multiplication cannot overflow. */ - function mul( - uint256 a, - uint256 b, - string memory errorMessage - ) internal pure returns (uint256) { + function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 @@ -169,11 +157,7 @@ library SafeMath { * Requirements: * - The divisor cannot be zero. */ - function div( - uint256 a, - uint256 b, - string memory errorMessage - ) internal pure returns (uint256) { + function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; @@ -208,11 +192,7 @@ library SafeMath { * Requirements: * - The divisor cannot be zero. */ - function mod( - uint256 a, - uint256 b, - string memory errorMessage - ) internal pure returns (uint256) { + function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } diff --git a/contracts/test/VTokenHarness.sol b/contracts/test/VTokenHarness.sol index cc91adade..3690c212e 100644 --- a/contracts/test/VTokenHarness.sol +++ b/contracts/test/VTokenHarness.sol @@ -41,11 +41,7 @@ contract VTokenHarness is VToken { totalReserves = totalReserves_; } - function harnessExchangeRateDetails( - uint256 totalSupply_, - uint256 totalBorrows_, - uint256 totalReserves_ - ) external { + function harnessExchangeRateDetails(uint256 totalSupply_, uint256 totalBorrows_, uint256 totalReserves_) external { totalSupply = totalSupply_; totalBorrows = totalBorrows_; totalReserves = totalReserves_; @@ -64,19 +60,11 @@ contract VTokenHarness is VToken { super._mintFresh(account, account, mintAmount); } - function harnessRedeemFresh( - address payable account, - uint256 vTokenAmount, - uint256 underlyingAmount - ) external { + function harnessRedeemFresh(address payable account, uint256 vTokenAmount, uint256 underlyingAmount) external { super._redeemFresh(account, vTokenAmount, underlyingAmount); } - function harnessSetAccountBorrows( - address account, - uint256 principal, - uint256 interestIndex - ) external { + function harnessSetAccountBorrows(address account, uint256 principal, uint256 interestIndex) external { accountBorrows[account] = BorrowSnapshot({ principal: principal, interestIndex: interestIndex }); } @@ -88,11 +76,7 @@ contract VTokenHarness is VToken { _borrowFresh(account, borrowAmount); } - function harnessRepayBorrowFresh( - address payer, - address account, - uint256 repayAmount - ) external { + function harnessRepayBorrowFresh(address payer, address account, uint256 repayAmount) external { _repayBorrowFresh(payer, account, repayAmount); } diff --git a/contracts/test/lib/ApproveOrRevertHarness.sol b/contracts/test/lib/ApproveOrRevertHarness.sol index b0d3185a3..e590d90b6 100644 --- a/contracts/test/lib/ApproveOrRevertHarness.sol +++ b/contracts/test/lib/ApproveOrRevertHarness.sol @@ -8,11 +8,7 @@ import { ApproveOrRevert } from "../../lib/ApproveOrRevert.sol"; contract ApproveOrRevertHarness { using ApproveOrRevert for IERC20Upgradeable; - function approve( - IERC20Upgradeable token, - address spender, - uint256 amount - ) external { + function approve(IERC20Upgradeable token, address spender, uint256 amount) external { token.approveOrRevert(spender, amount); } } diff --git a/contracts/test/lib/TokenDebtTrackerHarness.sol b/contracts/test/lib/TokenDebtTrackerHarness.sol index 4b8747689..37e8f7282 100644 --- a/contracts/test/lib/TokenDebtTrackerHarness.sol +++ b/contracts/test/lib/TokenDebtTrackerHarness.sol @@ -10,20 +10,12 @@ contract TokenDebtTrackerHarness is TokenDebtTracker { __TokenDebtTracker_init(); } - function addTokenDebt( - IERC20Upgradeable token, - address user, - uint256 amount - ) external { + function addTokenDebt(IERC20Upgradeable token, address user, uint256 amount) external { tokenDebt[token][user] += amount; totalTokenDebt[token] += amount; } - function transferOutOrTrackDebt( - IERC20Upgradeable token, - address user, - uint256 amount - ) external { + function transferOutOrTrackDebt(IERC20Upgradeable token, address user, uint256 amount) external { _transferOutOrTrackDebt(token, user, amount); }