Skip to content

Latest commit

 

History

History

erc20-hardhat

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

ERC20 Hardhat Demo

This project contains a fungible token implementation that inherits from OpenZeppelin's ERC20 implementation.

It uses the hardhat development framework to:

  • Compile
  • Test
  • Deploy
  • Verify

the smart contract.

Compilation and testing occur on localhost; whereas deployment and verification occur on Hedera Testnet (a public network).

This project has been designed as a minimal example demonstration; and a starting point for projects.

Set up

node -v
# v20.6.1
  • Note that you will need NodeJs v20 or higher.
cp .env.example .env
npm install

Compile

npm run compile

Test

npm run test

Deploy

npm run deploy

Then visit Hashscan (a Hedera network explorer) at the URL that is output, for example: https://hashscan.io/testnet/contract/0x6eae9247C122b3e3CDC621F61F757B809bF7455a.

Under the Contract Bytecode section, you should see the EVM bytecode for this smart contract.

Deployment error

If you see an error that looks similar to this:

ProviderError: [Request ID: 97d65a37-c521-4bed-b8b5-1d6c4b3769a2] Requested resource not found. address '0x38585566fb010606240194578cb3e4Ee44637D93'.

It likely means that the account that you are deploying from has not been created or funded with Testnet HBAR yet. To resolve this, visit portal.hedera.com/faucet and fund the address cited in the error message.

Verify

npm run verify

Then visit Hashscan (a Hedera network explorer) at the URL that is output, for example: https://hashscan.io/testnet/contract/0x6eae9247C122b3e3CDC621F61F757B809bF7455a.

Under the Contract Bytecode section, you should still see the EVM bytecode for this smart contract; and you show also see the Solidity source code as well.