@bananapus/core-v6 0.0.11 → 0.0.13
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 +1 -1
- package/test/TestPermissions.sol +1 -0
- package/test/formal/BondingCurveProperties.t.sol +7 -4
- package/test/helpers/TestBaseWorkflow.sol +0 -1
- package/test/units/static/JBChainlinkV3PriceFeed/TestPriceFeed.sol +1 -0
- package/test/units/static/JBController/JBControllerSetup.sol +1 -0
- package/test/units/static/JBDeadline/TestDeadlineFuzz.sol +1 -0
- package/test/units/static/JBDirectory/JBDirectorySetup.sol +1 -0
- package/test/units/static/JBERC20/JBERC20Setup.sol +1 -0
- package/test/units/static/JBFeelessAdresses/JBFeelessSetup.sol +1 -0
- package/test/units/static/JBFees/TestFeesFuzz.sol +1 -0
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimals.sol +1 -0
- package/test/units/static/JBFixedPointNumber/TestAdjustDecimalsFuzz.sol +1 -0
- package/test/units/static/JBFundAccessLimits/JBFundAccessSetup.sol +1 -0
- package/test/units/static/JBFundAccessLimits/TestFundAccessLimitsEdge.sol +1 -0
- package/test/units/static/JBMetadataResolver/TestGetDataFor.sol +1 -0
- package/test/units/static/JBMetadataResolver/TestMetadataResolverFuzz.sol +1 -0
- package/test/units/static/JBMetadataResolver/TestMetadataResolverM20M21.sol +1 -0
- package/test/units/static/JBMultiTerminal/JBMultiTerminalSetup.sol +1 -0
- package/test/units/static/JBPermissions/JBPermissionsSetup.sol +1 -0
- package/test/units/static/JBPrices/JBPricesSetup.sol +1 -0
- package/test/units/static/JBProjects/JBProjectsSetup.sol +1 -0
- package/test/units/static/JBProjects/TestInitialProject.sol +1 -0
- package/test/units/static/JBRulesetMetadataResolver/TestSetCashOutTaxRateTo.sol +1 -0
- package/test/units/static/JBRulesets/JBRulesetsSetup.sol +1 -0
- package/test/units/static/JBRulesets/TestRulesets.sol +1 -0
- package/test/units/static/JBSplits/JBSplitsSetup.sol +1 -0
- package/test/units/static/JBSurplus/TestSurplusFuzz.sol +1 -0
- package/test/units/static/JBTerminalStore/JBTerminalStoreSetup.sol +1 -0
- package/test/units/static/JBTokens/JBTokensSetup.sol +1 -0
package/package.json
CHANGED
package/test/TestPermissions.sol
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
|
|
|
@@ -93,7 +93,6 @@ import {JBSplitGroupIds} from "../../src/libraries/JBSplitGroupIds.sol";
|
|
|
93
93
|
import {IPermit2, IAllowanceTransfer} from "@uniswap/permit2/src/interfaces/IPermit2.sol";
|
|
94
94
|
import {DeployPermit2} from "@uniswap/permit2/test/utils/DeployPermit2.sol";
|
|
95
95
|
|
|
96
|
-
import {JBTest} from "./JBTest.sol";
|
|
97
96
|
import {MetadataResolverHelper} from "./MetadataResolverHelper.sol";
|
|
98
97
|
|
|
99
98
|
import {MockERC20} from "./../mock/MockERC20.sol";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBChainlinkV3PriceFeed} from "../../../../src/JBChainlinkV3PriceFeed.sol";
|
|
6
7
|
import {AggregatorV3Interface} from "@chainlink/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
|
|
7
8
|
import {JBFixedPointNumber} from "../../../../src/libraries/JBFixedPointNumber.sol";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBDeadline} from "../../../../src/JBDeadline.sol";
|
|
6
7
|
import {JBApprovalStatus} from "../../../../src/enums/JBApprovalStatus.sol";
|
|
7
8
|
import {JBRuleset} from "../../../../src/structs/JBRuleset.sol";
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBFixedPointNumber} from "../../../../src/libraries/JBFixedPointNumber.sol";
|
|
6
7
|
|
|
7
8
|
contract TestAdjustDecimals_Local is JBTest {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBFixedPointNumber} from "../../../../src/libraries/JBFixedPointNumber.sol";
|
|
6
7
|
|
|
7
8
|
/// @notice Fuzz tests for JBFixedPointNumber.adjustDecimals.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
|
|
6
7
|
/// @notice Edge case tests for JBFundAccessLimits append behavior and packing.
|
|
7
8
|
/// The key finding is that setFundAccessLimitsFor uses .push() (append), not replace.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBMetadataResolver} from "../../../../src/libraries/JBMetadataResolver.sol";
|
|
6
7
|
|
|
7
8
|
contract TestGetDataFor_Local is JBTest {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBMetadataResolver} from "../../../../src/libraries/JBMetadataResolver.sol";
|
|
6
7
|
|
|
7
8
|
/// @notice Wrapper contract to expose JBMetadataResolver internal functions for testing.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBMetadataResolver} from "../../../../src/libraries/JBMetadataResolver.sol";
|
|
6
7
|
|
|
7
8
|
/// @notice Harness that exposes JBMetadataResolver internals and adds a combined operation
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBRulesetWeightCache} from "src/structs/JBRulesetWeightCache.sol";
|
|
6
7
|
|
|
7
8
|
contract TestJBRulesetsUnits_Local is JBTest {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
pragma solidity 0.8.26;
|
|
3
3
|
|
|
4
4
|
import /* {*} from */ "../../../helpers/TestBaseWorkflow.sol";
|
|
5
|
+
import {JBTest} from "../../../helpers/JBTest.sol";
|
|
5
6
|
import {JBSurplus} from "../../../../src/libraries/JBSurplus.sol";
|
|
6
7
|
|
|
7
8
|
/// @notice Mock terminal that returns a fixed surplus for testing JBSurplus.
|