@bananapus/core-v6 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -198,8 +198,8 @@ contract BondingCurveProperties is Test {
|
|
|
198
198
|
if (firstResult + secondResult > singleResult) {
|
|
199
199
|
// The excess should be tiny relative to the result
|
|
200
200
|
uint256 excess = (firstResult + secondResult) - singleResult;
|
|
201
|
-
// Allow up to
|
|
202
|
-
assert(excess * 10_000 <= singleResult);
|
|
201
|
+
// Allow up to 2 wei absolute (for small values) or 0.01% relative
|
|
202
|
+
assert(excess <= 2 || excess * 10_000 <= singleResult);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
|
|
@@ -229,10 +229,13 @@ contract BondingCurveProperties is Test {
|
|
|
229
229
|
uint256 secondResult = JBCashOuts.cashOutFrom(remainingSurplus, b, remainingSupply, cashOutTaxRate);
|
|
230
230
|
|
|
231
231
|
// NOTE: Strict subadditivity violated due to mulDiv rounding.
|
|
232
|
-
// Verify the weaker property: excess bounded by rounding tolerance (< 0.01%).
|
|
232
|
+
// Verify the weaker property: excess bounded by rounding tolerance (<=2 wei or < 0.01%).
|
|
233
233
|
if (firstResult + secondResult > singleResult) {
|
|
234
234
|
uint256 excess = (firstResult + secondResult) - singleResult;
|
|
235
|
-
|
|
235
|
+
assertTrue(
|
|
236
|
+
excess <= 2 || excess * 10_000 <= singleResult,
|
|
237
|
+
"No-arbitrage: rounding excess should be <= 2 wei or < 0.01%"
|
|
238
|
+
);
|
|
236
239
|
}
|
|
237
240
|
}
|
|
238
241
|
|