@artblocks/contracts 1.0.4 → 1.1.0
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 +2 -2
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +97 -10
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +4 -4
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +4 -9
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +4 -9
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -9
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +4 -9
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +4 -4
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +19 -0
- package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +8 -101
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
- package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +51 -717
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
- package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
- package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
- package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
- package/contracts/DependencyRegistryV0.sol +84 -16
- package/contracts/archive/readme.md +16 -0
- package/contracts/engine/README.md +21 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +4 -10
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +4 -10
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +4 -10
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +4 -10
- package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +3 -0
- package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +11 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +4 -67
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +7 -155
- package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
- package/contracts/libs/v0.8.x/ABHelpers.sol +14 -14
- package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
- package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +163 -38
- package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +144 -37
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +250 -110
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +257 -48
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +778 -103
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +135 -13
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +567 -187
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +480 -322
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +214 -76
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +347 -304
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1 -54
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +388 -628
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +327 -664
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +278 -303
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +538 -622
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
- package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
- package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
- package/contracts/mock/ReentrancyMockShared.sol +48 -0
- package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +78 -70
- package/package.json +39 -33
|
@@ -4,168 +4,20 @@
|
|
|
4
4
|
pragma solidity ^0.8.0;
|
|
5
5
|
|
|
6
6
|
interface ISharedMinterV0 {
|
|
7
|
-
// This section defines events for generic project minter configuration updates
|
|
8
|
-
/**
|
|
9
|
-
* @dev Strings not supported. Recommend conversion of (short) strings to
|
|
10
|
-
* bytes32 to remain gas-efficient.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* @notice Generic project minter configuration event. Removes key `_key`
|
|
14
|
-
* for project `_projectId`.
|
|
15
|
-
*/
|
|
16
|
-
event ConfigKeyRemoved(
|
|
17
|
-
uint256 indexed _projectId,
|
|
18
|
-
address indexed _coreContract,
|
|
19
|
-
bytes32 _key
|
|
20
|
-
);
|
|
21
|
-
/// BOOL
|
|
22
|
-
/**
|
|
23
|
-
* @notice Generic project minter configuration event. Sets value of key
|
|
24
|
-
* `_key` to `_value` for project `_projectId`.
|
|
25
|
-
*/
|
|
26
|
-
event ConfigValueSet(
|
|
27
|
-
uint256 indexed _projectId,
|
|
28
|
-
address indexed _coreContract,
|
|
29
|
-
bytes32 _key,
|
|
30
|
-
bool _value
|
|
31
|
-
);
|
|
32
|
-
/// UINT256
|
|
33
|
-
/**
|
|
34
|
-
* @notice Generic project minter configuration event. Sets value of key
|
|
35
|
-
* `_key` to `_value` for project `_projectId`.
|
|
36
|
-
*/
|
|
37
|
-
event ConfigValueSet(
|
|
38
|
-
uint256 indexed _projectId,
|
|
39
|
-
address indexed _coreContract,
|
|
40
|
-
bytes32 _key,
|
|
41
|
-
uint256 _value
|
|
42
|
-
);
|
|
43
|
-
/**
|
|
44
|
-
* @notice Generic project minter configuration event. Adds value `_value`
|
|
45
|
-
* to the set of uint256 at key `_key` for project `_projectId`.
|
|
46
|
-
*/
|
|
47
|
-
event ConfigValueAddedToSet(
|
|
48
|
-
uint256 indexed _projectId,
|
|
49
|
-
address indexed _coreContract,
|
|
50
|
-
bytes32 _key,
|
|
51
|
-
uint256 _value
|
|
52
|
-
);
|
|
53
|
-
/**
|
|
54
|
-
* @notice Generic project minter configuration event. Removes value
|
|
55
|
-
* `_value` to the set of uint256 at key `_key` for project `_projectId`.
|
|
56
|
-
*/
|
|
57
|
-
event ConfigValueRemovedFromSet(
|
|
58
|
-
uint256 indexed _projectId,
|
|
59
|
-
address indexed _coreContract,
|
|
60
|
-
bytes32 _key,
|
|
61
|
-
uint256 _value
|
|
62
|
-
);
|
|
63
|
-
/// ADDRESS
|
|
64
|
-
/**
|
|
65
|
-
* @notice Generic project minter configuration event. Sets value of key
|
|
66
|
-
* `_key` to `_value` for project `_projectId`.
|
|
67
|
-
*/
|
|
68
|
-
event ConfigValueSet(
|
|
69
|
-
uint256 indexed _projectId,
|
|
70
|
-
address indexed _coreContract,
|
|
71
|
-
bytes32 _key,
|
|
72
|
-
address _value
|
|
73
|
-
);
|
|
74
|
-
/**
|
|
75
|
-
* @notice Generic project minter configuration event. Adds value `_value`
|
|
76
|
-
* to the set of addresses at key `_key` for project `_projectId`.
|
|
77
|
-
*/
|
|
78
|
-
event ConfigValueAddedToSet(
|
|
79
|
-
uint256 indexed _projectId,
|
|
80
|
-
address indexed _coreContract,
|
|
81
|
-
bytes32 _key,
|
|
82
|
-
address _value
|
|
83
|
-
);
|
|
84
|
-
/**
|
|
85
|
-
* @notice Generic project minter configuration event. Removes value
|
|
86
|
-
* `_value` to the set of addresses at key `_key` for project `_projectId`.
|
|
87
|
-
*/
|
|
88
|
-
event ConfigValueRemovedFromSet(
|
|
89
|
-
uint256 indexed _projectId,
|
|
90
|
-
address indexed _coreContract,
|
|
91
|
-
bytes32 _key,
|
|
92
|
-
address _value
|
|
93
|
-
);
|
|
94
|
-
/// BYTES32
|
|
95
|
-
/**
|
|
96
|
-
* @notice Generic project minter configuration event. Sets value of key
|
|
97
|
-
* `_key` to `_value` for project `_projectId`.
|
|
98
|
-
*/
|
|
99
|
-
event ConfigValueSet(
|
|
100
|
-
uint256 indexed _projectId,
|
|
101
|
-
address indexed _coreContract,
|
|
102
|
-
bytes32 _key,
|
|
103
|
-
bytes32 _value
|
|
104
|
-
);
|
|
105
|
-
/**
|
|
106
|
-
* @notice Generic project minter configuration event. Adds value `_value`
|
|
107
|
-
* to the set of bytes32 at key `_key` for project `_projectId`.
|
|
108
|
-
*/
|
|
109
|
-
event ConfigValueAddedToSet(
|
|
110
|
-
uint256 indexed _projectId,
|
|
111
|
-
address indexed _coreContract,
|
|
112
|
-
bytes32 _key,
|
|
113
|
-
bytes32 _value
|
|
114
|
-
);
|
|
115
|
-
/**
|
|
116
|
-
* @notice Generic project minter configuration event. Removes value
|
|
117
|
-
* `_value` to the set of bytes32 at key `_key` for project `_projectId`.
|
|
118
|
-
*/
|
|
119
|
-
event ConfigValueRemovedFromSet(
|
|
120
|
-
uint256 indexed _projectId,
|
|
121
|
-
address indexed _coreContract,
|
|
122
|
-
bytes32 _key,
|
|
123
|
-
bytes32 _value
|
|
124
|
-
);
|
|
125
|
-
///////////////////////////
|
|
126
|
-
/**
|
|
127
|
-
* @notice Price per token in wei updated for project `_projectId` to
|
|
128
|
-
* `_pricePerTokenInWei`.
|
|
129
|
-
*/
|
|
130
|
-
event PricePerTokenInWeiUpdated(
|
|
131
|
-
uint256 indexed _projectId,
|
|
132
|
-
address indexed _coreContract,
|
|
133
|
-
uint256 indexed _pricePerTokenInWei
|
|
134
|
-
);
|
|
135
|
-
/**
|
|
136
|
-
* @notice Currency updated for project `_projectId` to symbol
|
|
137
|
-
* `_currencySymbol` and address `_currencyAddress`.
|
|
138
|
-
*/
|
|
139
|
-
event ProjectCurrencyInfoUpdated(
|
|
140
|
-
uint256 indexed _projectId,
|
|
141
|
-
address indexed _coreContract,
|
|
142
|
-
address indexed _currencyAddress,
|
|
143
|
-
string _currencySymbol
|
|
144
|
-
);
|
|
145
|
-
/**
|
|
146
|
-
* @notice Local max invocations for project `_projectId`, tied to core contract `_coreContractAddress`,
|
|
147
|
-
* updated to `_maxInvocations`.
|
|
148
|
-
*/
|
|
149
|
-
event ProjectMaxInvocationsLimitUpdated(
|
|
150
|
-
uint256 indexed _projectId,
|
|
151
|
-
address indexed _coreContract,
|
|
152
|
-
uint256 _maxInvocations
|
|
153
|
-
);
|
|
154
|
-
|
|
155
7
|
// Sets the local max invocations for a given project, checking that the provided max invocations is
|
|
156
8
|
// less than or equal to the global max invocations for the project set on the core contract.
|
|
157
9
|
// This does not impact the max invocations value defined on the core contract.
|
|
158
10
|
function manuallyLimitProjectMaxInvocations(
|
|
159
|
-
uint256
|
|
160
|
-
address
|
|
161
|
-
uint24
|
|
11
|
+
uint256 projectId,
|
|
12
|
+
address coreContract,
|
|
13
|
+
uint24 maxInvocations
|
|
162
14
|
) external;
|
|
163
15
|
|
|
164
16
|
// Called to make the minter contract aware of the max invocations for a
|
|
165
17
|
// given project.
|
|
166
18
|
function syncProjectMaxInvocationsToCore(
|
|
167
|
-
uint256
|
|
168
|
-
address
|
|
19
|
+
uint256 projectId,
|
|
20
|
+
address coreContract
|
|
169
21
|
) external;
|
|
170
22
|
|
|
171
23
|
// getter function of public variable
|
|
@@ -177,8 +29,8 @@ interface ISharedMinterV0 {
|
|
|
177
29
|
// and currency address, assuming this is project's minter.
|
|
178
30
|
// Supersedes any defined core price.
|
|
179
31
|
function getPriceInfo(
|
|
180
|
-
uint256
|
|
181
|
-
address
|
|
32
|
+
uint256 projectId,
|
|
33
|
+
address coreContract
|
|
182
34
|
)
|
|
183
35
|
external
|
|
184
36
|
view
|
|
@@ -15,9 +15,9 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
|
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @notice Contract at `
|
|
19
|
-
* token hash seeds on core contract `
|
|
20
|
-
* `
|
|
18
|
+
* @notice Contract at `hashSeedSetterContract` allowed to assign
|
|
19
|
+
* token hash seeds on core contract `coreContract` for project
|
|
20
|
+
* `projectId`.
|
|
21
21
|
*/
|
|
22
22
|
event HashSeedSetterForProjectUpdated(
|
|
23
23
|
address indexed coreContract,
|
|
@@ -26,7 +26,7 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
|
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* @notice Project with ID `
|
|
29
|
+
* @notice Project with ID `projectId` is is or is not using a hash seed
|
|
30
30
|
* setter contract to assign token hash seeds on core contract.
|
|
31
31
|
*/
|
|
32
32
|
event ProjectUsingHashSeedSetterUpdated(
|
|
@@ -39,15 +39,15 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
|
|
|
39
39
|
* @notice Allows the artist of a project to set the contract that is
|
|
40
40
|
* allowed to assign hash seeds to tokens. Typically, this is expected to
|
|
41
41
|
* be a minter contract, such as `MinterPolyptychV1`.
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
42
|
+
* @param coreContract - the core contract that is being configured
|
|
43
|
+
* @param projectId - the project ID that is being configured
|
|
44
|
+
* @param hashSeedSetterContract - the contract that is allowed to assign
|
|
45
45
|
* hash seeds to tokens
|
|
46
46
|
*/
|
|
47
47
|
function setHashSeedSetterContract(
|
|
48
|
-
address
|
|
49
|
-
uint256
|
|
50
|
-
address
|
|
48
|
+
address coreContract,
|
|
49
|
+
uint256 projectId,
|
|
50
|
+
address hashSeedSetterContract
|
|
51
51
|
) external;
|
|
52
52
|
|
|
53
53
|
/**
|
|
@@ -60,48 +60,48 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
|
|
|
60
60
|
* An example use case is where the artist wants to mint a polyptych panel
|
|
61
61
|
* (second, third, etc.) of a project, and therefore wants to re-use
|
|
62
62
|
* specific hash seeds of the original project.
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
63
|
+
* @param coreContract - The address of the core contract
|
|
64
|
+
* @param projectId - The ID of the project to be toggled
|
|
65
65
|
*/
|
|
66
66
|
function toggleProjectUseAssignedHashSeed(
|
|
67
|
-
address
|
|
68
|
-
uint256
|
|
67
|
+
address coreContract,
|
|
68
|
+
uint256 projectId
|
|
69
69
|
) external;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* @notice Pre-set the hash seed for a token. This function is only
|
|
73
73
|
* callable by the hash seed setter contract of the project.
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
77
|
-
* @dev Only callable by the hash seed setter contract of `
|
|
74
|
+
* @param coreContract - The address of the core contract of `tokenId`
|
|
75
|
+
* @param tokenId - The ID of the token to set the hash seed for
|
|
76
|
+
* @param hashSeed - The hash seed to set for `tokenId`
|
|
77
|
+
* @dev Only callable by the hash seed setter contract of `coreContract`.
|
|
78
78
|
*/
|
|
79
79
|
function preSetHashSeed(
|
|
80
|
-
address
|
|
81
|
-
uint256
|
|
82
|
-
bytes12
|
|
80
|
+
address coreContract,
|
|
81
|
+
uint256 tokenId,
|
|
82
|
+
bytes12 hashSeed
|
|
83
83
|
) external;
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* @notice Boolean representing whether or not project with ID `
|
|
87
|
-
* on core contract `
|
|
86
|
+
* @notice Boolean representing whether or not project with ID `projectId`
|
|
87
|
+
* on core contract `coreContract` is currently using a hash seed setter
|
|
88
88
|
* contract to assign hash seeds to tokens.
|
|
89
89
|
*/
|
|
90
90
|
function projectUsesHashSeedSetter(
|
|
91
|
-
address
|
|
92
|
-
uint256
|
|
93
|
-
) external view returns (bool
|
|
91
|
+
address coreContract,
|
|
92
|
+
uint256 projectId
|
|
93
|
+
) external view returns (bool usingHashSeedSetter);
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Returns the hash seed setter contract for a given core contract.
|
|
97
97
|
* Returns address(0) if no hash seed setter contract is set for the core.
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
98
|
+
* @param coreContract - The address of the core contract
|
|
99
|
+
* @param projectId - The ID of the project to query
|
|
100
100
|
*/
|
|
101
101
|
function hashSeedSetterContracts(
|
|
102
|
-
address
|
|
103
|
-
uint256
|
|
104
|
-
) external view returns (address
|
|
102
|
+
address coreContract,
|
|
103
|
+
uint256 projectId
|
|
104
|
+
) external view returns (address hashSeedSetterContract);
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Returns the current pre-assigned hash seed for a given token ID.
|
|
@@ -112,12 +112,12 @@ interface ISharedRandomizerV0 is IRandomizer_V3CoreBase {
|
|
|
112
112
|
* the hash seed is generated on-chain by the pseudorandom atomic contract
|
|
113
113
|
* and is not stored on-chain in this randomizer contract, and therefore
|
|
114
114
|
* this function will return bytes12(0).
|
|
115
|
-
* @param
|
|
116
|
-
* @param
|
|
117
|
-
* @return
|
|
115
|
+
* @param coreContract - The address of the core contract of `tokenId`
|
|
116
|
+
* @param tokenId - The ID of the token to get the hash seed for
|
|
117
|
+
* @return hashSeed - The stored hash seed for `tokenId`
|
|
118
118
|
*/
|
|
119
119
|
function preAssignedHashSeed(
|
|
120
|
-
address
|
|
121
|
-
uint256
|
|
122
|
-
) external view returns (bytes12
|
|
120
|
+
address coreContract,
|
|
121
|
+
uint256 tokenId
|
|
122
|
+
) external view returns (bytes12 hashSeed);
|
|
123
123
|
}
|
|
@@ -14,42 +14,42 @@ library ABHelpers {
|
|
|
14
14
|
uint256 constant ONE_MILLION = 1_000_000;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param
|
|
17
|
+
* @notice Function to convert token id to project id.
|
|
18
|
+
* @param tokenId The id of the token.
|
|
19
19
|
*/
|
|
20
20
|
function tokenIdToProjectId(
|
|
21
|
-
uint256
|
|
21
|
+
uint256 tokenId
|
|
22
22
|
) internal pure returns (uint256) {
|
|
23
23
|
// int division properly rounds down
|
|
24
24
|
// @dev unchecked because will never divide by zero
|
|
25
25
|
unchecked {
|
|
26
|
-
return
|
|
26
|
+
return tokenId / ONE_MILLION;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param
|
|
31
|
+
* @notice Function to convert token id to token number.
|
|
32
|
+
* @param tokenId The id of the token.
|
|
33
33
|
*/
|
|
34
34
|
function tokenIdToTokenNumber(
|
|
35
|
-
uint256
|
|
35
|
+
uint256 tokenId
|
|
36
36
|
) internal pure returns (uint256) {
|
|
37
37
|
// mod returns remainder, which is the token number
|
|
38
38
|
// @dev no way to disable mod zero check in solidity, so not unchecked
|
|
39
|
-
return
|
|
39
|
+
return tokenId % ONE_MILLION;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
43
|
+
* @notice Function to convert project id and token number to token id.
|
|
44
|
+
* @param projectId The id of the project.
|
|
45
|
+
* @param tokenNumber The token number.
|
|
46
46
|
*/
|
|
47
47
|
function tokenIdFromProjectIdAndTokenNumber(
|
|
48
|
-
uint256
|
|
49
|
-
uint256
|
|
48
|
+
uint256 projectId,
|
|
49
|
+
uint256 tokenNumber
|
|
50
50
|
) internal pure returns (uint256) {
|
|
51
51
|
// @dev intentionally not unchecked to ensure overflow detection, which
|
|
52
52
|
// would likley only occur in a malicious call
|
|
53
|
-
return (
|
|
53
|
+
return (projectId * ONE_MILLION) + tokenNumber;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
pragma solidity ^0.8.0;
|
|
5
5
|
|
|
6
|
-
import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
7
|
-
import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
6
|
+
import {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
|
|
7
|
+
import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @title Art Blocks Authorization Minter Library
|
|
@@ -16,111 +16,110 @@ import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
|
16
16
|
|
|
17
17
|
library AuthLib {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* @notice Function to restrict access to only AdminACL allowed calls, where
|
|
20
20
|
* AdminACL is the admin of an IMinterFilterV1.
|
|
21
21
|
* Reverts if not allowed.
|
|
22
|
-
* @param
|
|
22
|
+
* @param minterFilterAddress address of the minter filter to be checked,
|
|
23
23
|
* should implement IMinterFilterV1
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
24
|
+
* @param sender address of the caller
|
|
25
|
+
* @param contract_ address of the contract being called
|
|
26
|
+
* @param selector selector of the function being called
|
|
27
27
|
*/
|
|
28
28
|
function onlyMinterFilterAdminACL(
|
|
29
|
-
address
|
|
30
|
-
address
|
|
31
|
-
address
|
|
32
|
-
bytes4
|
|
29
|
+
address minterFilterAddress,
|
|
30
|
+
address sender,
|
|
31
|
+
address contract_,
|
|
32
|
+
bytes4 selector
|
|
33
33
|
) internal {
|
|
34
34
|
require(
|
|
35
35
|
_minterFilterAdminACLAllowed({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
minterFilterAddress: minterFilterAddress,
|
|
37
|
+
sender: sender,
|
|
38
|
+
contract_: contract_,
|
|
39
|
+
selector: selector
|
|
40
40
|
}),
|
|
41
41
|
"Only MinterFilter AdminACL"
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Function to restrict access to only AdminACL allowed calls, where
|
|
47
|
-
* AdminACL is the admin of a core contract at `
|
|
46
|
+
* @notice Function to restrict access to only AdminACL allowed calls, where
|
|
47
|
+
* AdminACL is the admin of a core contract at `coreContract`.
|
|
48
48
|
* Reverts if not allowed.
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
49
|
+
* @param coreContract address of the core contract to be checked
|
|
50
|
+
* @param sender address of the caller
|
|
51
|
+
* @param contract_ address of the contract being called
|
|
52
|
+
* @param selector selector of the function being called
|
|
53
53
|
*/
|
|
54
54
|
function onlyCoreAdminACL(
|
|
55
|
-
address
|
|
56
|
-
address
|
|
57
|
-
address
|
|
58
|
-
bytes4
|
|
55
|
+
address coreContract,
|
|
56
|
+
address sender,
|
|
57
|
+
address contract_,
|
|
58
|
+
bytes4 selector
|
|
59
59
|
) internal {
|
|
60
60
|
require(
|
|
61
61
|
_coreAdminACLAllowed({
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
coreContract: coreContract,
|
|
63
|
+
sender: sender,
|
|
64
|
+
contract_: contract_,
|
|
65
|
+
selector: selector
|
|
66
66
|
}),
|
|
67
67
|
"Only Core AdminACL allowed"
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* @notice Throws if `
|
|
73
|
-
* specified project `
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* @param _projectId The ID of the project being checked.
|
|
77
|
-
* @param _coreContract The address of the GenArt721CoreContractV3_Base
|
|
72
|
+
* @notice Throws if `sender` is any account other than the artist of the
|
|
73
|
+
* specified project `projectId` on core contract `coreContract`.
|
|
74
|
+
* @param projectId The ID of the project being checked.
|
|
75
|
+
* @param coreContract The address of the GenArt721CoreContractV3_Base
|
|
78
76
|
* contract.
|
|
79
|
-
* @param
|
|
77
|
+
* @param sender Wallet to check. Typically, the address of the caller.
|
|
78
|
+
* @dev `sender` must be the artist associated with `projectId` on `coreContract`.
|
|
80
79
|
*/
|
|
81
80
|
function onlyArtist(
|
|
82
|
-
uint256
|
|
83
|
-
address
|
|
84
|
-
address
|
|
81
|
+
uint256 projectId,
|
|
82
|
+
address coreContract,
|
|
83
|
+
address sender
|
|
85
84
|
) internal view {
|
|
86
85
|
require(
|
|
87
86
|
_senderIsArtist({
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
projectId: projectId,
|
|
88
|
+
coreContract: coreContract,
|
|
89
|
+
sender: sender
|
|
91
90
|
}),
|
|
92
91
|
"Only Artist"
|
|
93
92
|
);
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
/**
|
|
97
|
-
*
|
|
96
|
+
* @notice Function to restrict access to only the artist of a project, or AdminACL
|
|
98
97
|
* allowed calls, where AdminACL is the admin of a core contract at
|
|
99
|
-
* `
|
|
100
|
-
* @param
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
98
|
+
* `coreContract`.
|
|
99
|
+
* @param projectId id of the project
|
|
100
|
+
* @param coreContract address of the core contract to be checked
|
|
101
|
+
* @param sender address of the caller
|
|
102
|
+
* @param contract_ address of the contract being called
|
|
103
|
+
* @param selector selector of the function being called
|
|
105
104
|
*/
|
|
106
105
|
function onlyCoreAdminACLOrArtist(
|
|
107
|
-
uint256
|
|
108
|
-
address
|
|
109
|
-
address
|
|
110
|
-
address
|
|
111
|
-
bytes4
|
|
106
|
+
uint256 projectId,
|
|
107
|
+
address coreContract,
|
|
108
|
+
address sender,
|
|
109
|
+
address contract_,
|
|
110
|
+
bytes4 selector
|
|
112
111
|
) internal {
|
|
113
112
|
require(
|
|
114
113
|
_senderIsArtist({
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
projectId: projectId,
|
|
115
|
+
coreContract: coreContract,
|
|
116
|
+
sender: sender
|
|
118
117
|
}) ||
|
|
119
118
|
_coreAdminACLAllowed({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
coreContract: coreContract,
|
|
120
|
+
sender: sender,
|
|
121
|
+
contract_: contract_,
|
|
122
|
+
selector: selector
|
|
124
123
|
}),
|
|
125
124
|
"Only Artist or Core Admin ACL"
|
|
126
125
|
);
|
|
@@ -131,67 +130,67 @@ library AuthLib {
|
|
|
131
130
|
// ------------------------------------------------------------------------
|
|
132
131
|
|
|
133
132
|
/**
|
|
134
|
-
* Private function that returns if minter filter contract's AdminACL
|
|
135
|
-
* allows `
|
|
136
|
-
* `
|
|
137
|
-
* @param
|
|
133
|
+
* @notice Private function that returns if minter filter contract's AdminACL
|
|
134
|
+
* allows `sender` to call function with selector `selector` on contract
|
|
135
|
+
* `contract`.
|
|
136
|
+
* @param minterFilterAddress address of the minter filter to be checked.
|
|
138
137
|
* Should implement IMinterFilterV1.
|
|
139
|
-
* @param
|
|
140
|
-
* @param
|
|
141
|
-
* @param
|
|
138
|
+
* @param sender address of the caller
|
|
139
|
+
* @param contract_ address of the contract being called
|
|
140
|
+
* @param selector selector of the function being called
|
|
142
141
|
*/
|
|
143
142
|
function _minterFilterAdminACLAllowed(
|
|
144
|
-
address
|
|
145
|
-
address
|
|
146
|
-
address
|
|
147
|
-
bytes4
|
|
143
|
+
address minterFilterAddress,
|
|
144
|
+
address sender,
|
|
145
|
+
address contract_,
|
|
146
|
+
bytes4 selector
|
|
148
147
|
) private returns (bool) {
|
|
149
148
|
return
|
|
150
|
-
IMinterFilterV1(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
IMinterFilterV1(minterFilterAddress).adminACLAllowed({
|
|
150
|
+
sender: sender,
|
|
151
|
+
contract_: contract_,
|
|
152
|
+
selector: selector
|
|
154
153
|
});
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
/**
|
|
158
|
-
* Private function that returns if core contract's AdminACL allows
|
|
159
|
-
* `
|
|
160
|
-
* `
|
|
161
|
-
* @param
|
|
162
|
-
* @param
|
|
163
|
-
* @param
|
|
164
|
-
* @param
|
|
157
|
+
* @notice Private function that returns if core contract's AdminACL allows
|
|
158
|
+
* `sender` to call function with selector `selector` on contract
|
|
159
|
+
* `contract`.
|
|
160
|
+
* @param coreContract address of the core contract to be checked
|
|
161
|
+
* @param sender address of the caller
|
|
162
|
+
* @param contract_ address of the contract being called
|
|
163
|
+
* @param selector selector of the function being called
|
|
165
164
|
*/
|
|
166
165
|
function _coreAdminACLAllowed(
|
|
167
|
-
address
|
|
168
|
-
address
|
|
169
|
-
address
|
|
170
|
-
bytes4
|
|
166
|
+
address coreContract,
|
|
167
|
+
address sender,
|
|
168
|
+
address contract_,
|
|
169
|
+
bytes4 selector
|
|
171
170
|
) private returns (bool) {
|
|
172
171
|
return
|
|
173
|
-
IGenArt721CoreContractV3_Base(
|
|
174
|
-
_sender:
|
|
175
|
-
_contract:
|
|
176
|
-
_selector:
|
|
172
|
+
IGenArt721CoreContractV3_Base(coreContract).adminACLAllowed({
|
|
173
|
+
_sender: sender,
|
|
174
|
+
_contract: contract_,
|
|
175
|
+
_selector: selector
|
|
177
176
|
});
|
|
178
177
|
}
|
|
179
178
|
|
|
180
179
|
/**
|
|
181
|
-
* Private function that returns if `
|
|
182
|
-
* on `
|
|
183
|
-
* @param
|
|
184
|
-
* @param
|
|
185
|
-
* @param
|
|
180
|
+
* @notice Private function that returns if `sender` is the artist of `projectId`
|
|
181
|
+
* on `coreContract`.
|
|
182
|
+
* @param projectId project ID to check
|
|
183
|
+
* @param coreContract core contract to check
|
|
184
|
+
* @param sender wallet to check
|
|
186
185
|
*/
|
|
187
186
|
function _senderIsArtist(
|
|
188
|
-
uint256
|
|
189
|
-
address
|
|
190
|
-
address
|
|
187
|
+
uint256 projectId,
|
|
188
|
+
address coreContract,
|
|
189
|
+
address sender
|
|
191
190
|
) private view returns (bool senderIsArtist) {
|
|
192
191
|
return
|
|
193
|
-
|
|
194
|
-
IGenArt721CoreContractV3_Base(
|
|
195
|
-
.projectIdToArtistAddress(
|
|
192
|
+
sender ==
|
|
193
|
+
IGenArt721CoreContractV3_Base(coreContract)
|
|
194
|
+
.projectIdToArtistAddress(projectId);
|
|
196
195
|
}
|
|
197
196
|
}
|