I have a truct with array types only. When I declare a mapping, it says: āInternal or recursive type is not allowed for public state variablesā
// SPDX-License-Identifier: MIT
// using 0.7.0+commit.9e61f92b
pragma solidity >=0.6.0 <0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/solc-0.7/contracts/token/ERC721/ERC721.sol";
contract MyNFT is ERC721 {
mapping (uint256 => Attributes) public tokenId2Attributes; // error: Internal or recursive type is not allowed for public state variables
struct Attributes {
string name; // comment out -> error on the line above
uint256[] keys;
uint256[] values;
}
constructor() ERC721("MyNFT", "MNFT"){
}
}