github.com/ethereum-optimism/optimism@v1.7.2/packages/contracts-bedrock/src/EAS/ISchemaRegistry.sol (about) 1 // SPDX-License-Identifier: MIT 2 pragma solidity ^0.8.0; 3 4 import { ISchemaResolver } from "src/EAS/resolver/ISchemaResolver.sol"; 5 6 /// @title A struct representing a record for a submitted schema. 7 struct SchemaRecord { 8 bytes32 uid; // The unique identifier of the schema. 9 ISchemaResolver resolver; // Optional schema resolver. 10 bool revocable; // Whether the schema allows revocations explicitly. 11 string schema; // Custom specification of the schema (e.g., an ABI). 12 } 13 14 /// @title ISchemaRegistry 15 /// @notice The interface of global attestation schemas for the Ethereum Attestation Service protocol. 16 interface ISchemaRegistry { 17 /// @dev Emitted when a new schema has been registered 18 /// @param uid The schema UID. 19 /// @param registerer The address of the account used to register the schema. 20 /// @param schema The schema data. 21 event Registered(bytes32 indexed uid, address indexed registerer, SchemaRecord schema); 22 23 /// @dev Submits and reserves a new schema 24 /// @param schema The schema data schema. 25 /// @param resolver An optional schema resolver. 26 /// @param revocable Whether the schema allows revocations explicitly. 27 /// @return The UID of the new schema. 28 function register(string calldata schema, ISchemaResolver resolver, bool revocable) external returns (bytes32); 29 30 /// @dev Returns an existing schema by UID 31 /// @param uid The UID of the schema to retrieve. 32 /// @return The schema data members. 33 function getSchema(bytes32 uid) external view returns (SchemaRecord memory); 34 }