code-423n4 / 2021-10-slingshot-findings

0 stars 0 forks source link

trades.length reads from memory multiple times #17

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

pants

Vulnerability details

At both lines 75 and 76 of Slingshot.sol trades.length is read. At line 76 it is inside a for loop that make it even worst. Caching len = trades.length and using the len instead will save gas.

tommyz7 commented 2 years ago

Duplicate of #63