From 51ab1ecefd4bd5277f25a61d52e852cd5b78bbe4 Mon Sep 17 00:00:00 2001 From: kyle <15720036+kyledewy@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:18:27 +0200 Subject: [PATCH] feature: replace OZ 721 with solmate 721 --- contracts/modules/cover/CoverNFT.sol | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/contracts/modules/cover/CoverNFT.sol b/contracts/modules/cover/CoverNFT.sol index 6c50728e17..6adb16b6ad 100644 --- a/contracts/modules/cover/CoverNFT.sol +++ b/contracts/modules/cover/CoverNFT.sol @@ -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 { @@ -19,12 +19,18 @@ 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 { @@ -32,7 +38,7 @@ contract CoverNFT is ERC721 { } function operatorTransferFrom(address from, address to, uint256 tokenId) external onlyOperator { - _transfer(from, to, tokenId); + super.transferFrom(from, to, tokenId); }