We're going to create a simple smart contract that implements a token that can be transferred.
-
Write a contract
put the contract under
contracts
(e.g.Token.sol
) -
Compile the contract.
npx hardhat compile
-
Test the contract
- put the test file under
test
(e.g.Token.js
) - run
npx hardhat test
- put the test file under
-
Deploy the contract on localhost
- put the deploy script under
scripts
(e.g.deploy.js
) - start the localhost:
npx hardhat node
- deploy:
npx hardhat run scripts/deploy.js --network localhost
- put the deploy script under