Hardhat Installation & Deploy your First L1X EVM FT Contract
You can use Hardhat and Ethers to Compile, Deploy and Interact with Contracts on L1X EVM.
Step 1: Initialize a New Project
Create a New Directory (if you're starting fresh):
Initialize a new NPM project:
Step 2: Install Hardhat and Set Up the Project
Install Hardhat:
Set up the Hardhat project: Run the setup command and choose to create a TypeScript project:
When prompted, select to create a TypeScript project. Follow the prompts to add a
.gitignore
and install the project's dependencies.
Step 3: Install Necessary Plugins and Dependencies
Install TypeScript-related dependencies:
Install OpenZeppelin Contracts:
Install Ethers and Hardhat Ethers (ensure compatibility):
Step 4: Configure TypeScript
Create a
tsconfig.json
file in your project root with the following content:
Step 5: Write Your Smart Contract
Create an ERC20 token using OpenZeppelin: Create a
contracts/Token.sol
file:
Step 7: Compile Your Contracts
Compile your project:
Write deployment scripts or tests as needed, using the setup you've created. Example Provided below.
Sample Hardhat Config TS File
-- Check Endpoint for L1X TestNet Faucet Before Deployment
Deployment Bash
Last updated