2

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-
testrpc/build/cli.node.js:70875:17)
at /usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:12643:24
at replenish (/usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:9736:17)
at iterateeCallback (/usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:9721:17)
at /usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:9696:16
at /usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:12648:13
at /usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:67073:16
at replenish (/usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:67020:25)
at /usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:67029:9
at eachLimit (/usr/local/lib/node_modules/ethereumjs-
testrpc/build/cli.node.js:66953:36)

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.

1
  • it's not working neither. I tried the testrpc -l 3000000 but in Remix still showing me the error message. Commented Nov 9, 2017 at 15:11

4 Answers 4

0

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 [email protected] hope this will help!

2

testrpc -l 30000000

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

https://www.npmjs.com/package/ethereumjs-testrpc

1

npm install -g [email protected]

worked for me.

-1

I changed my version to 4.1.3 and it worked! execute : npm install -g [email protected]

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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