I have a question regarding dynamic arrays. The code below gives a code 3 error. Does anyone know what i'm doing wrongly here?
function arrayQuestion(uint256 a1, uint256 a2) external returns(uint256[][2] memory) {
uint256[] memory r0;
r0[0] = a1;
uint256[] memory r1;
r1[0] = a2;
uint256[][2] memory r = [r0,r1];
return (r);
}
A bit of context, the result of r is meant to go into ERC1155 _mintBatch function which requires uint256[ ] mintId and uint256[ ] amounts array parameters.