I have this in my contract:
struct Shoe {
uint256 number;
uint256 sixe;
string color;
bool exist;
TicketLibrary.TicketState ticketState;
}
struct IndexedShoe {
uint256 index;
Shoe indexedShoe;
}
IndexedShoe[] public indexedShoeStorageArray;
function copyShoeArrayToStorage(
IndexedShoe[] memory tempArray
) public {
delete indexedShoeStorageArray;
indexedShoeStorageArray = new IndexedShoe[](tempArray.length);
for (uint256 i = 0; i <= tempArray.length; i++) {
indexedShoeStorageArray[i]= tempArray[i];
}
}
function createIndexedShoeArray(Shoe memory test) public returns (IndexedShoe[] memory) {
IndexedShoe[] memory tempShoeArray = new IndexedShoe[](3);
tempShoeArray[0].index = 0;
tempShoeArray[0].indexedShoe = test;
copyShoeArrayToStorage(tempShoeArray);
return tempShoeArray;
}
Im getting the UnimplementedFeatureError: Copying of type struct TestAbi.IndexedShoe memory[] memory to storage not yet supported
When working with solely the struct and not an array of struct it does allow me to do just:
indexedShoeStorage = tempShoe;
Do you guys know a workaround? Thank you for help!