0

Getting error Code:

  address payable owner;
  constructor ()  
  {
    owner= payable(msg.sender);
  }
  function kill() public
  {
    if(msg.sender== owner)
    {selfdestruct(owner);}

  }
}

contract greeter is mortal{
  string greeting;
  constructor (string memory _greeting) {
    greeting = _greeting;
  }
  function setGreeting (string memory _greeting) public {
    greeting = _greeting;
    
  }
  function greet() public view returns (string memory)
  {
    return greeting;    
  }
}

Console

1
  • It looks like the issue is in the truffle code. Can you share the truffle javascript code?
    – pbsh
    Jan 14 at 19:10
0

Per truffle docs, the .at functionality will yield a Promise. Based on what you're querying inside the terminal, shouldn't the syntax be more like:

(await greeter.at(address)).greet()
2

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.