@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,21 +1,23 @@
1
1
  // SPDX-License-Identifier: LGPL-3.0-only
2
2
  // Created By: Art Blocks Inc.
3
3
 
4
- import "../../interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol";
5
- import "../../interfaces/v0.8.x/ISharedMinterV0.sol";
6
- import "../../interfaces/v0.8.x/ISharedMinterDAV0.sol";
7
- import "../../interfaces/v0.8.x/ISharedMinterDAExpV0.sol";
8
- import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
4
+ // @dev fixed to specific solidity version for clarity and for more clear
5
+ // source code verification purposes.
6
+ pragma solidity 0.8.19;
9
7
 
10
- import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
11
- import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
12
- import "../../libs/v0.8.x/minter-libs/DAExpLib.sol";
13
- import "../../libs/v0.8.x/AuthLib.sol";
8
+ import {ISharedMinterSimplePurchaseV0} from "../../interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol";
9
+ import {ISharedMinterV0} from "../../interfaces/v0.8.x/ISharedMinterV0.sol";
10
+ import {ISharedMinterDAV0} from "../../interfaces/v0.8.x/ISharedMinterDAV0.sol";
11
+ import {ISharedMinterDAExpV0} from "../../interfaces/v0.8.x/ISharedMinterDAExpV0.sol";
12
+ import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
14
13
 
15
- import "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
16
- import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
14
+ import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
15
+ import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
16
+ import {DAExpLib} from "../../libs/v0.8.x/minter-libs/DAExpLib.sol";
17
+ import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
17
18
 
18
- pragma solidity 0.8.19;
19
+ import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
20
+ import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
19
21
 
20
22
  /**
21
23
  * @title Shared, filtered Minter contract that allows tokens to be minted with
@@ -48,6 +50,13 @@ pragma solidity 0.8.19;
48
50
  * ----------------------------------------------------------------------------
49
51
  * Additional admin and artist privileged roles may be described on other
50
52
  * contracts that this minter integrates with.
53
+ * ----------------------------------------------------------------------------
54
+ * @notice Caution: While Engine projects must be registered on the Art Blocks
55
+ * Core Registry to assign this minter, this minter does not enforce that a
56
+ * project is registered when configured or queried. This is primarily for gas
57
+ * optimization purposes. It is, therefore, possible that fake projects may be
58
+ * configured on this minter, but they will not be able to mint tokens due to
59
+ * checks performed by this minter's Minter Filter.
51
60
  *
52
61
  * @dev Note that while this minter makes use of `block.timestamp` and it is
53
62
  * technically possible that this value is manipulated by block producers, such
@@ -69,7 +78,7 @@ contract MinterDAExpV5 is
69
78
  address public immutable minterFilterAddress;
70
79
 
71
80
  /// Minter filter this minter may interact with.
72
- IMinterFilterV1 private immutable minterFilter;
81
+ IMinterFilterV1 private immutable _minterFilter;
73
82
 
74
83
  /// minterType for this minter
75
84
  string public constant minterType = "MinterDAExpV5";
@@ -82,92 +91,51 @@ contract MinterDAExpV5 is
82
91
  /// least this amount (must cut in half at least every N seconds).
83
92
  uint256 public minimumPriceDecayHalfLifeSeconds = 45; // 45 seconds
84
93
 
85
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
86
- // STATE VARIABLES FOR SplitFundsLib begin here
87
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
88
-
89
- // contractAddress => IsEngineCache
90
- mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
91
-
92
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
93
- // STATE VARIABLES FOR SplitFundsLib end here
94
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
95
-
96
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
97
- // STATE VARIABLES FOR DAExpLib begin here
98
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
99
-
100
- mapping(address => mapping(uint256 => DAExpLib.DAProjectConfig))
101
- private _auctionProjectConfigMapping;
102
-
103
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
104
- // STATE VARIABLES FOR DAExpLib end here
105
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
106
-
107
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
108
- // STATE VARIABLES FOR MaxInvocationsLib begin here
109
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
110
-
111
- // contractAddress => projectId => max invocations specific project config
112
- mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
113
- private _maxInvocationsProjectConfigMapping;
114
-
115
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
116
- // STATE VARIABLES FOR MaxInvocationsLib end here
117
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
118
-
119
94
  /**
120
95
  * @notice Initializes contract to be a Filtered Minter for
121
- * `_minterFilter` minter filter.
122
- * @param _minterFilter Minter filter for which this will be a
96
+ * `minterFilter` minter filter.
97
+ * @param minterFilter Minter filter for which this will be a
123
98
  * filtered minter.
124
99
  */
125
- constructor(address _minterFilter) ReentrancyGuard() {
126
- minterFilterAddress = _minterFilter;
127
- minterFilter = IMinterFilterV1(_minterFilter);
128
- emit AuctionMinHalfLifeSecondsUpdated(minimumPriceDecayHalfLifeSeconds);
100
+ constructor(address minterFilter) ReentrancyGuard() {
101
+ minterFilterAddress = minterFilter;
102
+ _minterFilter = IMinterFilterV1(minterFilter);
103
+ emit DAExpLib.AuctionMinHalfLifeSecondsUpdated(
104
+ minimumPriceDecayHalfLifeSeconds
105
+ );
129
106
  }
130
107
 
131
108
  /**
132
- * @notice Manually sets the local maximum invocations of project `_projectId`
133
- * with the provided `_maxInvocations`, checking that `_maxInvocations` is less
134
- * than or equal to the value of project `_project_id`'s maximum invocations that is
109
+ * @notice Manually sets the local maximum invocations of project `projectId`
110
+ * with the provided `maxInvocations`, checking that `maxInvocations` is less
111
+ * than or equal to the value of project `project_id`'s maximum invocations that is
135
112
  * set on the core contract.
136
- * @dev Note that a `_maxInvocations` of 0 can only be set if the current `invocations`
113
+ * @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
137
114
  * value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
138
115
  * this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
139
- * @param _projectId Project ID to set the maximum invocations for.
140
- * @param _coreContract Core contract address for the given project.
141
- * @param _maxInvocations Maximum invocations to set for the project.
116
+ * @param projectId Project ID to set the maximum invocations for.
117
+ * @param coreContract Core contract address for the given project.
118
+ * @param maxInvocations Maximum invocations to set for the project.
142
119
  */
143
120
  function manuallyLimitProjectMaxInvocations(
144
- uint256 _projectId,
145
- address _coreContract,
146
- uint24 _maxInvocations
121
+ uint256 projectId,
122
+ address coreContract,
123
+ uint24 maxInvocations
147
124
  ) external {
148
125
  AuthLib.onlyArtist({
149
- _projectId: _projectId,
150
- _coreContract: _coreContract,
151
- _sender: msg.sender
126
+ projectId: projectId,
127
+ coreContract: coreContract,
128
+ sender: msg.sender
152
129
  });
153
130
  MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
154
- _projectId: _projectId,
155
- _coreContract: _coreContract,
156
- _maxInvocations: _maxInvocations,
157
- maxInvocationsProjectConfig: _maxInvocationsProjectConfigMapping[
158
- _coreContract
159
- ][_projectId]
131
+ projectId: projectId,
132
+ coreContract: coreContract,
133
+ maxInvocations: maxInvocations
160
134
  });
161
-
162
- emit ProjectMaxInvocationsLimitUpdated(
163
- _projectId,
164
- _coreContract,
165
- _maxInvocations
166
- );
167
135
  }
168
136
 
169
137
  /**
170
- * @notice Sets auction details for project `_projectId`.
138
+ * @notice Sets auction details for project `projectId`.
171
139
  * Requires one of the following:
172
140
  * - The auction is unconfigured
173
141
  * - The auction has not yet started
@@ -176,144 +144,133 @@ contract MinterDAExpV5 is
176
144
  * max invocations effectively grants the artist the ability to set a new
177
145
  * auction at any point, since minter-local max invocations can be set by
178
146
  * the artist.
179
- * @param _projectId Project ID to set auction details for.
180
- * @param _coreContract Core contract address for the given project.
181
- * @param _auctionTimestampStart Timestamp at which to start the auction.
182
- * @param _priceDecayHalfLifeSeconds The half life with which to decay the
147
+ * @param projectId Project ID to set auction details for.
148
+ * @param coreContract Core contract address for the given project.
149
+ * @param auctionTimestampStart Timestamp at which to start the auction.
150
+ * @param priceDecayHalfLifeSeconds The half life with which to decay the
183
151
  * price (in seconds).
184
- * @param _startPrice Price at which to start the auction, in Wei.
185
- * @param _basePrice Resting price of the auction, in Wei.
152
+ * @param startPrice Price at which to start the auction, in Wei.
153
+ * @param basePrice Resting price of the auction, in Wei.
186
154
  * @dev Note that it is intentionally supported here that the configured
187
155
  * price may be explicitly set to `0`.
188
156
  */
189
157
  function setAuctionDetails(
190
- uint256 _projectId,
191
- address _coreContract,
192
- uint40 _auctionTimestampStart,
193
- uint40 _priceDecayHalfLifeSeconds,
194
- uint256 _startPrice,
195
- uint256 _basePrice
158
+ uint256 projectId,
159
+ address coreContract,
160
+ uint40 auctionTimestampStart,
161
+ uint40 priceDecayHalfLifeSeconds,
162
+ uint256 startPrice,
163
+ uint256 basePrice
196
164
  ) external {
197
165
  AuthLib.onlyArtist({
198
- _projectId: _projectId,
199
- _coreContract: _coreContract,
200
- _sender: msg.sender
166
+ projectId: projectId,
167
+ coreContract: coreContract,
168
+ sender: msg.sender
201
169
  });
202
170
  // CHECKS
203
- DAExpLib.DAProjectConfig
204
- storage _auctionProjectConfig = _auctionProjectConfigMapping[
205
- _coreContract
206
- ][_projectId];
207
- MaxInvocationsLib.MaxInvocationsProjectConfig
208
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
209
- _coreContract
210
- ][_projectId];
211
-
212
171
  require(
213
- (_priceDecayHalfLifeSeconds >= minimumPriceDecayHalfLifeSeconds),
172
+ (priceDecayHalfLifeSeconds >= minimumPriceDecayHalfLifeSeconds),
214
173
  "Price decay half life must be greater than min allowable value"
215
174
  );
216
175
 
217
176
  // EFFECTS
218
- bool maxHasBeenInvoked = MaxInvocationsLib.getMaxHasBeenInvoked(
219
- _maxInvocationsProjectConfig
220
- );
221
- DAExpLib.setAuctionDetailsExp({
222
- _DAProjectConfig: _auctionProjectConfig,
223
- _auctionTimestampStart: _auctionTimestampStart,
224
- _priceDecayHalfLifeSeconds: _priceDecayHalfLifeSeconds,
225
- _startPrice: _startPrice.toUint88(),
226
- _basePrice: _basePrice.toUint88(),
227
- _allowReconfigureAfterStart: maxHasBeenInvoked
177
+ bool maxHasBeenInvoked = MaxInvocationsLib.getMaxHasBeenInvoked({
178
+ projectId: projectId,
179
+ coreContract: coreContract
228
180
  });
229
-
230
- emit SetAuctionDetailsExp({
231
- _projectId: _projectId,
232
- _coreContract: _coreContract,
233
- _auctionTimestampStart: _auctionTimestampStart,
234
- _priceDecayHalfLifeSeconds: _priceDecayHalfLifeSeconds,
235
- _startPrice: _startPrice,
236
- _basePrice: _basePrice
181
+ DAExpLib.setAuctionDetailsExp({
182
+ projectId: projectId,
183
+ coreContract: coreContract,
184
+ auctionTimestampStart: auctionTimestampStart,
185
+ priceDecayHalfLifeSeconds: priceDecayHalfLifeSeconds,
186
+ startPrice: startPrice.toUint88(),
187
+ basePrice: basePrice.toUint88(),
188
+ allowReconfigureAfterStart: maxHasBeenInvoked
237
189
  });
238
190
 
239
191
  // sync local max invocations if not initially populated
240
192
  // @dev if local max invocations and maxHasBeenInvoked are both
241
193
  // initial values, we know they have not been populated.
242
194
  if (
243
- MaxInvocationsLib.maxInvocationsIsUnconfigured(
244
- _maxInvocationsProjectConfig
245
- )
195
+ MaxInvocationsLib.maxInvocationsIsUnconfigured({
196
+ projectId: projectId,
197
+ coreContract: coreContract
198
+ })
246
199
  ) {
247
- syncProjectMaxInvocationsToCore(_projectId, _coreContract);
200
+ syncProjectMaxInvocationsToCore({
201
+ projectId: projectId,
202
+ coreContract: coreContract
203
+ });
248
204
  }
249
205
  }
250
206
 
251
207
  /**
252
208
  * @notice Sets the minimum and maximum values that are settable for
253
- * `_priceDecayHalfLifeSeconds` across all projects.
254
- * @param _minimumPriceDecayHalfLifeSeconds Minimum price decay half life
209
+ * `priceDecayHalfLifeSeconds` across all projects.
210
+ * @param minimumPriceDecayHalfLifeSeconds_ Minimum price decay half life
255
211
  * (in seconds).
256
212
  */
257
213
  function setMinimumPriceDecayHalfLifeSeconds(
258
- uint256 _minimumPriceDecayHalfLifeSeconds
214
+ uint256 minimumPriceDecayHalfLifeSeconds_
259
215
  ) external {
260
216
  AuthLib.onlyMinterFilterAdminACL({
261
- _minterFilterAddress: minterFilterAddress,
262
- _sender: msg.sender,
263
- _contract: address(this),
264
- _selector: this.setMinimumPriceDecayHalfLifeSeconds.selector
217
+ minterFilterAddress: minterFilterAddress,
218
+ sender: msg.sender,
219
+ contract_: address(this),
220
+ selector: this.setMinimumPriceDecayHalfLifeSeconds.selector
265
221
  });
266
222
  require(
267
- _minimumPriceDecayHalfLifeSeconds > 0,
223
+ minimumPriceDecayHalfLifeSeconds_ > 0,
268
224
  "Half life of zero not allowed"
269
225
  );
270
- minimumPriceDecayHalfLifeSeconds = _minimumPriceDecayHalfLifeSeconds;
226
+ minimumPriceDecayHalfLifeSeconds = minimumPriceDecayHalfLifeSeconds_;
271
227
 
272
- emit AuctionMinHalfLifeSecondsUpdated(
273
- _minimumPriceDecayHalfLifeSeconds
228
+ emit DAExpLib.AuctionMinHalfLifeSecondsUpdated(
229
+ minimumPriceDecayHalfLifeSeconds_
274
230
  );
275
231
  }
276
232
 
277
233
  /**
278
- * @notice Resets auction details for project `_projectId`, zero-ing out all
234
+ * @notice Resets auction details for project `projectId`, zero-ing out all
279
235
  * relevant auction fields. Not intended to be used in normal auction
280
236
  * operation, but rather only in case of the need to halt an auction.
281
- * @param _projectId Project ID to set auction details for.
282
- * @param _coreContract Core contract address for the given project.
237
+ * @param projectId Project ID to set auction details for.
238
+ * @param coreContract Core contract address for the given project.
283
239
  */
284
240
  function resetAuctionDetails(
285
- uint256 _projectId,
286
- address _coreContract
241
+ uint256 projectId,
242
+ address coreContract
287
243
  ) external {
288
244
  AuthLib.onlyCoreAdminACL({
289
- _coreContract: _coreContract,
290
- _sender: msg.sender,
291
- _contract: address(this),
292
- _selector: this.resetAuctionDetails.selector
245
+ coreContract: coreContract,
246
+ sender: msg.sender,
247
+ contract_: address(this),
248
+ selector: this.resetAuctionDetails.selector
293
249
  });
294
250
 
295
- delete _auctionProjectConfigMapping[_coreContract][_projectId];
296
-
297
- emit ResetAuctionDetails(_projectId, _coreContract);
251
+ DAExpLib.resetAuctionDetails({
252
+ projectId: projectId,
253
+ coreContract: coreContract
254
+ });
298
255
  }
299
256
 
300
257
  /**
301
- * @notice Purchases a token from project `_projectId`.
258
+ * @notice Purchases a token from project `projectId`.
302
259
  * Note: Collectors should not send excessive value with their purchase
303
260
  * transaction, because the artist has the ability to change the auction
304
261
  * details at any time, including the price.
305
- * @param _projectId Project ID to mint a token on.
306
- * @param _coreContract Core contract address for the given project.
262
+ * @param projectId Project ID to mint a token on.
263
+ * @param coreContract Core contract address for the given project.
307
264
  * @return tokenId Token ID of minted token
308
265
  */
309
266
  function purchase(
310
- uint256 _projectId,
311
- address _coreContract
267
+ uint256 projectId,
268
+ address coreContract
312
269
  ) external payable returns (uint256 tokenId) {
313
270
  tokenId = purchaseTo({
314
- _to: msg.sender,
315
- _projectId: _projectId,
316
- _coreContract: _coreContract
271
+ to: msg.sender,
272
+ projectId: projectId,
273
+ coreContract: coreContract
317
274
  });
318
275
 
319
276
  return tokenId;
@@ -322,26 +279,30 @@ contract MinterDAExpV5 is
322
279
  // public getter functions
323
280
  /**
324
281
  * @notice Gets the maximum invocations project configuration.
325
- * @param _projectId The ID of the project whose data needs to be fetched.
326
- * @param _coreContract The address of the core contract.
282
+ * @param projectId The ID of the project whose data needs to be fetched.
283
+ * @param coreContract The address of the core contract.
327
284
  * @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
328
285
  * configuration data.
329
286
  */
330
287
  function maxInvocationsProjectConfig(
331
- uint256 _projectId,
332
- address _coreContract
288
+ uint256 projectId,
289
+ address coreContract
333
290
  )
334
291
  external
335
292
  view
336
293
  returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
337
294
  {
338
- return _maxInvocationsProjectConfigMapping[_coreContract][_projectId];
295
+ return
296
+ MaxInvocationsLib.getMaxInvocationsProjectConfig({
297
+ projectId: projectId,
298
+ coreContract: coreContract
299
+ });
339
300
  }
340
301
 
341
302
  /**
342
303
  * @notice Retrieves the auction parameters for a specific project.
343
- * @param _projectId The unique identifier for the project.
344
- * @param _coreContract The address of the core contract for the project.
304
+ * @param projectId The unique identifier for the project.
305
+ * @param coreContract The address of the core contract for the project.
345
306
  * @return timestampStart The start timestamp for the auction.
346
307
  * @return priceDecayHalfLifeSeconds The half-life for the price decay
347
308
  * during the auction, in seconds.
@@ -349,8 +310,8 @@ contract MinterDAExpV5 is
349
310
  * @return basePrice The base price of the auction.
350
311
  */
351
312
  function projectAuctionParameters(
352
- uint256 _projectId,
353
- address _coreContract
313
+ uint256 projectId,
314
+ address coreContract
354
315
  )
355
316
  external
356
317
  view
@@ -361,10 +322,8 @@ contract MinterDAExpV5 is
361
322
  uint256 basePrice
362
323
  )
363
324
  {
364
- DAExpLib.DAProjectConfig
365
- storage _auctionProjectConfig = _auctionProjectConfigMapping[
366
- _coreContract
367
- ][_projectId];
325
+ DAExpLib.DAProjectConfig storage _auctionProjectConfig = DAExpLib
326
+ .getDAProjectConfig(projectId, coreContract);
368
327
  timestampStart = _auctionProjectConfig.timestampStart;
369
328
  priceDecayHalfLifeSeconds = _auctionProjectConfig
370
329
  .priceDecayHalfLifeSeconds;
@@ -373,26 +332,25 @@ contract MinterDAExpV5 is
373
332
  }
374
333
 
375
334
  /**
376
- * @notice Checks if the specified `_coreContract` is a valid engine contract.
377
- * @dev This function retrieves the cached value of `_coreContract` from
335
+ * @notice Checks if the specified `coreContract` is a valid engine contract.
336
+ * @dev This function retrieves the cached value of `coreContract` from
378
337
  * the `isEngineCache` mapping. If the cached value is already set, it
379
- * returns the cached value. Otherwise, it calls the `getV3CoreIsEngine`
380
- * function from the `SplitFundsLib` library to check if `_coreContract`
338
+ * returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
339
+ * function from the `SplitFundsLib` library to check if `coreContract`
381
340
  * is a valid engine contract.
382
- * @dev This function will revert if the provided `_coreContract` is not
341
+ * @dev This function will revert if the provided `coreContract` is not
383
342
  * a valid Engine or V3 Flagship contract.
384
- * @param _coreContract The address of the contract to check.
385
- * @return bool indicating if `_coreContract` is a valid engine contract.
343
+ * @param coreContract The address of the contract to check.
344
+ * @return bool indicating if `coreContract` is a valid engine contract.
386
345
  */
387
- function isEngineView(address _coreContract) external view returns (bool) {
388
- SplitFundsLib.IsEngineCache storage isEngineCache = _isEngineCaches[
389
- _coreContract
390
- ];
346
+ function isEngineView(address coreContract) external view returns (bool) {
347
+ SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
348
+ .getIsEngineCacheConfig(coreContract);
391
349
  if (isEngineCache.isCached) {
392
350
  return isEngineCache.isEngine;
393
351
  } else {
394
- // @dev this calls the non-modifying variant of getV3CoreIsEngine
395
- return SplitFundsLib.getV3CoreIsEngineView(_coreContract);
352
+ // @dev this calls the non-state-modifying variant of isEngine
353
+ return SplitFundsLib.getV3CoreIsEngineView(coreContract);
396
354
  }
397
355
  }
398
356
 
@@ -407,17 +365,18 @@ contract MinterDAExpV5 is
407
365
  * possible because the V3 core contract only allows maximum invocations
408
366
  * to be reduced, not increased. Based on this rationale, we intentionally
409
367
  * do not do input validation in this method as to whether or not the input
410
- * @param _projectId is an existing project ID.
411
- * @param _coreContract is an existing core contract address.
368
+ * @param projectId is an existing project ID.
369
+ * @param coreContract is an existing core contract address.
412
370
  */
413
371
  function projectMaxHasBeenInvoked(
414
- uint256 _projectId,
415
- address _coreContract
372
+ uint256 projectId,
373
+ address coreContract
416
374
  ) external view returns (bool) {
417
375
  return
418
- MaxInvocationsLib.getMaxHasBeenInvoked(
419
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
420
- );
376
+ MaxInvocationsLib.getMaxHasBeenInvoked({
377
+ projectId: projectId,
378
+ coreContract: coreContract
379
+ });
421
380
  }
422
381
 
423
382
  /**
@@ -436,26 +395,27 @@ contract MinterDAExpV5 is
436
395
  * increased. When this happens, the minter will enable minting, allowing
437
396
  * the core contract to enforce the max invocations check. Based on this
438
397
  * rationale, we intentionally do not do input validation in this method as
439
- * to whether or not the input `_projectId` is an existing project ID.
440
- * @param _projectId is an existing project ID.
441
- * @param _coreContract is an existing core contract address.
398
+ * to whether or not the input `projectId` is an existing project ID.
399
+ * @param projectId is an existing project ID.
400
+ * @param coreContract is an existing core contract address.
442
401
  */
443
402
  function projectMaxInvocations(
444
- uint256 _projectId,
445
- address _coreContract
403
+ uint256 projectId,
404
+ address coreContract
446
405
  ) external view returns (uint256) {
447
406
  return
448
- MaxInvocationsLib.getMaxInvocations(
449
- _maxInvocationsProjectConfigMapping[_coreContract][_projectId]
450
- );
407
+ MaxInvocationsLib.getMaxInvocations({
408
+ projectId: projectId,
409
+ coreContract: coreContract
410
+ });
451
411
  }
452
412
 
453
413
  /**
454
414
  * @notice Gets if price of token is configured, price of minting a
455
- * token on project `_projectId`, and currency symbol and address to be
415
+ * token on project `projectId`, and currency symbol and address to be
456
416
  * used as payment. Supersedes any core contract price information.
457
- * @param _projectId Project ID to get price information for
458
- * @param _coreContract Contract address of the core contract
417
+ * @param projectId Project ID to get price information for
418
+ * @param coreContract Contract address of the core contract
459
419
  * @return isConfigured true only if token price has been configured on
460
420
  * this minter
461
421
  * @return tokenPriceInWei current price of token on this minter - invalid
@@ -466,8 +426,8 @@ contract MinterDAExpV5 is
466
426
  * this minter. This minter always returns null address, reserved for ether
467
427
  */
468
428
  function getPriceInfo(
469
- uint256 _projectId,
470
- address _coreContract
429
+ uint256 projectId,
430
+ address coreContract
471
431
  )
472
432
  external
473
433
  view
@@ -478,10 +438,11 @@ contract MinterDAExpV5 is
478
438
  address currencyAddress
479
439
  )
480
440
  {
481
- DAExpLib.DAProjectConfig
482
- storage auctionProjectConfig = _auctionProjectConfigMapping[
483
- _coreContract
484
- ][_projectId];
441
+ DAExpLib.DAProjectConfig storage auctionProjectConfig = DAExpLib
442
+ .getDAProjectConfig({
443
+ projectId: projectId,
444
+ coreContract: coreContract
445
+ });
485
446
  isConfigured = (auctionProjectConfig.startPrice > 0);
486
447
  if (!isConfigured) {
487
448
  // In the case of unconfigured auction, return price of zero when
@@ -493,112 +454,90 @@ contract MinterDAExpV5 is
493
454
  // before auction starts.
494
455
  tokenPriceInWei = auctionProjectConfig.startPrice;
495
456
  } else {
496
- tokenPriceInWei = DAExpLib.getPriceExp(auctionProjectConfig);
457
+ tokenPriceInWei = DAExpLib.getPriceExp({
458
+ projectId: projectId,
459
+ coreContract: coreContract
460
+ });
497
461
  }
498
462
  currencySymbol = "ETH";
499
463
  currencyAddress = address(0);
500
464
  }
501
465
 
502
466
  /**
503
- * @notice Syncs local maximum invocations of project `_projectId` based on
467
+ * @notice Syncs local maximum invocations of project `projectId` based on
504
468
  * the value currently defined in the core contract.
505
- * @param _projectId Project ID to set the maximum invocations for.
506
- * @param _coreContract Core contract address for the given project.
469
+ * @param projectId Project ID to set the maximum invocations for.
470
+ * @param coreContract Core contract address for the given project.
507
471
  * @dev this enables gas reduction after maxInvocations have been reached -
508
472
  * core contracts shall still enforce a maxInvocation check during mint.
509
473
  */
510
474
  function syncProjectMaxInvocationsToCore(
511
- uint256 _projectId,
512
- address _coreContract
475
+ uint256 projectId,
476
+ address coreContract
513
477
  ) public {
514
478
  AuthLib.onlyArtist({
515
- _projectId: _projectId,
516
- _coreContract: _coreContract,
517
- _sender: msg.sender
479
+ projectId: projectId,
480
+ coreContract: coreContract,
481
+ sender: msg.sender
518
482
  });
519
483
 
520
- uint256 maxInvocations = MaxInvocationsLib
521
- .syncProjectMaxInvocationsToCore({
522
- _projectId: _projectId,
523
- _coreContract: _coreContract,
524
- maxInvocationsProjectConfig: _maxInvocationsProjectConfigMapping[
525
- _coreContract
526
- ][_projectId]
527
- });
528
- emit ProjectMaxInvocationsLimitUpdated(
529
- _projectId,
530
- _coreContract,
531
- maxInvocations
532
- );
484
+ MaxInvocationsLib.syncProjectMaxInvocationsToCore({
485
+ projectId: projectId,
486
+ coreContract: coreContract
487
+ });
533
488
  }
534
489
 
535
490
  /**
536
- * @notice Purchases a token from project `_projectId` and sets
537
- * the token's owner to `_to`.
491
+ * @notice Purchases a token from project `projectId` and sets
492
+ * the token's owner to `to`.
538
493
  * Note: Collectors should not send excessive value with their purchase
539
494
  * transaction, because the artist has the ability to change the auction
540
495
  * details at any time, including the price.
541
- * @param _to Address to be the new token's owner.
542
- * @param _projectId Project ID to mint a token on.
543
- * @param _coreContract Core contract address for the given project.
496
+ * @param to Address to be the new token's owner.
497
+ * @param projectId Project ID to mint a token on.
498
+ * @param coreContract Core contract address for the given project.
544
499
  * @return tokenId Token ID of minted token
545
500
  */
546
501
  function purchaseTo(
547
- address _to,
548
- uint256 _projectId,
549
- address _coreContract
502
+ address to,
503
+ uint256 projectId,
504
+ address coreContract
550
505
  ) public payable nonReentrant returns (uint256 tokenId) {
551
506
  // CHECKS
552
- MaxInvocationsLib.MaxInvocationsProjectConfig
553
- storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
554
- _coreContract
555
- ][_projectId];
556
-
557
- DAExpLib.DAProjectConfig
558
- storage _auctionProjectConfig = _auctionProjectConfigMapping[
559
- _coreContract
560
- ][_projectId];
561
-
507
+ // pre-mint MaxInvocationsLib checks
562
508
  // Note that `maxHasBeenInvoked` is only checked here to reduce gas
563
509
  // consumption after a project has been fully minted.
564
- // `_maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
510
+ // `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
565
511
  // gas consumption, but if not in sync with the core contract's value,
566
512
  // the core contract also enforces its own max invocation check during
567
513
  // minting.
568
- require(
569
- !_maxInvocationsProjectConfig.maxHasBeenInvoked,
570
- "Max invocations reached"
571
- );
514
+ MaxInvocationsLib.preMintChecks(projectId, coreContract);
572
515
 
573
516
  // getPriceExp reverts if auction is unconfigured or has not started
574
- uint256 pricePerTokenInWei = DAExpLib.getPriceExp(
575
- _auctionProjectConfig
576
- );
517
+ uint256 pricePerTokenInWei = DAExpLib.getPriceExp({
518
+ projectId: projectId,
519
+ coreContract: coreContract
520
+ });
577
521
  require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
578
522
 
579
523
  // EFFECTS
580
- tokenId = minterFilter.mint_joo({
581
- _to: _to,
582
- _projectId: _projectId,
583
- _coreContract: _coreContract,
584
- _sender: msg.sender
524
+ tokenId = _minterFilter.mint_joo({
525
+ to: to,
526
+ projectId: projectId,
527
+ coreContract: coreContract,
528
+ sender: msg.sender
585
529
  });
586
530
 
587
- MaxInvocationsLib.validatePurchaseEffectsInvocations(
588
- tokenId,
589
- _maxInvocationsProjectConfig
590
- );
531
+ MaxInvocationsLib.validatePurchaseEffectsInvocations({
532
+ tokenId: tokenId,
533
+ coreContract: coreContract
534
+ });
591
535
 
592
536
  // INTERACTIONS
593
- bool isEngine = SplitFundsLib.isEngine(
594
- _coreContract,
595
- _isEngineCaches[_coreContract]
596
- );
597
- SplitFundsLib.splitFundsETH({
598
- _projectId: _projectId,
599
- _pricePerTokenInWei: pricePerTokenInWei,
600
- _coreContract: _coreContract,
601
- _isEngine: isEngine
537
+ SplitFundsLib.splitFundsETHRefundSender({
538
+ projectId: projectId,
539
+ pricePerTokenInWei: pricePerTokenInWei,
540
+ coreContract: coreContract
602
541
  });
603
542
 
604
543
  return tokenId;