re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RWV-02C] Improper Low-Level Interactions #85

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

RWV-02C: Improper Low-Level Interactions

Type Severity Location
Code Style RWAVotingEscrow.sol:L242-L243, L270-L271, L303-L304

Description:

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

Example:

(bool success,) = address($.lockedToken).call(abi.encodeWithSignature("mint(uint256)", _lockedBalance));
require(success, "mint unsuccessful");

Recommendation:

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