@enclave-e3/contracts 0.1.4 → 0.1.6
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.
- package/README.md +46 -2
- package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +135 -0
- package/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/artifacts.d.ts +27 -0
- package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.json +77 -0
- package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +126 -0
- package/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/artifacts.d.ts +43 -0
- package/artifacts/build-info/solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.json +311 -0
- package/artifacts/build-info/solc-0_8_28-5150b9e6b6cf4df4986fccba97bea37a16fdfebc.output.json +1 -0
- package/artifacts/contracts/Enclave.sol/Enclave.json +239 -147
- package/artifacts/contracts/Enclave.sol/artifacts.d.ts +6 -6
- package/artifacts/contracts/interfaces/IBondingRegistry.sol/IBondingRegistry.json +881 -0
- package/artifacts/contracts/interfaces/IBondingRegistry.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/ICiphernodeRegistry.json +326 -10
- package/artifacts/contracts/interfaces/ICiphernodeRegistry.sol/artifacts.d.ts +2 -2
- package/artifacts/contracts/interfaces/IComputeProvider.sol/IComputeProvider.json +1 -1
- package/artifacts/contracts/interfaces/IComputeProvider.sol/artifacts.d.ts +1 -1
- package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/IDecryptionVerifier.json +1 -1
- package/artifacts/contracts/interfaces/IDecryptionVerifier.sol/artifacts.d.ts +1 -1
- package/artifacts/contracts/interfaces/IE3Program.sol/IE3Program.json +21 -3
- package/artifacts/contracts/interfaces/IE3Program.sol/artifacts.d.ts +2 -2
- package/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json +247 -27
- package/artifacts/contracts/interfaces/IEnclave.sol/artifacts.d.ts +2 -2
- package/artifacts/contracts/interfaces/{IRegistryFilter.sol/IRegistryFilter.json → ISlashVerifier.sol/ISlashVerifier.json} +10 -10
- package/artifacts/contracts/interfaces/ISlashVerifier.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/interfaces/ISlashingManager.sol/ISlashingManager.json +759 -0
- package/artifacts/contracts/interfaces/ISlashingManager.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/lib/ExitQueueLib.sol/ExitQueueLib.json +116 -0
- package/artifacts/contracts/lib/ExitQueueLib.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/registry/BondingRegistry.sol/BondingRegistry.json +1217 -0
- package/artifacts/contracts/registry/BondingRegistry.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/CiphernodeRegistryOwnable.json +351 -57
- package/artifacts/contracts/registry/CiphernodeRegistryOwnable.sol/artifacts.d.ts +6 -6
- package/artifacts/contracts/slashing/SlashingManager.sol/SlashingManager.json +1107 -0
- package/artifacts/contracts/slashing/SlashingManager.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.json +328 -12
- package/artifacts/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.json +328 -12
- package/artifacts/contracts/test/MockCiphernodeRegistry.sol/artifacts.d.ts +8 -8
- package/artifacts/contracts/test/MockComputeProvider.sol/MockComputeProvider.json +4 -4
- package/artifacts/contracts/test/MockComputeProvider.sol/artifacts.d.ts +4 -4
- package/artifacts/contracts/test/MockDecryptionVerifier.sol/MockDecryptionVerifier.json +3 -3
- package/artifacts/contracts/test/MockDecryptionVerifier.sol/artifacts.d.ts +3 -3
- package/artifacts/contracts/test/MockE3Program.sol/MockE3Program.json +26 -32
- package/artifacts/contracts/test/MockE3Program.sol/artifacts.d.ts +4 -4
- package/artifacts/contracts/test/MockSlashingVerifier.sol/MockSlashingVerifier.json +38 -0
- package/artifacts/contracts/test/MockSlashingVerifier.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/test/MockStableToken.sol/MockUSDC.json +425 -0
- package/artifacts/contracts/test/MockStableToken.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/token/EnclaveTicketToken.sol/EnclaveTicketToken.json +1222 -0
- package/artifacts/contracts/token/EnclaveTicketToken.sol/artifacts.d.ts +27 -0
- package/artifacts/contracts/token/EnclaveToken.sol/EnclaveToken.json +1460 -0
- package/artifacts/contracts/token/EnclaveToken.sol/artifacts.d.ts +27 -0
- package/artifacts/poseidon-solidity/PoseidonT3.sol/PoseidonT3.json +3 -3
- package/artifacts/poseidon-solidity/PoseidonT3.sol/artifacts.d.ts +3 -3
- package/contracts/Enclave.sol +230 -81
- package/contracts/interfaces/IBondingRegistry.sol +446 -0
- package/contracts/interfaces/ICiphernodeRegistry.sol +153 -9
- package/contracts/interfaces/IComputeProvider.sol +12 -2
- package/contracts/interfaces/IDecryptionVerifier.sol +11 -6
- package/contracts/interfaces/IE3.sol +21 -17
- package/contracts/interfaces/IE3Program.sol +30 -17
- package/contracts/interfaces/IEnclave.sol +95 -21
- package/contracts/interfaces/ISlashVerifier.sol +23 -0
- package/contracts/interfaces/ISlashingManager.sol +426 -0
- package/contracts/lib/ExitQueueLib.sol +490 -0
- package/contracts/registry/BondingRegistry.sol +737 -0
- package/contracts/registry/CiphernodeRegistryOwnable.sol +393 -26
- package/contracts/slashing/SlashingManager.sol +367 -0
- package/contracts/test/MockCiphernodeRegistry.sol +118 -24
- package/contracts/test/MockComputeProvider.sol +2 -2
- package/contracts/test/MockE3Program.sol +17 -14
- package/contracts/test/MockSlashingVerifier.sol +19 -0
- package/contracts/test/MockStableToken.sol +28 -0
- package/contracts/token/EnclaveTicketToken.sol +243 -0
- package/contracts/token/EnclaveToken.sol +267 -0
- package/dist/hardhat.config.d.ts.map +1 -1
- package/dist/hardhat.config.js +35 -16
- package/dist/ignition/modules/{mockInputValidator.d.ts → bondingRegistry.d.ts} +1 -1
- package/dist/ignition/modules/bondingRegistry.d.ts.map +1 -0
- package/dist/ignition/modules/bondingRegistry.js +35 -0
- package/dist/ignition/modules/ciphernodeRegistry.d.ts.map +1 -1
- package/dist/ignition/modules/ciphernodeRegistry.js +12 -2
- package/dist/ignition/modules/enclave.d.ts.map +1 -1
- package/dist/ignition/modules/enclave.js +16 -7
- package/dist/ignition/modules/{naiveRegistryFilter.d.ts → enclaveTicketToken.d.ts} +1 -1
- package/dist/ignition/modules/enclaveTicketToken.d.ts.map +1 -0
- package/dist/ignition/modules/enclaveTicketToken.js +17 -0
- package/dist/ignition/modules/enclaveToken.d.ts +3 -0
- package/dist/ignition/modules/enclaveToken.d.ts.map +1 -0
- package/dist/ignition/modules/{mockInputValidator.js → enclaveToken.js} +4 -4
- package/dist/ignition/modules/mockCiphernodeRegistry.d.ts.map +1 -1
- package/dist/ignition/modules/mockCiphernodeRegistry.js +0 -1
- package/dist/ignition/modules/mockCiphernodeRegistryEmptyKey.d.ts.map +1 -1
- package/dist/ignition/modules/mockCiphernodeRegistryEmptyKey.js +0 -1
- package/dist/ignition/modules/mockComputeProvider.d.ts.map +1 -1
- package/dist/ignition/modules/mockComputeProvider.js +0 -1
- package/dist/ignition/modules/mockDecryptionVerifier.d.ts.map +1 -1
- package/dist/ignition/modules/mockDecryptionVerifier.js +0 -1
- package/dist/ignition/modules/mockE3Program.d.ts.map +1 -1
- package/dist/ignition/modules/mockE3Program.js +1 -3
- package/dist/ignition/modules/mockSlashingVerifier.d.ts +3 -0
- package/dist/ignition/modules/mockSlashingVerifier.d.ts.map +1 -0
- package/dist/ignition/modules/mockSlashingVerifier.js +10 -0
- package/dist/ignition/modules/mockStableToken.d.ts +3 -0
- package/dist/ignition/modules/mockStableToken.d.ts.map +1 -0
- package/dist/ignition/modules/mockStableToken.js +11 -0
- package/dist/ignition/modules/poseidonT3.d.ts.map +1 -1
- package/dist/ignition/modules/poseidonT3.js +0 -1
- package/dist/ignition/modules/slashingManager.d.ts +3 -0
- package/dist/ignition/modules/slashingManager.d.ts.map +1 -0
- package/dist/ignition/modules/slashingManager.js +16 -0
- package/dist/scripts/cleanIgnitionState.d.ts +12 -0
- package/dist/scripts/cleanIgnitionState.d.ts.map +1 -0
- package/dist/scripts/cleanIgnitionState.js +41 -0
- package/dist/scripts/deployAndSave/bondingRegistry.d.ts +38 -0
- package/dist/scripts/deployAndSave/bondingRegistry.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/bondingRegistry.js +133 -0
- package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.d.ts +11 -1
- package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.d.ts.map +1 -1
- package/dist/scripts/deployAndSave/ciphernodeRegistryOwnable.js +76 -19
- package/dist/scripts/deployAndSave/enclave.d.ts +16 -2
- package/dist/scripts/deployAndSave/enclave.d.ts.map +1 -1
- package/dist/scripts/deployAndSave/enclave.js +89 -22
- package/dist/scripts/deployAndSave/enclaveTicketToken.d.ts +20 -0
- package/dist/scripts/deployAndSave/enclaveTicketToken.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/enclaveTicketToken.js +41 -0
- package/dist/scripts/deployAndSave/enclaveToken.d.ts +18 -0
- package/dist/scripts/deployAndSave/enclaveToken.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/enclaveToken.js +57 -0
- package/dist/scripts/deployAndSave/mockComputeProvider.d.ts.map +1 -1
- package/dist/scripts/deployAndSave/mockComputeProvider.js +5 -5
- package/dist/scripts/deployAndSave/mockDecryptionVerifier.d.ts.map +1 -1
- package/dist/scripts/deployAndSave/mockDecryptionVerifier.js +5 -5
- package/dist/scripts/deployAndSave/mockProgram.d.ts +1 -2
- package/dist/scripts/deployAndSave/mockProgram.d.ts.map +1 -1
- package/dist/scripts/deployAndSave/mockProgram.js +7 -19
- package/dist/scripts/deployAndSave/mockStableToken.d.ts +18 -0
- package/dist/scripts/deployAndSave/mockStableToken.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/mockStableToken.js +36 -0
- package/dist/scripts/deployAndSave/poseidonT3.d.ts +11 -0
- package/dist/scripts/deployAndSave/poseidonT3.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/poseidonT3.js +41 -0
- package/dist/scripts/deployAndSave/slashingManager.d.ts +19 -0
- package/dist/scripts/deployAndSave/slashingManager.d.ts.map +1 -0
- package/dist/scripts/deployAndSave/slashingManager.js +38 -0
- package/dist/scripts/deployEnclave.d.ts.map +1 -1
- package/dist/scripts/deployEnclave.js +109 -23
- package/dist/scripts/deployMocks.d.ts +0 -1
- package/dist/scripts/deployMocks.d.ts.map +1 -1
- package/dist/scripts/deployMocks.js +3 -6
- package/dist/scripts/index.d.ts +7 -2
- package/dist/scripts/index.d.ts.map +1 -1
- package/dist/scripts/index.js +7 -2
- package/dist/scripts/proxy.d.ts +22 -0
- package/dist/scripts/proxy.d.ts.map +1 -0
- package/dist/scripts/proxy.js +36 -0
- package/dist/scripts/runVerification.d.ts +2 -0
- package/dist/scripts/runVerification.d.ts.map +1 -0
- package/dist/scripts/runVerification.js +16 -0
- package/dist/scripts/upgrade/bondingRegistry.d.ts +6 -0
- package/dist/scripts/upgrade/bondingRegistry.d.ts.map +1 -0
- package/dist/scripts/upgrade/bondingRegistry.js +49 -0
- package/dist/scripts/upgrade/ciphernodeRegistryOwnable.d.ts +6 -0
- package/dist/scripts/upgrade/ciphernodeRegistryOwnable.d.ts.map +1 -0
- package/dist/scripts/upgrade/ciphernodeRegistryOwnable.js +52 -0
- package/dist/scripts/upgrade/enclave.d.ts +6 -0
- package/dist/scripts/upgrade/enclave.d.ts.map +1 -0
- package/dist/scripts/upgrade/enclave.js +49 -0
- package/dist/scripts/utils.d.ts +51 -2
- package/dist/scripts/utils.d.ts.map +1 -1
- package/dist/scripts/utils.js +67 -4
- package/dist/scripts/verify.d.ts +6 -0
- package/dist/scripts/verify.d.ts.map +1 -0
- package/dist/scripts/verify.js +142 -0
- package/dist/tasks/ciphernode.d.ts +2 -0
- package/dist/tasks/ciphernode.d.ts.map +1 -1
- package/dist/tasks/ciphernode.js +290 -19
- package/dist/tasks/enclave.d.ts.map +1 -1
- package/dist/tasks/enclave.js +76 -31
- package/dist/test/Enclave.spec.js +377 -370
- package/dist/test/Registry/BondingRegistry.spec.d.ts +2 -0
- package/dist/test/Registry/BondingRegistry.spec.d.ts.map +1 -0
- package/dist/test/Registry/BondingRegistry.spec.js +684 -0
- package/dist/test/Registry/CiphernodeRegistryOwnable.spec.d.ts.map +1 -0
- package/dist/test/Registry/CiphernodeRegistryOwnable.spec.js +374 -0
- package/dist/test/Slashing/SlashingManager.spec.d.ts +2 -0
- package/dist/test/Slashing/SlashingManager.spec.d.ts.map +1 -0
- package/dist/test/Slashing/SlashingManager.spec.js +672 -0
- package/dist/types/@openzeppelin/contracts/index.d.ts +3 -0
- package/dist/types/@openzeppelin/contracts/index.d.ts.map +1 -0
- package/dist/types/@openzeppelin/contracts/proxy/index.d.ts +3 -0
- package/dist/types/@openzeppelin/contracts/proxy/index.d.ts.map +1 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts +97 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.d.ts.map +1 -0
- package/dist/types/{contracts/registry/NaiveRegistryFilter.js → @openzeppelin/contracts/proxy/transparent/ProxyAdmin.js} +0 -4
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.d.ts +81 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.d.ts.map +1 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy.js +12 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.d.ts +52 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.d.ts.map +1 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.js +8 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +3 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts.map +1 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/index.d.ts +4 -0
- package/dist/types/@openzeppelin/contracts/proxy/transparent/index.d.ts.map +1 -0
- package/dist/types/@openzeppelin/index.d.ts +3 -0
- package/dist/types/@openzeppelin/index.d.ts.map +1 -0
- package/dist/types/contracts/Enclave.d.ts +126 -53
- package/dist/types/contracts/Enclave.d.ts.map +1 -1
- package/dist/types/contracts/Enclave.js +12 -0
- package/dist/types/contracts/index.d.ts +6 -0
- package/dist/types/contracts/index.d.ts.map +1 -1
- package/dist/types/contracts/interfaces/IBondingRegistry.d.ts +622 -0
- package/dist/types/contracts/interfaces/IBondingRegistry.d.ts.map +1 -0
- package/dist/types/contracts/interfaces/IBondingRegistry.js +24 -0
- package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts +245 -15
- package/dist/types/contracts/interfaces/ICiphernodeRegistry.d.ts.map +1 -1
- package/dist/types/contracts/interfaces/ICiphernodeRegistry.js +16 -0
- package/dist/types/contracts/interfaces/IE3Program.d.ts +20 -10
- package/dist/types/contracts/interfaces/IE3Program.d.ts.map +1 -1
- package/dist/types/contracts/interfaces/IEnclave.d.ts +149 -20
- package/dist/types/contracts/interfaces/IEnclave.d.ts.map +1 -1
- package/dist/types/contracts/interfaces/IEnclave.js +12 -0
- package/dist/types/contracts/interfaces/{IRegistryFilter.d.ts → ISlashVerifier.d.ts} +16 -16
- package/dist/types/contracts/interfaces/ISlashVerifier.d.ts.map +1 -0
- package/dist/types/contracts/interfaces/ISlashVerifier.js +1 -0
- package/dist/types/contracts/interfaces/ISlashingManager.d.ts +384 -0
- package/dist/types/contracts/interfaces/ISlashingManager.d.ts.map +1 -0
- package/dist/types/contracts/interfaces/ISlashingManager.js +24 -0
- package/dist/types/contracts/interfaces/index.d.ts +3 -2
- package/dist/types/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/types/contracts/lib/ExitQueueLib.d.ts +73 -0
- package/dist/types/contracts/lib/ExitQueueLib.d.ts.map +1 -0
- package/dist/types/contracts/lib/ExitQueueLib.js +12 -0
- package/dist/types/contracts/lib/index.d.ts +2 -0
- package/dist/types/contracts/lib/index.d.ts.map +1 -0
- package/dist/types/contracts/lib/index.js +1 -0
- package/dist/types/contracts/registry/BondingRegistry.d.ts +821 -0
- package/dist/types/contracts/registry/BondingRegistry.d.ts.map +1 -0
- package/dist/types/contracts/registry/BondingRegistry.js +44 -0
- package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts +194 -34
- package/dist/types/contracts/registry/CiphernodeRegistryOwnable.d.ts.map +1 -1
- package/dist/types/contracts/registry/CiphernodeRegistryOwnable.js +20 -0
- package/dist/types/contracts/registry/index.d.ts +1 -1
- package/dist/types/contracts/registry/index.d.ts.map +1 -1
- package/dist/types/contracts/slashing/SlashingManager.d.ts +592 -0
- package/dist/types/contracts/slashing/SlashingManager.d.ts.map +1 -0
- package/dist/types/contracts/slashing/SlashingManager.js +36 -0
- package/dist/types/contracts/slashing/index.d.ts +2 -0
- package/dist/types/contracts/slashing/index.d.ts.map +1 -0
- package/dist/types/contracts/slashing/index.js +1 -0
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts +247 -17
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.d.ts.map +1 -1
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry.js +16 -0
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts +247 -17
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.d.ts.map +1 -1
- package/dist/types/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey.js +16 -0
- package/dist/types/contracts/test/MockE3Program.d.ts +20 -14
- package/dist/types/contracts/test/MockE3Program.d.ts.map +1 -1
- package/dist/types/contracts/test/{MockInputValidator.d.ts → MockSlashingVerifier.d.ts} +15 -15
- package/dist/types/contracts/test/MockSlashingVerifier.d.ts.map +1 -0
- package/dist/types/contracts/test/MockSlashingVerifier.js +1 -0
- package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.d.ts +227 -0
- package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.d.ts.map +1 -0
- package/dist/types/contracts/test/MockStableToken.sol/MockUSDC.js +12 -0
- package/dist/types/contracts/test/MockStableToken.sol/index.d.ts +2 -0
- package/dist/types/contracts/test/MockStableToken.sol/index.d.ts.map +1 -0
- package/dist/types/contracts/test/MockStableToken.sol/index.js +1 -0
- package/dist/types/contracts/test/index.d.ts +3 -3
- package/dist/types/contracts/test/index.d.ts.map +1 -1
- package/dist/types/contracts/token/EnclaveTicketToken.d.ts +574 -0
- package/dist/types/contracts/token/EnclaveTicketToken.d.ts.map +1 -0
- package/dist/types/contracts/token/EnclaveTicketToken.js +24 -0
- package/dist/types/contracts/token/EnclaveToken.d.ts +775 -0
- package/dist/types/contracts/token/EnclaveToken.d.ts.map +1 -0
- package/dist/types/contracts/token/EnclaveToken.js +48 -0
- package/dist/types/contracts/token/index.d.ts +3 -0
- package/dist/types/contracts/token/index.d.ts.map +1 -0
- package/dist/types/contracts/token/index.js +1 -0
- package/dist/types/factories/@openzeppelin/contracts/index.d.ts +2 -0
- package/dist/types/factories/@openzeppelin/contracts/index.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/index.js +4 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/index.d.ts +2 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/index.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/index.js +4 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts +118 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.js +157 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.d.ts +57 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/ITransparentUpgradeableProxy__factory.js +78 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts +105 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy__factory.js +141 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts +3 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.js +5 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.d.ts +3 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/contracts/proxy/transparent/index.js +5 -0
- package/dist/types/factories/@openzeppelin/index.d.ts +2 -0
- package/dist/types/factories/@openzeppelin/index.d.ts.map +1 -0
- package/dist/types/factories/@openzeppelin/index.js +4 -0
- package/dist/types/factories/contracts/Enclave__factory.d.ts +190 -104
- package/dist/types/factories/contracts/Enclave__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/Enclave__factory.js +241 -134
- package/dist/types/factories/contracts/index.d.ts +3 -0
- package/dist/types/factories/contracts/index.d.ts.map +1 -1
- package/dist/types/factories/contracts/index.js +3 -0
- package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts +678 -0
- package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/interfaces/IBondingRegistry__factory.js +882 -0
- package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts +253 -9
- package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/interfaces/ICiphernodeRegistry__factory.js +325 -9
- package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts +16 -2
- package/dist/types/factories/contracts/interfaces/IE3Program__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/interfaces/IE3Program__factory.js +20 -2
- package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts +190 -24
- package/dist/types/factories/contracts/interfaces/IEnclave__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/interfaces/IEnclave__factory.js +246 -26
- package/dist/types/factories/contracts/interfaces/ISlashVerifier__factory.d.ts +26 -0
- package/dist/types/factories/contracts/interfaces/ISlashVerifier__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/interfaces/{IRegistryFilter__factory.js → ISlashVerifier__factory.js} +7 -7
- package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.d.ts +594 -0
- package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/interfaces/ISlashingManager__factory.js +760 -0
- package/dist/types/factories/contracts/interfaces/index.d.ts +3 -2
- package/dist/types/factories/contracts/interfaces/index.d.ts.map +1 -1
- package/dist/types/factories/contracts/interfaces/index.js +3 -2
- package/dist/types/factories/contracts/lib/ExitQueueLib__factory.d.ts +107 -0
- package/dist/types/factories/contracts/lib/ExitQueueLib__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/lib/ExitQueueLib__factory.js +138 -0
- package/dist/types/factories/contracts/lib/index.d.ts +2 -0
- package/dist/types/factories/contracts/lib/index.d.ts.map +1 -0
- package/dist/types/factories/contracts/lib/index.js +4 -0
- package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts +958 -0
- package/dist/types/factories/contracts/registry/BondingRegistry__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/registry/BondingRegistry__factory.js +1239 -0
- package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts +272 -40
- package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/registry/CiphernodeRegistryOwnable__factory.js +343 -49
- package/dist/types/factories/contracts/registry/index.d.ts +1 -1
- package/dist/types/factories/contracts/registry/index.d.ts.map +1 -1
- package/dist/types/factories/contracts/registry/index.js +1 -1
- package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts +879 -0
- package/dist/types/factories/contracts/slashing/SlashingManager__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/slashing/SlashingManager__factory.js +1129 -0
- package/dist/types/factories/contracts/slashing/index.d.ts +2 -0
- package/dist/types/factories/contracts/slashing/index.d.ts.map +1 -0
- package/dist/types/factories/contracts/slashing/index.js +4 -0
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts +254 -10
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistryEmptyKey__factory.js +326 -10
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts +254 -10
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/MockCiphernodeRegistry.sol/MockCiphernodeRegistry__factory.js +326 -10
- package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts +2 -2
- package/dist/types/factories/contracts/test/MockComputeProvider__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/MockComputeProvider__factory.js +2 -2
- package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.d.ts +1 -1
- package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/MockDecryptionVerifier__factory.js +1 -1
- package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts +23 -27
- package/dist/types/factories/contracts/test/MockE3Program__factory.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/MockE3Program__factory.js +28 -34
- package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.d.ts +43 -0
- package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/test/MockSlashingVerifier__factory.js +60 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts +338 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/MockUSDC__factory.js +447 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/index.d.ts +2 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/index.d.ts.map +1 -0
- package/dist/types/factories/contracts/test/MockStableToken.sol/index.js +4 -0
- package/dist/types/factories/contracts/test/index.d.ts +2 -2
- package/dist/types/factories/contracts/test/index.d.ts.map +1 -1
- package/dist/types/factories/contracts/test/index.js +2 -2
- package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts +894 -0
- package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/token/EnclaveTicketToken__factory.js +1175 -0
- package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts +1101 -0
- package/dist/types/factories/contracts/token/EnclaveToken__factory.d.ts.map +1 -0
- package/dist/types/factories/contracts/token/EnclaveToken__factory.js +1439 -0
- package/dist/types/factories/contracts/token/index.d.ts +3 -0
- package/dist/types/factories/contracts/token/index.d.ts.map +1 -0
- package/dist/types/factories/contracts/token/index.js +5 -0
- package/dist/types/factories/index.d.ts +1 -0
- package/dist/types/factories/index.d.ts.map +1 -1
- package/dist/types/factories/index.js +1 -0
- package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.d.ts +1 -1
- package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.d.ts.map +1 -1
- package/dist/types/factories/poseidon-solidity/PoseidonT3__factory.js +1 -1
- package/dist/types/index.d.ts +28 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +13 -6
- package/package.json +30 -21
- package/LICENSE.md +0 -165
- package/artifacts/build-info/solc-0_8_27-9aea5e3f6e25811e781e96c22e8edaf1eb1a01c5.json +0 -130
- package/artifacts/build-info/solc-0_8_27-9aea5e3f6e25811e781e96c22e8edaf1eb1a01c5.output.json +0 -1
- package/artifacts/contracts/interfaces/IInputValidator.sol/IInputValidator.json +0 -38
- package/artifacts/contracts/interfaces/IInputValidator.sol/artifacts.d.ts +0 -27
- package/artifacts/contracts/interfaces/IRegistryFilter.sol/artifacts.d.ts +0 -27
- package/artifacts/contracts/registry/NaiveRegistryFilter.sol/NaiveRegistryFilter.json +0 -309
- package/artifacts/contracts/registry/NaiveRegistryFilter.sol/artifacts.d.ts +0 -27
- package/artifacts/contracts/test/MockInputValidator.sol/MockInputValidator.json +0 -43
- package/artifacts/contracts/test/MockInputValidator.sol/artifacts.d.ts +0 -27
- package/artifacts/contracts/test/MockRegistryFilter.sol/IRegistry.json +0 -37
- package/artifacts/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.json +0 -262
- package/artifacts/contracts/test/MockRegistryFilter.sol/artifacts.d.ts +0 -43
- package/contracts/interfaces/IInputValidator.sol +0 -18
- package/contracts/interfaces/IRegistryFilter.sol +0 -13
- package/contracts/registry/NaiveRegistryFilter.sol +0 -124
- package/contracts/test/MockInputValidator.sol +0 -29
- package/contracts/test/MockRegistryFilter.sol +0 -117
- package/dist/ignition/modules/mockInputValidator.d.ts.map +0 -1
- package/dist/ignition/modules/naiveRegistryFilter.d.ts.map +0 -1
- package/dist/ignition/modules/naiveRegistryFilter.js +0 -16
- package/dist/scripts/deployAndSave/mockInputValidator.d.ts +0 -6
- package/dist/scripts/deployAndSave/mockInputValidator.d.ts.map +0 -1
- package/dist/scripts/deployAndSave/mockInputValidator.js +0 -18
- package/dist/scripts/deployAndSave/naiveRegistryFilter.d.ts +0 -11
- package/dist/scripts/deployAndSave/naiveRegistryFilter.d.ts.map +0 -1
- package/dist/scripts/deployAndSave/naiveRegistryFilter.js +0 -41
- package/dist/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.d.ts.map +0 -1
- package/dist/test/CiphernodeRegistry/CiphernodeRegistryOwnable.spec.js +0 -279
- package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.d.ts +0 -2
- package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.d.ts.map +0 -1
- package/dist/test/CiphernodeRegistry/NaiveRegistryFilter.spec.js +0 -160
- package/dist/types/contracts/interfaces/IInputValidator.d.ts +0 -36
- package/dist/types/contracts/interfaces/IInputValidator.d.ts.map +0 -1
- package/dist/types/contracts/interfaces/IRegistryFilter.d.ts.map +0 -1
- package/dist/types/contracts/registry/NaiveRegistryFilter.d.ts +0 -187
- package/dist/types/contracts/registry/NaiveRegistryFilter.d.ts.map +0 -1
- package/dist/types/contracts/test/MockInputValidator.d.ts.map +0 -1
- package/dist/types/contracts/test/MockRegistryFilter.sol/IRegistry.d.ts +0 -38
- package/dist/types/contracts/test/MockRegistryFilter.sol/IRegistry.d.ts.map +0 -1
- package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.d.ts +0 -163
- package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.d.ts.map +0 -1
- package/dist/types/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter.js +0 -8
- package/dist/types/contracts/test/MockRegistryFilter.sol/index.d.ts +0 -3
- package/dist/types/contracts/test/MockRegistryFilter.sol/index.d.ts.map +0 -1
- package/dist/types/factories/contracts/interfaces/IInputValidator__factory.d.ts +0 -26
- package/dist/types/factories/contracts/interfaces/IInputValidator__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/interfaces/IInputValidator__factory.js +0 -39
- package/dist/types/factories/contracts/interfaces/IRegistryFilter__factory.d.ts +0 -26
- package/dist/types/factories/contracts/interfaces/IRegistryFilter__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.d.ts +0 -251
- package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/registry/NaiveRegistryFilter__factory.js +0 -331
- package/dist/types/factories/contracts/test/MockInputValidator__factory.d.ts +0 -47
- package/dist/types/factories/contracts/test/MockInputValidator__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/test/MockInputValidator__factory.js +0 -65
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.d.ts +0 -26
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/IRegistry__factory.js +0 -38
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.d.ts +0 -216
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.d.ts.map +0 -1
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/MockNaiveRegistryFilter__factory.js +0 -284
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.d.ts +0 -3
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.d.ts.map +0 -1
- package/dist/types/factories/contracts/test/MockRegistryFilter.sol/index.js +0 -5
- /package/dist/test/{CiphernodeRegistry → Registry}/CiphernodeRegistryOwnable.spec.d.ts +0 -0
- /package/dist/types/{contracts/test/MockRegistryFilter.sol → @openzeppelin/contracts}/index.js +0 -0
- /package/dist/types/{contracts/interfaces/IInputValidator.js → @openzeppelin/contracts/proxy/index.js} +0 -0
- /package/dist/types/{contracts/interfaces/IRegistryFilter.js → @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/index.js} +0 -0
- /package/dist/types/{contracts/test/MockInputValidator.js → @openzeppelin/contracts/proxy/transparent/index.js} +0 -0
- /package/dist/types/{contracts/test/MockRegistryFilter.sol/IRegistry.js → @openzeppelin/index.js} +0 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
|
+
//
|
|
3
|
+
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
|
+
// without even the implied warranty of MERCHANTABILITY
|
|
5
|
+
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
+
|
|
7
|
+
pragma solidity >=0.8.27;
|
|
8
|
+
|
|
9
|
+
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
10
|
+
import { ICiphernodeRegistry } from "./ICiphernodeRegistry.sol";
|
|
11
|
+
import { EnclaveTicketToken } from "../token/EnclaveTicketToken.sol";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title IBondingRegistry
|
|
15
|
+
* @notice Interface for the main bonding registry that holds operator balance and license bonds
|
|
16
|
+
*/
|
|
17
|
+
interface IBondingRegistry {
|
|
18
|
+
// ======================
|
|
19
|
+
// Custom Errors
|
|
20
|
+
// ======================
|
|
21
|
+
|
|
22
|
+
// General
|
|
23
|
+
error ZeroAddress();
|
|
24
|
+
error ZeroAmount();
|
|
25
|
+
error CiphernodeBanned();
|
|
26
|
+
error Unauthorized();
|
|
27
|
+
error InsufficientBalance();
|
|
28
|
+
error NotLicensed();
|
|
29
|
+
error AlreadyRegistered();
|
|
30
|
+
error NotRegistered();
|
|
31
|
+
error ExitInProgress();
|
|
32
|
+
error ExitNotReady();
|
|
33
|
+
error InvalidAmount();
|
|
34
|
+
error InvalidConfiguration();
|
|
35
|
+
error NoPendingDeregistration();
|
|
36
|
+
error OnlyRewardDistributor();
|
|
37
|
+
error ArrayLengthMismatch();
|
|
38
|
+
|
|
39
|
+
// ======================
|
|
40
|
+
// Events (Protocol-Named)
|
|
41
|
+
// ======================
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @notice Emitted when operator's ticket balance changes
|
|
45
|
+
* @param operator Address of the operator
|
|
46
|
+
* @param delta Change in balance (positive for increase, negative for decrease)
|
|
47
|
+
* @param newBalance New total balance
|
|
48
|
+
* @param reason Reason for the change (e.g., "DEPOSIT", "WITHDRAW", slash reason)
|
|
49
|
+
*/
|
|
50
|
+
event TicketBalanceUpdated(
|
|
51
|
+
address indexed operator,
|
|
52
|
+
int256 delta,
|
|
53
|
+
uint256 newBalance,
|
|
54
|
+
bytes32 indexed reason
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @notice Emitted when operator's license bond changes
|
|
59
|
+
* @param operator Address of the operator
|
|
60
|
+
* @param delta Change in bond (positive for increase, negative for decrease)
|
|
61
|
+
* @param newBond New total license bond
|
|
62
|
+
* @param reason Reason for the change (e.g., "BOND", "UNBOND", slash reason)
|
|
63
|
+
*/
|
|
64
|
+
event LicenseBondUpdated(
|
|
65
|
+
address indexed operator,
|
|
66
|
+
int256 delta,
|
|
67
|
+
uint256 newBond,
|
|
68
|
+
bytes32 indexed reason
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @notice Emitted when operator requests deregistration from the protocol
|
|
73
|
+
* @param operator Address of the operator
|
|
74
|
+
* @param unlockAt Timestamp when deregistration can be finalized
|
|
75
|
+
*/
|
|
76
|
+
event CiphernodeDeregistrationRequested(
|
|
77
|
+
address indexed operator,
|
|
78
|
+
uint64 unlockAt
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @notice Emitted when operator active status changes
|
|
83
|
+
* @param operator Address of the operator
|
|
84
|
+
* @param active True if active, false if inactive
|
|
85
|
+
*/
|
|
86
|
+
event OperatorActivationChanged(address indexed operator, bool active);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @notice Emitted when configuration is updated
|
|
90
|
+
* @param parameter Name of the parameter
|
|
91
|
+
* @param oldValue Previous value
|
|
92
|
+
* @param newValue New value
|
|
93
|
+
*/
|
|
94
|
+
event ConfigurationUpdated(
|
|
95
|
+
bytes32 indexed parameter,
|
|
96
|
+
uint256 oldValue,
|
|
97
|
+
uint256 newValue
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @notice Emitted when treasury withdraws slashed funds
|
|
102
|
+
* @param to Treasury address
|
|
103
|
+
* @param ticketAmount Amount of slashed ticket balance withdrawn
|
|
104
|
+
* @param licenseAmount Amount of slashed license bond withdrawn
|
|
105
|
+
*/
|
|
106
|
+
event SlashedFundsWithdrawn(
|
|
107
|
+
address indexed to,
|
|
108
|
+
uint256 ticketAmount,
|
|
109
|
+
uint256 licenseAmount
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// ======================
|
|
113
|
+
// View Functions
|
|
114
|
+
// ======================
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @notice Get license token address
|
|
118
|
+
* @return License token address
|
|
119
|
+
*/
|
|
120
|
+
function getLicenseToken() external view returns (address);
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @notice Get ticket token address
|
|
124
|
+
* @return Ticket token address
|
|
125
|
+
*/
|
|
126
|
+
function getTicketToken() external view returns (address);
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @notice Get operator's current ticket balance
|
|
130
|
+
* @param operator Address of the operator
|
|
131
|
+
* @return Current collateral balance
|
|
132
|
+
*/
|
|
133
|
+
function getTicketBalance(address operator) external view returns (uint256);
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* @notice Get operator's current license bond
|
|
137
|
+
* @param operator Address of the operator
|
|
138
|
+
* @return Current license bond
|
|
139
|
+
*/
|
|
140
|
+
function getLicenseBond(address operator) external view returns (uint256);
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @notice Get current ticket price
|
|
144
|
+
* @return Price per ticket in collateral token units
|
|
145
|
+
*/
|
|
146
|
+
function ticketPrice() external view returns (uint256);
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @notice Calculate available tickets for an operator
|
|
150
|
+
* @param operator Address of the operator
|
|
151
|
+
* @return Number of tickets available (floor(balance / ticketPrice))
|
|
152
|
+
*/
|
|
153
|
+
function availableTickets(address operator) external view returns (uint256);
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @notice Check if operator is licensed
|
|
157
|
+
* @param operator Address of the operator
|
|
158
|
+
* @return True if operator has sufficient license bond
|
|
159
|
+
*/
|
|
160
|
+
function isLicensed(address operator) external view returns (bool);
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* @notice Check if operator is registered
|
|
164
|
+
* @param operator Address of the operator
|
|
165
|
+
* @return True if operator is registered
|
|
166
|
+
*/
|
|
167
|
+
function isRegistered(address operator) external view returns (bool);
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @notice Check if operator is active
|
|
171
|
+
* @param operator Address of the operator
|
|
172
|
+
* @return True if operator is active (licensed, registered, and has min tickets)
|
|
173
|
+
*/
|
|
174
|
+
function isActive(address operator) external view returns (bool);
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @notice Check if operator has deregistration in progress
|
|
178
|
+
* @param operator Address of the operator
|
|
179
|
+
* @return True if exit requested but not finalized
|
|
180
|
+
*/
|
|
181
|
+
function hasExitInProgress(address operator) external view returns (bool);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* @notice Get license bond price required
|
|
185
|
+
* @return License bond price amount
|
|
186
|
+
*/
|
|
187
|
+
function licenseRequiredBond() external view returns (uint256);
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @notice Get minimum ticket balance required for activation
|
|
191
|
+
* @return Minimum number of tickets required
|
|
192
|
+
*/
|
|
193
|
+
function minTicketBalance() external view returns (uint256);
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @notice Get exit delay period
|
|
197
|
+
* @return Number of seconds operators must wait after requesting exit
|
|
198
|
+
*/
|
|
199
|
+
function exitDelay() external view returns (uint64);
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @notice Get operator's ticket balance at a specific block
|
|
203
|
+
* @param operator Address of the operator
|
|
204
|
+
* @param blockNumber Block number to query
|
|
205
|
+
* @return Ticket balance at the specified block
|
|
206
|
+
*/
|
|
207
|
+
function getTicketBalanceAtBlock(
|
|
208
|
+
address operator,
|
|
209
|
+
uint256 blockNumber
|
|
210
|
+
) external view returns (uint256);
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* @notice Get operator's total pending exit amounts
|
|
214
|
+
* @param operator Address of the operator
|
|
215
|
+
* @return ticket Total pending ticket balance in exit queue
|
|
216
|
+
* @return license Total pending license bond in exit queue
|
|
217
|
+
*/
|
|
218
|
+
function pendingExits(
|
|
219
|
+
address operator
|
|
220
|
+
) external view returns (uint256 ticket, uint256 license);
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* @notice Preview how much an operator can currently claim
|
|
224
|
+
* @param operator Address of the operator
|
|
225
|
+
* @return ticket Claimable ticket balance
|
|
226
|
+
* @return license Claimable license bond
|
|
227
|
+
*/
|
|
228
|
+
function previewClaimable(
|
|
229
|
+
address operator
|
|
230
|
+
) external view returns (uint256 ticket, uint256 license);
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @notice Get slashed funds treasury address
|
|
234
|
+
* @return Address where slashed funds are sent
|
|
235
|
+
*/
|
|
236
|
+
function slashedFundsTreasury() external view returns (address);
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* @notice Get total slashed ticket balance
|
|
240
|
+
* @return Amount of ticket balance slashed and available for treasury withdrawal
|
|
241
|
+
*/
|
|
242
|
+
function slashedTicketBalance() external view returns (uint256);
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* @notice Get total slashed license bond
|
|
246
|
+
* @return Amount of license bond slashed and available for treasury withdrawal
|
|
247
|
+
*/
|
|
248
|
+
function slashedLicenseBond() external view returns (uint256);
|
|
249
|
+
|
|
250
|
+
// ======================
|
|
251
|
+
// Operator Functions
|
|
252
|
+
// ======================
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @notice Register as an operator (callable by licensed operators)
|
|
256
|
+
* @dev Requires sufficient license bond and calls registry
|
|
257
|
+
*/
|
|
258
|
+
function registerOperator() external;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @notice Deregister as an operator and remove from IMT
|
|
262
|
+
* @param siblingNodes Sibling node proofs for IMT removal
|
|
263
|
+
* @dev Requires operator to provide sibling nodes for immediate IMT removal
|
|
264
|
+
*/
|
|
265
|
+
function deregisterOperator(uint256[] calldata siblingNodes) external;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @notice Increase operator's ticket balance by depositing tokens
|
|
269
|
+
* @param amount Amount of ticket tokens to deposit
|
|
270
|
+
* @dev Requires approval for ticket token transfer
|
|
271
|
+
*/
|
|
272
|
+
function addTicketBalance(uint256 amount) external;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @notice Decrease operator's ticket balance by withdrawing tokens
|
|
276
|
+
* @param amount Amount of ticket tokens to withdraw
|
|
277
|
+
* @dev Reverts if operator is in any active committee
|
|
278
|
+
*/
|
|
279
|
+
function removeTicketBalance(uint256 amount) external;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @notice Bond license tokens to become eligible for registration
|
|
283
|
+
* @param amount Amount of license tokens to bond
|
|
284
|
+
* @dev Requires approval for license token transfer
|
|
285
|
+
*/
|
|
286
|
+
function bondLicense(uint256 amount) external;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @notice Unbond license tokens
|
|
290
|
+
* @param amount Amount of license tokens to unbond
|
|
291
|
+
* @dev Reverts if operator is in any active committee or still registered
|
|
292
|
+
*/
|
|
293
|
+
function unbondLicense(uint256 amount) external;
|
|
294
|
+
|
|
295
|
+
// ======================
|
|
296
|
+
// Claim Functions
|
|
297
|
+
// ======================
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @notice Claim operator's ticket balance and license bond
|
|
301
|
+
* @param maxTicketAmount Maximum amount of ticket tokens to claim
|
|
302
|
+
* @param maxLicenseAmount Maximum amount of license tokens to claim
|
|
303
|
+
*/
|
|
304
|
+
function claimExits(
|
|
305
|
+
uint256 maxTicketAmount,
|
|
306
|
+
uint256 maxLicenseAmount
|
|
307
|
+
) external;
|
|
308
|
+
|
|
309
|
+
// ======================
|
|
310
|
+
// Slashing Functions
|
|
311
|
+
// ======================
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* @notice Slash operator's ticket balance by absolute amount
|
|
315
|
+
* @param operator Address of the operator to slash
|
|
316
|
+
* @param amount Amount to slash
|
|
317
|
+
* @param reason Reason for slashing (stored in event)
|
|
318
|
+
* @dev Only callable by authorized slashing manager
|
|
319
|
+
*/
|
|
320
|
+
function slashTicketBalance(
|
|
321
|
+
address operator,
|
|
322
|
+
uint256 amount,
|
|
323
|
+
bytes32 reason
|
|
324
|
+
) external;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @notice Slash operator's license bond by absolute amount
|
|
328
|
+
* @param operator Address of the operator to slash
|
|
329
|
+
* @param amount Amount to slash
|
|
330
|
+
* @param reason Reason for slashing (stored in event)
|
|
331
|
+
* @dev Only callable by authorized slashing manager
|
|
332
|
+
*/
|
|
333
|
+
function slashLicenseBond(
|
|
334
|
+
address operator,
|
|
335
|
+
uint256 amount,
|
|
336
|
+
bytes32 reason
|
|
337
|
+
) external;
|
|
338
|
+
|
|
339
|
+
// ======================
|
|
340
|
+
// Reward Distribution Functions
|
|
341
|
+
// ======================
|
|
342
|
+
/**
|
|
343
|
+
* @notice Distribute rewards to operators
|
|
344
|
+
* @param rewardToken Reward token contract
|
|
345
|
+
* @param operators Addresses of the operators to distribute rewards to
|
|
346
|
+
* @param amounts Amounts of rewards to distribute to each operator
|
|
347
|
+
* @dev Only callable by contract owner
|
|
348
|
+
*/
|
|
349
|
+
function distributeRewards(
|
|
350
|
+
IERC20 rewardToken,
|
|
351
|
+
address[] calldata operators,
|
|
352
|
+
uint256[] calldata amounts
|
|
353
|
+
) external;
|
|
354
|
+
|
|
355
|
+
// ======================
|
|
356
|
+
// Admin Functions
|
|
357
|
+
// ======================
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @notice Set ticket price
|
|
361
|
+
* @param newTicketPrice New price per ticket
|
|
362
|
+
* @dev Only callable by contract owner
|
|
363
|
+
*/
|
|
364
|
+
function setTicketPrice(uint256 newTicketPrice) external;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* @notice Set license bond price required
|
|
368
|
+
* @param newLicenseRequiredBond New license bond price
|
|
369
|
+
* @dev Only callable by contract owner
|
|
370
|
+
*/
|
|
371
|
+
function setLicenseRequiredBond(uint256 newLicenseRequiredBond) external;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* @notice Set license active BPS
|
|
375
|
+
* @param newBps New license active BPS
|
|
376
|
+
* @dev Only callable by contract owner
|
|
377
|
+
*/
|
|
378
|
+
function setLicenseActiveBps(uint256 newBps) external;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @notice Set minimum ticket balance required for activation
|
|
382
|
+
* @param newMinTicketBalance New minimum ticket balance
|
|
383
|
+
* @dev Only callable by contract owner
|
|
384
|
+
*/
|
|
385
|
+
function setMinTicketBalance(uint256 newMinTicketBalance) external;
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* @notice Set exit delay period
|
|
389
|
+
* @param newExitDelay New exit delay in seconds
|
|
390
|
+
* @dev Only callable by contract owner
|
|
391
|
+
*/
|
|
392
|
+
function setExitDelay(uint64 newExitDelay) external;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* @notice Set ticket token
|
|
396
|
+
* @param newTicketToken New ticket token
|
|
397
|
+
* @dev Only callable by contract owner
|
|
398
|
+
*/
|
|
399
|
+
function setTicketToken(EnclaveTicketToken newTicketToken) external;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* @notice Set license token
|
|
403
|
+
* @param newLicenseToken New license token
|
|
404
|
+
* @dev Only callable by contract owner
|
|
405
|
+
*/
|
|
406
|
+
function setLicenseToken(IERC20 newLicenseToken) external;
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* @notice Set slashed funds treasury address
|
|
410
|
+
* @param newSlashedFundsTreasury New slashed funds treasury address
|
|
411
|
+
* @dev Only callable by contract owner
|
|
412
|
+
*/
|
|
413
|
+
function setSlashedFundsTreasury(address newSlashedFundsTreasury) external;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* @notice Set registry address
|
|
417
|
+
* @param newRegistry New registry contract address
|
|
418
|
+
* @dev Only callable by contract owner
|
|
419
|
+
*/
|
|
420
|
+
function setRegistry(ICiphernodeRegistry newRegistry) external;
|
|
421
|
+
|
|
422
|
+
/**
|
|
423
|
+
* @notice Set slashing manager address
|
|
424
|
+
* @param newSlashingManager New slashing manager contract address
|
|
425
|
+
* @dev Only callable by contract owner
|
|
426
|
+
*/
|
|
427
|
+
function setSlashingManager(address newSlashingManager) external;
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* @notice Set reward distributor address
|
|
431
|
+
* @param newRewardDistributor New reward distributor address
|
|
432
|
+
* @dev Only callable by contract owner
|
|
433
|
+
*/
|
|
434
|
+
function setRewardDistributor(address newRewardDistributor) external;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* @notice Withdraw slashed funds to treasury
|
|
438
|
+
* @param ticketAmount Amount of slashed ticket balance to withdraw
|
|
439
|
+
* @param licenseAmount Amount of slashed license bond to withdraw
|
|
440
|
+
* @dev Only callable by contract owner, sends to treasury address
|
|
441
|
+
*/
|
|
442
|
+
function withdrawSlashedFunds(
|
|
443
|
+
uint256 ticketAmount,
|
|
444
|
+
uint256 licenseAmount
|
|
445
|
+
) external;
|
|
446
|
+
}
|
|
@@ -5,21 +5,83 @@
|
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
6
|
pragma solidity >=0.8.27;
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @title ICiphernodeRegistry
|
|
10
|
+
* @notice Interface for managing ciphernode registration and committee selection
|
|
11
|
+
* @dev This registry maintains an Incremental Merkle Tree (IMT) of registered ciphernodes
|
|
12
|
+
* and coordinates committee selection for E3 computations
|
|
13
|
+
*/
|
|
8
14
|
interface ICiphernodeRegistry {
|
|
15
|
+
/// @notice Struct representing the sortition state for an E3 round.
|
|
16
|
+
/// @param initialized Whether the round has been initialized.
|
|
17
|
+
/// @param finalized Whether the round has been finalized.
|
|
18
|
+
/// @param requestBlock The block number when the committee was requested.
|
|
19
|
+
/// @param submissionDeadline The deadline for submitting tickets.
|
|
20
|
+
/// @param threshold The M/N threshold for the committee ([M, N]).
|
|
21
|
+
/// @param publicKey Hash of the committee's public key.
|
|
22
|
+
/// @param seed The seed for the round.
|
|
23
|
+
/// @param topNodes The top nodes in the round.
|
|
24
|
+
/// @param committee The committee for the round.
|
|
25
|
+
/// @param submitted Mapping of nodes to their submission status.
|
|
26
|
+
/// @param scoreOf Mapping of nodes to their scores.
|
|
27
|
+
struct Committee {
|
|
28
|
+
bool initialized;
|
|
29
|
+
bool finalized;
|
|
30
|
+
uint256 seed;
|
|
31
|
+
uint256 requestBlock;
|
|
32
|
+
uint256 submissionDeadline;
|
|
33
|
+
bytes32 publicKey;
|
|
34
|
+
uint32[2] threshold;
|
|
35
|
+
address[] topNodes;
|
|
36
|
+
address[] committee;
|
|
37
|
+
mapping(address node => bool submitted) submitted;
|
|
38
|
+
mapping(address node => uint256 score) scoreOf;
|
|
39
|
+
}
|
|
40
|
+
|
|
9
41
|
/// @notice This event MUST be emitted when a committee is selected for an E3.
|
|
10
42
|
/// @param e3Id ID of the E3 for which the committee was selected.
|
|
11
|
-
/// @param
|
|
43
|
+
/// @param seed Random seed for score computation.
|
|
12
44
|
/// @param threshold The M/N threshold for the committee.
|
|
45
|
+
/// @param requestBlock Block number for snapshot validation.
|
|
46
|
+
/// @param submissionDeadline Deadline for submitting tickets.
|
|
13
47
|
event CommitteeRequested(
|
|
14
48
|
uint256 indexed e3Id,
|
|
15
|
-
|
|
16
|
-
uint32[2] threshold
|
|
49
|
+
uint256 seed,
|
|
50
|
+
uint32[2] threshold,
|
|
51
|
+
uint256 requestBlock,
|
|
52
|
+
uint256 submissionDeadline
|
|
17
53
|
);
|
|
18
54
|
|
|
55
|
+
/// @notice This event MUST be emitted when a ticket is submitted for sortition
|
|
56
|
+
/// @param e3Id ID of the E3 computation
|
|
57
|
+
/// @param node Address of the ciphernode submitting the ticket
|
|
58
|
+
/// @param ticketId The ticket number being submitted
|
|
59
|
+
/// @param score The computed score for the ticket
|
|
60
|
+
event TicketSubmitted(
|
|
61
|
+
uint256 indexed e3Id,
|
|
62
|
+
address indexed node,
|
|
63
|
+
uint256 ticketId,
|
|
64
|
+
uint256 score
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
/// @notice This event MUST be emitted when a committee is finalized
|
|
68
|
+
/// @param e3Id ID of the E3 computation
|
|
69
|
+
/// @param committee Array of selected ciphernode addresses
|
|
70
|
+
event CommitteeFinalized(uint256 indexed e3Id, address[] committee);
|
|
71
|
+
|
|
19
72
|
/// @notice This event MUST be emitted when a committee is selected for an E3.
|
|
20
73
|
/// @param e3Id ID of the E3 for which the committee was selected.
|
|
21
74
|
/// @param publicKey Public key of the committee.
|
|
22
|
-
event CommitteePublished(
|
|
75
|
+
event CommitteePublished(
|
|
76
|
+
uint256 indexed e3Id,
|
|
77
|
+
address[] nodes,
|
|
78
|
+
bytes publicKey
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
/// @notice This event MUST be emitted when a committee's active status changes.
|
|
82
|
+
/// @param e3Id ID of the E3 for which the committee status changed.
|
|
83
|
+
/// @param active True if committee is now active, false if completed.
|
|
84
|
+
event CommitteeActivationChanged(uint256 indexed e3Id, bool active);
|
|
23
85
|
|
|
24
86
|
/// @notice This event MUST be emitted when `enclave` is set.
|
|
25
87
|
/// @param enclave Address of the enclave contract.
|
|
@@ -49,27 +111,53 @@ interface ICiphernodeRegistry {
|
|
|
49
111
|
uint256 size
|
|
50
112
|
);
|
|
51
113
|
|
|
114
|
+
/// @notice This event MUST be emitted any time the `sortitionSubmissionWindow` is set.
|
|
115
|
+
/// @param sortitionSubmissionWindow The submission window for the E3 sortition in seconds.
|
|
116
|
+
event SortitionSubmissionWindowSet(uint256 sortitionSubmissionWindow);
|
|
117
|
+
|
|
118
|
+
/// @notice Check if a ciphernode is eligible for committee selection
|
|
119
|
+
/// @dev A ciphernode is eligible if it is enabled in the registry and meets bonding requirements
|
|
120
|
+
/// @param ciphernode Address of the ciphernode to check
|
|
121
|
+
/// @return eligible Whether the ciphernode is eligible for committee selection
|
|
52
122
|
function isCiphernodeEligible(address ciphernode) external returns (bool);
|
|
53
123
|
|
|
124
|
+
/// @notice Check if a ciphernode is enabled in the registry
|
|
125
|
+
/// @param node Address of the ciphernode
|
|
126
|
+
/// @return enabled Whether the ciphernode is enabled
|
|
127
|
+
function isEnabled(address node) external view returns (bool enabled);
|
|
128
|
+
|
|
129
|
+
/// @notice Add a ciphernode to the registry
|
|
130
|
+
/// @param node Address of the ciphernode to add
|
|
131
|
+
function addCiphernode(address node) external;
|
|
132
|
+
|
|
133
|
+
/// @notice Remove a ciphernode from the registry
|
|
134
|
+
/// @param node Address of the ciphernode to remove
|
|
135
|
+
/// @param siblingNodes Array of sibling node indices for tree operations
|
|
136
|
+
function removeCiphernode(
|
|
137
|
+
address node,
|
|
138
|
+
uint256[] calldata siblingNodes
|
|
139
|
+
) external;
|
|
140
|
+
|
|
54
141
|
/// @notice Initiates the committee selection process for a specified E3.
|
|
55
142
|
/// @dev This function MUST revert when not called by the Enclave contract.
|
|
56
143
|
/// @param e3Id ID of the E3 for which to select the committee.
|
|
57
|
-
/// @param
|
|
144
|
+
/// @param seed Random seed for score computation.
|
|
58
145
|
/// @param threshold The M/N threshold for the committee.
|
|
59
146
|
/// @return success True if committee selection was successfully initiated.
|
|
60
147
|
function requestCommittee(
|
|
61
148
|
uint256 e3Id,
|
|
62
|
-
|
|
149
|
+
uint256 seed,
|
|
63
150
|
uint32[2] calldata threshold
|
|
64
151
|
) external returns (bool success);
|
|
65
152
|
|
|
66
153
|
/// @notice Publishes the public key resulting from the committee selection process.
|
|
67
|
-
/// @dev This function MUST revert if not called by the
|
|
154
|
+
/// @dev This function MUST revert if not called by the owner.
|
|
68
155
|
/// @param e3Id ID of the E3 for which to select the committee.
|
|
69
|
-
/// @param
|
|
156
|
+
/// @param nodes Array of ciphernode addresses selected for the committee.
|
|
157
|
+
/// @param publicKey The public key generated by the given committee.
|
|
70
158
|
function publishCommittee(
|
|
71
159
|
uint256 e3Id,
|
|
72
|
-
|
|
160
|
+
address[] calldata nodes,
|
|
73
161
|
bytes calldata publicKey
|
|
74
162
|
) external;
|
|
75
163
|
|
|
@@ -81,4 +169,60 @@ interface ICiphernodeRegistry {
|
|
|
81
169
|
function committeePublicKey(
|
|
82
170
|
uint256 e3Id
|
|
83
171
|
) external view returns (bytes32 publicKeyHash);
|
|
172
|
+
|
|
173
|
+
/// @notice This function should be called by the Enclave contract to get the committee for a given E3.
|
|
174
|
+
/// @dev This function MUST revert if no committee has been requested for the given E3.
|
|
175
|
+
/// @param e3Id ID of the E3 for which to get the committee.
|
|
176
|
+
/// @return committeeNodes The nodes in the committee for the given E3.
|
|
177
|
+
function getCommitteeNodes(
|
|
178
|
+
uint256 e3Id
|
|
179
|
+
) external view returns (address[] memory committeeNodes);
|
|
180
|
+
|
|
181
|
+
/// @notice Returns the current root of the ciphernode IMT
|
|
182
|
+
/// @return Current IMT root
|
|
183
|
+
function root() external view returns (uint256);
|
|
184
|
+
|
|
185
|
+
/// @notice Returns the IMT root at the time a committee was requested
|
|
186
|
+
/// @param e3Id ID of the E3
|
|
187
|
+
/// @return IMT root at time of committee request
|
|
188
|
+
function rootAt(uint256 e3Id) external view returns (uint256);
|
|
189
|
+
|
|
190
|
+
/// @notice Returns the current size of the ciphernode IMT
|
|
191
|
+
/// @return Size of the IMT
|
|
192
|
+
function treeSize() external view returns (uint256);
|
|
193
|
+
|
|
194
|
+
/// @notice Returns the address of the bonding registry
|
|
195
|
+
/// @return Address of the bonding registry contract
|
|
196
|
+
function getBondingRegistry() external view returns (address);
|
|
197
|
+
|
|
198
|
+
/// @notice Sets the Enclave contract address
|
|
199
|
+
/// @dev Only callable by owner
|
|
200
|
+
/// @param _enclave Address of the Enclave contract
|
|
201
|
+
function setEnclave(address _enclave) external;
|
|
202
|
+
|
|
203
|
+
/// @notice Sets the bonding registry contract address
|
|
204
|
+
/// @dev Only callable by owner
|
|
205
|
+
/// @param _bondingRegistry Address of the bonding registry contract
|
|
206
|
+
function setBondingRegistry(address _bondingRegistry) external;
|
|
207
|
+
|
|
208
|
+
/// @notice This function should be called to set the submission window for the E3 sortition.
|
|
209
|
+
/// @param _sortitionSubmissionWindow The submission window for the E3 sortition in seconds.
|
|
210
|
+
function setSortitionSubmissionWindow(
|
|
211
|
+
uint256 _sortitionSubmissionWindow
|
|
212
|
+
) external;
|
|
213
|
+
|
|
214
|
+
/// @notice Submit a ticket for sortition
|
|
215
|
+
/// @dev Validates ticket against node's balance at request block
|
|
216
|
+
/// @param e3Id ID of the E3 computation
|
|
217
|
+
/// @param ticketNumber The ticket number to submit
|
|
218
|
+
function submitTicket(uint256 e3Id, uint256 ticketNumber) external;
|
|
219
|
+
|
|
220
|
+
/// @notice Finalize the committee after submission window closes
|
|
221
|
+
/// @param e3Id ID of the E3 computation
|
|
222
|
+
function finalizeCommittee(uint256 e3Id) external;
|
|
223
|
+
|
|
224
|
+
/// @notice Check if submission window is still open for an E3
|
|
225
|
+
/// @param e3Id ID of the E3 computation
|
|
226
|
+
/// @return Whether the submission window is open
|
|
227
|
+
function isOpen(uint256 e3Id) external view returns (bool);
|
|
84
228
|
}
|
|
@@ -7,9 +7,19 @@ pragma solidity >=0.8.27;
|
|
|
7
7
|
|
|
8
8
|
import { IDecryptionVerifier } from "./IDecryptionVerifier.sol";
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @title IComputeProvider
|
|
12
|
+
* @notice Interface for compute provider validation and configuration
|
|
13
|
+
* @dev Compute providers define how computations are executed and verified in the E3 system
|
|
14
|
+
*/
|
|
10
15
|
interface IComputeProvider {
|
|
11
|
-
/// @notice
|
|
12
|
-
/// @
|
|
16
|
+
/// @notice Validate compute provider parameters and return the appropriate decryption verifier
|
|
17
|
+
/// @dev This function is called by the Enclave contract during E3 request to validate
|
|
18
|
+
/// compute provider configuration
|
|
19
|
+
/// @param e3Id ID of the E3 computation
|
|
20
|
+
/// @param seed Random seed for the computation
|
|
21
|
+
/// @param params ABI encoded compute provider parameters
|
|
22
|
+
/// @return decryptionVerifier The decryption verifier contract to use for this computation
|
|
13
23
|
function validate(
|
|
14
24
|
uint256 e3Id,
|
|
15
25
|
uint256 seed,
|