re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RRR-01C] Improper Low-Level Interactions #90

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

RRR-01C: Improper Low-Level Interactions

Type Severity Location
Code Style RealReceiver.sol:L166-L169, L184-L187, L202-L205

Description:

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

Example:

(bool success,) = address(veRwaNFT).call(
    abi.encodeWithSignature("migrateBatch(address,uint256[],uint256[])", to, amounts, durations)
);
if (!success) revert MigrationFailed(SEND_NFT_BATCH);

Recommendation:

We advise the code to declare a proper interface for the migration methods and for the RealReceiver 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