chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
25
script/DeployPaymentChannelManager.s.sol
Normal file
25
script/DeployPaymentChannelManager.s.sol
Normal file
@@ -0,0 +1,25 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {PaymentChannelManager} from "../contracts/channels/PaymentChannelManager.sol";
|
||||
|
||||
/**
|
||||
* @notice Deploy PaymentChannelManager to the chain specified by RPC (Mainnet or Chain-138).
|
||||
* Set CHANNEL_ADMIN (or uses deployer), CHALLENGE_WINDOW_SECONDS (default 86400 = 24h).
|
||||
*/
|
||||
contract DeployPaymentChannelManager is Script {
|
||||
function run() external {
|
||||
uint256 pk = vm.envUint("PRIVATE_KEY");
|
||||
address deployer = vm.addr(pk);
|
||||
address admin = vm.envOr("CHANNEL_ADMIN", deployer);
|
||||
uint256 challengeWindow = vm.envOr("CHALLENGE_WINDOW_SECONDS", uint256(86400)); // 24h default
|
||||
|
||||
vm.startBroadcast(pk);
|
||||
PaymentChannelManager manager = new PaymentChannelManager(admin, challengeWindow);
|
||||
console.log("PaymentChannelManager deployed at:", address(manager));
|
||||
console.log("Admin:", admin);
|
||||
console.log("Challenge window (seconds):", challengeWindow);
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user