@bananapus/721-hook-v6 0.0.57 → 0.0.59
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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bananapus/721-hook-v6",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.59",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/Bananapus/nana-721-hook-v6"
|
|
7
|
+
"url": "git+https://github.com/Bananapus/nana-721-hook-v6.git"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"foundry.toml",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@bananapus/address-registry-v6": "^0.0.26",
|
|
29
|
-
"@bananapus/core-v6": "^0.0.
|
|
29
|
+
"@bananapus/core-v6": "^0.0.72",
|
|
30
30
|
"@bananapus/ownable-v6": "^0.0.31",
|
|
31
31
|
"@bananapus/permission-ids-v6": "^0.0.27",
|
|
32
32
|
"@openzeppelin/contracts": "5.6.1",
|
|
@@ -77,6 +77,7 @@ contract JB721TiersHookProjectDeployer is
|
|
|
77
77
|
/// @param salt A salt to use for the deterministic deployment.
|
|
78
78
|
/// @return projectId The ID of the newly launched project.
|
|
79
79
|
/// @return hook The 721 tiers hook that was deployed for the project.
|
|
80
|
+
/// @dev Forwards `msg.value` to `JBProjects.createFor` to cover any configured project creation fee.
|
|
80
81
|
function launchProjectFor(
|
|
81
82
|
address owner,
|
|
82
83
|
JBDeploy721TiersHookConfig calldata deployTiersHookConfig,
|
|
@@ -85,12 +86,13 @@ contract JB721TiersHookProjectDeployer is
|
|
|
85
86
|
bytes32 salt
|
|
86
87
|
)
|
|
87
88
|
external
|
|
89
|
+
payable
|
|
88
90
|
override
|
|
89
91
|
returns (uint256 projectId, IJB721TiersHook hook)
|
|
90
92
|
{
|
|
91
93
|
// Reserve the project ID up front so permissionless project creations cannot invalidate hook deployment.
|
|
92
94
|
IJBProjects projects = DIRECTORY.PROJECTS();
|
|
93
|
-
projectId = projects.createFor(address(this));
|
|
95
|
+
projectId = projects.createFor{value: msg.value}(address(this));
|
|
94
96
|
|
|
95
97
|
// Deploy the hook.
|
|
96
98
|
hook = HOOK_DEPLOYER.deployHookFor({
|
|
@@ -29,6 +29,7 @@ interface IJB721TiersHookProjectDeployer {
|
|
|
29
29
|
/// @param salt A salt to use for the deterministic deployment.
|
|
30
30
|
/// @return projectId The ID of the newly launched project.
|
|
31
31
|
/// @return hook The 721 tiers hook that was deployed for the project.
|
|
32
|
+
/// @dev Forwards `msg.value` to `JBProjects.createFor` to cover any configured project creation fee.
|
|
32
33
|
function launchProjectFor(
|
|
33
34
|
address owner,
|
|
34
35
|
JBDeploy721TiersHookConfig memory deployTiersHookConfig,
|
|
@@ -37,6 +38,7 @@ interface IJB721TiersHookProjectDeployer {
|
|
|
37
38
|
bytes32 salt
|
|
38
39
|
)
|
|
39
40
|
external
|
|
41
|
+
payable
|
|
40
42
|
returns (uint256 projectId, IJB721TiersHook hook);
|
|
41
43
|
|
|
42
44
|
/// @notice Launches rulesets for a project with an attached 721 tiers hook.
|
|
@@ -12,7 +12,7 @@ library JBIpfsDecoder {
|
|
|
12
12
|
|
|
13
13
|
/// @notice Just a kind reminder to our readers.
|
|
14
14
|
/// @dev Used in `base58ToString`
|
|
15
|
-
bytes internal constant
|
|
15
|
+
bytes internal constant _ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
|
16
16
|
|
|
17
17
|
/// @notice Decode an IPFS hash from a bytes32 and concatenate it with a base URI.
|
|
18
18
|
/// @param baseUri The base URI to prepend to the decoded IPFS hash.
|
|
@@ -47,15 +47,15 @@ library JBIpfsDecoder {
|
|
|
47
47
|
return output;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/// @notice Map each base-58 digit (0–57) to its corresponding character in `
|
|
50
|
+
/// @notice Map each base-58 digit (0–57) to its corresponding character in `_ALPHABET`.
|
|
51
51
|
/// @dev Final stage of `_toBase58`: turns the numeric digit array into the canonical base-58 string bytes.
|
|
52
52
|
/// @param indices Each element must satisfy `0 <= indices[i] < 58`; out-of-range values revert via index OOB.
|
|
53
|
-
/// @return output ASCII bytes with `output[i] =
|
|
53
|
+
/// @return output ASCII bytes with `output[i] = _ALPHABET[indices[i]]`.
|
|
54
54
|
function _toAlphabet(uint8[] memory indices) private pure returns (bytes memory) {
|
|
55
55
|
uint256 indicesLength = indices.length;
|
|
56
56
|
bytes memory output = new bytes(indicesLength);
|
|
57
57
|
for (uint256 i; i < indicesLength;) {
|
|
58
|
-
output[i] =
|
|
58
|
+
output[i] = _ALPHABET[indices[i]];
|
|
59
59
|
|
|
60
60
|
unchecked {
|
|
61
61
|
++i;
|