How to Advance Time on Fork
Forks will be deprecated on March 31, 2025.
Please migrate to Tenderly Virtual TestNets or contact our support for assistance with automatic migration.
New projects on Tenderly should use Virtual TestNets.
New projects on Tenderly should use Virtual TestNets.
Let’s say you have spawned a Tenderly Fork and now you have a hypothesis around X which may be time-dependent. To validate it, you can increase the current time of the network you forked.
For example, you can see if a DAO proposal is going to be impacted by expiration or if there’s a time lock implemented in the smart contract itself.
Let’s see how we can achieve this:
example.tsx
...
const params = [
ethers.utils.hexValue(24 * 60 * 60) // hex encoded number of seconds
];
await provider.send('evm_increaseTime', params)