The settleAsMaker and settleAskTaker functions in the DeliveryPlace.sol contract call the TokenManager::tillIn function, which is payable. However, these functions do not pass the required msg.value when the token being settled is the native token (e.g., ETH). This omission will cause the transaction to revert, resulting in a denial of service (DoS) for users dealing with native tokens.
Location: DeliveryPlace.sol
The settleAsMaker and settleAskTaker functions handle the settlement of assets for a maker and a taker, respectively. They both make an external call to the TokenManager::tillIn function, which is payable. The tillIn function performs a check to ensure that the msg.value sent with the call matches the _amount being deposited when the token is a native token (e.g., ETH). If msg.value is not provided or is less than the required amount, the transaction reverts.
The issue arises because the settleAsMaker and settleAskTaker functions do not pass msg.value when calling tillIn, which will cause the transaction to revert if the token is a native token. This results in a denial of service (DoS) for any user attempting to settle with a native token.
Here is the relevant code from the settleAsMaker function:
Since msg.value is not passed when tillIn is called from settleAsMaker, if the marketPlaceInfo.tokenAddress is the native token (e.g., ETH), the transaction will revert due to the NotEnoughMsgValue error.
The below test function proves this:
The root cause is the missing msg.value parameter when calling the tillIn function in the settleAsMaker and settleAskTaker functions, which causes the transaction to revert if the native token is used.
High: This issue results in a denial of service (DoS) for users attempting to settle trades involving native tokens, preventing them from completing their transactions.
Manual Review
. Pass msg.value When Calling tillIn: Modify the settleAsMaker and settleAskTaker functions to pass msg.value when calling the tillIn function. Ensure that the correct value is passed based on the token type.
Example fix for settleAsMaker:
Invalid, in `settleAskMaker` and `settleAskTaker` you are settling the point token to be given to the takers, which is an ERC20 token, so no native ETH is involved and thus no msg.value is required.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.