@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,426 @@
|
|
|
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 { IBondingRegistry } from "./IBondingRegistry.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title ISlashingManager
|
|
13
|
+
* @notice Interface for managing slashing proposals, appeals, and execution
|
|
14
|
+
* @dev Maintains policy table and handles slash workflows with appeals
|
|
15
|
+
*/
|
|
16
|
+
interface ISlashingManager {
|
|
17
|
+
// ======================
|
|
18
|
+
// Structs
|
|
19
|
+
// ======================
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @notice Slashing policy configuration for different slash reasons
|
|
23
|
+
* @dev Defines penalties, proof requirements, and appeal mechanisms for each slash type
|
|
24
|
+
* @param ticketPenalty Amount of ticket collateral to slash (in wei)
|
|
25
|
+
* @param licensePenalty Amount of license bond to slash (in wei)
|
|
26
|
+
* @param requiresProof Whether this slash type requires cryptographic proof verification
|
|
27
|
+
* @param proofVerifier Address of the ISlashVerifier contract for proof validation
|
|
28
|
+
* @param banNode Whether executing this slash will permanently ban the node
|
|
29
|
+
* @param appealWindow Time window in seconds for operators to appeal (0 = immediate execution, no appeals)
|
|
30
|
+
* @param enabled Whether this slash type is currently active and can be proposed
|
|
31
|
+
*/
|
|
32
|
+
struct SlashPolicy {
|
|
33
|
+
uint256 ticketPenalty;
|
|
34
|
+
uint256 licensePenalty;
|
|
35
|
+
bool requiresProof;
|
|
36
|
+
address proofVerifier;
|
|
37
|
+
bool banNode;
|
|
38
|
+
uint256 appealWindow;
|
|
39
|
+
bool enabled;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @notice Slash proposal details tracking the full lifecycle of a slash
|
|
44
|
+
* @dev Stores all state needed for proposal, appeal, and execution workflows
|
|
45
|
+
* @param operator Address of the ciphernode operator being slashed
|
|
46
|
+
* @param reason Hash of the slash reason (maps to SlashPolicy configuration)
|
|
47
|
+
* @param ticketAmount Amount of ticket collateral to slash (copied from policy at proposal time)
|
|
48
|
+
* @param licenseAmount Amount of license bond to slash (copied from policy at proposal time)
|
|
49
|
+
* @param executed Whether the slashing penalties have been executed
|
|
50
|
+
* @param appealed Whether the operator has filed an appeal
|
|
51
|
+
* @param resolved Whether the appeal has been resolved by governance
|
|
52
|
+
* @param appealUpheld Whether the appeal was approved (true = cancel slash, false = slash proceeds)
|
|
53
|
+
* @param proposedAt Block timestamp when the slash was proposed
|
|
54
|
+
* @param executableAt Block timestamp when execution becomes possible (proposedAt + appealWindow)
|
|
55
|
+
* @param proposer Address that created this slash proposal
|
|
56
|
+
* @param proofHash Keccak256 hash of the proof data submitted with the proposal
|
|
57
|
+
* @param proofVerified Whether the proof was successfully verified by the proof verifier contract
|
|
58
|
+
*/
|
|
59
|
+
struct SlashProposal {
|
|
60
|
+
address operator;
|
|
61
|
+
bytes32 reason;
|
|
62
|
+
uint256 ticketAmount;
|
|
63
|
+
uint256 licenseAmount;
|
|
64
|
+
bool executed;
|
|
65
|
+
bool appealed;
|
|
66
|
+
bool resolved;
|
|
67
|
+
bool appealUpheld;
|
|
68
|
+
uint256 proposedAt;
|
|
69
|
+
uint256 executableAt;
|
|
70
|
+
address proposer;
|
|
71
|
+
bytes32 proofHash;
|
|
72
|
+
bool proofVerified;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ======================
|
|
76
|
+
// Errors
|
|
77
|
+
// ======================
|
|
78
|
+
|
|
79
|
+
/// @notice Thrown when a zero address is provided where a valid address is required
|
|
80
|
+
error ZeroAddress();
|
|
81
|
+
|
|
82
|
+
/// @notice Thrown when caller lacks required role permissions for the operation
|
|
83
|
+
error Unauthorized();
|
|
84
|
+
|
|
85
|
+
/// @notice Thrown when a slash policy configuration is invalid
|
|
86
|
+
error InvalidPolicy();
|
|
87
|
+
|
|
88
|
+
/// @notice Thrown when referencing a proposal ID that doesn't exist or is in invalid state
|
|
89
|
+
error InvalidProposal();
|
|
90
|
+
|
|
91
|
+
/// @notice Thrown when proof is required by policy but not provided
|
|
92
|
+
error ProofRequired();
|
|
93
|
+
|
|
94
|
+
/// @notice Thrown when provided proof fails verification
|
|
95
|
+
error InvalidProof();
|
|
96
|
+
|
|
97
|
+
/// @notice Thrown when attempting to execute a slash whose appeal was upheld
|
|
98
|
+
error AppealUpheld();
|
|
99
|
+
|
|
100
|
+
/// @notice Thrown when attempting to execute a slash with an unresolved appeal
|
|
101
|
+
error AppealPending();
|
|
102
|
+
|
|
103
|
+
/// @notice Thrown when attempting to file an appeal after the appeal window has closed
|
|
104
|
+
error AppealWindowExpired();
|
|
105
|
+
|
|
106
|
+
/// @notice Thrown when attempting to execute a slash before the appeal window has closed
|
|
107
|
+
error AppealWindowActive();
|
|
108
|
+
|
|
109
|
+
/// @notice Thrown when attempting to file a second appeal for the same proposal
|
|
110
|
+
error AlreadyAppealed();
|
|
111
|
+
|
|
112
|
+
/// @notice Thrown when attempting to execute a slash that has already been executed
|
|
113
|
+
error AlreadyExecuted();
|
|
114
|
+
|
|
115
|
+
/// @notice Thrown when attempting to resolve an appeal that has already been resolved
|
|
116
|
+
error AlreadyResolved();
|
|
117
|
+
|
|
118
|
+
/// @notice Thrown when referencing a slash reason that doesn't exist
|
|
119
|
+
error SlashReasonNotFound();
|
|
120
|
+
|
|
121
|
+
/// @notice Thrown when attempting to propose a slash for a disabled reason
|
|
122
|
+
error SlashReasonDisabled();
|
|
123
|
+
|
|
124
|
+
/// @notice Thrown when a banned ciphernode attempts a restricted operation
|
|
125
|
+
error CiphernodeBanned();
|
|
126
|
+
|
|
127
|
+
/// @notice Thrown when a policy requires proof but no verifier contract is configured
|
|
128
|
+
error VerifierNotSet();
|
|
129
|
+
|
|
130
|
+
// ======================
|
|
131
|
+
// Events
|
|
132
|
+
// ======================
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @notice Emitted when a slash policy is created or updated
|
|
136
|
+
* @param reason Hash of the slash reason being configured
|
|
137
|
+
* @param policy The complete policy configuration including penalties and appeal settings
|
|
138
|
+
*/
|
|
139
|
+
event SlashPolicyUpdated(bytes32 indexed reason, SlashPolicy policy);
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @notice Emitted when a new slash proposal is created
|
|
143
|
+
* @param proposalId Unique ID of the created proposal
|
|
144
|
+
* @param operator Address of the ciphernode operator being slashed
|
|
145
|
+
* @param reason Hash of the slash reason
|
|
146
|
+
* @param ticketAmount Amount of ticket collateral to be slashed
|
|
147
|
+
* @param licenseAmount Amount of license bond to be slashed
|
|
148
|
+
* @param executableAt Timestamp when the slash can be executed (after appeal window)
|
|
149
|
+
* @param proposer Address that created the proposal
|
|
150
|
+
*/
|
|
151
|
+
event SlashProposed(
|
|
152
|
+
uint256 indexed proposalId,
|
|
153
|
+
address indexed operator,
|
|
154
|
+
bytes32 indexed reason,
|
|
155
|
+
uint256 ticketAmount,
|
|
156
|
+
uint256 licenseAmount,
|
|
157
|
+
uint256 executableAt,
|
|
158
|
+
address proposer
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @notice Emitted when a slash proposal is executed and penalties are applied
|
|
163
|
+
* @param proposalId ID of the executed proposal
|
|
164
|
+
* @param operator Address of the slashed operator
|
|
165
|
+
* @param reason Hash of the slash reason
|
|
166
|
+
* @param ticketAmount Amount of ticket collateral slashed
|
|
167
|
+
* @param licenseAmount Amount of license bond slashed
|
|
168
|
+
* @param executed Execution status (should always be true)
|
|
169
|
+
*/
|
|
170
|
+
event SlashExecuted(
|
|
171
|
+
uint256 indexed proposalId,
|
|
172
|
+
address indexed operator,
|
|
173
|
+
bytes32 indexed reason,
|
|
174
|
+
uint256 ticketAmount,
|
|
175
|
+
uint256 licenseAmount,
|
|
176
|
+
bool executed
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* @notice Emitted when an operator files an appeal against a slash proposal
|
|
181
|
+
* @param proposalId ID of the proposal being appealed
|
|
182
|
+
* @param operator Address of the operator filing the appeal
|
|
183
|
+
* @param reason Hash of the slash reason being appealed
|
|
184
|
+
* @param evidence Evidence string provided by the operator supporting their appeal
|
|
185
|
+
*/
|
|
186
|
+
event AppealFiled(
|
|
187
|
+
uint256 indexed proposalId,
|
|
188
|
+
address indexed operator,
|
|
189
|
+
bytes32 indexed reason,
|
|
190
|
+
string evidence
|
|
191
|
+
);
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @notice Emitted when governance resolves an appeal
|
|
195
|
+
* @param proposalId ID of the proposal with the resolved appeal
|
|
196
|
+
* @param operator Address of the operator who appealed
|
|
197
|
+
* @param appealUpheld Whether the appeal was approved (true = slash cancelled, false = slash proceeds)
|
|
198
|
+
* @param resolver Address of the governance account that resolved the appeal
|
|
199
|
+
* @param resolution Explanation string for the resolution decision
|
|
200
|
+
*/
|
|
201
|
+
event AppealResolved(
|
|
202
|
+
uint256 indexed proposalId,
|
|
203
|
+
address indexed operator,
|
|
204
|
+
bool appealUpheld,
|
|
205
|
+
address resolver,
|
|
206
|
+
string resolution
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @notice Emitted when a node is banned or unbanned from the network
|
|
211
|
+
* @param node Address of the node
|
|
212
|
+
* @param status Whether the node is banned
|
|
213
|
+
* @param reason Hash of the reason for banning or unbanning
|
|
214
|
+
* @param updater Address that executed the ban (governance or contract)
|
|
215
|
+
*/
|
|
216
|
+
event NodeBanUpdated(
|
|
217
|
+
address indexed node,
|
|
218
|
+
bool status,
|
|
219
|
+
bytes32 indexed reason,
|
|
220
|
+
address updater
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
// ======================
|
|
224
|
+
// View Functions
|
|
225
|
+
// ======================
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @notice Retrieves the slash policy configuration for a given reason
|
|
229
|
+
* @param reason Hash of the slash reason to query
|
|
230
|
+
* @return policy The complete SlashPolicy struct (returns default empty struct if not configured)
|
|
231
|
+
*/
|
|
232
|
+
function getSlashPolicy(
|
|
233
|
+
bytes32 reason
|
|
234
|
+
) external view returns (SlashPolicy memory policy);
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @notice Retrieves the details of a slash proposal
|
|
238
|
+
* @param proposalId ID of the proposal to query
|
|
239
|
+
* @return proposal The complete SlashProposal struct
|
|
240
|
+
* @dev Reverts with InvalidProposal if proposalId >= totalProposals
|
|
241
|
+
*/
|
|
242
|
+
function getSlashProposal(
|
|
243
|
+
uint256 proposalId
|
|
244
|
+
) external view returns (SlashProposal memory proposal);
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @notice Returns the total number of slash proposals ever created
|
|
248
|
+
* @return count The total count of proposals (next proposalId will be this value)
|
|
249
|
+
*/
|
|
250
|
+
function totalProposals() external view returns (uint256 count);
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @notice Checks whether a node is currently banned
|
|
254
|
+
* @param node Address of the node to check
|
|
255
|
+
* @return isBanned True if the node is banned, false otherwise
|
|
256
|
+
*/
|
|
257
|
+
function isBanned(address node) external view returns (bool isBanned);
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @notice Returns the bonding registry contract used for executing slashes
|
|
261
|
+
* @return registry The IBondingRegistry contract instance
|
|
262
|
+
*/
|
|
263
|
+
function bondingRegistry()
|
|
264
|
+
external
|
|
265
|
+
view
|
|
266
|
+
returns (IBondingRegistry registry);
|
|
267
|
+
|
|
268
|
+
// ======================
|
|
269
|
+
// Admin Functions
|
|
270
|
+
// ======================
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* @notice Creates or updates the slash policy for a specific reason
|
|
274
|
+
* @dev Only callable by GOVERNANCE_ROLE. Validates policy constraints before setting
|
|
275
|
+
* @param reason Hash of the slash reason to configure (must be non-zero)
|
|
276
|
+
* @param policy Complete policy configuration including penalties, proof requirements, and appeal settings
|
|
277
|
+
* Requirements:
|
|
278
|
+
* - reason must not be bytes32(0)
|
|
279
|
+
* - policy.enabled must be true
|
|
280
|
+
* - At least one of ticketPenalty or licensePenalty must be non-zero
|
|
281
|
+
* - If requiresProof is true, proofVerifier must be set and appealWindow must be 0
|
|
282
|
+
* - If requiresProof is false, appealWindow must be greater than 0
|
|
283
|
+
*/
|
|
284
|
+
function setSlashPolicy(
|
|
285
|
+
bytes32 reason,
|
|
286
|
+
SlashPolicy calldata policy
|
|
287
|
+
) external;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @notice Updates the bonding registry contract address
|
|
291
|
+
* @dev Only callable by DEFAULT_ADMIN_ROLE. Used to execute actual slashing of funds
|
|
292
|
+
* @param newBondingRegistry Address of the new IBondingRegistry contract (must be non-zero)
|
|
293
|
+
*/
|
|
294
|
+
function setBondingRegistry(address newBondingRegistry) external;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @notice Grants SLASHER_ROLE to an address
|
|
298
|
+
* @dev Only callable by DEFAULT_ADMIN_ROLE. Slashers can propose and execute slashes
|
|
299
|
+
* @param slasher Address to grant slashing permissions (must be non-zero)
|
|
300
|
+
*/
|
|
301
|
+
function addSlasher(address slasher) external;
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* @notice Revokes SLASHER_ROLE from an address
|
|
305
|
+
* @dev Only callable by DEFAULT_ADMIN_ROLE
|
|
306
|
+
* @param slasher Address to revoke slashing permissions from
|
|
307
|
+
*/
|
|
308
|
+
function removeSlasher(address slasher) external;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @notice Grants VERIFIER_ROLE to an address
|
|
312
|
+
* @dev Only callable by DEFAULT_ADMIN_ROLE. Verifiers can validate proof-based slashes
|
|
313
|
+
* @param verifier Address to grant verification permissions (must be non-zero)
|
|
314
|
+
*/
|
|
315
|
+
function addVerifier(address verifier) external;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @notice Revokes VERIFIER_ROLE from an address
|
|
319
|
+
* @dev Only callable by DEFAULT_ADMIN_ROLE
|
|
320
|
+
* @param verifier Address to revoke verification permissions from
|
|
321
|
+
*/
|
|
322
|
+
function removeVerifier(address verifier) external;
|
|
323
|
+
|
|
324
|
+
// ======================
|
|
325
|
+
// Slashing Functions
|
|
326
|
+
// ======================
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* @notice Creates a new slash proposal against an operator
|
|
330
|
+
* @dev Only callable by SLASHER_ROLE. Validates policy and proof if required
|
|
331
|
+
* @param operator Address of the ciphernode operator to slash (must be non-zero)
|
|
332
|
+
* @param reason Hash of the slash reason (must have an enabled policy configured)
|
|
333
|
+
* @param proof Proof data to be verified (required if policy.requiresProof is true, can be empty otherwise)
|
|
334
|
+
* @return proposalId Sequential ID of the created proposal
|
|
335
|
+
* Requirements:
|
|
336
|
+
* - operator must not be zero address
|
|
337
|
+
* - reason must have an enabled policy configured
|
|
338
|
+
* - If policy requires proof, proof must be non-empty and pass verification
|
|
339
|
+
* - Caller must have SLASHER_ROLE
|
|
340
|
+
*/
|
|
341
|
+
function proposeSlash(
|
|
342
|
+
address operator,
|
|
343
|
+
bytes32 reason,
|
|
344
|
+
bytes calldata proof
|
|
345
|
+
) external returns (uint256 proposalId);
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @notice Executes a slash proposal and applies penalties to the operator
|
|
349
|
+
* @dev Only callable by SLASHER_ROLE. Validates execution conditions and applies slashing
|
|
350
|
+
* @param proposalId ID of the proposal to execute (must exist and not be already executed)
|
|
351
|
+
* Requirements:
|
|
352
|
+
* - Proposal must exist and not be already executed
|
|
353
|
+
* - For proof-required slashes: proof must be verified
|
|
354
|
+
* - For evidence-based slashes: appeal window must have expired
|
|
355
|
+
* - If appeal was filed and resolved, appeal must not have been upheld
|
|
356
|
+
* - Caller must have SLASHER_ROLE
|
|
357
|
+
* Effects:
|
|
358
|
+
* - Marks proposal as executed
|
|
359
|
+
* - Slashes ticket balance if ticketAmount > 0
|
|
360
|
+
* - Slashes license bond if licenseAmount > 0
|
|
361
|
+
* - Bans node if policy.banNode is true
|
|
362
|
+
*/
|
|
363
|
+
function executeSlash(uint256 proposalId) external;
|
|
364
|
+
|
|
365
|
+
// ======================
|
|
366
|
+
// Appeal Functions
|
|
367
|
+
// ======================
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @notice Allows an operator to file an appeal against a slash proposal
|
|
371
|
+
* @dev Only the operator being slashed can file an appeal, and only within the appeal window
|
|
372
|
+
* @param proposalId ID of the proposal to appeal (must exist)
|
|
373
|
+
* @param evidence String containing evidence and arguments supporting the appeal
|
|
374
|
+
* Requirements:
|
|
375
|
+
* - Proposal must exist
|
|
376
|
+
* - Caller must be the operator being slashed
|
|
377
|
+
* - Current timestamp must be before proposal.executableAt (within appeal window)
|
|
378
|
+
* - Proposal must not already have an appeal filed
|
|
379
|
+
*/
|
|
380
|
+
function fileAppeal(uint256 proposalId, string calldata evidence) external;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* @notice Resolves an appeal by accepting or rejecting it
|
|
384
|
+
* @dev Only callable by GOVERNANCE_ROLE. If appeal is upheld, the slash cannot be executed
|
|
385
|
+
* @param proposalId ID of the proposal with the appeal to resolve (must exist and have an appeal)
|
|
386
|
+
* @param appealUpheld True to uphold the appeal (cancel the slash), false to deny the appeal
|
|
387
|
+
* (allow slash to proceed)
|
|
388
|
+
* @param resolution String explaining the governance decision
|
|
389
|
+
* Requirements:
|
|
390
|
+
* - Proposal must exist and have an appeal filed
|
|
391
|
+
* - Appeal must not already be resolved
|
|
392
|
+
* - Caller must have GOVERNANCE_ROLE
|
|
393
|
+
* Effects:
|
|
394
|
+
* - Marks appeal as resolved
|
|
395
|
+
* - Sets appealUpheld flag (true = slash cancelled, false = slash can proceed)
|
|
396
|
+
*/
|
|
397
|
+
function resolveAppeal(
|
|
398
|
+
uint256 proposalId,
|
|
399
|
+
bool appealUpheld,
|
|
400
|
+
string calldata resolution
|
|
401
|
+
) external;
|
|
402
|
+
|
|
403
|
+
// ======================
|
|
404
|
+
// Ban Management
|
|
405
|
+
// ======================
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* @notice Bans or unbans a node from the network
|
|
409
|
+
* @dev Only callable by GOVERNANCE_ROLE. Bans can also occur automatically via executeSlash
|
|
410
|
+
* @param node Address of the node to ban (must be non-zero)
|
|
411
|
+
* @param status Whether to ban the node
|
|
412
|
+
* @param reason Hash of the reason for banning
|
|
413
|
+
* Requirements:
|
|
414
|
+
* - node must not be zero address
|
|
415
|
+
* - Caller must have GOVERNANCE_ROLE
|
|
416
|
+
* Effects:
|
|
417
|
+
* - Sets banned[node] to status
|
|
418
|
+
* - Emits NodeBanned event if status is true
|
|
419
|
+
* - Emits NodeUnbanned event if status is false
|
|
420
|
+
*/
|
|
421
|
+
function updateBanStatus(
|
|
422
|
+
address node,
|
|
423
|
+
bool status,
|
|
424
|
+
bytes32 reason
|
|
425
|
+
) external;
|
|
426
|
+
}
|