Skip to content

Commit

Permalink
perf: update solidity compiler settings (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
milapsheth authored Oct 29, 2024
1 parent 53dd414 commit d7236cc
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 191 deletions.
25 changes: 13 additions & 12 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,22 @@ const optimizerSettings = {
},
},
};
const compilerSettings = {
// For contracts that are fixed to a specific version, we fix the compiler settings as well
const fixedContractCompilerSettings = {
version: '0.8.21',
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: optimizerSettings,
optimizer: {
...optimizerSettings,
runs: 1000,
},
},
};
const itsCompilerSettings = {
version: '0.8.24',
const compilerSettings = {
version: '0.8.27',
settings: {
evmVersion: process.env.EVM_VERSION || 'london',
optimizer: {
...optimizerSettings,
runs: 100, // Reduce runs to keep bytecode size under limit
},
optimizer: optimizerSettings,
},
};

Expand All @@ -55,10 +56,10 @@ module.exports = {
overrides: process.env.NO_OVERRIDES
? {}
: {
'contracts/proxies/Proxy.sol': compilerSettings,
'contracts/proxies/TokenManagerProxy.sol': compilerSettings,
'contracts/InterchainTokenService.sol': itsCompilerSettings,
'contracts/test/TestInterchainTokenService.sol': itsCompilerSettings,
'contracts/proxies/InterchainProxy.sol': fixedContractCompilerSettings,
'contracts/proxies/TokenManagerProxy.sol': fixedContractCompilerSettings,
'contracts/interchain-token/InterchainToken.sol': fixedContractCompilerSettings,
'contracts/test/TestInterchainTokenService.sol': fixedContractCompilerSettings,
},
},
defaultNetwork: 'hardhat',
Expand Down
Loading

0 comments on commit d7236cc

Please sign in to comment.