Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions contracts/src/core/AlignedProofAggregationService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -152,13 +164,19 @@ 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);
}

/// @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);
}
Expand Down
3 changes: 3 additions & 0 deletions contracts/src/core/BatcherPaymentService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions contracts/src/core/IAlignedProofAggregationService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ interface IAlignedProofAggregationService {
error InvalidProvingSystemId(uint8 actual);

error ProvingSystemIdMismatch(uint8 expected, uint8 received);

error InvalidAddress(string param);
}