0

the contract has 0 error's i am trying to deploy it trough injected web3 after i have full filled the constructor amounts and trying to deploy it i get this error

creation of RATCOIN errored: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603"data":{"code":-32000"message":"exceeds block gas limit"}}}'

Error Code

here is the smart contract it dont have any error in it when i have it on optimization 200 Link To Smart Contract

joel
  • 1
  • 3
  • 1
    What network do you deploy it to and what are your constructor params? – Richard Jan 20 '22 at 20:13
  • bsc you mean like this?
        constructor(uint16 _deadBlocks,
        uint16 _buyliq,
        uint16 _buymarket,
        uint16 _sellliq,
        uint16 _sellmarket,
        address payable _marketing,
        uint256 _supply,
        uint256 _numTokens,
        uint256 _maxWallet,
        uint256 _maxBuy,
        uint256 _maxSell 
        ) {
    
    – joel Jan 23 '22 at 00:11

1 Answers1

0
  • First, check if your transaction's setup(gas/gas limit) is ok (see this).

  • If everything is okay, the most probable issue might be the size of your contract. I suggest first take a look at this to get familiar with contract deployment's gas calculation.

  • Now, note that each block has a limited size(currently it is 15 million gas). This means that you cannot send transactions with more than this size. Which means that there is a limit for gas, too. (See these links: 1, 2, 3)

  • After reading aforementioned links, I suggest (if it is possible for you (which seems to be a MUST TO DO)), minimize your solidity code as much as possible. Removing extra codes, results in less bytecodes, which means you will not exceed the gas limit. Be warned that decreasing the volume of your code should not result in decreasing the security and functionality of your code.

I hope this helps you.

Rouhollah Joveini
  • 488
  • 1
  • 3
  • 16