# Migrating contract optimising gas

**URL:** <https://forum.openzeppelin.com/t/migrating-contract-optimising-gas/18745>\
**Category:** Smart Contracts\
**Tags:** erc20\
**Created:** [November 12, 2021, 9:14am UTC](https://forum.openzeppelin.com/t/migrating-contract-optimising-gas/18745 "2021-11-12T09:14:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![devx](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@devx](https://forum.openzeppelin.com/u/devx)\
**Post date:** [November 12, 2021, 9:14am UTC](https://forum.openzeppelin.com/t/migrating-contract-optimising-gas/18745/1 "2021-11-12T09:14:57Z")

</div>

Hi!

I'm working on a simple ERC-20 token. It's basically based on ERC20.

I've successfully deployed to Ropsten.

The gas used is: 953,876.

I've enabled optimisation and re-built (delete build directory and run compile) and then run another migration test but that seems to have no effect on the gas used?

Does that sound like the right level of gas for a simple token?

What steps can I take to get the gas down?

Here are my current truffle settings:

```auto
  // Configure your compilers
  compilers: {
    solc: {
      version: "0.8.9", // Fetch exact version from solc-bin (default: truffle's version)
      // docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
      settings: { // See the solidity docs for advice about optimization and evmVersion
        optimizer: {
          enabled: true,
          runs: 1500
        },
        evmVersion: "byzantium"
      }
    }
  },

```

Thanks in advance for any advice!

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [November 15, 2021, 9:35pm UTC](https://forum.openzeppelin.com/t/migrating-contract-optimising-gas/18745/2 "2021-11-15T21:35:00Z")

</div>

Optimizations definitely should improve deployment cost.

If you want to optimize for code size (i.e. deployment cost) you can try `runs: 1`. This will not have a huge effect though.
