Closed code423n4 closed 2 years ago
0xwags
TimeswapPair.lend() makes a call to lendMath.check() on line 247.There should be one argument returned on line 25 of check() instead of three.
https://github.com/code-423n4/2022-01-timeswap/blob/bf50d2a8bb93a5571f35f96bd74af54d9c92a210/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L241
https://github.com/code-423n4/2022-01-timeswap/blob/bf50d2a8bb93a5571f35f96bd74af54d9c92a210/Timeswap/Timeswap-V1-Core/contracts/libraries/LendMath.sol#L25
ManuaL Analysis
(uint 112 xReserve, uint112 yAdjusted ,uint112 zAdjusted) =state.checkConstantProduct(maturity);
The checkConstantProduct function from the ConstantProduct.sol Library don't have a return value.
closing as out of scope
Handle
0xwags
Vulnerability details
Impact
TimeswapPair.lend() makes a call to lendMath.check() on line 247.There should be one argument returned on line 25 of check() instead of three.
Proof of Concept
https://github.com/code-423n4/2022-01-timeswap/blob/bf50d2a8bb93a5571f35f96bd74af54d9c92a210/Timeswap/Timeswap-V1-Core/contracts/TimeswapPair.sol#L241
https://github.com/code-423n4/2022-01-timeswap/blob/bf50d2a8bb93a5571f35f96bd74af54d9c92a210/Timeswap/Timeswap-V1-Core/contracts/libraries/LendMath.sol#L25
Tools Used
ManuaL Analysis
Recommended Mitigation Steps
(uint 112 xReserve, uint112 yAdjusted ,uint112 zAdjusted) =state.checkConstantProduct(maturity);