🔧 AI Nachrichten OpenAI Targets Work of Wall Street Junior Bankers(10.09.2026 um 21:02 Uhr)
🔧 AI Nachrichten Altman Considers Slowing Down AI Development(11.09.2026 um 20:00 Uhr)
⚠️ Malware / Trojaner / VirenJSCeal Malware Can Bypass Google Authentication Using Stolen Session Cookies(07.09.2026 um 09:53 Uhr)
⚠️ Malware / Trojaner / VirenBengalSEO Poisons Bing Search Results to Deliver MayaBot and Tech Support Scams(08.09.2026 um 10:43 Uhr)
🕵️ SicherheitslückenN-able N-central Pre-Auth RCE Flaw Exploited in the Wild(09.09.2026 um 06:27 Uhr)
🔧 AI Nachrichten OpenAI Targets Work of Wall Street Junior Bankers(10.09.2026 um 21:02 Uhr)
🔧 AI Nachrichten Altman Considers Slowing Down AI Development(11.09.2026 um 20:00 Uhr)
⚠️ Malware / Trojaner / VirenJSCeal Malware Can Bypass Google Authentication Using Stolen Session Cookies(07.09.2026 um 09:53 Uhr)
⚠️ Malware / Trojaner / VirenBengalSEO Poisons Bing Search Results to Deliver MayaBot and Tech Support Scams(08.09.2026 um 10:43 Uhr)
🕵️ SicherheitslückenN-able N-central Pre-Auth RCE Flaw Exploited in the Wild(09.09.2026 um 06:27 Uhr)

🔧 Programmierung 🕛 vor 2 Jahren 7 Min Lesezeit
0

Smart Contract Dev : Hands-On with Truffle, Ganache and Solidity

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

Best guide for Developing, Deploying and Testing Smart Contracts using truffle and ganache .



Overview:

In this guide, we’ll set up an environment that simulates the real Ethereum network without using the usual testnets provided by Ethereum, such as Sepolia or Goerli. Instead, our testnet will be local, using the Ganache client, which automatically mines blocks instantly. This simulates a real blockchain environment without waiting for actual block times, allowing for rapid testing and development. I prefer this method over traditional testnets because it eliminates the need to collect test Ether from faucets, saving time. However, this method has some drawbacks, which we’ll discuss later.



Truffle



Truffle is a comprehensive development framework for building, testing, and deploying smart contracts on Ethereum, streamlining the entire blockchain development process, we’ll link it to the ganache client for our tests rather than the actual Ethereum network ‘mainnet’.



Introduction:

In this guide, we’re not using any IDE. The primary tools are Windows PowerShell and Node Package Manager (npm)."



It might be unusual for beginners to work without any GUI but this method really helped me getting hand on hand with smart contract development using only CLI , so first of all you should install Node.js on your system here’s a link for downloading it :





you could see all versions with this command :

npm list





Following step



Now after setting all requirements lets start developing , Create your project folder and navigate to it as cited in the following screenshot





Truffle will create a new project folder in the specified folder with standard project folders :





Normally the ganache client should start RPC Listening on 127.0.0.1:8545(local host as defined in the truffle config)and you’ll have 10 accounts with 1000 ETH in each one of them as in the following screenshot.





when compiled successfully lets deploy it by running :



truffle migrate





we managed successfully to deploy the contract, Lets try now interacting with it to see if its working as intended or not ,In this concept truffle offer us a tool for interacting with the deployed contract , Its the truffle console.



Interacting with the deployed contract

To summarize, we deployed our contract successfully lets now interact with it , by running this command:

truffle console

you will enter in a JavaScript environment to interact with the deployed contract .here’s a code example to interact with the contract.



const Skaltuchet = await artifacts.require("Skaltuchet").deployed()




CODE
const contractAddress = await Skaltuchet.address
const contractBalance = await Skaltuchet.balanceOf(contractAddress)
console.log("Contract SKT balance:", web3.utils.fromWei(contractBalance.toString(), 'ether'), "SKT")

const accounts = await web3.eth.getAccounts()
const ownerAddress = accounts[0]
const ownerBalance = await Skaltuchet.balanceOf(ownerAddress)
console.log("Owner SKT balance:", web3.utils.fromWei(ownerBalance.toString(), 'ether'), "SKT")

const ownerEthBalance = await web3.eth.getBalance(ownerAddress)
console.log("Owner ETH balance:", web3.utils.fromWei(ownerEthBalance.toString(), 'ether'), "ETH")






You can save this code to file.js, then navigate to its directory and run: node file.js. Alternatively, you can execute it command by command in the Truffle console, as shown in the following screenshot.








SUMMARY:



In the previous part we handled interacting with the deployed smart contract and testing it via Truffle console, You can see Truffle with Ganache is quite a good tool for creating deploying, and testing smart contracts, But it has some challenging steps when you want to use deployed contracts on the real Ethereum network (mainnet 1) like using Uniswap router, for example, you would probably need to fork the deployed contract on the ganache client and use an infura provider.

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
1 Quelle
OpenAI Targets Work of Wall Street Junior Bankers
1 Quelle
Altman Considers Slowing Down AI Development
1 Quelle
JSCeal Malware Can Bypass Google Authentication Using Stolen Session Cookies
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Smart Contract Dev : Hands-On with Truffle, Ganache and Solidity

Thematisch verwandte Begriffe: Smart, Contract, HandsOn, with · 6 Treffer

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 ...