{
    "Function": "checkERC20BeforePull",
    "File": "src/libraries/DelegateTokenTransferHelpers.sol",
    "Parent Contracts": [],
    "High-Level Calls": [
        "IERC20"
    ],
    "Internal Calls": [
        "revert WrongAmountForType(IDelegateRegistry.DelegationType,uint256)",
        "revert WrongTokenIdForType(IDelegateRegistry.DelegationType,uint256)",
        "revert InsufficientAllowanceOrInvalidToken()"
    ],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "function checkERC20BeforePull(uint256 underlyingAmount, address underlyingContract, uint256 underlyingTokenId) internal view {\n        if (underlyingTokenId != 0) {\n            revert Errors.WrongTokenIdForType(IDelegateRegistry.DelegationType.ERC20, underlyingTokenId);\n        }\n        if (underlyingAmount == 0) {\n            revert Errors.WrongAmountForType(IDelegateRegistry.DelegationType.ERC20, underlyingAmount);\n        }\n        if (IERC20(underlyingContract).allowance(msg.sender, address(this)) < underlyingAmount) {\n            revert Errors.InsufficientAllowanceOrInvalidToken();\n        }\n    }"
}