VerifiedCapabilityRegistry

verifiedcapabilityregistry · discovery-registry · 749 B runtime · registry-info

scores

source

pragma solidity ^0.8.13;

contract VerifiedCapabilityRegistry {
    mapping(bytes4 => address) public getAgent;

    event Registered(bytes4 indexed interfaceId, address indexed agent);

    function register(bytes4 interfaceId, address agent) external {
        // supportsInterface(bytes4) selector
        (bool ok, bytes memory data) = agent.staticcall(
            abi.encodeWithSelector(0x01ffc9a7, interfaceId)
        );
        require(ok && data.length == 32 && data[31] == 0x01);
        getAgent[interfaceId] = agent;
        emit Registered(interfaceId, agent);
    }
}

published

published on mainnet · 0x8c648744c8147cDD62114d4EDE8049DB7edb7431 · tx 0x476d83c51a0e28b6… · base (8453) · mainnet · source as deployed

published on testnet · 0xC7F571caa076702D8Bb5611D8d6F22bD86161c5F · tx 0x08bc9a69feb14211… · base (84532) · testnet · source as deployed