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

import {Script, console2} from "forge-std/Script.sol";
import {PolicyProfileRegistry} from "../../../contracts/universal-resource/PolicyProfileRegistry.sol";

/// @notice Publish commercial_emoney_m1_v1 profile anchor on live PolicyProfileRegistry.
contract PublishCommercialEmoneyM1Profile is Script {
    function run() external {
        PolicyProfileRegistry reg = PolicyProfileRegistry(vm.envAddress("POLICY_PROFILE_REGISTRY_ADDRESS"));
        bytes32 contentHash = vm.envBytes32("COMMERCIAL_EMONEY_M1_CONTENT_HASH");

        vm.startBroadcast(vm.envUint("PRIVATE_KEY"));
        reg.publishProfile("commercial_emoney_m1_v1", contentHash, 1, block.timestamp);
        vm.stopBroadcast();

        bytes32 key = reg.profileKey("commercial_emoney_m1_v1");
        console2.log("Published commercial_emoney_m1_v1");
        console2.logBytes32(key);
    }
}
