re-al-Foundation / rwa-contracts

Core dev environment for the RWA Governance contracts
0 stars 0 forks source link

[VER-01S] Inexistent Sanitization of Input Addresses #45

Closed chasebrownn closed 7 months ago

chasebrownn commented 7 months ago

VER-01S: Inexistent Sanitization of Input Addresses

Type Severity Location
Input Sanitization VotingEscrowRWAAPI.sol:L71-L82

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 _veRWA,
    address _veVesting,
    address _revStream
) external initializer {
    _grantRole(DEFAULT_ADMIN_ROLE, _admin);

    veRWA = RWAVotingEscrow(_veRWA);
    veVesting = VotingEscrowVesting(_veVesting);
    revStream = RevenueStreamETH(payable(_revStream));
}

Recommendation:

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