{
    "Function": "initPaymentChallenge",
    "File": "src/contracts/middleware/PaymentManager.sol",
    "Parent Contracts": [
        "src/contracts/permissions/Pausable.sol",
        "src/contracts/interfaces/IPausable.sol",
        "src/contracts/interfaces/IPaymentManager.sol",
        "lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/Initializable.sol"
    ],
    "High-Level Calls": [
        "SafeERC20"
    ],
    "Internal Calls": [
        "require(bool,string)"
    ],
    "Library Calls": [
        "safeTransferFrom"
    ],
    "Low-Level Calls": [],
    "Code": "function initPaymentChallenge(address operator, uint96 amount1, uint96 amount2) external {\n        require(\n            block.timestamp < operatorToPayment[operator].confirmAt\n                && operatorToPayment[operator].status == PaymentStatus.COMMITTED,\n            \"PaymentManager.initPaymentChallenge: Fraudproof interval has passed for payment\"\n        );\n\n        // store challenge details\n        operatorToPaymentChallenge[operator] = PaymentChallenge(\n            operator,\n            msg.sender,\n            address(serviceManager),\n            operatorToPayment[operator].fromTaskNumber,\n            operatorToPayment[operator].toTaskNumber,\n            amount1,\n            amount2,\n            // recording current timestamp plus the fraudproof interval as the `settleAt` timestamp for this challenge\n            uint32(block.timestamp + paymentFraudproofInterval),\n            // set the status for the operator to respond next\n            ChallengeStatus.OPERATOR_TURN\n        );\n\n        // move challengeAmount over\n        uint256 challengeAmount = operatorToPayment[operator].challengeAmount;\n        paymentChallengeToken.safeTransferFrom(msg.sender, address(this), challengeAmount);\n        // update the payment status and reset the fraudproof window for this payment\n        operatorToPayment[operator].status = PaymentStatus.CHALLENGED;\n        operatorToPayment[operator].confirmAt = uint32(block.timestamp + paymentFraudproofInterval);\n        emit PaymentChallengeInit(operator, msg.sender);\n    }"
}