Use hardhat-laika
What is hardhat-laika ?
hardhat-laika
is Laika's own Hardhat plugin that helps you sync your compiled contracts with Laika. This enables you to make a request without having to write a single line of extra code.
In counterview, it also boosts your performance when developing with Hardhat! 💪
Let’s try it out!
First, we are going to start a new Hardhat project using
Then, pick a configuration you like (We'll be usingthis configuration and Greeter.sol as an example contract in this guiding example)
After the project setup is completed, let’s install hardhat-laika by using
Now, import it to your hardhat.config.js By adding a require(…) statement at the top
Alright, now we’re all set! Let’s try to use it!
There are two ways to use hardhat-laika, viz.
through the command line
through your own scripts (by defining a hardhat-laika task)
Let’s try the first way.
The Hardhat Runner CLI
First, Let’s compile our contract so we can get the ABIs.
Then, use the laika-sync task to sync it to Laika
For this example, we'll use the command with the following parameters:
You should be able to see something like this.
2. Creating a Script
Let’s take a look at scripts/sample-script.js
We just have to simply add hre.run() to line 25 and we’re set! We can run it using the command.
You should be able to see something like this.
Both methods enable you to directly integrate Laika with your Hardhat environment as shown.
Last updated