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

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

/**
 * @title DeployTokenRegistry
 * @notice Deploy TokenRegistry contract
 */
contract DeployTokenRegistry is Script {
    function run() external {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPrivateKey);
        
        // Load environment variables
        address admin = vm.envOr("TOKEN_REGISTRY_OWNER", deployer);
        
        console.log("Deploying TokenRegistry with deployer:", vm.toString(deployer));
        console.log("Admin:", vm.toString(admin));
        
        vm.startBroadcast(deployerPrivateKey);
        
        TokenRegistry registry = new TokenRegistry(admin);
        console.log("TokenRegistry deployed at:", vm.toString(address(registry)));
        
        vm.stopBroadcast();
        
        console.log("\n=== Deployment Summary ===");
        console.log("TokenRegistry:", vm.toString(address(registry)));
        console.log("Admin:", vm.toString(admin));
    }
}

