re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RHR-01C] Improper Low-Level Interaction #99

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

RHR-01C: Improper Low-Level Interaction

Type Severity Location
Code Style RoyaltyHandler.sol:L256-L257

Description:

The referenced statement will interact with the rwaToken known implementation via low-level call operations rather than casting the rwaToken to an interface and invoking the methods that way.

Example:

// burn
(bool success,) = address(rwaToken).call(abi.encodeWithSignature("burn(uint256)", amountToBurn));
require(success, "RoyaltyHandler: burn unsuccessful");

Recommendation:

We advise the code to declare a proper interface for the migration methods and for the RoyaltyHandler to properly use it, optimizing its legibility greatly.

If graceful error handling is desired, the try-catch paradigm can be adopted to achieve the same in a highly legible manner.

chasebrownn commented 5 months ago

Acknowledged