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

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

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

