Home > Net >  How do I resolve "Identifier not found or not unique" in solidity?
How do I resolve "Identifier not found or not unique" in solidity?

Time:07-05

I'm a newb with no coding experience, so pardon me for asking something this simple. I've got the following code below for a simple smart contract that I'm building through a udemy course. I've got the following error code: "Identifier not found or not unique. [Ln 21, Col 27]" Can anyone help tell me what's wrong with the code. Ln 21, Col 27 is the "setGreetings" function below. Thanks in advance.

enter image description here

CodePudding user response:

The issue is in your setGreetings function argument. We first have to specify the data type of the argument then the storage location like memory, calldata etc. So correct function would be in order like this

function setGreetings(string calldata _message){
message=_message;
}
  • Related