Skip to content

Commit 2526765

Browse files
authored
Merge pull request #53 from crytic/update-cheatcode
Update hevm cheatcodes
2 parents 13a8724 + 8e48eb6 commit 2526765

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

contracts/util/Hevm.sol

+19
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ interface IHevm {
88
// Set block.number to newNumber
99
function roll(uint256 newNumber) external;
1010

11+
// Add the condition b to the assumption base for the current branch
12+
// This function is almost identical to require
13+
function assume(bool b) external;
14+
15+
// Sets the eth balance of usr to amt
16+
function deal(uint256 usr, uint256 amt) external;
17+
1118
// Loads a storage slot from an address
1219
function load(address where, bytes32 slot) external returns (bytes32);
1320

@@ -30,6 +37,18 @@ interface IHevm {
3037

3138
// Performs the next smart contract call with specified `msg.sender`
3239
function prank(address newSender) external;
40+
41+
// Creates a new fork with the given endpoint and the latest block and returns the identifier of the fork
42+
function createFork(string calldata urlOrAlias) external returns (uint256);
43+
44+
// Takes a fork identifier created by createFork and sets the corresponding forked state as active
45+
function selectFork(uint256 forkId) external;
46+
47+
// Returns the identifier of the current fork
48+
function activeFork() external returns (uint256);
49+
50+
// Labels the address in traces
51+
function label(address addr, string calldata label) external;
3352
}
3453

3554
IHevm constant hevm = IHevm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);

0 commit comments

Comments
 (0)