@artblocks/contracts 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/artifacts/contracts/AdminACLV1.sol/AdminACLV1.json +2 -2
- package/artifacts/contracts/DependencyRegistryV0.sol/DependencyRegistryV0.json +97 -10
- package/artifacts/contracts/GenArt721CoreV3.sol/GenArt721CoreV3.json +4 -4
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine.sol/GenArt721CoreV3_Engine.json +4 -9
- package/artifacts/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol/GenArt721CoreV3_Engine_Flex.json +4 -9
- package/artifacts/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol/GenArt721CoreV3_Engine_Flex_PROOF.json +4 -9
- package/artifacts/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol/GenArt721CoreV3_Engine_Flex_PROHIBITION.json +4 -9
- package/artifacts/contracts/engine-registry/CoreRegistryV1.sol/CoreRegistryV1.json +12 -12
- package/artifacts/contracts/explorations/GenArt721CoreV3_Explorations.sol/GenArt721CoreV3_Explorations.json +4 -4
- package/artifacts/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol/ICoreRegistryV1.json +6 -6
- package/artifacts/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol/IDependencyRegistryV0.json +19 -0
- package/artifacts/contracts/interfaces/v0.8.x/IMinterFilterV1.sol/IMinterFilterV1.json +22 -22
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol/ISharedMinterDAExpSettlementV0.json +8 -101
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol/ISharedMinterDAExpV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol/ISharedMinterDALinV0.json +1 -57
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol/ISharedMinterDAV0.json +2 -21
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol/ISharedMinterHolderERC20V0.json +158 -0
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol/ISharedMinterHolderV0.json +15 -90
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol/ISharedMinterMerkleV0.json +10 -36
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol/ISharedMinterSEAV0.json +4 -236
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol/ISharedMinterSimplePurchaseV0.json +5 -5
- package/artifacts/contracts/interfaces/v0.8.x/ISharedMinterV0.sol/ISharedMinterV0.json +7 -423
- package/artifacts/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol/ISharedRandomizerV0.json +17 -17
- package/artifacts/contracts/libs/v0.8.x/ABHelpers.sol/ABHelpers.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/AuthLib.sol/AuthLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/Bytes32Strings.sol/Bytes32Strings.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol/DAExpLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALib.sol/DALib.json +30 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/DALinLib.sol/DALinLib.json +60 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol/GenericMinterEventsLib.json +346 -0
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol/MaxInvocationsLib.json +29 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol/MerkleLib.json +30 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol/PolyptychLib.json +2 -2
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SEALib.sol/SEALib.json +254 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol/SetPriceLib.json +48 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol/SettlementExpLib.json +41 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol/SplitFundsLib.json +35 -3
- package/artifacts/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol/TokenHolderLib.json +79 -3
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV1.sol/MinterFilterV1.json +2 -2
- package/artifacts/contracts/minter-suite/MinterFilter/MinterFilterV2.sol/MinterFilterV2.json +41 -41
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol/MinterDAExpHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol/MinterDAExpSettlementV2.json +2 -20
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol/MinterDAExpSettlementV3.json +67 -594
- package/artifacts/contracts/minter-suite/Minters/MinterDAExpV5.sol/MinterDAExpV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterDALinHolderV5.sol/MinterDALinHolderV5.json +66 -632
- package/artifacts/contracts/minter-suite/Minters/MinterDALinV5.sol/MinterDALinV5.json +33 -524
- package/artifacts/contracts/minter-suite/Minters/MinterSEAV1.sol/MinterSEAV1.json +51 -717
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol/MinterSetPriceERC20V5.json +58 -454
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol/MinterSetPriceHolderV5.json +61 -552
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol/MinterSetPriceMerkleV5.json +55 -497
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol/MinterSetPricePolyptychERC20V5.json +110 -571
- package/artifacts/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol/MinterSetPricePolyptychV5.json +69 -560
- package/artifacts/contracts/minter-suite/Minters/MinterSetPriceV5.sol/MinterSetPriceV5.json +28 -444
- package/artifacts/contracts/mock/DummySharedMinter.sol/DummySharedMinter.json +2 -2
- package/artifacts/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol/GenArt721CoreV3_Engine_IncorrectCoreType.json +4 -9
- package/artifacts/contracts/mock/OriginRegisterMock.sol/OriginRegisterMock.json +2 -2
- package/artifacts/contracts/mock/ReentrancyHolderMockShared.sol/ReentrancyHolderMockShared.json +136 -0
- package/artifacts/contracts/mock/ReentrancyMerkleMockShared.sol/ReentrancyMerkleMockShared.json +105 -0
- package/artifacts/contracts/mock/ReentrancyMockShared.sol/ReentrancyMockShared.json +100 -0
- package/artifacts/contracts/mock/ReentrancySEAMockShared.sol/ReentrancySEAAutoBidderMockShared.json +69 -0
- package/artifacts/contracts/randomizer/shared/SharedRandomizerV0.sol/SharedRandomizerV0.json +19 -19
- package/contracts/DependencyRegistryV0.sol +84 -16
- package/contracts/archive/readme.md +16 -0
- package/contracts/engine/README.md +21 -0
- package/contracts/engine/V3/GenArt721CoreV3_Engine.sol +4 -10
- package/contracts/engine/V3/GenArt721CoreV3_Engine_Flex.sol +4 -10
- package/contracts/engine/V3/forks/GenArt721CoreV3_Engine_Flex_PROOF.sol +4 -10
- package/contracts/engine/V3/forks/PROHIBITION/GenArt721CoreV3_Engine_Flex_PROHIBITION.sol +4 -10
- package/contracts/engine-registry/CoreRegistryV1.sol +58 -65
- package/contracts/interfaces/v0.8.x/ICoreRegistryV1.sol +6 -8
- package/contracts/interfaces/v0.8.x/IDependencyRegistryV0.sol +3 -0
- package/contracts/interfaces/v0.8.x/IMinterFilterV1.sol +25 -25
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpSettlementV0.sol +11 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterDAExpV0.sol +1 -14
- package/contracts/interfaces/v0.8.x/ISharedMinterDALinV0.sol +1 -15
- package/contracts/interfaces/v0.8.x/ISharedMinterDAV0.sol +2 -8
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderERC20V0.sol +47 -0
- package/contracts/interfaces/v0.8.x/ISharedMinterHolderV0.sol +15 -43
- package/contracts/interfaces/v0.8.x/ISharedMinterMerkleV0.sol +10 -20
- package/contracts/interfaces/v0.8.x/ISharedMinterSEAV0.sol +4 -67
- package/contracts/interfaces/v0.8.x/ISharedMinterSimplePurchaseV0.sol +5 -5
- package/contracts/interfaces/v0.8.x/ISharedMinterV0.sol +7 -155
- package/contracts/interfaces/v0.8.x/ISharedRandomizerV0.sol +37 -37
- package/contracts/libs/v0.8.x/ABHelpers.sol +14 -14
- package/contracts/libs/v0.8.x/AuthLib.sol +101 -102
- package/contracts/libs/v0.8.x/Bytes32Strings.sol +5 -5
- package/contracts/libs/v0.8.x/minter-libs/DAExpLib.sol +163 -38
- package/contracts/libs/v0.8.x/minter-libs/DALib.sol +26 -0
- package/contracts/libs/v0.8.x/minter-libs/DALinLib.sol +144 -37
- package/contracts/libs/v0.8.x/minter-libs/GenericMinterEventsLib.sol +171 -0
- package/contracts/libs/v0.8.x/minter-libs/MaxInvocationsLib.sol +250 -110
- package/contracts/libs/v0.8.x/minter-libs/MerkleLib.sol +257 -48
- package/contracts/libs/v0.8.x/minter-libs/PolyptychLib.sol +138 -58
- package/contracts/libs/v0.8.x/minter-libs/SEALib.sol +778 -103
- package/contracts/libs/v0.8.x/minter-libs/SetPriceLib.sol +135 -13
- package/contracts/libs/v0.8.x/minter-libs/SettlementExpLib.sol +567 -187
- package/contracts/libs/v0.8.x/minter-libs/SplitFundsLib.sol +480 -322
- package/contracts/libs/v0.8.x/minter-libs/TokenHolderLib.sol +214 -76
- package/contracts/minter-suite/MinterFilter/MinterFilterV2.sol +347 -304
- package/contracts/minter-suite/Minters/MinterDAExpHolderV5.sol +391 -491
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV2.sol +1 -54
- package/contracts/minter-suite/Minters/MinterDAExpSettlementV3.sol +388 -628
- package/contracts/minter-suite/Minters/MinterDAExpV5.sol +212 -273
- package/contracts/minter-suite/Minters/MinterDALinHolderV5.sol +393 -488
- package/contracts/minter-suite/Minters/MinterDALinV5.sol +220 -277
- package/contracts/minter-suite/Minters/MinterSEAV1.sol +327 -664
- package/contracts/minter-suite/Minters/MinterSetPriceERC20V5.sol +278 -303
- package/contracts/minter-suite/Minters/MinterSetPriceHolderV5.sol +355 -446
- package/contracts/minter-suite/Minters/MinterSetPriceMerkleV5.sol +328 -416
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychERC20V5.sol +538 -622
- package/contracts/minter-suite/Minters/MinterSetPricePolyptychV5.sol +429 -553
- package/contracts/minter-suite/Minters/MinterSetPriceV5.sol +180 -227
- package/contracts/mock/GenArt721CoreV3_Engine_IncorrectCoreType.sol +3 -10
- package/contracts/mock/ReentrancyHolderMockShared.sol +59 -0
- package/contracts/mock/ReentrancyMerkleMockShared.sol +58 -0
- package/contracts/mock/ReentrancyMockShared.sol +48 -0
- package/contracts/mock/ReentrancySEAMockShared.sol +40 -0
- package/contracts/randomizer/shared/SharedRandomizerV0.sol +78 -70
- package/package.json +39 -33
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
2
|
// Created By: Art Blocks Inc.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 "../../
|
|
11
|
-
import "../../
|
|
12
|
-
import "../../
|
|
13
|
-
import "../../
|
|
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 "
|
|
16
|
-
import "
|
|
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
|
-
|
|
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
|
|
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
|
-
* `
|
|
122
|
-
* @param
|
|
96
|
+
* `minterFilter` minter filter.
|
|
97
|
+
* @param minterFilter Minter filter for which this will be a
|
|
123
98
|
* filtered minter.
|
|
124
99
|
*/
|
|
125
|
-
constructor(address
|
|
126
|
-
minterFilterAddress =
|
|
127
|
-
|
|
128
|
-
emit AuctionMinHalfLifeSecondsUpdated(
|
|
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 `
|
|
133
|
-
* with the provided `
|
|
134
|
-
* than or equal to the value of project `
|
|
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 `
|
|
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
|
|
140
|
-
* @param
|
|
141
|
-
* @param
|
|
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
|
|
145
|
-
address
|
|
146
|
-
uint24
|
|
121
|
+
uint256 projectId,
|
|
122
|
+
address coreContract,
|
|
123
|
+
uint24 maxInvocations
|
|
147
124
|
) external {
|
|
148
125
|
AuthLib.onlyArtist({
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
126
|
+
projectId: projectId,
|
|
127
|
+
coreContract: coreContract,
|
|
128
|
+
sender: msg.sender
|
|
152
129
|
});
|
|
153
130
|
MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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 `
|
|
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
|
|
180
|
-
* @param
|
|
181
|
-
* @param
|
|
182
|
-
* @param
|
|
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
|
|
185
|
-
* @param
|
|
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
|
|
191
|
-
address
|
|
192
|
-
uint40
|
|
193
|
-
uint40
|
|
194
|
-
uint256
|
|
195
|
-
uint256
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
(
|
|
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
|
-
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
245
|
-
|
|
195
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured({
|
|
196
|
+
projectId: projectId,
|
|
197
|
+
coreContract: coreContract
|
|
198
|
+
})
|
|
246
199
|
) {
|
|
247
|
-
syncProjectMaxInvocationsToCore(
|
|
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
|
-
* `
|
|
254
|
-
* @param
|
|
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
|
|
214
|
+
uint256 minimumPriceDecayHalfLifeSeconds_
|
|
259
215
|
) external {
|
|
260
216
|
AuthLib.onlyMinterFilterAdminACL({
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
217
|
+
minterFilterAddress: minterFilterAddress,
|
|
218
|
+
sender: msg.sender,
|
|
219
|
+
contract_: address(this),
|
|
220
|
+
selector: this.setMinimumPriceDecayHalfLifeSeconds.selector
|
|
265
221
|
});
|
|
266
222
|
require(
|
|
267
|
-
|
|
223
|
+
minimumPriceDecayHalfLifeSeconds_ > 0,
|
|
268
224
|
"Half life of zero not allowed"
|
|
269
225
|
);
|
|
270
|
-
minimumPriceDecayHalfLifeSeconds =
|
|
226
|
+
minimumPriceDecayHalfLifeSeconds = minimumPriceDecayHalfLifeSeconds_;
|
|
271
227
|
|
|
272
|
-
emit AuctionMinHalfLifeSecondsUpdated(
|
|
273
|
-
|
|
228
|
+
emit DAExpLib.AuctionMinHalfLifeSecondsUpdated(
|
|
229
|
+
minimumPriceDecayHalfLifeSeconds_
|
|
274
230
|
);
|
|
275
231
|
}
|
|
276
232
|
|
|
277
233
|
/**
|
|
278
|
-
* @notice Resets auction details for project `
|
|
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
|
|
282
|
-
* @param
|
|
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
|
|
286
|
-
address
|
|
241
|
+
uint256 projectId,
|
|
242
|
+
address coreContract
|
|
287
243
|
) external {
|
|
288
244
|
AuthLib.onlyCoreAdminACL({
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
245
|
+
coreContract: coreContract,
|
|
246
|
+
sender: msg.sender,
|
|
247
|
+
contract_: address(this),
|
|
248
|
+
selector: this.resetAuctionDetails.selector
|
|
293
249
|
});
|
|
294
250
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
251
|
+
DAExpLib.resetAuctionDetails({
|
|
252
|
+
projectId: projectId,
|
|
253
|
+
coreContract: coreContract
|
|
254
|
+
});
|
|
298
255
|
}
|
|
299
256
|
|
|
300
257
|
/**
|
|
301
|
-
* @notice Purchases a token from project `
|
|
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
|
|
306
|
-
* @param
|
|
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
|
|
311
|
-
address
|
|
267
|
+
uint256 projectId,
|
|
268
|
+
address coreContract
|
|
312
269
|
) external payable returns (uint256 tokenId) {
|
|
313
270
|
tokenId = purchaseTo({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
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
|
|
326
|
-
* @param
|
|
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
|
|
332
|
-
address
|
|
288
|
+
uint256 projectId,
|
|
289
|
+
address coreContract
|
|
333
290
|
)
|
|
334
291
|
external
|
|
335
292
|
view
|
|
336
293
|
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
337
294
|
{
|
|
338
|
-
return
|
|
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
|
|
344
|
-
* @param
|
|
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
|
|
353
|
-
address
|
|
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
|
-
|
|
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 `
|
|
377
|
-
* @dev This function retrieves the cached value of `
|
|
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 `
|
|
380
|
-
* function from the `SplitFundsLib` library to check if `
|
|
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 `
|
|
341
|
+
* @dev This function will revert if the provided `coreContract` is not
|
|
383
342
|
* a valid Engine or V3 Flagship contract.
|
|
384
|
-
* @param
|
|
385
|
-
* @return bool indicating if `
|
|
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
|
|
388
|
-
SplitFundsLib.IsEngineCache storage isEngineCache =
|
|
389
|
-
|
|
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
|
|
395
|
-
return SplitFundsLib.getV3CoreIsEngineView(
|
|
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
|
|
411
|
-
* @param
|
|
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
|
|
415
|
-
address
|
|
372
|
+
uint256 projectId,
|
|
373
|
+
address coreContract
|
|
416
374
|
) external view returns (bool) {
|
|
417
375
|
return
|
|
418
|
-
MaxInvocationsLib.getMaxHasBeenInvoked(
|
|
419
|
-
|
|
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 `
|
|
440
|
-
* @param
|
|
441
|
-
* @param
|
|
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
|
|
445
|
-
address
|
|
403
|
+
uint256 projectId,
|
|
404
|
+
address coreContract
|
|
446
405
|
) external view returns (uint256) {
|
|
447
406
|
return
|
|
448
|
-
MaxInvocationsLib.getMaxInvocations(
|
|
449
|
-
|
|
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 `
|
|
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
|
|
458
|
-
* @param
|
|
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
|
|
470
|
-
address
|
|
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
|
-
|
|
483
|
-
|
|
484
|
-
|
|
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(
|
|
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 `
|
|
467
|
+
* @notice Syncs local maximum invocations of project `projectId` based on
|
|
504
468
|
* the value currently defined in the core contract.
|
|
505
|
-
* @param
|
|
506
|
-
* @param
|
|
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
|
|
512
|
-
address
|
|
475
|
+
uint256 projectId,
|
|
476
|
+
address coreContract
|
|
513
477
|
) public {
|
|
514
478
|
AuthLib.onlyArtist({
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
479
|
+
projectId: projectId,
|
|
480
|
+
coreContract: coreContract,
|
|
481
|
+
sender: msg.sender
|
|
518
482
|
});
|
|
519
483
|
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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 `
|
|
537
|
-
* the token's owner 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
|
|
542
|
-
* @param
|
|
543
|
-
* @param
|
|
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
|
|
548
|
-
uint256
|
|
549
|
-
address
|
|
502
|
+
address to,
|
|
503
|
+
uint256 projectId,
|
|
504
|
+
address coreContract
|
|
550
505
|
) public payable nonReentrant returns (uint256 tokenId) {
|
|
551
506
|
// CHECKS
|
|
552
|
-
MaxInvocationsLib
|
|
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
|
-
// `
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
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
|
-
|
|
590
|
-
);
|
|
531
|
+
MaxInvocationsLib.validatePurchaseEffectsInvocations({
|
|
532
|
+
tokenId: tokenId,
|
|
533
|
+
coreContract: coreContract
|
|
534
|
+
});
|
|
591
535
|
|
|
592
536
|
// INTERACTIONS
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
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;
|