Skip to content

Commit

Permalink
feat: add WithdrawFee script for fee withdrawal from Launcher contract
Browse files Browse the repository at this point in the history
  • Loading branch information
cqlyj committed Jan 12, 2025
1 parent f818408 commit 3618217
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions script/WithdrawFee.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.27;

import {Script, console} from "forge-std/Script.sol";
import {Launcher} from "src/contracts/Launcher.sol";
import {Vm} from "forge-std/Vm.sol";

contract WithdrawFee is Script {
uint256 public constant AMOUNT = 0.01 ether;

function withdrawFee(address mostRecentlyDeployment) public {
Launcher launcher = Launcher(mostRecentlyDeployment);
vm.startBroadcast();
launcher.withdrawFee(AMOUNT);
vm.stopBroadcast();

console.log("Fee withdrawn!");
}

function run() public {
address deployAddress = Vm(address(vm)).getDeployment(
"Launcher",
uint64(block.chainid)
);

console.log("Most recent Launcher deployment address:");
console.logAddress(deployAddress);

withdrawFee(deployAddress);
}
}

0 comments on commit 3618217

Please sign in to comment.