From 739c99d846830ba6e04d9e846eeeb7edb7666fa8 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Mon, 23 Oct 2023 14:02:49 +0000 Subject: [PATCH] Add affiliate flat fees and tests --- contracts/modules/SuperMinterV1_1.sol | 115 ++++---- .../modules/interfaces/ISuperMinterV1_1.sol | 13 +- tests/modules/SuperMinterV1_1.t.sol | 270 +++++++++++++----- 3 files changed, 278 insertions(+), 120 deletions(-) diff --git a/contracts/modules/SuperMinterV1_1.sol b/contracts/modules/SuperMinterV1_1.sol index ab066f08..62f0cebf 100644 --- a/contracts/modules/SuperMinterV1_1.sol +++ b/contracts/modules/SuperMinterV1_1.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.16; import { Ownable, OwnableRoles } from "solady/auth/OwnableRoles.sol"; import { ISoundEditionV2 } from "@core/interfaces/ISoundEditionV2.sol"; -import { ISuperMinter } from "@modules/interfaces/ISuperMinter.sol"; +import { ISuperMinterV1_1 } from "@modules/interfaces/ISuperMinterV1_1.sol"; import { IERC165 } from "openzeppelin/utils/introspection/IERC165.sol"; import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol"; import { EIP712 } from "solady/utils/EIP712.sol"; @@ -17,10 +17,10 @@ import { LibOps } from "@core/utils/LibOps.sol"; import { LibMulticaller } from "multicaller/LibMulticaller.sol"; /** - * @title SuperMinter - * @dev The `SuperMinter` class is a generalized minter. + * @title SuperMinterV1_1 + * @dev The `SuperMinterV1_1` class is a generalized minter. */ -contract SuperMinter is ISuperMinter, EIP712 { +contract SuperMinterV1_1 is ISuperMinterV1_1, EIP712 { using LibBitmap for *; using MerkleProofLib for *; using LibMap for *; @@ -137,6 +137,7 @@ contract SuperMinter is ISuperMinter, EIP712 { /** * @dev The maximum platform per-mint flat fee. + * Also applies to the maximum per-mint flat fee. */ uint96 public constant MAX_PLATFORM_PER_MINT_FLAT_FEE = 0.1 ether; @@ -220,7 +221,7 @@ contract SuperMinter is ISuperMinter, EIP712 { // ============================================================= /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function createEditionMint(MintCreation memory c) public returns (uint8 scheduleNum) { _requireOnlyEditionOwnerOrAdmin(c.edition); @@ -300,7 +301,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function mintTo(MintTo calldata p) public payable { MintData storage d = _getMintData(LibOps.packId(p.edition, p.tier, p.scheduleNum)); @@ -329,17 +330,25 @@ contract SuperMinter is ISuperMinter, EIP712 { unchecked { if (msg.value != f.total) revert WrongPayment(msg.value, f.total); // Require exact payment. - remaining = f.total - f.platformFee; // `platformFee <= total`; - platformFeesAccrued[d.platform] += f.platformFee; // Accrue the platform fee. + remaining = f.total - (f.platformFee + f.affiliateFee); // `platformFee + affiliateFee <= total`; if (affiliated = _isAffiliatedWithProof(d, p.affiliate, p.affiliateProof)) { - remaining -= f.affiliateFee; // `affiliateFee <= remaining`. - affiliateFeesAccrued[p.affiliate] += f.affiliateFee; // Accrue the affiliate fee. + // Accrue the `affiliateBPSFee + affiliateFlatFee`. + affiliateFeesAccrued[p.affiliate] += f.affiliateFee; } else { // Proof may be invalid, revert to prevent unintended skipping of affiliate fee. if (p.affiliate != address(0)) revert InvalidAffiliate(); - f.affiliateFee = 0; // Set the affiliate fee to zero if not affiliated. + remaining += f.affiliateBPSFee; // Redirect the `affiliateBPSFee` back to the artist. + // If not affiliated... + f.affiliateFee = 0; // Set the affiliate fee to zero, for the {Minted} event. + // Redirect the affiliate flat fee to the platform fees if not affiliated. + f.platformFee += f.affiliateFlatFee; // To be accrued. + f.platformFlatFee += f.affiliateFlatFee; // For the {Minted} event. + f.affiliateFlatFee = 0; // Set the affiliate flat fee to zero, for the {Minted} event. } + + // Accrue the platform fee, inclusive of any redirected `affiliateFlatFee`. + platformFeesAccrued[d.platform] += f.platformFee; } /* ------------------------- MINT --------------------------- */ @@ -358,6 +367,7 @@ contract SuperMinter is ISuperMinter, EIP712 { l.platformFee = f.platformFee; l.platformFlatFee = f.platformFlatFee; l.affiliateFee = f.affiliateFee; + l.affiliateFlatFee = f.affiliateFlatFee; emit Minted(p.edition, p.tier, p.scheduleNum, p.to, l, p.attributionId); } @@ -367,7 +377,7 @@ contract SuperMinter is ISuperMinter, EIP712 { // These functions can only be called by the owner or admin of the edition. /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setPrice( address edition, @@ -384,7 +394,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setPaused( address edition, @@ -399,7 +409,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setTimeRange( address edition, @@ -419,7 +429,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setStartTime( address edition, @@ -432,7 +442,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setAffiliateFee( address edition, @@ -448,7 +458,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setAffiliateMerkleRoot( address edition, @@ -463,7 +473,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setMaxMintablePerAccount( address edition, @@ -483,7 +493,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setMaxMintable( address edition, @@ -501,7 +511,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setMerkleRoot( address edition, @@ -518,7 +528,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setSigner( address edition, @@ -541,7 +551,7 @@ contract SuperMinter is ISuperMinter, EIP712 { // These functions can be called by anyone. /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function withdrawForAffiliate(address affiliate) public { uint256 accrued = affiliateFeesAccrued[affiliate]; @@ -553,7 +563,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function withdrawForPlatform(address platform) public { address recipient = platformFeeAddress[platform]; @@ -571,7 +581,7 @@ contract SuperMinter is ISuperMinter, EIP712 { // These functions enable any caller to set their own platform fees. /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setPlatformFeeAddress(address recipient) public { address sender = LibMulticaller.sender(); @@ -581,7 +591,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setPlatformFeeConfig(uint8 tier, PlatformFeeConfig memory c) public { address sender = LibMulticaller.sender(); @@ -591,7 +601,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setDefaultPlatformFeeConfig(PlatformFeeConfig memory c) public { address sender = LibMulticaller.sender(); @@ -601,7 +611,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setGAPrice(uint96 price) public { address sender = LibMulticaller.sender(); @@ -610,7 +620,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function setPlatformSigner(address signer) public { address sender = LibMulticaller.sender(); @@ -640,7 +650,7 @@ contract SuperMinter is ISuperMinter, EIP712 { // ============================================================= /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function computeMintToDigest(MintTo calldata p) public view returns (bytes32) { // prettier-ignore @@ -660,7 +670,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function totalPriceAndFees( address edition, @@ -672,7 +682,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function totalPriceAndFeesWithSignedPrice( address edition, @@ -686,14 +696,14 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function nextScheduleNum(address edition, uint8 tier) public view returns (uint8) { return _mintData[LibOps.packId(edition, tier, 0)].nextScheduleNum; } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function numberMinted( address edition, @@ -706,7 +716,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function isAffiliatedWithProof( address edition, @@ -720,7 +730,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function isAffiliated( address edition, @@ -732,7 +742,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function checkClaimTickets( address edition, @@ -751,21 +761,21 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function platformFeeConfig(address platform, uint8 tier) public view returns (PlatformFeeConfig memory) { return _platformFeeConfigs[LibOps.packId(platform, tier)]; } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function defaultPlatformFeeConfig(address platform) public view returns (PlatformFeeConfig memory) { return _platformFeeConfigs[LibOps.packId(platform, _DEFAULT_FEE_CONFIG_INDEX)]; } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function effectivePlatformFeeConfig(address platform, uint8 tier) public view returns (PlatformFeeConfig memory) { PlatformFeeConfig memory c = _platformFeeConfigs[LibOps.packId(platform, tier)]; @@ -775,7 +785,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function mintInfoList(address edition) public view returns (MintInfo[] memory a) { unchecked { @@ -794,7 +804,7 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function mintInfo( address edition, @@ -823,14 +833,14 @@ contract SuperMinter is ISuperMinter, EIP712 { } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function name() external pure returns (string memory name_) { (name_, ) = _domainNameAndVersion(); } /** - * @inheritdoc ISuperMinter + * @inheritdoc ISuperMinterV1_1 */ function version() external pure returns (string memory version_) { (, version_) = _domainNameAndVersion(); @@ -840,7 +850,11 @@ contract SuperMinter is ISuperMinter, EIP712 { * @inheritdoc IERC165 */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { - return LibOps.or(interfaceId == type(ISuperMinter).interfaceId, interfaceId == this.supportsInterface.selector); + return + LibOps.or( + interfaceId == type(ISuperMinterV1_1).interfaceId, + interfaceId == this.supportsInterface.selector + ); } // ============================================================= @@ -927,7 +941,8 @@ contract SuperMinter is ISuperMinter, EIP712 { LibOps.or( c.perTxFlat > MAX_PLATFORM_PER_TX_FLAT_FEE, c.perMintFlat > MAX_PLATFORM_PER_MINT_FLAT_FEE, - c.perMintBPS > MAX_PLATFORM_PER_MINT_FEE_BPS + c.perMintBPS > MAX_PLATFORM_PER_MINT_FEE_BPS, + c.affiliatePerMintFlat > MAX_PLATFORM_PER_MINT_FLAT_FEE ) ) revert InvalidPlatformFeeConfig(); } @@ -956,7 +971,7 @@ contract SuperMinter is ISuperMinter, EIP712 { returns (string memory name_, string memory version_) { name_ = "SuperMinter"; - version_ = "1"; + version_ = "1_1"; } // Minting: @@ -1085,11 +1100,13 @@ contract SuperMinter is ISuperMinter, EIP712 { // The platform fee includes BPS fees deducted from sub total, // and flat fees added to sub total. f.platformFee = f.platformMintBPSFee + f.platformFlatFee; - // Affiliate fee is to be deducted from the sub total. + // Affiliate BPS fee is to be deducted from the sub total. // Will be conditionally set to zero during mint if not affiliated. - f.affiliateFee = LibOps.rawMulDiv(f.subTotal, d.affiliateFeeBPS, BPS_DENOMINATOR); + f.affiliateBPSFee = LibOps.rawMulDiv(f.subTotal, d.affiliateFeeBPS, BPS_DENOMINATOR); + f.affiliateFlatFee = c.affiliatePerMintFlat * uint256(quantity); + f.affiliateFee = f.affiliateBPSFee + f.affiliateFlatFee; // The total is the final value which the minter has to pay. It includes all fees. - f.total = f.subTotal + f.platformFlatFee; + f.total = f.subTotal + f.platformFlatFee + f.affiliateFlatFee; } } diff --git a/contracts/modules/interfaces/ISuperMinterV1_1.sol b/contracts/modules/interfaces/ISuperMinterV1_1.sol index 038015cd..fe82db09 100644 --- a/contracts/modules/interfaces/ISuperMinterV1_1.sol +++ b/contracts/modules/interfaces/ISuperMinterV1_1.sol @@ -4,10 +4,10 @@ pragma solidity ^0.8.16; import { IERC165 } from "openzeppelin/utils/introspection/IERC165.sol"; /** - * @title ISuperMinter + * @title ISuperMinterV1_1 * @notice The interface for the generalized minter. */ -interface ISuperMinter is IERC165 { +interface ISuperMinterV1_1 is IERC165 { // ============================================================= // STRUCTS // ============================================================= @@ -110,7 +110,12 @@ interface ISuperMinter is IERC165 { // The total platform per-token BPS fees. uint256 platformMintBPSFee; // The total affiliate fees. + // `affiliateBPSFee + affiliateFlatFee`. uint256 affiliateFee; + // The total affiliate BPS fees. + uint256 affiliateBPSFee; + // The total affiliate flat fees. + uint256 affiliateFlatFee; } /** @@ -143,12 +148,16 @@ interface ISuperMinter is IERC165 { uint256 platformFlatFee; // The total affiliate fees. uint256 affiliateFee; + // The total affiliate flat fees. + uint256 affiliateFlatFee; } /** * @dev A struct to hold the fee configuration for a platform and a tier. */ struct PlatformFeeConfig { + // The per-mint affiliate flat fee. + uint96 affiliatePerMintFlat; // The per-transaction flat fee. uint96 perTxFlat; // The per-token flat fee. diff --git a/tests/modules/SuperMinterV1_1.t.sol b/tests/modules/SuperMinterV1_1.t.sol index 9167f788..abe78619 100644 --- a/tests/modules/SuperMinterV1_1.t.sol +++ b/tests/modules/SuperMinterV1_1.t.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.16; import { Merkle } from "murky/Merkle.sol"; import { IERC721AUpgradeable, ISoundEditionV2, SoundEditionV2 } from "@core/SoundEditionV2.sol"; -import { ISuperMinter, SuperMinter } from "@modules/SuperMinter.sol"; +import { ISuperMinterV1_1, SuperMinterV1_1 } from "@modules/SuperMinterV1_1.sol"; import { DelegateCashLib } from "@modules/utils/DelegateCashLib.sol"; import { LibOps } from "@core/utils/LibOps.sol"; import { Ownable } from "solady/auth/Ownable.sol"; @@ -10,12 +10,21 @@ import { SafeCastLib } from "solady/utils/SafeCastLib.sol"; import { LibSort } from "solady/utils/LibSort.sol"; import "../TestConfigV2.sol"; -contract SuperMinterTests is TestConfigV2 { - SuperMinter sm; +contract SuperMinterV1_1Tests is TestConfigV2 { + SuperMinterV1_1 sm; SoundEditionV2 edition; Merkle merkle; - struct SuperMinterConstants { + event Minted( + address indexed edition, + uint8 tier, + uint8 scheduleNum, + address indexed to, + ISuperMinterV1_1.MintedLogData data, + uint256 indexed attributionId + ); + + struct SuperMinterV1_1Constants { uint96 MAX_PLATFORM_PER_TX_FLAT_FEE; uint96 MAX_PLATFORM_PER_MINT_FLAT_FEE; uint16 MAX_PLATFORM_PER_MINT_FEE_BPS; @@ -34,12 +43,12 @@ contract SuperMinterTests is TestConfigV2 { init.tierCreations[1].maxMintableLower = type(uint32).max; init.tierCreations[1].maxMintableUpper = type(uint32).max; edition = createSoundEdition(init); - sm = new SuperMinter(); + sm = new SuperMinterV1_1(); edition.grantRoles(address(sm), edition.MINTER_ROLE()); merkle = new Merkle(); } - function _superMinterConstants() internal view returns (SuperMinterConstants memory smc) { + function _superMinterConstants() internal view returns (SuperMinterV1_1Constants memory smc) { smc.MAX_PLATFORM_PER_TX_FLAT_FEE = sm.MAX_PLATFORM_PER_TX_FLAT_FEE(); smc.MAX_PLATFORM_PER_MINT_FLAT_FEE = sm.MAX_PLATFORM_PER_MINT_FLAT_FEE(); smc.MAX_PLATFORM_PER_MINT_FEE_BPS = sm.MAX_PLATFORM_PER_MINT_FEE_BPS(); @@ -53,7 +62,7 @@ contract SuperMinterTests is TestConfigV2 { assertEq(sm.mintInfoList(address(edition)).length, 0); for (uint256 j; j < 3; ++j) { for (uint256 i; i < 3; ++i) { - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = address(this); c.edition = address(edition); @@ -78,11 +87,11 @@ contract SuperMinterTests is TestConfigV2 { } } - ISuperMinter.MintInfo[] memory mintInfoList = sm.mintInfoList(address(edition)); + ISuperMinterV1_1.MintInfo[] memory mintInfoList = sm.mintInfoList(address(edition)); assertEq(mintInfoList.length, 3 * 3); for (uint256 j; j < 3; ++j) { for (uint256 i; i < 3; ++i) { - ISuperMinter.MintInfo memory info = mintInfoList[j * 3 + i]; + ISuperMinterV1_1.MintInfo memory info = mintInfoList[j * 3 + i]; assertEq(info.scheduleNum, j); assertEq(info.edition, address(edition)); assertEq(info.startTime, uint32(block.timestamp + i)); @@ -117,7 +126,7 @@ contract SuperMinterTests is TestConfigV2 { } function test_settersConfigurable(uint256) public { - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = uint32(_bound(_random(), 1, type(uint32).max)); c.platform = address(this); c.edition = address(edition); @@ -133,53 +142,53 @@ contract SuperMinterTests is TestConfigV2 { assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); + ISuperMinterV1_1.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); assertEq(info.platform, address(this)); if (c.tier == 0) { if (c.mode == sm.DEFAULT()) { assertEq(info.signer, address(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, bytes32(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMerkleRoot(address(edition), c.tier, 0, c.merkleRoot); assertEq(info.price, 0); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setPrice(address(edition), c.tier, 0, c.price); assertEq(info.maxMintable, type(uint32).max); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMaxMintable(address(edition), c.tier, 0, c.maxMintable); assertEq(info.maxMintablePerAccount, type(uint32).max); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMaxMintablePerAccount(address(edition), c.tier, 0, c.maxMintablePerAccount); } else if (c.mode == sm.VERIFY_MERKLE()) { assertEq(info.signer, address(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, c.merkleRoot); sm.setMerkleRoot(address(edition), c.tier, 0, c.merkleRoot); assertEq(info.price, 0); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setPrice(address(edition), c.tier, 0, c.price); assertEq(info.maxMintable, c.maxMintable); sm.setMaxMintable(address(edition), c.tier, 0, c.maxMintable); assertEq(info.maxMintablePerAccount, type(uint32).max); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMaxMintablePerAccount(address(edition), c.tier, 0, c.maxMintablePerAccount); } else if (c.mode == sm.VERIFY_SIGNATURE()) { assertEq(info.signer, c.signer); sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, bytes32(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMerkleRoot(address(edition), c.tier, 0, c.merkleRoot); assertEq(info.price, c.price); @@ -189,17 +198,17 @@ contract SuperMinterTests is TestConfigV2 { sm.setMaxMintable(address(edition), c.tier, 0, c.maxMintable); assertEq(info.maxMintablePerAccount, type(uint32).max); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMaxMintablePerAccount(address(edition), c.tier, 0, c.maxMintablePerAccount); } } else { if (c.mode == sm.DEFAULT()) { assertEq(info.signer, address(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, bytes32(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMerkleRoot(address(edition), c.tier, 0, c.merkleRoot); assertEq(info.price, c.price); @@ -212,7 +221,7 @@ contract SuperMinterTests is TestConfigV2 { sm.setMaxMintablePerAccount(address(edition), c.tier, 0, c.maxMintablePerAccount); } else if (c.mode == sm.VERIFY_MERKLE()) { assertEq(info.signer, address(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, c.merkleRoot); @@ -231,7 +240,7 @@ contract SuperMinterTests is TestConfigV2 { sm.setSigner(address(edition), c.tier, 0, c.signer); assertEq(info.merkleRoot, bytes32(0)); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMerkleRoot(address(edition), c.tier, 0, c.merkleRoot); assertEq(info.price, c.price); @@ -241,14 +250,14 @@ contract SuperMinterTests is TestConfigV2 { sm.setMaxMintable(address(edition), c.tier, 0, c.maxMintable); assertEq(info.maxMintablePerAccount, type(uint32).max); - vm.expectRevert(ISuperMinter.NotConfigurable.selector); + vm.expectRevert(ISuperMinterV1_1.NotConfigurable.selector); sm.setMaxMintablePerAccount(address(edition), c.tier, 0, c.maxMintablePerAccount); } } } function test_mintDefaultUpToMaxPerAccount() public { - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = address(this); c.edition = address(edition); @@ -263,7 +272,7 @@ contract SuperMinterTests is TestConfigV2 { c.tier = 1; assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = 0; p.scheduleNum = 0; @@ -291,7 +300,7 @@ contract SuperMinterTests is TestConfigV2 { p.tier = 1; p.quantity = 9; - vm.expectRevert(ISuperMinter.ExceedsMaxPerAccount.selector); + vm.expectRevert(ISuperMinterV1_1.ExceedsMaxPerAccount.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); p.quantity = 8; @@ -313,7 +322,7 @@ contract SuperMinterTests is TestConfigV2 { leaves[0] = keccak256(abi.encodePacked(allowlisted[0])); leaves[1] = keccak256(abi.encodePacked(allowlisted[1])); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = address(this); c.edition = address(edition); @@ -327,7 +336,7 @@ contract SuperMinterTests is TestConfigV2 { // Schedule 0. assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = 1; p.scheduleNum = 0; @@ -339,7 +348,7 @@ contract SuperMinterTests is TestConfigV2 { // Try mint with a corrupted proof. p.allowlistProof[0] = bytes32(uint256(p.allowlistProof[0]) ^ 1); - vm.expectRevert(ISuperMinter.InvalidMerkleProof.selector); + vm.expectRevert(ISuperMinterV1_1.InvalidMerkleProof.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); // Restore the proof. p.allowlistProof[0] = bytes32(uint256(p.allowlistProof[0]) ^ 1); @@ -353,14 +362,14 @@ contract SuperMinterTests is TestConfigV2 { assertEq(sm.numberMinted(address(edition), 1, 0, allowlisted[1]), 0); p.quantity = 9; - vm.expectRevert(ISuperMinter.ExceedsMaxPerAccount.selector); + vm.expectRevert(ISuperMinterV1_1.ExceedsMaxPerAccount.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); p.quantity = 8; sm.mintTo{ value: p.quantity * 1 ether }(p); p.quantity = 1; - vm.expectRevert(ISuperMinter.ExceedsMaxPerAccount.selector); + vm.expectRevert(ISuperMinterV1_1.ExceedsMaxPerAccount.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); // Schedule 1. @@ -378,7 +387,7 @@ contract SuperMinterTests is TestConfigV2 { p.allowlistProof = merkle.getProof(leaves, 0); p.quantity = 3; p.allowlistedQuantity = 3; - vm.expectRevert(ISuperMinter.ExceedsMaxPerAccount.selector); + vm.expectRevert(ISuperMinterV1_1.ExceedsMaxPerAccount.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); p.quantity = 2; @@ -401,7 +410,7 @@ contract SuperMinterTests is TestConfigV2 { leaves[0] = keccak256(abi.encodePacked(allowlisted[0])); leaves[1] = keccak256(abi.encodePacked(allowlisted[1])); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = address(this); c.edition = address(edition); @@ -415,7 +424,7 @@ contract SuperMinterTests is TestConfigV2 { // Schedule 0. assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = 1; p.scheduleNum = 0; @@ -429,14 +438,14 @@ contract SuperMinterTests is TestConfigV2 { vm.deal(allowlisted[0], 1000 ether); - vm.expectRevert(ISuperMinter.CallerNotDelegated.selector); + vm.expectRevert(ISuperMinterV1_1.CallerNotDelegated.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); vm.prank(allowlisted[0]); sm.mintTo{ value: p.quantity * 1 ether }(p); expectedNFTBalance += p.quantity; - vm.expectRevert(ISuperMinter.CallerNotDelegated.selector); + vm.expectRevert(ISuperMinterV1_1.CallerNotDelegated.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); for (uint256 q; q < 3; ++q) { @@ -449,7 +458,7 @@ contract SuperMinterTests is TestConfigV2 { vm.prank(allowlisted[0]); _setDelegateForAll(address(this), false); - vm.expectRevert(ISuperMinter.CallerNotDelegated.selector); + vm.expectRevert(ISuperMinterV1_1.CallerNotDelegated.selector); sm.mintTo{ value: p.quantity * 1 ether }(p); } @@ -480,7 +489,7 @@ contract SuperMinterTests is TestConfigV2 { } function test_platformFeeConfig(uint256) public { - SuperMinterConstants memory smc = _superMinterConstants(); + SuperMinterV1_1Constants memory smc = _superMinterConstants(); uint96 perTxFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_TX_FLAT_FEE * 2)); uint96 perMintFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FLAT_FEE * 2)); uint16 perMintBPS = uint16(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FEE_BPS * 2)); @@ -492,7 +501,7 @@ contract SuperMinterTests is TestConfigV2 { perMintFlat > smc.MAX_PLATFORM_PER_MINT_FLAT_FEE || perMintBPS > smc.MAX_PLATFORM_PER_MINT_FEE_BPS; - if (expectRevert) vm.expectRevert(ISuperMinter.InvalidPlatformFeeConfig.selector); + if (expectRevert) vm.expectRevert(ISuperMinterV1_1.InvalidPlatformFeeConfig.selector); if (_random() % 2 == 0) { _setPlatformFeeConfig(tier, perTxFlat, perMintFlat, perMintBPS, active); @@ -523,7 +532,7 @@ contract SuperMinterTests is TestConfigV2 { uint16 perMintBPS, bool active ) internal { - ISuperMinter.PlatformFeeConfig memory c; + ISuperMinterV1_1.PlatformFeeConfig memory c; c.perTxFlat = perTxFlat; c.perMintFlat = perMintFlat; c.perMintBPS = perMintBPS; @@ -538,7 +547,7 @@ contract SuperMinterTests is TestConfigV2 { uint16 perMintBPS, bool active ) internal { - ISuperMinter.PlatformFeeConfig memory c; + ISuperMinterV1_1.PlatformFeeConfig memory c; c.perTxFlat = perTxFlat; c.perMintFlat = perMintFlat; c.perMintBPS = perMintBPS; @@ -572,7 +581,7 @@ contract SuperMinterTests is TestConfigV2 { } function _checkPlatformFeeConfig( - ISuperMinter.PlatformFeeConfig memory result, + ISuperMinterV1_1.PlatformFeeConfig memory result, uint96 perTxFlat, uint96 perMintFlat, uint16 perMintBPS, @@ -585,9 +594,9 @@ contract SuperMinterTests is TestConfigV2 { } function test_unitPrice(uint256) public { - SuperMinterConstants memory smc = _superMinterConstants(); + SuperMinterV1_1Constants memory smc = _superMinterConstants(); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = _randomNonZeroAddress(); c.edition = address(edition); @@ -612,9 +621,9 @@ contract SuperMinterTests is TestConfigV2 { uint32 quantity = uint32(_bound(_random(), 1, type(uint32).max)); uint96 signedPrice = uint96(_bound(_random(), 1, type(uint96).max)); - ISuperMinter.TotalPriceAndFees memory tpaf; + ISuperMinterV1_1.TotalPriceAndFees memory tpaf; if (c.mode == sm.VERIFY_SIGNATURE() && signedPrice < c.price) { - vm.expectRevert(ISuperMinter.SignedPriceTooLow.selector); + vm.expectRevert(ISuperMinterV1_1.SignedPriceTooLow.selector); tpaf = sm.totalPriceAndFeesWithSignedPrice(address(edition), c.tier, 0, quantity, signedPrice); signedPrice = c.price; } @@ -627,7 +636,7 @@ contract SuperMinterTests is TestConfigV2 { assertEq(tpaf.unitPrice, c.price); } - ISuperMinter.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); + ISuperMinterV1_1.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); if (c.tier == 0) { assertEq(info.price, c.mode == sm.VERIFY_SIGNATURE() ? c.price : gaPrice); } else { @@ -636,10 +645,10 @@ contract SuperMinterTests is TestConfigV2 { } function test_mintWithVariousFees(uint256) public { - SuperMinterConstants memory smc = _superMinterConstants(); + SuperMinterV1_1Constants memory smc = _superMinterConstants(); address[] memory feeRecipients = _twoRandomUniqueAddresses(); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = _randomNonZeroAddress(); c.edition = address(edition); @@ -658,11 +667,11 @@ contract SuperMinterTests is TestConfigV2 { } assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintInfo memory mintInfo = sm.mintInfo(address(edition), 1, 0); + ISuperMinterV1_1.MintInfo memory mintInfo = sm.mintInfo(address(edition), 1, 0); assertEq(mintInfo.price, c.price); assertEq(mintInfo.affiliateFeeBPS, c.affiliateFeeBPS); - ISuperMinter.PlatformFeeConfig memory pfc; + ISuperMinterV1_1.PlatformFeeConfig memory pfc; pfc.perTxFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_TX_FLAT_FEE)); pfc.perMintFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FLAT_FEE)); pfc.perMintBPS = uint16(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FEE_BPS)); @@ -670,9 +679,9 @@ contract SuperMinterTests is TestConfigV2 { vm.prank(c.platform); sm.setPlatformFeeConfig(1, pfc); - ISuperMinter.TotalPriceAndFees memory tpaf; + ISuperMinterV1_1.TotalPriceAndFees memory tpaf; - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = 1; p.scheduleNum = 0; @@ -690,7 +699,7 @@ contract SuperMinterTests is TestConfigV2 { p.affiliate = feeRecipients[1]; p.quantity = uint32(_bound(_random(), 1, 8)); tpaf = sm.totalPriceAndFees(address(edition), 1, 0, p.quantity); - vm.expectRevert(ISuperMinter.InvalidAffiliate.selector); + vm.expectRevert(ISuperMinterV1_1.InvalidAffiliate.selector); vm.deal(address(this), type(uint192).max); sm.mintTo{ value: tpaf.total }(p); return; @@ -723,7 +732,7 @@ contract SuperMinterTests is TestConfigV2 { assertEq(address(sm).balance, (tpaf.affiliateFee + tpaf.platformFee) * 2); assertEq(address(edition).balance, (tpaf.total - tpaf.platformFee - tpaf.affiliateFee) * 2); - vm.expectRevert(ISuperMinter.PlatformFeeAddressIsZero.selector); + vm.expectRevert(ISuperMinterV1_1.PlatformFeeAddressIsZero.selector); sm.withdrawForPlatform(c.platform); vm.prank(c.platform); @@ -748,8 +757,131 @@ contract SuperMinterTests is TestConfigV2 { } } + function testMintWithAffiliateFlatFees(uint256) public { + SuperMinterV1_1Constants memory smc = _superMinterConstants(); + address[] memory feeRecipients = _twoRandomUniqueAddresses(); + + // Create a tier 1 mint schedule, without any affiliate root. + ISuperMinterV1_1.MintCreation memory c; + c.maxMintable = type(uint32).max; + c.platform = _randomNonZeroAddress(); + c.edition = address(edition); + c.tier = 1; + c.price = uint96(_bound(_random(), 0, type(uint96).max)); + c.affiliateFeeBPS = uint16(_bound(_random(), 0, smc.MAX_AFFILIATE_FEE_BPS)); + c.startTime = 0; + c.endTime = uint32(block.timestamp + 1000); + c.maxMintablePerAccount = type(uint32).max; + assertEq(sm.createEditionMint(c), 0); + + // Set the tier 1 platform fee config. + ISuperMinterV1_1.PlatformFeeConfig memory pfc; + pfc.affiliatePerMintFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FLAT_FEE)); + pfc.perTxFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_TX_FLAT_FEE)); + pfc.perMintFlat = uint96(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FLAT_FEE)); + pfc.perMintBPS = uint16(_bound(_random(), 0, smc.MAX_PLATFORM_PER_MINT_FEE_BPS)); + pfc.active = true; + vm.prank(c.platform); + sm.setPlatformFeeConfig(1, pfc); + + // Prepare the MintTo struct witha a random quantity. + ISuperMinterV1_1.MintTo memory p; + p.edition = address(edition); + p.tier = 1; + p.scheduleNum = 0; + p.to = address(this); + p.quantity = uint32(_bound(_random(), 0, type(uint32).max)); + + ISuperMinterV1_1.TotalPriceAndFees memory tpaf; + tpaf = sm.totalPriceAndFees(address(edition), 1, 0, p.quantity); + assertEq(tpaf.affiliateFlatFee, pfc.affiliatePerMintFlat * p.quantity); + assertEq(tpaf.affiliateFee, tpaf.affiliateFlatFee + tpaf.affiliateBPSFee); + + // Use a lower, non-zero quantity for mint testing. + p.quantity = uint32(_bound(_random(), 1, 8)); + tpaf = sm.totalPriceAndFees(address(edition), 1, 0, p.quantity); + assertEq(tpaf.affiliateFlatFee, pfc.affiliatePerMintFlat * p.quantity); + assertEq(tpaf.affiliateFee, tpaf.affiliateFlatFee + tpaf.affiliateBPSFee); + + // Just to ensure we have enough ETH to mint. + vm.deal(address(this), type(uint192).max); + + // Test the affiliated path. + if (_random() % 2 == 0) { + p.affiliate = _randomNonZeroAddress(); + + vm.expectEmit(true, true, true, true); + ISuperMinterV1_1.MintedLogData memory l; + l.quantity = p.quantity; + l.fromTokenId = 1; + l.affiliate = p.affiliate; + l.affiliated = true; + l.requiredEtherValue = tpaf.total; + l.unitPrice = tpaf.unitPrice; + l.platformFee = tpaf.platformFee; + l.platformFlatFee = tpaf.platformFlatFee; + l.affiliateFee = tpaf.affiliateFee; + l.affiliateFlatFee = tpaf.affiliateFlatFee; + emit Minted(address(edition), 1, 0, address(this), l, 0); + + sm.mintTo{ value: tpaf.total }(p); + assertEq(sm.platformFeesAccrued(c.platform), tpaf.platformFee); + assertEq(sm.affiliateFeesAccrued(p.affiliate), tpaf.affiliateFee); + assertEq(address(sm).balance, tpaf.affiliateFee + tpaf.platformFee); + assertEq(address(edition).balance, (tpaf.total - tpaf.platformFee - tpaf.affiliateFee)); + + // Perform the withdrawals and check if the balances tally. + vm.prank(c.platform); + sm.setPlatformFeeAddress(feeRecipients[0]); + assertEq(sm.platformFeeAddress(c.platform), feeRecipients[0]); + + uint256 balanceBefore = address(p.affiliate).balance; + sm.withdrawForAffiliate(p.affiliate); + assertEq(address(p.affiliate).balance, balanceBefore + tpaf.affiliateFee); + assertEq(address(sm).balance, tpaf.platformFee); + + balanceBefore = address(feeRecipients[0]).balance; + sm.withdrawForPlatform(c.platform); + assertEq(address(feeRecipients[0]).balance, balanceBefore + tpaf.platformFee); + assertEq(sm.platformFeeAddress(c.platform), feeRecipients[0]); + assertEq(address(sm).balance, 0); + } else { + p.affiliate = address(0); + + vm.expectEmit(true, true, true, true); + ISuperMinterV1_1.MintedLogData memory l; + l.quantity = p.quantity; + l.fromTokenId = 1; + l.affiliate = address(0); + l.affiliated = false; + l.requiredEtherValue = tpaf.total; + l.unitPrice = tpaf.unitPrice; + l.platformFee = tpaf.platformFee + tpaf.affiliateFlatFee; + l.platformFlatFee = tpaf.platformFlatFee + tpaf.affiliateFlatFee; + l.affiliateFee = 0; + l.affiliateFlatFee = 0; + emit Minted(address(edition), 1, 0, address(this), l, 0); + sm.mintTo{ value: tpaf.total }(p); + + assertEq(sm.platformFeesAccrued(c.platform), tpaf.affiliateFlatFee + tpaf.platformFee); + assertEq(address(sm).balance, tpaf.affiliateFlatFee + tpaf.platformFee); + assertEq(address(edition).balance, (tpaf.total - tpaf.platformFee - tpaf.affiliateFlatFee)); + + // Perform the withdrawals and check if the balances tally. + vm.prank(c.platform); + sm.setPlatformFeeAddress(feeRecipients[0]); + assertEq(sm.platformFeeAddress(c.platform), feeRecipients[0]); + + uint256 balanceBefore = address(feeRecipients[0]).balance; + sm.withdrawForPlatform(c.platform); + assertEq(address(feeRecipients[0]).balance, balanceBefore + tpaf.affiliateFlatFee + tpaf.platformFee); + assertEq(sm.platformFeeAddress(c.platform), feeRecipients[0]); + assertEq(address(sm).balance, 0); + } + } + function _checkTotalPriceAndFees( - ISuperMinter.TotalPriceAndFees memory tpaf, + ISuperMinterV1_1.TotalPriceAndFees memory tpaf, uint256 quantity, uint256 perTxFlat, uint256 perMintFlat, @@ -778,7 +910,7 @@ contract SuperMinterTests is TestConfigV2 { function test_mintWithSignature(uint256) public { (address signer, uint256 privateKey) = _randomSigner(); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = _randomNonZeroAddress(); c.edition = address(edition); @@ -796,7 +928,7 @@ contract SuperMinterTests is TestConfigV2 { } assertEq(sm.createEditionMint(c), 0); - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = c.tier; p.scheduleNum = 0; @@ -813,19 +945,19 @@ contract SuperMinterTests is TestConfigV2 { sm.mintTo{ value: uint256(p.quantity) * uint256(p.signedPrice) }(p); - vm.expectRevert(ISuperMinter.SignatureAlreadyUsed.selector); + vm.expectRevert(ISuperMinterV1_1.SignatureAlreadyUsed.selector); sm.mintTo{ value: uint256(p.quantity) * uint256(p.signedPrice) }(p); assertEq(edition.balanceOf(p.to), p.quantity); p.signedClaimTicket = uint32(p.signedClaimTicket ^ 1); - vm.expectRevert(ISuperMinter.InvalidSignature.selector); + vm.expectRevert(ISuperMinterV1_1.InvalidSignature.selector); sm.mintTo{ value: uint256(p.quantity) * uint256(p.signedPrice) }(p); uint32 originalQuantity = p.quantity; p.quantity = uint32(p.signedQuantity + _bound(_random(), 1, 10)); p.signature = _generateSignature(p, privateKey); - vm.expectRevert(ISuperMinter.ExceedsSignedQuantity.selector); + vm.expectRevert(ISuperMinterV1_1.ExceedsSignedQuantity.selector); sm.mintTo{ value: uint256(p.quantity) * uint256(p.signedPrice) }(p); p.quantity = originalQuantity; @@ -835,7 +967,7 @@ contract SuperMinterTests is TestConfigV2 { assertEq(edition.balanceOf(p.to), p.quantity * 2); } - function _generateSignature(ISuperMinter.MintTo memory p, uint256 privateKey) + function _generateSignature(ISuperMinterV1_1.MintTo memory p, uint256 privateKey) internal returns (bytes memory signature) { @@ -845,7 +977,7 @@ contract SuperMinterTests is TestConfigV2 { } function test_mintGA(uint256) public { - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = _randomNonZeroAddress(); c.edition = address(edition); @@ -860,7 +992,7 @@ contract SuperMinterTests is TestConfigV2 { vm.prank(c.platform); sm.setGAPrice(uint96(gaPrice)); - ISuperMinter.MintTo memory p; + ISuperMinterV1_1.MintTo memory p; p.edition = address(edition); p.tier = 0; p.scheduleNum = 0; @@ -874,7 +1006,7 @@ contract SuperMinterTests is TestConfigV2 { function test_setSigner(uint256) public { address initialSigner = _random() % 2 == 0 ? address(1) : _randomNonZeroAddress(); - ISuperMinter.MintCreation memory c; + ISuperMinterV1_1.MintCreation memory c; c.maxMintable = type(uint32).max; c.platform = _randomNonZeroAddress(); c.edition = address(edition); @@ -890,7 +1022,7 @@ contract SuperMinterTests is TestConfigV2 { vm.prank(c.platform); sm.setPlatformSigner(platformSigner); - ISuperMinter.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); + ISuperMinterV1_1.MintInfo memory info = sm.mintInfo(address(edition), c.tier, 0); assertEq(info.signer, initialSigner == address(1) ? platformSigner : initialSigner); assertEq(info.usePlatformSigner, initialSigner == address(1));