pragma solidity ^0.8.4;
contract MessageDB {
mapping(address => string) public latestHash;
event HashSubmitted(address signer, string messageHash);
constructor() {}
function submitSignature(string calldata _messageHash) external {
latestHash[msg.sender] = _messageHash;
emit HashSubmitted(msg.sender, _messageHash);
}
}
{
"compilationTarget": {
"MessageDB.sol": "MessageDB"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"string","name":"messageHash","type":"string"}],"name":"HashSubmitted","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"latestHash","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_messageHash","type":"string"}],"name":"submitSignature","outputs":[],"stateMutability":"nonpayable","type":"function"}]