Skip to content

Commit e6e58b8

Browse files
committed
fixup! refactor: extract interfaces
1 parent da1bbf3 commit e6e58b8

File tree

10 files changed

+10
-36
lines changed

10 files changed

+10
-36
lines changed

contracts/Lens/SnapshotLens.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ contract SnapshotLens is ExponentialNoError {
9090
vars.collateralFactor = Exp({ mantissa: collateralFactorMantissa });
9191

9292
// Get the normalized price of the asset
93-
vars.oraclePriceMantissa = IComptroller(comptrollerAddress).oracle().getUnderlyingPrice(
94-
address(vToken)
95-
);
93+
vars.oraclePriceMantissa = IComptroller(comptrollerAddress).oracle().getUnderlyingPrice(address(vToken));
9694
vars.oraclePrice = Exp({ mantissa: vars.oraclePriceMantissa });
9795

9896
// Pre-compute a conversion factor from tokens -> bnb (normalized price value)

contracts/Lens/VenusLens.sol

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ contract VenusLens is ExponentialNoError {
117117
uint exchangeRateCurrent = vToken.exchangeRateCurrent();
118118
address comptrollerAddress = address(vToken.comptroller());
119119
IComptroller comptroller = IComptroller(comptrollerAddress);
120-
(bool isListed, uint collateralFactorMantissa,) = comptroller.markets(address(vToken));
120+
(bool isListed, uint collateralFactorMantissa, ) = comptroller.markets(address(vToken));
121121
address underlyingAssetAddress;
122122
uint underlyingDecimals;
123123

@@ -317,10 +317,7 @@ contract VenusLens is ExponentialNoError {
317317
* @param account Address of the account to query
318318
* @return Struct with markets user has entered, liquidity, and shortfall of the account
319319
*/
320-
function getAccountLimits(
321-
IComptroller comptroller,
322-
address account
323-
) public view returns (AccountLimits memory) {
320+
function getAccountLimits(IComptroller comptroller, address account) public view returns (AccountLimits memory) {
324321
(uint errorCode, uint liquidity, uint shortfall) = comptroller.getAccountLiquidity(account);
325322
require(errorCode == 0, "account liquidity error");
326323

@@ -504,10 +501,7 @@ contract VenusLens is ExponentialNoError {
504501
* @param comptroller Address of the comptroller
505502
* @return Reward object contraining the totalRewards and pending rewards for each market
506503
*/
507-
function pendingRewards(
508-
address holder,
509-
IComptroller comptroller
510-
) external view returns (RewardSummary memory) {
504+
function pendingRewards(address holder, IComptroller comptroller) external view returns (RewardSummary memory) {
511505
IVToken[] memory vTokens = comptroller.getAllMarkets();
512506
ClaimVenusLocalVariables memory vars;
513507
RewardSummary memory rewardSummary;

contracts/Tokens/VAI/VAIController.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ contract VAIController is IVAIController, VAIControllerStorageG4, VAIControllerE
490490
return (uint256(Error.MATH_ERROR), 0);
491491
}
492492

493-
(, uint256 collateralFactorMantissa,) = comptroller.markets(address(enteredMarkets[i]));
493+
(, uint256 collateralFactorMantissa, ) = comptroller.markets(address(enteredMarkets[i]));
494494
(vars.mErr, vars.marketSupply) = mulUInt(vars.marketSupply, collateralFactorMantissa);
495495
if (vars.mErr != MathError.NO_ERROR) {
496496
return (uint256(Error.MATH_ERROR), 0);

contracts/Tokens/VTokens/VBep20.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,7 @@ contract VBep20 is VToken, IVBep20 {
162162
* @return uint Returns 0 on success, otherwise returns a failure code (see ErrorReporter.sol for details).
163163
*/
164164
// @custom:event Emit LiquidateBorrow event on success
165-
function liquidateBorrow(
166-
address borrower,
167-
uint repayAmount,
168-
IVToken vTokenCollateral
169-
) external returns (uint) {
165+
function liquidateBorrow(address borrower, uint repayAmount, IVToken vTokenCollateral) external returns (uint) {
170166
(uint err, ) = liquidateBorrowInternal(borrower, repayAmount, vTokenCollateral);
171167
return err;
172168
}

contracts/Tokens/VTokens/VBep20Delegator.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,7 @@ contract VBep20Delegator is IVDelegator, VTokenStorage {
174174
* @param repayAmount The amount of the underlying borrowed asset to repay
175175
* @return uint Returns 0 on success, otherwise returns a failure code (see ErrorReporter.sol for details).
176176
*/
177-
function liquidateBorrow(
178-
address borrower,
179-
uint repayAmount,
180-
IVToken vTokenCollateral
181-
) external returns (uint) {
177+
function liquidateBorrow(address borrower, uint repayAmount, IVToken vTokenCollateral) external returns (uint) {
182178
bytes memory data = delegateToImplementation(
183179
abi.encodeWithSignature("liquidateBorrow(address,uint256,address)", borrower, repayAmount, vTokenCollateral)
184180
);

contracts/Tokens/VTokens/interfaces/IVBNB.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ interface IVBNB is IVToken {
7171
* @custom:event Emit LiquidateBorrow event on success
7272
*/
7373
function liquidateBorrow(address borrower, IVToken vTokenCollateral) external payable;
74-
}
74+
}

contracts/Tokens/VTokens/interfaces/IVBep20.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,7 @@ interface IVBep20 is IVToken {
7171
* @param vTokenCollateral The address of the vToken collateral
7272
* @return uint Returns the amount successfully liquidated
7373
*/
74-
function liquidateBorrow(
75-
address borrower,
76-
uint repayAmount,
77-
IVToken vTokenCollateral
78-
) external returns (uint);
74+
function liquidateBorrow(address borrower, uint repayAmount, IVToken vTokenCollateral) external returns (uint);
7975

8076
/*** Admin Functions ***/
8177

contracts/Tokens/VTokens/interfaces/IVToken.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ interface IVToken is IVTokenStorage {
8181
/// @notice Emitted when access control address is changed by admin
8282
event NewAccessControlManager(address oldAccessControlAddress, address newAccessControlAddress);
8383

84-
8584
/**
8685
* @notice Indicator that this is a vToken contract (for inspection)
8786
*/

contracts/Tokens/VTokens/interfaces/IVTokenStorage.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ pragma solidity 0.8.25;
44
import { IComptroller } from "../../../Comptroller/interfaces/IComptroller.sol";
55
import { InterestRateModelV8 } from "../../../InterestRateModels/InterestRateModelV8.sol";
66

7-
87
interface IVTokenStorage {
98
/**
109
* @notice Container for borrow balance information

contracts/test/VBep20MockDelegate.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@ contract VBep20MockDelegate is VToken, IVBep20, IVDelegate {
163163
* @param vTokenCollateral The market in which to seize collateral from the borrower
164164
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
165165
*/
166-
function liquidateBorrow(
167-
address borrower,
168-
uint repayAmount,
169-
IVToken vTokenCollateral
170-
) external returns (uint) {
166+
function liquidateBorrow(address borrower, uint repayAmount, IVToken vTokenCollateral) external returns (uint) {
171167
(uint err, ) = liquidateBorrowInternal(borrower, repayAmount, vTokenCollateral);
172168
return err;
173169
}

0 commit comments

Comments
 (0)