My questions in BOLD... I did try to format correctly with back ticks appreciate scolding and teaching if I fouled up. thx
pragma solidity ^0.8.9;```
```import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
Add Royalty
pragma solidity ^0.6.0;
import "./IERC165.sol";```
```interface IERC2981 is IERC165 {
function royaltyInfo(
uint256 **(Proof of Truth)**,
uint256 **0.0026 ether**;
) external view returns (
address **(my wallet)**,
uint256 **0.001 ether**;
);
ERC721(“Proof of Truth”, “PROOF”)
}
// First Question: (1) is this right position and (2) should I make
//Generic somehow for compiling?```
```contract ProofContract is ERC721Enumerable, Ownable {
using Strings for uint256;
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
string public baseURI;
string public baseExtension = ".json";
string public notRevealedURI;
uint256 public cost = 0.0026 ether;
uint256 public maxSupply = 1000;
uint256 public maxMintAmount = 100;
cost seems reasonable, what is effect of max supply and max
mint amount? Should I increase either for longer term use?
I mean if max supply is higher does it affect just gas or number
of times contract can be used and max mint is that for each customer
or too limiting? ```
``` bool public revealed = false;
bool public paused = false;
mapping(address => bool) public whitelisted;
does this belong here?```
```interface IERC165 {
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
constructor(
string memory **“Proof of Truth”**,
string memory **“PROOF”**,
string memory _initBaseURI,
string memory _notRevealedURI
) ERC721**(“Proof of Truth”, “PROOF”**) {
setBaseURI(_initBaseURI);
setNotRevealedURI(_notRevealedURI);
_safeMint(msg.sender, 1);```
``` Royalty
Crosschain Polygon or suggestions for cross chains to add```
```constructor (string memory name, string memory symbol, string memory baseURI) {
_name = (Proof of Truth);
_symbol = (PROOF);
_setBaseURI(baseURI);
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
_registerInterface(_INTERFACE_ID_ERC2981);
bytes4 private constant _INTERFACE_ID_ERC2981 = 0x2a55205a;
function checkRoyalties(address _contract) internal returns (bool) {
(bool success) = IERC165(_contract).supportsInterface(_INTERFACE_ID_ERC2981);
return success;
}
}```
``` internal
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}```
``` public
function mint(uint256 _mintAmount) public payable {
require(!revealed);
require(!paused);
require(_mintAmount > 0);
require(balanceOf(msg.sender) + _mintAmount <= maxMintAmount);
uint256 supply = totalSupply();
require(supply + _mintAmount <= maxSupply);
if (msg.sender != owner()) {
if (whitelisted[msg.sender] != true) {
require(msg.value >= cost * _mintAmount);
}
}
for (uint256 i = 1; i <= _mintAmount; i++) {
_safeMint(msg.sender, supply + i);
_tokenIds.increment();
}
require(payable(owner()).send(address(this).balance));
}
function count() public view returns (uint256) {
return _tokenIds.current();
}
function walletOfOwner(address _owner)
public
view
returns (uint256[] memory)
{
uint256 ownerTokenCount = balanceOf(_owner);
uint256[] memory tokenIds = new uint256[](ownerTokenCount);
for (uint256 i; i < ownerTokenCount; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, i);
}
return tokenIds;
}```
``` function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
require(
_exists(tokenId),
"ERC721Metadata: URI query for nonexistent token"
);
string memory currentBaseURI = _baseURI();
if (revealed) {
return
bytes(currentBaseURI).length > 0
? string(
abi.encodePacked(
currentBaseURI,
tokenId.toString(),
baseExtension
)
)
: "";
} else {
return notRevealedURI;
}
}
function setCost(uint256 _newCost) public onlyOwner {
cost = _newCost;
}
function setmaxMintAmount(uint256 _newmaxMintAmount) public onlyOwner {
maxMintAmount = _newmaxMintAmount;
}
function setNotRevealedURI(string memory _newNotRevealedURI)
public
onlyOwner
{
notRevealedURI = _newNotRevealedURI;
}
function setBaseURI(string memory _newBaseURI) public onlyOwner {
baseURI = _newBaseURI;
}
function setBaseExtension(string memory _newBaseExtension) public onlyOwner {
baseExtension = _newBaseExtension;
}
function setReveal() public onlyOwner {
revealed = !revealed;
}
function setPause() public onlyOwner {
paused = !paused;
}
function addWhitelistUser(address _user) public onlyOwner {
whitelisted[_user] = true;
}
function removeWhitelistUser(address _user) public onlyOwner {
whitelisted[_user] = false;
}
function withdraw() public payable onlyOwner {
require(payable(msg.sender).send(address(this).balance));
}
}```
```Upgradable
do you think this will compile correctly? Remix ? I plan to add crosschain next and end with upgradable Other suggestions?```