I have a mapping: mapping(uint256 => uint256[]) public derivedTokens;
In some cases, I want to define the size of the uint256[]
dynamic array to 5
. But if I try this: derivedTokens[tokenId] = uint256[5];
I get the following error: from solidity:
TypeError: Type type(uint256[5] memory) is not implicitly convertible to expected type uint256[] storage ref.
How can I resolve this issue?
PS: Another question would be "How to have different fixed sized arrays within a mapping?" or is this possible?