enter image description here

I am getting this error while migrating

pragma solidity ^0.5.16;
contract Hello {
   string message;

   constructor() public {

   message = "Hello, World";

   function getGreetings() public view returns (string memory)
     return message;
   function setGreetings(string memory _message) public{
     message = _message;



var Hello = artifacts.require("./Hello.sol");
module.exports = function(deployer) {
  • And Yes I am Deploying it on local ethereum. not in ganache-cli – Prasanna Desai Sep 6 '20 at 13:03
  • What is your genesis file? It should be missing the fork that enabled SHR opcode. – Ismael Sep 6 '20 at 17:55

SO the Problem was in my genesis block, I wrote genesis.json myself so some parameters were missing. then I used puppeth to create new genesis block and that how i solve.


Indeed adding

"byzantiumBlock": 0,
"constantinopleBlock": 0

to genesis.json fixed the problem for me, as the SHR opcode is a recent addition to geth in the Constantinople release (and byzantiumBlock must be added in order to add constantinopleBlock).


if you successfully migrated before..

Delete all files in --> truffle/build/contracts

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.