Hello,
I have a proxy that delegates calls to an implementation contract. The implementation contract contains the following function:
// Retrieve the array that contains the entire number of Items set for the contract
function getUpdatedItems()
public
returns (uint256[] memory, ItemsLibrary.Item[] memory)
{
idCounter.reset();
for (uint256 i = 0; i < itemsCount; i++) {
if (idToItem[i].itemState != ItemsLibrary.ItemState.deleted) {
idCounter.increment();
}
}
uint256 indexesNumber = idCounter.current();
uint256[] memory _itemsIndexesArray = new uint256[](indexesNumber);
ItemLibrary.Items[] memory _items = new ItemsLibrary.Item[](
indexesNumber
);
uint8 k;
for (uint8 j = 0; j < itemCount; j++) {
if (idToItem[j].itemState != ItemLibrary.ItemState.deleted) {
_items[k].var1 = idToItem[j].var1;
_items[k].var2 = idToItem[j].var2;
_itemIndexesArray[k] = j;
k++;
}
}
return (_itemIndexesArray, _items);
}
Im calling the function through the proxy but it returns nothing so my assumption is that the delegatecall is not able to retrieve the memory values as they are wiped off, is that the case?, so how would I retrieved the memory values return by the implementation contract function?
Environment
Remix