Skip to content

Commit

Permalink
Merge pull request #284 from fleekxyz/feat/remove-transfer
Browse files Browse the repository at this point in the history
feat: disable transfers
  • Loading branch information
EmperorOrokuSaki authored Jul 7, 2023
2 parents c900272 + ba5958a commit 83f7ee2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions contracts/contracts/FleekApps.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ contract FleekApps is Initializable, ERC721Upgradeable {
));
}

/**
* @dev Override of transfer of ERC721.
* Transfer is disabled for NFA tokens.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual override {
revert TransferIsDisabled();
}

function _baseURI() internal view virtual override returns (string memory) {
return "data:application/json;base64,";
}
Expand Down
9 changes: 9 additions & 0 deletions contracts/contracts/FleekERC721.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import "./IERCX.sol";
error MustBeTokenOwner(uint256 tokenId);
error MustBeTokenVerifier(uint256 tokenId);
error ThereIsNoTokenMinted();
error TransferIsDisabled();

contract FleekERC721 is
IERCX,
Expand Down Expand Up @@ -250,6 +251,14 @@ contract FleekERC721 is
super._beforeTokenTransfer(from, to, tokenId, batchSize);
}

/**
* @dev Override of transfer of ERC721.
* Transfer is disabled for NFA tokens.
*/
function _transfer(address from, address to, uint256 tokenId) internal virtual override whenNotPaused {
revert TransferIsDisabled();
}

/**
* @dev A baseURI internal function implementation to be called in the `tokenURI` function.
*/
Expand Down

0 comments on commit 83f7ee2

Please sign in to comment.