Open code423n4 opened 2 years ago
pants
This line in Swap.setSwapFee() perfoms an SLOAD operation for a value that is already stored in a local variable:
Swap.setSwapFee()
SLOAD
emit NewSwapFee(swapFee);
Storage reads are much more expensive than reading local variables.
Manual code review.
Use the already existing local variable instead of loading this value from storage:
emit NewSwapFee(swapFee_);
Handle
pants
Vulnerability details
This line in
Swap.setSwapFee()
perfoms anSLOAD
operation for a value that is already stored in a local variable:Impact
Storage reads are much more expensive than reading local variables.
Tool Used
Manual code review.
Recommended Mitigation Steps
Use the already existing local variable instead of loading this value from storage: