0

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)

  • This (annoying) problem has also been reported on GitHub (web3.js if I remember correctly). – goodvibration Aug 16 '18 at 10:07
1

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.

  • i changes with this gas price and gas limit but still not working.. – satyajit deshmukh Aug 16 '18 at 10:54
  • What values do you have for price + and block gas limit on the ganache gui? (i think the defaults are "6721975" for the maximum block gas and 20000000000 for the price) – leberknecht Aug 24 '18 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.