@bananapus/core-v6 0.0.72 → 0.0.74
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/README.md
CHANGED
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
`@bananapus/core-v6` is the base protocol package for Juicebox on EVM chains. It defines projects, rulesets, terminals, permissions, token issuance, cash outs, splits, price feeds, and the accounting that the rest of the V6 ecosystem builds on.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
|
|
6
|
+
## Documentation
|
|
7
|
+
|
|
8
|
+
In-repo docs (entry points for this repo):
|
|
9
|
+
|
|
10
|
+
- [ARCHITECTURE.md](./ARCHITECTURE.md) — module layout, data flow, critical-flow diagrams, and accounting model.
|
|
11
|
+
- [INVARIANTS.md](./INVARIANTS.md) — per-contract operation inventory and the guarantees core makes to users, owners, and integrators.
|
|
12
|
+
- [ADMINISTRATION.md](./ADMINISTRATION.md) — admin surfaces, role matrix, immutable decisions, and recovery posture.
|
|
13
|
+
- [RISKS.md](./RISKS.md) — threat model, accepted risks, and invariants to verify.
|
|
14
|
+
- [USER_JOURNEYS.md](./USER_JOURNEYS.md) — example end-to-end flows (launch, pay, cash out, payout, migrate, delegate).
|
|
15
|
+
- [AUDIT_INSTRUCTIONS.md](./AUDIT_INSTRUCTIONS.md) — what to focus on for a security audit and how to start.
|
|
16
|
+
- [SKILLS.md](./SKILLS.md) — implementation nuances, gotchas, and reading order for working on this codebase.
|
|
17
|
+
- [STYLE_GUIDE.md](./STYLE_GUIDE.md) — Solidity conventions and repo layout used across the V6 ecosystem.
|
|
18
|
+
- [CHANGELOG.md](./CHANGELOG.md) — v5 → v6 ABI and behavior deltas.
|
|
19
|
+
- [references/entrypoints.md](./references/entrypoints.md) — callable entrypoints by contract.
|
|
20
|
+
- [references/types-errors-events.md](./references/types-errors-events.md) — packed metadata, errors, events, and hook return shapes.
|
|
12
21
|
|
|
13
22
|
## Overview
|
|
14
23
|
|
|
@@ -134,6 +143,8 @@ script/
|
|
|
134
143
|
|
|
135
144
|
## Risks And Notes
|
|
136
145
|
|
|
146
|
+
See [RISKS.md](./RISKS.md) for the full risk register. In short:
|
|
147
|
+
|
|
137
148
|
- Hooks can materially change payment and cash-out behavior.
|
|
138
149
|
- Permissions are flexible, which makes broad or wildcard grants risky.
|
|
139
150
|
- Multi-terminal and multi-token accounting is powerful, but it is easy to misuse if an integration assumes a single-terminal model.
|
package/package.json
CHANGED
|
@@ -169,6 +169,7 @@ The core Juicebox V6 protocol on EVM: a modular system for launching treasury-ba
|
|
|
169
169
|
| `setFeelessHook(IJBFeelessHook hook)` | Sets or clears the optional hook consulted by `isFeelessFor`. Owner-only. (`JBFeelessAddresses`) |
|
|
170
170
|
| `isFeelessFor(address addr, uint256 projectId, address caller)` | Returns whether an address is feeless for a project, checking static grants and the optional caller-aware hook. (`JBFeelessAddresses`) |
|
|
171
171
|
| `creationFee()` / `creationFeeReceiver()` | Return the current project creation fee and receiver. (`JBProjects`) |
|
|
172
|
-
| `
|
|
172
|
+
| `MAX_CREATION_FEE()` | Hardcoded ceiling (`0.001 ether`) on the native-token project creation fee the owner can set. (`JBProjects`) |
|
|
173
|
+
| `setCreationFee(uint256 fee, address payable receiver)` | Sets the native-token project creation fee. Reverts if `fee > MAX_CREATION_FEE`. Owner-only. (`JBProjects`) |
|
|
173
174
|
| `setControllerAllowed(uint256 projectId)` | Returns whether a project's controller can currently be set. (`IJBDirectoryAccessControl`) |
|
|
174
175
|
| `setTerminalsAllowed(uint256 projectId)` | Returns whether a project's terminals can currently be set. (`IJBDirectoryAccessControl`) |
|
|
@@ -8,7 +8,7 @@ import {JBChainlinkV3PriceFeed} from "./JBChainlinkV3PriceFeed.sol";
|
|
|
8
8
|
|
|
9
9
|
/// @notice Extends `JBChainlinkV3PriceFeed` with L2 sequencer uptime checks (for Optimism, Arbitrum, etc.). Reverts if
|
|
10
10
|
/// the sequencer is down or has not been back online for at least `GRACE_PERIOD_TIME` seconds — preventing stale
|
|
11
|
-
/// prices from
|
|
11
|
+
/// prices from being used immediately after an outage.
|
|
12
12
|
contract JBChainlinkV3SequencerPriceFeed is JBChainlinkV3PriceFeed {
|
|
13
13
|
//*********************************************************************//
|
|
14
14
|
// --------------------------- custom errors ------------------------- //
|
package/src/JBProjects.sol
CHANGED
|
@@ -18,9 +18,19 @@ contract JBProjects is ERC721, ERC2771Context, Ownable, IJBProjects {
|
|
|
18
18
|
// --------------------------- custom errors ------------------------- //
|
|
19
19
|
//*********************************************************************//
|
|
20
20
|
|
|
21
|
+
error JBProjects_CreationFeeExceedsMax(uint256 fee, uint256 max);
|
|
21
22
|
error JBProjects_InvalidCreationFee(uint256 value, uint256 requiredFee);
|
|
22
23
|
error JBProjects_ZeroCreationFeeReceiver();
|
|
23
24
|
|
|
25
|
+
//*********************************************************************//
|
|
26
|
+
// ------------------------- public constants ------------------------ //
|
|
27
|
+
//*********************************************************************//
|
|
28
|
+
|
|
29
|
+
/// @notice The maximum native-token fee the owner can require to create a project.
|
|
30
|
+
/// @dev Hardcoded as a cap on the owner's `setCreationFee` authority so the fee can never become an effective
|
|
31
|
+
/// barrier to project creation.
|
|
32
|
+
uint256 public constant override MAX_CREATION_FEE = 0.001 ether;
|
|
33
|
+
|
|
24
34
|
//*********************************************************************//
|
|
25
35
|
// --------------------- public stored properties -------------------- //
|
|
26
36
|
//*********************************************************************//
|
|
@@ -66,10 +76,14 @@ contract JBProjects is ERC721, ERC2771Context, Ownable, IJBProjects {
|
|
|
66
76
|
//*********************************************************************//
|
|
67
77
|
|
|
68
78
|
/// @notice Set the native-token fee required to create a project and the address that receives it.
|
|
69
|
-
/// @dev Only this contract's owner can change the fee. A non-zero fee requires a non-zero receiver.
|
|
70
|
-
///
|
|
79
|
+
/// @dev Only this contract's owner can change the fee. A non-zero fee requires a non-zero receiver. The fee may
|
|
80
|
+
/// not exceed `MAX_CREATION_FEE`.
|
|
81
|
+
/// @param fee The required creation fee. Set to 0 to disable creation fees. Must be `<= MAX_CREATION_FEE`.
|
|
71
82
|
/// @param receiver The address that receives project creation fees.
|
|
72
83
|
function setCreationFee(uint256 fee, address payable receiver) external override onlyOwner {
|
|
84
|
+
// Enforce the hardcoded ceiling so the owner can never price project creation out of reach.
|
|
85
|
+
if (fee > MAX_CREATION_FEE) revert JBProjects_CreationFeeExceedsMax({fee: fee, max: MAX_CREATION_FEE});
|
|
86
|
+
|
|
73
87
|
// Non-zero fees need somewhere to go.
|
|
74
88
|
if (fee != 0 && receiver == address(0)) revert JBProjects_ZeroCreationFeeReceiver();
|
|
75
89
|
|
|
@@ -24,6 +24,9 @@ interface IJBProjects is IERC721 {
|
|
|
24
24
|
/// @param caller The address that set the resolver.
|
|
25
25
|
event SetTokenUriResolver(IJBTokenUriResolver indexed resolver, address caller);
|
|
26
26
|
|
|
27
|
+
/// @notice Returns the maximum native-token fee the owner can require to create a project.
|
|
28
|
+
function MAX_CREATION_FEE() external view returns (uint256);
|
|
29
|
+
|
|
27
30
|
/// @notice Returns the native-token fee required to create a project.
|
|
28
31
|
function creationFee() external view returns (uint256);
|
|
29
32
|
|
|
@@ -42,7 +45,7 @@ interface IJBProjects is IERC721 {
|
|
|
42
45
|
function createFor(address owner) external payable returns (uint256 projectId);
|
|
43
46
|
|
|
44
47
|
/// @notice Sets the native-token fee required to create a project and the address that receives it.
|
|
45
|
-
/// @param fee The required creation fee. Set to 0 to disable creation fees.
|
|
48
|
+
/// @param fee The required creation fee. Set to 0 to disable creation fees. Must be `<= MAX_CREATION_FEE`.
|
|
46
49
|
/// @param receiver The address that receives creation fees. Must be non-zero when `fee` is non-zero.
|
|
47
50
|
function setCreationFee(uint256 fee, address payable receiver) external;
|
|
48
51
|
|