This repository focuses on ERC-20 tokens, drawing parallels with Bitcoin and Litecoin in various aspects. Unlike Bitcoin and Litecoin, which operate on standalone blockchain networks, ERC-20 coins seamlessly run on Ethereum's blockchain network, utilizing gas as the primary transaction fee mechanism.
The repository leverages the Hardhat framework for Ethereum development and incorporates OpenZeppelin for robust smart contract standards and security.
-
Clone this repository and run the following command:
npm ci
-
Get your wallet (MetaMask, for example) and set it to Sepolia TestNet. You can obtain some SepoliaETH to pay for gas here.
-
Acquire your API key at https://www.alchemy.com/.
Navigate to "API Key" and copy the HTTPS Option.
-
Create a
.envfile like.env-examplein this repo and insert your API URL and your wallet private keys so you can sign transactions on the blockchain. DO NOT SHARE YOUR PRIVATE KEYS WITH ANYONE!This information will be used in the Hardhat settings to connect to the Sepolia testnet.
-
Set the token name and symbol in constructor arguments. Defining 'MINTER_ROLE' grants only your wallet access to mint new tokens in this contract.
-
Run this command to deploy your contract:
npx hardhat run scripts/deploy.js
You will get your contract address in the terminal. Copy it and go to https://sepolia.etherscan.io/ to search for your contract and view all the transactions.
-
With your contract address, go to
scripts/transferand paste your contract address and wallet address to which you want to send your new tokens. For example, my wallet is '0x5D296F39a503cD0e003A9fF470e49DCe635E8d9B'. Send me some of your tokens! -
After setting the information, run the command:
npx hardhat run scripts/transfer.js
Enjoy your first ERC-20 Token, and feel free to implement new interactions with scripts!
You can also send me tokens on Binance Smart Chain or Ethereum Mainnet here: '0x5D296F39a503cD0e003A9fF470e49DCe635E8d9B' 😄




