explain what I'm doing wrong please?
struct Example {
uint8[2] eg;
bool[2] ex;
address someAddress;
string myString;
}
Example[] internal examples;
function addExample(Example[] _examples) external {
for (uint256 i; i < _examples.length; i++)
examples.push(_examples[i]);
if (_examples.length > 0)
examples[0].eg[1] = 9; //ERROR HERE
}
use pragma experimental ABIEncoderV2; in header file
function addExample(Example[] memory _examples) external {
Yeah sorry, that's a typo from simplifying, that's there else the compiler complains
Ok, one moment i look more deeply
I'll check this - I'm using it in my base contract, but the error occurs in an inherited contract which doesn't have this in the header so I'll add and make sure this isn't the issue. I think I can use pragma abicoder v2 now as it's no longer experimental
Обсуждают сегодня