Closed thegostep closed 3 years ago
Really just for convenience of migrating from truffle to hardhat - but I think https://github.com/OpenZeppelin/openzeppelin-upgrades/issues/206 is really what I want
For migrating from Truffle to Hardhat you can take a look at what I did in the recent migration of OpenZeppelin Contracts (although it was from Truffle to Buidler).
For the Upgrades Plugin, it's already been migrated and we just need to update the docs before releasing.
@frangio I am trying to use hardhat
for compiling contracts and openzeppelin-test-environment
for testing. But the contract.fromArtifact
doesn't work as the artifacts are not in build/contracts
but artifacts
. Do you think it make sense for contract-loader
to be able to find the artifacts compiled by hardhat
?
Hi @pinglamb, you can configure the artifacts directory using the configuration file. But note that this is not enough because Hardhat stores artifacts in subdirectories organized by source file. We don't intend to add Hardhat compatibility to this package. I would recommend using Hardhat's built in test functionality.
Hi @thegostep, I've considered this before and I don't think it's a good idea. Test Environment spins up its own Ganache instance, whereas Hardhat provides its own Hardhat Network, which incidentally provides a lot of extra features that Test Environment with Ganache will never support.
The interface for using Hardhat Network is also very similar, it's possible to use any test runner by including
require('hardhat')
in your test files, which (as long as there's a Hardhat config) will spin up a Hardhat Network instance and provider.Would love to hear why you would like to see Hardhat compatibility on this project.