diff --git a/contracts/src/core/AlignedProofAggregationService.sol b/contracts/src/core/AlignedProofAggregationService.sol index 3b03efcb7..e424a304e 100644 --- a/contracts/src/core/AlignedProofAggregationService.sol +++ b/contracts/src/core/AlignedProofAggregationService.sol @@ -54,6 +54,18 @@ contract AlignedProofAggregationService is bytes32 _risc0AggregatorProgramImageId, bytes32 _sp1AggregatorProgramVKHash ) public initializer { + if (newOwner == address(0)) { + revert InvalidAddress("newOwner"); + } + if (_alignedAggregatorAddress == address(0)) { + revert InvalidAddress("alignedAggregatorAddress"); + } + if (_sp1VerifierAddress == address(0)) { + revert InvalidAddress("sp1VerifierAddress"); + } + if (_risc0VerifierAddress == address(0)) { + revert InvalidAddress("risc0VerifierAddress"); + } __Ownable_init(); __UUPSUpgradeable_init(); _transferOwnership(newOwner); @@ -152,6 +164,9 @@ contract AlignedProofAggregationService is /// @notice Sets the address of the Risc0 verifier contract /// @param _risc0VerifierAddress The new address for the Risc0 verifier contract function setRisc0VerifierAddress(address _risc0VerifierAddress) external onlyOwner { + if (_risc0VerifierAddress == address(0)) { + revert InvalidAddress("risc0VerifierAddress"); + } risc0VerifierAddress = _risc0VerifierAddress; emit Risc0VerifierAddressUpdated(_risc0VerifierAddress); } @@ -159,6 +174,9 @@ contract AlignedProofAggregationService is /// @notice Sets the address of the SP1 verifier contract /// @param _sp1VerifierAddress The new address for the SP1 verifier contract function setSP1VerifierAddress(address _sp1VerifierAddress) external onlyOwner { + if (_sp1VerifierAddress == address(0)) { + revert InvalidAddress("sp1VerifierAddress"); + } sp1VerifierAddress = _sp1VerifierAddress; emit SP1VerifierAddressUpdated(_sp1VerifierAddress); } diff --git a/contracts/src/core/BatcherPaymentService.sol b/contracts/src/core/BatcherPaymentService.sol index 379dd0379..b76af0271 100644 --- a/contracts/src/core/BatcherPaymentService.sol +++ b/contracts/src/core/BatcherPaymentService.sol @@ -194,6 +194,9 @@ contract BatcherPaymentService is uint256 amount, address withdrawAddress ) public payable onlyOwner { + if (withdrawAddress == address(0)) { + revert InvalidAddress("withdrawAddress"); + } alignedLayerServiceManager.withdraw(amount); // reverts if InsufficientBalance // money is now in this contract // we transfer it to the withdraw address diff --git a/contracts/src/core/IAlignedProofAggregationService.sol b/contracts/src/core/IAlignedProofAggregationService.sol index 56b8ddc1a..c14535f1a 100644 --- a/contracts/src/core/IAlignedProofAggregationService.sol +++ b/contracts/src/core/IAlignedProofAggregationService.sol @@ -61,4 +61,6 @@ interface IAlignedProofAggregationService { error InvalidProvingSystemId(uint8 actual); error ProvingSystemIdMismatch(uint8 expected, uint8 received); + + error InvalidAddress(string param); }