// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {Script, console} from "forge-std/Script.sol";
import {QuotePushFlashWorkflowBorrower} from "../../contracts/flash/QuotePushFlashWorkflowBorrower.sol";

/**
 * @title DeployQuotePushFlashWorkflowBorrower
 * @notice Deploy the ERC-3156 quote-push borrower against a trusted flash lender.
 *
 * Env:
 *   PRIVATE_KEY                    required
 *   QUOTE_PUSH_FLASH_LENDER        required
 *
 * Usage:
 *   forge script script/deploy/DeployQuotePushFlashWorkflowBorrower.s.sol:DeployQuotePushFlashWorkflowBorrower \
 *     --rpc-url <RPC> --broadcast -vvvv
 */
contract DeployQuotePushFlashWorkflowBorrower is Script {
    function run() external {
        uint256 pk = vm.envUint("PRIVATE_KEY");
        address lender = vm.envAddress("QUOTE_PUSH_FLASH_LENDER");
        address deployer = vm.addr(pk);

        console.log("Deployer:", deployer);
        console.log("Trusted lender:", lender);

        vm.startBroadcast(pk);
        QuotePushFlashWorkflowBorrower borrower = new QuotePushFlashWorkflowBorrower(lender);
        vm.stopBroadcast();

        console.log("QuotePushFlashWorkflowBorrower:", address(borrower));
    }
}
