Skip to content

fix: removes hash from ZeekMessages contract on Atlas #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions contracts/ZeekMessages.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.0;

contract ZeekMessages {
bytes32[] private messages;
string[] private messages;

// Event to acknowledge a new message
event MessageReceived(string);
Expand All @@ -12,10 +12,8 @@ contract ZeekMessages {
emit MessageReceived("Zeek welcomes you to zkSync!");
}

// Function to send a "secret" message to Zeek
function sendMessage(string memory _message) public {
bytes32 hashedMessage = keccak256(abi.encodePacked(_message));
messages.push(hashedMessage);
messages.push(_message);

// Acknowledge the message receipt with Zeek's reply
emit MessageReceived("ZK is the endgame - Message received!");
Expand All @@ -31,4 +29,4 @@ contract ZeekMessages {
require(messages.length > 0, "No messages sent to Zeek yet!");
return messages[messages.length - 1];
}
}
}