@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,25 +1,27 @@
|
|
|
1
1
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
2
2
|
// Created By: Art Blocks Inc.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import "../../interfaces/v0.8.x/ISharedMinterDAV0.sol";
|
|
7
|
-
import "../../interfaces/v0.8.x/ISharedMinterDALinV0.sol";
|
|
8
|
-
import "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
|
|
9
|
-
import "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
10
|
-
|
|
11
|
-
import "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
12
|
-
import "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
|
|
13
|
-
import "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
|
|
14
|
-
import "../../libs/v0.8.x/minter-libs/DALinLib.sol";
|
|
15
|
-
import "../../libs/v0.8.x/AuthLib.sol";
|
|
16
|
-
|
|
17
|
-
import "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
|
|
18
|
-
import "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
|
|
19
|
-
import "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
|
|
20
|
-
|
|
4
|
+
// @dev fixed to specific solidity version for clarity and for more clear
|
|
5
|
+
// source code verification purposes.
|
|
21
6
|
pragma solidity 0.8.19;
|
|
22
7
|
|
|
8
|
+
import {IDelegationRegistry} from "../../interfaces/v0.8.x/IDelegationRegistry.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 {ISharedMinterHolderV0} from "../../interfaces/v0.8.x/ISharedMinterHolderV0.sol";
|
|
13
|
+
import {IMinterFilterV1} from "../../interfaces/v0.8.x/IMinterFilterV1.sol";
|
|
14
|
+
|
|
15
|
+
import {SplitFundsLib} from "../../libs/v0.8.x/minter-libs/SplitFundsLib.sol";
|
|
16
|
+
import {MaxInvocationsLib} from "../../libs/v0.8.x/minter-libs/MaxInvocationsLib.sol";
|
|
17
|
+
import {TokenHolderLib} from "../../libs/v0.8.x/minter-libs/TokenHolderLib.sol";
|
|
18
|
+
import {DALinLib} from "../../libs/v0.8.x/minter-libs/DALinLib.sol";
|
|
19
|
+
import {AuthLib} from "../../libs/v0.8.x/AuthLib.sol";
|
|
20
|
+
|
|
21
|
+
import {SafeCast} from "@openzeppelin-4.7/contracts/utils/math/SafeCast.sol";
|
|
22
|
+
import {ReentrancyGuard} from "@openzeppelin-4.5/contracts/security/ReentrancyGuard.sol";
|
|
23
|
+
import {EnumerableSet} from "@openzeppelin-4.5/contracts/utils/structs/EnumerableSet.sol";
|
|
24
|
+
|
|
23
25
|
/**
|
|
24
26
|
* @title Shared, filtered Minter contract that allows tokens to be minted with
|
|
25
27
|
* ETH when purchaser owns an allowlisted ERC-721 NFT. This contract does NOT
|
|
@@ -72,6 +74,13 @@ pragma solidity 0.8.19;
|
|
|
72
74
|
* delegation types include token-level, contract-level (via genArt721CoreAddress), or
|
|
73
75
|
* wallet-level delegation. Contract-level delegations must be configured for the core
|
|
74
76
|
* token contract as returned by the public immutable variable `genArt721CoreAddress`.
|
|
77
|
+
* ----------------------------------------------------------------------------
|
|
78
|
+
* @notice Caution: While Engine projects must be registered on the Art Blocks
|
|
79
|
+
* Core Registry to assign this minter, this minter does not enforce that a
|
|
80
|
+
* project is registered when configured or queried. This is primarily for gas
|
|
81
|
+
* optimization purposes. It is, therefore, possible that fake projects may be
|
|
82
|
+
* configured on this minter, but they will not be able to mint tokens due to
|
|
83
|
+
* checks performed by this minter's Minter Filter.
|
|
75
84
|
*
|
|
76
85
|
* @dev Note that while this minter makes use of `block.timestamp` and it is
|
|
77
86
|
* technically possible that this value is manipulated by block producers, such
|
|
@@ -96,13 +105,13 @@ contract MinterDALinHolderV5 is
|
|
|
96
105
|
address public immutable minterFilterAddress;
|
|
97
106
|
|
|
98
107
|
/// Minter filter this minter may interact with.
|
|
99
|
-
IMinterFilterV1 private immutable
|
|
108
|
+
IMinterFilterV1 private immutable _minterFilter;
|
|
100
109
|
|
|
101
110
|
// Delegation registry address
|
|
102
111
|
address public immutable delegationRegistryAddress;
|
|
103
112
|
|
|
104
113
|
// Delegation registry address
|
|
105
|
-
IDelegationRegistry private immutable
|
|
114
|
+
IDelegationRegistry private immutable _delegationRegistryContract;
|
|
106
115
|
|
|
107
116
|
/// minterType for this minter
|
|
108
117
|
string public constant minterType = "MinterDALinHolderV5";
|
|
@@ -113,272 +122,187 @@ contract MinterDALinHolderV5 is
|
|
|
113
122
|
/// Minimum auction length in seconds
|
|
114
123
|
uint256 public minimumAuctionLengthSeconds = 600; // 10 minutes
|
|
115
124
|
|
|
116
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
117
|
-
// STATE VARIABLES FOR SplitFundsLib begin here
|
|
118
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
119
|
-
|
|
120
|
-
// contractAddress => IsEngineCache
|
|
121
|
-
mapping(address => SplitFundsLib.IsEngineCache) private _isEngineCaches;
|
|
122
|
-
|
|
123
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
124
|
-
// STATE VARIABLES FOR SplitFundsLib end here
|
|
125
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
126
|
-
|
|
127
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
128
|
-
// STATE VARIABLES FOR DALinLib begin here
|
|
129
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
130
|
-
|
|
131
|
-
mapping(address => mapping(uint256 => DALinLib.DAProjectConfig))
|
|
132
|
-
private _auctionProjectConfigMapping;
|
|
133
|
-
|
|
134
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
135
|
-
// STATE VARIABLES FOR DALinLib end here
|
|
136
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
137
|
-
|
|
138
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
139
|
-
// STATE VARIABLES FOR MaxInvocationsLib begin here
|
|
140
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
141
|
-
|
|
142
|
-
// contractAddress => projectId => max invocations specific project config
|
|
143
|
-
mapping(address => mapping(uint256 => MaxInvocationsLib.MaxInvocationsProjectConfig))
|
|
144
|
-
private _maxInvocationsProjectConfigMapping;
|
|
145
|
-
|
|
146
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
147
|
-
// STATE VARIABLES FOR MaxInvocationsLib end here
|
|
148
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
149
|
-
|
|
150
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
151
|
-
// STATE VARIABLES FOR TokenHolderLib begin here
|
|
152
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* coreContract => projectId => ownedNFTAddress => ownedNFTProjectIds => bool
|
|
156
|
-
* projects whose holders are allowed to purchase a token on `projectId`
|
|
157
|
-
*/
|
|
158
|
-
mapping(address => mapping(uint256 => TokenHolderLib.HolderProjectConfig))
|
|
159
|
-
private _allowedProjectHoldersMapping;
|
|
160
|
-
|
|
161
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
162
|
-
// STATE VARIABLES FOR TokenHolderLib end here
|
|
163
|
-
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
164
|
-
|
|
165
125
|
/**
|
|
166
126
|
* @notice Initializes contract to be a Filtered Minter for
|
|
167
|
-
* `
|
|
168
|
-
* @param
|
|
127
|
+
* `minterFilter` minter filter.
|
|
128
|
+
* @param minterFilter Minter filter for which this will be a
|
|
169
129
|
* filtered minter.
|
|
170
130
|
*/
|
|
171
131
|
constructor(
|
|
172
|
-
address
|
|
173
|
-
address
|
|
132
|
+
address minterFilter,
|
|
133
|
+
address delegationRegistryAddress_
|
|
174
134
|
) ReentrancyGuard() {
|
|
175
|
-
minterFilterAddress =
|
|
176
|
-
|
|
135
|
+
minterFilterAddress = minterFilter;
|
|
136
|
+
_minterFilter = IMinterFilterV1(minterFilter);
|
|
177
137
|
|
|
178
|
-
delegationRegistryAddress =
|
|
179
|
-
|
|
180
|
-
|
|
138
|
+
delegationRegistryAddress = delegationRegistryAddress_;
|
|
139
|
+
_delegationRegistryContract = IDelegationRegistry(
|
|
140
|
+
delegationRegistryAddress_
|
|
141
|
+
);
|
|
142
|
+
emit TokenHolderLib.DelegationRegistryUpdated(
|
|
143
|
+
delegationRegistryAddress_
|
|
144
|
+
);
|
|
145
|
+
emit DALinLib.AuctionMinimumLengthSecondsUpdated(
|
|
146
|
+
minimumAuctionLengthSeconds
|
|
181
147
|
);
|
|
182
|
-
emit DelegationRegistryUpdated(_delegationRegistryAddress);
|
|
183
|
-
emit AuctionMinimumLengthSecondsUpdated(minimumAuctionLengthSeconds);
|
|
184
148
|
}
|
|
185
149
|
|
|
186
150
|
/**
|
|
187
|
-
* @notice Manually sets the local maximum invocations of project `
|
|
188
|
-
* with the provided `
|
|
189
|
-
* than or equal to the value of project `
|
|
151
|
+
* @notice Manually sets the local maximum invocations of project `projectId`
|
|
152
|
+
* with the provided `maxInvocations`, checking that `maxInvocations` is less
|
|
153
|
+
* than or equal to the value of project `project_id`'s maximum invocations that is
|
|
190
154
|
* set on the core contract.
|
|
191
|
-
* @dev Note that a `
|
|
155
|
+
* @dev Note that a `maxInvocations` of 0 can only be set if the current `invocations`
|
|
192
156
|
* value is also 0 and this would also set `maxHasBeenInvoked` to true, correctly short-circuiting
|
|
193
157
|
* this minter's purchase function, avoiding extra gas costs from the core contract's maxInvocations check.
|
|
194
|
-
* @param
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
158
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
159
|
+
* @param coreContract Core contract address for the given project.
|
|
160
|
+
* @param maxInvocations Maximum invocations to set for the project.
|
|
197
161
|
*/
|
|
198
162
|
function manuallyLimitProjectMaxInvocations(
|
|
199
|
-
uint256
|
|
200
|
-
address
|
|
201
|
-
uint24
|
|
163
|
+
uint256 projectId,
|
|
164
|
+
address coreContract,
|
|
165
|
+
uint24 maxInvocations
|
|
202
166
|
) external {
|
|
203
167
|
AuthLib.onlyArtist({
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
168
|
+
projectId: projectId,
|
|
169
|
+
coreContract: coreContract,
|
|
170
|
+
sender: msg.sender
|
|
207
171
|
});
|
|
208
172
|
MaxInvocationsLib.manuallyLimitProjectMaxInvocations({
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
maxInvocationsProjectConfig: _maxInvocationsProjectConfigMapping[
|
|
213
|
-
_coreContract
|
|
214
|
-
][_projectId]
|
|
173
|
+
projectId: projectId,
|
|
174
|
+
coreContract: coreContract,
|
|
175
|
+
maxInvocations: maxInvocations
|
|
215
176
|
});
|
|
216
|
-
|
|
217
|
-
emit ProjectMaxInvocationsLimitUpdated(
|
|
218
|
-
_projectId,
|
|
219
|
-
_coreContract,
|
|
220
|
-
_maxInvocations
|
|
221
|
-
);
|
|
222
177
|
}
|
|
223
178
|
|
|
224
179
|
/**
|
|
225
|
-
* @notice Allows holders of NFTs at addresses `
|
|
226
|
-
* project IDs `
|
|
227
|
-
* `
|
|
228
|
-
* e.g. Allows holders of project `
|
|
229
|
-
* contract `
|
|
180
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddresses`,
|
|
181
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`.
|
|
182
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
183
|
+
* e.g. Allows holders of project `ownedNFTProjectIds[0]` on token
|
|
184
|
+
* contract `ownedNFTAddresses[0]` to mint `projectId`.
|
|
230
185
|
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
231
186
|
* due to assumptions about tokenId and projectId relationships.
|
|
232
|
-
* @param
|
|
233
|
-
* @param
|
|
234
|
-
* @param
|
|
235
|
-
* allowlisted. Indexes must align with `
|
|
236
|
-
* @param
|
|
237
|
-
* holders shall be allowlisted to mint project `
|
|
238
|
-
* align with `
|
|
187
|
+
* @param projectId Project ID to enable minting on.
|
|
188
|
+
* @param coreContract Core contract address for the given project.
|
|
189
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be
|
|
190
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIds`.
|
|
191
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
192
|
+
* holders shall be allowlisted to mint project `projectId`. Indexes must
|
|
193
|
+
* align with `ownedNFTAddresses`.
|
|
239
194
|
*/
|
|
240
195
|
function allowHoldersOfProjects(
|
|
241
|
-
uint256
|
|
242
|
-
address
|
|
243
|
-
address[]
|
|
244
|
-
uint256[]
|
|
196
|
+
uint256 projectId,
|
|
197
|
+
address coreContract,
|
|
198
|
+
address[] calldata ownedNFTAddresses,
|
|
199
|
+
uint256[] calldata ownedNFTProjectIds
|
|
245
200
|
) external {
|
|
246
201
|
AuthLib.onlyArtist({
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
202
|
+
projectId: projectId,
|
|
203
|
+
coreContract: coreContract,
|
|
204
|
+
sender: msg.sender
|
|
250
205
|
});
|
|
251
206
|
TokenHolderLib.allowHoldersOfProjects({
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
_ownedNFTProjectIds: _ownedNFTProjectIds
|
|
207
|
+
projectId: projectId,
|
|
208
|
+
coreContract: coreContract,
|
|
209
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
210
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
257
211
|
});
|
|
258
|
-
// emit approve event
|
|
259
|
-
emit AllowedHoldersOfProjects(
|
|
260
|
-
_projectId,
|
|
261
|
-
_coreContract,
|
|
262
|
-
_ownedNFTAddresses,
|
|
263
|
-
_ownedNFTProjectIds
|
|
264
|
-
);
|
|
265
212
|
}
|
|
266
213
|
|
|
267
214
|
/**
|
|
268
|
-
* @notice Removes holders of NFTs at addresses `
|
|
269
|
-
* project IDs `
|
|
215
|
+
* @notice Removes holders of NFTs at addresses `ownedNFTAddresses`,
|
|
216
|
+
* project IDs `ownedNFTProjectIds` to mint on project `projectId`. If
|
|
270
217
|
* other projects owned by a holder are still allowed to mint, holder will
|
|
271
218
|
* maintain ability to purchase.
|
|
272
|
-
* `
|
|
273
|
-
* e.g. Removes holders of project `
|
|
274
|
-
* contract `
|
|
275
|
-
* @param
|
|
276
|
-
* @param
|
|
277
|
-
* @param
|
|
278
|
-
* from allowlist. Indexes must align with `
|
|
279
|
-
* @param
|
|
280
|
-
* holders will be removed from allowlist to mint project `
|
|
281
|
-
* Indexes must align with `
|
|
219
|
+
* `ownedNFTAddresses` assumed to be aligned with `ownedNFTProjectIds`.
|
|
220
|
+
* e.g. Removes holders of project `ownedNFTProjectIds[0]` on token
|
|
221
|
+
* contract `ownedNFTAddresses[0]` from mint allowlist of `projectId`.
|
|
222
|
+
* @param projectId Project ID to enable minting on.
|
|
223
|
+
* @param coreContract Core contract address for the given project.
|
|
224
|
+
* @param ownedNFTAddresses NFT core addresses of projects to be removed
|
|
225
|
+
* from allowlist. Indexes must align with `ownedNFTProjectIds`.
|
|
226
|
+
* @param ownedNFTProjectIds Project IDs on `ownedNFTAddresses` whose
|
|
227
|
+
* holders will be removed from allowlist to mint project `projectId`.
|
|
228
|
+
* Indexes must align with `ownedNFTAddresses`.
|
|
282
229
|
*/
|
|
283
230
|
function removeHoldersOfProjects(
|
|
284
|
-
uint256
|
|
285
|
-
address
|
|
286
|
-
address[]
|
|
287
|
-
uint256[]
|
|
231
|
+
uint256 projectId,
|
|
232
|
+
address coreContract,
|
|
233
|
+
address[] calldata ownedNFTAddresses,
|
|
234
|
+
uint256[] calldata ownedNFTProjectIds
|
|
288
235
|
) external {
|
|
289
236
|
AuthLib.onlyArtist({
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
237
|
+
projectId: projectId,
|
|
238
|
+
coreContract: coreContract,
|
|
239
|
+
sender: msg.sender
|
|
293
240
|
});
|
|
294
241
|
// require same length arrays
|
|
295
242
|
TokenHolderLib.removeHoldersOfProjects({
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
_ownedNFTProjectIds: _ownedNFTProjectIds
|
|
243
|
+
projectId: projectId,
|
|
244
|
+
coreContract: coreContract,
|
|
245
|
+
ownedNFTAddresses: ownedNFTAddresses,
|
|
246
|
+
ownedNFTProjectIds: ownedNFTProjectIds
|
|
301
247
|
});
|
|
302
|
-
// emit removed event
|
|
303
|
-
emit RemovedHoldersOfProjects(
|
|
304
|
-
_projectId,
|
|
305
|
-
_coreContract,
|
|
306
|
-
_ownedNFTAddresses,
|
|
307
|
-
_ownedNFTProjectIds
|
|
308
|
-
);
|
|
309
248
|
}
|
|
310
249
|
|
|
311
250
|
/**
|
|
312
|
-
* @notice Allows holders of NFTs at addresses `
|
|
313
|
-
* project IDs `
|
|
314
|
-
* Also removes holders of NFTs at addresses `
|
|
315
|
-
* project IDs `
|
|
316
|
-
* `
|
|
317
|
-
* `
|
|
318
|
-
* `
|
|
319
|
-
* e.g. Allows holders of project `
|
|
320
|
-
* contract `
|
|
321
|
-
* `
|
|
322
|
-
* `
|
|
251
|
+
* @notice Allows holders of NFTs at addresses `ownedNFTAddressesAdd`,
|
|
252
|
+
* project IDs `ownedNFTProjectIdsAdd` to mint on project `projectId`.
|
|
253
|
+
* Also removes holders of NFTs at addresses `ownedNFTAddressesRemove`,
|
|
254
|
+
* project IDs `ownedNFTProjectIdsRemove` from minting on project
|
|
255
|
+
* `projectId`.
|
|
256
|
+
* `ownedNFTAddressesAdd` assumed to be aligned with
|
|
257
|
+
* `ownedNFTProjectIdsAdd`.
|
|
258
|
+
* e.g. Allows holders of project `ownedNFTProjectIdsAdd[0]` on token
|
|
259
|
+
* contract `ownedNFTAddressesAdd[0]` to mint `projectId`.
|
|
260
|
+
* `ownedNFTAddressesRemove` also assumed to be aligned with
|
|
261
|
+
* `ownedNFTProjectIdsRemove`.
|
|
323
262
|
* WARNING: Only Art Blocks Core contracts are compatible with holder allowlisting,
|
|
324
263
|
* due to assumptions about tokenId and projectId relationships.
|
|
325
|
-
* @param
|
|
326
|
-
* @param
|
|
327
|
-
* @param
|
|
328
|
-
* allowlisted. Indexes must align with `
|
|
329
|
-
* @param
|
|
330
|
-
* whose holders shall be allowlisted to mint project `
|
|
331
|
-
* must align with `
|
|
332
|
-
* @param
|
|
264
|
+
* @param projectId Project ID to enable minting on.
|
|
265
|
+
* @param coreContract Core contract address for the given project.
|
|
266
|
+
* @param ownedNFTAddressesAdd NFT core addresses of projects to be
|
|
267
|
+
* allowlisted. Indexes must align with `ownedNFTProjectIdsAdd`.
|
|
268
|
+
* @param ownedNFTProjectIdsAdd Project IDs on `ownedNFTAddressesAdd`
|
|
269
|
+
* whose holders shall be allowlisted to mint project `projectId`. Indexes
|
|
270
|
+
* must align with `ownedNFTAddressesAdd`.
|
|
271
|
+
* @param ownedNFTAddressesRemove NFT core addresses of projects to be
|
|
333
272
|
* removed from allowlist. Indexes must align with
|
|
334
|
-
* `
|
|
335
|
-
* @param
|
|
336
|
-
* `
|
|
337
|
-
* to mint project `
|
|
338
|
-
* `
|
|
273
|
+
* `ownedNFTProjectIdsRemove`.
|
|
274
|
+
* @param ownedNFTProjectIdsRemove Project IDs on
|
|
275
|
+
* `ownedNFTAddressesRemove` whose holders will be removed from allowlist
|
|
276
|
+
* to mint project `projectId`. Indexes must align with
|
|
277
|
+
* `ownedNFTAddressesRemove`.
|
|
339
278
|
* @dev if a project is included in both add and remove arrays, it will be
|
|
340
279
|
* removed.
|
|
341
280
|
*/
|
|
342
281
|
function allowAndRemoveHoldersOfProjects(
|
|
343
|
-
uint256
|
|
344
|
-
address
|
|
345
|
-
address[]
|
|
346
|
-
uint256[]
|
|
347
|
-
address[]
|
|
348
|
-
uint256[]
|
|
282
|
+
uint256 projectId,
|
|
283
|
+
address coreContract,
|
|
284
|
+
address[] calldata ownedNFTAddressesAdd,
|
|
285
|
+
uint256[] calldata ownedNFTProjectIdsAdd,
|
|
286
|
+
address[] calldata ownedNFTAddressesRemove,
|
|
287
|
+
uint256[] calldata ownedNFTProjectIdsRemove
|
|
349
288
|
) external {
|
|
350
289
|
AuthLib.onlyArtist({
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
290
|
+
projectId: projectId,
|
|
291
|
+
coreContract: coreContract,
|
|
292
|
+
sender: msg.sender
|
|
354
293
|
});
|
|
355
294
|
TokenHolderLib.allowAndRemoveHoldersOfProjects({
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
_ownedNFTProjectIdsRemove: _ownedNFTProjectIdsRemove
|
|
295
|
+
projectId: projectId,
|
|
296
|
+
coreContract: coreContract,
|
|
297
|
+
ownedNFTAddressesAdd: ownedNFTAddressesAdd,
|
|
298
|
+
ownedNFTProjectIdsAdd: ownedNFTProjectIdsAdd,
|
|
299
|
+
ownedNFTAddressesRemove: ownedNFTAddressesRemove,
|
|
300
|
+
ownedNFTProjectIdsRemove: ownedNFTProjectIdsRemove
|
|
363
301
|
});
|
|
364
|
-
|
|
365
|
-
// emit events
|
|
366
|
-
emit AllowedHoldersOfProjects(
|
|
367
|
-
_projectId,
|
|
368
|
-
_coreContract,
|
|
369
|
-
_ownedNFTAddressesAdd,
|
|
370
|
-
_ownedNFTProjectIdsAdd
|
|
371
|
-
);
|
|
372
|
-
emit RemovedHoldersOfProjects(
|
|
373
|
-
_projectId,
|
|
374
|
-
_coreContract,
|
|
375
|
-
_ownedNFTAddressesRemove,
|
|
376
|
-
_ownedNFTProjectIdsRemove
|
|
377
|
-
);
|
|
378
302
|
}
|
|
379
303
|
|
|
380
304
|
/**
|
|
381
|
-
* @notice Sets auction details for project `
|
|
305
|
+
* @notice Sets auction details for project `projectId`.
|
|
382
306
|
* Requires one of the following:
|
|
383
307
|
* - The auction is unconfigured
|
|
384
308
|
* - The auction has not yet started
|
|
@@ -387,214 +311,209 @@ contract MinterDALinHolderV5 is
|
|
|
387
311
|
* max invocations effectively grants the artist the ability to set a new
|
|
388
312
|
* auction at any point, since minter-local max invocations can be set by
|
|
389
313
|
* the artist.
|
|
390
|
-
* @param
|
|
391
|
-
* @param
|
|
392
|
-
* @param
|
|
393
|
-
* @param
|
|
394
|
-
* @param
|
|
395
|
-
* @param
|
|
314
|
+
* @param projectId Project ID to set auction details for.
|
|
315
|
+
* @param coreContract Core contract address for the given project.
|
|
316
|
+
* @param auctionTimestampStart Timestamp at which to start the auction.
|
|
317
|
+
* @param auctionTimestampEnd Timestamp at which to end the auction.
|
|
318
|
+
* @param startPrice Price at which to start the auction, in Wei.
|
|
319
|
+
* @param basePrice Resting price of the auction, in Wei.
|
|
396
320
|
* @dev Note that it is intentionally supported here that the configured
|
|
397
321
|
* price may be explicitly set to `0`.
|
|
398
322
|
*/
|
|
399
323
|
function setAuctionDetails(
|
|
400
|
-
uint256
|
|
401
|
-
address
|
|
402
|
-
uint40
|
|
403
|
-
uint40
|
|
404
|
-
uint256
|
|
405
|
-
uint256
|
|
324
|
+
uint256 projectId,
|
|
325
|
+
address coreContract,
|
|
326
|
+
uint40 auctionTimestampStart,
|
|
327
|
+
uint40 auctionTimestampEnd,
|
|
328
|
+
uint256 startPrice,
|
|
329
|
+
uint256 basePrice
|
|
406
330
|
) external {
|
|
407
331
|
AuthLib.onlyArtist({
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
332
|
+
projectId: projectId,
|
|
333
|
+
coreContract: coreContract,
|
|
334
|
+
sender: msg.sender
|
|
411
335
|
});
|
|
412
336
|
// CHECKS
|
|
413
|
-
DALinLib.DAProjectConfig
|
|
414
|
-
storage _auctionProjectConfig = _auctionProjectConfigMapping[
|
|
415
|
-
_coreContract
|
|
416
|
-
][_projectId];
|
|
417
|
-
MaxInvocationsLib.MaxInvocationsProjectConfig
|
|
418
|
-
storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
419
|
-
_coreContract
|
|
420
|
-
][_projectId];
|
|
421
|
-
|
|
422
337
|
require(
|
|
423
|
-
|
|
424
|
-
|
|
338
|
+
auctionTimestampEnd >=
|
|
339
|
+
auctionTimestampStart + minimumAuctionLengthSeconds,
|
|
425
340
|
"Auction length must be at least minimumAuctionLengthSeconds"
|
|
426
341
|
);
|
|
427
342
|
|
|
428
343
|
// EFFECTS
|
|
429
|
-
bool maxHasBeenInvoked = MaxInvocationsLib.getMaxHasBeenInvoked(
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
DALinLib.setAuctionDetailsLin({
|
|
433
|
-
_DAProjectConfig: _auctionProjectConfig,
|
|
434
|
-
_auctionTimestampStart: _auctionTimestampStart,
|
|
435
|
-
_auctionTimestampEnd: _auctionTimestampEnd,
|
|
436
|
-
_startPrice: _startPrice.toUint88(),
|
|
437
|
-
_basePrice: _basePrice.toUint88(),
|
|
438
|
-
_allowReconfigureAfterStart: maxHasBeenInvoked
|
|
344
|
+
bool maxHasBeenInvoked = MaxInvocationsLib.getMaxHasBeenInvoked({
|
|
345
|
+
projectId: projectId,
|
|
346
|
+
coreContract: coreContract
|
|
439
347
|
});
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
348
|
+
DALinLib.setAuctionDetailsLin({
|
|
349
|
+
projectId: projectId,
|
|
350
|
+
coreContract: coreContract,
|
|
351
|
+
auctionTimestampStart: auctionTimestampStart,
|
|
352
|
+
auctionTimestampEnd: auctionTimestampEnd,
|
|
353
|
+
startPrice: startPrice.toUint88(),
|
|
354
|
+
basePrice: basePrice.toUint88(),
|
|
355
|
+
allowReconfigureAfterStart: maxHasBeenInvoked
|
|
448
356
|
});
|
|
449
357
|
|
|
450
358
|
// sync local max invocations if not initially populated
|
|
451
359
|
// @dev if local max invocations and maxHasBeenInvoked are both
|
|
452
360
|
// initial values, we know they have not been populated.
|
|
453
361
|
if (
|
|
454
|
-
MaxInvocationsLib.maxInvocationsIsUnconfigured(
|
|
455
|
-
|
|
456
|
-
|
|
362
|
+
MaxInvocationsLib.maxInvocationsIsUnconfigured({
|
|
363
|
+
projectId: projectId,
|
|
364
|
+
coreContract: coreContract
|
|
365
|
+
})
|
|
457
366
|
) {
|
|
458
|
-
syncProjectMaxInvocationsToCore(
|
|
367
|
+
syncProjectMaxInvocationsToCore({
|
|
368
|
+
projectId: projectId,
|
|
369
|
+
coreContract: coreContract
|
|
370
|
+
});
|
|
459
371
|
}
|
|
460
372
|
}
|
|
461
373
|
|
|
462
374
|
/**
|
|
463
|
-
* @notice Sets minimum auction length to `
|
|
375
|
+
* @notice Sets minimum auction length to `minimumAuctionLengthSeconds`
|
|
464
376
|
* for all projects.
|
|
465
|
-
* @param
|
|
377
|
+
* @param minimumAuctionLengthSeconds_ Minimum auction length in seconds.
|
|
466
378
|
*/
|
|
467
379
|
function setMinimumAuctionLengthSeconds(
|
|
468
|
-
uint256
|
|
380
|
+
uint256 minimumAuctionLengthSeconds_
|
|
469
381
|
) external {
|
|
470
382
|
AuthLib.onlyMinterFilterAdminACL({
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
383
|
+
minterFilterAddress: minterFilterAddress,
|
|
384
|
+
sender: msg.sender,
|
|
385
|
+
contract_: address(this),
|
|
386
|
+
selector: this.setMinimumAuctionLengthSeconds.selector
|
|
475
387
|
});
|
|
476
|
-
minimumAuctionLengthSeconds =
|
|
477
|
-
emit AuctionMinimumLengthSecondsUpdated(
|
|
388
|
+
minimumAuctionLengthSeconds = minimumAuctionLengthSeconds_;
|
|
389
|
+
emit DALinLib.AuctionMinimumLengthSecondsUpdated(
|
|
390
|
+
minimumAuctionLengthSeconds_
|
|
391
|
+
);
|
|
478
392
|
}
|
|
479
393
|
|
|
480
394
|
/**
|
|
481
|
-
* @notice Resets auction details for project `
|
|
395
|
+
* @notice Resets auction details for project `projectId`, zero-ing out all
|
|
482
396
|
* relevant auction fields. Not intended to be used in normal auction
|
|
483
397
|
* operation, but rather only in case of the need to halt an auction.
|
|
484
|
-
* @param
|
|
485
|
-
* @param
|
|
398
|
+
* @param projectId Project ID to set auction details for.
|
|
399
|
+
* @param coreContract Core contract address for the given project.
|
|
486
400
|
*/
|
|
487
401
|
function resetAuctionDetails(
|
|
488
|
-
uint256
|
|
489
|
-
address
|
|
402
|
+
uint256 projectId,
|
|
403
|
+
address coreContract
|
|
490
404
|
) external {
|
|
491
405
|
AuthLib.onlyCoreAdminACL({
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
406
|
+
coreContract: coreContract,
|
|
407
|
+
sender: msg.sender,
|
|
408
|
+
contract_: address(this),
|
|
409
|
+
selector: this.resetAuctionDetails.selector
|
|
496
410
|
});
|
|
497
411
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
412
|
+
DALinLib.resetAuctionDetails({
|
|
413
|
+
projectId: projectId,
|
|
414
|
+
coreContract: coreContract
|
|
415
|
+
});
|
|
501
416
|
}
|
|
502
417
|
|
|
503
418
|
/**
|
|
504
|
-
* @notice Purchases a token from project `
|
|
419
|
+
* @notice Purchases a token from project `projectId`.
|
|
505
420
|
* Note: Collectors should not send excessive value with their purchase
|
|
506
421
|
* transaction, because the artist has the ability to change the auction
|
|
507
422
|
* details at any time, including the price.
|
|
508
|
-
* @param
|
|
509
|
-
* @param
|
|
510
|
-
* @param
|
|
423
|
+
* @param projectId Project ID to mint a token on.
|
|
424
|
+
* @param coreContract Core contract address for the given project.
|
|
425
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
511
426
|
* msg.sender being used to claim right to purchase.
|
|
512
|
-
* @param
|
|
427
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
|
|
513
428
|
* to claim right to purchase.
|
|
514
429
|
* @return tokenId Token ID of minted token
|
|
515
430
|
*/
|
|
516
431
|
function purchase(
|
|
517
|
-
uint256
|
|
518
|
-
address
|
|
519
|
-
address
|
|
520
|
-
uint256
|
|
432
|
+
uint256 projectId,
|
|
433
|
+
address coreContract,
|
|
434
|
+
address ownedNFTAddress,
|
|
435
|
+
uint256 ownedNFTTokenId
|
|
521
436
|
) external payable returns (uint256 tokenId) {
|
|
522
437
|
tokenId = purchaseTo({
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
438
|
+
to: msg.sender,
|
|
439
|
+
projectId: projectId,
|
|
440
|
+
coreContract: coreContract,
|
|
441
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
442
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
443
|
+
vault: address(0)
|
|
529
444
|
});
|
|
530
445
|
|
|
531
446
|
return tokenId;
|
|
532
447
|
}
|
|
533
448
|
|
|
534
449
|
/**
|
|
535
|
-
* @notice Purchases a token from project `
|
|
536
|
-
* the token's owner to `
|
|
450
|
+
* @notice Purchases a token from project `projectId` and sets
|
|
451
|
+
* the token's owner to `to`.
|
|
537
452
|
* Note: Collectors should not send excessive value with their purchase
|
|
538
453
|
* transaction, because the artist has the ability to change the auction
|
|
539
454
|
* details at any time, including the price.
|
|
540
|
-
* @param
|
|
541
|
-
* @param
|
|
542
|
-
* @param
|
|
543
|
-
* @param
|
|
455
|
+
* @param to Address to be the new token's owner.
|
|
456
|
+
* @param projectId Project ID to mint a token on.
|
|
457
|
+
* @param coreContract Core contract address for the given project.
|
|
458
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
544
459
|
* msg.sender being used to claim right to purchase.
|
|
545
|
-
* @param
|
|
460
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
|
|
546
461
|
* to claim right to purchase.
|
|
547
462
|
* @return tokenId Token ID of minted token
|
|
548
463
|
*/
|
|
549
464
|
function purchaseTo(
|
|
550
|
-
address
|
|
551
|
-
uint256
|
|
552
|
-
address
|
|
553
|
-
address
|
|
554
|
-
uint256
|
|
465
|
+
address to,
|
|
466
|
+
uint256 projectId,
|
|
467
|
+
address coreContract,
|
|
468
|
+
address ownedNFTAddress,
|
|
469
|
+
uint256 ownedNFTTokenId
|
|
555
470
|
) external payable returns (uint256 tokenId) {
|
|
556
471
|
return
|
|
557
472
|
purchaseTo({
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
473
|
+
to: to,
|
|
474
|
+
projectId: projectId,
|
|
475
|
+
coreContract: coreContract,
|
|
476
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
477
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
478
|
+
vault: address(0)
|
|
564
479
|
});
|
|
565
480
|
}
|
|
566
481
|
|
|
567
482
|
// public getter functions
|
|
568
483
|
/**
|
|
569
484
|
* @notice Gets the maximum invocations project configuration.
|
|
570
|
-
* @param
|
|
571
|
-
* @param
|
|
485
|
+
* @param projectId The ID of the project whose data needs to be fetched.
|
|
486
|
+
* @param coreContract The address of the core contract.
|
|
572
487
|
* @return MaxInvocationsLib.MaxInvocationsProjectConfig instance with the
|
|
573
488
|
* configuration data.
|
|
574
489
|
*/
|
|
575
490
|
function maxInvocationsProjectConfig(
|
|
576
|
-
uint256
|
|
577
|
-
address
|
|
491
|
+
uint256 projectId,
|
|
492
|
+
address coreContract
|
|
578
493
|
)
|
|
579
494
|
external
|
|
580
495
|
view
|
|
581
496
|
returns (MaxInvocationsLib.MaxInvocationsProjectConfig memory)
|
|
582
497
|
{
|
|
583
|
-
return
|
|
498
|
+
return
|
|
499
|
+
MaxInvocationsLib.getMaxInvocationsProjectConfig({
|
|
500
|
+
projectId: projectId,
|
|
501
|
+
coreContract: coreContract
|
|
502
|
+
});
|
|
584
503
|
}
|
|
585
504
|
|
|
586
505
|
/**
|
|
587
506
|
* @notice Retrieves the auction parameters for a specific project.
|
|
588
|
-
* @param
|
|
589
|
-
* @param
|
|
507
|
+
* @param projectId The unique identifier for the project.
|
|
508
|
+
* @param coreContract The address of the core contract for the project.
|
|
590
509
|
* @return timestampStart The start timestamp for the auction.
|
|
591
510
|
* @return timestampEnd The end timestamp for the auction.
|
|
592
511
|
* @return startPrice The starting price of the auction.
|
|
593
512
|
* @return basePrice The base price of the auction.
|
|
594
513
|
*/
|
|
595
514
|
function projectAuctionParameters(
|
|
596
|
-
uint256
|
|
597
|
-
address
|
|
515
|
+
uint256 projectId,
|
|
516
|
+
address coreContract
|
|
598
517
|
)
|
|
599
518
|
external
|
|
600
519
|
view
|
|
@@ -605,37 +524,37 @@ contract MinterDALinHolderV5 is
|
|
|
605
524
|
uint256 basePrice
|
|
606
525
|
)
|
|
607
526
|
{
|
|
608
|
-
DALinLib.DAProjectConfig
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
527
|
+
DALinLib.DAProjectConfig storage auctionProjectConfig = DALinLib
|
|
528
|
+
.getDAProjectConfig({
|
|
529
|
+
projectId: projectId,
|
|
530
|
+
coreContract: coreContract
|
|
531
|
+
});
|
|
532
|
+
timestampStart = auctionProjectConfig.timestampStart;
|
|
533
|
+
timestampEnd = auctionProjectConfig.timestampEnd;
|
|
534
|
+
startPrice = auctionProjectConfig.startPrice;
|
|
535
|
+
basePrice = auctionProjectConfig.basePrice;
|
|
616
536
|
}
|
|
617
537
|
|
|
618
538
|
/**
|
|
619
|
-
* @notice Checks if the specified `
|
|
620
|
-
* @dev This function retrieves the cached value of `
|
|
539
|
+
* @notice Checks if the specified `coreContract` is a valid engine contract.
|
|
540
|
+
* @dev This function retrieves the cached value of `coreContract` from
|
|
621
541
|
* the `isEngineCache` mapping. If the cached value is already set, it
|
|
622
|
-
* returns the cached value. Otherwise, it calls the `
|
|
623
|
-
* function from the `SplitFundsLib` library to check if `
|
|
542
|
+
* returns the cached value. Otherwise, it calls the `getV3CoreIsEngineView`
|
|
543
|
+
* function from the `SplitFundsLib` library to check if `coreContract`
|
|
624
544
|
* is a valid engine contract.
|
|
625
|
-
* @dev This function will revert if the provided `
|
|
545
|
+
* @dev This function will revert if the provided `coreContract` is not
|
|
626
546
|
* a valid Engine or V3 Flagship contract.
|
|
627
|
-
* @param
|
|
628
|
-
* @return bool indicating if `
|
|
547
|
+
* @param coreContract The address of the contract to check.
|
|
548
|
+
* @return bool indicating if `coreContract` is a valid engine contract.
|
|
629
549
|
*/
|
|
630
|
-
function isEngineView(address
|
|
631
|
-
SplitFundsLib.IsEngineCache storage isEngineCache =
|
|
632
|
-
|
|
633
|
-
];
|
|
550
|
+
function isEngineView(address coreContract) external view returns (bool) {
|
|
551
|
+
SplitFundsLib.IsEngineCache storage isEngineCache = SplitFundsLib
|
|
552
|
+
.getIsEngineCacheConfig(coreContract);
|
|
634
553
|
if (isEngineCache.isCached) {
|
|
635
554
|
return isEngineCache.isEngine;
|
|
636
555
|
} else {
|
|
637
|
-
// @dev this calls the non-modifying variant of
|
|
638
|
-
return SplitFundsLib.getV3CoreIsEngineView(
|
|
556
|
+
// @dev this calls the non-state-modifying variant of isEngine
|
|
557
|
+
return SplitFundsLib.getV3CoreIsEngineView(coreContract);
|
|
639
558
|
}
|
|
640
559
|
}
|
|
641
560
|
|
|
@@ -650,17 +569,18 @@ contract MinterDALinHolderV5 is
|
|
|
650
569
|
* possible because the V3 core contract only allows maximum invocations
|
|
651
570
|
* to be reduced, not increased. Based on this rationale, we intentionally
|
|
652
571
|
* do not do input validation in this method as to whether or not the input
|
|
653
|
-
* @param
|
|
654
|
-
* @param
|
|
572
|
+
* @param projectId is an existing project ID.
|
|
573
|
+
* @param coreContract is an existing core contract address.
|
|
655
574
|
*/
|
|
656
575
|
function projectMaxHasBeenInvoked(
|
|
657
|
-
uint256
|
|
658
|
-
address
|
|
576
|
+
uint256 projectId,
|
|
577
|
+
address coreContract
|
|
659
578
|
) external view returns (bool) {
|
|
660
579
|
return
|
|
661
|
-
MaxInvocationsLib.getMaxHasBeenInvoked(
|
|
662
|
-
|
|
663
|
-
|
|
580
|
+
MaxInvocationsLib.getMaxHasBeenInvoked({
|
|
581
|
+
projectId: projectId,
|
|
582
|
+
coreContract: coreContract
|
|
583
|
+
});
|
|
664
584
|
}
|
|
665
585
|
|
|
666
586
|
/**
|
|
@@ -679,26 +599,27 @@ contract MinterDALinHolderV5 is
|
|
|
679
599
|
* increased. When this happens, the minter will enable minting, allowing
|
|
680
600
|
* the core contract to enforce the max invocations check. Based on this
|
|
681
601
|
* rationale, we intentionally do not do input validation in this method as
|
|
682
|
-
* to whether or not the input `
|
|
683
|
-
* @param
|
|
684
|
-
* @param
|
|
602
|
+
* to whether or not the input `projectId` is an existing project ID.
|
|
603
|
+
* @param projectId is an existing project ID.
|
|
604
|
+
* @param coreContract is an existing core contract address.
|
|
685
605
|
*/
|
|
686
606
|
function projectMaxInvocations(
|
|
687
|
-
uint256
|
|
688
|
-
address
|
|
607
|
+
uint256 projectId,
|
|
608
|
+
address coreContract
|
|
689
609
|
) external view returns (uint256) {
|
|
690
610
|
return
|
|
691
|
-
MaxInvocationsLib.getMaxInvocations(
|
|
692
|
-
|
|
693
|
-
|
|
611
|
+
MaxInvocationsLib.getMaxInvocations({
|
|
612
|
+
projectId: projectId,
|
|
613
|
+
coreContract: coreContract
|
|
614
|
+
});
|
|
694
615
|
}
|
|
695
616
|
|
|
696
617
|
/**
|
|
697
618
|
* @notice Gets if price of token is configured, price of minting a
|
|
698
|
-
* token on project `
|
|
619
|
+
* token on project `projectId`, and currency symbol and address to be
|
|
699
620
|
* used as payment. Supersedes any core contract price information.
|
|
700
|
-
* @param
|
|
701
|
-
* @param
|
|
621
|
+
* @param projectId Project ID to get price information for
|
|
622
|
+
* @param coreContract Contract address of the core contract
|
|
702
623
|
* @return isConfigured true only if token price has been configured on
|
|
703
624
|
* this minter
|
|
704
625
|
* @return tokenPriceInWei current price of token on this minter - invalid
|
|
@@ -709,8 +630,8 @@ contract MinterDALinHolderV5 is
|
|
|
709
630
|
* this minter. This minter always returns null address, reserved for ether
|
|
710
631
|
*/
|
|
711
632
|
function getPriceInfo(
|
|
712
|
-
uint256
|
|
713
|
-
address
|
|
633
|
+
uint256 projectId,
|
|
634
|
+
address coreContract
|
|
714
635
|
)
|
|
715
636
|
external
|
|
716
637
|
view
|
|
@@ -721,10 +642,11 @@ contract MinterDALinHolderV5 is
|
|
|
721
642
|
address currencyAddress
|
|
722
643
|
)
|
|
723
644
|
{
|
|
724
|
-
DALinLib.DAProjectConfig
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
645
|
+
DALinLib.DAProjectConfig storage auctionProjectConfig = DALinLib
|
|
646
|
+
.getDAProjectConfig({
|
|
647
|
+
projectId: projectId,
|
|
648
|
+
coreContract: coreContract
|
|
649
|
+
});
|
|
728
650
|
isConfigured = (auctionProjectConfig.startPrice > 0);
|
|
729
651
|
if (!isConfigured) {
|
|
730
652
|
// In the case of unconfigured auction, return price of zero when
|
|
@@ -736,7 +658,10 @@ contract MinterDALinHolderV5 is
|
|
|
736
658
|
// before auction starts.
|
|
737
659
|
tokenPriceInWei = auctionProjectConfig.startPrice;
|
|
738
660
|
} else {
|
|
739
|
-
tokenPriceInWei = DALinLib.getPriceLin(
|
|
661
|
+
tokenPriceInWei = DALinLib.getPriceLin({
|
|
662
|
+
projectId: projectId,
|
|
663
|
+
coreContract: coreContract
|
|
664
|
+
});
|
|
740
665
|
}
|
|
741
666
|
currencySymbol = "ETH";
|
|
742
667
|
currencyAddress = address(0);
|
|
@@ -746,141 +671,126 @@ contract MinterDALinHolderV5 is
|
|
|
746
671
|
* @notice Checks if a specific NFT owner is allowed in a given project.
|
|
747
672
|
* @dev This function retrieves the allowance status of an NFT owner
|
|
748
673
|
* within a specific project from the allowedProjectHoldersMapping.
|
|
749
|
-
* @param
|
|
750
|
-
* @param
|
|
751
|
-
* @param
|
|
752
|
-
* @param
|
|
674
|
+
* @param projectId The ID of the project to check.
|
|
675
|
+
* @param coreContract Core contract address for the given project.
|
|
676
|
+
* @param ownedNFTAddress The address of the owned NFT contract.
|
|
677
|
+
* @param ownedNFTProjectId The ID of the owned NFT project.
|
|
753
678
|
* @return bool True if the NFT owner is allowed in the given project, False otherwise.
|
|
754
679
|
*/
|
|
755
680
|
function allowedProjectHolders(
|
|
756
|
-
uint256
|
|
757
|
-
address
|
|
758
|
-
address
|
|
759
|
-
uint256
|
|
681
|
+
uint256 projectId,
|
|
682
|
+
address coreContract,
|
|
683
|
+
address ownedNFTAddress,
|
|
684
|
+
uint256 ownedNFTProjectId
|
|
760
685
|
) external view returns (bool) {
|
|
761
686
|
return
|
|
762
|
-
|
|
763
|
-
.
|
|
687
|
+
TokenHolderLib
|
|
688
|
+
.getHolderProjectConfig({
|
|
689
|
+
projectId: projectId,
|
|
690
|
+
coreContract: coreContract
|
|
691
|
+
})
|
|
692
|
+
.allowedProjectHolders[ownedNFTAddress][ownedNFTProjectId];
|
|
764
693
|
}
|
|
765
694
|
|
|
766
695
|
/**
|
|
767
|
-
* @notice Returns if token is an allowlisted NFT for project `
|
|
768
|
-
* @param
|
|
769
|
-
* @param
|
|
770
|
-
* @param
|
|
771
|
-
* @param
|
|
696
|
+
* @notice Returns if token is an allowlisted NFT for project `projectId`.
|
|
697
|
+
* @param projectId Project ID to be checked.
|
|
698
|
+
* @param coreContract Core contract address for the given project.
|
|
699
|
+
* @param ownedNFTAddress ERC-721 NFT token address to be checked.
|
|
700
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID to be checked.
|
|
772
701
|
* @return bool Token is allowlisted
|
|
773
702
|
* @dev does not check if token has been used to purchase
|
|
774
703
|
* @dev assumes project ID can be derived from tokenId / 1_000_000
|
|
775
704
|
*/
|
|
776
705
|
function isAllowlistedNFT(
|
|
777
|
-
uint256
|
|
778
|
-
address
|
|
779
|
-
address
|
|
780
|
-
uint256
|
|
706
|
+
uint256 projectId,
|
|
707
|
+
address coreContract,
|
|
708
|
+
address ownedNFTAddress,
|
|
709
|
+
uint256 ownedNFTTokenId
|
|
781
710
|
) external view returns (bool) {
|
|
782
711
|
return
|
|
783
712
|
TokenHolderLib.isAllowlistedNFT({
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
_ownedNFTTokenId: _ownedNFTTokenId
|
|
713
|
+
projectId: projectId,
|
|
714
|
+
coreContract: coreContract,
|
|
715
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
716
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
789
717
|
});
|
|
790
718
|
}
|
|
791
719
|
|
|
792
720
|
/**
|
|
793
|
-
* @notice Syncs local maximum invocations of project `
|
|
721
|
+
* @notice Syncs local maximum invocations of project `projectId` based on
|
|
794
722
|
* the value currently defined in the core contract.
|
|
795
|
-
* @param
|
|
796
|
-
* @param
|
|
723
|
+
* @param projectId Project ID to set the maximum invocations for.
|
|
724
|
+
* @param coreContract Core contract address for the given project.
|
|
797
725
|
* @dev this enables gas reduction after maxInvocations have been reached -
|
|
798
726
|
* core contracts shall still enforce a maxInvocation check during mint.
|
|
799
727
|
*/
|
|
800
728
|
function syncProjectMaxInvocationsToCore(
|
|
801
|
-
uint256
|
|
802
|
-
address
|
|
729
|
+
uint256 projectId,
|
|
730
|
+
address coreContract
|
|
803
731
|
) public {
|
|
804
732
|
AuthLib.onlyArtist({
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
733
|
+
projectId: projectId,
|
|
734
|
+
coreContract: coreContract,
|
|
735
|
+
sender: msg.sender
|
|
808
736
|
});
|
|
809
737
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
maxInvocationsProjectConfig: _maxInvocationsProjectConfigMapping[
|
|
815
|
-
_coreContract
|
|
816
|
-
][_projectId]
|
|
817
|
-
});
|
|
818
|
-
emit ProjectMaxInvocationsLimitUpdated(
|
|
819
|
-
_projectId,
|
|
820
|
-
_coreContract,
|
|
821
|
-
maxInvocations
|
|
822
|
-
);
|
|
738
|
+
MaxInvocationsLib.syncProjectMaxInvocationsToCore({
|
|
739
|
+
projectId: projectId,
|
|
740
|
+
coreContract: coreContract
|
|
741
|
+
});
|
|
823
742
|
}
|
|
824
743
|
|
|
825
744
|
/**
|
|
826
|
-
* @notice Purchases a token from project `
|
|
827
|
-
* the token's owner to `
|
|
745
|
+
* @notice Purchases a token from project `projectId` and sets
|
|
746
|
+
* the token's owner to `to`.
|
|
828
747
|
* Note: Collectors should not send excessive value with their purchase
|
|
829
748
|
* transaction, because the artist has the ability to change the auction
|
|
830
749
|
* details at any time, including the price.
|
|
831
|
-
* @param
|
|
832
|
-
* @param
|
|
833
|
-
* @param
|
|
834
|
-
* @param
|
|
750
|
+
* @param to Address to be the new token's owner.
|
|
751
|
+
* @param projectId Project ID to mint a token on.
|
|
752
|
+
* @param coreContract Core contract address for the given project.
|
|
753
|
+
* @param ownedNFTAddress ERC-721 NFT holding the project token owned by
|
|
835
754
|
* msg.sender being used to claim right to purchase.
|
|
836
|
-
* @param
|
|
755
|
+
* @param ownedNFTTokenId ERC-721 NFT token ID owned by msg.sender being used
|
|
837
756
|
* to claim right to purchase.
|
|
838
757
|
* @return tokenId Token ID of minted token
|
|
839
758
|
*/
|
|
840
759
|
function purchaseTo(
|
|
841
|
-
address
|
|
842
|
-
uint256
|
|
843
|
-
address
|
|
844
|
-
address
|
|
845
|
-
uint256
|
|
846
|
-
address
|
|
760
|
+
address to,
|
|
761
|
+
uint256 projectId,
|
|
762
|
+
address coreContract,
|
|
763
|
+
address ownedNFTAddress,
|
|
764
|
+
uint256 ownedNFTTokenId,
|
|
765
|
+
address vault
|
|
847
766
|
) public payable nonReentrant returns (uint256 tokenId) {
|
|
848
767
|
// CHECKS
|
|
849
|
-
MaxInvocationsLib
|
|
850
|
-
storage _maxInvocationsProjectConfig = _maxInvocationsProjectConfigMapping[
|
|
851
|
-
_coreContract
|
|
852
|
-
][_projectId];
|
|
853
|
-
|
|
854
|
-
DALinLib.DAProjectConfig
|
|
855
|
-
storage _auctionProjectConfig = _auctionProjectConfigMapping[
|
|
856
|
-
_coreContract
|
|
857
|
-
][_projectId];
|
|
858
|
-
|
|
768
|
+
// pre-mint MaxInvocationsLib checks
|
|
859
769
|
// Note that `maxHasBeenInvoked` is only checked here to reduce gas
|
|
860
770
|
// consumption after a project has been fully minted.
|
|
861
|
-
// `
|
|
771
|
+
// `maxInvocationsProjectConfig.maxHasBeenInvoked` is locally cached to reduce
|
|
862
772
|
// gas consumption, but if not in sync with the core contract's value,
|
|
863
773
|
// the core contract also enforces its own max invocation check during
|
|
864
774
|
// minting.
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
);
|
|
775
|
+
MaxInvocationsLib.preMintChecks({
|
|
776
|
+
projectId: projectId,
|
|
777
|
+
coreContract: coreContract
|
|
778
|
+
});
|
|
869
779
|
|
|
870
780
|
// getPriceLin reverts if auction is unconfigured or has not started
|
|
871
|
-
uint256 pricePerTokenInWei = DALinLib.getPriceLin(
|
|
872
|
-
|
|
873
|
-
|
|
781
|
+
uint256 pricePerTokenInWei = DALinLib.getPriceLin({
|
|
782
|
+
projectId: projectId,
|
|
783
|
+
coreContract: coreContract
|
|
784
|
+
});
|
|
874
785
|
require(msg.value >= pricePerTokenInWei, "Min value to mint req.");
|
|
875
786
|
|
|
876
787
|
// require token used to claim to be in set of allowlisted NFTs
|
|
877
788
|
require(
|
|
878
789
|
TokenHolderLib.isAllowlistedNFT({
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
_ownedNFTTokenId: _ownedNFTTokenId
|
|
790
|
+
projectId: projectId,
|
|
791
|
+
coreContract: coreContract,
|
|
792
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
793
|
+
ownedNFTTokenId: ownedNFTTokenId
|
|
884
794
|
}),
|
|
885
795
|
"Only allowlisted NFTs"
|
|
886
796
|
);
|
|
@@ -888,39 +798,39 @@ contract MinterDALinHolderV5 is
|
|
|
888
798
|
// NOTE: delegate-vault handling **begins here**.
|
|
889
799
|
|
|
890
800
|
// handle that the vault may be either the `msg.sender` in the case
|
|
891
|
-
// that there is not a true vault, or may be `
|
|
801
|
+
// that there is not a true vault, or may be `vault` if one is
|
|
892
802
|
// provided explicitly (and it is valid).
|
|
893
|
-
address
|
|
894
|
-
if (
|
|
803
|
+
address vault_ = msg.sender;
|
|
804
|
+
if (vault != address(0)) {
|
|
895
805
|
// If a vault is provided, it must be valid, otherwise throw rather
|
|
896
806
|
// than optimistically-minting with original `msg.sender`.
|
|
897
807
|
// Note, we do not check `checkDelegateForAll` or `checkDelegateForContract` as well,
|
|
898
808
|
// as they are known to be implicitly checked by calling `checkDelegateForToken`.
|
|
899
|
-
bool isValidVault =
|
|
809
|
+
bool isValidVault = _delegationRegistryContract
|
|
900
810
|
.checkDelegateForToken({
|
|
901
811
|
delegate: msg.sender,
|
|
902
|
-
vault:
|
|
903
|
-
contract_:
|
|
904
|
-
tokenId:
|
|
812
|
+
vault: vault,
|
|
813
|
+
contract_: coreContract,
|
|
814
|
+
tokenId: ownedNFTTokenId
|
|
905
815
|
});
|
|
906
816
|
require(isValidVault, "Invalid delegate-vault pairing");
|
|
907
|
-
|
|
817
|
+
vault_ = vault;
|
|
908
818
|
}
|
|
909
819
|
|
|
910
820
|
// EFFECTS
|
|
911
|
-
tokenId =
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
821
|
+
tokenId = _minterFilter.mint_joo({
|
|
822
|
+
to: to,
|
|
823
|
+
projectId: projectId,
|
|
824
|
+
coreContract: coreContract,
|
|
825
|
+
sender: vault_
|
|
916
826
|
});
|
|
917
827
|
|
|
918
828
|
// NOTE: delegate-vault handling **ends here**.
|
|
919
829
|
|
|
920
|
-
MaxInvocationsLib.validatePurchaseEffectsInvocations(
|
|
921
|
-
tokenId,
|
|
922
|
-
|
|
923
|
-
);
|
|
830
|
+
MaxInvocationsLib.validatePurchaseEffectsInvocations({
|
|
831
|
+
tokenId: tokenId,
|
|
832
|
+
coreContract: coreContract
|
|
833
|
+
});
|
|
924
834
|
|
|
925
835
|
// INTERACTIONS
|
|
926
836
|
// require vault to own NFT used to redeem
|
|
@@ -931,20 +841,15 @@ contract MinterDALinHolderV5 is
|
|
|
931
841
|
* function is non-reentrant, so this is extra cautious.
|
|
932
842
|
*/
|
|
933
843
|
TokenHolderLib.validateNFTOwnership({
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
844
|
+
ownedNFTAddress: ownedNFTAddress,
|
|
845
|
+
ownedNFTTokenId: ownedNFTTokenId,
|
|
846
|
+
targetOwner: vault_
|
|
937
847
|
});
|
|
938
848
|
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
SplitFundsLib.splitFundsETH({
|
|
944
|
-
_projectId: _projectId,
|
|
945
|
-
_pricePerTokenInWei: pricePerTokenInWei,
|
|
946
|
-
_coreContract: _coreContract,
|
|
947
|
-
_isEngine: isEngine
|
|
849
|
+
SplitFundsLib.splitFundsETHRefundSender({
|
|
850
|
+
projectId: projectId,
|
|
851
|
+
pricePerTokenInWei: pricePerTokenInWei,
|
|
852
|
+
coreContract: coreContract
|
|
948
853
|
});
|
|
949
854
|
|
|
950
855
|
return tokenId;
|