Skip to content

Commit

Permalink
use mustBeManager instead of adhoc (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
robdoesstuff committed Jan 12, 2024
1 parent dad0816 commit 7a68de3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
5 changes: 1 addition & 4 deletions test/nfts/Test1155PatchNFT.sol
Expand Up @@ -30,10 +30,7 @@ contract Test1155PatchNFT is Patchwork1155Patch {
return MetadataSchema(1, entries);
}

function mintPatch(address to, address originalNFTAddress, uint originalNFTTokenId, address account) external returns (uint256 tokenId){
if (msg.sender != _manager) {
revert();
}
function mintPatch(address to, address originalNFTAddress, uint originalNFTTokenId, address account) external mustBeManager returns (uint256 tokenId){
// Just for testing
tokenId = _nextTokenId;
_nextTokenId++;
Expand Down
5 changes: 1 addition & 4 deletions test/nfts/TestAccountPatchNFT.sol
Expand Up @@ -30,10 +30,7 @@ contract TestAccountPatchNFT is PatchworkReversibleAccountPatch {
return MetadataSchema(1, entries);
}

function mintPatch(address to, address original) public returns (uint256) {
if (msg.sender != _manager) {
revert IPatchworkProtocol.NotAuthorized(msg.sender);
}
function mintPatch(address to, address original) public mustBeManager returns (uint256) {
if (_sameOwnerModel) {
if (to != original) {
revert IPatchworkProtocol.MintNotAllowed(to);
Expand Down
5 changes: 1 addition & 4 deletions test/nfts/TestPatchFragmentNFT.sol
Expand Up @@ -117,10 +117,7 @@ contract TestPatchFragmentNFT is PatchworkPatch, PatchworkFragmentSingle {
return unpackMetadata(_metadataStorage[_tokenId]);
}

function mintPatch(address originalNFTOwner, address originalNFTAddress, uint originalNFTTokenId) external returns (uint256 tokenId){
if (msg.sender != _manager) {
revert();
}
function mintPatch(address originalNFTOwner, address originalNFTAddress, uint originalNFTTokenId) external mustBeManager returns (uint256 tokenId){
// Just for testing
tokenId = _nextTokenId;
_nextTokenId++;
Expand Down
5 changes: 1 addition & 4 deletions test/nfts/TestPatchNFT.sol
Expand Up @@ -83,10 +83,7 @@ contract TestPatchNFT is PatchworkPatch {
return unpackMetadata(_metadataStorage[_tokenId]);
}

function mintPatch(address owner, address originalNFTAddress, uint originalNFTTokenId) external returns (uint256 tokenId){
if (msg.sender != _manager) {
revert();
}
function mintPatch(address owner, address originalNFTAddress, uint originalNFTTokenId) external mustBeManager returns (uint256 tokenId){
// require inherited ownership
if (IERC721(originalNFTAddress).ownerOf(originalNFTTokenId) != owner) {
revert IPatchworkProtocol.NotAuthorized(owner);
Expand Down

0 comments on commit 7a68de3

Please sign in to comment.