{
    "Function": "expected",
    "File": "contracts/v3/converters/GeneralConverter.sol",
    "Parent Contracts": [
        "contracts/v3/interfaces/IConverter.sol"
    ],
    "High-Level Calls": [
        "ICurvePool",
        "ICurve2Pool",
        "ICurve3Pool",
        "ICurvePool"
    ],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function expected(\n        address _input,\n        address _output,\n        uint256 _inputAmount\n    ) external view override returns (uint256) {\n        if (_output == address(tokenCRV)) {\n            // convert to CRV\n            for (uint8 i = 0; i < tokens.length; i++) {\n                if (_input == address(tokens[i])) {\n                    if (tokens.length == 2) {\n                        uint256[2] memory amounts;\n                        amounts[i] = _inputAmount;\n                        return ICurve2Pool(address(swapPool)).calc_token_amount(amounts, true);\n                    } else {\n                        uint256[3] memory amounts;\n                        amounts[i] = _inputAmount;\n                        return ICurve3Pool(address(swapPool)).calc_token_amount(amounts, true);\n                    }\n                }\n            }\n        } else if (_input == address(tokenCRV)) {\n            // convert from CRV\n            for (uint8 i = 0; i < tokens.length; i++) {\n                if (_output == address(tokens[i])) {\n                    // @dev this is for UI reference only, the actual share price\n                    // (stable/CRV) will be re-calculated on-chain when we do convert()\n                    return swapPool.calc_withdraw_one_coin(_inputAmount, i);\n                }\n            }\n        } else {\n            return swapPool.get_dy(indices[_input], indices[_output], _inputAmount);\n        }\n        return 0;\n    }"
}