Omniscia Alliance Block Audit

PaymentPortal Static Analysis Findings

PaymentPortal Static Analysis Findings

PPL-01S: Inexistent Zero-Address Validation

Description:

The linked constructor arguments are not validated against the zero-address, permitting a potentially misconfigured state of the contract to be deployed.

Example:

contracts/PaymentPortal.sol
36constructor(
37 address _paymentReceiverA, // required
38 address _paymentReceiverB, // optional, but _paymentShareA must be 1000
39 uint256 _paymentShareA, // what percentage of payments will go to payment receiver address A (1000 = 100%)
40 address _albtToken, // address of the ALBT token
41 address _usdtToken, // address of the USDT token
42 address _uniswapPair, // address of the ALBT/USDT uniswap pair
43 address _uniswapRouter, // address of the uniswap router
44 uint256 _priceWithALBT, // price in USDT when paying with ALBT (USDT uses 6 decimals)
45 uint256 _priceWithUSDT // price in USDT when paying with USDT (USDT uses 6 decimals)
46) {
47 setPaymentReceivers(_paymentReceiverA, _paymentReceiverB);
48 setPaymentShareA(_paymentShareA);
49
50 uniswapPair = _uniswapPair;
51 uniswapRouter = _uniswapRouter;
52
53 albtToken = _albtToken;
54 usdtToken = _usdtToken;
55
56 priceWithALBT = _priceWithALBT;
57 priceWithUSDT = _priceWithUSDT;
58}

Recommendation:

We advise zero-address checks to be imposed for the linked variables to ensure no misconfiguration can be validly deployed.

Alleviation:

All addresses are now properly sanitized with the exclusion of _uniswapPair which was omitted from the codebase.