arbitrary address could not ghost tokens

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2025-07-22 16:47:19 +03:00
parent 2a012ef8e2
commit 00a7dea8fb
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB

View File

@ -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));