From 54a7bdcb04aa9d29b3726cf1f177aa5e955ec626 Mon Sep 17 00:00:00 2001 From: poma Date: Thu, 11 Mar 2021 23:05:59 +0300 Subject: [PATCH] update solidity to 0.7.6 --- contracts/ERC20Tornado.sol | 4 ++-- contracts/ETHTornado.sol | 4 ++-- contracts/MerkleTreeWithHistory.sol | 4 ++-- contracts/Mocks/BadRecipient.sol | 2 +- contracts/Mocks/ERC20Mock.sol | 2 +- contracts/Mocks/IDeployer.sol | 2 +- contracts/Mocks/IUSDT.sol | 2 +- contracts/Mocks/MerkleTreeWithHistoryMock.sol | 4 ++-- contracts/Tornado.sol | 4 ++-- contracts/Verifier.sol | 2 +- contracts/cTornado.sol | 4 ++-- package.json | 2 +- truffle-config.js | 2 +- yarn.lock | 8 ++++---- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/contracts/ERC20Tornado.sol b/contracts/ERC20Tornado.sol index 2a03e5f..a0221a0 100644 --- a/contracts/ERC20Tornado.sol +++ b/contracts/ERC20Tornado.sol @@ -10,7 +10,7 @@ */ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "./Tornado.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -26,7 +26,7 @@ contract ERC20Tornado is Tornado { uint256 _denomination, uint32 _merkleTreeHeight, IERC20 _token - ) public Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight) { + ) Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight) { token = _token; } diff --git a/contracts/ETHTornado.sol b/contracts/ETHTornado.sol index 5e6bb26..80681b9 100644 --- a/contracts/ETHTornado.sol +++ b/contracts/ETHTornado.sol @@ -10,7 +10,7 @@ */ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "./Tornado.sol"; @@ -20,7 +20,7 @@ contract ETHTornado is Tornado { IHasher _hasher, uint256 _denomination, uint32 _merkleTreeHeight - ) public Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight) {} + ) Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight) {} function _processDeposit() internal override { require(msg.value == denomination, "Please send `mixDenomination` ETH along with transaction"); diff --git a/contracts/MerkleTreeWithHistory.sol b/contracts/MerkleTreeWithHistory.sol index 87238fa..f594a75 100644 --- a/contracts/MerkleTreeWithHistory.sol +++ b/contracts/MerkleTreeWithHistory.sol @@ -10,7 +10,7 @@ */ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; interface IHasher { function MiMCSponge(uint256 in_xL, uint256 in_xR) external pure returns (uint256 xL, uint256 xR); @@ -35,7 +35,7 @@ contract MerkleTreeWithHistory { uint32 public currentRootIndex = 0; uint32 public nextIndex = 0; - constructor(uint32 _levels, IHasher _hasher) public { + constructor(uint32 _levels, IHasher _hasher) { require(_levels > 0, "_levels should be greater than zero"); require(_levels < 32, "_levels should be less than 32"); levels = _levels; diff --git a/contracts/Mocks/BadRecipient.sol b/contracts/Mocks/BadRecipient.sol index 09f49dd..f81229f 100644 --- a/contracts/Mocks/BadRecipient.sol +++ b/contracts/Mocks/BadRecipient.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; contract BadRecipient { fallback() external { diff --git a/contracts/Mocks/ERC20Mock.sol b/contracts/Mocks/ERC20Mock.sol index d291a6e..b7d09f7 100644 --- a/contracts/Mocks/ERC20Mock.sol +++ b/contracts/Mocks/ERC20Mock.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/contracts/Mocks/IDeployer.sol b/contracts/Mocks/IDeployer.sol index 63e119d..05ef3d1 100644 --- a/contracts/Mocks/IDeployer.sol +++ b/contracts/Mocks/IDeployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; interface IDeployer { function deploy(bytes memory _initCode, bytes32 _salt) external returns (address payable createdContract); diff --git a/contracts/Mocks/IUSDT.sol b/contracts/Mocks/IUSDT.sol index 5b59e44..4336622 100644 --- a/contracts/Mocks/IUSDT.sol +++ b/contracts/Mocks/IUSDT.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; interface ERC20Basic { function _totalSupply() external returns (uint256); diff --git a/contracts/Mocks/MerkleTreeWithHistoryMock.sol b/contracts/Mocks/MerkleTreeWithHistoryMock.sol index b50d499..bd1ab0a 100644 --- a/contracts/Mocks/MerkleTreeWithHistoryMock.sol +++ b/contracts/Mocks/MerkleTreeWithHistoryMock.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "../MerkleTreeWithHistory.sol"; contract MerkleTreeWithHistoryMock is MerkleTreeWithHistory { - constructor(uint32 _treeLevels, IHasher _hasher) public MerkleTreeWithHistory(_treeLevels, _hasher) {} + constructor(uint32 _treeLevels, IHasher _hasher) MerkleTreeWithHistory(_treeLevels, _hasher) {} function insert(bytes32 _leaf) public { _insert(_leaf); diff --git a/contracts/Tornado.sol b/contracts/Tornado.sol index 50b0a48..6459d49 100644 --- a/contracts/Tornado.sol +++ b/contracts/Tornado.sol @@ -10,7 +10,7 @@ */ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "./MerkleTreeWithHistory.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; @@ -42,7 +42,7 @@ abstract contract Tornado is MerkleTreeWithHistory, ReentrancyGuard { IHasher _hasher, uint256 _denomination, uint32 _merkleTreeHeight - ) public MerkleTreeWithHistory(_merkleTreeHeight, _hasher) { + ) MerkleTreeWithHistory(_merkleTreeHeight, _hasher) { require(_denomination > 0, "denomination should be greater than 0"); verifier = _verifier; denomination = _denomination; diff --git a/contracts/Verifier.sol b/contracts/Verifier.sol index 54c7251..69a5dfc 100644 --- a/contracts/Verifier.sol +++ b/contracts/Verifier.sol @@ -32,7 +32,7 @@ // 2019 OKIMS -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; library Pairing { uint256 constant PRIME_Q = 21888242871839275222246405745257275088696311157297823662689037894645226208583; diff --git a/contracts/cTornado.sol b/contracts/cTornado.sol index 8450ebb..06b729c 100644 --- a/contracts/cTornado.sol +++ b/contracts/cTornado.sol @@ -10,7 +10,7 @@ */ // SPDX-License-Identifier: MIT -pragma solidity ^0.6.0; +pragma solidity ^0.7.0; import "./ERC20Tornado.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; @@ -26,7 +26,7 @@ contract cTornado is ERC20Tornado { uint256 _denomination, uint32 _merkleTreeHeight, IERC20 _token - ) public ERC20Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight, _token) { + ) ERC20Tornado(_verifier, _hasher, _denomination, _merkleTreeHeight, _token) { require(address(_comp) != address(0), "Invalid COMP token address"); comp = _comp; } diff --git a/package.json b/package.json index 6aec949..9deb37f 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "author": "", "license": "ISC", "dependencies": { - "@openzeppelin/contracts": "^3.4.0", + "@openzeppelin/contracts": "^3.4.1", "@truffle/contract": "^4.0.39", "@truffle/hdwallet-provider": "^1.0.24", "axios": "^0.19.0", diff --git a/truffle-config.js b/truffle-config.js index e9f345e..be52484 100644 --- a/truffle-config.js +++ b/truffle-config.js @@ -107,7 +107,7 @@ module.exports = { // Configure your compilers compilers: { solc: { - version: '0.6.12', // Fetch exact version from solc-bin (default: truffle's version) + version: '0.7.6', // Fetch exact version from solc-bin (default: truffle's version) // docker: true, // Use "0.5.1" you've installed locally with docker (default: false) settings: { // See the solidity docs for advice about optimization and evmVersion diff --git a/yarn.lock b/yarn.lock index dac28c8..a2b607d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1127,10 +1127,10 @@ "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" -"@openzeppelin/contracts@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.0.tgz#9a1669ad5f9fdfb6e273bb5a4fed10cb4cc35eb0" - integrity sha512-qh+EiHWzfY/9CORr+eRUkeEUP1WiFUcq3974bLHwyYzLBUtK6HPaMkIUHi74S1rDTZ0sNz42DwPc5A4IJvN3rg== +"@openzeppelin/contracts@^3.4.1": + version "3.4.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.1.tgz#03c891fec7f93be0ae44ed74e57a122a38732ce7" + integrity sha512-cUriqMauq1ylzP2TxePNdPqkwI7Le3Annh4K9rrpvKfSBB/bdW+Iu1ihBaTIABTAAJ85LmKL5SSPPL9ry8d1gQ== "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2"