Platform: Code4rena
Start Date: 14/10/2022
Pot Size: $100,000 USDC
Total HM: 12
Participants: 75
Period: 9 days
Judge: GalloDaSballo
Total Solo HM: 1
Id: 171
League: ETH
Rank: 52/75
Findings: 1
Award: $0.97
🌟 Selected for report: 0
🚀 Solo Findings: 0
0.9728 USDC - $0.97
swapAVAXForExactTokens
can only be called with the exact amount of AVAX.
At LBRouter.sol#L520 any excess sent is supposed to be refunded, i.e. if msg.value > amountsIn[0]
, but the amount to be refunded is calculated as amountsIn[0] - msg.value
:
if (msg.value > amountsIn[0]) _safeTransferAVAX(_to, amountsIn[0] - msg.value);
Code inspection
Invert amountsIn[0] - msg.value
to the correct msg.value - amountsIn[0]
.
#0 - GalloDaSballo
2022-10-26T18:27:13Z
#1 - GalloDaSballo
2022-11-13T19:54:58Z
L
#2 - c4-judge
2022-11-13T19:55:05Z
#3 - Simon-Busch
2022-11-21T06:21:17Z
Reverted to M as requested by @GalloDaSballo Duplicate of https://github.com/code-423n4/2022-10-traderjoe-findings/issues/469
#4 - Simon-Busch
2022-12-05T06:44:09Z
Marked this issue as satisfactory as requested by @GalloDaSballo