re-al-Foundation / rwa-contracts

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

[DRO-01S] Inexistent Sanitization of Input Addresses #30

Closed chasebrownn closed 7 months ago

chasebrownn commented 7 months ago

DRO-01S: Inexistent Sanitization of Input Addresses

Type Severity Location
Input Sanitization Delegator.sol:L73-L84

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 _veRWA,
    address _creator,
    address _delegatee
) external initializer {
    __Ownable_init(_creator);

    veRWA = IERC721Enumerable(_veRWA);
    creator = _creator;
    delegatee = _delegatee;
    delegateFactory = msg.sender;
}

Recommendation:

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