# Remix Deployment Failing -- contract creation code storage out of gas

**URL:** https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399
**Category:** Smart Contracts
**Tags:** erc20
**Created:** [May 25, 2023, 3:55pm UTC](https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399 "2023-05-25T15:55:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Taya](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/taya/32/18616_2.png) [@Taya](https://forum.openzeppelin.com/u/Taya)
#### Post date: [May 25, 2023, 3:55pm UTC](https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399/1 "2023-05-25T15:55:06Z")

</div>

Hey,

I'm new to smart contracts and I tried to deploy a test ERC-20 token on REMIX using the openzeppelin wizard contract template (code below) but I keep getting a "contract creation code storage out of gas" error.

I tried playing around with the gas limit, and even forcing the transaction (which failed with the error **contract creation code storage out of gas** , since I had done this after lowering the fee) but nothing seems to be working. When I tested it though, it worked perfectly as expected on Remix's VM, and the gas fee charged was minimal.

Is there a fix for this? Or am I missing something?

Contract:

```auto

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyToken is ERC20, ERC20Burnable, Ownable {
    constructor() ERC20("MyToken", "MTK") {
        _mint(msg.sender, 4000000000000 * 10 ** decimals());
    }
}

```

---

<div class="post-metadata">

### Author: ![Amxx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/amxx/32/668_2.png) [@Amxx](https://forum.openzeppelin.com/u/Amxx)
#### Post date: [May 26, 2023, 8:45am UTC](https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399/2 "2023-05-26T08:45:42Z")

</div>

Hello @Taya  
Which network are you targetting ? Mainnet ? Are you using the injected metamask provider ?

---

<div class="post-metadata">

### Author: ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)
#### Post date: [May 26, 2023, 10:18am UTC](https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399/3 "2023-05-26T10:18:49Z")

</div>

If you are deployingh on ETH mainent, I suggest to use [https://eth.llamarpc.com](https://eth.llamarpc.com) RPC. That issue is caused by a wrong gas estimation

---

<div class="post-metadata">

### Author: ![Osas](https://avatars.discourse-cdn.com/v4/letter/o/d6d6ee/32.png) [@Osas](https://forum.openzeppelin.com/u/Osas)
#### Post date: [November 26, 2023, 9:17pm UTC](https://forum.openzeppelin.com/t/remix-deployment-failing-contract-creation-code-storage-out-of-gas/36399/4 "2023-11-26T21:17:19Z")

</div>

i am having the same issue, i am targeting ethereum mainnet, yes i am using injector provider metamask. please help me i have been stuck here for days
