From e67934668330062341da08154722ce5b3d9cec6f Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Fri, 12 Apr 2024 12:19:33 +0300 Subject: [PATCH] feat!: migrate to Solidity 0.8.25 --- contracts/Bridge/BaseXVSProxyOFT.sol | 2 +- contracts/Bridge/XVSBridgeAdmin.sol | 3 +- contracts/Bridge/XVSProxyOFTDest.sol | 2 +- contracts/Bridge/XVSProxyOFTSrc.sol | 2 +- contracts/Bridge/interfaces/IXVS.sol | 2 +- contracts/Bridge/interfaces/IXVSProxyOFT.sol | 2 +- contracts/Bridge/token/TokenController.sol | 3 +- contracts/Bridge/token/XVS.sol | 2 +- hardhat.config.ts | 3 +- package.json | 6 +-- yarn.lock | 45 ++++++++++++++------ 11 files changed, 46 insertions(+), 26 deletions(-) diff --git a/contracts/Bridge/BaseXVSProxyOFT.sol b/contracts/Bridge/BaseXVSProxyOFT.sol index 69685a0..7b7041c 100644 --- a/contracts/Bridge/BaseXVSProxyOFT.sol +++ b/contracts/Bridge/BaseXVSProxyOFT.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity 0.8.25; import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol"; diff --git a/contracts/Bridge/XVSBridgeAdmin.sol b/contracts/Bridge/XVSBridgeAdmin.sol index ac61317..038a947 100644 --- a/contracts/Bridge/XVSBridgeAdmin.sol +++ b/contracts/Bridge/XVSBridgeAdmin.sol @@ -1,6 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause - -pragma solidity 0.8.13; +pragma solidity 0.8.25; import { AccessControlledV8 } from "@venusprotocol/governance-contracts/contracts/Governance/AccessControlledV8.sol"; import { ensureNonzeroAddress } from "@venusprotocol/solidity-utilities/contracts/validators.sol"; diff --git a/contracts/Bridge/XVSProxyOFTDest.sol b/contracts/Bridge/XVSProxyOFTDest.sol index 5f1aa3e..ee9e3c3 100644 --- a/contracts/Bridge/XVSProxyOFTDest.sol +++ b/contracts/Bridge/XVSProxyOFTDest.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity 0.8.25; import { IXVS } from "./interfaces/IXVS.sol"; import { BaseXVSProxyOFT } from "./BaseXVSProxyOFT.sol"; diff --git a/contracts/Bridge/XVSProxyOFTSrc.sol b/contracts/Bridge/XVSProxyOFTSrc.sol index fcd4da1..923c980 100644 --- a/contracts/Bridge/XVSProxyOFTSrc.sol +++ b/contracts/Bridge/XVSProxyOFTSrc.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity 0.8.25; import { SafeERC20, IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { BaseXVSProxyOFT } from "./BaseXVSProxyOFT.sol"; diff --git a/contracts/Bridge/interfaces/IXVS.sol b/contracts/Bridge/interfaces/IXVS.sol index fcbc222..fed4af9 100644 --- a/contracts/Bridge/interfaces/IXVS.sol +++ b/contracts/Bridge/interfaces/IXVS.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity ^0.8.25; /** * @title IXVS diff --git a/contracts/Bridge/interfaces/IXVSProxyOFT.sol b/contracts/Bridge/interfaces/IXVSProxyOFT.sol index 78d92b1..04becee 100644 --- a/contracts/Bridge/interfaces/IXVSProxyOFT.sol +++ b/contracts/Bridge/interfaces/IXVSProxyOFT.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity ^0.8.25; /** * @title IXVSProxyOFT diff --git a/contracts/Bridge/token/TokenController.sol b/contracts/Bridge/token/TokenController.sol index cf87ebd..e0a3567 100644 --- a/contracts/Bridge/token/TokenController.sol +++ b/contracts/Bridge/token/TokenController.sol @@ -1,5 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity 0.8.25; + import { IAccessControlManagerV8 } from "@venusprotocol/governance-contracts/contracts/Governance/IAccessControlManagerV8.sol"; import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/contracts/Bridge/token/XVS.sol b/contracts/Bridge/token/XVS.sol index b1a64ff..0e2bf20 100644 --- a/contracts/Bridge/token/XVS.sol +++ b/contracts/Bridge/token/XVS.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -pragma solidity 0.8.13; +pragma solidity 0.8.25; import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; diff --git a/hardhat.config.ts b/hardhat.config.ts index 082044e..61db88e 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -69,7 +69,7 @@ const config: HardhatUserConfig = { solidity: { compilers: [ { - version: "0.8.13", + version: "0.8.25", settings: { optimizer: { enabled: true, @@ -77,6 +77,7 @@ const config: HardhatUserConfig = { yul: !process.env.CI, }, }, + evmVersion: "paris", outputSelection: { "*": { "*": ["storageLayout"], diff --git a/package.json b/package.json index f7999b6..faf3730 100644 --- a/package.json +++ b/package.json @@ -60,9 +60,9 @@ "@types/node": "^12.20.50", "@typescript-eslint/eslint-plugin": "^5.27.1", "@typescript-eslint/parser": "^5.27.1", - "@venusprotocol/governance-contracts": "^1.4.0", - "@venusprotocol/oracle": "^1.8.0", - "@venusprotocol/solidity-utilities": "1.1.0", + "@venusprotocol/governance-contracts": "^2.0.0", + "@venusprotocol/oracle": "^2.0.0", + "@venusprotocol/solidity-utilities": "2.0.0", "bignumber.js": "9.0.0", "chai": "^4.3.6", "dotenv": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index 7f1d771..0e7f433 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3052,7 +3052,7 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/governance-contracts@npm:^1.4.0, @venusprotocol/governance-contracts@npm:^1.4.0-dev.1, @venusprotocol/governance-contracts@npm:^1.4.0-dev.9": +"@venusprotocol/governance-contracts@npm:^1.4.0-dev.1": version: 1.4.0 resolution: "@venusprotocol/governance-contracts@npm:1.4.0" dependencies: @@ -3063,23 +3063,35 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/oracle@npm:^1.8.0": - version: 1.8.0 - resolution: "@venusprotocol/oracle@npm:1.8.0" +"@venusprotocol/governance-contracts@npm:^2.0.0": + version: 2.0.0 + resolution: "@venusprotocol/governance-contracts@npm:2.0.0" + dependencies: + "@venusprotocol/solidity-utilities": 2.0.0 + hardhat-deploy-ethers: ^0.3.0-beta.13 + module-alias: ^2.2.2 + checksum: 18b56d951c4e68fa1edadc93ed44daa55c8b81294778a4969d940a084de6d949630eacd4702d1b92f04ad5d709963a3a0a790014871ec34b0b2f4806cebc731c + languageName: node + linkType: hard + +"@venusprotocol/oracle@npm:^2.0.0": + version: 2.0.0 + resolution: "@venusprotocol/oracle@npm:2.0.0" dependencies: "@chainlink/contracts": ^0.5.1 "@defi-wonderland/smock": ^2.3.4 "@nomicfoundation/hardhat-network-helpers": ^1.0.8 "@openzeppelin/contracts": ^4.6.0 "@openzeppelin/contracts-upgradeable": ^4.7.3 - "@venusprotocol/governance-contracts": ^1.4.0-dev.9 + "@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 hardhat-deploy: ^0.11.14 module-alias: ^2.2.2 solidity-docgen: ^0.6.0-beta.29 - checksum: 3ea02a9686e80ce0b378aa5197fd46b2c02b089bd5512afe673d6d45e3091e280dbf04788400ea47bee4151182b4b39c981207e1d42fbe2b970161b29abcfee1 + checksum: 00673550cdc63244eba2872b32253454a3b2062c2759075c68449b2923f2bb645e971d5ca0cbfd288bddd092d346a5f3e49d10bbb97d743fb33f9ece14179723 languageName: node linkType: hard @@ -3100,10 +3112,10 @@ __metadata: languageName: node linkType: hard -"@venusprotocol/solidity-utilities@npm:1.1.0, @venusprotocol/solidity-utilities@npm:^1.1.0": - version: 1.1.0 - resolution: "@venusprotocol/solidity-utilities@npm:1.1.0" - checksum: 3b17ec451cd0ba5aaea76686c7bef35757fb158709214be094f73ebd0d643c79817159f7aa162cc694e1a5ee1f02b20e26211a65929113b985827959aae99fa7 +"@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 @@ -3114,6 +3126,13 @@ __metadata: languageName: node linkType: hard +"@venusprotocol/solidity-utilities@npm:^1.1.0": + version: 1.1.0 + resolution: "@venusprotocol/solidity-utilities@npm:1.1.0" + checksum: 3b17ec451cd0ba5aaea76686c7bef35757fb158709214be094f73ebd0d643c79817159f7aa162cc694e1a5ee1f02b20e26211a65929113b985827959aae99fa7 + languageName: node + linkType: hard + "@venusprotocol/token-bridge@workspace:.": version: 0.0.0-use.local resolution: "@venusprotocol/token-bridge@workspace:." @@ -3141,9 +3160,9 @@ __metadata: "@types/node": ^12.20.50 "@typescript-eslint/eslint-plugin": ^5.27.1 "@typescript-eslint/parser": ^5.27.1 - "@venusprotocol/governance-contracts": ^1.4.0 - "@venusprotocol/oracle": ^1.8.0 - "@venusprotocol/solidity-utilities": 1.1.0 + "@venusprotocol/governance-contracts": ^2.0.0 + "@venusprotocol/oracle": ^2.0.0 + "@venusprotocol/solidity-utilities": 2.0.0 bignumber.js: 9.0.0 chai: ^4.3.6 dotenv: ^10.0.0