@bannynet/core-v6 0.0.1
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 +53 -0
- package/SKILLS.md +94 -0
- package/deployments/banny-core-v5/arbitrum/Banny721TokenUriResolver.json +1809 -0
- package/deployments/banny-core-v5/arbitrum_sepolia/Banny721TokenUriResolver.json +1795 -0
- package/deployments/banny-core-v5/base/Banny721TokenUriResolver.json +1810 -0
- package/deployments/banny-core-v5/base_sepolia/Banny721TokenUriResolver.json +1796 -0
- package/deployments/banny-core-v5/ethereum/Banny721TokenUriResolver.json +1795 -0
- package/deployments/banny-core-v5/optimism/Banny721TokenUriResolver.json +1810 -0
- package/deployments/banny-core-v5/optimism_sepolia/Banny721TokenUriResolver.json +1796 -0
- package/deployments/banny-core-v5/sepolia/Banny721TokenUriResolver.json +1795 -0
- package/foundry.toml +22 -0
- package/package.json +53 -0
- package/remappings.txt +1 -0
- package/script/1.Fix.s.sol +290 -0
- package/script/Add.Denver.s.sol +75 -0
- package/script/AirdropOutfits.s.sol +2302 -0
- package/script/Deploy.s.sol +440 -0
- package/script/Drop1.s.sol +979 -0
- package/script/MigrationContractArbitrum.sol +494 -0
- package/script/MigrationContractArbitrum1.sol +170 -0
- package/script/MigrationContractArbitrum2.sol +204 -0
- package/script/MigrationContractArbitrum3.sol +174 -0
- package/script/MigrationContractArbitrum4.sol +478 -0
- package/script/MigrationContractBase1.sol +444 -0
- package/script/MigrationContractBase2.sol +175 -0
- package/script/MigrationContractBase3.sol +309 -0
- package/script/MigrationContractBase4.sol +350 -0
- package/script/MigrationContractBase5.sol +259 -0
- package/script/MigrationContractEthereum1.sol +468 -0
- package/script/MigrationContractEthereum2.sol +306 -0
- package/script/MigrationContractEthereum3.sol +349 -0
- package/script/MigrationContractEthereum4.sol +352 -0
- package/script/MigrationContractEthereum5.sol +354 -0
- package/script/MigrationContractEthereum6.sol +270 -0
- package/script/MigrationContractEthereum7.sol +439 -0
- package/script/MigrationContractEthereum8.sol +385 -0
- package/script/MigrationContractOptimism.sol +196 -0
- package/script/helpers/BannyverseDeploymentLib.sol +73 -0
- package/script/helpers/MigrationHelper.sol +155 -0
- package/script/outfit_drop/generate-migration.js +3441 -0
- package/script/outfit_drop/raw.json +43276 -0
- package/slither-ci.config.json +10 -0
- package/sphinx.lock +521 -0
- package/src/Banny721TokenUriResolver.sol +1288 -0
- package/src/interfaces/IBanny721TokenUriResolver.sol +137 -0
- package/test/Banny721TokenUriResolver.t.sol +669 -0
- package/test/BannyAttacks.t.sol +322 -0
- package/test/DecorateFlow.t.sol +1056 -0
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/// @notice Manages Banny NFT assets -- bodies, backgrounds, and outfits -- and resolves on-chain SVG token URIs for
|
|
5
|
+
/// dressed Banny compositions.
|
|
6
|
+
interface IBanny721TokenUriResolver {
|
|
7
|
+
event DecorateBanny(
|
|
8
|
+
address indexed hook,
|
|
9
|
+
uint256 indexed bannyBodyId,
|
|
10
|
+
uint256 indexed backgroundId,
|
|
11
|
+
uint256[] outfitIds,
|
|
12
|
+
address caller
|
|
13
|
+
);
|
|
14
|
+
event SetProductName(uint256 indexed upc, string name, address caller);
|
|
15
|
+
event SetSvgBaseUri(string baseUri, address caller);
|
|
16
|
+
event SetSvgContent(uint256 indexed upc, string svgContent, address caller);
|
|
17
|
+
event SetSvgHash(uint256 indexed upc, bytes32 indexed svgHash, address caller);
|
|
18
|
+
|
|
19
|
+
/// @notice The stored SVG content hash for a given product.
|
|
20
|
+
/// @param upc The universal product code to look up.
|
|
21
|
+
/// @return The SVG content hash.
|
|
22
|
+
function svgHashOf(uint256 upc) external view returns (bytes32);
|
|
23
|
+
|
|
24
|
+
/// @notice The base URI used to lazily resolve SVG content from IPFS.
|
|
25
|
+
/// @return The base URI string.
|
|
26
|
+
function svgBaseUri() external view returns (string memory);
|
|
27
|
+
|
|
28
|
+
/// @notice The timestamp until which a banny body's outfit is locked and cannot be changed.
|
|
29
|
+
/// @param hook The hook address of the collection.
|
|
30
|
+
/// @param upc The ID of the banny body.
|
|
31
|
+
/// @return The lock expiration timestamp, or 0 if not locked.
|
|
32
|
+
function outfitLockedUntil(address hook, uint256 upc) external view returns (uint256);
|
|
33
|
+
|
|
34
|
+
/// @notice The default SVG content for alien banny eyes.
|
|
35
|
+
/// @return The SVG string.
|
|
36
|
+
function DEFAULT_ALIEN_EYES() external view returns (string memory);
|
|
37
|
+
|
|
38
|
+
/// @notice The default SVG content for a banny mouth.
|
|
39
|
+
/// @return The SVG string.
|
|
40
|
+
function DEFAULT_MOUTH() external view returns (string memory);
|
|
41
|
+
|
|
42
|
+
/// @notice The default SVG content for a banny necklace.
|
|
43
|
+
/// @return The SVG string.
|
|
44
|
+
function DEFAULT_NECKLACE() external view returns (string memory);
|
|
45
|
+
|
|
46
|
+
/// @notice The default SVG content for standard banny eyes.
|
|
47
|
+
/// @return The SVG string.
|
|
48
|
+
function DEFAULT_STANDARD_EYES() external view returns (string memory);
|
|
49
|
+
|
|
50
|
+
/// @notice The base SVG content for a banny body.
|
|
51
|
+
/// @return The SVG string.
|
|
52
|
+
function BANNY_BODY() external view returns (string memory);
|
|
53
|
+
|
|
54
|
+
/// @notice The background and outfit IDs currently attached to a banny body.
|
|
55
|
+
/// @param hook The hook address of the collection.
|
|
56
|
+
/// @param bannyBodyId The ID of the banny body.
|
|
57
|
+
/// @return backgroundId The ID of the attached background.
|
|
58
|
+
/// @return outfitIds The IDs of the attached outfits.
|
|
59
|
+
function assetIdsOf(
|
|
60
|
+
address hook,
|
|
61
|
+
uint256 bannyBodyId
|
|
62
|
+
)
|
|
63
|
+
external
|
|
64
|
+
view
|
|
65
|
+
returns (uint256 backgroundId, uint256[] memory outfitIds);
|
|
66
|
+
|
|
67
|
+
/// @notice The banny body ID that is currently using a given background.
|
|
68
|
+
/// @param hook The hook address of the collection.
|
|
69
|
+
/// @param backgroundId The ID of the background.
|
|
70
|
+
/// @return The banny body ID using the background, or 0 if none.
|
|
71
|
+
function userOf(address hook, uint256 backgroundId) external view returns (uint256);
|
|
72
|
+
|
|
73
|
+
/// @notice The banny body ID that is currently wearing a given outfit.
|
|
74
|
+
/// @param hook The hook address of the collection.
|
|
75
|
+
/// @param outfitId The ID of the outfit.
|
|
76
|
+
/// @return The banny body ID wearing the outfit, or 0 if none.
|
|
77
|
+
function wearerOf(address hook, uint256 outfitId) external view returns (uint256);
|
|
78
|
+
|
|
79
|
+
/// @notice Get the composed SVG for a token, optionally dressed and with a background.
|
|
80
|
+
/// @param hook The hook address of the collection.
|
|
81
|
+
/// @param tokenId The token ID to render.
|
|
82
|
+
/// @param shouldDressBannyBody Whether to include the banny body's attached outfits.
|
|
83
|
+
/// @param shouldIncludeBackgroundOnBannyBody Whether to include the banny body's attached background.
|
|
84
|
+
/// @return The composed SVG string.
|
|
85
|
+
function svgOf(
|
|
86
|
+
address hook,
|
|
87
|
+
uint256 tokenId,
|
|
88
|
+
bool shouldDressBannyBody,
|
|
89
|
+
bool shouldIncludeBackgroundOnBannyBody
|
|
90
|
+
)
|
|
91
|
+
external
|
|
92
|
+
view
|
|
93
|
+
returns (string memory);
|
|
94
|
+
|
|
95
|
+
/// @notice Get the names associated with a token (product name, category name, and display name).
|
|
96
|
+
/// @param hook The hook address of the collection.
|
|
97
|
+
/// @param tokenId The token ID to look up.
|
|
98
|
+
/// @return The product name, the category name, and the display name.
|
|
99
|
+
function namesOf(address hook, uint256 tokenId) external view returns (string memory, string memory, string memory);
|
|
100
|
+
|
|
101
|
+
/// @notice Dress a banny body with a background and outfits.
|
|
102
|
+
/// @param hook The hook address of the collection.
|
|
103
|
+
/// @param bannyBodyId The ID of the banny body to dress.
|
|
104
|
+
/// @param backgroundId The ID of the background to attach (0 for none).
|
|
105
|
+
/// @param outfitIds The IDs of the outfits to attach.
|
|
106
|
+
function decorateBannyWith(
|
|
107
|
+
address hook,
|
|
108
|
+
uint256 bannyBodyId,
|
|
109
|
+
uint256 backgroundId,
|
|
110
|
+
uint256[] calldata outfitIds
|
|
111
|
+
)
|
|
112
|
+
external;
|
|
113
|
+
|
|
114
|
+
/// @notice Lock a banny body so its outfit cannot be changed for a period of time.
|
|
115
|
+
/// @param hook The hook address of the collection.
|
|
116
|
+
/// @param bannyBodyId The ID of the banny body to lock.
|
|
117
|
+
function lockOutfitChangesFor(address hook, uint256 bannyBodyId) external;
|
|
118
|
+
|
|
119
|
+
/// @notice Store SVG contents for products, validated against previously stored hashes.
|
|
120
|
+
/// @param upcs The universal product codes to store SVG contents for.
|
|
121
|
+
/// @param svgContents The SVG contents to store (must match stored hashes).
|
|
122
|
+
function setSvgContentsOf(uint256[] memory upcs, string[] calldata svgContents) external;
|
|
123
|
+
|
|
124
|
+
/// @notice Store SVG content hashes for products. Only the contract owner can call this.
|
|
125
|
+
/// @param upcs The universal product codes to store SVG hashes for.
|
|
126
|
+
/// @param svgHashes The SVG content hashes to store.
|
|
127
|
+
function setSvgHashesOf(uint256[] memory upcs, bytes32[] memory svgHashes) external;
|
|
128
|
+
|
|
129
|
+
/// @notice Set custom display names for products. Only the contract owner can call this.
|
|
130
|
+
/// @param upcs The universal product codes to set names for.
|
|
131
|
+
/// @param names The names to assign to each product.
|
|
132
|
+
function setProductNames(uint256[] memory upcs, string[] memory names) external;
|
|
133
|
+
|
|
134
|
+
/// @notice Set the base URI used for lazily resolving SVG content from IPFS. Only the contract owner can call this.
|
|
135
|
+
/// @param baseUri The new base URI.
|
|
136
|
+
function setSvgBaseUri(string calldata baseUri) external;
|
|
137
|
+
}
|