code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Unnecessary `else if` statement in `swapWithSynthsWithLimit` #319

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

shw

Vulnerability details

Impact

In Router.sol, the second else if statement in the function swapWithSynthsWithLimit is unnecessary.

Proof of Concept

Referenced code: Router.sol#L162

Tools Used

None

Recommended Mitigation Steps

Consider using else {...}, which has the identical behavior to save gas.

0xBrian commented 3 years ago

https://github.com/vetherasset/vaderprotocol-contracts/commit/dd4ac300bcec8c1f2fd88b9b4809ce285ed101e0#diff-9dbb8dad80202557b41e378168876747e77f53fa5a17bf48959fe97fd41913ddR219