{
    "Function": "setMaxAllowance",
    "File": "contracts/libraries/ExchangeHelpers.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "SafeERC20",
        "SafeERC20",
        "IERC20"
    ],
    "Internal Calls": [],
    "Library Calls": [
        "safeDecreaseAllowance",
        "safeIncreaseAllowance"
    ],
    "Low-Level Calls": [],
    "Code": "function setMaxAllowance(IERC20 _token, address _spender) internal {\n        uint256 _currentAllowance = _token.allowance(address(this), _spender);\n        if (_currentAllowance != type(uint256).max) {\n            // Decrease to 0 first for tokens mitigating the race condition\n            _token.safeDecreaseAllowance(_spender, _currentAllowance);\n            _token.safeIncreaseAllowance(_spender, type(uint256).max);\n        }\n    }"
}