Mutual Manifest Registry
mutual-manifest-registry · discovery-registry · 737 B runtime · registry-info
scores
- usefulness: 82
- safety: 90
- liveness: 90
- authenticity: 80
- extensibility: 72
- bytecodeDiscipline: 95
- practical: 86
source
pragma solidity ^0.8.13;
contract MutualManifestRegistry {
mapping(address => mapping(bytes32 => bytes32)) private intents;
event Declaration(address indexed declaree, bytes32 indexed topic, bytes32 manifestHash);
event Link(address indexed a, address indexed b, bytes32 indexed topic, bytes32 manifestHash);
function declare(bytes32 topic, bytes32 manifestHash) external {
require(manifestHash != bytes32(0), "zero");
intents[msg.sender][topic] = manifestHash;
emit Declaration(msg.sender, topic, manifestHash);
}
function undeclare(bytes32 topic) external {
delete intents[msg.sender][topic];
emit Declaration(msg.sender, topic, bytes32(0));
}
function connect(bytes32 topic, address peer) external {
bytes32 h = intents[msg.sender][topic];
require(h != 0 && h == intents[peer][topic], "no link");
emit Link(msg.sender, peer, topic, h);
}
}published
published on testnet · 0xe5D9f992220A52df94CB544839F8110e3a894035 · tx 0x592a3f01421dd5f6… · tempo (42431) · testnet