sherlock-audit / 2023-06-dinari-judging

5 stars 4 forks source link

twcctop - BuyOrderIssuer.sol#_fillBuyOrder doesn't transfer `receivedAmount` #91

Closed sherlock-admin closed 1 year ago

sherlock-admin commented 1 year ago

twcctop

high

BuyOrderIssuer.sol#_fillBuyOrder doesn't transfer receivedAmount

Summary

BuyOrderIssuer.sol#_fillBuyOrder doesn't transfer receivedAmount, making the contract can not receive the receivedAmount token.

Vulnerability Detail

BuyOrderIssuer.sol#_fillBuyOrder should transfer receivedAmount to this contract, compare to SellOrderProcessor.sol#_fillOrderAccounting,

IERC20(orderRequest.paymentToken).safeTransferFrom(msg.sender, address(this), receivedAmount);

BuyOrderIssuer lack of related logic

Impact

BuyOrderIssuer can not receive receivedAmount token.

Code Snippet

https://github.com/sherlock-audit/2023-06-dinari/blob/main/sbt-contracts/src/issuer/BuyOrderIssuer.sol#L161-L189

Tool used

Manual Review

Recommendation

add transfer logic