[Ethereum] errored: base fee exceeds gas limit

remixsolidityweb3js

the default value for uint variable is 10
now on function call, I want to change this value to 0

steps to reproduce:

  1. copy the following code to remix:

    contract test {
        uint128 public aPos=10;
        function updateQuota( uint128  _Quota){
            aPos = _Quota;
        }
    }
    
  2. Use the environment as a web3 provider (configure local ganache server with remix ID)

  3. Deploy contract.

  4. Call updateQuota function with parameter as 0

  5. Shows error as

"transact to test.updateQuota errored: base fee exceeds gas limit "

.

Question: how to assign zero value to uint variable when we work with the web3 provider (local ganache server)

Best Answer

You most probably have assinged too little gas to the transaction. The Solidity code is fine (works as-expected with injected JS VM). Try using gasPrice: 8000000000 and gas: 4700000, that should run fine on ganache.

Related Topic