Skip to content

Commit e68214f

Browse files
authored
feat: add new fork cheatcodes (#180)
1 parent 340fe86 commit e68214f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Vm.sol

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,12 @@ interface Vm {
172172
function createFork(string calldata,uint256) external returns(uint256);
173173
// Creates a new fork with the given endpoint and the _latest_ block and returns the identifier of the fork
174174
function createFork(string calldata) external returns(uint256);
175+
// Creates a new fork with the given endpoint and at the block the given transaction was mined in, and replays all transaction mined in the block before the transaction
176+
function createFork(string calldata, bytes32) external returns (uint256);
175177
// Creates _and_ also selects a new fork with the given endpoint and block and returns the identifier of the fork
176178
function createSelectFork(string calldata,uint256) external returns(uint256);
179+
// Creates _and_ also selects new fork with the given endpoint and at the block the given transaction was mined in, and replays all transaction mined in the block before the transaction
180+
function createSelectFork(string calldata, bytes32) external returns (uint256);
177181
// Creates _and_ also selects a new fork with the given endpoint and the latest block and returns the identifier of the fork
178182
function createSelectFork(string calldata) external returns(uint256);
179183
// Takes a fork identifier created by `createFork` and sets the corresponding forked state as active.
@@ -184,8 +188,13 @@ interface Vm {
184188
// Updates the currently active fork to given block number
185189
// This is similar to `roll` but for the currently active fork
186190
function rollFork(uint256) external;
191+
// Updates the currently active fork to given transaction
192+
// this will `rollFork` with the number of the block the transaction was mined it and replays all transaction mined before it in the block
193+
function rollFork(bytes32) external;
187194
// Updates the given fork to given block number
188195
function rollFork(uint256 forkId, uint256 blockNumber) external;
196+
// Updates the given fork to block number of the given transaction and replays all transaction mined before it in the block
197+
function rollFork(uint256 forkId, bytes32 transaction) external;
189198

190199
// Marks that the account(s) should use persistent storage across fork swaps in a multifork setup
191200
// Meaning, changes made to the state of this account will be kept when switching forks

0 commit comments

Comments
 (0)