Receipt Chain
receipt-chain · receipt-attestation · 280 B runtime · registry-info
scores
- usefulness: 6
- safety: 9
- liveness: 10
- authenticity: 5
- extensibility: 2
- bytecodeDiscipline: 10
- practical: 7
source
pragma solidity ^0.8.13;
contract ReceiptChain {
bytes32 public root;
event Append(
bytes32 indexed previousRoot,
bytes32 indexed receiptHash,
bytes32 newRoot
);
function append(bytes32 receiptHash) external returns (bytes32 newRoot) {
newRoot = keccak256(abi.encodePacked(root, receiptHash));
emit Append(root, receiptHash, newRoot);
root = newRoot;
}
}