@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.
Files changed (30) hide show
  1. package/package.json +1 -1
  2. package/test/TestPermissions.sol +1 -0
  3. package/test/formal/BondingCurveProperties.t.sol +7 -4
  4. package/test/helpers/TestBaseWorkflow.sol +0 -1
  5. package/test/units/static/JBChainlinkV3PriceFeed/TestPriceFeed.sol +1 -0
  6. package/test/units/static/JBController/JBControllerSetup.sol +1 -0
  7. package/test/units/static/JBDeadline/TestDeadlineFuzz.sol +1 -0
  8. package/test/units/static/JBDirectory/JBDirectorySetup.sol +1 -0
  9. package/test/units/static/JBERC20/JBERC20Setup.sol +1 -0
  10. package/test/units/static/JBFeelessAdresses/JBFeelessSetup.sol +1 -0
  11. package/test/units/static/JBFees/TestFeesFuzz.sol +1 -0
  12. package/test/units/static/JBFixedPointNumber/TestAdjustDecimals.sol +1 -0
  13. package/test/units/static/JBFixedPointNumber/TestAdjustDecimalsFuzz.sol +1 -0
  14. package/test/units/static/JBFundAccessLimits/JBFundAccessSetup.sol +1 -0
  15. package/test/units/static/JBFundAccessLimits/TestFundAccessLimitsEdge.sol +1 -0
  16. package/test/units/static/JBMetadataResolver/TestGetDataFor.sol +1 -0
  17. package/test/units/static/JBMetadataResolver/TestMetadataResolverFuzz.sol +1 -0
  18. package/test/units/static/JBMetadataResolver/TestMetadataResolverM20M21.sol +1 -0
  19. package/test/units/static/JBMultiTerminal/JBMultiTerminalSetup.sol +1 -0
  20. package/test/units/static/JBPermissions/JBPermissionsSetup.sol +1 -0
  21. package/test/units/static/JBPrices/JBPricesSetup.sol +1 -0
  22. package/test/units/static/JBProjects/JBProjectsSetup.sol +1 -0
  23. package/test/units/static/JBProjects/TestInitialProject.sol +1 -0
  24. package/test/units/static/JBRulesetMetadataResolver/TestSetCashOutTaxRateTo.sol +1 -0
  25. package/test/units/static/JBRulesets/JBRulesetsSetup.sol +1 -0
  26. package/test/units/static/JBRulesets/TestRulesets.sol +1 -0
  27. package/test/units/static/JBSplits/JBSplitsSetup.sol +1 -0
  28. package/test/units/static/JBSurplus/TestSurplusFuzz.sol +1 -0
  29. package/test/units/static/JBTerminalStore/JBTerminalStoreSetup.sol +1 -0
  30. package/test/units/static/JBTokens/JBTokensSetup.sol +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/core-v6",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,6 +2,7 @@
2
2
  pragma solidity ^0.8.6;
3
3
 
4
4
  import /* {*} from */ "./helpers/TestBaseWorkflow.sol";
5
+ import {JBTest} from "./helpers/JBTest.sol";
5
6
 
6
7
  contract TestPermissions_Local is TestBaseWorkflow, JBTest {
7
8
  IJBController private _controller;
@@ -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 1 basis point (0.01%) rounding tolerance
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
- assertLe(excess * 10_000, singleResult, "No-arbitrage: rounding excess should be < 0.01%");
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
 
6
7
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
 
6
7
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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 {JBFees} from "../../../../src/libraries/JBFees.sol";
6
7
 
7
8
  /// @notice Fuzz tests for the JBFees library.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
 
6
7
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  contract TestInitialProject_Local is JBTest {
7
8
  address _owner = makeAddr("owner");
@@ -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
  contract TestSetCashOutTaxRateTo_Local is JBTest {
7
8
  using JBRulesetMetadataResolver for JBRulesetMetadata;
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
 
6
7
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.
@@ -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
  /*
7
8
  Contract that deploys a target contract with other mock contracts to satisfy the constructor.