You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically we update it once inside _calculateBuy by getting exact market by getting the exact profileId by calling the _calculateBuy inside the buyVotes and sellVotes functions
Deep Ruby Troll
Medium
Re-Updating Market Votes
Summary
This issue is seen in both
buyVotes
andsellVotes
once it updates themarket.votes
inside_calculateBuy
then it updates it again in_calculateBuy
Root Cause
https://github.com/sherlock-audit/2024-11-ethos-network-ii/blob/main/ethos/packages/contracts/contracts/ReputationMarket.sol#L442-L534
https://github.com/sherlock-audit/2024-11-ethos-network-ii/blob/main/ethos/packages/contracts/contracts/ReputationMarket.sol#L942-L983
Exact Line of code where the re update occurs:
https://github.com/sherlock-audit/2024-11-ethos-network-ii/blob/main/ethos/packages/contracts/contracts/ReputationMarket.sol#L467
https://github.com/sherlock-audit/2024-11-ethos-network-ii/blob/main/ethos/packages/contracts/contracts/ReputationMarket.sol#L975
Basically we update it once inside
_calculateBuy
by getting exactmarket
by getting the exact profileId by calling the_calculateBuy
inside thebuyVotes
andsellVotes
functionsand when we update the
market
inside_calculateBuy
We re-Update it in both
buyVotes
andsellVotes
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
No response
Impact
causes re Updating and x2 of the actual amount of
votesBought
orvotesSold
PoC
No response
Mitigation
Update it just once after
buyVouches
or aftersellVouches
The text was updated successfully, but these errors were encountered: