Shambolic Opaque Swift
Medium
The absence of a deadline parameter or expiry mechanism for vote-buying/selling in ReputationMarket.sol leaves transactions open-ended. Without a time limit, user orders (minimumVotePrice, minVotesToBuy, maxVotesToBuy) can remain valid indefinitely, allowing front-running or execution under stale conditions that harm users expecting timely executions.
In ReputationMarket.sol#L440 and ReputationMarket.sol#L539, the parameters for buying/selling votes (e.g., minVotesToBuy
, maxVotesToBuy
, and minimumVotePrice
) do not include or enforce a transaction deadline. Thus, a user’s trade can be left pending for an arbitrary duration, risking exploitation or unfavorable price changes.
- The user initiates a buyVotes or sellVotes transaction specifying only
minVotesToBuy
,maxVotesToBuy
, orminimumVotePrice
—with no time-based constraint. - The contract lacks any mechanism to invalidate or expire the transaction if not mined promptly.
No response
- A user initiates a buyVotes or sellVotes transaction with certain price or vote constraints but no deadline.
- The transaction remains pending in the mempool due to low gas fees or congestion.
- Market conditions change (e.g., price fluctuations in the underlying asset), making the original min/max constraints stale.
- An MEV bot or malicious actor can time their blocks or reorder transactions to exploit the newly stale parameters, either front-running or sandwiching the user’s trade.
- The user ends up with a suboptimal or manipulated fill for their vote purchase/sale because they expected prompt execution but had no time-bound protection.
Users risk receiving worse-than-expected trade outcomes or having trades executed under disadvantageous conditions. Malicious actors can exploit the indefinite window to front-run or back-run transactions, causing unnecessary losses or slippage. This damages user trust in the protocol’s fairness.
No response
- Introduce Deadline Parameters: Similar to many DEX designs, add a
deadline
parameter to buyVotes and sellVotes. If the current block.timestamp exceeds the user-specified deadline, revert the transaction.