Skip to content

Commit c30bdd8

Browse files
fix: logic bug in template contract MessageEmitter.sol (#246)
fix(template): logic bug in MessageEmitter.sol
1 parent d5728f0 commit c30bdd8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/creinit/template/workflow/porExampleDev/contracts/evm/src/MessageEmitter.sol.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract MessageEmitter is ITypeAndVersion {
2626

2727
function getMessage(address emitter, uint256 timestamp) public view returns (string memory) {
2828
bytes32 key = _hashKey(emitter, timestamp);
29-
require(bytes(s_messages[key]).length == 0, "Message does not exist for the given sender and timestamp");
29+
require(bytes(s_messages[key]).length > 0, "Message does not exist for the given sender and timestamp");
3030
return s_messages[key];
3131
}
3232

@@ -40,4 +40,4 @@ contract MessageEmitter is ITypeAndVersion {
4040
function _hashKey(address emitter, uint256 timestamp) internal pure returns (bytes32) {
4141
return keccak256(abi.encode(emitter, timestamp));
4242
}
43-
}
43+
}

0 commit comments

Comments
 (0)