@enclave-e3/contracts 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +1 -1
  2. package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/artifacts.d.ts +1 -1
  3. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +1 -1
  4. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1 -1
  5. package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/artifacts.d.ts +2 -2
  6. package/artifacts/build-info/{solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.json → solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84.json} +2 -2
  7. package/artifacts/build-info/{solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.output.json → solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84.output.json} +1 -1
  8. package/artifacts/contracts/Enclave.sol/Enclave.json +1 -1
  9. package/artifacts/contracts/Enclave.sol/artifacts.d.ts +1 -1
  10. package/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +1 -1
  11. package/artifacts/contracts/interfaces/IBondingRegistry.sol/artifacts.d.ts +1 -1
  12. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +1 -1
  13. package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/artifacts.d.ts +1 -1
  14. package/artifacts/contracts/interfaces/IComputeProvider.sol/IComputeProvider.json +1 -1
  15. package/artifacts/contracts/interfaces/IComputeProvider.sol/artifacts.d.ts +1 -1
  16. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/IDecryptionVerifier.json +1 -1
  17. package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/artifacts.d.ts +1 -1
  18. package/artifacts/contracts/interfaces/IE3Program.sol/IE3Program.json +1 -1
  19. package/artifacts/contracts/interfaces/IE3Program.sol/artifacts.d.ts +1 -1
  20. package/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json +14 -1
  21. package/artifacts/contracts/interfaces/IEnclave.sol/artifacts.d.ts +2 -2
  22. package/artifacts/contracts/interfaces/ISlashVerifier.sol/ISlashVerifier.json +1 -1
  23. package/artifacts/contracts/interfaces/ISlashVerifier.sol/artifacts.d.ts +1 -1
  24. package/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +1 -1
  25. package/artifacts/contracts/interfaces/ISlashingManager.sol/artifacts.d.ts +1 -1
  26. package/artifacts/contracts/lib/ExitQueueLib.sol/ExitQueueLib.json +1 -1
  27. package/artifacts/contracts/lib/ExitQueueLib.sol/artifacts.d.ts +1 -1
  28. package/artifacts/contracts/registry/BondingRegistry.sol/BondingRegistry.json +1 -1
  29. package/artifacts/contracts/registry/BondingRegistry.sol/artifacts.d.ts +1 -1
  30. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/CiphernodeRegistryOwnable.json +1 -1
  31. package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/artifacts.d.ts +1 -1
  32. package/artifacts/contracts/slashing/SlashingManager.sol/SlashingManager.json +1 -1
  33. package/artifacts/contracts/slashing/SlashingManager.sol/artifacts.d.ts +1 -1
  34. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.json +1 -1
  35. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.json +1 -1
  36. package/artifacts/contracts/test/MockCiphernodeRegistry.sol/artifacts.d.ts +2 -2
  37. package/artifacts/contracts/test/MockComputeProvider.sol/MockComputeProvider.json +1 -1
  38. package/artifacts/contracts/test/MockComputeProvider.sol/artifacts.d.ts +1 -1
  39. package/artifacts/contracts/test/MockDecryptionVerifier.sol/MockDecryptionVerifier.json +1 -1
  40. package/artifacts/contracts/test/MockDecryptionVerifier.sol/artifacts.d.ts +1 -1
  41. package/artifacts/contracts/test/MockE3Program.sol/MockE3Program.json +1 -1
  42. package/artifacts/contracts/test/MockE3Program.sol/artifacts.d.ts +1 -1
  43. package/artifacts/contracts/test/MockSlashingVerifier.sol/MockSlashingVerifier.json +1 -1
  44. package/artifacts/contracts/test/MockSlashingVerifier.sol/artifacts.d.ts +1 -1
  45. package/artifacts/contracts/test/MockStableToken.sol/MockUSDC.json +1 -1
  46. package/artifacts/contracts/test/MockStableToken.sol/artifacts.d.ts +1 -1
  47. package/artifacts/contracts/token/EnclaveTicketToken.sol/EnclaveTicketToken.json +1 -1
  48. package/artifacts/contracts/token/EnclaveTicketToken.sol/artifacts.d.ts +1 -1
  49. package/artifacts/contracts/token/EnclaveToken.sol/EnclaveToken.json +1 -1
  50. package/artifacts/contracts/token/EnclaveToken.sol/artifacts.d.ts +1 -1
  51. package/artifacts/poseidon-solidity/PoseidonT3.sol/PoseidonT3.json +1 -1
  52. package/artifacts/poseidon-solidity/PoseidonT3.sol/artifacts.d.ts +1 -1
  53. package/contracts/interfaces/IEnclave.sol +3 -0
  54. package/dist/types/contracts/interfaces/IEnclave.d.ts +11 -1
  55. package/dist/types/contracts/interfaces/IEnclave.d.ts.map +1 -1
  56. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts +10 -0
  57. package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts.map +1 -1
  58. package/dist/types/factories/contracts/interfaces/IEnclave__factory.js +13 -0
  59. package/package.json +2 -2
@@ -131,5 +131,5 @@
131
131
  "deployedLinkReferences": {},
132
132
  "immutableReferences": {},
133
133
  "inputSourceName": "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/ProxyAdmin.sol",
134
- "buildInfoId": "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc"
134
+ "buildInfoId": "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84"
135
135
  }
@@ -15,7 +15,7 @@ export interface ProxyAdmin$Type {
15
15
  readonly deployedLinkReferences: {};
16
16
  readonly immutableReferences: {};
17
17
  readonly inputSourceName: "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/ProxyAdmin.sol";
18
- readonly buildInfoId: "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc";
18
+ readonly buildInfoId: "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84";
19
19
  };
20
20
 
21
21
  import "hardhat/types/artifacts";
@@ -73,5 +73,5 @@
73
73
  "deployedLinkReferences": {},
74
74
  "immutableReferences": {},
75
75
  "inputSourceName": "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/TransparentUpgradeableProxy.sol",
76
- "buildInfoId": "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc"
76
+ "buildInfoId": "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84"
77
77
  }
@@ -122,5 +122,5 @@
122
122
  ]
123
123
  },
124
124
  "inputSourceName": "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/TransparentUpgradeableProxy.sol",
125
- "buildInfoId": "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc"
125
+ "buildInfoId": "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84"
126
126
  }
@@ -15,7 +15,7 @@ export interface ITransparentUpgradeableProxy$Type {
15
15
  readonly deployedLinkReferences: {};
16
16
  readonly immutableReferences: {};
17
17
  readonly inputSourceName: "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/TransparentUpgradeableProxy.sol";
18
- readonly buildInfoId: "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc";
18
+ readonly buildInfoId: "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84";
19
19
  };
20
20
 
21
21
  export interface TransparentUpgradeableProxy$Type {
@@ -29,7 +29,7 @@ export interface TransparentUpgradeableProxy$Type {
29
29
  readonly deployedLinkReferences: {};
30
30
  readonly immutableReferences: {"2413":[{"length":32,"start":16}]};
31
31
  readonly inputSourceName: "npm/@openzeppelin/contracts@5.3.0/proxy/transparent/TransparentUpgradeableProxy.sol";
32
- readonly buildInfoId: "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc";
32
+ readonly buildInfoId: "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84";
33
33
  };
34
34
 
35
35
  import "hardhat/types/artifacts";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "_format": "hh3-sol-build-info-1",
3
- "id": "solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc",
3
+ "id": "solc-0_8_28-4bcd87d14b711a4c77809b8506304ad531199f84",
4
4
  "solcVersion": "0.8.28",
5
5
  "solcLongVersion": "0.8.28+commit.7893614a",
6
6
  "userSourceNameMap": {
@@ -262,7 +262,7 @@
262
262
  "content": "// SPDX-License-Identifier: LGPL-3.0-only\n//\n// This file is provided WITHOUT ANY WARRANTY;\n// without even the implied warranty of MERCHANTABILITY\n// or FITNESS FOR A PARTICULAR PURPOSE.\npragma solidity >=0.8.27;\n\n/**\n * @title IE3Program\n * @notice Interface for E3 program validation and verification\n * @dev E3 programs define the computation logic and validation rules for encrypted execution environments\n */\ninterface IE3Program {\n /// @notice Validate E3 computation parameters and return encryption scheme and input validator\n /// @dev This function is called by the Enclave contract during E3 request to configure the computation\n /// @param e3Id ID of the E3 computation\n /// @param seed Random seed for the computation\n /// @param e3ProgramParams ABI encoded E3 program parameters\n /// @param computeProviderParams ABI encoded compute provider parameters\n /// @return encryptionSchemeId ID of the encryption scheme to be used for the computation\n function validate(\n uint256 e3Id,\n uint256 seed,\n bytes calldata e3ProgramParams,\n bytes calldata computeProviderParams\n ) external returns (bytes32 encryptionSchemeId);\n\n /// @notice Verify the ciphertext output of an E3 computation\n /// @dev This function is called by the Enclave contract when ciphertext output is published\n /// @param e3Id ID of the E3 computation\n /// @param ciphertextOutputHash The keccak256 hash of output data to be verified\n /// @param proof ABI encoded data to verify the ciphertextOutputHash\n /// @return success Whether the output data is valid\n function verify(\n uint256 e3Id,\n bytes32 ciphertextOutputHash,\n bytes memory proof\n ) external returns (bool success);\n\n /// @notice Validate and process input data for a computation\n /// @dev This function is called by the Enclave contract when input is published\n /// @param e3Id ID of the E3 computation\n /// @param sender The account that is submitting the input\n /// @param data The input data to be validated\n function validateInput(\n uint256 e3Id,\n address sender,\n bytes memory data\n ) external;\n}\n"
263
263
  },
264
264
  "project/contracts/interfaces/IEnclave.sol": {
265
- "content": "// SPDX-License-Identifier: LGPL-3.0-only\n//\n// This file is provided WITHOUT ANY WARRANTY;\n// without even the implied warranty of MERCHANTABILITY\n// or FITNESS FOR A PARTICULAR PURPOSE.\npragma solidity >=0.8.27;\n\nimport { E3, IE3Program } from \"./IE3.sol\";\nimport { ICiphernodeRegistry } from \"./ICiphernodeRegistry.sol\";\nimport { IBondingRegistry } from \"./IBondingRegistry.sol\";\nimport { IDecryptionVerifier } from \"./IDecryptionVerifier.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IEnclave {\n ////////////////////////////////////////////////////////////\n // //\n // Events //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully requested.\n /// @param e3Id ID of the E3.\n /// @param e3 Details of the E3.\n /// @param e3Program Address of the Computation module selected.\n event E3Requested(uint256 e3Id, E3 e3, IE3Program indexed e3Program);\n\n /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully activated.\n /// @param e3Id ID of the E3.\n /// @param expiration Timestamp when committee duties expire.\n /// @param committeePublicKey Public key of the committee.\n event E3Activated(\n uint256 e3Id,\n uint256 expiration,\n bytes committeePublicKey\n );\n\n /// @notice This event MUST be emitted when an input to an Encrypted Execution Environment (E3) is\n /// successfully published.\n /// @param e3Id ID of the E3.\n /// @param data ABI encoded input data.\n event InputPublished(\n uint256 indexed e3Id,\n bytes data,\n uint256 inputHash,\n uint256 index\n );\n\n /// @notice This event MUST be emitted when the plaintext output of an Encrypted Execution Environment (E3)\n /// is successfully published.\n /// @param e3Id ID of the E3.\n /// @param plaintextOutput ABI encoded plaintext output.\n event PlaintextOutputPublished(uint256 indexed e3Id, bytes plaintextOutput);\n\n /// @notice This event MUST be emitted when the ciphertext output of an Encrypted Execution Environment (E3)\n /// is successfully published.\n /// @param e3Id ID of the E3.\n /// @param ciphertextOutput ABI encoded ciphertext output.\n event CiphertextOutputPublished(\n uint256 indexed e3Id,\n bytes ciphertextOutput\n );\n\n /// @notice This event MUST be emitted any time the `maxDuration` is set.\n /// @param maxDuration The maximum duration of a computation in seconds.\n event MaxDurationSet(uint256 maxDuration);\n\n /// @notice This event MUST be emitted any time the CiphernodeRegistry is set.\n /// @param ciphernodeRegistry The address of the CiphernodeRegistry contract.\n event CiphernodeRegistrySet(address ciphernodeRegistry);\n\n /// @notice This event MUST be emitted any time the BondingRegistry is set.\n /// @param bondingRegistry The address of the BondingRegistry contract.\n event BondingRegistrySet(address bondingRegistry);\n\n /// @notice This event MUST be emitted any time the fee token is set.\n /// @param feeToken The address of the fee token.\n event FeeTokenSet(address feeToken);\n\n /// @notice This event MUST be emitted when rewards are distributed to committee members.\n /// @param e3Id The ID of the E3 computation.\n /// @param nodes The addresses of the committee members receiving rewards.\n /// @param amounts The reward amounts for each committee member.\n event RewardsDistributed(\n uint256 indexed e3Id,\n address[] nodes,\n uint256[] amounts\n );\n\n /// @notice The event MUST be emitted any time an encryption scheme is enabled.\n /// @param encryptionSchemeId The ID of the encryption scheme that was enabled.\n event EncryptionSchemeEnabled(bytes32 encryptionSchemeId);\n\n /// @notice This event MUST be emitted any time an encryption scheme is disabled.\n /// @param encryptionSchemeId The ID of the encryption scheme that was disabled.\n event EncryptionSchemeDisabled(bytes32 encryptionSchemeId);\n\n /// @notice This event MUST be emitted any time a E3 Program is enabled.\n /// @param e3Program The address of the E3 Program.\n event E3ProgramEnabled(IE3Program e3Program);\n\n /// @notice This event MUST be emitted any time a E3 Program is disabled.\n /// @param e3Program The address of the E3 Program.\n event E3ProgramDisabled(IE3Program e3Program);\n\n /// @notice Emitted when the allowed E3 encryption scheme parameters are configured.\n /// @param e3ProgramParams Array of encoded encryption scheme parameters (e.g, for BFV)\n event AllowedE3ProgramsParamsSet(bytes[] e3ProgramParams);\n\n ////////////////////////////////////////////////////////////\n // //\n // Structs //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This struct contains the parameters to submit a request to Enclave.\n /// @param threshold The M/N threshold for the committee.\n /// @param startWindow The start window for the computation.\n /// @param duration The duration of the computation in seconds.\n /// @param e3Program The address of the E3 Program.\n /// @param e3ProgramParams The ABI encoded computation parameters.\n /// @param computeProviderParams The ABI encoded compute provider parameters.\n /// @param customParams Arbitrary ABI-encoded application-defined parameters.\n struct E3RequestParams {\n uint32[2] threshold;\n uint256[2] startWindow;\n uint256 duration;\n IE3Program e3Program;\n bytes e3ProgramParams;\n bytes computeProviderParams;\n bytes customParams;\n }\n\n ////////////////////////////////////////////////////////////\n // //\n // Core Entrypoints //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to request a computation within an Encrypted Execution Environment (E3).\n /// @dev This function MUST emit the E3Requested event.\n /// @param requestParams The parameters for the E3 request.\n /// @return e3Id ID of the E3.\n /// @return e3 The E3 struct.\n function request(\n E3RequestParams calldata requestParams\n ) external returns (uint256 e3Id, E3 memory e3);\n\n /// @notice This function should be called to activate an Encrypted Execution Environment (E3) once it has been\n /// initialized and is ready for input.\n /// @dev This function MUST emit the E3Activated event.\n /// @dev This function MUST revert if the given E3 has not yet been requested.\n /// @dev This function MUST revert if the selected node committee has not yet published a public key.\n /// @param e3Id ID of the E3.\n /// @param publicKey Public key of the committee.\n /// @return success True if the E3 was successfully activated.\n function activate(\n uint256 e3Id,\n bytes calldata publicKey\n ) external returns (bool success);\n\n /// @notice This function should be called to publish input data for Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the E3 is not yet activated.\n /// @dev This function MUST emit the InputPublished event.\n /// @param e3Id ID of the E3.\n /// @param data ABI encoded input data to publish.\n /// @return success True if the input was successfully published.\n function publishInput(\n uint256 e3Id,\n bytes calldata data\n ) external returns (bool success);\n\n /// @notice This function should be called to publish output data for an Encrypted Execution Environment (E3).\n /// @dev This function MUST emit the CiphertextOutputPublished event.\n /// @param e3Id ID of the E3.\n /// @param ciphertextOutput ABI encoded output data to verify.\n /// @param proof ABI encoded data to verify the ciphertextOutput.\n /// @return success True if the output was successfully published.\n function publishCiphertextOutput(\n uint256 e3Id,\n bytes calldata ciphertextOutput,\n bytes calldata proof\n ) external returns (bool success);\n\n /// @notice This function publishes the plaintext output of an Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the output has not been published.\n /// @dev This function MUST emit the PlaintextOutputPublished event.\n /// @param e3Id ID of the E3.\n /// @param plaintextOutput ABI encoded plaintext output.\n /// @param proof ABI encoded data to verify the plaintextOutput.\n function publishPlaintextOutput(\n uint256 e3Id,\n bytes calldata plaintextOutput,\n bytes calldata proof\n ) external returns (bool success);\n\n ////////////////////////////////////////////////////////////\n // //\n // Set Functions //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to set the maximum duration of requested computations.\n /// @param _maxDuration The maximum duration of a computation in seconds.\n /// @return success True if the max duration was successfully set.\n function setMaxDuration(\n uint256 _maxDuration\n ) external returns (bool success);\n\n /// @notice Sets the Ciphernode Registry contract address.\n /// @dev This function MUST revert if the address is zero or the same as the current registry.\n /// @param _ciphernodeRegistry The address of the new Ciphernode Registry contract.\n /// @return success True if the registry was successfully set.\n function setCiphernodeRegistry(\n ICiphernodeRegistry _ciphernodeRegistry\n ) external returns (bool success);\n\n /// @notice Sets the Bonding Registry contract address.\n /// @dev This function MUST revert if the address is zero or the same as the current registry.\n /// @param _bondingRegistry The address of the new Bonding Registry contract.\n /// @return success True if the registry was successfully set.\n function setBondingRegistry(\n IBondingRegistry _bondingRegistry\n ) external returns (bool success);\n\n /// @notice Sets the fee token used for E3 payments.\n /// @dev This function MUST revert if the address is zero or the same as the current fee token.\n /// @param _feeToken The address of the new fee token.\n /// @return success True if the fee token was successfully set.\n function setFeeToken(IERC20 _feeToken) external returns (bool success);\n\n /// @notice This function should be called to enable an E3 Program.\n /// @param e3Program The address of the E3 Program.\n /// @return success True if the E3 Program was successfully enabled.\n function enableE3Program(\n IE3Program e3Program\n ) external returns (bool success);\n\n /// @notice This function should be called to disable an E3 Program.\n /// @param e3Program The address of the E3 Program.\n /// @return success True if the E3 Program was successfully disabled.\n function disableE3Program(\n IE3Program e3Program\n ) external returns (bool success);\n\n /// @notice Sets or enables a decryption verifier for a specific encryption scheme.\n /// @dev This function MUST revert if the verifier address is zero or already set to the same value.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme.\n /// @param decryptionVerifier The address of the decryption verifier contract.\n /// @return success True if the verifier was successfully set.\n function setDecryptionVerifier(\n bytes32 encryptionSchemeId,\n IDecryptionVerifier decryptionVerifier\n ) external returns (bool success);\n\n /// @notice Disables a previously enabled encryption scheme.\n /// @dev This function MUST revert if the encryption scheme is not currently enabled.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme to disable.\n /// @return success True if the encryption scheme was successfully disabled.\n function disableEncryptionScheme(\n bytes32 encryptionSchemeId\n ) external returns (bool success);\n\n /// @notice Sets the allowed E3 program parameters.\n /// @dev This function enables specific parameter sets for E3 programs (e.g., BFV encryption parameters).\n /// @param _e3ProgramsParams Array of ABI encoded parameter sets to allow.\n /// @return success True if the parameters were successfully set.\n function setE3ProgramsParams(\n bytes[] memory _e3ProgramsParams\n ) external returns (bool success);\n\n ////////////////////////////////////////////////////////////\n // //\n // Get Functions //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to retrieve the details of an Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the E3 does not exist.\n /// @param e3Id ID of the E3.\n /// @return e3 The struct representing the requested E3.\n function getE3(uint256 e3Id) external view returns (E3 memory e3);\n\n /// @notice This function returns the fee of an E3\n /// @dev This function MUST revert if the E3 parameters are invalid.\n /// @param e3Params the struct representing the E3 request parameters\n /// @return fee the fee of the E3\n function getE3Quote(\n E3RequestParams calldata e3Params\n ) external view returns (uint256 fee);\n\n /// @notice Returns the decryption verifier for a given encryption scheme.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme.\n /// @return The decryption verifier contract for the specified encryption scheme.\n function getDecryptionVerifier(\n bytes32 encryptionSchemeId\n ) external view returns (IDecryptionVerifier);\n}\n"
265
+ "content": "// SPDX-License-Identifier: LGPL-3.0-only\n//\n// This file is provided WITHOUT ANY WARRANTY;\n// without even the implied warranty of MERCHANTABILITY\n// or FITNESS FOR A PARTICULAR PURPOSE.\npragma solidity >=0.8.27;\n\nimport { E3, IE3Program } from \"./IE3.sol\";\nimport { ICiphernodeRegistry } from \"./ICiphernodeRegistry.sol\";\nimport { IBondingRegistry } from \"./IBondingRegistry.sol\";\nimport { IDecryptionVerifier } from \"./IDecryptionVerifier.sol\";\nimport { IERC20 } from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ninterface IEnclave {\n ////////////////////////////////////////////////////////////\n // //\n // Events //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully requested.\n /// @param e3Id ID of the E3.\n /// @param e3 Details of the E3.\n /// @param e3Program Address of the Computation module selected.\n event E3Requested(uint256 e3Id, E3 e3, IE3Program indexed e3Program);\n\n /// @notice This event MUST be emitted when an Encrypted Execution Environment (E3) is successfully activated.\n /// @param e3Id ID of the E3.\n /// @param expiration Timestamp when committee duties expire.\n /// @param committeePublicKey Public key of the committee.\n event E3Activated(\n uint256 e3Id,\n uint256 expiration,\n bytes committeePublicKey\n );\n\n /// @notice This event MUST be emitted when an input to an Encrypted Execution Environment (E3) is\n /// successfully published.\n /// @param e3Id ID of the E3.\n /// @param data ABI encoded input data.\n event InputPublished(\n uint256 indexed e3Id,\n bytes data,\n uint256 inputHash,\n uint256 index\n );\n\n /// @notice This event MUST be emitted when the plaintext output of an Encrypted Execution Environment (E3)\n /// is successfully published.\n /// @param e3Id ID of the E3.\n /// @param plaintextOutput ABI encoded plaintext output.\n event PlaintextOutputPublished(uint256 indexed e3Id, bytes plaintextOutput);\n\n /// @notice This event MUST be emitted when the ciphertext output of an Encrypted Execution Environment (E3)\n /// is successfully published.\n /// @param e3Id ID of the E3.\n /// @param ciphertextOutput ABI encoded ciphertext output.\n event CiphertextOutputPublished(\n uint256 indexed e3Id,\n bytes ciphertextOutput\n );\n\n /// @notice This event MUST be emitted any time the `maxDuration` is set.\n /// @param maxDuration The maximum duration of a computation in seconds.\n event MaxDurationSet(uint256 maxDuration);\n\n /// @notice This event MUST be emitted any time the CiphernodeRegistry is set.\n /// @param ciphernodeRegistry The address of the CiphernodeRegistry contract.\n event CiphernodeRegistrySet(address ciphernodeRegistry);\n\n /// @notice This event MUST be emitted any time the BondingRegistry is set.\n /// @param bondingRegistry The address of the BondingRegistry contract.\n event BondingRegistrySet(address bondingRegistry);\n\n /// @notice This event MUST be emitted any time the fee token is set.\n /// @param feeToken The address of the fee token.\n event FeeTokenSet(address feeToken);\n\n /// @notice This event MUST be emitted when rewards are distributed to committee members.\n /// @param e3Id The ID of the E3 computation.\n /// @param nodes The addresses of the committee members receiving rewards.\n /// @param amounts The reward amounts for each committee member.\n event RewardsDistributed(\n uint256 indexed e3Id,\n address[] nodes,\n uint256[] amounts\n );\n\n /// @notice The event MUST be emitted any time an encryption scheme is enabled.\n /// @param encryptionSchemeId The ID of the encryption scheme that was enabled.\n event EncryptionSchemeEnabled(bytes32 encryptionSchemeId);\n\n /// @notice This event MUST be emitted any time an encryption scheme is disabled.\n /// @param encryptionSchemeId The ID of the encryption scheme that was disabled.\n event EncryptionSchemeDisabled(bytes32 encryptionSchemeId);\n\n /// @notice This event MUST be emitted any time a E3 Program is enabled.\n /// @param e3Program The address of the E3 Program.\n event E3ProgramEnabled(IE3Program e3Program);\n\n /// @notice This event MUST be emitted any time a E3 Program is disabled.\n /// @param e3Program The address of the E3 Program.\n event E3ProgramDisabled(IE3Program e3Program);\n\n /// @notice Emitted when the allowed E3 encryption scheme parameters are configured.\n /// @param e3ProgramParams Array of encoded encryption scheme parameters (e.g, for BFV)\n event AllowedE3ProgramsParamsSet(bytes[] e3ProgramParams);\n\n ////////////////////////////////////////////////////////////\n // //\n // Structs //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This struct contains the parameters to submit a request to Enclave.\n /// @param threshold The M/N threshold for the committee.\n /// @param startWindow The start window for the computation.\n /// @param duration The duration of the computation in seconds.\n /// @param e3Program The address of the E3 Program.\n /// @param e3ProgramParams The ABI encoded computation parameters.\n /// @param computeProviderParams The ABI encoded compute provider parameters.\n /// @param customParams Arbitrary ABI-encoded application-defined parameters.\n struct E3RequestParams {\n uint32[2] threshold;\n uint256[2] startWindow;\n uint256 duration;\n IE3Program e3Program;\n bytes e3ProgramParams;\n bytes computeProviderParams;\n bytes customParams;\n }\n\n ////////////////////////////////////////////////////////////\n // //\n // Core Entrypoints //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to request a computation within an Encrypted Execution Environment (E3).\n /// @dev This function MUST emit the E3Requested event.\n /// @param requestParams The parameters for the E3 request.\n /// @return e3Id ID of the E3.\n /// @return e3 The E3 struct.\n function request(\n E3RequestParams calldata requestParams\n ) external returns (uint256 e3Id, E3 memory e3);\n\n /// @notice This function should be called to activate an Encrypted Execution Environment (E3) once it has been\n /// initialized and is ready for input.\n /// @dev This function MUST emit the E3Activated event.\n /// @dev This function MUST revert if the given E3 has not yet been requested.\n /// @dev This function MUST revert if the selected node committee has not yet published a public key.\n /// @param e3Id ID of the E3.\n /// @param publicKey Public key of the committee.\n /// @return success True if the E3 was successfully activated.\n function activate(\n uint256 e3Id,\n bytes calldata publicKey\n ) external returns (bool success);\n\n /// @notice This function should be called to publish input data for Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the E3 is not yet activated.\n /// @dev This function MUST emit the InputPublished event.\n /// @param e3Id ID of the E3.\n /// @param data ABI encoded input data to publish.\n /// @return success True if the input was successfully published.\n function publishInput(\n uint256 e3Id,\n bytes calldata data\n ) external returns (bool success);\n\n /// @notice This function should be called to publish output data for an Encrypted Execution Environment (E3).\n /// @dev This function MUST emit the CiphertextOutputPublished event.\n /// @param e3Id ID of the E3.\n /// @param ciphertextOutput ABI encoded output data to verify.\n /// @param proof ABI encoded data to verify the ciphertextOutput.\n /// @return success True if the output was successfully published.\n function publishCiphertextOutput(\n uint256 e3Id,\n bytes calldata ciphertextOutput,\n bytes calldata proof\n ) external returns (bool success);\n\n /// @notice This function publishes the plaintext output of an Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the output has not been published.\n /// @dev This function MUST emit the PlaintextOutputPublished event.\n /// @param e3Id ID of the E3.\n /// @param plaintextOutput ABI encoded plaintext output.\n /// @param proof ABI encoded data to verify the plaintextOutput.\n function publishPlaintextOutput(\n uint256 e3Id,\n bytes calldata plaintextOutput,\n bytes calldata proof\n ) external returns (bool success);\n\n ////////////////////////////////////////////////////////////\n // //\n // Set Functions //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to set the maximum duration of requested computations.\n /// @param _maxDuration The maximum duration of a computation in seconds.\n /// @return success True if the max duration was successfully set.\n function setMaxDuration(\n uint256 _maxDuration\n ) external returns (bool success);\n\n /// @notice Sets the Ciphernode Registry contract address.\n /// @dev This function MUST revert if the address is zero or the same as the current registry.\n /// @param _ciphernodeRegistry The address of the new Ciphernode Registry contract.\n /// @return success True if the registry was successfully set.\n function setCiphernodeRegistry(\n ICiphernodeRegistry _ciphernodeRegistry\n ) external returns (bool success);\n\n /// @notice Sets the Bonding Registry contract address.\n /// @dev This function MUST revert if the address is zero or the same as the current registry.\n /// @param _bondingRegistry The address of the new Bonding Registry contract.\n /// @return success True if the registry was successfully set.\n function setBondingRegistry(\n IBondingRegistry _bondingRegistry\n ) external returns (bool success);\n\n /// @notice Sets the fee token used for E3 payments.\n /// @dev This function MUST revert if the address is zero or the same as the current fee token.\n /// @param _feeToken The address of the new fee token.\n /// @return success True if the fee token was successfully set.\n function setFeeToken(IERC20 _feeToken) external returns (bool success);\n\n /// @notice This function should be called to enable an E3 Program.\n /// @param e3Program The address of the E3 Program.\n /// @return success True if the E3 Program was successfully enabled.\n function enableE3Program(\n IE3Program e3Program\n ) external returns (bool success);\n\n /// @notice This function should be called to disable an E3 Program.\n /// @param e3Program The address of the E3 Program.\n /// @return success True if the E3 Program was successfully disabled.\n function disableE3Program(\n IE3Program e3Program\n ) external returns (bool success);\n\n /// @notice Sets or enables a decryption verifier for a specific encryption scheme.\n /// @dev This function MUST revert if the verifier address is zero or already set to the same value.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme.\n /// @param decryptionVerifier The address of the decryption verifier contract.\n /// @return success True if the verifier was successfully set.\n function setDecryptionVerifier(\n bytes32 encryptionSchemeId,\n IDecryptionVerifier decryptionVerifier\n ) external returns (bool success);\n\n /// @notice Disables a previously enabled encryption scheme.\n /// @dev This function MUST revert if the encryption scheme is not currently enabled.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme to disable.\n /// @return success True if the encryption scheme was successfully disabled.\n function disableEncryptionScheme(\n bytes32 encryptionSchemeId\n ) external returns (bool success);\n\n /// @notice Sets the allowed E3 program parameters.\n /// @dev This function enables specific parameter sets for E3 programs (e.g., BFV encryption parameters).\n /// @param _e3ProgramsParams Array of ABI encoded parameter sets to allow.\n /// @return success True if the parameters were successfully set.\n function setE3ProgramsParams(\n bytes[] memory _e3ProgramsParams\n ) external returns (bool success);\n\n ////////////////////////////////////////////////////////////\n // //\n // Get Functions //\n // //\n ////////////////////////////////////////////////////////////\n\n /// @notice This function should be called to retrieve the details of an Encrypted Execution Environment (E3).\n /// @dev This function MUST revert if the E3 does not exist.\n /// @param e3Id ID of the E3.\n /// @return e3 The struct representing the requested E3.\n function getE3(uint256 e3Id) external view returns (E3 memory e3);\n\n /// @notice This function returns the fee of an E3\n /// @dev This function MUST revert if the E3 parameters are invalid.\n /// @param e3Params the struct representing the E3 request parameters\n /// @return fee the fee of the E3\n function getE3Quote(\n E3RequestParams calldata e3Params\n ) external view returns (uint256 fee);\n\n /// @notice Returns the decryption verifier for a given encryption scheme.\n /// @param encryptionSchemeId The unique identifier for the encryption scheme.\n /// @return The decryption verifier contract for the specified encryption scheme.\n function getDecryptionVerifier(\n bytes32 encryptionSchemeId\n ) external view returns (IDecryptionVerifier);\n\n /// @notice Returns the ERC20 token used to pay for E3 fees.\n function feeToken() external view returns (IERC20);\n}\n"
266
266
  },
267
267
  "project/contracts/interfaces/ISlashingManager.sol": {
268
268
  "content": "// SPDX-License-Identifier: LGPL-3.0-only\n//\n// This file is provided WITHOUT ANY WARRANTY;\n// without even the implied warranty of MERCHANTABILITY\n// or FITNESS FOR A PARTICULAR PURPOSE.\n\npragma solidity >=0.8.27;\n\nimport { IBondingRegistry } from \"./IBondingRegistry.sol\";\n\n/**\n * @title ISlashingManager\n * @notice Interface for managing slashing proposals, appeals, and execution\n * @dev Maintains policy table and handles slash workflows with appeals\n */\ninterface ISlashingManager {\n // ======================\n // Structs\n // ======================\n\n /**\n * @notice Slashing policy configuration for different slash reasons\n * @dev Defines penalties, proof requirements, and appeal mechanisms for each slash type\n * @param ticketPenalty Amount of ticket collateral to slash (in wei)\n * @param licensePenalty Amount of license bond to slash (in wei)\n * @param requiresProof Whether this slash type requires cryptographic proof verification\n * @param proofVerifier Address of the ISlashVerifier contract for proof validation\n * @param banNode Whether executing this slash will permanently ban the node\n * @param appealWindow Time window in seconds for operators to appeal (0 = immediate execution, no appeals)\n * @param enabled Whether this slash type is currently active and can be proposed\n */\n struct SlashPolicy {\n uint256 ticketPenalty;\n uint256 licensePenalty;\n bool requiresProof;\n address proofVerifier;\n bool banNode;\n uint256 appealWindow;\n bool enabled;\n }\n\n /**\n * @notice Slash proposal details tracking the full lifecycle of a slash\n * @dev Stores all state needed for proposal, appeal, and execution workflows\n * @param operator Address of the ciphernode operator being slashed\n * @param reason Hash of the slash reason (maps to SlashPolicy configuration)\n * @param ticketAmount Amount of ticket collateral to slash (copied from policy at proposal time)\n * @param licenseAmount Amount of license bond to slash (copied from policy at proposal time)\n * @param executed Whether the slashing penalties have been executed\n * @param appealed Whether the operator has filed an appeal\n * @param resolved Whether the appeal has been resolved by governance\n * @param appealUpheld Whether the appeal was approved (true = cancel slash, false = slash proceeds)\n * @param proposedAt Block timestamp when the slash was proposed\n * @param executableAt Block timestamp when execution becomes possible (proposedAt + appealWindow)\n * @param proposer Address that created this slash proposal\n * @param proofHash Keccak256 hash of the proof data submitted with the proposal\n * @param proofVerified Whether the proof was successfully verified by the proof verifier contract\n */\n struct SlashProposal {\n address operator;\n bytes32 reason;\n uint256 ticketAmount;\n uint256 licenseAmount;\n bool executed;\n bool appealed;\n bool resolved;\n bool appealUpheld;\n uint256 proposedAt;\n uint256 executableAt;\n address proposer;\n bytes32 proofHash;\n bool proofVerified;\n }\n\n // ======================\n // Errors\n // ======================\n\n /// @notice Thrown when a zero address is provided where a valid address is required\n error ZeroAddress();\n\n /// @notice Thrown when caller lacks required role permissions for the operation\n error Unauthorized();\n\n /// @notice Thrown when a slash policy configuration is invalid\n error InvalidPolicy();\n\n /// @notice Thrown when referencing a proposal ID that doesn't exist or is in invalid state\n error InvalidProposal();\n\n /// @notice Thrown when proof is required by policy but not provided\n error ProofRequired();\n\n /// @notice Thrown when provided proof fails verification\n error InvalidProof();\n\n /// @notice Thrown when attempting to execute a slash whose appeal was upheld\n error AppealUpheld();\n\n /// @notice Thrown when attempting to execute a slash with an unresolved appeal\n error AppealPending();\n\n /// @notice Thrown when attempting to file an appeal after the appeal window has closed\n error AppealWindowExpired();\n\n /// @notice Thrown when attempting to execute a slash before the appeal window has closed\n error AppealWindowActive();\n\n /// @notice Thrown when attempting to file a second appeal for the same proposal\n error AlreadyAppealed();\n\n /// @notice Thrown when attempting to execute a slash that has already been executed\n error AlreadyExecuted();\n\n /// @notice Thrown when attempting to resolve an appeal that has already been resolved\n error AlreadyResolved();\n\n /// @notice Thrown when referencing a slash reason that doesn't exist\n error SlashReasonNotFound();\n\n /// @notice Thrown when attempting to propose a slash for a disabled reason\n error SlashReasonDisabled();\n\n /// @notice Thrown when a banned ciphernode attempts a restricted operation\n error CiphernodeBanned();\n\n /// @notice Thrown when a policy requires proof but no verifier contract is configured\n error VerifierNotSet();\n\n // ======================\n // Events\n // ======================\n\n /**\n * @notice Emitted when a slash policy is created or updated\n * @param reason Hash of the slash reason being configured\n * @param policy The complete policy configuration including penalties and appeal settings\n */\n event SlashPolicyUpdated(bytes32 indexed reason, SlashPolicy policy);\n\n /**\n * @notice Emitted when a new slash proposal is created\n * @param proposalId Unique ID of the created proposal\n * @param operator Address of the ciphernode operator being slashed\n * @param reason Hash of the slash reason\n * @param ticketAmount Amount of ticket collateral to be slashed\n * @param licenseAmount Amount of license bond to be slashed\n * @param executableAt Timestamp when the slash can be executed (after appeal window)\n * @param proposer Address that created the proposal\n */\n event SlashProposed(\n uint256 indexed proposalId,\n address indexed operator,\n bytes32 indexed reason,\n uint256 ticketAmount,\n uint256 licenseAmount,\n uint256 executableAt,\n address proposer\n );\n\n /**\n * @notice Emitted when a slash proposal is executed and penalties are applied\n * @param proposalId ID of the executed proposal\n * @param operator Address of the slashed operator\n * @param reason Hash of the slash reason\n * @param ticketAmount Amount of ticket collateral slashed\n * @param licenseAmount Amount of license bond slashed\n * @param executed Execution status (should always be true)\n */\n event SlashExecuted(\n uint256 indexed proposalId,\n address indexed operator,\n bytes32 indexed reason,\n uint256 ticketAmount,\n uint256 licenseAmount,\n bool executed\n );\n\n /**\n * @notice Emitted when an operator files an appeal against a slash proposal\n * @param proposalId ID of the proposal being appealed\n * @param operator Address of the operator filing the appeal\n * @param reason Hash of the slash reason being appealed\n * @param evidence Evidence string provided by the operator supporting their appeal\n */\n event AppealFiled(\n uint256 indexed proposalId,\n address indexed operator,\n bytes32 indexed reason,\n string evidence\n );\n\n /**\n * @notice Emitted when governance resolves an appeal\n * @param proposalId ID of the proposal with the resolved appeal\n * @param operator Address of the operator who appealed\n * @param appealUpheld Whether the appeal was approved (true = slash cancelled, false = slash proceeds)\n * @param resolver Address of the governance account that resolved the appeal\n * @param resolution Explanation string for the resolution decision\n */\n event AppealResolved(\n uint256 indexed proposalId,\n address indexed operator,\n bool appealUpheld,\n address resolver,\n string resolution\n );\n\n /**\n * @notice Emitted when a node is banned or unbanned from the network\n * @param node Address of the node\n * @param status Whether the node is banned\n * @param reason Hash of the reason for banning or unbanning\n * @param updater Address that executed the ban (governance or contract)\n */\n event NodeBanUpdated(\n address indexed node,\n bool status,\n bytes32 indexed reason,\n address updater\n );\n\n // ======================\n // View Functions\n // ======================\n\n /**\n * @notice Retrieves the slash policy configuration for a given reason\n * @param reason Hash of the slash reason to query\n * @return policy The complete SlashPolicy struct (returns default empty struct if not configured)\n */\n function getSlashPolicy(\n bytes32 reason\n ) external view returns (SlashPolicy memory policy);\n\n /**\n * @notice Retrieves the details of a slash proposal\n * @param proposalId ID of the proposal to query\n * @return proposal The complete SlashProposal struct\n * @dev Reverts with InvalidProposal if proposalId >= totalProposals\n */\n function getSlashProposal(\n uint256 proposalId\n ) external view returns (SlashProposal memory proposal);\n\n /**\n * @notice Returns the total number of slash proposals ever created\n * @return count The total count of proposals (next proposalId will be this value)\n */\n function totalProposals() external view returns (uint256 count);\n\n /**\n * @notice Checks whether a node is currently banned\n * @param node Address of the node to check\n * @return isBanned True if the node is banned, false otherwise\n */\n function isBanned(address node) external view returns (bool isBanned);\n\n /**\n * @notice Returns the bonding registry contract used for executing slashes\n * @return registry The IBondingRegistry contract instance\n */\n function bondingRegistry()\n external\n view\n returns (IBondingRegistry registry);\n\n // ======================\n // Admin Functions\n // ======================\n\n /**\n * @notice Creates or updates the slash policy for a specific reason\n * @dev Only callable by GOVERNANCE_ROLE. Validates policy constraints before setting\n * @param reason Hash of the slash reason to configure (must be non-zero)\n * @param policy Complete policy configuration including penalties, proof requirements, and appeal settings\n * Requirements:\n * - reason must not be bytes32(0)\n * - policy.enabled must be true\n * - At least one of ticketPenalty or licensePenalty must be non-zero\n * - If requiresProof is true, proofVerifier must be set and appealWindow must be 0\n * - If requiresProof is false, appealWindow must be greater than 0\n */\n function setSlashPolicy(\n bytes32 reason,\n SlashPolicy calldata policy\n ) external;\n\n /**\n * @notice Updates the bonding registry contract address\n * @dev Only callable by DEFAULT_ADMIN_ROLE. Used to execute actual slashing of funds\n * @param newBondingRegistry Address of the new IBondingRegistry contract (must be non-zero)\n */\n function setBondingRegistry(address newBondingRegistry) external;\n\n /**\n * @notice Grants SLASHER_ROLE to an address\n * @dev Only callable by DEFAULT_ADMIN_ROLE. Slashers can propose and execute slashes\n * @param slasher Address to grant slashing permissions (must be non-zero)\n */\n function addSlasher(address slasher) external;\n\n /**\n * @notice Revokes SLASHER_ROLE from an address\n * @dev Only callable by DEFAULT_ADMIN_ROLE\n * @param slasher Address to revoke slashing permissions from\n */\n function removeSlasher(address slasher) external;\n\n /**\n * @notice Grants VERIFIER_ROLE to an address\n * @dev Only callable by DEFAULT_ADMIN_ROLE. Verifiers can validate proof-based slashes\n * @param verifier Address to grant verification permissions (must be non-zero)\n */\n function addVerifier(address verifier) external;\n\n /**\n * @notice Revokes VERIFIER_ROLE from an address\n * @dev Only callable by DEFAULT_ADMIN_ROLE\n * @param verifier Address to revoke verification permissions from\n */\n function removeVerifier(address verifier) external;\n\n // ======================\n // Slashing Functions\n // ======================\n\n /**\n * @notice Creates a new slash proposal against an operator\n * @dev Only callable by SLASHER_ROLE. Validates policy and proof if required\n * @param operator Address of the ciphernode operator to slash (must be non-zero)\n * @param reason Hash of the slash reason (must have an enabled policy configured)\n * @param proof Proof data to be verified (required if policy.requiresProof is true, can be empty otherwise)\n * @return proposalId Sequential ID of the created proposal\n * Requirements:\n * - operator must not be zero address\n * - reason must have an enabled policy configured\n * - If policy requires proof, proof must be non-empty and pass verification\n * - Caller must have SLASHER_ROLE\n */\n function proposeSlash(\n address operator,\n bytes32 reason,\n bytes calldata proof\n ) external returns (uint256 proposalId);\n\n /**\n * @notice Executes a slash proposal and applies penalties to the operator\n * @dev Only callable by SLASHER_ROLE. Validates execution conditions and applies slashing\n * @param proposalId ID of the proposal to execute (must exist and not be already executed)\n * Requirements:\n * - Proposal must exist and not be already executed\n * - For proof-required slashes: proof must be verified\n * - For evidence-based slashes: appeal window must have expired\n * - If appeal was filed and resolved, appeal must not have been upheld\n * - Caller must have SLASHER_ROLE\n * Effects:\n * - Marks proposal as executed\n * - Slashes ticket balance if ticketAmount > 0\n * - Slashes license bond if licenseAmount > 0\n * - Bans node if policy.banNode is true\n */\n function executeSlash(uint256 proposalId) external;\n\n // ======================\n // Appeal Functions\n // ======================\n\n /**\n * @notice Allows an operator to file an appeal against a slash proposal\n * @dev Only the operator being slashed can file an appeal, and only within the appeal window\n * @param proposalId ID of the proposal to appeal (must exist)\n * @param evidence String containing evidence and arguments supporting the appeal\n * Requirements:\n * - Proposal must exist\n * - Caller must be the operator being slashed\n * - Current timestamp must be before proposal.executableAt (within appeal window)\n * - Proposal must not already have an appeal filed\n */\n function fileAppeal(uint256 proposalId, string calldata evidence) external;\n\n /**\n * @notice Resolves an appeal by accepting or rejecting it\n * @dev Only callable by GOVERNANCE_ROLE. If appeal is upheld, the slash cannot be executed\n * @param proposalId ID of the proposal with the appeal to resolve (must exist and have an appeal)\n * @param appealUpheld True to uphold the appeal (cancel the slash), false to deny the appeal\n * (allow slash to proceed)\n * @param resolution String explaining the governance decision\n * Requirements:\n * - Proposal must exist and have an appeal filed\n * - Appeal must not already be resolved\n * - Caller must have GOVERNANCE_ROLE\n * Effects:\n * - Marks appeal as resolved\n * - Sets appealUpheld flag (true = slash cancelled, false = slash can proceed)\n */\n function resolveAppeal(\n uint256 proposalId,\n bool appealUpheld,\n string calldata resolution\n ) external;\n\n // ======================\n // Ban Management\n // ======================\n\n /**\n * @notice Bans or unbans a node from the network\n * @dev Only callable by GOVERNANCE_ROLE. Bans can also occur automatically via executeSlash\n * @param node Address of the node to ban (must be non-zero)\n * @param status Whether to ban the node\n * @param reason Hash of the reason for banning\n * Requirements:\n * - node must not be zero address\n * - Caller must have GOVERNANCE_ROLE\n * Effects:\n * - Sets banned[node] to status\n * - Emits NodeBanned event if status is true\n * - Emits NodeUnbanned event if status is false\n */\n function updateBanStatus(\n address node,\n bool status,\n bytes32 reason\n ) external;\n}\n"