Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 656 Bytes

prank.md

File metadata and controls

33 lines (21 loc) · 656 Bytes

prank

Signature

function prank(address) external;
function prank(address sender, address origin) external;

Description

Sets msg.sender to the specified address for the next call. "The next call" includes static calls as well, but not calls to the cheat code address.

If the alternative signature of prank is used, then tx.origin is set as well for the next call.

Examples

/// function withdraw() public {
///     require(msg.sender == owner);

vm.prank(owner);
myContract.withdraw(); // [PASS]

SEE ALSO

Forge Standard Library

hoax