Last active
March 7, 2022 17:20
-
-
Save skyfly200/1fe7621107d16d76d9d46bca027ad9dc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.2; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Royalty.sol"; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract ERRORNFT is ERC721Burnable, ERC721Royalty, Ownable { | |
uint96 public royaltyPercent = 1000; | |
string public metadataURI = "https://gist.githubusercontent.com/skyfly200/1fe7621107d16d76d9d46bca027ad9dc/raw/05c8c6671b6130f6e4a2553189c4e204a827936d/metadata.json"; | |
string public ipfsLink = "ipfs://ipfs/QmdnJtm8hxfqZPcXGZYDaw6e459Sdy85k1ChifeiL8YoqG/image.png"; | |
string public arWeaveLink = "https://app.ardrive.io/#/file/888104b7-eb10-43db-bd49-9052f36c5197/view"; | |
string public github = "https://github.com/MonkMatto/Conceptual-Art/tree/main/ERROR"; | |
constructor() ERC721("ERROR", "404") { | |
// set deafault royalty | |
_setDefaultRoyalty(address(this), royaltyPercent); | |
_safeMint(msg.sender, 404); | |
} | |
/** | |
* @dev Update the royalty percentage | |
* @param _percentage for royalties | |
* @dev Only the owner can call this | |
*/ | |
function setRoyaltyPercent(uint96 _percentage) onlyOwner external { | |
royaltyPercent = _percentage; | |
} | |
/** | |
* @dev Update the metadata URI | |
* @param uri to set | |
* @dev Only the owner can call this | |
*/ | |
function setMetadataURI(string calldata uri) onlyOwner external { | |
metadataURI = uri; | |
} | |
// The following functions are overrides required by Solidity. | |
/** | |
* @dev get baseURI for all tokens | |
*/ | |
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) { | |
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); | |
return metadataURI; | |
} | |
/** | |
* @dev get baseURI for all tokens | |
*/ | |
function _baseURI() internal view override returns (string memory) { | |
return metadataURI; | |
} | |
function supportsInterface(bytes4 interfaceId) | |
public | |
view | |
override(ERC721, ERC721Royalty) | |
returns (bool) | |
{ | |
return super.supportsInterface(interfaceId); | |
} | |
function _burn(uint256 tokenId) | |
internal | |
override(ERC721, ERC721Royalty) | |
{ | |
super._burn(tokenId); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"platform":"MATTO","name":"ERROR","tokenID":"404","description":"ERROR is a purposely broken image file.","github":"https://github.com/MonkMatto/Conceptual-Art/tree/main/ERROR","arweave":"https://app.ardrive.io/#/file/888104b7-eb10-43db-bd49-9052f36c5197/view","image":"ipfs://ipfs/QmdnJtm8hxfqZPcXGZYDaw6e459Sdy85k1ChifeiL8YoqG/image.png","website":"https://matto.xyz/","artist":"Matto","license":"NFT License","royaltyInfo":{"artistAddress":"0xA6a4Fe416F8Bf46bc3bCA068aC8b1fC4DF760653","royaltyFeeByID":10},"attributes":[{"trait_type":"ERROR","value":"404"}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment