Receipt Onion Beacon

receipt-onion-beacon · receipt-attestation · 410 B runtime · registry-info

scores

source

pragma solidity ^0.8.13;

contract ReceiptOnionBeacon {
    bytes32 private head;
    uint256 private packed;

    event Anchor(uint64 seq, address author, bytes32 payloadDigest, bytes32 head);

    function append(uint64 seq, bytes32 payloadDigest) external {
        unchecked { require(seq == uint64(packed + 1)); }
        bytes32 h = keccak256(abi.encodePacked(head, msg.sender, seq, payloadDigest));
        head = h;
        packed = (uint256(uint40(block.number)) << 64) | seq;
        emit Anchor(seq, msg.sender, payloadDigest, h);
    }
}

published

published on testnet · 0xe5F0838155a006eF6bed668be0D59ac95384c8ec · tx 0xc2d0808a71e3e654… · tempo (42431) · testnet