Skip to content

Commit

Permalink
feature: replace OZ 721 with solmate 721
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdewy committed Sep 8, 2022
1 parent 0c1a7d4 commit 51ab1ec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions contracts/modules/cover/CoverNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.9;

import "@openzeppelin/contracts-v4/token/ERC721/ERC721.sol";
import "@rari-capital/solmate/src/tokens/ERC721.sol";
import "../../interfaces/ICover.sol";

contract CoverNFT is ERC721 {
Expand All @@ -19,20 +19,26 @@ contract CoverNFT is ERC721 {

}

function tokenURI(uint256 id) public pure override returns (string memory) {
id; // To silence unused param warning. Remove once fn is implemented
return "";
}

function safeMint(address to, uint tokenId) external onlyOperator {
_safeMint(to, tokenId);
}

function isApprovedOrOwner(address spender, uint tokenId) external view returns (bool) {
return _isApprovedOrOwner(spender, tokenId);
address owner = ownerOf(tokenId);
return spender == owner || isApprovedForAll[owner][spender] || spender == getApproved[tokenId];
}

function burn(uint tokenId) external onlyOperator {
_burn(tokenId);
}

function operatorTransferFrom(address from, address to, uint256 tokenId) external onlyOperator {
_transfer(from, to, tokenId);
super.transferFrom(from, to, tokenId);
}


Expand Down

0 comments on commit 51ab1ec

Please sign in to comment.