Skip to content

Commit

Permalink
Enable Solidity Optimizer by default
Browse files Browse the repository at this point in the history
  • Loading branch information
moltam89 committed Jun 12, 2023
1 parent 86f44fd commit 9853a25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,15 @@ The deployer account is the account that will deploy your contracts. Additionall

You can generate a random account / private key with `yarn generate` or add the private key of your crypto wallet. `yarn generate` will create a random account and add the DEPLOYER_PRIVATE_KEY to the .env file. You can check the generated account with `yarn account`.

3. Enable the Solidity Optimizer

By default, the Optimizer is disabled. You can enable it in `hardhat.config.ts`.
Here are the [benefits](https://docs.soliditylang.org/en/latest/internals/optimizer.html#benefits-of-optimizing-solidity-code) of enabling the Optimizer.

4. Deploy your smart contract(s)
3. Deploy your smart contract(s)

Run the command below to deploy the smart contract to the target network. Make sure to have some funds in your deployer account to pay for the transaction.

```
yarn deploy --network network_name
```

5. Verify your smart contract
4. Verify your smart contract

You can verify your smart contract on Etherscan by running:

Expand Down
4 changes: 2 additions & 2 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const config: HardhatUserConfig = {
solidity: {
version: "0.8.17",
settings: {
// By default, the Solidity Optimizer is disabled
// By default, the Solidity Optimizer is enabled
// https://docs.soliditylang.org/en/latest/internals/optimizer.html#benefits-of-optimizing-solidity-code
// https://docs.soliditylang.org/en/latest/using-the-compiler.html#optimizer-options
// https://hardhat.org/hardhat-runner/docs/config
optimizer: {
enabled: false,
enabled: true,
runs: 200,
},
},
Expand Down

0 comments on commit 9853a25

Please sign in to comment.