Open code423n4 opened 2 years ago
Interestingly the warden advise to remove the 0 check to save gas, what will the 0 check people say?
As linked by the warden the 0 check also happens in the library. As such the 0 check in the external function is redundant. Agree with the finding
Handle
wuwe1
Vulnerability details
Proof of Concept
redundant code
https://github.com/code-423n4/2022-01-elasticswap/blob/main/elasticswap/src/contracts/Exchange.sol#L266-L269
https://github.com/code-423n4/2022-01-elasticswap/blob/main/elasticswap/src/libraries/MathLib.sol#L663-L666
Tools Used
remove Exchange.sol#L266-L269