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):
mkdir L1XEVMERC20 cd L1XEVMERC20Initialize a new NPM project:
npm init -y
Step 2: Install Hardhat and Set Up the Project
Install Hardhat:
npm install --save-dev hardhatSet up the Hardhat project: Run the setup command and choose to create a TypeScript project:
npx hardhatWhen prompted, select to create a TypeScript project. Follow the prompts to add a
.gitignoreand install the project's dependencies.
Step 3: Install Necessary Plugins and Dependencies
Install TypeScript-related dependencies:
npm install --save-dev ts-node typescript @types/node @types/mochaInstall OpenZeppelin Contracts:
npm install @openzeppelin/contractsInstall Ethers and Hardhat Ethers (ensure compatibility):
npm install --save-dev ethers @nomicfoundation/hardhat-ethers
Step 4: Configure TypeScript
Create a
tsconfig.jsonfile in your project root with the following content:
Step 5: Write Your Smart Contract
Create an ERC20 token using OpenZeppelin: Create a
contracts/Token.solfile:
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