# Ridiculous high gas fee in production

**URL:** <https://forum.openzeppelin.com/t/ridiculous-high-gas-fee-in-production/41411>\
**Category:** Smart Contracts\
**Tags:** erc20, etherscan-verify\
**Created:** [August 21, 2024, 5:04pm UTC](https://forum.openzeppelin.com/t/ridiculous-high-gas-fee-in-production/41411 "2024-08-21T17:04:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beep\_Bop](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/beep_bop/32/21371_2.png) [@Beep\_Bop](https://forum.openzeppelin.com/u/Beep_Bop)\
**Post date:** [August 21, 2024, 5:04pm UTC](https://forum.openzeppelin.com/t/ridiculous-high-gas-fee-in-production/41411/1 "2024-08-21T17:04:41Z")

</div>

Hi,  
I was trying to create a new smart contract with Remix.  
It should be something like a lottery.  
I made a simple function to enter the lottery:

```auto
function enter() public payable {
        require(msg.value == ticketPrice, "Incorrect ETH amount sent");
        players.push(msg.sender);
    }

```

Remix was showing gas fee of around 50000.  
Now after deploying the contract and using the function on etherscan, I get the message of MetaMask, that the gas fee cant be calculated and MM sets the gas fee to $300.  
I know that with increasing the array size, the gas fee will get higher, but $300 for the first entry?  
Any idea how to fix this?
