When calling the settleAskMaker
function, because the tokenManager.addTokenBalance
function is not called for the TokenBalanceType.PointToken
- matched stock's authority - marketPlaceInfo.tokenAddress
- settledPointTokenAmount
combination if settledPointTokenAmount > 0
is true
, the matched stock's authority's claimable point token balance for TokenBalanceType.PointToken
is not increased by such settledPointTokenAmount
in the token manager though it should be. In this case, such matched stock's authority would not able to claim such settledPointTokenAmount
of the point token that is entitled to him.
When calling the following settleAskMaker
function, tokenManager.tillIn(_msgSender(), marketPlaceInfo.tokenAddress, settledPointTokenAmount, true)
would be executed if settledPointTokenAmount > 0
is true
. However, the tokenManager.addTokenBalance
function is not called for the TokenBalanceType.PointToken
- matched stock's authority - marketPlaceInfo.tokenAddress
- settledPointTokenAmount
combination in this case; hence, the userTokenBalanceMap
for the matched stock's authority - marketPlaceInfo.tokenAddress
- TokenBalanceType.PointToken
combination is not increased by settledPointTokenAmount
when it should be. In other words, after _msgSender()
sends settledPointTokenAmount
of the point token to the capital pool through the tokenManager.tillIn
function call, the matched stock's authority's claimable point token balance for TokenBalanceType.PointToken
is not increased by such settledPointTokenAmount
in the token manager though it should be.
Since the matched stock's authority's claimable point token balance for TokenBalanceType.PointToken
is not increased by settledPointTokenAmount
in the token manager though it should be, such matched stock's authority would not be able to claim such settledPointTokenAmount
of the point token that is entitled to him.
Manual Review
The settleAskMaker
function can be updated to call tokenManager.addTokenBalance
function for the TokenBalanceType.PointToken
- matched stock's authority - marketPlaceInfo.tokenAddress
- settledPointTokenAmount
combination after tokenManager.tillIn(_msgSender(), marketPlaceInfo.tokenAddress, settledPointTokenAmount, true)
is executed in the settledPointTokenAmount > 0
if
block.
Valid high severity, In `settleAskTaker/closeBidTaker`, by assigning collateral token to user balance instead of point token, if collateral token is worth more than point, this can cause stealing of other users collateral tokens within the CapitalPool contract, If the opposite occurs, user loses funds based on the points they are supposed to receive
Valid low severity, while the token type inputted is wrong, userTokenBalanceMap is still incremented appropriately, so users can still withdraw their funds. So this would technically only affect accounting and public view functions.
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.