// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract Token is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721("GameItem", "ITM") {}
function mintItem(address player, string memory tokenURI)
external
returns (uint256)
{
uint256 newItemId = _tokenIds.current();
_mint(player, newItemId);
_setTokenURI(newItemId, tokenURI);
_tokenIds.increment();
return newItemId;
}
}
When we send the above contract to audit, we will get report like the following methods should be changed from public
to external
.
- balanceOf
- name
- symbol
- approve
- afeTransferFrom
To make the above methods as external, we have to flatten the contracts and make it external. Is there any alternate methods to pass audit report.