@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
|
@@ -3,16 +3,26 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("CiphernodeRegistry", (m) => {
|
|
9
8
|
const enclaveAddress = m.getParameter("enclaveAddress");
|
|
10
9
|
const owner = m.getParameter("owner");
|
|
10
|
+
const submissionWindow = m.getParameter("submissionWindow");
|
|
11
11
|
const poseidonT3 = m.library("PoseidonT3");
|
|
12
|
-
const
|
|
12
|
+
const cipherNodeRegistryImpl = m.contract("CiphernodeRegistryOwnable", [], {
|
|
13
13
|
libraries: {
|
|
14
14
|
PoseidonT3: poseidonT3,
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
|
+
const initData = m.encodeFunctionCall(cipherNodeRegistryImpl, "initialize", [
|
|
18
|
+
owner,
|
|
19
|
+
enclaveAddress,
|
|
20
|
+
submissionWindow,
|
|
21
|
+
]);
|
|
22
|
+
const cipherNodeRegistry = m.contract("TransparentUpgradeableProxy", [
|
|
23
|
+
cipherNodeRegistryImpl,
|
|
24
|
+
owner,
|
|
25
|
+
initData,
|
|
26
|
+
]);
|
|
17
27
|
return { cipherNodeRegistry };
|
|
18
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enclave.d.ts","sourceRoot":"","sources":["../../../ignition/modules/enclave.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enclave.d.ts","sourceRoot":"","sources":["../../../ignition/modules/enclave.ts"],"names":[],"mappings":"wBAiCM,GAAG;AA1BT,wBA0BU"}
|
|
@@ -3,18 +3,27 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("Enclave", (m) => {
|
|
9
8
|
const params = m.getParameter("params");
|
|
10
9
|
const owner = m.getParameter("owner");
|
|
11
10
|
const maxDuration = m.getParameter("maxDuration");
|
|
12
11
|
const registry = m.getParameter("registry");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const bondingRegistry = m.getParameter("bondingRegistry");
|
|
13
|
+
const feeToken = m.getParameter("feeToken");
|
|
14
|
+
const enclaveImpl = m.contract("Enclave", []);
|
|
15
|
+
const initData = m.encodeFunctionCall(enclaveImpl, "initialize", [
|
|
16
|
+
owner,
|
|
17
|
+
registry,
|
|
18
|
+
bondingRegistry,
|
|
19
|
+
feeToken,
|
|
20
|
+
maxDuration,
|
|
21
|
+
[params],
|
|
22
|
+
]);
|
|
23
|
+
const enclave = m.contract("TransparentUpgradeableProxy", [
|
|
24
|
+
enclaveImpl,
|
|
25
|
+
owner,
|
|
26
|
+
initData,
|
|
27
|
+
]);
|
|
19
28
|
return { enclave };
|
|
20
29
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enclaveTicketToken.d.ts","sourceRoot":"","sources":["../../../ignition/modules/enclaveTicketToken.ts"],"names":[],"mappings":"wBAmBM,GAAG;AAZT,wBAYU"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
7
|
+
export default buildModule("EnclaveTicketToken", (m) => {
|
|
8
|
+
const baseToken = m.getParameter("baseToken");
|
|
9
|
+
const registry = m.getParameter("registry");
|
|
10
|
+
const owner = m.getParameter("owner");
|
|
11
|
+
const enclaveTicketToken = m.contract("EnclaveTicketToken", [
|
|
12
|
+
baseToken,
|
|
13
|
+
registry,
|
|
14
|
+
owner,
|
|
15
|
+
]);
|
|
16
|
+
return { enclaveTicketToken };
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enclaveToken.d.ts","sourceRoot":"","sources":["../../../ignition/modules/enclaveToken.ts"],"names":[],"mappings":"wBAaM,GAAG;AANT,wBAMU"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
|
-
export default buildModule("
|
|
9
|
-
const
|
|
10
|
-
|
|
7
|
+
export default buildModule("EnclaveToken", (m) => {
|
|
8
|
+
const owner = m.getParameter("owner");
|
|
9
|
+
const enclaveToken = m.contract("EnclaveToken", [owner]);
|
|
10
|
+
return { enclaveToken };
|
|
11
11
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockCiphernodeRegistry.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockCiphernodeRegistry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockCiphernodeRegistry.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockCiphernodeRegistry.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("MockCiphernodeRegistry", (m) => {
|
|
9
8
|
const mockCiphernodeRegistry = m.contract("MockCiphernodeRegistry");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockCiphernodeRegistryEmptyKey.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockCiphernodeRegistryEmptyKey.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockCiphernodeRegistryEmptyKey.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockCiphernodeRegistryEmptyKey.ts"],"names":[],"mappings":"wBAaM,GAAG;AANT,wBAMU"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("MockCiphernodeRegistryEmptyKey", (m) => {
|
|
9
8
|
const mockCiphernodeRegistryEmptyKey = m.contract("MockCiphernodeRegistryEmptyKey");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockComputeProvider.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockComputeProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockComputeProvider.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockComputeProvider.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("MockComputeProvider", (m) => {
|
|
9
8
|
const mockComputeProvider = m.contract("MockComputeProvider");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockDecryptionVerifier.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockDecryptionVerifier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockDecryptionVerifier.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockDecryptionVerifier.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("MockDecryptionVerifier", (m) => {
|
|
9
8
|
const mockDecryptionVerifier = m.contract("MockDecryptionVerifier");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockE3Program.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockE3Program.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mockE3Program.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockE3Program.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -3,10 +3,8 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("MockE3Program", (m) => {
|
|
9
|
-
const
|
|
10
|
-
const mockE3Program = m.contract("MockE3Program", [mockInputValidator]);
|
|
8
|
+
const mockE3Program = m.contract("MockE3Program", []);
|
|
11
9
|
return { mockE3Program };
|
|
12
10
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockSlashingVerifier.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockSlashingVerifier.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
7
|
+
export default buildModule("MockSlashingVerifier", (m) => {
|
|
8
|
+
const mockSlashingVerifier = m.contract("MockSlashingVerifier");
|
|
9
|
+
return { mockSlashingVerifier };
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockStableToken.d.ts","sourceRoot":"","sources":["../../../ignition/modules/mockStableToken.ts"],"names":[],"mappings":"wBAaM,GAAG;AANT,wBAMU"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
7
|
+
export default buildModule("MockUSDC", (m) => {
|
|
8
|
+
const initialSupply = m.getParameter("initialSupply");
|
|
9
|
+
const mockUSDC = m.contract("MockUSDC", [initialSupply]);
|
|
10
|
+
return { mockUSDC };
|
|
11
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poseidonT3.d.ts","sourceRoot":"","sources":["../../../ignition/modules/poseidonT3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"poseidonT3.d.ts","sourceRoot":"","sources":["../../../ignition/modules/poseidonT3.ts"],"names":[],"mappings":"wBAWM,GAAG;AAJT,wBAIU"}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
// This file is provided WITHOUT ANY WARRANTY;
|
|
4
4
|
// without even the implied warranty of MERCHANTABILITY
|
|
5
5
|
// or FITNESS FOR A PARTICULAR PURPOSE.
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
6
|
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
7
|
export default buildModule("PoseidonT3", (m) => {
|
|
9
8
|
const poseidon = m.library("PoseidonT3");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slashingManager.d.ts","sourceRoot":"","sources":["../../../ignition/modules/slashingManager.ts"],"names":[],"mappings":"wBAmBM,GAAG;AAVT,wBAUU"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
+
import { buildModule } from "@nomicfoundation/hardhat-ignition/modules";
|
|
8
|
+
export default buildModule("SlashingManager", (m) => {
|
|
9
|
+
const bondingRegistry = m.getParameter("bondingRegistry");
|
|
10
|
+
const admin = m.getParameter("admin");
|
|
11
|
+
const slashingManager = m.contract("SlashingManager", [
|
|
12
|
+
admin,
|
|
13
|
+
bondingRegistry,
|
|
14
|
+
]);
|
|
15
|
+
return { slashingManager };
|
|
16
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cleans deployment records for a specific network from deployed_contracts.json
|
|
3
|
+
*
|
|
4
|
+
* @param networkName - The network name (e.g., "localhost", "hardhat")
|
|
5
|
+
*/
|
|
6
|
+
export declare const cleanDeploymentRecords: (networkName: string) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Automatically clean Ignition state and deployment records for localhost/hardhat networks before deployment.
|
|
9
|
+
* This prevents stale state issues when Anvil is restarted.
|
|
10
|
+
*/
|
|
11
|
+
export declare const autoCleanForLocalhost: (networkName: string) => Promise<void>;
|
|
12
|
+
//# sourceMappingURL=cleanIgnitionState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanIgnitionState.d.ts","sourceRoot":"","sources":["../../scripts/cleanIgnitionState.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,aAAa,MAAM,KAAG,IAqB5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,aAAa,MAAM,KAClB,OAAO,CAAC,IAAI,CAQd,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import fs from "fs";
|
|
7
|
+
import path from "path";
|
|
8
|
+
/**
|
|
9
|
+
* Cleans deployment records for a specific network from deployed_contracts.json
|
|
10
|
+
*
|
|
11
|
+
* @param networkName - The network name (e.g., "localhost", "hardhat")
|
|
12
|
+
*/
|
|
13
|
+
export const cleanDeploymentRecords = (networkName) => {
|
|
14
|
+
const deploymentsFile = path.join(process.cwd(), "deployed_contracts.json");
|
|
15
|
+
if (!fs.existsSync(deploymentsFile)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const deployments = JSON.parse(fs.readFileSync(deploymentsFile, "utf8"));
|
|
20
|
+
if (deployments[networkName]) {
|
|
21
|
+
console.log(`Cleaning deployment records for network '${networkName}'...`);
|
|
22
|
+
delete deployments[networkName];
|
|
23
|
+
fs.writeFileSync(deploymentsFile, JSON.stringify(deployments, null, 2));
|
|
24
|
+
console.log(`Cleaned deployment records for '${networkName}'`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
console.warn("Failed to clean deployment records:", error);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Automatically clean Ignition state and deployment records for localhost/hardhat networks before deployment.
|
|
33
|
+
* This prevents stale state issues when Anvil is restarted.
|
|
34
|
+
*/
|
|
35
|
+
export const autoCleanForLocalhost = async (networkName) => {
|
|
36
|
+
const localNetworks = ["localhost", "hardhat", "anvil", "ganache"];
|
|
37
|
+
if (localNetworks.includes(networkName)) {
|
|
38
|
+
console.log(`Detected local network '${networkName}', auto-cleaning stale deployment state...`);
|
|
39
|
+
cleanDeploymentRecords(networkName);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HardhatRuntimeEnvironment } from "hardhat/types/hre";
|
|
2
|
+
import { BondingRegistry } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* The arguments for the deployAndSaveBondingRegistry function
|
|
5
|
+
*/
|
|
6
|
+
export interface BondingRegistryArgs {
|
|
7
|
+
owner?: string;
|
|
8
|
+
ticketToken?: string;
|
|
9
|
+
licenseToken?: string;
|
|
10
|
+
registry?: string;
|
|
11
|
+
slashedFundsTreasury?: string;
|
|
12
|
+
ticketPrice?: string;
|
|
13
|
+
licenseRequiredBond?: string;
|
|
14
|
+
minTicketBalance?: number;
|
|
15
|
+
exitDelay?: number;
|
|
16
|
+
hre: HardhatRuntimeEnvironment;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Deploys the BondingRegistry contract and saves the deployment arguments
|
|
20
|
+
* @param param0 - The deployment arguments
|
|
21
|
+
* @returns The deployed BondingRegistry contract
|
|
22
|
+
*/
|
|
23
|
+
export declare const deployAndSaveBondingRegistry: ({ owner, ticketToken, licenseToken, registry, slashedFundsTreasury, ticketPrice, licenseRequiredBond, minTicketBalance, exitDelay, hre, }: BondingRegistryArgs) => Promise<{
|
|
24
|
+
bondingRegistry: BondingRegistry;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Upgrades the BondingRegistry implementation while keeping the same proxy address
|
|
28
|
+
* @param param0 - The upgrade arguments
|
|
29
|
+
* @returns The upgraded BondingRegistry contract (same proxy address)
|
|
30
|
+
*/
|
|
31
|
+
export declare const upgradeAndSaveBondingRegistry: ({ ownerAddress, hre, }: {
|
|
32
|
+
ownerAddress: string;
|
|
33
|
+
hre: HardhatRuntimeEnvironment;
|
|
34
|
+
}) => Promise<{
|
|
35
|
+
bondingRegistry: BondingRegistry;
|
|
36
|
+
implementationAddress: string;
|
|
37
|
+
}>;
|
|
38
|
+
//# sourceMappingURL=bondingRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bondingRegistry.d.ts","sourceRoot":"","sources":["../../../scripts/deployAndSave/bondingRegistry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EACL,eAAe,EAEhB,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,yBAAyB,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,GAAU,2IAWhD,mBAAmB,KAAG,OAAO,CAAC;IAC/B,eAAe,EAAE,eAAe,CAAC;CAClC,CA4GA,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,GAAU,wBAGjD;IACD,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,yBAAyB,CAAC;CAChC,KAAG,OAAO,CAAC;IACV,eAAe,EAAE,eAAe,CAAC;IACjC,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAiFA,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { BondingRegistry__factory as BondingRegistryFactory, } from "../../types";
|
|
2
|
+
import { getProxyAdmin, verifyProxyAdminOwner } from "../proxy";
|
|
3
|
+
import { readDeploymentArgs, storeDeploymentArgs } from "../utils";
|
|
4
|
+
/**
|
|
5
|
+
* Deploys the BondingRegistry contract and saves the deployment arguments
|
|
6
|
+
* @param param0 - The deployment arguments
|
|
7
|
+
* @returns The deployed BondingRegistry contract
|
|
8
|
+
*/
|
|
9
|
+
export const deployAndSaveBondingRegistry = async ({ owner, ticketToken, licenseToken, registry, slashedFundsTreasury, ticketPrice, licenseRequiredBond, minTicketBalance, exitDelay, hre, }) => {
|
|
10
|
+
const { ethers } = await hre.network.connect();
|
|
11
|
+
const [signer] = await ethers.getSigners();
|
|
12
|
+
const chain = (await signer.provider?.getNetwork())?.name ?? "localhost";
|
|
13
|
+
const preDeployedArgs = readDeploymentArgs("BondingRegistry", chain);
|
|
14
|
+
if (!owner ||
|
|
15
|
+
!ticketToken ||
|
|
16
|
+
!licenseToken ||
|
|
17
|
+
!registry ||
|
|
18
|
+
!slashedFundsTreasury ||
|
|
19
|
+
!ticketPrice ||
|
|
20
|
+
!licenseRequiredBond ||
|
|
21
|
+
minTicketBalance === undefined ||
|
|
22
|
+
exitDelay === undefined ||
|
|
23
|
+
(preDeployedArgs?.constructorArgs?.owner === owner &&
|
|
24
|
+
preDeployedArgs?.constructorArgs?.ticketToken === ticketToken &&
|
|
25
|
+
preDeployedArgs?.constructorArgs?.licenseToken === licenseToken &&
|
|
26
|
+
preDeployedArgs?.constructorArgs?.registry === registry &&
|
|
27
|
+
preDeployedArgs?.constructorArgs?.slashedFundsTreasury ===
|
|
28
|
+
slashedFundsTreasury &&
|
|
29
|
+
preDeployedArgs?.constructorArgs?.ticketPrice === ticketPrice &&
|
|
30
|
+
preDeployedArgs?.constructorArgs?.licenseRequiredBond ===
|
|
31
|
+
licenseRequiredBond &&
|
|
32
|
+
preDeployedArgs?.constructorArgs?.minTicketBalance ===
|
|
33
|
+
minTicketBalance.toString() &&
|
|
34
|
+
preDeployedArgs?.constructorArgs?.exitDelay === exitDelay.toString())) {
|
|
35
|
+
if (!preDeployedArgs?.address) {
|
|
36
|
+
throw new Error("BondingRegistry address not found, it must be deployed first");
|
|
37
|
+
}
|
|
38
|
+
const bondingRegistryContract = BondingRegistryFactory.connect(preDeployedArgs.address, signer);
|
|
39
|
+
return { bondingRegistry: bondingRegistryContract };
|
|
40
|
+
}
|
|
41
|
+
const blockNumber = await ethers.provider.getBlockNumber();
|
|
42
|
+
const bondingRegistryFactory = await ethers.getContractFactory("BondingRegistry");
|
|
43
|
+
const bondingRegistry = await bondingRegistryFactory.deploy();
|
|
44
|
+
await bondingRegistry.waitForDeployment();
|
|
45
|
+
const bondingRegistryAddress = await bondingRegistry.getAddress();
|
|
46
|
+
const initData = bondingRegistryFactory.interface.encodeFunctionData("initialize", [
|
|
47
|
+
owner,
|
|
48
|
+
ticketToken,
|
|
49
|
+
licenseToken,
|
|
50
|
+
registry,
|
|
51
|
+
slashedFundsTreasury,
|
|
52
|
+
ticketPrice,
|
|
53
|
+
licenseRequiredBond,
|
|
54
|
+
minTicketBalance,
|
|
55
|
+
exitDelay,
|
|
56
|
+
]);
|
|
57
|
+
const ProxyCF = await ethers.getContractFactory("TransparentUpgradeableProxy");
|
|
58
|
+
const proxy = await ProxyCF.deploy(bondingRegistryAddress, owner, initData);
|
|
59
|
+
await proxy.waitForDeployment();
|
|
60
|
+
const proxyAddress = await proxy.getAddress();
|
|
61
|
+
const proxyAdminAddress = await getProxyAdmin(ethers.provider, proxyAddress);
|
|
62
|
+
storeDeploymentArgs({
|
|
63
|
+
constructorArgs: {
|
|
64
|
+
owner,
|
|
65
|
+
ticketToken,
|
|
66
|
+
licenseToken,
|
|
67
|
+
registry,
|
|
68
|
+
slashedFundsTreasury,
|
|
69
|
+
ticketPrice,
|
|
70
|
+
licenseRequiredBond,
|
|
71
|
+
minTicketBalance: minTicketBalance.toString(),
|
|
72
|
+
exitDelay: exitDelay.toString(),
|
|
73
|
+
},
|
|
74
|
+
proxyRecords: {
|
|
75
|
+
initData,
|
|
76
|
+
initialOwner: owner,
|
|
77
|
+
proxyAddress,
|
|
78
|
+
proxyAdminAddress,
|
|
79
|
+
implementationAddress: bondingRegistryAddress,
|
|
80
|
+
},
|
|
81
|
+
blockNumber,
|
|
82
|
+
address: proxyAddress,
|
|
83
|
+
}, "BondingRegistry", chain);
|
|
84
|
+
const bondingRegistryContract = BondingRegistryFactory.connect(proxyAddress, signer);
|
|
85
|
+
return { bondingRegistry: bondingRegistryContract };
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Upgrades the BondingRegistry implementation while keeping the same proxy address
|
|
89
|
+
* @param param0 - The upgrade arguments
|
|
90
|
+
* @returns The upgraded BondingRegistry contract (same proxy address)
|
|
91
|
+
*/
|
|
92
|
+
export const upgradeAndSaveBondingRegistry = async ({ ownerAddress, hre, }) => {
|
|
93
|
+
const { ethers } = await hre.network.connect();
|
|
94
|
+
const [signer] = await ethers.getSigners();
|
|
95
|
+
const chain = hre.globalOptions.network;
|
|
96
|
+
const preDeployedArgs = readDeploymentArgs("BondingRegistry", chain);
|
|
97
|
+
if (!preDeployedArgs?.address) {
|
|
98
|
+
throw new Error("BondingRegistry proxy not found. Deploy first before upgrading.");
|
|
99
|
+
}
|
|
100
|
+
const proxyAddress = preDeployedArgs.address;
|
|
101
|
+
const autoProxyAdminAddress = await getProxyAdmin(ethers.provider, proxyAddress);
|
|
102
|
+
console.log("Auto-deployed ProxyAdmin address:", autoProxyAdminAddress);
|
|
103
|
+
const bondingRegistryFactory = await ethers.getContractFactory("BondingRegistry", signer);
|
|
104
|
+
const newImplementation = await bondingRegistryFactory.deploy();
|
|
105
|
+
await newImplementation.waitForDeployment();
|
|
106
|
+
const newImplementationAddress = await newImplementation.getAddress();
|
|
107
|
+
console.log("New Implementation Address:", newImplementationAddress);
|
|
108
|
+
const proxyAdmin = await ethers.getContractAt("ProxyAdmin", autoProxyAdminAddress, signer);
|
|
109
|
+
await verifyProxyAdminOwner(proxyAdmin, ownerAddress);
|
|
110
|
+
// TODO: Add init data if needed
|
|
111
|
+
const initData = "0x";
|
|
112
|
+
const upgradeTx = await proxyAdmin.upgradeAndCall(proxyAddress, newImplementationAddress, initData);
|
|
113
|
+
await upgradeTx.wait();
|
|
114
|
+
const existingProxyRecords = preDeployedArgs.proxyRecords
|
|
115
|
+
? Object.fromEntries(Object.entries(preDeployedArgs.proxyRecords).filter(([, value]) => value !== undefined))
|
|
116
|
+
: {};
|
|
117
|
+
const proxyRecords = {
|
|
118
|
+
...existingProxyRecords,
|
|
119
|
+
implementationAddress: newImplementationAddress,
|
|
120
|
+
};
|
|
121
|
+
if (initData !== "0x") {
|
|
122
|
+
proxyRecords.initData = initData;
|
|
123
|
+
}
|
|
124
|
+
storeDeploymentArgs({
|
|
125
|
+
...preDeployedArgs,
|
|
126
|
+
proxyRecords,
|
|
127
|
+
}, "BondingRegistry", chain);
|
|
128
|
+
const bondingRegistryContract = BondingRegistryFactory.connect(proxyAddress, signer);
|
|
129
|
+
return {
|
|
130
|
+
bondingRegistry: bondingRegistryContract,
|
|
131
|
+
implementationAddress: newImplementationAddress,
|
|
132
|
+
};
|
|
133
|
+
};
|
|
@@ -6,6 +6,8 @@ import { CiphernodeRegistryOwnable } from "../../types";
|
|
|
6
6
|
export interface CiphernodeRegistryOwnableArgs {
|
|
7
7
|
enclaveAddress?: string;
|
|
8
8
|
owner?: string;
|
|
9
|
+
submissionWindow?: number;
|
|
10
|
+
poseidonT3Address: string;
|
|
9
11
|
hre: HardhatRuntimeEnvironment;
|
|
10
12
|
}
|
|
11
13
|
/**
|
|
@@ -13,7 +15,15 @@ export interface CiphernodeRegistryOwnableArgs {
|
|
|
13
15
|
* @param param0 - The deployment arguments
|
|
14
16
|
* @returns The deployed CiphernodeRegistryOwnable contract
|
|
15
17
|
*/
|
|
16
|
-
export declare const deployAndSaveCiphernodeRegistryOwnable: ({ enclaveAddress, owner, hre, }: CiphernodeRegistryOwnableArgs) => Promise<{
|
|
18
|
+
export declare const deployAndSaveCiphernodeRegistryOwnable: ({ enclaveAddress, owner, submissionWindow, poseidonT3Address, hre, }: CiphernodeRegistryOwnableArgs) => Promise<{
|
|
17
19
|
ciphernodeRegistry: CiphernodeRegistryOwnable;
|
|
18
20
|
}>;
|
|
21
|
+
export declare const upgradeAndSaveCiphernodeRegistryOwnable: ({ poseidonT3Address, ownerAddress, hre, }: {
|
|
22
|
+
poseidonT3Address: string;
|
|
23
|
+
ownerAddress: string;
|
|
24
|
+
hre: HardhatRuntimeEnvironment;
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
ciphernodeRegistry: CiphernodeRegistryOwnable;
|
|
27
|
+
implementationAddress: string;
|
|
28
|
+
}>;
|
|
19
29
|
//# sourceMappingURL=ciphernodeRegistryOwnable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ciphernodeRegistryOwnable.d.ts","sourceRoot":"","sources":["../../../scripts/deployAndSave/ciphernodeRegistryOwnable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ciphernodeRegistryOwnable.d.ts","sourceRoot":"","sources":["../../../scripts/deployAndSave/ciphernodeRegistryOwnable.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EACL,yBAAyB,EAE1B,MAAM,aAAa,CAAC;AAIrB;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,yBAAyB,CAAC;CAChC;AAED;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,GAAU,sEAM1D,6BAA6B,KAAG,OAAO,CAAC;IACzC,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C,CA0FA,CAAC;AAEF,eAAO,MAAM,uCAAuC,GAAU,2CAI3D;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,yBAAyB,CAAC;CAChC,KAAG,OAAO,CAAC;IACV,kBAAkB,EAAE,yBAAyB,CAAC;IAC9C,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAqFA,CAAC"}
|