If you are from the eth-global/encode hackathon https://github.com/flare-foundation/flare-hardhat-starter/tree/encode-hackathon is the branch you look for
IMPORTANT!!
The supporting library uses Openzeppelin version 4.9.3
, be careful to use the documentation and examples from that library version.
If you are new to Hardhat please check the Hardhat getting started doc
-
Clone and install dependencies:
git clone https://github.com/flare-foundation/flare-hardhat-starter.git cd flare-hardhat-starter
and then run:
yarn
or
npm install
-
Set up
.env
filemv .env.example .env
-
Change the
PRIVATE_KEY
in the.env
file to yours -
Compile the project
yarn hardhat compile
or
npx hardhat compile
This will compile all
.sol
files in your/contracts
folder. It will also generate artifacts that will be needed for testing. ContractsImports.sol
import MockContracts and Flare related mocks, thus enabling mocking of the contracts from typescript. -
Run Tests
yarn hardhat test
or
npx hardhat test
-
Deploy
Check the
hardhat.config.ts
file, where you define which networks you want to interact with. Flare mainnet & test network details are already added in that file.Make sure that you have added API Keys in the
.env
filenpx hardhat run scripts/tryDeployment.ts