re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[DFY-01C] Improper Low-Level Interactions #78

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

DFY-01C: Improper Low-Level Interactions

Type Severity Location
Code Style DelegateFactory.sol:L126-L127, L142-L143

Description:

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

Example:

(bool success,) = newDelegator.call(abi.encodeWithSignature("depositDelegatorToken(uint256)", _tokenId));
require(success, "deposit unsuccessful");

Recommendation:

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