Closed sherlock-admin closed 2 years ago
tives
medium
https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LienToken.sol/#L594
in the _payment function you check if the paymentAmount is higher than the lienAmount and subtract from the active lien amount after that
_payment
if (lien.amount > paymentAmount) { lien.amount -= paymentAmount;
However, in the else block, you dont check for excessive paymentAmount, and transfer the full amount to the payee
TRANSFER_PROXY.tokenTransferFrom(WETH, payer, payee, paymentAmount);
Some payers could, by mistake, make a payment with more funds than necessary and lose their tokens.
Revert if the payment is more than the lien.amount, or return the excessive payment back to the msg.sender
lien.amount
msg.sender
Duplicate of #28
tives
medium
There are no checks or refunds for excessive payments in makePayment
https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/LienToken.sol/#L594
in the
_payment
function you check if the paymentAmount is higher than the lienAmount and subtract from the active lien amount after thatHowever, in the else block, you dont check for excessive paymentAmount, and transfer the full amount to the payee
Impact
Some payers could, by mistake, make a payment with more funds than necessary and lose their tokens.
Mitigation
Revert if the payment is more than the
lien.amount
, or return the excessive payment back to themsg.sender
Duplicate of #28