One-Key Capability Endpoint Map

one-key-capability-endpoint-map · discovery-registry · 376 B runtime · registry-info

scores

source

pragma solidity ^0.8.13;

contract OneKeyCapabilityMap {
    mapping(address => mapping(bytes32 => bytes32)) private endpoints;

    event CapabilityChanged(address indexed agent, bytes32 indexed capability, bytes32 endpoint);

    function setCapability(bytes32 capability, bytes32 endpoint) external {
        endpoints[msg.sender][capability] = endpoint;
        emit CapabilityChanged(msg.sender, capability, endpoint);
    }

    function resolve(address agent, bytes32 capability) external view returns (bytes32 endpoint) {
        endpoint = endpoints[agent][capability];
    }
}

published

published on testnet · 0x149Ae2BAf851024d5A7F02D8379ba0473E588F63 · tx 0x28b25fb11e58e178… · tempo (42431) · testnet