Skip to content

Commit 5046e28

Browse files
committed
fix: merge conflict
2 parents 55ecc18 + 8d98b33 commit 5046e28

File tree

208 files changed

+91445
-43442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

208 files changed

+91445
-43442
lines changed

CHANGELOG.md

Lines changed: 369 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ $ yarn hardhat --network <network-name> --export ./deployments/<network-name>.js
130130
### Source Code Verification
131131

132132
In order to verify the source code of already deployed contracts, run:
133-
`npx hardhat etherscan-verify --network <network_name>`
133+
`npx hardhat verify --network <network-name> <contract-address> <constructor-arg1> <constructor-arg2>`
134134

135135
Make sure you have added `ETHERSCAN_API_KEY` in `.env` file.
136136

3.53 MB
Binary file not shown.
1.58 MB
Binary file not shown.
3.81 MB
Binary file not shown.
1.6 MB
Binary file not shown.

contracts/Admin/VBNBAdmin.sol

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
pragma solidity 0.8.25;
33

4-
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
5-
import "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol";
6-
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
7-
import { IProtocolShareReserve, IWBNB, VBNBAdminStorage, VTokenInterface } from "./VBNBAdminStorage.sol";
4+
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
5+
import { AccessControlledV8 } from "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol";
6+
import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
7+
import { IProtocolShareReserve } from "../external/IProtocolShareReserve.sol";
8+
import { IWBNB } from "../external/IWBNB.sol";
9+
import { VBNBAdminStorage, VTokenInterface } from "./VBNBAdminStorage.sol";
810

911
/**
1012
* @title VBNBAdmin

contracts/Admin/VBNBAdminStorage.sol

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
pragma solidity 0.8.25;
33

4-
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
4+
import { IProtocolShareReserve } from "../external/IProtocolShareReserve.sol";
55

66
interface VTokenInterface {
77
function _reduceReserves(uint reduceAmount) external returns (uint);
@@ -13,19 +13,6 @@ interface VTokenInterface {
1313
function _setInterestRateModel(address newInterestRateModel) external returns (uint);
1414
}
1515

16-
interface IWBNB is IERC20Upgradeable {
17-
function deposit() external payable;
18-
}
19-
20-
interface IProtocolShareReserve {
21-
enum IncomeType {
22-
SPREAD,
23-
LIQUIDATION
24-
}
25-
26-
function updateAssetsState(address comptroller, address asset, IncomeType incomeType) external;
27-
}
28-
2916
contract VBNBAdminStorage {
3017
/// @notice address of protocol share reserve contract
3118
IProtocolShareReserve public protocolShareReserve;

contracts/Comptroller/ComptrollerInterface.sol

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1-
pragma solidity ^0.5.16;
2-
3-
import "../Tokens/VTokens/VToken.sol";
4-
import "../Oracle/PriceOracle.sol";
5-
import "../Tokens/VAI/VAIControllerInterface.sol";
6-
import { ComptrollerTypes } from "./ComptrollerStorage.sol";
1+
// SPDX-License-Identifier: BSD-3-Clause
2+
3+
pragma solidity 0.8.25;
4+
5+
import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";
6+
7+
import { VToken } from "../Tokens/VTokens/VToken.sol";
8+
import { VAIControllerInterface } from "../Tokens/VAI/VAIControllerInterface.sol";
9+
import { WeightFunction } from "./Diamond/interfaces/IFacetBase.sol";
10+
11+
enum Action {
12+
MINT,
13+
REDEEM,
14+
BORROW,
15+
REPAY,
16+
SEIZE,
17+
LIQUIDATE,
18+
TRANSFER,
19+
ENTER_MARKET,
20+
EXIT_MARKET
21+
}
722

8-
contract ComptrollerInterface {
23+
interface ComptrollerInterface {
924
/// @notice Indicator that this is a Comptroller contract (for inspection)
10-
bool public constant isComptroller = true;
25+
function isComptroller() external pure returns (bool);
1126

1227
/*** Assets You Are In ***/
1328

@@ -89,18 +104,25 @@ contract ComptrollerInterface {
89104
uint repayAmount
90105
) external view returns (uint, uint);
91106

107+
function liquidateCalculateSeizeTokens(
108+
address borrower,
109+
address vTokenBorrowed,
110+
address vTokenCollateral,
111+
uint repayAmount
112+
) external view returns (uint, uint);
113+
92114
function setMintedVAIOf(address owner, uint amount) external returns (uint);
93115

94116
function liquidateVAICalculateSeizeTokens(
95117
address vTokenCollateral,
96118
uint repayAmount
97119
) external view returns (uint, uint);
98120

99-
function getXVSAddress() public view returns (address);
121+
function getXVSAddress() external view returns (address);
100122

101-
function markets(address) external view returns (bool, uint);
123+
function markets(address) external view returns (bool, uint, bool, uint, uint, uint96, bool);
102124

103-
function oracle() external view returns (PriceOracle);
125+
function oracle() external view returns (ResilientOracleInterface);
104126

105127
function getAccountLiquidity(address) external view returns (uint, uint, uint);
106128

@@ -130,24 +152,58 @@ contract ComptrollerInterface {
130152

131153
function vaiController() external view returns (VAIControllerInterface);
132154

133-
function liquidationIncentiveMantissa() external view returns (uint);
134-
135155
function protocolPaused() external view returns (bool);
136156

137-
function actionPaused(address market, ComptrollerTypes.Action action) public view returns (bool);
157+
function actionPaused(address market, Action action) external view returns (bool);
138158

139159
function mintedVAIs(address user) external view returns (uint);
140160

141161
function vaiMintRate() external view returns (uint);
162+
163+
function userPoolId(address account) external view returns (uint96);
164+
165+
function getLiquidationIncentive(address vToken) external view returns (uint256);
166+
167+
function getEffectiveLiquidationIncentive(address account, address vToken) external view returns (uint256);
168+
169+
function getEffectiveLtvFactor(
170+
address account,
171+
address vToken,
172+
WeightFunction weightingStrategy
173+
) external view returns (uint256);
174+
175+
function lastPoolId() external view returns (uint96);
176+
177+
function corePoolId() external pure returns (uint96);
178+
179+
function pools(
180+
uint96 poolId
181+
) external view returns (string memory label, bool isActive, bool allowCorePoolFallback);
182+
183+
function getPoolVTokens(uint96 poolId) external view returns (address[] memory);
184+
185+
function poolMarkets(
186+
uint96 poolId,
187+
address vToken
188+
)
189+
external
190+
view
191+
returns (
192+
bool isListed,
193+
uint256 collateralFactorMantissa,
194+
bool isVenus,
195+
uint256 liquidationThresholdMantissa,
196+
uint256 liquidationIncentiveMantissa,
197+
uint96 marketPoolId,
198+
bool isBorrowAllowed
199+
);
142200
}
143201

144202
interface IVAIVault {
145203
function updatePendingRewards() external;
146204
}
147205

148206
interface IComptroller {
149-
function liquidationIncentiveMantissa() external view returns (uint);
150-
151207
/*** Treasury Data ***/
152208
function treasuryAddress() external view returns (address);
153209

contracts/Comptroller/ComptrollerLensInterface.sol

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
pragma solidity ^0.5.16;
2-
pragma experimental ABIEncoderV2;
1+
// SPDX-License-Identifier: BSD-3-Clause
32

4-
import "../Tokens/VTokens/VToken.sol";
3+
pragma solidity 0.8.25;
4+
5+
import { VToken } from "../Tokens/VTokens/VToken.sol";
6+
import { WeightFunction } from "./Diamond/interfaces/IFacetBase.sol";
57

68
interface ComptrollerLensInterface {
79
function liquidateCalculateSeizeTokens(
@@ -11,6 +13,14 @@ interface ComptrollerLensInterface {
1113
uint actualRepayAmount
1214
) external view returns (uint, uint);
1315

16+
function liquidateCalculateSeizeTokens(
17+
address borrower,
18+
address comptroller,
19+
address vTokenBorrowed,
20+
address vTokenCollateral,
21+
uint actualRepayAmount
22+
) external view returns (uint, uint);
23+
1424
function liquidateVAICalculateSeizeTokens(
1525
address comptroller,
1626
address vTokenCollateral,
@@ -22,6 +32,7 @@ interface ComptrollerLensInterface {
2232
address account,
2333
VToken vTokenModify,
2434
uint redeemTokens,
25-
uint borrowAmount
35+
uint borrowAmount,
36+
WeightFunction weightingStrategy
2637
) external view returns (uint, uint, uint);
2738
}

0 commit comments

Comments
 (0)