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

import {Script, console} from "forge-std/Script.sol";
import {CCIPWETH10Bridge} from "../contracts/ccip/CCIPWETH10Bridge.sol";
import {WETH10} from "../contracts/tokens/WETH10.sol";

contract DeployCCIPWETH10Bridge is Script {
    function run() external {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPrivateKey);
        
        // Get configuration from environment
        address ccipRouter = vm.envAddress("CCIP_ROUTER");
        // Use canonical Mainnet WETH10 address (predeployed in genesis)
        address weth10 = 0xf4BB2e28688e89fCcE3c0580D37d36A7672E8A9F;
        address feeToken = vm.envAddress("CCIP_FEE_TOKEN"); // LINK token
        
        console.log("Deploying CCIPWETH10Bridge with:");
        console.log("  Deployer:", deployer);
        console.log("  CCIP Router:", ccipRouter);
        console.log("  WETH10:", weth10);
        console.log("  Fee Token:", feeToken);
        
        vm.startBroadcast(deployerPrivateKey);
        
        CCIPWETH10Bridge bridge = new CCIPWETH10Bridge(
            ccipRouter,
            weth10,
            feeToken
        );
        
        console.log("CCIPWETH10Bridge deployed at:", address(bridge));
        console.log("  CCIP Router:", address(bridge.ccipRouter()));
        console.log("  WETH10:", bridge.weth10());
        console.log("  Fee Token:", bridge.feeToken());
        console.log("  Admin:", bridge.admin());
        
        vm.stopBroadcast();
    }
}

