0

I have been working on Smart Contract development with the local node running. It worked two weeks ago, and I got an error when I tried to deploy the same contract to the same local node. The error exceeds block gas limit. I have a high gas in the truffle.js, but still, I am getting the same error. Why is that?

pragma solidity ^0.4.8;
contract Verifier {
    bool public isSignedW = false;
    address public theAddress;
    function recoverAddr(bytes32 msgHash, uint8 v, bytes32 r, bytes32 s) returns (address) {
        theAddress=  ecrecover(msgHash, v, r, s);
        return theAddress;
    }

    function isSigned(address _addr, bytes32 msgHash, uint8 v, bytes32 r, bytes32 s) returns (bool) {
        isSignedW= ecrecover(msgHash, v, r, s) == _addr;
        return isSignedW;
    }
}
DavidB
  • 313
  • 1
  • 8
  • 23

1 Answers1

0

It is difficult to say when we can't see your Smart Contract and how you deploy it. Maybe can you provide more information ?

Can we have the information of the block in which your contract is mined ?

web3.eth.getBlock(BLOCK_NUMBER, function(error, result){
if(!error)
    console.log(JSON.stringify(result));
else
    console.error(error);
})

One possibility is the gas limit became too low to be able to mine your contract. Because the gas limit in a private network decrease with each mined block to the limit of 4.7 Million gas, if you use the default parameters.

  • I have uploaded the Smart Contract code above. Is a simple contract. – DavidB Mar 01 '18 at 11:08
  • Try not to set the boolean when declaring it, but set it in the constructor. EDIT : it is working with remix, so it's a issue from truffle and not from the Smart Contract – Kévin Descamps Mar 01 '18 at 14:45