code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

Redundant rewriting to memory #271

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Czar102

Vulnerability details

Optimization

An array of tokens in BasketFacet::getTokens() is first rewritten to the memory as IERC20[] and then copied again just to change type to address[]. The intermediary state is redundant.

Recommended Mitigation Steps

Consider copying storage data directly to the result array.