Given the following structure, how do I create a function to loop through the addressInfo and return the address, ownerName and balance.
struct AddressInfo {
string ownerName;
uint256 balance;
bool allowed;
}
mapping(address => AddressInfo) public addressInfo;
I imagined that I could go through the mapping as an array, but the mapping doesn't even have a length to define within the for.