Skip to content

Instantly share code, notes, and snippets.

@MCarlomagno
Created January 24, 2022 20:32
Show Gist options
  • Select an option

  • Save MCarlomagno/929017f4ea8942fe8721912006e7c6a7 to your computer and use it in GitHub Desktop.

Select an option

Save MCarlomagno/929017f4ea8942fe8721912006e7c6a7 to your computer and use it in GitHub Desktop.
pragma solidity >=0.7.0 <0.9.0;
contract Chat {
function sendMessage(string _text) public {
lastMessageId++;
// loads the message into the list.
messageList[messageIdCounter] = Message(
lastMessageId,
msg.sender,
_text
);
//Trigger event
newMessageEvent(lastMessageId, msg.sender, _text);
}
}
@smontoyadev

Copy link
Copy Markdown

Dónde inicializas el messageIdCounter, cuando copio todo el contrato del chat server, me salta error ahí

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment