Closed sherlock-admin2 closed 8 months ago
2 comment(s) were left on this issue during the judging contest.
WangAudit commented:
0 address check; invalid according to rules; why would we make ss.origin = address(0)?
takarez commented:
invalid
The protocol team fixed this issue in PR/commit https://github.com/telcoin/telcoin-contracts/pull/6.
Update: after consulting with the sponsor and LSW, we decided to keep this one invalid:
ss.origin = address(0)
the stablecoinSwap
shouldn't be used, cause ss.origin = address(0)
is used for defi trades when no stablecoins are used. Therefore, in that case the defiSwap
function should be called directly. Yes, the team decided to fix it, but the issue is still invalid due to reasons addressed above.
Fix looks good, address(0) check added
The Lead Senior Watson signed off on the fix.
ZdravkoHr.
medium
AmirX.stablecoinSwap
will always revert whenss.origin == address(0)
Summary
AmirX.stablecoinSwap
, when called withss.origin == address(0)
, will always revert and swaps will not be possible.Vulnerability Detail
When
AmirX.stableCoinSwap
gets called withss.origin
, the execution will eventually query the balance of the origin token withbalanceOf()
. But calling it onaddress(0)
will revert the whole transaction and the operation will not be successfull.Impact
DoS of some token swaps.
Code Snippet
Tool used
Manual Review
Recommendation
Do not call
balanceOf
ifss.origin == address(0)