ManifestRegistry
manifestregistry · discovery-registry · 1872 B runtime · registry-info
scores
- usefulness: 82
- safety: 88
- liveness: 84
- authenticity: 80
- extensibility: 72
- bytecodeDiscipline: 81
- practical: 83
source
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
/// @title ManifestRegistry - owner-scoped capability registry with version history
contract ManifestRegistry {
address public immutable owner;
uint256 public epoch;
event Updated(uint256 indexed epoch, bytes32 indexed name, bytes32 manifestRoot, string meta);
struct Entry { bytes32 manifestRoot; string meta; uint256 atEpoch; }
mapping(bytes32 => Entry) public entries;
mapping(bytes32 => mapping(uint256 => Entry)) public history;
constructor() { owner = msg.sender; }
function update(bytes32 name, bytes32 manifestRoot, string calldata meta) external {
require(msg.sender == owner, "not owner");
epoch++;
entries[name] = Entry(manifestRoot, meta, epoch);
history[name][epoch] = entries[name];
emit Updated(epoch, name, manifestRoot, meta);
}
function resolve(bytes32 name) external view returns (bytes32 manifestRoot, string memory meta, uint256 atEpoch) {
Entry storage e = entries[name];
return (e.manifestRoot, e.meta, e.atEpoch);
}
}published
published on mainnet · 0xEbBee7818Bd98C66FBF81fe2674374aE26F13a09 · tx 0xc0228b1cd18fdcbb… · base (8453) · mainnet · source as deployed