Skip to content

dbindea/contract-hardhat-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardhat Contract

This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts.

Start local

Run npx hardhat node for local and compile with npx hardhat compile. Publish contract in localhost red npx hardhat run --network localhost scripts/sample-script.js and interact with console on npx hardhat console --network localhost.

npx hardhat node

npx hardhat compile

npx hardhat run --network localhost scripts/sample-script.js

npx hardhat console --network localhost

Start testnet

npx hardhat node

npx hardhat compile

npx hardhat run --network kovan scripts/sample-script.js

npx hardhat console --network kovan

Some commands...

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help

Console commands

const Contract01 = await ethers.getContractFactory("Contract01")
const contract01 = await Contract01.attach("0x5FbDB2315678....")
await contract01.text()
await contract01.setText("Another text...")
await contract01.text()

More info

https://dev.to/turupawn/hardhat-hola-mundo-en-un-blockchain-de-prueba-40c1

About

Hardhat: the first contract on a local blockchain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published