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

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

/**
 * @title DeployOfficialUSDT138
 * @notice Deploy the local Chain 138 quote-side USDT mirror used by DODO PMM pools.
 */
contract DeployOfficialUSDT138 is Script {
    function run() external {
        uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(deployerPrivateKey);
        address owner = vm.envOr("OFFICIAL_USDT_138_OWNER", deployer);
        uint256 initialSupply = vm.envOr("OFFICIAL_USDT_138_INITIAL_SUPPLY", uint256(0));

        console.log("Deploying Official USDT (Chain 138) with deployer:", vm.toString(deployer));
        console.log("Owner:", vm.toString(owner));
        console.log("Initial supply:", initialSupply);

        vm.startBroadcast(deployerPrivateKey);

        OfficialStableMirrorToken token = new OfficialStableMirrorToken(
            "Tether USD (Chain 138)",
            "USDT",
            6,
            owner,
            initialSupply
        );

        console.log("Official USDT (Chain 138) deployed at:", vm.toString(address(token)));

        vm.stopBroadcast();
    }
}
