diff --git a/4337/README.md b/4337/README.md index 4da8ff80b..a12c59a58 100644 --- a/4337/README.md +++ b/4337/README.md @@ -136,6 +136,14 @@ npx hardhat --network etherscan-verify npx hardhat --network local-verify ``` +### Compiler settings + +The project uses Solidity compiler version `0.8.21` with 10 million optimizer runs, as we want to optimize for the code execution costs. The evm version is set to `paris`, because not all of our target networks support the opcodes introduced in the `Shanghai` EVM upgrade. + +After careful consideration, we decided to enable the optimizer for the following reasons: +- The most critical functionality is handled by the Safe and Entrypoint contracts, such as signature checks and replay protection. +- The Entrypoint contract uses the optimizer. + #### Custom Networks It is possible to use the `NODE_URL` env var to connect to any EVM based network via an RPC endpoint. This connection then can be used with the `custom` network. diff --git a/4337/hardhat.config.ts b/4337/hardhat.config.ts index 5c07dc229..4daeb6521 100644 --- a/4337/hardhat.config.ts +++ b/4337/hardhat.config.ts @@ -36,8 +36,8 @@ import './src/tasks/local_verify' import './src/tasks/deploy_contracts' import './src/tasks/show_codesize' -const primarySolidityVersion = SOLIDITY_VERSION || '0.8.20' -const soliditySettings = !!SOLIDITY_SETTINGS ? JSON.parse(SOLIDITY_SETTINGS) : { optimizer: { enabled: true, runs: 200 } } +const primarySolidityVersion = SOLIDITY_VERSION || '0.8.21' +const soliditySettings = !!SOLIDITY_SETTINGS ? JSON.parse(SOLIDITY_SETTINGS) : { optimizer: { enabled: true, runs: 10_000_000 } } const userConfig: HardhatUserConfig = { paths: { @@ -47,7 +47,7 @@ const userConfig: HardhatUserConfig = { sources: 'contracts', }, solidity: { - compilers: [{ version: primarySolidityVersion, settings: { evmVersion: 'london', ...soliditySettings }}, { version: '0.6.12' }, { version: '0.5.17' }], + compilers: [{ version: primarySolidityVersion, settings: { evmVersion: 'paris', ...soliditySettings }}, { version: '0.6.12' }, { version: '0.5.17' }], }, networks: { hardhat: {