// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "@openzeppelin/contracts/token/ERC721//ERC721.sol"; contract GenNFTs is ERC721 { uint public totalMinted; mapping (address => bool) public autorized; using Strings for uint256; string InitName = "GenNFTs"; string InitSymbol = "GEN"; uint256 specialMinted; uint256 founderPercentage=10; address royaltyReceiver; mapping (uint => string) private ID2URI; uint[] public mintedNFTs; constructor() ERC721(InitName, InitSymbol) { autorized[msg.sender]=true; royaltyReceiver=msg.sender; } function autorizeAddress(address _address) public onlyAutorized{ autorized[_address]=true; } modifier onlyAutorized(){ require(autorized[msg.sender],"Only autorized"); _; } function mint(address _to, string memory _specialURI, uint _NFTID) public onlyAutorized { totalMinted++; ID2URI[_NFTID]=_specialURI; _safeMint(_to, _NFTID); _ownedTokens[_to].push(_NFTID); mintedNFTs.push(_NFTID); } function walletOfOwner(address _owner) public view returns (uint256[] memory) { return _ownedTokens[_owner]; } mapping(address => uint[]) private _ownedTokens; function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) { require( _exists(_tokenId), "ERC721Metadata: URI query for nonexistent token" ); return ID2URI[_tokenId]; } function change_tokenURI(uint256 _tokenId, string memory _newURI) public onlyAutorized{ require(_exists(_tokenId),"ERC721Metadata: URI query for nonexistent token"); ID2URI[_tokenId]=_newURI; } function royaltyInfo(uint256 _tokenId,uint256 _salePrice) public view returns (address receiver, uint256 royaltyAmount){ _tokenId+0; return(royaltyReceiver, _salePrice*(founderPercentage)/100); } function changeRoyaltyFounderInfo(address _royaltyReceiver) public onlyAutorized{ royaltyReceiver=_royaltyReceiver; } } //Fork de Contrato de Prueba Hashlips //Modificado y Adaptado por Rafael SantaMarĂ­a de BitsDapps.tech para el proyecto "Astroneas"