diff --git a/packages/manifold/contracts/edition/ManifoldERC721Edition.sol b/packages/manifold/contracts/edition/ManifoldERC721Edition.sol index 5077c36b..54a04633 100644 --- a/packages/manifold/contracts/edition/ManifoldERC721Edition.sol +++ b/packages/manifold/contracts/edition/ManifoldERC721Edition.sol @@ -142,7 +142,7 @@ contract ManifoldERC721Edition is CreatorExtension, ICreatorExtensionTokenURI, I } else if (info.storageProtocol == StorageProtocol.IPFS) { prefix = IPFS_PREFIX; } - return string(abi.encodePacked(prefix, info.location, (index+1).toString())); + return string(abi.encodePacked(prefix, info.location, "/", (index+1).toString())); } /** diff --git a/packages/manifold/test/edition/ManifoldERC721Edition.t.sol b/packages/manifold/test/edition/ManifoldERC721Edition.t.sol index 64fe8665..e9b8da49 100644 --- a/packages/manifold/test/edition/ManifoldERC721Edition.t.sol +++ b/packages/manifold/test/edition/ManifoldERC721Edition.t.sol @@ -145,7 +145,7 @@ contract ManifoldERC721EditionTest is Test { example.mint(address(creatorCore1), 1, 0, new IManifoldERC721Edition.Recipient[](0)); // Create with arweave - example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.ARWEAVE, "abcdefgh/", _emptyRecipients); + example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.ARWEAVE, "abcdefgh", _emptyRecipients); IManifoldERC721Edition.Recipient[] memory recipients = new IManifoldERC721Edition.Recipient[](1); recipients[0].recipient = operator; @@ -155,7 +155,7 @@ contract ManifoldERC721EditionTest is Test { assertEq(example.tokenURI(address(creatorCore1), 1), "https://arweave.net/abcdefgh/1"); // Change to be IPFS based - example.setTokenURI(address(creatorCore1), 1, IManifoldERC721Edition.StorageProtocol.IPFS, "abcdefgh/"); + example.setTokenURI(address(creatorCore1), 1, IManifoldERC721Edition.StorageProtocol.IPFS, "abcdefgh"); assertEq(example.tokenURI(address(creatorCore1), 1), "ipfs://abcdefgh/1"); vm.stopPrank(); @@ -172,10 +172,10 @@ contract ManifoldERC721EditionTest is Test { IManifoldERC721Edition.Recipient[] memory _emptyRecipients = new IManifoldERC721Edition.Recipient[](0); vm.startPrank(owner); - example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", _emptyRecipients); - example.createSeries(address(creatorCore1), 2, 20, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2/", _emptyRecipients); - example.createSeries(address(creatorCore2), 3, 200, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2/", _emptyRecipients); - example.createSeries(address(creatorCore3), 4, 300, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2/", _emptyRecipients); + example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", _emptyRecipients); + example.createSeries(address(creatorCore1), 2, 20, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2", _emptyRecipients); + example.createSeries(address(creatorCore2), 3, 200, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2", _emptyRecipients); + example.createSeries(address(creatorCore3), 4, 300, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series2", _emptyRecipients); // Get the edition info ManifoldERC721Edition.EditionInfo memory edition = example.getEditionInfo(address(creatorCore1), 1); @@ -248,7 +248,7 @@ contract ManifoldERC721EditionTest is Test { // Prefix change test vm.expectRevert(IManifoldERC721Edition.InvalidInput.selector); example.setTokenURI(address(creatorCore1), 0, IManifoldERC721Edition.StorageProtocol.INVALID, ""); - example.setTokenURI(address(creatorCore1), 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1new/"); + example.setTokenURI(address(creatorCore1), 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1new"); assertEq("http://creator1series1new/3", creatorCore1.tokenURI(13)); assertEq("http://creator1series1new/5", creatorCore1.tokenURI(15)); @@ -265,7 +265,7 @@ contract ManifoldERC721EditionTest is Test { IManifoldERC721Edition.Recipient[] memory _emptyRecipients = new IManifoldERC721Edition.Recipient[](0); vm.startPrank(owner); - example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", _emptyRecipients); + example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", _emptyRecipients); vm.expectRevert(IManifoldERC721Edition.InvalidInput.selector); example.mint(address(creatorCore1), 1, 0, new IManifoldERC721Edition.Recipient[](0)); @@ -284,7 +284,7 @@ contract ManifoldERC721EditionTest is Test { IManifoldERC721Edition.Recipient[] memory _emptyRecipients = new IManifoldERC721Edition.Recipient[](0); vm.startPrank(owner); - example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", _emptyRecipients); + example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", _emptyRecipients); IManifoldERC721Edition.Recipient[] memory recipients = new IManifoldERC721Edition.Recipient[](1); recipients[0].recipient = operator; @@ -313,7 +313,7 @@ contract ManifoldERC721EditionTest is Test { IManifoldERC721Edition.Recipient[] memory _emptyRecipients = new IManifoldERC721Edition.Recipient[](0); vm.startPrank(owner); - example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", _emptyRecipients); + example.createSeries(address(creatorCore1), 1, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", _emptyRecipients); IManifoldERC721Edition.Recipient[] memory recipients = new IManifoldERC721Edition.Recipient[](1); recipients[0].recipient = operator; @@ -338,7 +338,7 @@ contract ManifoldERC721EditionTest is Test { vm.startPrank(owner); vm.expectRevert(IManifoldERC721Edition.InvalidInput.selector); - example.createSeries(address(creatorCore1), 0, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", _emptyRecipients); + example.createSeries(address(creatorCore1), 0, 10, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", _emptyRecipients); vm.expectRevert(IManifoldERC721Edition.InvalidInput.selector); example.createSeries(address(creatorCore1), 1, 0, IManifoldERC721Edition.StorageProtocol.NONE, "hi", _emptyRecipients); @@ -374,10 +374,10 @@ contract ManifoldERC721EditionTest is Test { // Mint count 0 vm.expectRevert(IManifoldERC721Edition.InvalidInput.selector); - example.createSeries(address(creatorCore1), 10, 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", recipients); + example.createSeries(address(creatorCore1), 10, 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", recipients); recipients[0].count = 1; - example.createSeries(address(creatorCore1), 10, 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", recipients); + example.createSeries(address(creatorCore1), 10, 1, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", recipients); // Too many recipients... recipients = new IManifoldERC721Edition.Recipient[](11); @@ -387,7 +387,7 @@ contract ManifoldERC721EditionTest is Test { } vm.expectRevert(IManifoldERC721Edition.TooManyRequested.selector); - example.createSeries(address(creatorCore1), 11, 2, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1/", recipients); + example.createSeries(address(creatorCore1), 11, 2, IManifoldERC721Edition.StorageProtocol.NONE, "http://creator1series1", recipients); vm.stopPrank(); }