Use assignment not += in function mint (TimeswapPair.sol) #136
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
Handle
ye0lde
Vulnerability details
Impact
The
pool.state.totalLiquidity
is increased instead of set to the value directly.This performs an unnecessary addition as
pool.state.totalLiquidity
is zero.Proof of Concept
https://github.com/code-423n4/2022-01-timeswap/blob/bf50d2a8bb93a5571f35f96bd74af54d9c92a210/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L161
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Change
to
The text was updated successfully, but these errors were encountered: