The contract SettlementBranch.sol has several Insufficient Validation on Size Delta.
In the _fillOrder
method, the sizeDeltaX18
parameter, which represents the size of the order, is directly added to the oldPositionSizeX18
without any checks. This could potentially result in an overflow error if sizeDeltaX18
is an enormous value.
Similar risks are associated with other places in the contract where size deltas are used without proper validation.
For example in the _fillOrder
function:
This could potentially result in an overflow error if sizeDeltaX18
is an enormous value.
Manual Review
Adding size delta values directly can lead to overflow risks. To prevent this, before proceeding with the operations involving sizeDeltaX18
, ensure that the value is within a certain reasonable range.
Secondly, use SafeMath operations or check for overflows explicitly to prevent any potential issues. Implementing checks will help ensure that calculations involving these deltas do not result in overflow.
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.