From 9480889a197b04d453107b81c786c6229a9ce33a Mon Sep 17 00:00:00 2001 From: Alex Forshtat Date: Tue, 17 Dec 2024 14:56:17 +0100 Subject: [PATCH] Use ReentrancyGuardTransient in the EntryPoint --- contracts/core/EntryPoint.sol | 4 ++-- contracts/package.json | 2 +- hardhat.config.ts | 12 +++++++----- package.json | 2 +- yarn.lock | 8 ++++---- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/contracts/core/EntryPoint.sol b/contracts/core/EntryPoint.sol index f3ff909c..5165fc36 100644 --- a/contracts/core/EntryPoint.sol +++ b/contracts/core/EntryPoint.sol @@ -16,7 +16,7 @@ import "./NonceManager.sol"; import "./UserOperationLib.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; -import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; +import "@openzeppelin/contracts/utils/ReentrancyGuardTransient.sol"; /* * Account-Abstraction (EIP-4337) singleton EntryPoint implementation. @@ -24,7 +24,7 @@ import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; */ /// @custom:security-contact https://bounty.ethereum.org -contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuard, ERC165 { +contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardTransient, ERC165 { using UserOperationLib for PackedUserOperation; diff --git a/contracts/package.json b/contracts/package.json index bb1703cb..6420f51e 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -23,7 +23,7 @@ "url": "https://github.com/eth-infinitism/account-abstraction/issues" }, "dependencies": { - "@openzeppelin/contracts": "^5.0.0", + "@openzeppelin/contracts": "^5.1.0", "@uniswap/v3-periphery": "^1.4.3" } } diff --git a/hardhat.config.ts b/hardhat.config.ts index 32dbd886..b78ae682 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -43,12 +43,14 @@ const optimizedComilerSettings = { const config: HardhatUserConfig = { solidity: { - compilers: [{ - version: '0.8.28', - settings: { - optimizer: { enabled: true, runs: 1000000 } + version: '0.8.28', + settings: { + evmVersion: `cancun`, + optimizer: { + enabled: true, + runs: 1000000 } - }], + }, overrides: { 'contracts/core/EntryPoint.sol': optimizedComilerSettings, 'contracts/samples/SimpleAccount.sol': optimizedComilerSettings diff --git a/package.json b/package.json index e68eade7..ec03344f 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ }, "dependencies": { "@nomiclabs/hardhat-etherscan": "^2.1.6", - "@openzeppelin/contracts": "^5.0.0", + "@openzeppelin/contracts": "^5.1.0", "@thehubbleproject/bls": "^0.5.1", "@typechain/hardhat": "^2.3.0", "@types/debug": "^4.1.12", diff --git a/yarn.lock b/yarn.lock index 6477e3e5..8e47b43d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -806,10 +806,10 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2-solc-0.7.tgz#38f4dbab672631034076ccdf2f3201fab1726635" integrity sha512-W6QmqgkADuFcTLzHL8vVoNBtkwjvQRpYIAom7KiUNoLKghyx3FgH0GBjt8NRvigV1ZmMOBllvE1By1C+bi8WpA== -"@openzeppelin/contracts@^5.0.0": - version "5.0.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.0.0.tgz#ee0e4b4564f101a5c4ee398cd4d73c0bd92b289c" - integrity sha512-bv2sdS6LKqVVMLI5+zqnNrNU/CA+6z6CmwFXm/MzmOPBRSO5reEJN7z0Gbzvs0/bv/MZZXNklubpwy3v2+azsw== +"@openzeppelin/contracts@^5.1.0": + version "5.1.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-5.1.0.tgz#4e61162f2a2bf414c4e10c45eca98ce5f1aadbd4" + integrity sha512-p1ULhl7BXzjjbha5aqst+QMLY+4/LCWADXOCsmLHRM77AqiPjnd9vvUN9sosUfhL9JGKpZ0TjEGxgvnizmWGSA== "@resolver-engine/core@^0.3.3": version "0.3.3"