{
    "Function": "_getTokenValue",
    "File": "contracts/test/LibraryWrapper.sol",
    "Parent Contracts": [
        "contracts/helpers/StrategyTypes.sol"
    ],
    "High-Level Calls": [
        "IOracle",
        "IOracle",
        "IOracle",
        "IStrategy",
        "IERC20",
        "IOracle",
        "IOracle",
        "IOracle",
        "IStrategy",
        "IERC20",
        "SignedSafeMath",
        "IERC20",
        "IERC20",
        "SignedSafeMath"
    ],
    "Internal Calls": [
        "balance(address)"
    ],
    "Library Calls": [
        "add",
        "add"
    ],
    "Low-Level Calls": [],
    "Code": "function _getTokenValue(IStrategy s, address token) internal view returns (int256) {\n        if (token == address(0)) {\n            return int256(address(s).balance);\n        } else if (token == address(-1)) {\n            address[] memory synths = s.synths();\n            int256 estimate = 0;\n            for (uint256 i = 0; i < synths.length; i++) {\n              estimate = estimate.add(oracle.estimateItem(\n                IERC20(synths[i]).balanceOf(address(s)),\n                synths[i]\n              ));\n            }\n            estimate = estimate.add(oracle.estimateItem(\n              IERC20(oracle.susd()).balanceOf(address(s)),\n              oracle.susd()\n            ));\n            return estimate;\n        } else if (token == oracle.weth()) {\n            return int256(IERC20(token).balanceOf(address(s)));\n        } else {\n            return s.oracle().estimateItem(\n                IERC20(token).balanceOf(address(s)),\n                token\n            );\n        }\n    }"
}