Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: migrate to Solidity 0.8.25 #177

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/ResilientOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2022 Venus
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "./interfaces/VBep20Interface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/FeedRegistryInterface.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 FeedRegistryInterface {
function latestRoundDataByName(
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IStETH.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 IStETH {
function getPooledEthByShares(uint256 _sharesAmount) external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/OracleInterface.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;

Check warning on line 2 in contracts/interfaces/OracleInterface.sol

View workflow job for this annotation

GitHub Actions / Lint

Found more than One contract per file. 4 contracts found!

interface OracleInterface {
function getPrice(address asset) external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/PublicResolverInterface.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2022 Venus
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

interface PublicResolverInterface {
function addr(bytes32 node) external view returns (address payable);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/PythInterface.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2021 Pyth Data Foundation
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

contract PythStructs {
// A price with a degree of uncertainty, represented as a price +- a confidence interval.
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/SIDRegistryInterface.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: 2022 Venus
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

interface SIDRegistryInterface {
function resolver(bytes32 node) external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/VBep20Interface.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity ^0.8.25;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

Check warning on line 4 in contracts/interfaces/VBep20Interface.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

interface VBep20Interface is IERC20Metadata {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/BinanceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

Check warning on line 4 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/VBep20Interface.sol";

Check warning on line 5 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/VBep20Interface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/SIDRegistryInterface.sol";

Check warning on line 6 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/SIDRegistryInterface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/FeedRegistryInterface.sol";

Check warning on line 7 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/FeedRegistryInterface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/PublicResolverInterface.sol";

Check warning on line 8 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/PublicResolverInterface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/OracleInterface.sol";

Check warning on line 9 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/OracleInterface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol";

Check warning on line 10 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path @venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)
import "../interfaces/OracleInterface.sol";

Check warning on line 11 in contracts/oracles/BinanceOracle.sol

View workflow job for this annotation

GitHub Actions / Lint

global import of path ../interfaces/OracleInterface.sol is not allowed. Specify names to import individually or bind all exports of the module into a name (import "path" as Name)

/**
* @title BinanceOracle
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/BoundValidator.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 "../interfaces/VBep20Interface.sol";
import "../interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/ChainlinkOracle.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 "../interfaces/VBep20Interface.sol";
import "../interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/PythOracle.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 "@openzeppelin/contracts/utils/math/SafeCast.sol";
import "@openzeppelin/contracts/utils/math/SignedMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/SequencerChainlinkOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
pragma solidity 0.8.25;

import { ChainlinkOracle } from "./ChainlinkOracle.sol";
import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/WstETHOracle.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 { OracleInterface } from "../interfaces/OracleInterface.sol";
import { IStETH } from "../interfaces/IStETH.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/mocks/MockBinanceFeedRegistry.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 "../../interfaces/FeedRegistryInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/mocks/MockBinanceOracle.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 { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { OracleInterface } from "../../interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/mocks/MockChainlinkOracle.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 { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { OracleInterface } from "../../interfaces/OracleInterface.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/mocks/MockPythOracle.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 { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { IPyth } from "../PythOracle.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/AccessControlManager.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 "@openzeppelin/contracts/access/AccessControl.sol";
import "@venusprotocol/governance-contracts/contracts/Governance/AccessControlManager.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/BEP20Harness.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 "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockPyth.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 "../interfaces/PythInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockSimpleOracle.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 "../interfaces/OracleInterface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/MockV3Aggregator.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 "@chainlink/contracts/src/v0.8/interfaces/AggregatorV2V3Interface.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/PancakePairHarness.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;

// a library for performing various math operations

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/VBEP20Harness.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 "./BEP20Harness.sol";

Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const config: HardhatUserConfig = {
solidity: {
compilers: [
{
version: "0.8.13",
version: "0.8.25",
settings: {
optimizer: {
enabled: true,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"@nomicfoundation/hardhat-network-helpers": "^1.0.8",
"@openzeppelin/contracts": "^4.6.0",
"@openzeppelin/contracts-upgradeable": "^4.7.3",
"@venusprotocol/governance-contracts": "^1.4.0",
"@venusprotocol/solidity-utilities": "1.3.0",
"@venusprotocol/governance-contracts": "^2.0.0",
"@venusprotocol/solidity-utilities": "^2.0.0",
"@venusprotocol/venus-protocol": "^6.0.0",
"ethers": "^5.6.8",
"hardhat": "^2.16.1",
Expand Down
30 changes: 15 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3135,25 +3135,25 @@ __metadata:
languageName: node
linkType: hard

"@venusprotocol/governance-contracts@npm:^1.4.0":
version: 1.4.0
resolution: "@venusprotocol/governance-contracts@npm:1.4.0"
"@venusprotocol/governance-contracts@npm:^1.4.0-dev.1":
version: 1.4.0-dev.9
resolution: "@venusprotocol/governance-contracts@npm:1.4.0-dev.9"
dependencies:
"@venusprotocol/solidity-utilities": ^1.1.0
hardhat-deploy-ethers: ^0.3.0-beta.13
module-alias: ^2.2.2
checksum: 85c6b6a815edb0befa4c38e3652a58464827d390620210b99575c16960ee6505e95e7c2192ebc972da7ed758d3c62e150d32fbdd1f01acab1731f29b11d1884e
checksum: 25583a20738973d2ade4a1fdf84dcacf0caec42004f5bf755fdfa29b3602f2b9184638f2d828359195bf8baa3b082797cad941874be1a91a61900b343420cead
languageName: node
linkType: hard

"@venusprotocol/governance-contracts@npm:^1.4.0-dev.1":
version: 1.4.0-dev.9
resolution: "@venusprotocol/governance-contracts@npm:1.4.0-dev.9"
"@venusprotocol/governance-contracts@npm:^2.0.0":
version: 2.0.0
resolution: "@venusprotocol/governance-contracts@npm:2.0.0"
dependencies:
"@venusprotocol/solidity-utilities": ^1.1.0
"@venusprotocol/solidity-utilities": 2.0.0
hardhat-deploy-ethers: ^0.3.0-beta.13
module-alias: ^2.2.2
checksum: 25583a20738973d2ade4a1fdf84dcacf0caec42004f5bf755fdfa29b3602f2b9184638f2d828359195bf8baa3b082797cad941874be1a91a61900b343420cead
checksum: 18b56d951c4e68fa1edadc93ed44daa55c8b81294778a4969d940a084de6d949630eacd4702d1b92f04ad5d709963a3a0a790014871ec34b0b2f4806cebc731c
languageName: node
linkType: hard

Expand Down Expand Up @@ -3188,8 +3188,8 @@ __metadata:
"@types/sinon-chai": ^3.2.9
"@typescript-eslint/eslint-plugin": ^5.27.1
"@typescript-eslint/parser": ^5.27.1
"@venusprotocol/governance-contracts": ^1.4.0
"@venusprotocol/solidity-utilities": 1.3.0
"@venusprotocol/governance-contracts": ^2.0.0
"@venusprotocol/solidity-utilities": ^2.0.0
"@venusprotocol/venus-protocol": ^6.0.0
chai: ^4.3.6
cross-env: ^7.0.3
Expand Down Expand Up @@ -3241,10 +3241,10 @@ __metadata:
languageName: node
linkType: hard

"@venusprotocol/solidity-utilities@npm:1.3.0":
version: 1.3.0
resolution: "@venusprotocol/solidity-utilities@npm:1.3.0"
checksum: d1109365a5e01959c47b25fb129373db93792e60bf1bc0ed324b63c2a64f6e4a7878ebf016cfade94bc41a2c1245d3e861fdc6b8c5844ac210ed1d73e7307e72
"@venusprotocol/solidity-utilities@npm:2.0.0, @venusprotocol/solidity-utilities@npm:^2.0.0":
version: 2.0.0
resolution: "@venusprotocol/solidity-utilities@npm:2.0.0"
checksum: 87a2ce2fd1d702bc04c4e98d675b904176c7f2489476e8da586d1782b48faae92aa4f2ba894737773d189ba72a6b274f1464cf2e0308e62758303d0adde749e6
languageName: node
linkType: hard

Expand Down
Loading