{
    "Function": "estimateTotal",
    "File": "contracts/oracles/protocols/ProtocolOracle.sol",
    "Parent Contracts": [
        "contracts/interfaces/IProtocolOracle.sol"
    ],
    "High-Level Calls": [
        "SafeMath",
        "IERC20"
    ],
    "Internal Calls": [
        "balance(address)",
        "consult"
    ],
    "Library Calls": [
        "add"
    ],
    "Low-Level Calls": [],
    "Code": "function estimateTotal(address account, address[] memory tokens)\n        public\n        view\n        override\n        returns (uint256, uint256[] memory)\n    {\n        //Loop through tokens and calculate the total\n        uint256 total = 0;\n        uint256[] memory estimates = new uint256[](tokens.length);\n        for (uint256 i = 0; i < tokens.length; i++) {\n            uint256 estimate;\n            if (tokens[i] == address(0)) {\n                estimate = account.balance;\n            } else {\n                estimate = consult(IERC20(tokens[i]).balanceOf(account), tokens[i]);\n            }\n            total = total.add(estimate);\n            estimates[i] = estimate;\n        }\n        return (total, estimates);\n    }"
}