Kind White Buffalo
Medium
When users buy votes the fees they have to pay are calculated inaccurately causing them to pay more than they should.
In ReputationMarket. _calculateBuy:960 previewFees is called on all of the msg.value
sent by the user. This is wrong as the funds the caller has to pay are likely to be lower than all of the funds they sent, which is why any leftover ETH is sent back to the caller.
For example, a user sends 10 ETH and has to pay 10% in fees = 1 ETH. The fees are reduced from the 10 ETH, and 9 ETH is used to buy votes. However, only 8 ETH is spent, and 1 ETH is paid back to the caller. Now, even though, 1 ETH was not used to buy votes, the user still had to pay 0.1 ETH of fees for that 1 ETH.
No response
No response
- User buys votes with 10 ETH
- 10% of fees are taken away from the 10 ETH
- 9 ETH is used to buy votes, however, only 8 ETH is spent, as the price of a vote has become more than 1 ETH
- 1 ETH is paid back to the caller, however, they still have to pay 0.1 ETH in fees
Users that buy votes pay higher fees than intended.
No response
Do not charge extra fees on ETH that is paid back to the votes buyer.