@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.
Files changed (120) hide show
  1. package/README.md +2 -2
  2. package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
  3. package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +97 -10
  4. package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +4 -4
  5. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +4 -9
  6. package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +4 -9
  7. package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -9
  8. package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +4 -9
  9. package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
  10. package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +4 -4
  11. package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
  12. package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +19 -0
  13. package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
  14. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +8 -101
  15. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
  16. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
  17. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
  18. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
  19. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
  20. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
  21. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
  22. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
  23. package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
  24. package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
  25. package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
  26. package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
  27. package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
  28. package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
  29. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
  30. package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
  31. package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
  32. package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
  33. package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
  34. package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
  35. package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
  36. package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
  37. package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
  38. package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
  39. package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
  40. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
  41. package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
  42. package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
  43. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
  44. package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
  45. package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
  46. package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
  47. package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
  48. package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +51 -717
  49. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
  50. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
  51. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
  52. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
  53. package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
  54. package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
  55. package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
  56. package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
  57. package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
  58. package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
  59. package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
  60. package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
  61. package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
  62. package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
  63. package/contracts/DependencyRegistryV0.sol +84 -16
  64. package/contracts/archive/readme.md +16 -0
  65. package/contracts/engine/README.md +21 -0
  66. package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +4 -10
  67. package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +4 -10
  68. package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +4 -10
  69. package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +4 -10
  70. package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
  71. package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
  72. package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +3 -0
  73. package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
  74. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +11 -20
  75. package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
  76. package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
  77. package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
  78. package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
  79. package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
  80. package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
  81. package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +4 -67
  82. package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
  83. package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +7 -155
  84. package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
  85. package/contracts/libs/v0.8.x/ABHelpers.sol +14 -14
  86. package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
  87. package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
  88. package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +163 -38
  89. package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
  90. package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +144 -37
  91. package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
  92. package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +250 -110
  93. package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +257 -48
  94. package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
  95. package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +778 -103
  96. package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +135 -13
  97. package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +567 -187
  98. package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +480 -322
  99. package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +214 -76
  100. package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +347 -304
  101. package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
  102. package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1 -54
  103. package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +388 -628
  104. package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
  105. package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
  106. package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
  107. package/contracts/minter-suite/Minters/MinterSEAV1.sol +327 -664
  108. package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +278 -303
  109. package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
  110. package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
  111. package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +538 -622
  112. package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
  113. package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
  114. package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
  115. package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
  116. package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
  117. package/contracts/mock/ReentrancyMockShared.sol +48 -0
  118. package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
  119. package/contracts/randomizer/shared/SharedRandomizerV0.sol +78 -70
  120. package/package.json +39 -33
@@ -1,25 +1,27 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
5
- import "../../interfaces/v0.8.x/IDelegationRegistry.sol";
6
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
7
- import "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
8
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
9
-
10
- import "../../libs/v0.8.x/ABHelpers.sol";
11
- import "../../libs/v0.8.x/AuthLib.sol";
12
- import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
13
- import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
14
- import "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
15
- import "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
16
- import "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
17
-
18
- import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
19
- import "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
20
-
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
21
6
  pragma solidity 0.8.19;
22
7
 
8
+ import {IGenArt721CoreContractV3_Base} from "../../interfaces/v0.8.x/IGenArt721CoreContractV3_Base.sol";
9
+ import {IDelegationRegistry} from "../../interfaces/v0.8.x/IDelegationRegistry.sol";
10
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
11
+ import {ISharedMinterHolderV0} from "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
12
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
13
+
14
+ import {ABHelpers} from "../../libs/v0.8.x/ABHelpers.sol";
15
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
16
+ import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
17
+ import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
18
+ import {SetPriceLib} from "../../libs/v0.8.x/minter-libs/SetPriceLib.sol";
19
+ import {TokenHolderLib} from "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
20
+ import {PolyptychLib} from "../../libs/v0.8.x/minter-libs/PolyptychLib.sol";
21
+
22
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
23
+ import {EnumerableSet} from "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
24
+
23
25
  /**
24
26
  * @title Shared, filtered Minter contract that allows tokens to be minted with
25
27
  * ETH when purchaser owns an allowlisted ERC-721 NFT.
@@ -71,6 +73,13 @@ pragma solidity 0.8.19;
71
73
  * Token-level delegations are configured by the vault owner, and contract-
72
74
  * level delegations must be configured for the core token contract as returned
73
75
  * by the public immutable variable `genArt721CoreAddress`.
76
+ * ----------------------------------------------------------------------------
77
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
78
+ * Core Registry to assign this minter, this minter does not enforce that a
79
+ * project is registered when configured or queried. This is primarily for gas
80
+ * optimization purposes. It is, therefore, possible that fake projects may be
81
+ * configured on this minter, but they will not be able to mint tokens due to
82
+ * checks performed by this minter's Minter Filter.
74
83
  */
75
84
  contract MinterSetPricePolyptychV5 is
76
85
  ReentrancyGuard,
@@ -84,13 +93,13 @@ contract MinterSetPricePolyptychV5 is
84
93
  address public immutable minterFilterAddress;
85
94
 
86
95
  /// Minter filter this minter may interact with.
87
- IMinterFilterV1 private immutable minterFilter;
96
+ IMinterFilterV1 private immutable _minterFilter;
88
97
 
89
98
  /// Delegation registry address
90
99
  address public immutable delegationRegistryAddress;
91
100
 
92
101
  /// Delegation registry address
93
- IDelegationRegistry private immutable delegationRegistryContract;
102
+ IDelegationRegistry private immutable _delegationRegistryContract;
94
103
 
95
104
  /// minterType for this minter
96
105
  string public constant minterType = "MinterSetPricePolyptychV5";
@@ -98,68 +107,6 @@ contract MinterSetPricePolyptychV5 is
98
107
  /// minter version for this minter
99
108
  string public constant minterVersion = "v5.0.0";
100
109
 
101
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
102
- // STATE VARIABLES FOR SetPriceLib begin here
103
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
104
-
105
- /// contractAddress => projectId => set price project config
106
- mapping(address => mapping(uint256 => SetPriceLib.SetPriceProjectConfig))
107
- private _setPriceProjectConfigMapping;
108
-
109
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
110
- // STATE VARIABLES FOR SetPriceLib end here
111
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
112
-
113
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
114
- // STATE VARIABLES FOR SplitFundsLib begin here
115
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
116
-
117
- // contractAddress => IsEngineCache
118
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
119
-
120
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
121
- // STATE VARIABLES FOR SplitFundsLib end here
122
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
123
-
124
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
125
- // STATE VARIABLES FOR MaxInvocationsLib begin here
126
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
127
-
128
- // contractAddress => projectId => max invocations specific project config
129
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
130
- private _maxInvocationsProjectConfigMapping;
131
-
132
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
133
- // STATE VARIABLES FOR MaxInvocationsLib end here
134
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
135
-
136
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
137
- // STATE VARIABLES FOR PolyptychLib begin here
138
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
139
-
140
- // contractAddress => projectId => polyptych project config
141
- mapping(address => mapping(uint256 => PolyptychLib.PolyptychProjectConfig))
142
- private _polyptychProjectConfigs;
143
-
144
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
145
- // STATE VARIABLES FOR PolyptychLib end here
146
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
147
-
148
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
149
- // STATE VARIABLES FOR TokenHolderLib begin here
150
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
151
-
152
- /**
153
- * coreContract => projectId => ownedNFTAddress => ownedNFTProjectIds => bool
154
- * projects whose holders are allowed to purchase a token on `projectId`
155
- */
156
- mapping(address => mapping(uint256 => TokenHolderLib.HolderProjectConfig))
157
- private _allowedProjectHoldersMapping;
158
-
159
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
160
- // STATE VARIABLES FOR TokenHolderLib end here
161
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
162
-
163
110
  // MODIFIERS
164
111
  // @dev contract uses modifier-like internal functions instead of modifiers
165
112
  // to reduce contract bytecode size
@@ -167,459 +114,416 @@ contract MinterSetPricePolyptychV5 is
167
114
 
168
115
  /**
169
116
  * @notice Initializes contract to be a Filtered Minter for
170
- * `_minterFilter` minter filter.
171
- * @param _minterFilter Minter filter for which this will be a
117
+ * `minterFilter` minter filter.
118
+ * @param minterFilter Minter filter for which this will be a
172
119
  * filtered minter.
173
- * @param _delegationRegistryAddress Delegation registry contract address.
120
+ * @param delegationRegistryAddress_ Delegation registry contract address.
174
121
  */
175
122
  constructor(
176
- address _minterFilter,
177
- address _delegationRegistryAddress
123
+ address minterFilter,
124
+ address delegationRegistryAddress_
178
125
  ) ReentrancyGuard() {
179
- minterFilterAddress = _minterFilter;
180
- minterFilter = IMinterFilterV1(_minterFilter);
126
+ minterFilterAddress = minterFilter;
127
+ _minterFilter = IMinterFilterV1(minterFilter);
181
128
 
182
- delegationRegistryAddress = _delegationRegistryAddress;
183
- delegationRegistryContract = IDelegationRegistry(
184
- _delegationRegistryAddress
129
+ delegationRegistryAddress = delegationRegistryAddress_;
130
+ _delegationRegistryContract = IDelegationRegistry(
131
+ delegationRegistryAddress_
132
+ );
133
+ emit TokenHolderLib.DelegationRegistryUpdated(
134
+ delegationRegistryAddress_
185
135
  );
186
- emit DelegationRegistryUpdated(_delegationRegistryAddress);
187
136
  }
188
137
 
189
138
  /**
190
- * @notice Manually sets the local maximum invocations of project `_projectId`
191
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
192
- * than or equal to the value of project `_project_id`'s maximum invocations that is
139
+ * @notice Manually sets the local maximum invocations of project `projectId`
140
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
141
+ * than or equal to the value of project `project_id`'s maximum invocations that is
193
142
  * set on the core contract.
194
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
143
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
195
144
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
196
145
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
197
- * @param _projectId Project ID to set the maximum invocations for.
198
- * @param _coreContract Core contract address for the given project.
199
- * @param _maxInvocations Maximum invocations to set for the project.
146
+ * @param projectId Project ID to set the maximum invocations for.
147
+ * @param coreContract Core contract address for the given project.
148
+ * @param maxInvocations Maximum invocations to set for the project.
200
149
  */
201
150
  function manuallyLimitProjectMaxInvocations(
202
- uint256 _projectId,
203
- address _coreContract,
204
- uint24 _maxInvocations
151
+ uint256 projectId,
152
+ address coreContract,
153
+ uint24 maxInvocations
205
154
  ) external {
206
155
  AuthLib.onlyArtist({
207
- _projectId: _projectId,
208
- _coreContract: _coreContract,
209
- _sender: msg.sender
156
+ projectId: projectId,
157
+ coreContract: coreContract,
158
+ sender: msg.sender
159
+ });
160
+ MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
161
+ projectId: projectId,
162
+ coreContract: coreContract,
163
+ maxInvocations: maxInvocations
210
164
  });
211
- MaxInvocationsLib.manuallyLimitProjectMaxInvocations(
212
- _projectId,
213
- _coreContract,
214
- _maxInvocations,
215
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
216
- );
217
- emit ProjectMaxInvocationsLimitUpdated(
218
- _projectId,
219
- _coreContract,
220
- _maxInvocations
221
- );
222
165
  }
223
166
 
224
167
  /**
225
- * @notice Updates this minter's price per token of project `_projectId`
168
+ * @notice Updates this minter's price per token of project `projectId`
226
169
  * to be '_pricePerTokenInWei`, in Wei.
227
170
  * @dev Note that it is intentionally supported here that the configured
228
171
  * price may be explicitly set to `0`.
229
- * @param _projectId Project ID to set the price per token for.
230
- * @param _coreContract Core contract address for the given project.
231
- * @param _pricePerTokenInWei Price per token to set for the project, in Wei.
172
+ * @param projectId Project ID to set the price per token for.
173
+ * @param coreContract Core contract address for the given project.
174
+ * @param pricePerTokenInWei Price per token to set for the project, in Wei.
232
175
  */
233
176
  function updatePricePerTokenInWei(
234
- uint256 _projectId,
235
- address _coreContract,
236
- uint248 _pricePerTokenInWei
177
+ uint256 projectId,
178
+ address coreContract,
179
+ uint248 pricePerTokenInWei
237
180
  ) external {
238
181
  AuthLib.onlyArtist({
239
- _projectId: _projectId,
240
- _coreContract: _coreContract,
241
- _sender: msg.sender
182
+ projectId: projectId,
183
+ coreContract: coreContract,
184
+ sender: msg.sender
185
+ });
186
+ SetPriceLib.updatePricePerToken({
187
+ projectId: projectId,
188
+ coreContract: coreContract,
189
+ pricePerToken: pricePerTokenInWei
242
190
  });
243
- SetPriceLib.SetPriceProjectConfig
244
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
245
- _coreContract
246
- ][_projectId];
247
- SetPriceLib.updatePricePerTokenInWei(
248
- _pricePerTokenInWei,
249
- _setPriceProjectConfig
250
- );
251
- emit PricePerTokenInWeiUpdated(
252
- _projectId,
253
- _coreContract,
254
- _pricePerTokenInWei
255
- );
256
191
 
257
192
  // sync local max invocations if not initially populated
258
193
  // @dev if local max invocations and maxHasBeenInvoked are both
259
194
  // initial values, we know they have not been populated.
260
- MaxInvocationsLib.MaxInvocationsProjectConfig
261
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
262
- _coreContract
263
- ][_projectId];
264
195
  // @dev if local maxInvocations and maxHasBeenInvoked are both
265
196
  // initial values, we know they have not been populated on this minter
266
197
  if (
267
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
268
- _maxInvocationsProjectConfig
269
- )
198
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
199
+ projectId: projectId,
200
+ coreContract: coreContract
201
+ })
270
202
  ) {
271
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
203
+ syncProjectMaxInvocationsToCore({
204
+ projectId: projectId,
205
+ coreContract: coreContract
206
+ });
272
207
  }
273
208
  }
274
209
 
275
210
  /**
276
- * @notice Allows holders of NFTs at addresses `_ownedNFTAddresses`,
277
- * project IDs `_ownedNFTProjectIds` to mint on project `_projectId`.
278
- * `_ownedNFTAddresses` assumed to be aligned with `_ownedNFTProjectIds`.
279
- * e.g. Allows holders of project `_ownedNFTProjectIds[0]` on token
280
- * contract `_ownedNFTAddresses[0]` to mint `_projectId`.
211
+ * @notice Allows holders of NFTs at addresses `ownedNFTAddresses`,
212
+ * project IDs `ownedNFTProjectIds` to mint on project `projectId`.
213
+ * `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
214
+ * e.g. Allows holders of project `ownedNFTProjectIds[0]` on token
215
+ * contract `ownedNFTAddresses[0]` to mint `projectId`.
281
216
  * WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
282
217
  * due to assumptions about tokenId and projectId relationships.
283
- * @param _projectId Project ID to enable minting on.
284
- * @param _coreContract Core contract address for the given project.
285
- * @param _ownedNFTAddresses NFT core addresses of projects to be
286
- * allowlisted. Indexes must align with `_ownedNFTProjectIds`.
287
- * @param _ownedNFTProjectIds Project IDs on `_ownedNFTAddresses` whose
288
- * holders shall be allowlisted to mint project `_projectId`. Indexes must
289
- * align with `_ownedNFTAddresses`.
218
+ * @param projectId Project ID to enable minting on.
219
+ * @param coreContract Core contract address for the given project.
220
+ * @param ownedNFTAddresses NFT core addresses of projects to be
221
+ * allowlisted. Indexes must align with `ownedNFTProjectIds`.
222
+ * @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
223
+ * holders shall be allowlisted to mint project `projectId`. Indexes must
224
+ * align with `ownedNFTAddresses`.
290
225
  */
291
226
  function allowHoldersOfProjects(
292
- uint256 _projectId,
293
- address _coreContract,
294
- address[] memory _ownedNFTAddresses,
295
- uint256[] memory _ownedNFTProjectIds
227
+ uint256 projectId,
228
+ address coreContract,
229
+ address[] calldata ownedNFTAddresses,
230
+ uint256[] calldata ownedNFTProjectIds
296
231
  ) external {
297
232
  AuthLib.onlyArtist({
298
- _projectId: _projectId,
299
- _coreContract: _coreContract,
300
- _sender: msg.sender
233
+ projectId: projectId,
234
+ coreContract: coreContract,
235
+ sender: msg.sender
301
236
  });
302
237
  TokenHolderLib.allowHoldersOfProjects({
303
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
304
- _projectId
305
- ],
306
- _ownedNFTAddresses: _ownedNFTAddresses,
307
- _ownedNFTProjectIds: _ownedNFTProjectIds
238
+ projectId: projectId,
239
+ coreContract: coreContract,
240
+ ownedNFTAddresses: ownedNFTAddresses,
241
+ ownedNFTProjectIds: ownedNFTProjectIds
308
242
  });
309
-
310
- // emit approve event
311
- emit AllowedHoldersOfProjects(
312
- _projectId,
313
- _coreContract,
314
- _ownedNFTAddresses,
315
- _ownedNFTProjectIds
316
- );
317
243
  }
318
244
 
319
245
  /**
320
- * @notice Removes holders of NFTs at addresses `_ownedNFTAddresses`,
321
- * project IDs `_ownedNFTProjectIds` to mint on project `_projectId`. If
246
+ * @notice Removes holders of NFTs at addresses `ownedNFTAddresses`,
247
+ * project IDs `ownedNFTProjectIds` to mint on project `projectId`. If
322
248
  * other projects owned by a holder are still allowed to mint, holder will
323
249
  * maintain ability to purchase.
324
- * `_ownedNFTAddresses` assumed to be aligned with `_ownedNFTProjectIds`.
325
- * e.g. Removes holders of project `_ownedNFTProjectIds[0]` on token
326
- * contract `_ownedNFTAddresses[0]` from mint allowlist of `_projectId`.
327
- * @param _projectId Project ID to enable minting on.
328
- * @param _coreContract Core contract address for the given project.
329
- * @param _ownedNFTAddresses NFT core addresses of projects to be removed
330
- * from allowlist. Indexes must align with `_ownedNFTProjectIds`.
331
- * @param _ownedNFTProjectIds Project IDs on `_ownedNFTAddresses` whose
332
- * holders will be removed from allowlist to mint project `_projectId`.
333
- * Indexes must align with `_ownedNFTAddresses`.
250
+ * `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
251
+ * e.g. Removes holders of project `ownedNFTProjectIds[0]` on token
252
+ * contract `ownedNFTAddresses[0]` from mint allowlist of `projectId`.
253
+ * @param projectId Project ID to enable minting on.
254
+ * @param coreContract Core contract address for the given project.
255
+ * @param ownedNFTAddresses NFT core addresses of projects to be removed
256
+ * from allowlist. Indexes must align with `ownedNFTProjectIds`.
257
+ * @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
258
+ * holders will be removed from allowlist to mint project `projectId`.
259
+ * Indexes must align with `ownedNFTAddresses`.
334
260
  */
335
261
  function removeHoldersOfProjects(
336
- uint256 _projectId,
337
- address _coreContract,
338
- address[] memory _ownedNFTAddresses,
339
- uint256[] memory _ownedNFTProjectIds
262
+ uint256 projectId,
263
+ address coreContract,
264
+ address[] calldata ownedNFTAddresses,
265
+ uint256[] calldata ownedNFTProjectIds
340
266
  ) external {
341
267
  AuthLib.onlyArtist({
342
- _projectId: _projectId,
343
- _coreContract: _coreContract,
344
- _sender: msg.sender
268
+ projectId: projectId,
269
+ coreContract: coreContract,
270
+ sender: msg.sender
345
271
  });
346
272
  // require same length arrays
347
273
  TokenHolderLib.removeHoldersOfProjects({
348
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
349
- _projectId
350
- ],
351
- _ownedNFTAddresses: _ownedNFTAddresses,
352
- _ownedNFTProjectIds: _ownedNFTProjectIds
274
+ projectId: projectId,
275
+ coreContract: coreContract,
276
+ ownedNFTAddresses: ownedNFTAddresses,
277
+ ownedNFTProjectIds: ownedNFTProjectIds
353
278
  });
354
-
355
- // emit removed event
356
- emit RemovedHoldersOfProjects(
357
- _projectId,
358
- _coreContract,
359
- _ownedNFTAddresses,
360
- _ownedNFTProjectIds
361
- );
362
279
  }
363
280
 
364
281
  /**
365
- * @notice Allows holders of NFTs at addresses `_ownedNFTAddressesAdd`,
366
- * project IDs `_ownedNFTProjectIdsAdd` to mint on project `_projectId`.
367
- * Also removes holders of NFTs at addresses `_ownedNFTAddressesRemove`,
368
- * project IDs `_ownedNFTProjectIdsRemove` from minting on project
369
- * `_projectId`.
370
- * `_ownedNFTAddressesAdd` assumed to be aligned with
371
- * `_ownedNFTProjectIdsAdd`.
372
- * e.g. Allows holders of project `_ownedNFTProjectIdsAdd[0]` on token
373
- * contract `_ownedNFTAddressesAdd[0]` to mint `_projectId`.
374
- * `_ownedNFTAddressesRemove` also assumed to be aligned with
375
- * `_ownedNFTProjectIdsRemove`.
282
+ * @notice Allows holders of NFTs at addresses `ownedNFTAddressesAdd`,
283
+ * project IDs `ownedNFTProjectIdsAdd` to mint on project `projectId`.
284
+ * Also removes holders of NFTs at addresses `ownedNFTAddressesRemove`,
285
+ * project IDs `ownedNFTProjectIdsRemove` from minting on project
286
+ * `projectId`.
287
+ * `ownedNFTAddressesAdd` assumed to be aligned with
288
+ * `ownedNFTProjectIdsAdd`.
289
+ * e.g. Allows holders of project `ownedNFTProjectIdsAdd[0]` on token
290
+ * contract `ownedNFTAddressesAdd[0]` to mint `projectId`.
291
+ * `ownedNFTAddressesRemove` also assumed to be aligned with
292
+ * `ownedNFTProjectIdsRemove`.
376
293
  * WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
377
294
  * due to assumptions about tokenId and projectId relationships.
378
- * @param _projectId Project ID to enable minting on.
379
- * @param _coreContract Core contract address for the given project.
380
- * @param _ownedNFTAddressesAdd NFT core addresses of projects to be
381
- * allowlisted. Indexes must align with `_ownedNFTProjectIdsAdd`.
382
- * @param _ownedNFTProjectIdsAdd Project IDs on `_ownedNFTAddressesAdd`
383
- * whose holders shall be allowlisted to mint project `_projectId`. Indexes
384
- * must align with `_ownedNFTAddressesAdd`.
385
- * @param _ownedNFTAddressesRemove NFT core addresses of projects to be
295
+ * @param projectId Project ID to enable minting on.
296
+ * @param coreContract Core contract address for the given project.
297
+ * @param ownedNFTAddressesAdd NFT core addresses of projects to be
298
+ * allowlisted. Indexes must align with `ownedNFTProjectIdsAdd`.
299
+ * @param ownedNFTProjectIdsAdd Project IDs on `ownedNFTAddressesAdd`
300
+ * whose holders shall be allowlisted to mint project `projectId`. Indexes
301
+ * must align with `ownedNFTAddressesAdd`.
302
+ * @param ownedNFTAddressesRemove NFT core addresses of projects to be
386
303
  * removed from allowlist. Indexes must align with
387
- * `_ownedNFTProjectIdsRemove`.
388
- * @param _ownedNFTProjectIdsRemove Project IDs on
389
- * `_ownedNFTAddressesRemove` whose holders will be removed from allowlist
390
- * to mint project `_projectId`. Indexes must align with
391
- * `_ownedNFTAddressesRemove`.
304
+ * `ownedNFTProjectIdsRemove`.
305
+ * @param ownedNFTProjectIdsRemove Project IDs on
306
+ * `ownedNFTAddressesRemove` whose holders will be removed from allowlist
307
+ * to mint project `projectId`. Indexes must align with
308
+ * `ownedNFTAddressesRemove`.
392
309
  * @dev if a project is included in both add and remove arrays, it will be
393
310
  * removed.
394
311
  */
395
312
  function allowAndRemoveHoldersOfProjects(
396
- uint256 _projectId,
397
- address _coreContract,
398
- address[] memory _ownedNFTAddressesAdd,
399
- uint256[] memory _ownedNFTProjectIdsAdd,
400
- address[] memory _ownedNFTAddressesRemove,
401
- uint256[] memory _ownedNFTProjectIdsRemove
313
+ uint256 projectId,
314
+ address coreContract,
315
+ address[] calldata ownedNFTAddressesAdd,
316
+ uint256[] calldata ownedNFTProjectIdsAdd,
317
+ address[] calldata ownedNFTAddressesRemove,
318
+ uint256[] calldata ownedNFTProjectIdsRemove
402
319
  ) external {
403
320
  AuthLib.onlyArtist({
404
- _projectId: _projectId,
405
- _coreContract: _coreContract,
406
- _sender: msg.sender
321
+ projectId: projectId,
322
+ coreContract: coreContract,
323
+ sender: msg.sender
407
324
  });
408
325
  TokenHolderLib.allowAndRemoveHoldersOfProjects({
409
- holderProjectConfig: _allowedProjectHoldersMapping[_coreContract][
410
- _projectId
411
- ],
412
- _ownedNFTAddressesAdd: _ownedNFTAddressesAdd,
413
- _ownedNFTProjectIdsAdd: _ownedNFTProjectIdsAdd,
414
- _ownedNFTAddressesRemove: _ownedNFTAddressesRemove,
415
- _ownedNFTProjectIdsRemove: _ownedNFTProjectIdsRemove
326
+ projectId: projectId,
327
+ coreContract: coreContract,
328
+ ownedNFTAddressesAdd: ownedNFTAddressesAdd,
329
+ ownedNFTProjectIdsAdd: ownedNFTProjectIdsAdd,
330
+ ownedNFTAddressesRemove: ownedNFTAddressesRemove,
331
+ ownedNFTProjectIdsRemove: ownedNFTProjectIdsRemove
416
332
  });
417
-
418
- // emit events
419
- emit AllowedHoldersOfProjects(
420
- _projectId,
421
- _coreContract,
422
- _ownedNFTAddressesAdd,
423
- _ownedNFTProjectIdsAdd
424
- );
425
- emit RemovedHoldersOfProjects(
426
- _projectId,
427
- _coreContract,
428
- _ownedNFTAddressesRemove,
429
- _ownedNFTProjectIdsRemove
430
- );
431
333
  }
432
334
 
433
335
  /**
434
336
  * @notice Allows the artist to increment the minter to the next polyptych panel
435
- * @param _projectId Project ID to increment to its next polyptych panel
436
- * @param _coreContract Core contract address for the given project.
337
+ * @param projectId Project ID to increment to its next polyptych panel
338
+ * @param coreContract Core contract address for the given project.
437
339
  */
438
340
  function incrementPolyptychProjectPanelId(
439
- uint256 _projectId,
440
- address _coreContract
341
+ uint256 projectId,
342
+ address coreContract
441
343
  ) public {
442
344
  AuthLib.onlyArtist({
443
- _projectId: _projectId,
444
- _coreContract: _coreContract,
445
- _sender: msg.sender
345
+ projectId: projectId,
346
+ coreContract: coreContract,
347
+ sender: msg.sender
348
+ });
349
+ PolyptychLib.incrementPolyptychProjectPanelId({
350
+ projectId: projectId,
351
+ coreContract: coreContract
446
352
  });
447
- PolyptychLib.PolyptychProjectConfig
448
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
449
- _coreContract
450
- ][_projectId];
451
- PolyptychLib.incrementPolyptychProjectPanelId(_polyptychProjectConfig);
452
- // index the update
453
- emit ConfigValueSet(
454
- _projectId,
455
- _coreContract,
456
- PolyptychLib.POLYPTYCH_PANEL_ID,
457
- _polyptychProjectConfig.polyptychPanelId
458
- );
459
353
  }
460
354
 
461
355
  /**
462
- * @notice Purchases a token from project `_projectId` on core contract
463
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
464
- * token ID `_ownedNFTTokenId` as the parent token.
465
- * @param _projectId Project ID to mint a token on.
466
- * @param _coreContract Core contract address for the given project.
467
- * @param _ownedNFTAddress ERC-721 NFT address holding the project token
356
+ * @notice Purchases a token from project `projectId` on core contract
357
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
358
+ * token ID `ownedNFTTokenId` as the parent token.
359
+ * @param projectId Project ID to mint a token on.
360
+ * @param coreContract Core contract address for the given project.
361
+ * @param ownedNFTAddress ERC-721 NFT address holding the project token
468
362
  * owned by msg.sender being used as the parent token.
469
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
363
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender to be
470
364
  * used as the parent token.
471
365
  * @return tokenId Token ID of minted token
472
366
  */
473
367
  function purchase(
474
- uint256 _projectId,
475
- address _coreContract,
476
- address _ownedNFTAddress,
477
- uint256 _ownedNFTTokenId
368
+ uint256 projectId,
369
+ address coreContract,
370
+ address ownedNFTAddress,
371
+ uint256 ownedNFTTokenId
478
372
  ) external payable returns (uint256 tokenId) {
479
- tokenId = purchaseTo(
480
- msg.sender,
481
- _projectId,
482
- _coreContract,
483
- _ownedNFTAddress,
484
- _ownedNFTTokenId,
485
- address(0)
486
- );
373
+ tokenId = purchaseTo({
374
+ to: msg.sender,
375
+ projectId: projectId,
376
+ coreContract: coreContract,
377
+ ownedNFTAddress: ownedNFTAddress,
378
+ ownedNFTTokenId: ownedNFTTokenId,
379
+ vault: address(0)
380
+ });
487
381
  return tokenId;
488
382
  }
489
383
 
490
384
  /**
491
- * @notice Purchases a token from project `_projectId` on core contract
492
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
493
- * token ID `_ownedNFTTokenId` as the parent token.
494
- * Sets the token's owner to `_to`.
495
- * @param _to Address to be the new token's owner.
496
- * @param _projectId Project ID to mint a token on.
497
- * @param _coreContract Core contract address for the given project.
498
- * @param _ownedNFTAddress ERC-721 NFT holding the project token owned by
385
+ * @notice Purchases a token from project `projectId` on core contract
386
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
387
+ * token ID `ownedNFTTokenId` as the parent token.
388
+ * Sets the token's owner to `to`.
389
+ * @param to Address to be the new token's owner.
390
+ * @param projectId Project ID to mint a token on.
391
+ * @param coreContract Core contract address for the given project.
392
+ * @param ownedNFTAddress ERC-721 NFT holding the project token owned by
499
393
  * msg.sender being used as the parent token.
500
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
394
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
501
395
  * as the parent token.
502
396
  * @return tokenId Token ID of minted token
503
397
  */
504
398
  function purchaseTo(
505
- address _to,
506
- uint256 _projectId,
507
- address _coreContract,
508
- address _ownedNFTAddress,
509
- uint256 _ownedNFTTokenId
399
+ address to,
400
+ uint256 projectId,
401
+ address coreContract,
402
+ address ownedNFTAddress,
403
+ uint256 ownedNFTTokenId
510
404
  ) external payable returns (uint256 tokenId) {
511
405
  return
512
- purchaseTo(
513
- _to,
514
- _projectId,
515
- _coreContract,
516
- _ownedNFTAddress,
517
- _ownedNFTTokenId,
518
- address(0)
519
- );
406
+ purchaseTo({
407
+ to: to,
408
+ projectId: projectId,
409
+ coreContract: coreContract,
410
+ ownedNFTAddress: ownedNFTAddress,
411
+ ownedNFTTokenId: ownedNFTTokenId,
412
+ vault: address(0)
413
+ });
520
414
  }
521
415
 
522
416
  // public getter functions
523
417
  /**
524
418
  * @notice Gets the maximum invocations project configuration.
525
- * @param _projectId The ID of the project whose data needs to be fetched.
526
- * @param _coreContract The address of the core contract.
419
+ * @param projectId The ID of the project whose data needs to be fetched.
420
+ * @param coreContract The address of the core contract.
527
421
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
528
422
  * configuration data.
529
423
  */
530
424
  function maxInvocationsProjectConfig(
531
- uint256 _projectId,
532
- address _coreContract
425
+ uint256 projectId,
426
+ address coreContract
533
427
  )
534
428
  external
535
429
  view
536
430
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
537
431
  {
538
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
432
+ return
433
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
434
+ projectId: projectId,
435
+ coreContract: coreContract
436
+ });
539
437
  }
540
438
 
541
439
  /**
542
440
  * @notice Gets the set price project configuration.
543
- * @param _projectId The ID of the project whose data needs to be fetched.
544
- * @param _coreContract The address of the core contract.
441
+ * @param projectId The ID of the project whose data needs to be fetched.
442
+ * @param coreContract The address of the core contract.
545
443
  * @return SetPriceProjectConfig struct with the fixed price project
546
444
  * configuration data.
547
445
  */
548
446
  function setPriceProjectConfig(
549
- uint256 _projectId,
550
- address _coreContract
447
+ uint256 projectId,
448
+ address coreContract
551
449
  ) external view returns (SetPriceLib.SetPriceProjectConfig memory) {
552
- return _setPriceProjectConfigMapping[_coreContract][_projectId];
450
+ return
451
+ SetPriceLib.getSetPriceProjectConfig({
452
+ projectId: projectId,
453
+ coreContract: coreContract
454
+ });
553
455
  }
554
456
 
555
457
  /**
556
458
  * @notice Checks if a specific NFT owner is allowed in a given project.
557
459
  * @dev This function retrieves the allowance status of an NFT owner
558
460
  * within a specific project from the allowedProjectHoldersMapping.
559
- * @param _projectId The ID of the project to check.
560
- * @param _coreContract Core contract address for the given project.
561
- * @param _ownedNFTAddress The address of the owned NFT contract.
562
- * @param _ownedNFTProjectId The ID of the owned NFT project.
461
+ * @param projectId The ID of the project to check.
462
+ * @param coreContract Core contract address for the given project.
463
+ * @param ownedNFTAddress The address of the owned NFT contract.
464
+ * @param ownedNFTProjectId The ID of the owned NFT project.
563
465
  * @return bool True if the NFT owner is allowed in the given project, False otherwise.
564
466
  */
565
467
  function allowedProjectHolders(
566
- uint256 _projectId,
567
- address _coreContract,
568
- address _ownedNFTAddress,
569
- uint256 _ownedNFTProjectId
468
+ uint256 projectId,
469
+ address coreContract,
470
+ address ownedNFTAddress,
471
+ uint256 ownedNFTProjectId
570
472
  ) external view returns (bool) {
571
473
  return
572
- _allowedProjectHoldersMapping[_coreContract][_projectId]
573
- .allowedProjectHolders[_ownedNFTAddress][_ownedNFTProjectId];
474
+ TokenHolderLib
475
+ .getHolderProjectConfig({
476
+ projectId: projectId,
477
+ coreContract: coreContract
478
+ })
479
+ .allowedProjectHolders[ownedNFTAddress][ownedNFTProjectId];
574
480
  }
575
481
 
576
482
  /**
577
- * @notice Returns if token is an allowlisted NFT for project `_projectId`.
578
- * @param _projectId Project ID to be checked.
579
- * @param _coreContract Core contract address for the given project.
580
- * @param _ownedNFTAddress ERC-721 NFT token address to be checked.
581
- * @param _ownedNFTTokenId ERC-721 NFT token ID to be checked.
483
+ * @notice Returns if token is an allowlisted NFT for project `projectId`.
484
+ * @param projectId Project ID to be checked.
485
+ * @param coreContract Core contract address for the given project.
486
+ * @param ownedNFTAddress ERC-721 NFT token address to be checked.
487
+ * @param ownedNFTTokenId ERC-721 NFT token ID to be checked.
582
488
  * @return bool Token is allowlisted
583
489
  * @dev does not check if token has been used to purchase
584
490
  * @dev assumes project ID can be derived from tokenId / 1_000_000
585
491
  */
586
492
  function isAllowlistedNFT(
587
- uint256 _projectId,
588
- address _coreContract,
589
- address _ownedNFTAddress,
590
- uint256 _ownedNFTTokenId
493
+ uint256 projectId,
494
+ address coreContract,
495
+ address ownedNFTAddress,
496
+ uint256 ownedNFTTokenId
591
497
  ) external view returns (bool) {
592
498
  return
593
499
  TokenHolderLib.isAllowlistedNFT({
594
- holderProjectConfig: _allowedProjectHoldersMapping[
595
- _coreContract
596
- ][_projectId],
597
- _ownedNFTAddress: _ownedNFTAddress,
598
- _ownedNFTTokenId: _ownedNFTTokenId
500
+ projectId: projectId,
501
+ coreContract: coreContract,
502
+ ownedNFTAddress: ownedNFTAddress,
503
+ ownedNFTTokenId: ownedNFTTokenId
599
504
  });
600
505
  }
601
506
 
602
507
  /**
603
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
604
- * @dev This function retrieves the cached value of `_isEngine` from
508
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
509
+ * @dev This function retrieves the cached value of `isEngine` from
605
510
  * the `isEngineCache` mapping. If the cached value is already set, it
606
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
607
- * function from the `SplitFundsLib` library to check if `_coreContract`
511
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
512
+ * function from the `SplitFundsLib` library to check if `coreContract`
608
513
  * is a valid engine contract.
609
- * @dev This function will revert if the provided `_coreContract` is not
514
+ * @dev This function will revert if the provided `coreContract` is not
610
515
  * a valid Engine or V3 Flagship contract.
611
- * @param _coreContract The address of the contract to check.
612
- * @return bool indicating if `_coreContract` is a valid engine contract.
516
+ * @param coreContract The address of the contract to check.
517
+ * @return bool indicating if `coreContract` is a valid engine contract.
613
518
  */
614
- function isEngineView(address _coreContract) external view returns (bool) {
615
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
616
- _coreContract
617
- ];
519
+ function isEngineView(address coreContract) external view returns (bool) {
520
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
521
+ .getIsEngineCacheConfig(coreContract);
618
522
  if (isEngineCache.isCached) {
619
523
  return isEngineCache.isEngine;
620
524
  } else {
621
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
622
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
525
+ // @dev this calls the non-state-modifying variant of isEngine
526
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
623
527
  }
624
528
  }
625
529
 
@@ -634,17 +538,18 @@ contract MinterSetPricePolyptychV5 is
634
538
  * possible because the V3 core contract only allows maximum invocations
635
539
  * to be reduced, not increased. Based on this rationale, we intentionally
636
540
  * do not do input validation in this method as to whether or not the input
637
- * @param `_projectId` is an existing project ID.
638
- * @param `_coreContract` is an existing core contract address.
541
+ * @param projectId is an existing project ID.
542
+ * @param coreContract is an existing core contract address.
639
543
  */
640
544
  function projectMaxHasBeenInvoked(
641
- uint256 _projectId,
642
- address _coreContract
545
+ uint256 projectId,
546
+ address coreContract
643
547
  ) external view returns (bool) {
644
548
  return
645
- MaxInvocationsLib.getMaxHasBeenInvoked(
646
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
647
- );
549
+ MaxInvocationsLib.getMaxHasBeenInvoked({
550
+ projectId: projectId,
551
+ coreContract: coreContract
552
+ });
648
553
  }
649
554
 
650
555
  /**
@@ -663,26 +568,27 @@ contract MinterSetPricePolyptychV5 is
663
568
  * increased. When this happens, the minter will enable minting, allowing
664
569
  * the core contract to enforce the max invocations check. Based on this
665
570
  * rationale, we intentionally do not do input validation in this method as
666
- * to whether or not the input `_projectId` is an existing project ID.
667
- * @param `_projectId` is an existing project ID.
668
- * @param `_coreContract` is an existing core contract address.
571
+ * to whether or not the input `projectId` is an existing project ID.
572
+ * @param projectId is an existing project ID.
573
+ * @param coreContract is an existing core contract address.
669
574
  */
670
575
  function projectMaxInvocations(
671
- uint256 _projectId,
672
- address _coreContract
576
+ uint256 projectId,
577
+ address coreContract
673
578
  ) external view returns (uint256) {
674
579
  return
675
- MaxInvocationsLib.getMaxInvocations(
676
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
677
- );
580
+ MaxInvocationsLib.getMaxInvocations({
581
+ projectId: projectId,
582
+ coreContract: coreContract
583
+ });
678
584
  }
679
585
 
680
586
  /**
681
587
  * @notice Gets if price of token is configured, price of minting a
682
- * token on project `_projectId`, and currency symbol and address to be
588
+ * token on project `projectId`, and currency symbol and address to be
683
589
  * used as payment.
684
- * @param _projectId Project ID to get price information for
685
- * @param _coreContract Contract address of the core contract
590
+ * @param projectId Project ID to get price information for
591
+ * @param coreContract Contract address of the core contract
686
592
  * @return isConfigured true only if token price has been configured on
687
593
  * this minter
688
594
  * @return tokenPriceInWei current price of token on this minter - invalid
@@ -693,8 +599,8 @@ contract MinterSetPricePolyptychV5 is
693
599
  * this minter. This minter always returns null address, reserved for ether
694
600
  */
695
601
  function getPriceInfo(
696
- uint256 _projectId,
697
- address _coreContract
602
+ uint256 projectId,
603
+ address coreContract
698
604
  )
699
605
  external
700
606
  view
@@ -706,158 +612,139 @@ contract MinterSetPricePolyptychV5 is
706
612
  )
707
613
  {
708
614
  SetPriceLib.SetPriceProjectConfig
709
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
710
- _coreContract
711
- ][_projectId];
712
- isConfigured = _setPriceProjectConfig.priceIsConfigured;
713
- tokenPriceInWei = _setPriceProjectConfig.pricePerTokenInWei;
615
+ storage setPriceProjectConfig_ = SetPriceLib
616
+ .getSetPriceProjectConfig({
617
+ projectId: projectId,
618
+ coreContract: coreContract
619
+ });
620
+ isConfigured = setPriceProjectConfig_.priceIsConfigured;
621
+ tokenPriceInWei = setPriceProjectConfig_.pricePerToken;
714
622
  currencySymbol = "ETH";
715
623
  currencyAddress = address(0);
716
624
  }
717
625
 
718
626
  /**
719
627
  * Gets the current polyptych panel ID for the given project.
720
- * @param _projectId Project ID to be queried
721
- * @param _coreContract Contract address of the core contract
628
+ * @param projectId Project ID to be queried
629
+ * @param coreContract Contract address of the core contract
722
630
  * @return uint256 representing the current polyptych panel ID for the
723
631
  * given project
724
632
  */
725
633
  function getCurrentPolyptychPanelId(
726
- uint256 _projectId,
727
- address _coreContract
634
+ uint256 projectId,
635
+ address coreContract
728
636
  ) external view returns (uint256) {
729
- PolyptychLib.PolyptychProjectConfig
730
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
731
- _coreContract
732
- ][_projectId];
733
- return PolyptychLib.getPolyptychPanelId(_polyptychProjectConfig);
637
+ return
638
+ PolyptychLib.getPolyptychPanelId({
639
+ projectId: projectId,
640
+ coreContract: coreContract
641
+ });
734
642
  }
735
643
 
736
644
  /**
737
645
  * Gets if the hash seed for the given project has been used on a given
738
646
  * polyptych panel id. The current polyptych panel ID for a given project
739
647
  * can be queried via the view function `getCurrentPolyptychPanelId`.
740
- * @param _projectId Project ID to be queried
741
- * @param _coreContract Contract address of the core contract
742
- * @param _panelId Panel ID to be queried
743
- * @param _hashSeed Hash seed to be queried
648
+ * @param projectId Project ID to be queried
649
+ * @param coreContract Contract address of the core contract
650
+ * @param panelId Panel ID to be queried
651
+ * @param hashSeed Hash seed to be queried
744
652
  * @return bool representing if the hash seed has been used on the given
745
653
  * polyptych panel ID
746
654
  */
747
655
  function getPolyptychPanelHashSeedIsMinted(
748
- uint256 _projectId,
749
- address _coreContract,
750
- uint256 _panelId,
751
- bytes12 _hashSeed
656
+ uint256 projectId,
657
+ address coreContract,
658
+ uint256 panelId,
659
+ bytes12 hashSeed
752
660
  ) external view returns (bool) {
753
- PolyptychLib.PolyptychProjectConfig
754
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
755
- _coreContract
756
- ][_projectId];
757
661
  return
758
- PolyptychLib.getPolyptychPanelHashSeedIsMinted(
759
- _polyptychProjectConfig,
760
- _panelId,
761
- _hashSeed
762
- );
662
+ PolyptychLib.getPolyptychPanelHashSeedIsMinted({
663
+ projectId: projectId,
664
+ coreContract: coreContract,
665
+ panelId: panelId,
666
+ hashSeed: hashSeed
667
+ });
763
668
  }
764
669
 
765
670
  /**
766
- * @notice Syncs local maximum invocations of project `_projectId` based on
671
+ * @notice Syncs local maximum invocations of project `projectId` based on
767
672
  * the value currently defined in the core contract.
768
- * @param _projectId Project ID to set the maximum invocations for.
769
- * @param _coreContract Core contract address for the given project.
673
+ * @param projectId Project ID to set the maximum invocations for.
674
+ * @param coreContract Core contract address for the given project.
770
675
  * @dev this enables gas reduction after maxInvocations have been reached -
771
676
  * core contracts shall still enforce a maxInvocation check during mint.
772
677
  */
773
678
  function syncProjectMaxInvocationsToCore(
774
- uint256 _projectId,
775
- address _coreContract
679
+ uint256 projectId,
680
+ address coreContract
776
681
  ) public {
777
682
  AuthLib.onlyArtist({
778
- _projectId: _projectId,
779
- _coreContract: _coreContract,
780
- _sender: msg.sender
683
+ projectId: projectId,
684
+ coreContract: coreContract,
685
+ sender: msg.sender
781
686
  });
782
687
 
783
- uint256 maxInvocations = MaxInvocationsLib
784
- .syncProjectMaxInvocationsToCore(
785
- _projectId,
786
- _coreContract,
787
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
788
- );
789
- emit ProjectMaxInvocationsLimitUpdated(
790
- _projectId,
791
- _coreContract,
792
- maxInvocations
793
- );
688
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
689
+ projectId: projectId,
690
+ coreContract: coreContract
691
+ });
794
692
  }
795
693
 
796
694
  /**
797
- * @notice Purchases a token from project `_projectId` on core contract
798
- * `_coreContract` using an owned NFT at address `_ownedNFTAddress` and
799
- * token ID `_ownedNFTTokenId` as the parent token.
800
- * Sets the token's owner to `_to`.
801
- * Parent token must be owned by `msg.sender`, or `_vault` if `msg.sender`
802
- * is a valid delegate for `_vault`.
803
- * @param _to Address to be the new token's owner.
804
- * @param _projectId Project ID to mint a token on.
805
- * @param _coreContract Core contract address for the given project.
806
- * @param _ownedNFTAddress ERC-721 NFT holding the project token owned by
807
- * msg.sender or `_vault` being used as the parent token.
808
- * @param _ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
809
- * `_vault` being used as the parent token.
695
+ * @notice Purchases a token from project `projectId` on core contract
696
+ * `coreContract` using an owned NFT at address `ownedNFTAddress` and
697
+ * token ID `ownedNFTTokenId` as the parent token.
698
+ * Sets the token's owner to `to`.
699
+ * Parent token must be owned by `msg.sender`, or `vault` if `msg.sender`
700
+ * is a valid delegate for `vault`.
701
+ * @param to Address to be the new token's owner.
702
+ * @param projectId Project ID to mint a token on.
703
+ * @param coreContract Core contract address for the given project.
704
+ * @param ownedNFTAddress ERC-721 NFT holding the project token owned by
705
+ * msg.sender or `vault` being used as the parent token.
706
+ * @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender or
707
+ * `vault` being used as the parent token.
810
708
  * @return tokenId Token ID of minted token
811
709
  */
812
710
  function purchaseTo(
813
- address _to,
814
- uint256 _projectId,
815
- address _coreContract,
816
- address _ownedNFTAddress,
817
- uint256 _ownedNFTTokenId,
818
- address _vault
711
+ address to,
712
+ uint256 projectId,
713
+ address coreContract,
714
+ address ownedNFTAddress,
715
+ uint256 ownedNFTTokenId,
716
+ address vault
819
717
  ) public payable nonReentrant returns (uint256 tokenId) {
820
718
  // CHECKS
821
- SetPriceLib.SetPriceProjectConfig
822
- storage _setPriceProjectConfig = _setPriceProjectConfigMapping[
823
- _coreContract
824
- ][_projectId];
825
- MaxInvocationsLib.MaxInvocationsProjectConfig
826
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
827
- _coreContract
828
- ][_projectId];
829
-
719
+ // pre-mint MaxInvocationsLib checks
830
720
  // Note that `maxHasBeenInvoked` is only checked here to reduce gas
831
721
  // consumption after a project has been fully minted.
832
- // `_maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
722
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
833
723
  // gas consumption, but if not in sync with the core contract's value,
834
724
  // the core contract also enforces its own max invocation check during
835
725
  // minting.
836
- require(
837
- !_maxInvocationsProjectConfig.maxHasBeenInvoked,
838
- "Max invocations reached"
839
- );
726
+ MaxInvocationsLib.preMintChecks({
727
+ projectId: projectId,
728
+ coreContract: coreContract
729
+ });
840
730
 
841
- // require artist to have configured price of token on this minter
842
- require(
843
- _setPriceProjectConfig.priceIsConfigured,
844
- "Price not configured"
845
- );
731
+ // pre-mint checks for set price lib, and get price per token in wei
732
+ // @dev price per token is loaded into memory here for gas efficiency
733
+ uint256 pricePerTokenInWei = SetPriceLib.preMintChecksAndGetPrice({
734
+ projectId: projectId,
735
+ coreContract: coreContract
736
+ });
846
737
  // @dev pricePerTokenInWei intentionally not loaded as local variable
847
738
  // to avoid stack too deep error
848
- require(
849
- msg.value >= _setPriceProjectConfig.pricePerTokenInWei,
850
- "Min value to mint req."
851
- );
739
+ require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
852
740
 
853
741
  // require token used to claim to be in set of allowlisted NFTs
854
742
  require(
855
743
  TokenHolderLib.isAllowlistedNFT({
856
- holderProjectConfig: _allowedProjectHoldersMapping[
857
- _coreContract
858
- ][_projectId],
859
- _ownedNFTAddress: _ownedNFTAddress,
860
- _ownedNFTTokenId: _ownedNFTTokenId
744
+ projectId: projectId,
745
+ coreContract: coreContract,
746
+ ownedNFTAddress: ownedNFTAddress,
747
+ ownedNFTTokenId: ownedNFTTokenId
861
748
  }),
862
749
  "Only allowlisted NFTs"
863
750
  );
@@ -865,31 +752,31 @@ contract MinterSetPricePolyptychV5 is
865
752
  // NOTE: delegate-vault handling **begins here**.
866
753
 
867
754
  // handle that the vault may be either the `msg.sender` in the case
868
- // that there is not a true vault, or may be `_vault` if one is
755
+ // that there is not a true vault, or may be `vault` if one is
869
756
  // provided explicitly (and it is valid).
870
- address vault = msg.sender;
871
- if (_vault != address(0)) {
757
+ address vault_ = msg.sender;
758
+ if (vault != address(0)) {
872
759
  // If a vault is provided, it must be valid, otherwise throw rather
873
760
  // than optimistically-minting with original `msg.sender`.
874
761
  // Note, we do not check `checkDelegateForAll` or `checkDelegateForContract` as well,
875
762
  // as they are known to be implicitly checked by calling `checkDelegateForToken`.
876
- bool isValidVault = delegationRegistryContract
877
- .checkDelegateForToken(
878
- msg.sender, // delegate
879
- _vault, // vault
880
- _coreContract, // contract
881
- _ownedNFTTokenId // tokenId
882
- );
763
+ bool isValidVault = _delegationRegistryContract
764
+ .checkDelegateForToken({
765
+ delegate: msg.sender,
766
+ vault: vault,
767
+ contract_: coreContract,
768
+ tokenId: ownedNFTTokenId
769
+ });
883
770
  require(isValidVault, "Invalid delegate-vault pairing");
884
- vault = _vault;
771
+ vault_ = vault;
885
772
  }
886
773
 
887
774
  // we need the new token ID in advance of the randomizer setting a token hash
888
775
  IGenArt721CoreContractV3_Base genArtCoreContract = IGenArt721CoreContractV3_Base(
889
- _coreContract
776
+ coreContract
890
777
  );
891
- (uint256 _invocations, , , , , ) = genArtCoreContract.projectStateData(
892
- _projectId
778
+ (uint256 invocations, , , , , ) = genArtCoreContract.projectStateData(
779
+ projectId
893
780
  );
894
781
 
895
782
  // EFFECTS
@@ -897,60 +784,54 @@ contract MinterSetPricePolyptychV5 is
897
784
  // we need to store the new token ID before it is minted so the randomizer can query it
898
785
  // block scope to avoid stack too deep error
899
786
  {
900
- bytes12 _targetHashSeed = PolyptychLib.getTokenHashSeed(
901
- _ownedNFTAddress,
902
- _ownedNFTTokenId
903
- );
787
+ bytes12 targetHashSeed = PolyptychLib.getTokenHashSeed({
788
+ coreContract: ownedNFTAddress,
789
+ tokenId: ownedNFTTokenId
790
+ });
904
791
 
905
- // block scope to avoid stack too deep error (nested)
906
- {
907
- // validates hash seed and ensures each hash seed used max once per panel
908
- PolyptychLib.PolyptychProjectConfig
909
- storage _polyptychProjectConfig = _polyptychProjectConfigs[
910
- _coreContract
911
- ][_projectId];
912
- PolyptychLib.validatePolyptychEffects(
913
- _polyptychProjectConfig,
914
- _targetHashSeed
915
- );
916
- }
917
-
918
- uint256 _newTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
919
- _projectId: _projectId,
792
+ // validates hash seed and ensures each hash seed used max once per panel
793
+ PolyptychLib.validatePolyptychEffects({
794
+ projectId: projectId,
795
+ coreContract: coreContract,
796
+ tokenHashSeed: targetHashSeed
797
+ });
798
+
799
+ uint256 newTokenId = ABHelpers.tokenIdFromProjectIdAndTokenNumber({
800
+ projectId: projectId,
920
801
  // @dev next token number is current invocations due to number
921
802
  // being zero-based-indexed
922
- _tokenNumber: _invocations
803
+ tokenNumber: invocations
923
804
  });
924
805
  PolyptychLib.setPolyptychHashSeed({
925
- _coreContract: _coreContract,
926
- _tokenId: _newTokenId, // new token ID
927
- _hashSeed: _targetHashSeed
806
+ coreContract: coreContract,
807
+ tokenId: newTokenId, // new token ID
808
+ hashSeed: targetHashSeed
928
809
  });
929
810
 
930
811
  // once mint() is called, the polyptych randomizer will either:
931
812
  // 1) assign a random token hash
932
813
  // 2) if configured, obtain the token hash from the `polyptychSeedHashes` mapping
933
- tokenId = minterFilter.mint_joo(
934
- _to,
935
- _projectId,
936
- _coreContract,
937
- vault
938
- );
814
+ tokenId = _minterFilter.mint_joo({
815
+ to: to,
816
+ projectId: projectId,
817
+ coreContract: coreContract,
818
+ sender: vault_
819
+ });
939
820
 
940
821
  // NOTE: delegate-vault handling **ends here**.
941
822
 
942
823
  // redundant check against reentrancy
943
824
  PolyptychLib.validateAssignedHashSeed({
944
- _coreContract: _coreContract,
945
- _tokenId: tokenId,
946
- _targetHashSeed: _targetHashSeed
825
+ coreContract: coreContract,
826
+ tokenId: tokenId,
827
+ targetHashSeed: targetHashSeed
947
828
  });
948
829
  }
949
830
 
950
- MaxInvocationsLib.validatePurchaseEffectsInvocations(
951
- tokenId,
952
- _maxInvocationsProjectConfig
953
- );
831
+ MaxInvocationsLib.validatePurchaseEffectsInvocations({
832
+ tokenId: tokenId,
833
+ coreContract: coreContract
834
+ });
954
835
 
955
836
  // INTERACTIONS
956
837
  // block scope to avoid stack too deep error
@@ -965,26 +846,21 @@ contract MinterSetPricePolyptychV5 is
965
846
  // @dev if the artist is the sender, then the NFT must be owned by the
966
847
  // recipient, otherwise the NFT must be owned by the vault
967
848
  address _artist = genArtCoreContract.projectIdToArtistAddress(
968
- _projectId
849
+ projectId
969
850
  );
970
- address targetOwner = (msg.sender == _artist) ? _to : vault;
851
+ address targetOwner = (msg.sender == _artist) ? to : vault_;
971
852
  TokenHolderLib.validateNFTOwnership({
972
- _ownedNFTAddress: _ownedNFTAddress,
973
- _ownedNFTTokenId: _ownedNFTTokenId,
974
- _targetOwner: targetOwner
853
+ ownedNFTAddress: ownedNFTAddress,
854
+ ownedNFTTokenId: ownedNFTTokenId,
855
+ targetOwner: targetOwner
975
856
  });
976
857
  }
977
858
 
978
859
  // split funds
979
- bool isEngine = SplitFundsLib.isEngine(
980
- _coreContract,
981
- _isEngineCaches[_coreContract]
982
- );
983
- SplitFundsLib.splitFundsETH({
984
- _projectId: _projectId,
985
- _pricePerTokenInWei: _setPriceProjectConfig.pricePerTokenInWei,
986
- _coreContract: _coreContract,
987
- _isEngine: isEngine
860
+ SplitFundsLib.splitFundsETHRefundSender({
861
+ projectId: projectId,
862
+ pricePerTokenInWei: pricePerTokenInWei,
863
+ coreContract: coreContract
988
864
  });
989
865
 
990
866
  return tokenId;