1

I'm trying to deploy a contract with REMIX but it throw an error "smart contract too large, not enough gas".

Is REMIX hardcoded for contract size ?

Do smart contract size increase with blocksize ? For example if we have 18M gas per block, a contract may be 18M gas cost to deploy ?

GrindCode
  • 365
  • 1
  • 8

1 Answers1

0

No. The contract size mainly depends on the source code. There are other factors like compiler version used, the EVM's opcode pricings, but they are minor variations.

Remix in the "Deploy & Run transaction" tab has a "Gas Limit" input, with a default value of 3M gas.

Ismael
  • 30,570
  • 21
  • 53
  • 96
  • Thanks you but what is the gas limit for a smart contract ? If we have 15M gas per block I can go up to 15M gas for a smart contract ? – GrindCode May 30 '21 at 11:02
  • @GrindCode For a contract to execute its cost has to be equal or lower than the block gas limit. Currently mainnet has a 15M block gas limit, so that's the maximum a contract can use. For deployment there's another limit the transaction size: https://ethereum.stackexchange.com/questions/1106/is-there-a-limit-for-transaction-size. – Ismael May 30 '21 at 17:10