Skip to content
Request an audit

‹ Findings database

Overflow check in PowerToken._divideUp is unnecessary

Low/InfoM^0 Minter Gateway audit·Three Sigma·Stablecoin framework·8th January, 20243S-M^0-N10

Description

The PowerToken._divideUp function checks if a result of a multiplication "wrapped" around the maximum number, i.e. if it silently overflowed:

solidity
z = (x * ONE) + y;
if (z < x) revert DivideUpOverflow();

Because calculation of z is not unchecked, the condition z < x will never be true, since solidity 0.8 checks and reverts on overflow.

Recommendation

Remove the line checking the z < x condition.

Status

Acknowledged