From 00a7dea8fbaf17fa9a5cde07ca9df4bcd13528f7 Mon Sep 17 00:00:00 2001 From: Uncle Fatso Date: Tue, 22 Jul 2025 16:47:19 +0300 Subject: [PATCH] arbitrary address could not ghost tokens Signed-off-by: Uncle Fatso --- test/gatekeeper/Gatekeeper.t.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/gatekeeper/Gatekeeper.t.sol b/test/gatekeeper/Gatekeeper.t.sol index 0e392cf..57f3b87 100644 --- a/test/gatekeeper/Gatekeeper.t.sol +++ b/test/gatekeeper/Gatekeeper.t.sol @@ -35,6 +35,16 @@ contract GatekeeperTest is Test { assertEq(gatekeeper.ghostedSupply(), ghostedSupply + ghostAmount); } + function test_couldNotGhostTokensFromArbitraryAddress(address someone) public { + vm.assume(someone != alice); + bytes32 receiver = bytes32(abi.encodePacked(alice)); + + vm.expectRevert(); + vm.prank(someone); + gatekeeper.ghost(receiver, 69); + assertEq(gatekeeper.ghostedSupply(), 0); + } + function test_ghostTokensEmitsEvent(uint256 ghostAmount) public { vm.assume(ghostAmount > 0); bytes32 receiver = bytes32(abi.encodePacked(alice));