diff --git a/test/ZoraNFTCreatorV1.t.sol b/test/ZoraNFTCreatorV1.t.sol index 38323b2..7c2cc88 100644 --- a/test/ZoraNFTCreatorV1.t.sol +++ b/test/ZoraNFTCreatorV1.t.sol @@ -11,7 +11,7 @@ import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; import {ForkHelper} from "./utils/ForkHelper.sol"; import {DropDeployment , ChainConfig} from "../src/DeploymentConfig.sol"; -contract ZoraNFTCreatorV1Test is Test, ForkHelper { +contract ZoraNFTCreatorV1Test is Test { address public constant DEFAULT_OWNER_ADDRESS = address(0x23499); address payable public constant DEFAULT_FUNDS_RECIPIENT_ADDRESS = payable(address(0x21303)); @@ -87,59 +87,6 @@ contract ZoraNFTCreatorV1Test is Test, ForkHelper { assertEq(drop.totalSupply(), 10); } - function test_fork_CreateEdition() external { - string[] memory forkTestChains = getForkTestChains(); - - DropDeployment memory deployment; - ChainConfig memory chainConfig; - - for (uint256 i = 0; i < forkTestChains.length; i++) { - string memory chainName = forkTestChains[i]; - - vm.createSelectFork(vm.rpcUrl(chainName )); - - // get the deployment for the current chain id. - deployment = getDeployment(); - chainConfig = getChainConfig(); - - address factoryAddress = deployment.factory; - ZoraNFTCreatorV1 factory = ZoraNFTCreatorV1(factoryAddress); - - assertEq(chainConfig.factoryOwner, OwnableUpgradeable(factoryAddress).owner(), string.concat("configured owner incorrect on: ", chainName)); - assertEq(deployment.dropMetadata, address(factory.dropMetadataRenderer()), string.concat("configured drop metadata renderer incorrect on: ", chainName)); - assertEq(deployment.editionMetadata, address(factory.editionMetadataRenderer()), string.concat("configured edition metadata renderer incorrect on: ", chainName)); - // assertEq(deployment.dropImplementation, address(factory.editionMetadataRenderer()), string.concat("configured metadata renderer incorrect on: ", chainName)); - - address deployedEdition = factory.createEdition( - "name", - "symbol", - 100, - 500, - DEFAULT_FUNDS_RECIPIENT_ADDRESS, - DEFAULT_FUNDS_RECIPIENT_ADDRESS, - IERC721Drop.SalesConfiguration({ - publicSaleStart: 0, - publicSaleEnd: type(uint64).max, - presaleStart: 0, - presaleEnd: 0, - publicSalePrice: 0.1 ether, - maxSalePurchasePerAddress: 0, - presaleMerkleRoot: bytes32(0) - }), - "desc", - "animation", - "image" - ); - ERC721Drop drop = ERC721Drop(payable(deployedEdition)); - (, uint256 fee) = drop.zoraFeeForAmount(10); - vm.startPrank(DEFAULT_FUNDS_RECIPIENT_ADDRESS); - vm.deal(DEFAULT_FUNDS_RECIPIENT_ADDRESS, 10 ether + fee); - drop.purchase{value: 1 ether + fee}(10); - assertEq(drop.totalSupply(), 10); - - } - } - function test_CreateDrop() public { address deployedDrop = creator.createDrop( "name", diff --git a/test/ZoraNFTCreatorV1_Fork.t.sol b/test/ZoraNFTCreatorV1_Fork.t.sol new file mode 100644 index 0000000..8af9fcc --- /dev/null +++ b/test/ZoraNFTCreatorV1_Fork.t.sol @@ -0,0 +1,70 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.10; + +import {Test} from "forge-std/Test.sol"; +import {IMetadataRenderer} from "../src/interfaces/IMetadataRenderer.sol"; +import "../src/ZoraNFTCreatorV1.sol"; +import "../src/ZoraNFTCreatorProxy.sol"; +import {MockMetadataRenderer} from "./metadata/MockMetadataRenderer.sol"; +import {FactoryUpgradeGate} from "../src/FactoryUpgradeGate.sol"; +import {IERC721AUpgradeable} from "erc721a-upgradeable/IERC721AUpgradeable.sol"; +import {ForkHelper} from "./utils/ForkHelper.sol"; +import {DropDeployment , ChainConfig} from "../src/DeploymentConfig.sol"; + +contract ZoraNFTCreatorV1_ForkTests is Test, ForkHelper { + address payable public constant DEFAULT_FUNDS_RECIPIENT_ADDRESS = + payable(address(0x21303)); + + function test_fork_CreateEdition() external { + string[] memory forkTestChains = getForkTestChains(); + + DropDeployment memory deployment; + ChainConfig memory chainConfig; + + for (uint256 i = 0; i < forkTestChains.length; i++) { + string memory chainName = forkTestChains[i]; + + vm.createSelectFork(vm.rpcUrl(chainName )); + + // get the deployment for the current chain id. + deployment = getDeployment(); + chainConfig = getChainConfig(); + + address factoryAddress = deployment.factory; + ZoraNFTCreatorV1 factory = ZoraNFTCreatorV1(factoryAddress); + + assertEq(chainConfig.factoryOwner, OwnableUpgradeable(factoryAddress).owner(), string.concat("configured owner incorrect on: ", chainName)); + assertEq(deployment.dropMetadata, address(factory.dropMetadataRenderer()), string.concat("configured drop metadata renderer incorrect on: ", chainName)); + assertEq(deployment.editionMetadata, address(factory.editionMetadataRenderer()), string.concat("configured edition metadata renderer incorrect on: ", chainName)); + // assertEq(deployment.dropImplementation, address(factory.editionMetadataRenderer()), string.concat("configured metadata renderer incorrect on: ", chainName)); + + address deployedEdition = factory.createEdition( + "name", + "symbol", + 100, + 500, + DEFAULT_FUNDS_RECIPIENT_ADDRESS, + DEFAULT_FUNDS_RECIPIENT_ADDRESS, + IERC721Drop.SalesConfiguration({ + publicSaleStart: 0, + publicSaleEnd: type(uint64).max, + presaleStart: 0, + presaleEnd: 0, + publicSalePrice: 0.1 ether, + maxSalePurchasePerAddress: 0, + presaleMerkleRoot: bytes32(0) + }), + "desc", + "animation", + "image" + ); + ERC721Drop drop = ERC721Drop(payable(deployedEdition)); + (, uint256 fee) = drop.zoraFeeForAmount(10); + vm.startPrank(DEFAULT_FUNDS_RECIPIENT_ADDRESS); + vm.deal(DEFAULT_FUNDS_RECIPIENT_ADDRESS, 10 ether + fee); + drop.purchase{value: 1 ether + fee}(10); + assertEq(drop.totalSupply(), 10); + + } + } +} \ No newline at end of file