Created
January 24, 2022 20:32
-
-
Save MCarlomagno/929017f4ea8942fe8721912006e7c6a7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dónde inicializas el messageIdCounter, cuando copio todo el contrato del chat server, me salta error ahí