Note: I have already visited the related links which have similar questions posted, but I didn't find any solution which I could use to solve the issue Im facing.

Im following this Coursetro tutorial, which basically guides those new to blockchain to create a simple smart contract. The contract is defined as follows:

pragma solidity ^0.4.18;

contract Coursetro {

string fName;
uint age;

function setInstructor(string _fName, uint _age) public {
    fName = _fName;
    age = _age;

function getInstructor() public constant returns (string, uint) {
    return (fName, age);

However when I change the environment in the remix IDE from Javascript env to Web 3 env(To connect to the testrpc instance running locally on terminal), I get the following error:

creation of browser/Coursetro.sol:Coursetro pending...
creation of browser/Coursetro.sol:Coursetro errored: Error: base fee 
exceeds gas limit
at runCall (/usr/local/lib/node_modules/ethereumjs-
at /usr/local/lib/node_modules/ethereumjs-
at replenish (/usr/local/lib/node_modules/ethereumjs-
at iterateeCallback (/usr/local/lib/node_modules/ethereumjs-
at /usr/local/lib/node_modules/ethereumjs-
at /usr/local/lib/node_modules/ethereumjs-
at /usr/local/lib/node_modules/ethereumjs-
at replenish (/usr/local/lib/node_modules/ethereumjs-
at /usr/local/lib/node_modules/ethereumjs-
at eachLimit (/usr/local/lib/node_modules/ethereumjs-

I understand that the fee for executing any contract must never exceed the Gas limit set, but in this case, Im unable to deduce where to set the Gas limit. Im new to this so kindly guide me as to how to solve the above error.

  • it's not working neither. I tried the testrpc -l 3000000 but in Remix still showing me the error message. – Tarik EN-NAKDI Nov 9 '17 at 15:11

Here is the solution: you need to initialize your account in Remix with 100 ether (100eth) to begin with. Then I also changed my testrpc version to 4.1.3 and it worked! do : npm install -g ethereumjs-testrpc@4.1.3 hope this will help!

| improve this answer | |

testrpc -l 30000000

Did the trick for me. -l will set a custom gas limit, in this case 30000000.


| improve this answer | |

npm install -g ethereumjs-testrpc@4.1.3

worked for me.

| improve this answer | |

I changed my version to 4.1.3 and it worked! execute : npm install -g ethereumjs-testrpc@4.1.3

| improve this answer | |

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.