// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console} from "forge-std/Script.sol";
import {RaidGeld} from "../src/RaidGeld.sol";
import {Upgrades} from "openzeppelin-foundry-upgrades/Upgrades.sol";

contract RaidGeldScript is Script {
    function setUp() public {}

    function run() public {
        vm.startBroadcast();

        // Deploy the upgradeable contract
        address _proxyAddress = Upgrades.deployTransparentProxy(
            "RaidGeld.sol",
            msg.sender,
            abi.encodeCall(RaidGeld.initialize, (msg.sender))
        );

        // Get the implementation address
        address implementationAddress = Upgrades.getImplementationAddress(
            _proxyAddress
        );

        vm.stopBroadcast();

        return (implementationAddress, _proxyAddress);
    }
}
