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