import { type ContractArtifact, FunctionSelector } from '../abi/index.js'; import type { ContractClassPublic, UtilityFunctionMembershipProof, UtilityFunctionWithMembershipProof } from './interfaces/index.js'; /** * Creates a membership proof for a utility function in a contract class, to be verified via `isValidUtilityFunctionMembershipProof`. * @param selector - Selector of the function to create the proof for. * @param artifact - Artifact of the contract class where the function is defined. */ export declare function createUtilityFunctionMembershipProof(selector: FunctionSelector, artifact: ContractArtifact): Promise; /** * Verifies that a utility function with a membership proof as emitted by the ClassRegistry contract is valid, * as defined in the protocol specs at contract-deployment/classes: * * ``` * // Load contract class from local db * contract_class = db.get_contract_class(contract_class_id) * * // Compute artifact leaf and assert it belongs to the artifact * artifact_function_leaf = sha256(selector, metadata_hash, sha256(bytecode)) * computed_artifact_utility_function_tree_root = compute_root(artifact_function_leaf, artifact_function_tree_sibling_path, artifact_function_tree_leaf_index) * computed_artifact_hash = sha256(private_functions_artifact_tree_root, computed_artifact_utility_function_tree_root, artifact_metadata_hash) * assert computed_artifact_hash == contract_class.artifact_hash * ``` * @param fn - Function to check membership proof for. * @param contractClass - In which contract class the function is expected to be. */ export declare function isValidUtilityFunctionMembershipProof(fn: UtilityFunctionWithMembershipProof, contractClass: Pick): Promise; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0eV9mdW5jdGlvbl9tZW1iZXJzaGlwX3Byb29mLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3QvdXRpbGl0eV9mdW5jdGlvbl9tZW1iZXJzaGlwX3Byb29mLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUFFLGdCQUFnQixFQUFnQixNQUFNLGlCQUFpQixDQUFDO0FBU3hGLE9BQU8sS0FBSyxFQUNWLG1CQUFtQixFQUNuQiw4QkFBOEIsRUFDOUIsa0NBQWtDLEVBQ25DLE1BQU0sdUJBQXVCLENBQUM7QUFFL0I7Ozs7R0FJRztBQUNILHdCQUFzQixvQ0FBb0MsQ0FDeEQsUUFBUSxFQUFFLGdCQUFnQixFQUMxQixRQUFRLEVBQUUsZ0JBQWdCLEdBQ3pCLE9BQU8sQ0FBQyw4QkFBOEIsQ0FBQyxDQXNDekM7QUFFRDs7Ozs7Ozs7Ozs7Ozs7OztHQWdCRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsRUFBRSxFQUFFLGtDQUFrQyxFQUN0QyxhQUFhLEVBQUUsSUFBSSxDQUFDLG1CQUFtQixFQUFFLGNBQWMsQ0FBQyxvQkErQnpEIn0=