Download third_party/real_code/rc17/sources/contracts/SharpNFT.sol from UTSCybeR/nftbench: direct link, hf CLI and curl.
- Browser
- Download file 1.72 kB
-
https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/third_party/real_code/rc17/sources/contracts/SharpNFT.sol
- Command line
-
hf download hf://datasets/UTSCybeR/nftbench/third_party/real_code/rc17/sources/contracts/SharpNFT.sol
-
curl -L -o SharpNFT.sol https://huggingface.co/datasets/UTSCybeR/nftbench/resolve/main/third_party/real_code/rc17/sources/contracts/SharpNFT.sol
1.72 kB
| // SPDX-License-Identifier: MIT | |
| // Compatible with OpenZeppelin Contracts ^5.0.0 | |
| pragma solidity ^0.8.22; | |
| import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
| import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; | |
| import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
| import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract SharpNFT is ERC721, ERC721Enumerable, ERC721URIStorage, Ownable { | |
| uint256 private _nextTokenId; | |
| event Locked(uint256 tokenId); | |
| constructor( address initialOwner) ERC721("SharpNFT", "SNFT") Ownable(initialOwner) {} | |
| function safeMint(address to, string memory uri) public onlyOwner returns (uint256) { | |
| uint256 tokenId = _nextTokenId++; | |
| _safeMint(to, tokenId); | |
| _setTokenURI(tokenId, uri); | |
| emit Locked(tokenId); | |
| return tokenId; | |
| } | |
| // The following functions are overrides required by Solidity. | |
| function _update(address to, uint256 tokenId, address auth) internal override(ERC721, ERC721Enumerable) returns (address) { | |
| return super._update(to, tokenId, auth); | |
| } | |
| function _increaseBalance(address account, uint128 value) internal override(ERC721, ERC721Enumerable) { | |
| super._increaseBalance(account, value); | |
| } | |
| function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { | |
| return super.tokenURI(tokenId); | |
| } | |
| function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) | |
| { | |
| return super.supportsInterface(interfaceId); | |
| } | |
| } | |