Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,15 @@ contract SeaDropXArtBlocksShim is
_onlyArtistOrSelf(msg.sender);

// ensure maxSupply lte project's max invocations on core contract
(, uint256 maxInvocations) = _getInvocationsDataFromCore();
if (newMaxSupply > maxInvocations) {
revert(
(
,
uint256 maxInvocationsOnCoreContract
) = _getInvocationsDataFromCore();
if (newMaxSupply > maxInvocationsOnCoreContract) {
// @dev revert if not special case of OpenSea OpenEdition (200M) and Art Blocks OpenEdition (1M)
require(
newMaxSupply == 200_000_000 &&
maxInvocationsOnCoreContract == 1_000_000,
"SeaDropXArtBlocksShim: Only newMaxSupply lte max invocations on the Art Blocks core contract"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ runForEach.forEach((params) => {
await config.genArt721Core
.connect(config.accounts.artist)
.toggleProjectIsPaused(config.projectZero);
await config.genArt721Core
.connect(config.accounts.artist)
.updateProjectMaxInvocations(config.projectZero, 15);

return config as T_SeaDropShimTestConfig;
}
Expand Down Expand Up @@ -487,12 +484,24 @@ runForEach.forEach((params) => {

it("reverts when maxSupply > core max invocations", async function () {
const config = await loadFixture(_beforeEach);
await config.genArt721Core
.connect(config.accounts.artist)
.updateProjectMaxInvocations(config.projectZero, 15);
await expectRevert(
config.minter.connect(config.accounts.artist).setMaxSupply(16),
revertMessages.maxSupplyExceedsMaxInvocations
);
});

it("does not revert special case when maxSupply is 200,000,000 and core max invocations is 1,000,000", async function () {
const config = await loadFixture(_beforeEach);
// core max invocations is already 1M
// expect no revert
await config.minter
.connect(config.accounts.artist)
.setMaxSupply(200000000);
});

it("updates maxSupply when less than core max invocations", async function () {
const config = await loadFixture(_beforeEach);
const configuredValue = 10;
Expand All @@ -505,6 +514,9 @@ runForEach.forEach((params) => {

it("updates maxSupply when equal to core max invocations", async function () {
const config = await loadFixture(_beforeEach);
await config.genArt721Core
.connect(config.accounts.artist)
.updateProjectMaxInvocations(config.projectZero, 15);
const configuredValue = 15;
await config.minter
.connect(config.accounts.artist)
Expand Down
Loading