Skip to content

Instantly share code, notes, and snippets.

@alcuadrado
Created July 7, 2022 16:30
Show Gist options
  • Save alcuadrado/41f0b3c0a1665dc75fc975cfe1658b58 to your computer and use it in GitHub Desktop.
Save alcuadrado/41f0b3c0a1665dc75fc975cfe1658b58 to your computer and use it in GitHub Desktop.
// mine 100 blocks
await network.provider.send("hardhat_mine", ["0x64"]);
// mine a new block one hour in the future
await network.provider.send(
"evm_increaseTime",
"0xe10"
);
await network.provider.send("hardhat_mine");
// take and revert a snapshot
const snapshotId = await network.provider.send("evm_snapshot");
await network.provider.send("evm_revert", [snapshotId]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment