How to Recreate
A tutorial on how to recreate the OpenZeppelin tests locally using a Thor Solo node.
Run a Thor Solo Node
Use the tutorial How to run a Thor Solo Node to start up a thor solo node.
Configure a Development Environment
Clone openzeppelin-contracts
git clone [email protected]:OpenZeppelin/openzeppelin-contracts.git
cd openzeppelin-contractsInstall the required VeChain libraries
npm install @vechain/[email protected] --save-exact
npm install @vechain/[email protected] --save-exact
npm install @vechain/[email protected] --save-exactModify your hardhat.config.js
Add the following to your hardhat config
require("@vechain/hardhat-vechain");
require("@vechain/hardhat-web3");Add the VeChain network settings
Run the OpenZeppelin Tests
Assuming you have cloned OpenZeppelin and are running thor locally in solo mode we can now move on to running the OpenZeppelin tests. First navigate to the appropriate directory.
Run a single test
Run all tests
Running VeChain custom fork
This section explains how to run the custom tests adapted to run on VeChainThor blockchain. This fork is based on OpenZeppelin version 5.
Clone openzeppelin-contracts
Run thor solo
When running the custom fork you need to increase the gas limit.
Run the OpenZeppelin Tests
Assuming you have cloned OpenZeppelin and are running thor locally in solo mode we can now move on to running the OpenZeppelin tests. First navigate to the appropriate directory.
Run a single test
Run all tests
⚠️ Disclaimer: Running the complete OpenZeppelin test suite can take several hours due to Thor Solo's processing limitations. Consider running tests in smaller batches.
Run all tests in a specific directory (OZ5)
Results
All the tests in the custom fork are expected to pass.
Last updated
Was this helpful?