Skip to content

Commit 06ce332

Browse files
maxsam4adamdossa
authored andcommitted
Fix rounding off errors (#467)
* Fixed rounding off errors * Increased tolerance * Reduced tolerance to zero * Comment updated * Tolerance set to 2
1 parent d771ea4 commit 06ce332

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contracts/modules/STO/USDTieredSTO.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ contract USDTieredSTO is USDTieredSTOStorage, ISTO, ReentrancyGuard {
455455
fundsRaisedUSD = fundsRaisedUSD.add(spentUSD);
456456
}
457457

458-
spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, originalUSD), _investmentValue);
458+
spentValue = DecimalMath.div(spentUSD, _rate);
459459
}
460460

461461
/**
@@ -494,7 +494,7 @@ contract USDTieredSTO is USDTieredSTOStorage, ISTO, ReentrancyGuard {
494494
}
495495
}
496496

497-
spentValue = DecimalMath.mul(DecimalMath.div(spentUSD, originalUSD), _investmentValue);
497+
spentValue = DecimalMath.div(spentUSD, rate);
498498
}
499499

500500
function _buyTokensChecks(

0 commit comments

Comments
 (0)