@bananapus/core-v6 0.0.2 → 0.0.4

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/foundry.toml CHANGED
@@ -9,20 +9,6 @@ match_contract = "_Local"
9
9
  [profile.ci_sizes]
10
10
  optimizer_runs = 200
11
11
 
12
- [profile.fork]
13
- match_contract = "_Fork"
14
- fs_permissions = [{ access = "read", path = "./deployments/mainnet" }]
15
-
16
- [rpc_endpoints]
17
- ethereum = "${RPC_ETHEREUM_MAINNET}"
18
- optimism = "${RPC_OPTIMISM_MAINNET}"
19
- arbitrum = "${RPC_ARBITRUM_MAINNET}"
20
- base = "${RPC_BASE_MAINNET}"
21
- ethereum_sepolia = "${RPC_ETHEREUM_SEPOLIA}"
22
- optimism_sepolia = "${RPC_OPTIMISM_SEPOLIA}"
23
- arbitrum_sepolia = "${RPC_ARBITRUM_SEPOLIA}"
24
- base_sepolia = "${RPC_BASE_SEPOLIA}"
25
-
26
12
  [fuzz]
27
13
  runs = 4096
28
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/core-v6",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "artifacts": "source ./.env && npx sphinx artifacts --org-id 'ea165b21-7cdc-4d7b-be59-ecdd4c26bee4' --project-name 'nana-core-v6'"
27
27
  },
28
28
  "dependencies": {
29
- "@bananapus/permission-ids-v6": "^0.0.1",
29
+ "@bananapus/permission-ids-v6": "^0.0.2",
30
30
  "@chainlink/contracts": "^1.3.0",
31
31
  "@openzeppelin/contracts": "^5.2.0",
32
32
  "@prb/math": "^4.1.0",
@@ -20,6 +20,9 @@ contract TestRulesetQueuing_Local is TestBaseWorkflow {
20
20
  function setUp() public override {
21
21
  super.setUp();
22
22
 
23
+ // Foundry defaults block.timestamp to 1, which causes underflow in tests using past timestamps.
24
+ vm.warp(7 days);
25
+
23
26
  _terminal = jbMultiTerminal();
24
27
  _controller = jbController();
25
28
 
@@ -52,6 +52,9 @@ contract TestPriceFeed_Local is JBTest {
52
52
  uint256 constant THRESHOLD = 1 hours;
53
53
 
54
54
  function setUp() external {
55
+ // Foundry defaults block.timestamp to 1, which causes underflow in stale-price tests.
56
+ vm.warp(THRESHOLD + 1 days);
57
+
55
58
  mockFeed = new MockAggregator();
56
59
  mockFeed.setDecimals(8);
57
60
  mockFeed.setPrice(200_000_000_000); // $2000 with 8 decimals
@@ -13,6 +13,9 @@ contract TestDeadlineFuzz_Local is JBTest {
13
13
  uint256 constant DURATION = 3 days;
14
14
 
15
15
  function setUp() external {
16
+ // Foundry defaults block.timestamp to 1, which causes underflow in tests
17
+ // that subtract DURATION from timestamp-derived values.
18
+ vm.warp(DURATION + 1 days);
16
19
  deadline = new JBDeadline(DURATION);
17
20
  }
18
21
 
@@ -112,15 +115,14 @@ contract TestDeadlineFuzz_Local is JBTest {
112
115
  }
113
116
 
114
117
  /// @notice If gap >= DURATION and deadline passed, always Approved.
115
- function testFuzz_sufficientGap_deadlinePassed_approved(uint256 gapExtra) external view {
118
+ function testFuzz_sufficientGap_deadlinePassed_approved(uint256 gapExtra) external {
116
119
  // gap = DURATION + gapExtra (always >= DURATION)
117
120
  gapExtra = bound(gapExtra, 0, 365 days);
118
121
  uint256 gap = DURATION + gapExtra;
119
122
 
120
- // start = block.timestamp (deadline already passed since block.timestamp + DURATION >= start)
123
+ // Warp to a timestamp large enough so that start >= gap always holds.
124
+ vm.warp(gap + 1);
121
125
  uint48 start = uint48(block.timestamp);
122
- // Ensure queuedAt doesn't underflow
123
- vm.assume(start >= gap);
124
126
  uint48 queuedAt = start - uint48(gap);
125
127
 
126
128
  JBRuleset memory ruleset = _makeRuleset({queuedAt: queuedAt, start: start});
@@ -131,8 +133,8 @@ contract TestDeadlineFuzz_Local is JBTest {
131
133
  /// @notice Status monotonically transitions: ApprovalExpected -> Approved as time advances.
132
134
  function testFuzz_statusMonotonic(uint48 gap) external {
133
135
  gap = uint48(bound(uint256(gap), DURATION, type(uint32).max));
134
- // Ensure arithmetic doesn't overflow uint48
135
- uint48 start = uint48(bound(uint256(block.timestamp) + 2 * DURATION + 100, gap, type(uint48).max));
136
+ // Cap start to leave room for `start + 1000` without overflowing uint48.
137
+ uint48 start = uint48(bound(uint256(block.timestamp) + 2 * DURATION + 100, gap, type(uint48).max - 1000));
136
138
  uint48 queuedAt = start - gap;
137
139
 
138
140
  JBRuleset memory ruleset = _makeRuleset({queuedAt: queuedAt, start: start});
@@ -55,6 +55,9 @@ contract TestJBRulesetsUnits_Local is JBTest {
55
55
  }
56
56
 
57
57
  function setUp() public {
58
+ // Foundry defaults block.timestamp to 1, which causes underflow in tests using past timestamps.
59
+ vm.warp(7 days);
60
+
58
61
  // Mock contracts and label them
59
62
  _directory = IJBDirectory(makeAddr("JBDirectory"));
60
63
  _permissions = IJBPermissions(makeAddr("JBPermissions"));