Closed mudgen closed 2 years ago
The getCraftQueue() function will revert when called because no QueueItem[] value with length is assigned to the output_ variable. https://github.com/aavegotchi/aavegotchi-realm-diamond/blob/cee38d37307c49dc41cdb737a962d5d313c1cd4f/contracts/InstallationDiamond/facets/InstallationFacet.sol#L455-L463
getCraftQueue()
QueueItem[]
output_
This would work:
function getCraftQueue(address _owner) external view returns (QueueItem[] memory output_) { uint256 length = s.craftQueue.length; output_ = new QueueItem[](length); uint256 counter; for (uint256 i; i < length; i++) { if (s.craftQueue[i].owner == _owner) { output_[counter] = s.craftQueue[i]; counter++; } } assembly { mstore(output_, counter) } }
Good
The
getCraftQueue()
function will revert when called because noQueueItem[]
value with length is assigned to theoutput_
variable. https://github.com/aavegotchi/aavegotchi-realm-diamond/blob/cee38d37307c49dc41cdb737a962d5d313c1cd4f/contracts/InstallationDiamond/facets/InstallationFacet.sol#L455-L463This would work: