@ballkidz/defifa 0.0.4 → 0.0.5
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/STYLE_GUIDE.md +5 -27
- package/foundry.toml +3 -10
- package/package.json +3 -3
- package/src/DefifaDeployer.sol +1 -1
- package/src/DefifaHook.sol +1 -0
- package/test/DefifaGovernor.t.sol +2 -2
package/STYLE_GUIDE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
How we write Solidity and organize repos across the Juicebox V6 ecosystem. `nana-core-v6` is the gold standard — when in doubt, match what it does.
|
|
4
4
|
|
|
5
|
-
**This repo's deviations:** `
|
|
5
|
+
**This repo's deviations:** `via_ir = true` (stack depth). Package scope: `@ballkidz/`.
|
|
6
6
|
|
|
7
7
|
## File Organization
|
|
8
8
|
|
|
@@ -326,7 +326,7 @@ try hook.afterPayRecordedWith(context) {} catch (bytes memory reason) {
|
|
|
326
326
|
|
|
327
327
|
### foundry.toml
|
|
328
328
|
|
|
329
|
-
Standard config
|
|
329
|
+
Standard config for `@bananapus/core-v6`:
|
|
330
330
|
|
|
331
331
|
```toml
|
|
332
332
|
[profile.default]
|
|
@@ -353,18 +353,7 @@ multiline_func_header = "all"
|
|
|
353
353
|
wrap_comments = true
|
|
354
354
|
```
|
|
355
355
|
|
|
356
|
-
|
|
357
|
-
- `evm_version = 'cancun'` for repos using transient storage (buyback-hook, router-terminal, univ4-router)
|
|
358
|
-
- `via_ir = true` for repos hitting stack-too-deep (buyback-hook, banny-retail, univ4-lp-split-hook, deploy-all)
|
|
359
|
-
- `optimizer = false` only for deploy-all-v6 (stack-too-deep with optimization)
|
|
360
|
-
|
|
361
|
-
**This repo uses:**
|
|
362
|
-
- `via-ir = true` (note: hyphen not underscore in this repo's foundry.toml)
|
|
363
|
-
- `build_info = true`, `extra_output = ['storageLayout']`
|
|
364
|
-
- `[rpc_endpoints]` for ethereum, optimism, arbitrum, base, and their testnets
|
|
365
|
-
- `[invariant]` with `runs = 256`, `depth = 50` (lower than standard)
|
|
366
|
-
- No `[fuzz]` section
|
|
367
|
-
- `[lint]` section with `lint_on_build = false`
|
|
356
|
+
This is the standard config with no deviations.
|
|
368
357
|
|
|
369
358
|
### CI Workflows
|
|
370
359
|
|
|
@@ -394,8 +383,6 @@ jobs:
|
|
|
394
383
|
uses: foundry-rs/foundry-toolchain@v1
|
|
395
384
|
- name: Run tests
|
|
396
385
|
run: forge test --fail-fast --summary --detailed --skip "*/script/**"
|
|
397
|
-
env:
|
|
398
|
-
RPC_ETHEREUM_MAINNET: ${{ secrets.RPC_ETHEREUM_MAINNET }}
|
|
399
386
|
- name: Check contract sizes
|
|
400
387
|
run: FOUNDRY_PROFILE=ci_sizes forge build --sizes --skip "*/test/**" --skip "*/script/**" --skip SphinxUtils
|
|
401
388
|
```
|
|
@@ -423,10 +410,10 @@ jobs:
|
|
|
423
410
|
|
|
424
411
|
```json
|
|
425
412
|
{
|
|
426
|
-
"name": "@
|
|
413
|
+
"name": "@bananapus/core-v6",
|
|
427
414
|
"version": "x.x.x",
|
|
428
415
|
"license": "MIT",
|
|
429
|
-
"repository": { "type": "git", "url": "git+https://github.com/
|
|
416
|
+
"repository": { "type": "git", "url": "git+https://github.com/Bananapus/nana-core-v6.git" },
|
|
430
417
|
"engines": { "node": ">=20.0.0" },
|
|
431
418
|
"scripts": {
|
|
432
419
|
"test": "forge test",
|
|
@@ -460,15 +447,6 @@ Run `forge fmt` before committing. The `[fmt]` config in `foundry.toml` enforces
|
|
|
460
447
|
|
|
461
448
|
CI checks formatting via `forge fmt --check`.
|
|
462
449
|
|
|
463
|
-
### CI Secrets
|
|
464
|
-
|
|
465
|
-
| Secret | Purpose |
|
|
466
|
-
|--------|--------|
|
|
467
|
-
| `NPM_TOKEN` | npm publish access (used by `publish.yml`) |
|
|
468
|
-
| `RPC_ETHEREUM_MAINNET` | Ethereum mainnet RPC URL for fork tests (used by `test.yml`) |
|
|
469
|
-
|
|
470
|
-
Fork tests require `RPC_ETHEREUM_MAINNET` — they fail if it's missing.
|
|
471
|
-
|
|
472
450
|
### Branching
|
|
473
451
|
|
|
474
452
|
- `main` is the primary branch
|
package/foundry.toml
CHANGED
|
@@ -6,18 +6,8 @@ optimizer_runs = 200
|
|
|
6
6
|
libs = ["node_modules", "lib"]
|
|
7
7
|
fs_permissions = [{ access = "read-write", path = "./"}]
|
|
8
8
|
|
|
9
|
-
[profile.ci_sizes]
|
|
10
|
-
optimizer_runs = 200
|
|
11
|
-
|
|
12
9
|
[rpc_endpoints]
|
|
13
10
|
ethereum = "${RPC_ETHEREUM_MAINNET}"
|
|
14
|
-
optimism = "${RPC_OPTIMISM_MAINNET}"
|
|
15
|
-
arbitrum = "${RPC_ARBITRUM_MAINNET}"
|
|
16
|
-
base = "${RPC_BASE_MAINNET}"
|
|
17
|
-
arbitrum_sepolia = "${RPC_ARBITRUM_SEPOLIA}"
|
|
18
|
-
ethereum_sepolia = "${RPC_ETHEREUM_SEPOLIA}"
|
|
19
|
-
optimism_sepolia = "${RPC_OPTIMISM_SEPOLIA}"
|
|
20
|
-
base_sepolia = "${RPC_BASE_SEPOLIA}"
|
|
21
11
|
|
|
22
12
|
[fuzz]
|
|
23
13
|
runs = 4096
|
|
@@ -27,6 +17,9 @@ runs = 1024
|
|
|
27
17
|
depth = 100
|
|
28
18
|
fail_on_revert = false
|
|
29
19
|
|
|
20
|
+
[lint]
|
|
21
|
+
lint_on_build = false
|
|
22
|
+
|
|
30
23
|
[fmt]
|
|
31
24
|
number_underscore = "thousands"
|
|
32
25
|
multiline_func_header = "all"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ballkidz/defifa",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.0.0"
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"url": "https://github.com/BallKidz/defifa-collection-deployer"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@bananapus/721-hook-v6": "^0.0.
|
|
16
|
+
"@bananapus/721-hook-v6": "^0.0.13",
|
|
17
17
|
"@bananapus/address-registry-v6": "^0.0.4",
|
|
18
|
-
"@bananapus/core-v6": "^0.0.
|
|
18
|
+
"@bananapus/core-v6": "^0.0.14",
|
|
19
19
|
"@bananapus/permission-ids-v6": "^0.0.5",
|
|
20
20
|
"@openzeppelin/contracts": "5.2.0",
|
|
21
21
|
"@prb/math": "^4.1.1",
|
package/src/DefifaDeployer.sol
CHANGED
|
@@ -411,8 +411,8 @@ contract DefifaDeployer is IDefifaDeployer, IDefifaGamePhaseReporter, IDefifaGam
|
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// Make sure the provided gameplay timestamps are sequential and that there is a mint duration.
|
|
414
|
-
// slither-disable-next-line incorrect-equality
|
|
415
414
|
if (
|
|
415
|
+
// slither-disable-next-line incorrect-equality
|
|
416
416
|
launchProjectData.mintPeriodDuration == 0
|
|
417
417
|
|| launchProjectData.start
|
|
418
418
|
< block.timestamp + launchProjectData.refundPeriodDuration + launchProjectData.mintPeriodDuration
|
package/src/DefifaHook.sol
CHANGED
|
@@ -532,6 +532,7 @@ contract DefifaHook is JB721Hook, Ownable, IDefifaHook {
|
|
|
532
532
|
/// @notice Mint reserved tokens within the tier for the provided value.
|
|
533
533
|
/// @param tierId The ID of the tier to mint within.
|
|
534
534
|
/// @param count The number of reserved tokens to mint.
|
|
535
|
+
// slither-disable-next-line reentrancy-no-eth
|
|
535
536
|
function mintReservesFor(uint256 tierId, uint256 count) public override {
|
|
536
537
|
// Minting reserves must not be paused.
|
|
537
538
|
if (JB721TiersRulesetMetadataResolver.mintPendingReservesPaused(
|
|
@@ -444,8 +444,8 @@ contract DefifaGovernorTest is JBTest, TestBaseWorkflow {
|
|
|
444
444
|
}
|
|
445
445
|
|
|
446
446
|
function testSetCashOutRatesAndRedeem_multipleTiers(uint8 nTiers, uint8[] calldata distribution) public {
|
|
447
|
-
|
|
448
|
-
vm.assume(distribution.length < nTiers);
|
|
447
|
+
nTiers = uint8(bound(uint256(nTiers), 11, 99));
|
|
448
|
+
vm.assume(distribution.length > 0 && distribution.length < nTiers);
|
|
449
449
|
|
|
450
450
|
uint256 _sumDistribution;
|
|
451
451
|
for (uint256 i = 0; i < distribution.length; i++) {
|