lanasta / deploy-smart-contract

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploy your first smart contract

As blockchain technology continues to flourish, companies are moving towards building their applications on-chain using smart contracts. In this workshop, we will discuss how Ethereum smart contracts work and go over related concepts like gas fees, the Ethereum Virtual Machine (EVM), customizable event classes, wallets and identities, visualization tools, and more. We will then get familiar with the Solidity programming language and write a simple smart contract together. Afterward, we will deploy the smart contract to an Ethereum test network through the latest Ethereum development tools like Hardhat and the MetaMask wallet. After we test some interactions with our deployed smart contract, you’ll feel empowered to write, test, and deploy your own smart contract to bring blockchain to your use case.

Pre-workshop to-do list

  • Set up a Node development environment on your machine.

  • Hardhat: npm install --save-dev hardhat

  • MetaMask Wallet: Make sure you have some Goerli Test Network ETH in your MetaMask Wallet before the workshop

    • Install Metamask as a browser extension – use Chrome or Firefox.
    • Make sure the “Show test networks” setting under “Advanced” is set to on.
    • Switch to the Görli Testnet network in your MetaMask wallet.
    • Use a Goerli Faucet to request some funds. Watch the tutorial. Faucets can be found here or here
  • Infura: Sign up for a free account and create a Goerli Network endpoint

  • Set environment variables that are needed in the Hardhat config file:

export INFURA_URL_GOERLI=<Copy and paste the network endpoint URL from Infura>

export PRIVATE_KEY_GOERLI=<Copy and paste your MetaMask wallet private key>

  • If you'd like to test interacting with your smart contract from a Node application, modify the contract address in demo/interact.js, and please set the following environment variable.

export GOERLI_ACCOUNT_ADDRESS=<Copy and paste your MetaMask Goerli account address>

To run the script, execute node interact.js

Additional learning materials

About

License:MIT License