-
Notifications
You must be signed in to change notification settings - Fork 640
Create IHookMetadata #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Create IHookMetadata #382
Changes from 3 commits
4021ce3
ac79dcf
c93d4b8
ecedc53
f8cd75c
2115888
c57b25b
7e78c5c
2c91c7b
2a0c75a
53d62fa
9b080fb
da33a30
a27cb9c
a5f5003
b371d61
3df37ea
0fbc8b4
f941f1e
67f11d7
735033e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // SPDX-License-Identifier: MIT | ||
| pragma solidity ^0.8.0; | ||
|
|
||
| interface IHookMetadata { | ||
| // Struct representing the auditor of a smart contract | ||
| struct Auditor { | ||
| string name; // Name of the auditor | ||
| string uri; // URI with additional information about the auditor | ||
| string[] authors; // List of authors who are responsible for the audit | ||
| } | ||
|
|
||
| // Struct representing a summary of the audit | ||
| struct AuditSummary { | ||
| Auditor auditor; // The auditor who performed the audit | ||
| uint256 issuedAt; // The timestamp at which the audit was issued | ||
| uint256[] ercs; // List of ERC standards that were covered in the audit | ||
| bytes32 codeHash; // Hash of the audited smart contract code | ||
| bytes32 auditHash; // Hash of the audit document | ||
| string auditUri; // URI with additional information or the full audit report | ||
| } | ||
|
|
||
| // Struct representing the EIP712 domain, which is used for signatures | ||
| struct EIP712Domain { | ||
|
||
| string name; // Name of the domain | ||
| string version; // Version of the domain | ||
| } | ||
|
|
||
| // Enum defining different types of signature standards | ||
| enum SignatureType { | ||
| SECP256K1, // Standard ECDSA signature using secp256k1 curve | ||
| BLS, // BLS signature | ||
| ERC1271, // Signature type for smart contract based signatures (EIP-1271) | ||
| SECP256R1 // ECDSA signature using secp256r1 curve | ||
| } | ||
|
|
||
| // Struct representing a cryptographic signature | ||
| struct Signature { | ||
| SignatureType signatureType; // Type of the signature (e.g., SECP256K1, BLS, etc.) | ||
| bytes data; // Actual signature data | ||
| } | ||
|
|
||
| // Struct representing a signed audit summary | ||
| struct SignedAuditSummary { | ||
| AuditSummary auditSummary; // The audit summary being signed | ||
| uint256 signedAt; // Timestamp indicating when the audit summary was signed | ||
| Signature auditorSignature; // Signature of the auditor for authenticity | ||
| } | ||
|
|
||
| // These are external functions that must be implemented by any contract that implements this interface | ||
|
|
||
| function name() external view returns (string memory); // Returns the name of the hook | ||
| function repository() external view returns (string memory); // Returns the repository URI for the smart contract code | ||
| function logoURI() external view returns (string memory); // Returns the URI for the hook's logo | ||
|
||
| function description() external view returns (string memory); // Returns a description of the hook | ||
| function version() external view returns (bytes32); // Returns the version of the hook | ||
| function auditSummary() external view returns (AuditSummary memory); // Returns the audit summary of the hook | ||
| function eip712Domain() external view returns (EIP712Domain memory); // Returns the EIP712 domain details for signing purposes | ||
| function signatureType() external view returns (SignatureType[] memory); // Returns the list of supported signature types | ||
| function signature() external view returns (Signature memory); // Returns the signature details of a specific audit | ||
| function signedAuditSummary() external view returns (SignedAuditSummary memory); // Returns a signed audit summary of the hook | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this should be more specific in the comment - is this the github commit? the bytecode hash? the initcode hash?