Skip to content

Commit

Permalink
feat!: migrate to Solidity 0.8.25
Browse files Browse the repository at this point in the history
  • Loading branch information
kkirka committed Apr 19, 2024
1 parent 48a9a22 commit 9190201
Show file tree
Hide file tree
Showing 43 changed files with 110 additions and 89 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
SHELL ["/bin/bash", "-c"]
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash
RUN apt -y install nodejs
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.13/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc
RUN wget https://github.com/ethereum/solidity/releases/download/v0.8.25/solc-static-linux -O /usr/bin/solc && chmod +x /usr/bin/solc

RUN mkdir -p /usr/app
WORKDIR /usr/app
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ The `Comptroller` also includes two functions `liquidateAccount()` and `healAcco
## Prerequisites

- NodeJS - 12.x
- Solc - v0.8.13 (https://github.com/ethereum/solidity/releases/tag/v0.8.13)
- Solc - v0.8.25 (https://github.com/ethereum/solidity/releases/tag/v0.8.25)

## Installing

Expand Down
2 changes: 1 addition & 1 deletion contracts/BaseJumpRateModelV2.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IAccessControlManagerV8 } from "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Comptroller.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/ComptrollerInterface.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/ComptrollerStorage.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/ErrorReporter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

/**
* @title TokenErrorReporter
Expand Down
2 changes: 1 addition & 1 deletion contracts/ExponentialNoError.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { EXP_SCALE as EXP_SCALE_, MANTISSA_ONE as MANTISSA_ONE_ } from "./lib/constants.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Gateway/INativeTokenGateway.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.20;
pragma solidity ^0.8.25;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Gateway/Interfaces/IVToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.20;
pragma solidity ^0.8.25;

interface IVToken {
function mintBehalf(address receiver, uint256 mintAmount) external returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/Gateway/Interfaces/IWrappedNative.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.20;
pragma solidity ^0.8.25;

interface IWrappedNative {
function deposit() external payable;
Expand Down
2 changes: 1 addition & 1 deletion contracts/Gateway/NativeTokenGateway.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.20;
pragma solidity 0.8.25;

import { Ownable2Step } from "@openzeppelin/contracts/access/Ownable2Step.sol";
import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/IPancakeswapV2Router.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

interface IPancakeswapV2Router {
function swapExactTokensForTokens(
Expand Down
2 changes: 1 addition & 1 deletion contracts/InterestRateModel.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

/**
* @title Compound's InterestRateModel Interface
Expand Down
2 changes: 1 addition & 1 deletion contracts/JumpRateModelV2.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IAccessControlManagerV8 } from "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/Lens/PoolLens.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/MaxLoopsLimitHelper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

/**
* @title MaxLoopsLimitHelper
Expand Down
2 changes: 1 addition & 1 deletion contracts/Pool/PoolRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Pool/PoolRegistryInterface.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

/**
* @title PoolRegistryInterface
Expand Down
2 changes: 1 addition & 1 deletion contracts/Rewards/RewardsDistributor.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/RiskFund/IRiskFund.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

/**
* @title IRiskFund
Expand Down
2 changes: 1 addition & 1 deletion contracts/RiskFund/ReserveHelpers.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/RiskFund/RiskFund.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { SafeERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/Shortfall/Shortfall.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// @notice SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/VToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Ownable2StepUpgradeable } from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/VTokenInterfaces.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/WhitePaperInterestRateModel.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { InterestRateModel } from "./InterestRateModel.sol";
import { EXP_SCALE, MANTISSA_ONE } from "./lib/constants.sol";
Expand Down
3 changes: 1 addition & 2 deletions contracts/lib/ApproveOrRevert.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";

Expand Down
3 changes: 1 addition & 2 deletions contracts/lib/TokenDebtTracker.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/constants.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

/// @dev Base unit for computations, usually used in scaling (multiplications, divisions)
uint256 constant EXP_SCALE = 1e18;
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/imports.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

// This file is needed to make hardhat and typechain generate artifacts for
// contracts we depend on (e.g. in tests or deployments) but not use directly.
Expand Down
2 changes: 1 addition & 1 deletion contracts/lib/validators.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

/// @notice Thrown if the supplied address is a zero address where it is not allowed
error ZeroAddressNotAllowed();
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/HarnessMaxLoopsLimitHelper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { MaxLoopsLimitHelper } from "../MaxLoopsLimitHelper.sol";

Expand Down
3 changes: 2 additions & 1 deletion contracts/test/MockDeflationaryToken.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pragma solidity 0.8.13;
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;

contract MockDeflatingToken {
string public constant NAME = "Deflating Test Token";
Expand Down
3 changes: 2 additions & 1 deletion contracts/test/PrimeLiquidityProviderScenario.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pragma solidity 0.8.13;
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;

import { PrimeLiquidityProvider } from "@venusprotocol/venus-protocol/contracts/Tokens/Prime/PrimeLiquidityProvider.sol";

Expand Down
3 changes: 2 additions & 1 deletion contracts/test/PrimeScenario.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pragma solidity 0.8.13;
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;

import { Prime } from "@venusprotocol/venus-protocol/contracts/Tokens/Prime/Prime.sol";
import { IPrimeLiquidityProvider } from "@venusprotocol/venus-protocol/contracts/Tokens/Prime/Interfaces/IPrimeLiquidityProvider.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/WrappedNative.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.20;
pragma solidity 0.8.25;

contract WrappedNative {
string public name = "Wrapped Native";
Expand Down
3 changes: 1 addition & 2 deletions contracts/test/lib/ApproveOrRevertHarness.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { ApproveOrRevert } from "../../lib/ApproveOrRevert.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/lib/ProtocolShareReserve.sol
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pragma solidity 0.8.13;
pragma solidity 0.8.25;
import { ProtocolShareReserve } from "@venusprotocol/protocol-reserve/contracts/ProtocolReserve/ProtocolShareReserve.sol";
3 changes: 1 addition & 2 deletions contracts/test/lib/TokenDebtTrackerHarness.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { TokenDebtTracker } from "../../lib/TokenDebtTracker.sol";
Expand Down
19 changes: 2 additions & 17 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,30 +149,15 @@ const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.13",
settings: {
optimizer: {
enabled: true,
details: {
yul: !process.env.CI,
},
},
outputSelection: {
"*": {
"*": ["storageLayout"],
},
},
},
},
{
version: "0.8.20",
version: "0.8.25",
settings: {
optimizer: {
enabled: true,
details: {
yul: !process.env.CI,
},
},
evmVersion: "paris",
outputSelection: {
"*": {
"*": ["storageLayout"],
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"@types/node": "^12.20.50",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@venusprotocol/governance-contracts": "1.4.0",
"@venusprotocol/oracle": "1.10.0",
"@venusprotocol/protocol-reserve": "1.5.0-dev.8",
"@venusprotocol/venus-protocol": "7.5.0",
"@venusprotocol/governance-contracts": "2.0.0",
"@venusprotocol/oracle": "2.0.0",
"@venusprotocol/protocol-reserve": "2.0.0",
"@venusprotocol/venus-protocol": "8.0.0",
"bignumber.js": "9.0.0",
"chai": "^4.3.6",
"dotenv": "^10.0.0",
Expand Down
Loading

0 comments on commit 9190201

Please sign in to comment.