# How to use mainnet forking in Solidity tests with OpenZeppelin Test Environment

**URL:** <https://forum.openzeppelin.com/t/how-to-use-mainnet-forking-in-solidity-tests-with-openzeppelin-test-environment/4175>\
**Category:** Support\
**Created:** [October 18, 2020, 5:10pm UTC](https://forum.openzeppelin.com/t/how-to-use-mainnet-forking-in-solidity-tests-with-openzeppelin-test-environment/4175 "2020-10-18T17:10:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![viraj124](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/viraj124/32/2408_2.png) [@viraj124](https://forum.openzeppelin.com/u/viraj124)\
**Post date:** [October 18, 2020, 5:10pm UTC](https://forum.openzeppelin.com/t/how-to-use-mainnet-forking-in-solidity-tests-with-openzeppelin-test-environment/4175/1 "2020-10-18T17:10:50Z")

</div>

Hi Guys,

I am trying to integrate with external mainnet contracts and wanted to know is there a guide to do sol testing with ganache fork or i just need to deploy my contracts after forking and directly run the tests ?

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [October 19, 2020, 2:56am UTC](https://forum.openzeppelin.com/t/how-to-use-mainnet-forking-in-solidity-tests-with-openzeppelin-test-environment/4175/2 "2020-10-19T02:56:19Z")

</div>

Hi @viraj124,

To use OpenZeppelin Test Environment with a fork of mainnet you will need to specify a url to an Ethereum node to use as a source for a fork in your `test-environment.config.js`.

You can then run your tests. Please note testing will take time using the fork.

For details please see the documentation:

> **[Getting Started - OpenZeppelin Docs](https://docs.openzeppelin.com/test-environment/0.1/getting-started#fork_and_unlocked_accounts)**
