aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-08-25 07:17:02 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-08-25 07:17:02 +0800
commitbc686fcbf3a0f9eea0c96107b9880314027f2d02 (patch)
tree058540695d63a9f6ee690a564812cb3e51acd680
parent80291caf7cef16f0b300484755960d92d6750a6a (diff)
downloaddexon-0x-contracts-bc686fcbf3a0f9eea0c96107b9880314027f2d02.tar.gz
dexon-0x-contracts-bc686fcbf3a0f9eea0c96107b9880314027f2d02.tar.zst
dexon-0x-contracts-bc686fcbf3a0f9eea0c96107b9880314027f2d02.zip
Stylistic fixes
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol25
1 files changed, 20 insertions, 5 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol
index 7d58f70ce..0e0fba5d2 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibMath.sol
@@ -39,7 +39,10 @@ contract LibMath is
pure
returns (uint256 partialAmount)
{
- require(denominator > 0, "DIVISION_BY_ZERO");
+ require(
+ denominator > 0,
+ "DIVISION_BY_ZERO"
+ );
partialAmount = safeDiv(
safeMul(numerator, target),
@@ -62,13 +65,19 @@ contract LibMath is
pure
returns (uint256 partialAmount)
{
- require(denominator > 0, "DIVISION_BY_ZERO");
+ require(
+ denominator > 0,
+ "DIVISION_BY_ZERO"
+ );
// safeDiv computes `floor(a / b)`. We use the identity (a, b integer):
// ceil(a / b) = floor((a + b - 1) / b)
// To implement `ceil(a / b)` using safeDiv.
partialAmount = safeDiv(
- safeAdd(safeMul(numerator, target), safeSub(denominator, 1)),
+ safeAdd(
+ safeMul(numerator, target),
+ safeSub(denominator, 1)
+ ),
denominator
);
return partialAmount;
@@ -88,7 +97,10 @@ contract LibMath is
pure
returns (bool isError)
{
- require(denominator > 0, "DIVISION_BY_ZERO");
+ require(
+ denominator > 0,
+ "DIVISION_BY_ZERO"
+ );
// The absolute rounding error is the difference between the rounded
// value and the ideal value. The relative rounding error is the
@@ -135,7 +147,10 @@ contract LibMath is
pure
returns (bool isError)
{
- require(denominator > 0, "DIVISION_BY_ZERO");
+ require(
+ denominator > 0,
+ "DIVISION_BY_ZERO"
+ );
// See the comments in `isRoundingError`.
if (target == 0 || numerator == 0) {