Closed code423n4 closed 2 years ago
pants
These lines in Swap's constructor perfom two SLOADs operations for values that are already stored in local variables:
Swap
SLOAD
emit NewFeeRecipient(feeRecipient); emit NewSwapFee(swapFee);
Storage reads are much more expensive than reading local variables.
Manual code review.
Use the already existing local variables instead of loading these values from storage:
emit NewFeeRecipient(feeRecipient_); emit NewSwapFee(swapFee_);
dupe of #19
Handle
pants
Vulnerability details
These lines in
Swap
's constructor perfom twoSLOAD
s operations for values that are already stored in local variables:Impact
Storage reads are much more expensive than reading local variables.
Tool Used
Manual code review.
Recommended Mitigation Steps
Use the already existing local variables instead of loading these values from storage: