Onchain data verifcation
Now that the data has been submitted from Github Automation, the DAO verifies it and executes the data
How is this decentralised?
/// @notice Allows anyone to submit data for execution of votes
/// @dev Attempts to parse at high level and then confirm hash before submitting to queue
/// @param data Payload fully encoded as required (see formatting using encoding functions below)
function submitData(bytes memory data) external {
(bytes32 hashed, Message[] memory _messages) = abi.decode(data, (bytes32, Message[]));
require(hashed == keccak256(abi.encode(_messages)), "Hash doesn't match");
SubmittedData memory newSubmittedData;
newSubmittedData.data = data;
newSubmittedData.time = block.timestamp;
submittedData.push(newSubmittedData);
}
How does the DAO verify submitted data?
Last updated