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

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

contract DeployCCIPRelayRouterOnly is Script {
    function run() external {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPrivateKey);
        address relayer = vm.envAddress("RELAYER_ADDRESS");

        console.log("Deploying CCIPRelayRouter with deployer:", deployer);
        console.log("Relayer:", relayer);

        vm.startBroadcast(deployerPrivateKey);

        CCIPRelayRouter relayRouter = new CCIPRelayRouter();
        if (relayer != address(0)) {
            relayRouter.grantRelayerRole(relayer);
        }

        vm.stopBroadcast();

        console.log("CCIPRelayRouter deployed at:", address(relayRouter));
    }
}
