The OrderBook contract should work with real-world token decimals to ensure accurate price calculations and user expectations. Mock tokens in tests should mirror the decimal precision to catch potential integration issues.
The test suite incorrectly assumes WBTC has 8 decimals and WSOL has 18 decimals, when both actually use 9 decimals in production. This mismatch could lead to frontend integration errors where users think they're trading different amounts than actually executed.
Likelihood:
Frontend developers will use test results to implement decimal handling logic
Integration testing with incorrect decimals won't catch real-world decimal mismatches
Impact:
Users may create orders with 10x price discrepancy (0.1 WBTC sold at 1 WBTC price)
Frontend confusion where displayed amounts don't match on-chain amounts
Potential arbitrage opportunities for users who understand the decimal mismatch
Loss of user trust due to unexpected order execution amounts
This test demonstrates how the incorrect decimal assumption creates a 10x discrepancy between expected and actual amounts. When a user intends to sell 1 WBTC, they actually end up selling only 0.1 WBTC due to the decimal mismatch, creating an overpriced order that benefits buyers.
Update the test setup to use correct decimal values that match mainnet token implementations. This ensures that integration testing accurately reflects real world behavior and prevents frontend teams from implementing incorrect decimal handling logic.
This simple change aligns the test environment with production token standards.
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.