re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RHR-04S] Inexistent Sanitization of Input Addresses #44

Closed chasebrownn closed 6 months ago

chasebrownn commented 6 months ago

RHR-04S: Inexistent Sanitization of Input Addresses

Type Severity Location
Input Sanitization RoyaltyHandler.sol:L108-L132

Description:

The linked function(s) accept address arguments yet do not properly sanitize them.

Impact:

The presence of zero-value addresses, especially in constructor implementations, can cause the contract to be permanently inoperable. These checks are advised as zero-value inputs are a common side-effect of off-chain software related bugs.

Example:

function initialize(
    address _admin,
    address _revDist,
    address _rwaToken,
    address _weth,
    address _router,
    address _quoter,
    address _boxManager
) external initializer {
    __Ownable_init(_admin);
    __UUPSUpgradeable_init();

    revDistributor = _revDist;
    rwaToken = IERC20(_rwaToken);
    WETH = IERC20(_weth);
    swapRouter = ISwapRouter(_router);
    quoter = IQuoterV2(_quoter);
    boxManager = ILiquidBoxManager(_boxManager);

    burnPortion = 2; // 2/5
    revSharePortion = 2; // 2/5
    lpPortion = 1; // 1/5

    poolFee = 100;
}

Recommendation:

We advise some basic sanitization to be put in place by ensuring that each address specified is non-zero.