Skip to content

Commit

Permalink
use 'sub()' instead of the default minus operator to check for overflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jaensen authored Feb 12, 2024
1 parent 6ddb582 commit 6ffd3e6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/circles/Circles.sol
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ contract Circles is ERC1155 {
// using the geometric sum:
// SUM_i=dA..dB (Beta^i) = (Beta^(dB + 1) - 1) / (Beta^dA - 1)
int128 term1 = iB1.sub(ONE_64x64);
int128 term2 = iA - ONE_64x64;
int128 term2 = iA.sub(ONE_64x64);
int128 geometricSum = Math64x64.div(term1, term2);
// 24 hours * 1 CRC/hour * EXA * geometricSum
fullIssuance = Math64x64.mulu(geometricSum, 24 * EXA);
Expand Down

0 comments on commit 6ffd3e6

Please sign in to comment.