Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Upgrade to Solidity 0.8.x #541

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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/interfaces/IUniswapExchange.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniswapFactory.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions contracts/math/BigDiv.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/math/Sqrt.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/protocols/Uniswap/UniswapOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion contracts/protocols/Uniswap/UniswapV2Library.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/AntiOwnerProxy.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;

import './CallContract.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/CallContract.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;

/**
* @title Calls an arbitrary contract function.
Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/Clone2Factory.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/Clone2Probe.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/CloneFactory.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/proxies/Create2Probe.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/BigDivMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


import '../math/BigDiv.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/CallContractMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;

import '../proxies/CallContract.sol';

Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/CloneFactoryMock.sol
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/HelloWorld.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;

contract HelloWorld
{
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/Log.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/SqrtMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


import '../math/Sqrt.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/TestReturnValue.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;

contract TestReturnValue
{
Expand Down
2 changes: 1 addition & 1 deletion contracts/test-artifacts/UtilsMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


import '../utils/ChainId.sol';
Expand Down
2 changes: 1 addition & 1 deletion contracts/tokens/ERC20/ApproveAndCall.sol
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/ChainId.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


library ChainId
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/Gas.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
pragma solidity ^0.8.2;


library Gas
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion truffle-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
},
compilers: {
solc: {
version: "0.6.10",
version: "0.8.2",
settings: {
optimizer: {
enabled: true,
Expand Down