Skip to content

Commit

Permalink
allows admin to transfer NFT
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHomanics committed Feb 2, 2024
1 parent 3be6122 commit 40ec410
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions packages/foundry/contracts/ATXDAOPartnershipNft.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ contract ATXDAOPartnershipNft is ERC721URIStorage, AccessControl {
transferFrom(ownerOf(tokenId), msg.sender, tokenId);
}

function _checkAuthorized(
address owner,
address spender,
uint256 tokenId
) internal view override {
if (!hasRole(DEFAULT_ADMIN_ROLE, spender)) {
if (!_isAuthorized(owner, spender, tokenId)) {
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} else {
revert ERC721InsufficientApproval(spender, tokenId);
}
}
}
}

function supportsInterface(
bytes4 interfaceId
) public view override(ERC721URIStorage, AccessControl) returns (bool) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Er
// Token symbol
string private _symbol;

mapping(uint256 tokenId => address) private _owners;
mapping(uint256 tokenId => address) _owners;

mapping(address owner => uint256) private _balances;
mapping(address owner => uint256) _balances;

mapping(uint256 tokenId => address) private _tokenApprovals;

Expand Down

0 comments on commit 40ec410

Please sign in to comment.