@bananapus/core-v6 0.0.72 → 0.0.73
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
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`) |
|
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
|
|