Skip to content

Commit

Permalink
feat: add banner image (#41)
Browse files Browse the repository at this point in the history
* feat: add banner image

* fix lint

* bump version
  • Loading branch information
arr00 authored Sep 3, 2024
1 parent 1bfe43e commit 694b199
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/MintERC1155.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
string public imageURI;
/// @notice Contract level description for `contractURI`
string public description;
///@notice Contract level banner for `contractURI`
string public bannerURI;

constructor(address minter) {
_disableInitializers();
Expand Down Expand Up @@ -169,9 +171,7 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
return json;
}

function supportsInterface(
bytes4 interfaceId
)
function supportsInterface(bytes4 interfaceId)
public
view
virtual
Expand All @@ -185,6 +185,7 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
string memory name_,
string memory imageURI_,
string memory description_,
string memory bannerURI_,
address royaltyReceiver,
uint16 royaltyAmountBps
)
Expand All @@ -195,6 +196,7 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
name = name_;
imageURI = imageURI_;
description = description_;
bannerURI = bannerURI_;

emit ContractURIUpdated();
}
Expand All @@ -207,6 +209,8 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
LibString.escapeJSON(imageURI),
'","description":"',
LibString.escapeJSON(description),
'","banner_image":"',
LibString.escapeJSON(bannerURI),
'"}'
);

Expand Down Expand Up @@ -253,6 +257,6 @@ contract MintERC1155 is ERC1155SupplyUpgradeable, OwnableUpgradeable, ERC2981Upg
}

function VERSION() external pure returns (string memory) {
return "1.1.0";
return "1.2.0";
}
}
2 changes: 1 addition & 1 deletion src/NFTMint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,6 @@ contract NFTMint is Ownable {
}

function VERSION() external pure returns (string memory) {
return "1.1.0";
return "1.2.0";
}
}
4 changes: 3 additions & 1 deletion test/MintERC1155.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ contract MintERC1155Test is TestBase, LintJSON {
function test_setContractInfo() external {
vm.expectEmit(true, true, true, true);
emit ContractURIUpdated();
token.setContractInfo("MyTestContract", "https://example.com/image.png", "New description", address(this), 100);
token.setContractInfo(
"MyTestContract", "https://example.com/image.png", "New description", "the banner", address(this), 100
);

assertEq(token.name(), "MyTestContract");
assertEq(token.imageURI(), "https://example.com/image.png");
Expand Down

0 comments on commit 694b199

Please sign in to comment.