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

0 stars 0 forks source link

Caching array length will save gas [Basket.sol] #168

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

rishabh

Vulnerability details

Details

In validateWeights function, the length of tokenList will always be equal to _token length, so replacing tokenList.length at L79 with length declared at L70 will save gas

Tools Used

Manual Code Review

0xleastwood commented 2 years ago

Duplicate of #140