From b01bd6d475c4619eb2823c1c4c83ea50fba822a0 Mon Sep 17 00:00:00 2001 From: Clement Renaud Date: Thu, 14 Oct 2021 14:11:37 +0200 Subject: [PATCH 1/2] bump solidity versions --- contracts/interfaces/IUniswapExchange.sol | 2 +- contracts/interfaces/IUniswapFactory.sol | 2 +- contracts/math/BigDiv.sol | 4 ++-- contracts/math/Sqrt.sol | 2 +- contracts/protocols/Uniswap/UniswapOracle.sol | 4 ++-- contracts/protocols/Uniswap/UniswapV2Library.sol | 2 +- contracts/proxies/AntiOwnerProxy.sol | 2 +- contracts/proxies/CallContract.sol | 2 +- contracts/proxies/Clone2Factory.sol | 2 +- contracts/proxies/Clone2Probe.sol | 2 +- contracts/proxies/CloneFactory.sol | 2 +- contracts/proxies/Create2Probe.sol | 2 +- contracts/test-artifacts/BigDivMock.sol | 2 +- contracts/test-artifacts/CallContractMock.sol | 2 +- contracts/test-artifacts/CloneFactoryMock.sol | 2 +- contracts/test-artifacts/HelloWorld.sol | 2 +- contracts/test-artifacts/Log.sol | 2 +- contracts/test-artifacts/SqrtMock.sol | 2 +- contracts/test-artifacts/TestReturnValue.sol | 2 +- contracts/test-artifacts/UtilsMock.sol | 2 +- contracts/tokens/ERC20/ApproveAndCall.sol | 2 +- contracts/utils/ChainId.sol | 2 +- contracts/utils/Gas.sol | 2 +- truffle-config.js | 2 +- 24 files changed, 26 insertions(+), 26 deletions(-) diff --git a/contracts/interfaces/IUniswapExchange.sol b/contracts/interfaces/IUniswapExchange.sol index aedcb04..563013c 100644 --- a/contracts/interfaces/IUniswapExchange.sol +++ b/contracts/interfaces/IUniswapExchange.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // Source: https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_exchange.vy diff --git a/contracts/interfaces/IUniswapFactory.sol b/contracts/interfaces/IUniswapFactory.sol index 8c2e4f0..ff5ecf0 100644 --- a/contracts/interfaces/IUniswapFactory.sol +++ b/contracts/interfaces/IUniswapFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0 -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // Source: https://github.com/Uniswap/contracts-vyper/blob/master/contracts/uniswap_factory.vy diff --git a/contracts/math/BigDiv.sol b/contracts/math/BigDiv.sol index d4858a3..0828418 100644 --- a/contracts/math/BigDiv.sol +++ b/contracts/math/BigDiv.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; -import '@openzeppelin/contracts/math/SafeMath.sol'; +import '@openzeppelin/contracts/utils/math/SafeMath.sol'; /** * @title Reduces the size of terms before multiplication, to avoid an overflow, and then diff --git a/contracts/math/Sqrt.sol b/contracts/math/Sqrt.sol index a45dc96..2231364 100644 --- a/contracts/math/Sqrt.sol +++ b/contracts/math/Sqrt.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; /** diff --git a/contracts/protocols/Uniswap/UniswapOracle.sol b/contracts/protocols/Uniswap/UniswapOracle.sol index 78229b4..94ccd0d 100644 --- a/contracts/protocols/Uniswap/UniswapOracle.sol +++ b/contracts/protocols/Uniswap/UniswapOracle.sol @@ -2,12 +2,12 @@ // SPDX-License-Identifier: GPL-3.0 // Original source: https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/examples // Modified to unpin solidity version and to support multiple pairs -pragma solidity ^0.6.6; +pragma solidity ^0.8.2; import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol'; import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; import '@uniswap/lib/contracts/libraries/FixedPoint.sol'; -import '@openzeppelin/contracts/math/SafeMath.sol'; +import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@uniswap/v2-periphery/contracts/libraries/UniswapV2OracleLibrary.sol'; import './UniswapV2Library.sol'; import './IUniswapOracle.sol'; diff --git a/contracts/protocols/Uniswap/UniswapV2Library.sol b/contracts/protocols/Uniswap/UniswapV2Library.sol index 59b05d6..c2c1099 100644 --- a/contracts/protocols/Uniswap/UniswapV2Library.sol +++ b/contracts/protocols/Uniswap/UniswapV2Library.sol @@ -4,7 +4,7 @@ pragma solidity >=0.5.0; import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol'; -import '@openzeppelin/contracts/math/SafeMath.sol'; +import '@openzeppelin/contracts/utils/math/SafeMath.sol'; library UniswapV2Library { using SafeMath for uint; diff --git a/contracts/proxies/AntiOwnerProxy.sol b/contracts/proxies/AntiOwnerProxy.sol index 85fabad..165c0d0 100644 --- a/contracts/proxies/AntiOwnerProxy.sol +++ b/contracts/proxies/AntiOwnerProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import './CallContract.sol'; diff --git a/contracts/proxies/CallContract.sol b/contracts/proxies/CallContract.sol index 77e11b7..a83aac9 100644 --- a/contracts/proxies/CallContract.sol +++ b/contracts/proxies/CallContract.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; /** * @title Calls an arbitrary contract function. diff --git a/contracts/proxies/Clone2Factory.sol b/contracts/proxies/Clone2Factory.sol index 0f46bdf..a9046a8 100644 --- a/contracts/proxies/Clone2Factory.sol +++ b/contracts/proxies/Clone2Factory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // From https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol diff --git a/contracts/proxies/Clone2Probe.sol b/contracts/proxies/Clone2Probe.sol index 05c73e5..290d026 100644 --- a/contracts/proxies/Clone2Probe.sol +++ b/contracts/proxies/Clone2Probe.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/ProxyFactory.sol diff --git a/contracts/proxies/CloneFactory.sol b/contracts/proxies/CloneFactory.sol index b008b50..e184693 100644 --- a/contracts/proxies/CloneFactory.sol +++ b/contracts/proxies/CloneFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // From https://github.com/optionality/clone-factory/blob/master/contracts/CloneFactory.sol diff --git a/contracts/proxies/Create2Probe.sol b/contracts/proxies/Create2Probe.sol index 9761e60..a4b9393 100644 --- a/contracts/proxies/Create2Probe.sol +++ b/contracts/proxies/Create2Probe.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; // https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/upgradeability/ProxyFactory.sol diff --git a/contracts/test-artifacts/BigDivMock.sol b/contracts/test-artifacts/BigDivMock.sol index 7efd985..a83020a 100644 --- a/contracts/test-artifacts/BigDivMock.sol +++ b/contracts/test-artifacts/BigDivMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '../math/BigDiv.sol'; diff --git a/contracts/test-artifacts/CallContractMock.sol b/contracts/test-artifacts/CallContractMock.sol index ecf3f9d..b81aa19 100644 --- a/contracts/test-artifacts/CallContractMock.sol +++ b/contracts/test-artifacts/CallContractMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '../proxies/CallContract.sol'; diff --git a/contracts/test-artifacts/CloneFactoryMock.sol b/contracts/test-artifacts/CloneFactoryMock.sol index 4f800a1..2a28f0e 100644 --- a/contracts/test-artifacts/CloneFactoryMock.sol +++ b/contracts/test-artifacts/CloneFactoryMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '../proxies/CloneFactory.sol'; import '../proxies/Clone2Factory.sol'; diff --git a/contracts/test-artifacts/HelloWorld.sol b/contracts/test-artifacts/HelloWorld.sol index ff3ad82..ca68915 100644 --- a/contracts/test-artifacts/HelloWorld.sol +++ b/contracts/test-artifacts/HelloWorld.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; contract HelloWorld { diff --git a/contracts/test-artifacts/Log.sol b/contracts/test-artifacts/Log.sol index 5519422..0484893 100644 --- a/contracts/test-artifacts/Log.sol +++ b/contracts/test-artifacts/Log.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; /** diff --git a/contracts/test-artifacts/SqrtMock.sol b/contracts/test-artifacts/SqrtMock.sol index 06f4b4c..f9357e1 100644 --- a/contracts/test-artifacts/SqrtMock.sol +++ b/contracts/test-artifacts/SqrtMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '../math/Sqrt.sol'; diff --git a/contracts/test-artifacts/TestReturnValue.sol b/contracts/test-artifacts/TestReturnValue.sol index 0acf253..2b19222 100644 --- a/contracts/test-artifacts/TestReturnValue.sol +++ b/contracts/test-artifacts/TestReturnValue.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; contract TestReturnValue { diff --git a/contracts/test-artifacts/UtilsMock.sol b/contracts/test-artifacts/UtilsMock.sol index ca52a70..e05703b 100644 --- a/contracts/test-artifacts/UtilsMock.sol +++ b/contracts/test-artifacts/UtilsMock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '../utils/ChainId.sol'; diff --git a/contracts/tokens/ERC20/ApproveAndCall.sol b/contracts/tokens/ERC20/ApproveAndCall.sol index 50a69a4..6a8d03a 100644 --- a/contracts/tokens/ERC20/ApproveAndCall.sol +++ b/contracts/tokens/ERC20/ApproveAndCall.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '../../proxies/CallContract.sol'; diff --git a/contracts/utils/ChainId.sol b/contracts/utils/ChainId.sol index 5c67ad4..9ccef2a 100644 --- a/contracts/utils/ChainId.sol +++ b/contracts/utils/ChainId.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; library ChainId diff --git a/contracts/utils/Gas.sol b/contracts/utils/Gas.sol index 4f146af..9167ff5 100644 --- a/contracts/utils/Gas.sol +++ b/contracts/utils/Gas.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.8.2; library Gas diff --git a/truffle-config.js b/truffle-config.js index 412c228..8a92dec 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -9,7 +9,7 @@ module.exports = { }, compilers: { solc: { - version: "0.6.10", + version: "0.8.2", settings: { optimizer: { enabled: true, From 561f776acac4d630526247bf5d8fa742c296ec05 Mon Sep 17 00:00:00 2001 From: Clement Renaud Date: Thu, 14 Oct 2021 14:11:51 +0200 Subject: [PATCH 2/2] upgrade openzeppelin --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8d20780..67d720e 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "homepage": "https://github.com/HardlyDifficult/hardlydifficult-eth#readme", "dependencies": { - "@openzeppelin/contracts": "3.4.2", + "@openzeppelin/contracts": "4.3.2", "@truffle/contract": "4.3.38", "@uniswap/lib": "2.1.0", "@uniswap/v2-core": "1.0.1",