Closed code423n4 closed 2 years ago
vaderAmount = (_shares * vader.balanceOf(address(this))) / totalSupply()
shares / totalSupply <= 1
When shares < totalSupply
, vaderAmount < vader.balanceOf(address(this))
Attacker won't be able to pay back flash loan
Dispute accepted.
Handle
hack3r-0m
Vulnerability details
https://github.com/code-423n4/2021-11-vader/blob/main/contracts/x-vader/XVader.sol#L51-L57
One has few
_shares
already obtained fromenter
One can transfer a large amount of Vader (borrowed using flashloan) and send it directly to xVader and then call
leave
will multiplex shares due to large
vader.balanceOf(address(this))
will burn the actual amount of shares the user had.
will transfer a large multiplexed amount to the caller.
caller pay back borrowed Vader and keeps the profit.