Detailed description of the impact of this finding.
Rounding Errors: The contract calculates the average price as the sum of two prices divided by two. This can introduce rounding errors, especially if the prices are odd numbers.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
Lines of code
https://github.com/code-423n4/2024-01-salty/blob/main/src/price_feed/PriceAggregator.sol#L139
Vulnerability details
Impact
Detailed description of the impact of this finding. Rounding Errors: The contract calculates the average price as the sum of two prices divided by two. This can introduce rounding errors, especially if the prices are odd numbers.
Proof of Concept
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
uint256 averagePrice = ( priceA + priceB ) / 2;
Tools Used
Recommended Mitigation Steps
use some other method for odd numbers.
Assessed type
Context