Hardhat
Getting setup with Hardhat
Setting up your environment
Create a new directory and navigate to it, and create a new project with npm init
.
$ mkdir create-pharo-hardhat
$ cd create-pharo-hardhat
$ npm init -y
For this example, we'll use HardHat to compile our contracts.
$ npm i --save-dev hardhat
Now we can install the v1 Core contracts, so that we can inherit what we need to create a new Pharo.
$ npm i @pharo/contracts
Now we can create a new Hardhat config file in our environment, which can help us configure the compilation and testing processes for our contracts.
$ npx hardhat
Setting up Hardhat solidity version
For this example, we'll need to change ./hardhat.config.js to include the appropriate solidity version for compilling the Pharo core v1 contracts.
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.19",
};
Compiling Your Contract
We can compile our contracts with npx hardhat compile
Last updated
Was this helpful?