🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)
🔧 AI Nachrichten Major AI platforms go down in unprecedented simultaneous outage(03.09.2026 um 17:34 Uhr)
🔧 AI Nachrichten ChatGPT, Claude, and Grok Down? Users Report Widespread Outages(03.09.2026 um 19:14 Uhr)
🔧 AI Nachrichten OpenAI Launches GPT-6 Astra, Says We May Have Entered the AGI Era(03.09.2026 um 22:08 Uhr)
🔧 AI Nachrichten Claude Comes to CarPlay as Fifth Major AI Chatbot App(05.09.2026 um 05:31 Uhr)
🔧 AI Nachrichten OpenAI’s GPT-6 Astra Is AGI, Says NVIDIA CEO Jensen Huang(07.09.2026 um 06:31 Uhr)
🔧 AI Nachrichten Blame AI companies for Mac mini and Mac Studio shortage(31.08.2026 um 10:32 Uhr)

🔧 Programmierung 🕛 kürzlich 7 Min Lesezeit
0

Simple Start to Smart Contract Development with Hardhat

↗ Quelle (dev.to)
🗣️ Stimme:
📑 Inhaltsübersicht

Welcome to my post about Smart Contract development! This post is mostly just my notes on how to get a super simple smart contract (self executing program on a blockchain) written, deployed and called. For me it is easier to learn something new by doing. When dealing with blockchains and smart contracts however, that "doing" becomes expensive when you are trying to do something many times for educational purposes. Since every write to a blockchain costs something (on Ethereum Virtual Machine, or EVM, based networks, this cost is referred to as a Gas Fee). To avoid the cost of writing to a real blockchain, we'll use a tool called .



In this post we'll create simple contract with the server-side Javascript runtime already installed. Note that my notes below are based on my experience on a Linux server, but it shouldn't be too difficult to adapt to some other OS.




  1. Create a directory and node project

    mkdir counter-test

    cd counter-test/

    npm init --yes


  2. Add Hardhat to project

    npm install --save-dev hardhat


  3. Create new Hardhat project

    npx hardhat init





  4. Now that you have a local blockchain to test with, let's go back to the other terminal and deploy our smart contract with the deploy.js script that we created earlier.

    npx hardhat run scripts/deploy.js --network localhost



    If we monitor the Hardhat node we will see our attempt to deploy the smart contract. Note that the From address matches the public address of the first test account. Also make note that we now have a contract address (0x5fbdb2315678afecb367f032d93f642f64180aa3), we'll need this to interact with the contract.










Interact With Your Contract From Hardhat Console



Now that our contract is written and deployed on the blockchain, let's try to call some of it's functions.





  1. Start the Hardhat Javascript console



    npx hardhat console --network localhost




  2. We'll store our contract connection in the myContract variable



    const myContract = await ethers.getContractAt("CounterTest","0x5fbdb2315678afecb367f032d93f642f64180aa3")



  3. Next, let's call our getCount() function and see what the current count is:

    await myContract.getCount()

    You should get "0n" if this is our first run. Ignore the n, this is just indicates the type. You can cast this to an integer or whatever type you need in code if you were using this contract in real-life.


  4. Now, let's increment the counter with our incrementCount() function:

    await myContract.incrementCount()

    You'll see a lot more output from this call since we are actually adding information to the blockchain. Most notably you'll see the blockHash of the transaction and the gasPrice.


  5. Call getCount() again to confirm that the counter incremented as expected. The entire interaction should look something like this:

    library to interact with your contract.

    Vollständiger Original-Bericht
    Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
    ↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
3 Quellen
GPT-6 Astra Release Today? OpenAI’s Next Major AI Model Is Almost Here
1 Quelle
Apple accuses OpenAI of destroying evidence as trade-secrets fight intensifies
1 Quelle
Major AI platforms go down in unprecedented simultaneous outage
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Simple Start to Smart Contract Development with Hardhat

Thematisch verwandte Begriffe: Simple, Start, Smart, Contract · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...