@bannynet/core-v6 0.0.8 → 0.0.9
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 +1 -1
- package/script/Deploy.s.sol +4 -6
- package/script/helpers/BannyverseDeploymentLib.sol +2 -2
- package/test/Banny721TokenUriResolver.t.sol +12 -10
- package/test/BannyAttacks.t.sol +2 -0
- package/test/DecorateFlow.t.sol +2 -0
- package/test/Fork.t.sol +12 -9
- package/test/regression/BodyCategoryValidation.t.sol +1 -0
- package/test/regression/BurnedTokenCheck.t.sol +1 -0
- package/test/regression/CEIReorder.t.sol +1 -0
- package/test/regression/MsgSenderEvents.t.sol +1 -0
- package/test/regression/RemovedTierDesync.t.sol +1 -0
package/package.json
CHANGED
package/script/Deploy.s.sol
CHANGED
|
@@ -82,6 +82,8 @@ contract DeployScript is Script, Sphinx {
|
|
|
82
82
|
uint104 constant BAN_BASE_AUTO_ISSUANCE = 10_097_684_379_816_492_953_872;
|
|
83
83
|
uint104 constant BAN_OP_AUTO_ISSUANCE = 328_366_065_858_064_488_000;
|
|
84
84
|
uint104 constant BAN_ARB_AUTO_ISSUANCE = 2_825_980_000_000_000_000_000;
|
|
85
|
+
// forge-lint: disable-next-line(unsafe-typecast)
|
|
86
|
+
uint104 constant BAN_PREMINT_COUNT = uint104(1_000_000 * DECIMAL_MULTIPLIER);
|
|
85
87
|
|
|
86
88
|
function configureSphinx() public override {
|
|
87
89
|
sphinxConfig.projectName = "banny-core-v6";
|
|
@@ -179,12 +181,8 @@ contract DeployScript is Script, Sphinx {
|
|
|
179
181
|
|
|
180
182
|
{
|
|
181
183
|
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](1);
|
|
182
|
-
autoIssuances[0] =
|
|
183
|
-
|
|
184
|
-
chainId: PREMINT_CHAIN_ID,
|
|
185
|
-
count: uint104(1_000_000 * DECIMAL_MULTIPLIER),
|
|
186
|
-
beneficiary: operator
|
|
187
|
-
});
|
|
184
|
+
autoIssuances[0] =
|
|
185
|
+
REVAutoIssuance({chainId: PREMINT_CHAIN_ID, count: BAN_PREMINT_COUNT, beneficiary: operator});
|
|
188
186
|
|
|
189
187
|
// decrease by a smaller percent more frequently. 30 days, 7%-ish.
|
|
190
188
|
stageConfigurations[1] = REVStageConfig({
|
|
@@ -79,9 +79,9 @@ library BannyverseDeploymentLib {
|
|
|
79
79
|
view
|
|
80
80
|
returns (address)
|
|
81
81
|
{
|
|
82
|
-
// forge-lint: disable-next-line(unsafe-cheatcode)
|
|
83
82
|
string memory deploymentJson =
|
|
84
|
-
|
|
83
|
+
// forge-lint: disable-next-line(unsafe-cheatcode)
|
|
84
|
+
vm.readFile(string.concat(path, projectName, "/", networkName, "/", contractName, ".json"));
|
|
85
85
|
return stdJson.readAddress({json: deploymentJson, key: ".address"});
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -79,10 +79,12 @@ contract MockStore {
|
|
|
79
79
|
return tiers[hook][tokenId];
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
82
83
|
function encodedTierIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
83
84
|
return bytes32(0);
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
86
88
|
function encodedIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
87
89
|
return bytes32(0);
|
|
88
90
|
}
|
|
@@ -166,7 +168,7 @@ contract TestBanny721TokenUriResolver is Test {
|
|
|
166
168
|
// --- Constructor --------------------------------------------------- //
|
|
167
169
|
//*********************************************************************//
|
|
168
170
|
|
|
169
|
-
function test_constructor_setsDefaults() public {
|
|
171
|
+
function test_constructor_setsDefaults() public view {
|
|
170
172
|
assertEq(resolver.BANNY_BODY(), "<path/>");
|
|
171
173
|
assertEq(resolver.DEFAULT_NECKLACE(), "<necklace/>");
|
|
172
174
|
assertEq(resolver.DEFAULT_MOUTH(), "<mouth/>");
|
|
@@ -607,27 +609,27 @@ contract TestBanny721TokenUriResolver is Test {
|
|
|
607
609
|
resolver.decorateBannyWith(address(hook), BODY_TOKEN, 0, outfitIds1);
|
|
608
610
|
|
|
609
611
|
// Create a new necklace token.
|
|
610
|
-
uint256
|
|
611
|
-
_setupTier(
|
|
612
|
-
hook.setOwner(
|
|
612
|
+
uint256 necklaceToken2 = 11_000_000_001;
|
|
613
|
+
_setupTier(necklaceToken2, 11, 3); // Same category (3)
|
|
614
|
+
hook.setOwner(necklaceToken2, alice);
|
|
613
615
|
|
|
614
616
|
// Replace with new necklace. Old one should be returned.
|
|
615
617
|
uint256[] memory outfitIds2 = new uint256[](1);
|
|
616
|
-
outfitIds2[0] =
|
|
618
|
+
outfitIds2[0] = necklaceToken2;
|
|
617
619
|
vm.prank(alice);
|
|
618
620
|
resolver.decorateBannyWith(address(hook), BODY_TOKEN, 0, outfitIds2);
|
|
619
621
|
|
|
620
622
|
// Old necklace returned to alice.
|
|
621
623
|
assertEq(hook.ownerOf(NECKLACE_TOKEN), alice, "old necklace should be returned");
|
|
622
624
|
// New necklace held by resolver.
|
|
623
|
-
assertEq(hook.ownerOf(
|
|
625
|
+
assertEq(hook.ownerOf(necklaceToken2), address(resolver), "new necklace should be held");
|
|
624
626
|
}
|
|
625
627
|
|
|
626
628
|
//*********************************************************************//
|
|
627
629
|
// --- onERC721Received ---------------------------------------------- //
|
|
628
630
|
//*********************************************************************//
|
|
629
631
|
|
|
630
|
-
function test_onERC721Received_acceptsFromSelf() public {
|
|
632
|
+
function test_onERC721Received_acceptsFromSelf() public view {
|
|
631
633
|
bytes4 result = resolver.onERC721Received(address(resolver), alice, 1, "");
|
|
632
634
|
assertEq(result, IERC721Receiver.onERC721Received.selector, "should accept from self");
|
|
633
635
|
}
|
|
@@ -641,7 +643,7 @@ contract TestBanny721TokenUriResolver is Test {
|
|
|
641
643
|
// --- View: assetIdsOf with no outfits ------------------------------ //
|
|
642
644
|
//*********************************************************************//
|
|
643
645
|
|
|
644
|
-
function test_assetIdsOf_empty() public {
|
|
646
|
+
function test_assetIdsOf_empty() public view {
|
|
645
647
|
(uint256 backgroundId, uint256[] memory outfitIds) = resolver.assetIdsOf(address(hook), BODY_TOKEN);
|
|
646
648
|
assertEq(backgroundId, 0, "no background initially");
|
|
647
649
|
assertEq(outfitIds.length, 0, "no outfits initially");
|
|
@@ -651,11 +653,11 @@ contract TestBanny721TokenUriResolver is Test {
|
|
|
651
653
|
// --- View: userOf / wearerOf --------------------------------------- //
|
|
652
654
|
//*********************************************************************//
|
|
653
655
|
|
|
654
|
-
function test_userOf_returnsZeroIfNotAttached() public {
|
|
656
|
+
function test_userOf_returnsZeroIfNotAttached() public view {
|
|
655
657
|
assertEq(resolver.userOf(address(hook), BACKGROUND_TOKEN), 0, "no user initially");
|
|
656
658
|
}
|
|
657
659
|
|
|
658
|
-
function test_wearerOf_returnsZeroIfNotWorn() public {
|
|
660
|
+
function test_wearerOf_returnsZeroIfNotWorn() public view {
|
|
659
661
|
assertEq(resolver.wearerOf(address(hook), NECKLACE_TOKEN), 0, "no wearer initially");
|
|
660
662
|
}
|
|
661
663
|
|
package/test/BannyAttacks.t.sol
CHANGED
|
@@ -70,10 +70,12 @@ contract AttackMockStore {
|
|
|
70
70
|
return tiers[hook][tokenId];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
73
74
|
function encodedTierIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
74
75
|
return bytes32(0);
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
77
79
|
function encodedIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
78
80
|
return bytes32(0);
|
|
79
81
|
}
|
package/test/DecorateFlow.t.sol
CHANGED
|
@@ -70,10 +70,12 @@ contract DecorateFlowMockStore {
|
|
|
70
70
|
return tiers[hook][tokenId];
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
73
74
|
function encodedTierIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
74
75
|
return bytes32(0);
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
77
79
|
function encodedIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
78
80
|
return bytes32(0);
|
|
79
81
|
}
|
package/test/Fork.t.sol
CHANGED
|
@@ -27,7 +27,6 @@ import {JB721TiersHookFlags} from "@bananapus/721-hook-v6/src/structs/JB721Tiers
|
|
|
27
27
|
import {JBDeploy721TiersHookConfig} from "@bananapus/721-hook-v6/src/structs/JBDeploy721TiersHookConfig.sol";
|
|
28
28
|
import {JB721Tier} from "@bananapus/721-hook-v6/src/structs/JB721Tier.sol";
|
|
29
29
|
import {IJB721TokenUriResolver} from "@bananapus/721-hook-v6/src/interfaces/IJB721TokenUriResolver.sol";
|
|
30
|
-
import {IJBPrices} from "@bananapus/core-v6/src/interfaces/IJBPrices.sol";
|
|
31
30
|
import {JBCurrencyIds} from "@bananapus/core-v6/src/libraries/JBCurrencyIds.sol";
|
|
32
31
|
import {JBSplit} from "@bananapus/core-v6/src/structs/JBSplit.sol";
|
|
33
32
|
|
|
@@ -113,10 +112,12 @@ contract ReentrantMockStore {
|
|
|
113
112
|
return tiers[hook][tokenId];
|
|
114
113
|
}
|
|
115
114
|
|
|
115
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
116
116
|
function encodedTierIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
117
117
|
return bytes32(0);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
120
121
|
function encodedIPFSUriOf(address, uint256) external pure returns (bytes32) {
|
|
121
122
|
return bytes32(0);
|
|
122
123
|
}
|
|
@@ -299,13 +300,13 @@ contract BannyForkTest is Test {
|
|
|
299
300
|
assertEq(IERC721(address(bannyHook)).ownerOf(ORIGINAL_BODY_1), alice);
|
|
300
301
|
}
|
|
301
302
|
|
|
302
|
-
function test_fork_e2e_alienBodyDefaultEyes() public {
|
|
303
|
+
function test_fork_e2e_alienBodyDefaultEyes() public view {
|
|
303
304
|
// Alice owns ALIEN_BODY_1. Naked alien body should inject alien eyes in SVG.
|
|
304
305
|
string memory svg = resolver.svgOf(address(bannyHook), ALIEN_BODY_1, true, false);
|
|
305
306
|
assertGt(bytes(svg).length, 0, "alien body SVG should render");
|
|
306
307
|
}
|
|
307
308
|
|
|
308
|
-
function test_fork_e2e_outfitRenderedOnMannequin() public {
|
|
309
|
+
function test_fork_e2e_outfitRenderedOnMannequin() public view {
|
|
309
310
|
// Unequipped outfit token should render on mannequin.
|
|
310
311
|
string memory uri = resolver.tokenUriOf(address(bannyHook), NECKLACE_1);
|
|
311
312
|
assertGt(bytes(uri).length, 0, "outfit URI should render on mannequin");
|
|
@@ -781,14 +782,14 @@ contract BannyForkTest is Test {
|
|
|
781
782
|
// 7. TOKEN URI RENDERING
|
|
782
783
|
// ═══════════════════════════════════════════════════════════════════════
|
|
783
784
|
|
|
784
|
-
function test_fork_render_nakedBodyHasDefaultInjections() public {
|
|
785
|
+
function test_fork_render_nakedBodyHasDefaultInjections() public view {
|
|
785
786
|
// A naked body should still render with default necklace, eyes, mouth.
|
|
786
787
|
string memory svg = resolver.svgOf(address(bannyHook), ORIGINAL_BODY_1, true, false);
|
|
787
788
|
assertGt(bytes(svg).length, 0, "naked body should render");
|
|
788
789
|
// The SVG should contain the body path and defaults.
|
|
789
790
|
}
|
|
790
791
|
|
|
791
|
-
function test_fork_render_allFourBodyTypes() public {
|
|
792
|
+
function test_fork_render_allFourBodyTypes() public view {
|
|
792
793
|
// Each body type should render.
|
|
793
794
|
string memory alienSvg = resolver.svgOf(address(bannyHook), ALIEN_BODY_1, true, false);
|
|
794
795
|
string memory pinkSvg = resolver.svgOf(address(bannyHook), PINK_BODY_1, true, false);
|
|
@@ -1011,17 +1012,17 @@ contract BannyForkTest is Test {
|
|
|
1011
1012
|
assertEq(outfitIds.length, 0);
|
|
1012
1013
|
}
|
|
1013
1014
|
|
|
1014
|
-
function test_fork_edge_assetIdsEmptyInitially() public {
|
|
1015
|
+
function test_fork_edge_assetIdsEmptyInitially() public view {
|
|
1015
1016
|
(uint256 bgId, uint256[] memory outfitIds) = resolver.assetIdsOf(address(bannyHook), ORIGINAL_BODY_1);
|
|
1016
1017
|
assertEq(bgId, 0);
|
|
1017
1018
|
assertEq(outfitIds.length, 0);
|
|
1018
1019
|
}
|
|
1019
1020
|
|
|
1020
|
-
function test_fork_edge_wearerOfUnwornReturnsZero() public {
|
|
1021
|
+
function test_fork_edge_wearerOfUnwornReturnsZero() public view {
|
|
1021
1022
|
assertEq(resolver.wearerOf(address(bannyHook), NECKLACE_1), 0);
|
|
1022
1023
|
}
|
|
1023
1024
|
|
|
1024
|
-
function test_fork_edge_userOfUnusedBackgroundReturnsZero() public {
|
|
1025
|
+
function test_fork_edge_userOfUnusedBackgroundReturnsZero() public view {
|
|
1025
1026
|
assertEq(resolver.userOf(address(bannyHook), BACKGROUND_1), 0);
|
|
1026
1027
|
}
|
|
1027
1028
|
|
|
@@ -1136,7 +1137,7 @@ contract BannyForkTest is Test {
|
|
|
1136
1137
|
resolver.decorateBannyWith(address(bannyHook), ORIGINAL_BODY_1, 0, outfits);
|
|
1137
1138
|
}
|
|
1138
1139
|
|
|
1139
|
-
function test_fork_edge_namesReturnsCorrectData() public {
|
|
1140
|
+
function test_fork_edge_namesReturnsCorrectData() public view {
|
|
1140
1141
|
// Verify namesOf returns correct product name for each body type.
|
|
1141
1142
|
(string memory alienFull,,) = resolver.namesOf(address(bannyHook), ALIEN_BODY_1);
|
|
1142
1143
|
assertGt(bytes(alienFull).length, 0, "alien name should not be empty");
|
|
@@ -1791,6 +1792,7 @@ contract BannyForkTest is Test {
|
|
|
1791
1792
|
// Internal helpers
|
|
1792
1793
|
// ═══════════════════════════════════════════════════════════════════════
|
|
1793
1794
|
|
|
1795
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
1794
1796
|
function _deployJBCore() internal {
|
|
1795
1797
|
jbPermissions = new JBPermissions(trustedForwarder);
|
|
1796
1798
|
jbProjects = new JBProjects(multisig, address(0), trustedForwarder);
|
|
@@ -1944,6 +1946,7 @@ contract BannyForkTest is Test {
|
|
|
1944
1946
|
});
|
|
1945
1947
|
}
|
|
1946
1948
|
|
|
1949
|
+
// forge-lint: disable-next-line(mixed-case-function)
|
|
1947
1950
|
function _mintInitialNFTs() internal {
|
|
1948
1951
|
// Mint bodies and outfits to alice, bob.
|
|
1949
1952
|
vm.startPrank(multisig); // hook owner can mint
|