Skip to content

Commit

Permalink
Merge pull request #103 from 1inch/feature/bump-solidity
Browse files Browse the repository at this point in the history
[SC-989][SC-990] Solidity 0.8.23, OZ 5.0.0
  • Loading branch information
ZumZoom authored Dec 20, 2023
2 parents 582d444 + 2732a8d commit 318ee4a
Show file tree
Hide file tree
Showing 72 changed files with 575 additions and 1,525 deletions.
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "solhint:recommended",
"rules": {
"compiler-version": ["error", "0.8.19"],
"compiler-version": ["error", "0.8.23"],
"explicit-types": ["off"],
"func-named-parameters": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }],
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"solidity.compileUsingRemoteVersion": "0.8.19"
"solidity.compileUsingRemoteVersion": "0.8.23"
}
2 changes: 1 addition & 1 deletion contracts/GasEstimator.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

contract GasEstimator {
function gasLimit() external view returns (uint256) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/MultiWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down Expand Up @@ -29,7 +29,7 @@ contract MultiWrapper is Ownable {
* @dev Initializes the MultiWrapper with an array of existing `IWrapper` contracts.
* @param existingWrappers Initial wrappers to be added.
*/
constructor(IWrapper[] memory existingWrappers) {
constructor(IWrapper[] memory existingWrappers, address owner_) Ownable(owner_) {
unchecked {
for (uint256 i = 0; i < existingWrappers.length; i++) {
if (!_wrappers.add(address(existingWrappers[i]))) revert WrapperAlreadyAdded();
Expand Down
5 changes: 2 additions & 3 deletions contracts/OffchainOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down Expand Up @@ -50,7 +50,7 @@ contract OffchainOracle is Ownable {
IERC20 private constant _BASE = IERC20(0x0000000000000000000000000000000000000000);
IERC20 private immutable _WBASE;

constructor(MultiWrapper _multiWrapper, IOracle[] memory existingOracles, OracleType[] memory oracleTypes, IERC20[] memory existingConnectors, IERC20 wBase, address owner) {
constructor(MultiWrapper _multiWrapper, IOracle[] memory existingOracles, OracleType[] memory oracleTypes, IERC20[] memory existingConnectors, IERC20 wBase, address owner_) Ownable(owner_) {
unchecked {
if(existingOracles.length != oracleTypes.length) revert ArraysLengthMismatch();
multiWrapper = _multiWrapper;
Expand All @@ -74,7 +74,6 @@ contract OffchainOracle is Ownable {
}
_WBASE = wBase;
}
if (owner != msg.sender) transferOwnership(owner);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IBzxProtocol.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface IBzxProtocol {
function underlyingToLoanPool(address underlying) external view returns (address loanPool);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ICToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
4 changes: 3 additions & 1 deletion contracts/interfaces/IChai.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
// solhint-disable one-contract-per-file

pragma solidity 0.8.23;

interface IChai {
function balanceOf(address) external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IChainlink.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IComptroller.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "./ICToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ICurveProvider.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

// solhint-disable func-name-mixedcase

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ICurveRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

// solhint-disable func-name-mixedcase

Expand Down
4 changes: 3 additions & 1 deletion contracts/interfaces/ICurveSwap.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
// solhint-disable one-contract-per-file

pragma solidity 0.8.23;

// solhint-disable func-name-mixedcase

Expand Down
4 changes: 3 additions & 1 deletion contracts/interfaces/IDodo.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
// solhint-disable one-contract-per-file

pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
4 changes: 3 additions & 1 deletion contracts/interfaces/IDodoFactories.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
// solhint-disable one-contract-per-file

pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IKyberDmmFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IKyberDmmPool.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface IKyberDmmPool {
function getTradeInfo() external view returns (uint112 reserve0, uint112 reserve1, uint112 _vReserve0, uint112 _vReserve1, uint256 feeInPrecision);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILendingPoolV1.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILendingPoolV2.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ILoanToken.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface ILoanToken {
function tokenPrice() external view returns (uint256 price);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IMooniswap.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IMooniswapFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "./IMooniswap.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISDai.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface ISDai {
function previewDeposit(uint256 assets) external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISolidlyFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISynthetixAddressResolver.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

// https://docs.synthetix.io/contracts/source/interfaces/iaddressresolver
interface ISynthetixAddressResolver {
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISynthetixExchangeRates.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface ISynthetixExchangeRates {
function rateAndInvalid(bytes32 currencyKey) external view returns (uint256 rate, bool isInvalid);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ISynthetixProxy.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface ISynthetixProxy {
function target() external view returns (address);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapFactory.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapV2Pair.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: UNLICENSED

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface IUniswapV2Pair {
function getReserves() external view returns (uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapV3Pool.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IWstETH.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

interface IWstETH {
function tokensPerStEth() external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IYVault.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

Expand Down
6 changes: 3 additions & 3 deletions contracts/libraries/OraclePrices.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

/**
* @title OraclePrices
Expand All @@ -12,7 +12,7 @@ import "@openzeppelin/contracts/utils/math/SafeMath.sol";
* The level of low-weight pool filtering can be managed using the thresholdFilter parameter.
*/
library OraclePrices {
using SafeMath for uint256;
using Math for uint256;

/**
* @title Oracle Price Data Structure
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/SimpleOracleMock.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/IOracle.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/ChainlinkOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeCast.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/CurveOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/DodoOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/DodoV2Oracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
4 changes: 3 additions & 1 deletion contracts/oracles/KlaySwapOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
// solhint-disable one-contract-per-file

pragma solidity 0.8.23;

import "./OracleBase.sol";
import "../interfaces/IUniswapV2Pair.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/KyberDmmOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/MooniswapOracle.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "../interfaces/IMooniswapFactory.sol";
import "./OracleBase.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/oracles/OracleBase.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity 0.8.19;
pragma solidity 0.8.23;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
Expand Down
Loading

0 comments on commit 318ee4a

Please sign in to comment.