Skip to content

fix(contracts): BatcherPaymentService contract does not check that an address is not equal to address(0) during constructor or initialization #1020

Description

@PatStiles

Overview:

The BatcherPaymentService contract does not check that an address is not equal to address(0)during the initialization process.

Mitigation:

Add a check to ensure that the addresses are not equal to address(0) during the initialization process.

...
contractBatcherPaymentServiceis
...
{
...
function initialize(
address_AlignedLayerServiceManager,
address_BatcherPaymentServiceOwner,
address_BatcherWallet
) public initializer {
require(_AlignedLayerServiceManager !=address(0), "AlignedLayerServiceManager address cannot be 0");
require(_BatcherPaymentServiceOwner !=address(0), "BatcherPaymentServiceOwner address cannot be 0");
require(_BatcherWallet !=address(0), "BatcherWallet address cannot be 0");
__Ownable_init(); // default is msg.sender__UUPSUpgradeable_init();
_transferOwnership(_BatcherPaymentServiceOwner);
AlignedLayerServiceManager = _AlignedLayerServiceManager;
BatcherWallet = _BatcherWallet;
}
...
}

Metadata

Metadata

Assignees

Type

No type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions