{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/adapters/strategy/MetaStrategyAdapter.sol",
    "Parent Contracts": [
        "contracts/adapters/BaseAdapter.sol",
        "contracts/interfaces/IBaseAdapter.sol"
    ],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "contract MetaStrategyAdapter is BaseAdapter {\n    using SafeERC20 for IERC20;\n\n    uint256 public constant DEFAULT_SLIPPAGE = 980; //98%\n    IStrategyController public immutable controller;\n    IStrategyRouter public immutable router;\n\n\n    constructor(\n        address controller_,\n        address router_,\n        address weth_\n    ) public BaseAdapter(weth_) {\n        controller = IStrategyController(controller_);\n        router = IStrategyRouter(router_);\n    }\n\n    function swap(\n        uint256 amount,\n        uint256 expected,\n        address tokenIn,\n        address tokenOut,\n        address from,\n        address to\n    ) public override {\n        require(tokenIn != tokenOut, \"Tokens cannot match\");\n        require(tokenIn == weth || tokenOut == weth, \"No WETH\");\n\n        if (from != address(this))\n            IERC20(tokenIn).safeTransferFrom(from, address(this), amount);\n\n        if (tokenIn == weth) {\n            if(address(router) != address(this))\n                IERC20(tokenIn).safeApprove(address(router), amount);\n            //Assumes the use of LoopRouter when depositing tokens\n            controller.deposit(IStrategy(tokenOut), router, amount, DEFAULT_SLIPPAGE, \"0x\");\n            if(address(router) != address(this))\n                IERC20(tokenIn).safeApprove(address(router), 0);\n        }\n\n        if (tokenOut == weth)\n            controller.withdrawWETH(IStrategy(tokenIn), router, amount, DEFAULT_SLIPPAGE, \"0x\");\n\n        uint256 received = IERC20(tokenOut).balanceOf(address(this));\n        require(received >= expected, \"Insufficient tokenOut amount\");\n\n        if (to != address(this))\n          IERC20(tokenOut).safeTransfer(to, received);\n    }\n}"
}