Users will benefit from fee spit when calling burnNFT() agains intended design. #241
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
insufficient quality report
This report is not of sufficient quality
primary issue
Highest quality submission among a set of duplicates
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2023-11-canto/blob/b78bfdbf329ba9055ba24bd710c7e1c60251039a/1155tech-contracts/src/Market.sol#L230-L232
Vulnerability details
Impact
Users will benefit from fee spit when calling burnNFT() agains intended design.
Proof of Concept
Let us first take a look at how a user was prevented from benefiting from fee spit in
buy()
functionFrom the snippet above, note that
rewardsSinceLastClaim
was first obtained using the previous state before callingsplitFees()
so that the caller does not benefit from its fee, andrewardsLastClaimedValue[_id][msg.sender]
was set to equal the updated value after calling_splitFees()
so then no value will be claimable by the user when callingclaimHolderFee()
, this was done correctly.However, in
Market.buyNFT()
, the proper order was not followed,splitFees()
was called before settingrewardsSinceLastClaim
, which implies that user will benefit from the fee split.Tools Used
Manual review.
Recommended Mitigation Steps
Assessed type
Context
The text was updated successfully, but these errors were encountered: