code-423n4 / 2021-09-yaxis-findings

0 stars 0 forks source link

Gas: Same modifiers are repeatedly computed in `Vault.depositMultiple` #119

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

The Vault.depositMultiple function has a notHalted multiplier that the subcalls to deposit already check. Furthermore, all repeated deposit calls check the notHalted modifier each time.

Recommended Mitigation Steps

Consider refactoring the code such that the notHalted modifier is only evaluated once instead of _tokens.length + 1 times.

Haz077 commented 2 years ago

Same as #70

GalloDaSballo commented 2 years ago

Duplicate of #70