// SPDX-License-Identifier: MIT pragma solidity 0.8.30; /// Each publisher deploys a registry and distributes its address through a trusted channel. /// The key is keccak256 of the UTF-8 canonical website origin, including its scheme. contract AddrsealRegistry { address public owner; mapping(bytes32 => address) public destinations; event DestinationSet(bytes32 indexed originKey, address indexed destination); error PublisherOnly(); error InvalidFirstRecord(); constructor(bytes32 originKey, address destination) { if (destination == address(0)) revert InvalidFirstRecord(); owner = msg.sender; destinations[originKey] = destination; emit DestinationSet(originKey, destination); } /// A zero destination revokes the entry. function setDestination(bytes32 originKey, address destination) external { if (msg.sender != owner) revert PublisherOnly(); destinations[originKey] = destination; emit DestinationSet(originKey, destination); } }