@artblocks/contracts 1.0.1 → 1.0.2
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/.env.example +8 -1
- package/README.md +42 -157
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +2 -2
- package/artifacts/contracts/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +2229 -0
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV2.sol/MinterDAExpV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExp/MinterDAExpV3.sol/MinterDAExpV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV0.sol/MinterDAExpSettlementV0.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDAExpSettlement/MinterDAExpSettlementV1.sol/MinterDAExpSettlementV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV2.sol/MinterDALinV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterDALin/MinterDALinV3.sol/MinterDALinV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV1.sol/MinterHolderV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV2.sol/MinterHolderV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterHolder/MinterHolderV3.sol/MinterHolderV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV1.sol/MinterMerkleV1.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV2.sol/MinterMerkleV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV3.sol/MinterMerkleV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterMerkle/MinterMerkleV4.sol/MinterMerkleV4.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV2.sol/MinterSetPriceV2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPrice/MinterSetPriceV3.sol/MinterSetPriceV3.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V2.sol/MinterSetPriceERC20V2.json +2 -2
- package/artifacts/contracts/archive/minter-suite/Minters/MinterSetPriceERC20/MinterSetPriceERC20V3.sol/MinterSetPriceERC20V3.json +2 -2
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +2 -2
- package/artifacts/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol/IFilteredMinterSEAV0.json +1032 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3.sol/IGenArt721CoreContractV3.json +149 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol/IGenArt721CoreContractV3_Base.json +149 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol/IGenArt721CoreContractV3_Engine.json +130 -0
- package/artifacts/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol/IGenArt721CoreContractV3_Engine_Flex.json +1066 -0
- package/artifacts/contracts/interfaces/0.8.x/IWETH.sol/IWETH.json +55 -0
- package/artifacts/contracts/libs/integration-refs/weth9/weth9.sol/WETH9_.json +295 -0
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV4.sol/MinterDAExpV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV4.sol/MinterDALinV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterHolderV4.sol/MinterHolderV4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterMerkleV5.sol/MinterMerkleV5.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/IGenArt721CoreContractV3WithRandomizer.json +130 -0
- package/artifacts/contracts/minter-suite/Minters/MinterPolyptychV0.sol/MinterPolyptychV0.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV0.sol/MinterSEAV0.json +1310 -0
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol/MinterSetPriceERC20V4.json +2 -2
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV4.sol/MinterSetPriceV4.json +2 -2
- package/artifacts/contracts/mock/DeadReceiverBidderMock.sol/DeadReceiverBidderMock.json +33 -0
- package/artifacts/contracts/mock/GasLimitReceiverBidderMock.sol/GasLimitReceiverBidderMock.json +46 -0
- package/artifacts/contracts/mock/GasLimitReceiverMock.sol/GasLimitReceiverMock.json +28 -0
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +2 -2
- package/artifacts/contracts/mock/RandomizerV2_NoAssignMock.sol/RandomizerV2_NoAssignMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancySEAMock.sol/ReentrancySEAAutoBidderMock.json +51 -0
- package/artifacts/contracts/{BasicRandomizer.sol → randomizer/BasicRandomizer.sol}/BasicRandomizer.json +3 -3
- package/artifacts/contracts/randomizer/BasicRandomizerBase_v0_0_0.sol/RandomizerBase.json +10 -0
- package/artifacts/contracts/randomizer/PolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +229 -0
- package/artifacts/contracts/randomizer/RandomizerV2.sol/BasicRandomizerV2.json +102 -0
- package/artifacts/contracts/royalty-registry/GenArt721RoyaltyOverride.sol/GenArt721RoyaltyOverride.json +2 -2
- package/contracts/DependencyRegistryV0.sol +74 -113
- package/contracts/GenArt721CoreV3.sol +124 -171
- package/contracts/GenArt721CoreV3_Engine.sol +136 -198
- package/contracts/GenArt721CoreV3_Engine_Flex.sol +2274 -0
- package/contracts/explorations/GenArt721CoreV3_Explorations.sol +147 -176
- package/contracts/interfaces/0.8.x/IFilteredMinterSEAV0.sol +145 -0
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Base.sol +39 -0
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine.sol +0 -3
- package/contracts/interfaces/0.8.x/IGenArt721CoreContractV3_Engine_Flex.sol +132 -0
- package/contracts/interfaces/0.8.x/IWETH.sol +11 -0
- package/contracts/libs/integration-refs/weth9/weth9.sol +763 -0
- package/contracts/minter-suite/MinterFilter/MinterFilterV1.sol +35 -47
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +26 -34
- package/contracts/minter-suite/Minters/MinterDAExpV4.sol +16 -21
- package/contracts/minter-suite/Minters/MinterDALinV4.sol +15 -17
- package/contracts/minter-suite/Minters/MinterHolderV4.sol +19 -19
- package/contracts/minter-suite/Minters/MinterMerkleV5.sol +13 -15
- package/contracts/minter-suite/Minters/MinterPolyptychV0.sol +23 -23
- package/contracts/minter-suite/Minters/MinterSEAV0.sol +1224 -0
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V4.sol +11 -11
- package/contracts/minter-suite/Minters/MinterSetPriceV4.sol +9 -10
- package/contracts/mock/DeadReceiverBidderMock.sol +23 -0
- package/contracts/mock/GasLimitReceiverBidderMock.sol +23 -0
- package/contracts/mock/GasLimitReceiverMock.sol +19 -0
- package/contracts/mock/RandomizerV2_NoAssignMock.sol +2 -11
- package/contracts/mock/ReentrancySEAMock.sol +36 -0
- package/contracts/{BasicRandomizer.sol → randomizer/BasicRandomizer.sol} +1 -1
- package/contracts/randomizer/BasicRandomizerBase_v0_0_0.sol +23 -0
- package/contracts/{BasicPolyptychRandomizerV0.sol → randomizer/PolyptychRandomizerV0.sol} +19 -28
- package/contracts/{BasicRandomizerV2.sol → randomizer/RandomizerV2.sol} +5 -13
- package/package.json +27 -14
- package/artifacts/contracts/BasicPolyptychRandomizerV0.sol/BasicPolyptychRandomizerV0.json +0 -229
- package/artifacts/contracts/BasicRandomizerV2.sol/BasicRandomizerV2.json +0 -102
|
@@ -27,8 +27,8 @@ pragma solidity 0.8.17;
|
|
|
27
27
|
* ----------------------------------------------------------------------------
|
|
28
28
|
* The following functions are restricted to the core contract's Admin ACL
|
|
29
29
|
* contract:
|
|
30
|
-
* -
|
|
31
|
-
* -
|
|
30
|
+
* - addApprovedMinter
|
|
31
|
+
* - removeApprovedMinter
|
|
32
32
|
* - removeMintersForProjects
|
|
33
33
|
* ----------------------------------------------------------------------------
|
|
34
34
|
* The following functions are restricted to the core contract's Admin ACL
|
|
@@ -72,45 +72,43 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
72
72
|
/// minter address => is an approved minter?
|
|
73
73
|
mapping(address => bool) public isApprovedMinter;
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
function _onlyNonZeroAddress(address _address) internal pure {
|
|
76
76
|
require(_address != address(0), "Must input non-zero address");
|
|
77
|
-
_;
|
|
78
77
|
}
|
|
79
78
|
|
|
80
|
-
//
|
|
79
|
+
// function to restrict access to only AdminACL allowed calls
|
|
81
80
|
// @dev defers which ACL contract is used to the core contract
|
|
82
|
-
|
|
81
|
+
function _onlyCoreAdminACL(bytes4 _selector) internal {
|
|
83
82
|
require(_coreAdminACLAllowed(_selector), "Only Core AdminACL allowed");
|
|
84
|
-
_;
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
//
|
|
85
|
+
// function to restrict access to only the artist of `_projectId`, or
|
|
88
86
|
// AdminACL allowed calls
|
|
89
87
|
// @dev defers which ACL contract is used to the core contract
|
|
90
|
-
|
|
88
|
+
function _onlyCoreAdminACLOrArtist(
|
|
89
|
+
uint256 _projectId,
|
|
90
|
+
bytes4 _selector
|
|
91
|
+
) internal {
|
|
91
92
|
require(
|
|
92
93
|
msg.sender ==
|
|
93
94
|
genArtCoreContract.projectIdToArtistAddress(_projectId) ||
|
|
94
95
|
_coreAdminACLAllowed(_selector),
|
|
95
96
|
"Only Core AdminACL or Artist"
|
|
96
97
|
);
|
|
97
|
-
_;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
function _onlyValidProjectId(uint256 _projectId) internal view {
|
|
101
101
|
require(
|
|
102
102
|
_projectId < genArtCoreContract.nextProjectId(),
|
|
103
103
|
"Only existing projects"
|
|
104
104
|
);
|
|
105
|
-
_;
|
|
106
105
|
}
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
function _usingApprovedMinter(address _minterAddress) internal view {
|
|
109
108
|
require(
|
|
110
109
|
isApprovedMinter[_minterAddress],
|
|
111
110
|
"Only approved minters are allowed"
|
|
112
111
|
);
|
|
113
|
-
_;
|
|
114
112
|
}
|
|
115
113
|
|
|
116
114
|
/**
|
|
@@ -118,9 +116,8 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
118
116
|
* @param _genArt721Address Art Blocks core contract address
|
|
119
117
|
* this contract will be a minter for. Can never be updated.
|
|
120
118
|
*/
|
|
121
|
-
constructor(
|
|
122
|
-
|
|
123
|
-
) onlyNonZeroAddress(_genArt721Address) {
|
|
119
|
+
constructor(address _genArt721Address) {
|
|
120
|
+
_onlyNonZeroAddress(_genArt721Address);
|
|
124
121
|
genArt721CoreAddress = _genArt721Address;
|
|
125
122
|
genArtCoreContract = IGenArt721CoreContractV3(_genArt721Address);
|
|
126
123
|
emit Deployed();
|
|
@@ -144,13 +141,9 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
144
141
|
* @notice Approves minter `_minterAddress`.
|
|
145
142
|
* @param _minterAddress Minter to be added as an approved minter.
|
|
146
143
|
*/
|
|
147
|
-
function addApprovedMinter(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
external
|
|
151
|
-
onlyCoreAdminACL(this.addApprovedMinter.selector)
|
|
152
|
-
onlyNonZeroAddress(_minterAddress)
|
|
153
|
-
{
|
|
144
|
+
function addApprovedMinter(address _minterAddress) external {
|
|
145
|
+
_onlyCoreAdminACL(this.addApprovedMinter.selector);
|
|
146
|
+
_onlyNonZeroAddress(_minterAddress);
|
|
154
147
|
isApprovedMinter[_minterAddress] = true;
|
|
155
148
|
emit MinterApproved(
|
|
156
149
|
_minterAddress,
|
|
@@ -162,9 +155,8 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
162
155
|
* @notice Removes previously approved minter `_minterAddress`.
|
|
163
156
|
* @param _minterAddress Minter to remove.
|
|
164
157
|
*/
|
|
165
|
-
function removeApprovedMinter(
|
|
166
|
-
|
|
167
|
-
) external onlyCoreAdminACL(this.removeApprovedMinter.selector) {
|
|
158
|
+
function removeApprovedMinter(address _minterAddress) external {
|
|
159
|
+
_onlyCoreAdminACL(this.removeApprovedMinter.selector);
|
|
168
160
|
require(isApprovedMinter[_minterAddress], "Only approved minters");
|
|
169
161
|
require(
|
|
170
162
|
numProjectsUsingMinter[_minterAddress] == 0,
|
|
@@ -183,12 +175,13 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
183
175
|
function setMinterForProject(
|
|
184
176
|
uint256 _projectId,
|
|
185
177
|
address _minterAddress
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
) external {
|
|
179
|
+
_onlyCoreAdminACLOrArtist(
|
|
180
|
+
_projectId,
|
|
181
|
+
this.setMinterForProject.selector
|
|
182
|
+
);
|
|
183
|
+
_usingApprovedMinter(_minterAddress);
|
|
184
|
+
_onlyValidProjectId(_projectId);
|
|
192
185
|
// decrement number of projects using a previous minter
|
|
193
186
|
(bool hasPreviousMinter, address previousMinter) = minterForProject
|
|
194
187
|
.tryGet(_projectId);
|
|
@@ -210,15 +203,11 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
210
203
|
* @param _projectId Project ID to remove minter.
|
|
211
204
|
* @dev requires project to have an assigned minter
|
|
212
205
|
*/
|
|
213
|
-
function removeMinterForProject(
|
|
214
|
-
|
|
215
|
-
)
|
|
216
|
-
external
|
|
217
|
-
onlyCoreAdminACLOrArtist(
|
|
206
|
+
function removeMinterForProject(uint256 _projectId) external {
|
|
207
|
+
_onlyCoreAdminACLOrArtist(
|
|
218
208
|
_projectId,
|
|
219
209
|
this.removeMinterForProject.selector
|
|
220
|
-
)
|
|
221
|
-
{
|
|
210
|
+
);
|
|
222
211
|
_removeMinterForProject(_projectId);
|
|
223
212
|
}
|
|
224
213
|
|
|
@@ -228,9 +217,8 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
228
217
|
* @dev requires all project IDs to have an assigned minter
|
|
229
218
|
* @dev caution with respect to single tx gas limits
|
|
230
219
|
*/
|
|
231
|
-
function removeMintersForProjects(
|
|
232
|
-
|
|
233
|
-
) external onlyCoreAdminACL(this.removeMintersForProjects.selector) {
|
|
220
|
+
function removeMintersForProjects(uint256[] calldata _projectIds) external {
|
|
221
|
+
_onlyCoreAdminACL(this.removeMintersForProjects.selector);
|
|
234
222
|
uint256 numProjects = _projectIds.length;
|
|
235
223
|
for (uint256 i; i < numProjects; i++) {
|
|
236
224
|
_removeMinterForProject(_projectIds[i]);
|
|
@@ -283,7 +271,8 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
283
271
|
*/
|
|
284
272
|
function getMinterForProject(
|
|
285
273
|
uint256 _projectId
|
|
286
|
-
) external view
|
|
274
|
+
) external view returns (address) {
|
|
275
|
+
_onlyValidProjectId(_projectId);
|
|
287
276
|
(bool _hasMinter, address _currentMinter) = minterForProject.tryGet(
|
|
288
277
|
_projectId
|
|
289
278
|
);
|
|
@@ -296,9 +285,8 @@ contract MinterFilterV1 is IMinterFilterV0 {
|
|
|
296
285
|
* @param _projectId Project ID to query.
|
|
297
286
|
* @return bool true if project has an assigned minter, else false
|
|
298
287
|
*/
|
|
299
|
-
function projectHasMinter(
|
|
300
|
-
|
|
301
|
-
) external view onlyValidProjectId(_projectId) returns (bool) {
|
|
288
|
+
function projectHasMinter(uint256 _projectId) external view returns (bool) {
|
|
289
|
+
_onlyValidProjectId(_projectId);
|
|
302
290
|
(bool _hasMinter, ) = minterForProject.tryGet(_projectId);
|
|
303
291
|
return _hasMinter;
|
|
304
292
|
}
|
|
@@ -144,8 +144,11 @@ contract MinterDAExpSettlementV2 is
|
|
|
144
144
|
/// user address => project ID => receipt
|
|
145
145
|
mapping(address => mapping(uint256 => Receipt)) receipts;
|
|
146
146
|
|
|
147
|
-
//
|
|
148
|
-
|
|
147
|
+
// function to restrict access to only AdminACL or the artist
|
|
148
|
+
function _onlyCoreAdminACLOrArtist(
|
|
149
|
+
uint256 _projectId,
|
|
150
|
+
bytes4 _selector
|
|
151
|
+
) internal {
|
|
149
152
|
require(
|
|
150
153
|
(msg.sender ==
|
|
151
154
|
genArtCoreContract_Base.projectIdToArtistAddress(_projectId)) ||
|
|
@@ -158,12 +161,11 @@ contract MinterDAExpSettlementV2 is
|
|
|
158
161
|
),
|
|
159
162
|
"Only Artist or Admin ACL"
|
|
160
163
|
);
|
|
161
|
-
_;
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
//
|
|
166
|
+
// function to restrict access to only AdminACL allowed calls
|
|
165
167
|
// @dev defers which ACL contract is used to the core contract
|
|
166
|
-
|
|
168
|
+
function _onlyCoreAdminACL(bytes4 _selector) internal {
|
|
167
169
|
require(
|
|
168
170
|
genArtCoreContract_Base.adminACLAllowed(
|
|
169
171
|
msg.sender,
|
|
@@ -172,16 +174,14 @@ contract MinterDAExpSettlementV2 is
|
|
|
172
174
|
),
|
|
173
175
|
"Only Core AdminACL allowed"
|
|
174
176
|
);
|
|
175
|
-
_;
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
179
180
|
require(
|
|
180
181
|
(msg.sender ==
|
|
181
182
|
genArtCoreContract_Base.projectIdToArtistAddress(_projectId)),
|
|
182
183
|
"Only Artist"
|
|
183
184
|
);
|
|
184
|
-
_;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/**
|
|
@@ -220,9 +220,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
220
220
|
* @param _projectId Project ID to set the maximum invocations for.
|
|
221
221
|
* @dev This function is included for interface conformance purposes only.
|
|
222
222
|
*/
|
|
223
|
-
function setProjectMaxInvocations(
|
|
224
|
-
|
|
225
|
-
) external view onlyArtist(_projectId) {
|
|
223
|
+
function setProjectMaxInvocations(uint256 _projectId) external view {
|
|
224
|
+
_onlyArtist(_projectId);
|
|
226
225
|
revert("Not implemented");
|
|
227
226
|
}
|
|
228
227
|
|
|
@@ -240,7 +239,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
240
239
|
function manuallyLimitProjectMaxInvocations(
|
|
241
240
|
uint256 _projectId,
|
|
242
241
|
uint256 _maxInvocations
|
|
243
|
-
) external
|
|
242
|
+
) external {
|
|
243
|
+
_onlyArtist(_projectId);
|
|
244
244
|
// CHECKS
|
|
245
245
|
// require that new maxInvocations is greater than 0 to prevent
|
|
246
246
|
// accidental premature closure of a project when artist is
|
|
@@ -288,9 +288,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
288
288
|
* @notice Warning: Disabling purchaseTo is not supported on this minter.
|
|
289
289
|
* This method exists purely for interface-conformance purposes.
|
|
290
290
|
*/
|
|
291
|
-
function togglePurchaseToDisabled(
|
|
292
|
-
|
|
293
|
-
) external view onlyArtist(_projectId) {
|
|
291
|
+
function togglePurchaseToDisabled(uint256 _projectId) external view {
|
|
292
|
+
_onlyArtist(_projectId);
|
|
294
293
|
revert("Action not supported");
|
|
295
294
|
}
|
|
296
295
|
|
|
@@ -355,12 +354,10 @@ contract MinterDAExpSettlementV2 is
|
|
|
355
354
|
function setAllowablePriceDecayHalfLifeRangeSeconds(
|
|
356
355
|
uint256 _minimumPriceDecayHalfLifeSeconds,
|
|
357
356
|
uint256 _maximumPriceDecayHalfLifeSeconds
|
|
358
|
-
)
|
|
359
|
-
|
|
360
|
-
onlyCoreAdminACL(
|
|
357
|
+
) external {
|
|
358
|
+
_onlyCoreAdminACL(
|
|
361
359
|
this.setAllowablePriceDecayHalfLifeRangeSeconds.selector
|
|
362
|
-
)
|
|
363
|
-
{
|
|
360
|
+
);
|
|
364
361
|
require(
|
|
365
362
|
_maximumPriceDecayHalfLifeSeconds >
|
|
366
363
|
_minimumPriceDecayHalfLifeSeconds,
|
|
@@ -410,7 +407,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
410
407
|
uint256 _priceDecayHalfLifeSeconds,
|
|
411
408
|
uint256 _startPrice,
|
|
412
409
|
uint256 _basePrice
|
|
413
|
-
) external
|
|
410
|
+
) external {
|
|
411
|
+
_onlyArtist(_projectId);
|
|
414
412
|
// CHECKS
|
|
415
413
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
416
414
|
require(
|
|
@@ -485,9 +483,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
485
483
|
* surpass (payments - excess_settlement_funds) for a given project.
|
|
486
484
|
* @param _projectId Project ID to set auction details for.
|
|
487
485
|
*/
|
|
488
|
-
function resetAuctionDetails(
|
|
489
|
-
|
|
490
|
-
) external onlyCoreAdminACL(this.resetAuctionDetails.selector) {
|
|
486
|
+
function resetAuctionDetails(uint256 _projectId) external {
|
|
487
|
+
_onlyCoreAdminACL(this.resetAuctionDetails.selector);
|
|
491
488
|
// CHECKS
|
|
492
489
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
493
490
|
require(_projectConfig.startPrice != 0, "Auction must be configured");
|
|
@@ -527,10 +524,8 @@ contract MinterDAExpSettlementV2 is
|
|
|
527
524
|
function adminEmergencyReduceSelloutPrice(
|
|
528
525
|
uint256 _projectId,
|
|
529
526
|
uint256 _newSelloutPrice
|
|
530
|
-
)
|
|
531
|
-
|
|
532
|
-
onlyCoreAdminACL(this.adminEmergencyReduceSelloutPrice.selector)
|
|
533
|
-
{
|
|
527
|
+
) external {
|
|
528
|
+
_onlyCoreAdminACL(this.adminEmergencyReduceSelloutPrice.selector);
|
|
534
529
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
535
530
|
require(
|
|
536
531
|
!_projectConfig.auctionRevenuesCollected,
|
|
@@ -576,14 +571,11 @@ contract MinterDAExpSettlementV2 is
|
|
|
576
571
|
*/
|
|
577
572
|
function withdrawArtistAndAdminRevenues(
|
|
578
573
|
uint256 _projectId
|
|
579
|
-
)
|
|
580
|
-
|
|
581
|
-
nonReentrant
|
|
582
|
-
onlyCoreAdminACLOrArtist(
|
|
574
|
+
) external nonReentrant {
|
|
575
|
+
_onlyCoreAdminACLOrArtist(
|
|
583
576
|
_projectId,
|
|
584
577
|
this.withdrawArtistAndAdminRevenues.selector
|
|
585
|
-
)
|
|
586
|
-
{
|
|
578
|
+
);
|
|
587
579
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
588
580
|
// CHECKS
|
|
589
581
|
// require revenues to not have already been collected
|
|
@@ -91,9 +91,9 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
91
91
|
/// more than this amount (may cut in half at no more than every N seconds).
|
|
92
92
|
uint256 public maximumPriceDecayHalfLifeSeconds = 3600; // 60 minutes
|
|
93
93
|
|
|
94
|
-
//
|
|
94
|
+
// function to restrict access to only AdminACL allowed calls
|
|
95
95
|
// @dev defers which ACL contract is used to the core contract
|
|
96
|
-
|
|
96
|
+
function _onlyCoreAdminACL(bytes4 _selector) internal {
|
|
97
97
|
require(
|
|
98
98
|
genArtCoreContract_Base.adminACLAllowed(
|
|
99
99
|
msg.sender,
|
|
@@ -102,16 +102,14 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
102
102
|
),
|
|
103
103
|
"Only Core AdminACL allowed"
|
|
104
104
|
);
|
|
105
|
-
_;
|
|
106
105
|
}
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
109
108
|
require(
|
|
110
109
|
(msg.sender ==
|
|
111
110
|
genArtCoreContract_Base.projectIdToArtistAddress(_projectId)),
|
|
112
111
|
"Only Artist"
|
|
113
112
|
);
|
|
114
|
-
_;
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
/**
|
|
@@ -148,9 +146,8 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
148
146
|
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
149
147
|
* core contracts shall still enforce a maxInvocation check during mint.
|
|
150
148
|
*/
|
|
151
|
-
function setProjectMaxInvocations(
|
|
152
|
-
|
|
153
|
-
) public onlyArtist(_projectId) {
|
|
149
|
+
function setProjectMaxInvocations(uint256 _projectId) public {
|
|
150
|
+
_onlyArtist(_projectId);
|
|
154
151
|
uint256 maxInvocations;
|
|
155
152
|
uint256 invocations;
|
|
156
153
|
(invocations, maxInvocations, , , , ) = genArtCoreContract_Base
|
|
@@ -183,7 +180,8 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
183
180
|
function manuallyLimitProjectMaxInvocations(
|
|
184
181
|
uint256 _projectId,
|
|
185
182
|
uint256 _maxInvocations
|
|
186
|
-
) external
|
|
183
|
+
) external {
|
|
184
|
+
_onlyArtist(_projectId);
|
|
187
185
|
// CHECKS
|
|
188
186
|
// ensure that the manually set maxInvocations is not greater than what is set on the core contract
|
|
189
187
|
uint256 maxInvocations;
|
|
@@ -213,9 +211,8 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
213
211
|
* @notice Warning: Disabling purchaseTo is not supported on this minter.
|
|
214
212
|
* This method exists purely for interface-conformance purposes.
|
|
215
213
|
*/
|
|
216
|
-
function togglePurchaseToDisabled(
|
|
217
|
-
|
|
218
|
-
) external view onlyArtist(_projectId) {
|
|
214
|
+
function togglePurchaseToDisabled(uint256 _projectId) external view {
|
|
215
|
+
_onlyArtist(_projectId);
|
|
219
216
|
revert("Action not supported");
|
|
220
217
|
}
|
|
221
218
|
|
|
@@ -298,12 +295,10 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
298
295
|
function setAllowablePriceDecayHalfLifeRangeSeconds(
|
|
299
296
|
uint256 _minimumPriceDecayHalfLifeSeconds,
|
|
300
297
|
uint256 _maximumPriceDecayHalfLifeSeconds
|
|
301
|
-
)
|
|
302
|
-
|
|
303
|
-
onlyCoreAdminACL(
|
|
298
|
+
) external {
|
|
299
|
+
_onlyCoreAdminACL(
|
|
304
300
|
this.setAllowablePriceDecayHalfLifeRangeSeconds.selector
|
|
305
|
-
)
|
|
306
|
-
{
|
|
301
|
+
);
|
|
307
302
|
require(
|
|
308
303
|
_maximumPriceDecayHalfLifeSeconds >
|
|
309
304
|
_minimumPriceDecayHalfLifeSeconds,
|
|
@@ -339,7 +334,8 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
339
334
|
uint256 _priceDecayHalfLifeSeconds,
|
|
340
335
|
uint256 _startPrice,
|
|
341
336
|
uint256 _basePrice
|
|
342
|
-
) external
|
|
337
|
+
) external {
|
|
338
|
+
_onlyArtist(_projectId);
|
|
343
339
|
// CHECKS
|
|
344
340
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
345
341
|
require(
|
|
@@ -393,9 +389,8 @@ contract MinterDAExpV4 is ReentrancyGuard, MinterBase, IFilteredMinterDAExpV1 {
|
|
|
393
389
|
* operation, but rather only in case of the need to halt an auction.
|
|
394
390
|
* @param _projectId Project ID to set auction details for.
|
|
395
391
|
*/
|
|
396
|
-
function resetAuctionDetails(
|
|
397
|
-
|
|
398
|
-
) external onlyCoreAdminACL(this.resetAuctionDetails.selector) {
|
|
392
|
+
function resetAuctionDetails(uint256 _projectId) external {
|
|
393
|
+
_onlyCoreAdminACL(this.resetAuctionDetails.selector);
|
|
399
394
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
400
395
|
// reset to initial values
|
|
401
396
|
_projectConfig.timestampStart = 0;
|
|
@@ -87,9 +87,9 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
87
87
|
/// Minimum auction length in seconds
|
|
88
88
|
uint256 public minimumAuctionLengthSeconds = 3600;
|
|
89
89
|
|
|
90
|
-
//
|
|
90
|
+
// function to restrict access to only AdminACL allowed calls
|
|
91
91
|
// @dev defers which ACL contract is used to the core contract
|
|
92
|
-
|
|
92
|
+
function _onlyCoreAdminACL(bytes4 _selector) internal {
|
|
93
93
|
require(
|
|
94
94
|
genArtCoreContract_Base.adminACLAllowed(
|
|
95
95
|
msg.sender,
|
|
@@ -98,16 +98,14 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
98
98
|
),
|
|
99
99
|
"Only Core AdminACL allowed"
|
|
100
100
|
);
|
|
101
|
-
_;
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
|
|
103
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
105
104
|
require(
|
|
106
105
|
(msg.sender ==
|
|
107
106
|
genArtCoreContract_Base.projectIdToArtistAddress(_projectId)),
|
|
108
107
|
"Only Artist"
|
|
109
108
|
);
|
|
110
|
-
_;
|
|
111
109
|
}
|
|
112
110
|
|
|
113
111
|
/**
|
|
@@ -144,9 +142,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
144
142
|
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
145
143
|
* core contracts shall still enforce a maxInvocation check during mint.
|
|
146
144
|
*/
|
|
147
|
-
function setProjectMaxInvocations(
|
|
148
|
-
|
|
149
|
-
) public onlyArtist(_projectId) {
|
|
145
|
+
function setProjectMaxInvocations(uint256 _projectId) public {
|
|
146
|
+
_onlyArtist(_projectId);
|
|
150
147
|
uint256 maxInvocations;
|
|
151
148
|
uint256 invocations;
|
|
152
149
|
(invocations, maxInvocations, , , , ) = genArtCoreContract_Base
|
|
@@ -178,7 +175,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
178
175
|
function manuallyLimitProjectMaxInvocations(
|
|
179
176
|
uint256 _projectId,
|
|
180
177
|
uint256 _maxInvocations
|
|
181
|
-
) external
|
|
178
|
+
) external {
|
|
179
|
+
_onlyArtist(_projectId);
|
|
182
180
|
// CHECKS
|
|
183
181
|
// ensure that the manually set maxInvocations is not greater than what is set on the core contract
|
|
184
182
|
uint256 maxInvocations;
|
|
@@ -207,9 +205,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
207
205
|
* @notice Warning: Disabling purchaseTo is not supported on this minter.
|
|
208
206
|
* This method exists purely for interface-conformance purposes.
|
|
209
207
|
*/
|
|
210
|
-
function togglePurchaseToDisabled(
|
|
211
|
-
|
|
212
|
-
) external view onlyArtist(_projectId) {
|
|
208
|
+
function togglePurchaseToDisabled(uint256 _projectId) external view {
|
|
209
|
+
_onlyArtist(_projectId);
|
|
213
210
|
revert("Action not supported");
|
|
214
211
|
}
|
|
215
212
|
|
|
@@ -287,7 +284,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
287
284
|
*/
|
|
288
285
|
function setMinimumAuctionLengthSeconds(
|
|
289
286
|
uint256 _minimumAuctionLengthSeconds
|
|
290
|
-
) external
|
|
287
|
+
) external {
|
|
288
|
+
_onlyCoreAdminACL(this.setMinimumAuctionLengthSeconds.selector);
|
|
291
289
|
minimumAuctionLengthSeconds = _minimumAuctionLengthSeconds;
|
|
292
290
|
emit MinimumAuctionLengthSecondsUpdated(_minimumAuctionLengthSeconds);
|
|
293
291
|
}
|
|
@@ -309,7 +307,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
309
307
|
uint256 _auctionTimestampEnd,
|
|
310
308
|
uint256 _startPrice,
|
|
311
309
|
uint256 _basePrice
|
|
312
|
-
) external
|
|
310
|
+
) external {
|
|
311
|
+
_onlyArtist(_projectId);
|
|
313
312
|
// CHECKS
|
|
314
313
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
315
314
|
require(
|
|
@@ -364,9 +363,8 @@ contract MinterDALinV4 is ReentrancyGuard, MinterBase, IFilteredMinterDALinV1 {
|
|
|
364
363
|
* operation, but rather only in case of the need to halt an auction.
|
|
365
364
|
* @param _projectId Project ID to set auction details for.
|
|
366
365
|
*/
|
|
367
|
-
function resetAuctionDetails(
|
|
368
|
-
|
|
369
|
-
) external onlyCoreAdminACL(this.resetAuctionDetails.selector) {
|
|
366
|
+
function resetAuctionDetails(uint256 _projectId) external {
|
|
367
|
+
_onlyCoreAdminACL(this.resetAuctionDetails.selector);
|
|
370
368
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
371
369
|
// reset to initial values
|
|
372
370
|
_projectConfig.timestampStart = 0;
|
|
@@ -113,9 +113,9 @@ contract MinterHolderV4 is
|
|
|
113
113
|
mapping(uint256 => mapping(address => mapping(uint256 => bool)))
|
|
114
114
|
public allowedProjectHolders;
|
|
115
115
|
|
|
116
|
-
//
|
|
116
|
+
// function to restrict access to only AdminACL allowed calls
|
|
117
117
|
// @dev defers which ACL contract is used to the core contract
|
|
118
|
-
|
|
118
|
+
function _onlyCoreAdminACL(bytes4 _selector) internal {
|
|
119
119
|
require(
|
|
120
120
|
genArtCoreContract_Base.adminACLAllowed(
|
|
121
121
|
msg.sender,
|
|
@@ -124,16 +124,14 @@ contract MinterHolderV4 is
|
|
|
124
124
|
),
|
|
125
125
|
"Only Core AdminACL allowed"
|
|
126
126
|
);
|
|
127
|
-
_;
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
|
|
129
|
+
function _onlyArtist(uint256 _projectId) internal view {
|
|
131
130
|
require(
|
|
132
131
|
msg.sender ==
|
|
133
132
|
genArtCoreContract_Base.projectIdToArtistAddress(_projectId),
|
|
134
133
|
"Only Artist"
|
|
135
134
|
);
|
|
136
|
-
_;
|
|
137
135
|
}
|
|
138
136
|
|
|
139
137
|
/**
|
|
@@ -177,9 +175,8 @@ contract MinterHolderV4 is
|
|
|
177
175
|
* `projectId = tokenId / 1_000_000`
|
|
178
176
|
* @param _NFTAddress NFT core address to be registered.
|
|
179
177
|
*/
|
|
180
|
-
function registerNFTAddress(
|
|
181
|
-
|
|
182
|
-
) external onlyCoreAdminACL(this.registerNFTAddress.selector) {
|
|
178
|
+
function registerNFTAddress(address _NFTAddress) external {
|
|
179
|
+
_onlyCoreAdminACL(this.registerNFTAddress.selector);
|
|
183
180
|
_registeredNFTAddresses.add(_NFTAddress);
|
|
184
181
|
emit RegisteredNFTAddress(_NFTAddress);
|
|
185
182
|
}
|
|
@@ -190,9 +187,8 @@ contract MinterHolderV4 is
|
|
|
190
187
|
* considered for adding to future allowlists.
|
|
191
188
|
* @param _NFTAddress NFT core address to be unregistered.
|
|
192
189
|
*/
|
|
193
|
-
function unregisterNFTAddress(
|
|
194
|
-
|
|
195
|
-
) external onlyCoreAdminACL(this.unregisterNFTAddress.selector) {
|
|
190
|
+
function unregisterNFTAddress(address _NFTAddress) external {
|
|
191
|
+
_onlyCoreAdminACL(this.unregisterNFTAddress.selector);
|
|
196
192
|
_registeredNFTAddresses.remove(_NFTAddress);
|
|
197
193
|
emit UnregisteredNFTAddress(_NFTAddress);
|
|
198
194
|
}
|
|
@@ -214,7 +210,8 @@ contract MinterHolderV4 is
|
|
|
214
210
|
uint256 _projectId,
|
|
215
211
|
address[] memory _ownedNFTAddresses,
|
|
216
212
|
uint256[] memory _ownedNFTProjectIds
|
|
217
|
-
) public
|
|
213
|
+
) public {
|
|
214
|
+
_onlyArtist(_projectId);
|
|
218
215
|
// require same length arrays
|
|
219
216
|
require(
|
|
220
217
|
_ownedNFTAddresses.length == _ownedNFTProjectIds.length,
|
|
@@ -259,7 +256,8 @@ contract MinterHolderV4 is
|
|
|
259
256
|
uint256 _projectId,
|
|
260
257
|
address[] memory _ownedNFTAddresses,
|
|
261
258
|
uint256[] memory _ownedNFTProjectIds
|
|
262
|
-
) public
|
|
259
|
+
) public {
|
|
260
|
+
_onlyArtist(_projectId);
|
|
263
261
|
// require same length arrays
|
|
264
262
|
require(
|
|
265
263
|
_ownedNFTAddresses.length == _ownedNFTProjectIds.length,
|
|
@@ -314,7 +312,8 @@ contract MinterHolderV4 is
|
|
|
314
312
|
uint256[] memory _ownedNFTProjectIdsAdd,
|
|
315
313
|
address[] memory _ownedNFTAddressesRemove,
|
|
316
314
|
uint256[] memory _ownedNFTProjectIdsRemove
|
|
317
|
-
) external
|
|
315
|
+
) external {
|
|
316
|
+
_onlyArtist(_projectId);
|
|
318
317
|
allowHoldersOfProjects(
|
|
319
318
|
_projectId,
|
|
320
319
|
_ownedNFTAddressesAdd,
|
|
@@ -387,7 +386,8 @@ contract MinterHolderV4 is
|
|
|
387
386
|
function manuallyLimitProjectMaxInvocations(
|
|
388
387
|
uint256 _projectId,
|
|
389
388
|
uint256 _maxInvocations
|
|
390
|
-
) external
|
|
389
|
+
) external {
|
|
390
|
+
_onlyArtist(_projectId);
|
|
391
391
|
// CHECKS
|
|
392
392
|
// ensure that the manually set maxInvocations is not greater than what is set on the core contract
|
|
393
393
|
uint256 maxInvocations;
|
|
@@ -418,9 +418,8 @@ contract MinterHolderV4 is
|
|
|
418
418
|
* @notice Warning: Disabling purchaseTo is not supported on this minter.
|
|
419
419
|
* This method exists purely for interface-conformance purposes.
|
|
420
420
|
*/
|
|
421
|
-
function togglePurchaseToDisabled(
|
|
422
|
-
|
|
423
|
-
) external view onlyArtist(_projectId) {
|
|
421
|
+
function togglePurchaseToDisabled(uint256 _projectId) external view {
|
|
422
|
+
_onlyArtist(_projectId);
|
|
424
423
|
revert("Action not supported");
|
|
425
424
|
}
|
|
426
425
|
|
|
@@ -477,7 +476,8 @@ contract MinterHolderV4 is
|
|
|
477
476
|
function updatePricePerTokenInWei(
|
|
478
477
|
uint256 _projectId,
|
|
479
478
|
uint256 _pricePerTokenInWei
|
|
480
|
-
) external
|
|
479
|
+
) external {
|
|
480
|
+
_onlyArtist(_projectId);
|
|
481
481
|
ProjectConfig storage _projectConfig = projectConfig[_projectId];
|
|
482
482
|
_projectConfig.pricePerTokenInWei = _pricePerTokenInWei;
|
|
483
483
|
_projectConfig.priceIsConfigured = true;
|