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

import "forge-std/Script.sol";
import "../../../contracts/bridge/EtherlinkRelayReceiver.sol";

/**
 * Deploy EtherlinkRelayReceiver on Etherlink (chain 42793).
 * Env: PRIVATE_KEY, ETHERLINK_RPC_URL (optional; --rpc-url overrides).
 * Run: forge script script/deploy/bridge/DeployEtherlinkRelayReceiver.s.sol --rpc-url $ETHERLINK_RPC_URL --broadcast
 */
contract DeployEtherlinkRelayReceiverScript is Script {
    function run() external {
        uint256 pk = vm.envUint("PRIVATE_KEY");
        address deployer = vm.addr(pk);
        vm.startBroadcast(pk);
        EtherlinkRelayReceiver receiver = new EtherlinkRelayReceiver(deployer);
        vm.stopBroadcast();
        console.log("EtherlinkRelayReceiver deployed at:", address(receiver));
    }
}
