Ethereum – Deploying Contract

Last updated on Oct 20 2021
Avinash Malviya

Table of Contents

Ethereum – Deploying Contract

To deploy the contract, select the Contracts menu option as shown in the screenshot below −

Page 1 Image 1 5
Deploying Contract

You will need to enter the contract’s bytecode on this screen. Remember, when you compile your Solidity contract code, it generated a bytecode that runs on EVM. You will now need to obtain this bytecode from Remix IDE.
Go to the Remix IDE screen, your earlier typed contract should be there in the code window. If not, retype the contract in the code window. Click on the Bytecode button as shown in the following screenshot −

Page 2 Image 2 4
Bytecode button

The bytecode for your compiled source is copied to the clipboard along with some other information. Paste the copied code into your favorite text editor. Following is the screenshot of the text editor −

Page 2 Image 3 2
Paste code

The value of the object tag contains the desired bytecode. Copy this carefully making sure that you do not copy the enclosing quotes. The bytecode is really long, so make sure that you copy right upto the last byte inclusive of it. Now, paste this bytecode in the Deploy Contract screen as shown below −

Page 3 Image 4 3
Deploy Contract

The Gas Limit field is automatically set.
Below the Gas Limit field, you will find the selection for accessing the wallet.

Page 3 Image 5 2
Accessing wallet

Now, access the wallet using the Private Key of the Ganache account on which this contract will be deployed. To get this private key, go back to the Ganache window. Click on the keys icon of the first account as shown below −

Page 4 Image 6 2
Accessing wallet

You will see the private key of the user account # 1 as seen in the screenshot below −

 

 

Page 4 Image 7 2
Private key

Copy this private key and paste it in the “Paste Your Private Key” section as shown below −

Page 5 Image 8 1
Copy key

You will see the “Unlock” button at the bottom of the screen. After unlocking, a “success” message will appear at the bottom of the screen. At this point, your wallet is attached to account #1 of the Ganache Blockchain.
Now, you are ready to sign and deploy the contract. Click on the “Sign Transaction” button as shown in the screenshot below −

Page 6 Image 9
Sign Transaction

Signing the transaction generates and displays both Raw and Signed transactions. Click on the “Deploy Contract” button to deploy the contract on the Ganache Blockchain. Remember the contract is deployed by account # 1 user of the Ganache Blockchain. Therefore, account # 1 user becomes the contract creator. Before the contract is deployed, you will be asked to confirm the transaction as it may cost you some real money if you were to deploy this contract on a public real Ethereum Blockchain. Do not worry, for the current private Blockchain running on your local machine, there is no real money involved. Click on the Make transaction button as shown in the screenshot below −

Page 6 Image 10 1
Make transaction

Examine the Ganache console; you will see that the ETH balance in the account # 1 has reduced as seen in the screenshot below −

Page 7 Image 11
Examine

Now, click on the TRANSACTIONS menu as shown in the screenshot below −

Page 7 Image 12
TRANSACTIONS

You will see the transaction details.

Page 7 Image 13
Transaction details

On this screen, you will find the contract’s published address. The address is marked in the above screenshot. You will distribute this address publicly to let others know that your contract is available at this specified address to which they can connect and execute the contract methods, such as sending money to you – the contract creator. Copy this contract address for your own reference as you are going to need it in the next step.
So, this brings us to the end of blog. This Tecklearn ‘Ethereum – Deploying Contract’ blog helps you with commonly asked questions if you are looking out for a job in BlockChain or Ethereum. If you wish to learn BlockChain or Ethereum and build a career in BlockChain domain, then check out our interactive, Blockchain and Ethereum Developer Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/blockchain-and-ethereum-certification-training/

Blockchain and Ethereum Developer Training

About the Course

Tecklearn’s Blockchain and Ethereum Certification Training course in the blockchain technology that covers essential concepts like Blockchain programming, Ethereum, Solidity, Digital ledger types, Smart Contracts, Multichain, Bitcoin mining, Cryptocurrency, etc. The course provides an overview of the structure and mechanism of Blockchain. You will learn about the Ethereum ecosystem, how smart contracts are developed using Solidity and how to deploy a business network using Hyperledger Compose.

Why Should you take BlockChain and Ethereum Certification Training?

• The average salary of a Blockchain Ethereum Developer is $158,860 per annum – Paysa.com.
• Blockchain tech has gone far beyond its beginnings in banking and cryptocurrency: In 2019, businesses are expected to spend $2.9B on the technology.
• IBM reports that Blockchain markets are headed to $60 Billion worldwide by 2024.

What you will Learn in this Course?

Introduction and origin of Blockchain

• How does our current financial system work?
• What can be the possible solution
• What is a distributed system
• What is Blockchain
• How does a Blockchain work
• Components of Blockchain
• Business network
• Consensus, Provenances, immutability and finality

Cryptocurrency and Blockchain

• Distributed system
• Distributed Ledger technology
• Global Payments
• Why BlockChain
• BlockChain and use case needs
• Requirements of blockchain for business
• BlockChain benefits
• Types of BlockChain
• Hands on

Bitcoin Platform

• What is Bitcoin?
• Why use Bitcoins?
• Bitcoin Ecosystem
• Structure of a Bitcoin Transaction
• Merkel Trees
• Scripting language in Bitcoin
• Applications of Bitcoin script
• Nodes in a Bitcoin Network
• Bitcoin Economics
• What is Bitcoin Mining?
• Types of Mining
• Mining and Consensus
• Hands On

Introduction to Ethereum

• What is Ethereum?
• Ethereum Layers
• Introducing Smart Contracts
• Cryptocurrency in Ethereum
• Mining in Ethereum
• Consensus Mechanism
• Platform Functions in Ethereum
• Technologies that support Ethereum
• Ethereum Programming Language
• Components for the development of Ethereum DApps
• Editors and tools
• Frontend Development
• Ethereum Test Networks
• ERC Tokens
• Hands On

Solidity

• Introducing Solidity
• Sample Code, Layout of Source File
• Structure of a Contract
• State Variables, Functions Types, Reference Types
• Special Variables and Functions, Expressions and Control Structures
• Function Calls, Error Handling
• Visibility for Functions and State Variables
• Inheritance, Constructors
• Importing Smart Contracts
• Gas Limit and Loops
• Sending and Receiving Ether
• Recommendations
• Contract ABI
• Setting up the development environment and Deploying DApp
• Hands On

Hyperledger

• Introduction to Hyperledger
• Hyperledger architecture
• Hyperledger Fabric V1 Architecture
• Consensus
• Hyperledger API
• Hyperledger Application Model
• Hyperledger project and tools
• Network Topology
• Exploring Hyperledger frameworks
• Business Network Deployment on Hyperledger Composer Playground
• Sample Transaction
• Service invoices
• Hands On

Hyperledger Composer

• Development Environment using Composer
• Developing business networks
• Testing business networks
• Introduction to Hyperledger Fabric
• Hyperledger Fabric Model
• Ways to create Hyperledger Fabric Blockchain Network
• Hands On

Create and Deploy Your Private Blockchain On Multichain

• What Is MultiChain
• MultiChain Privacy and Permissions
• Mining in MultiChain
• Multiple configurable Blockchains using MultiChain
• Setting up a Private Blockchain
• Hands On

Blockchain Use Cases

• Potential use cases in Blockchain
• BlockChain project

Got a question for us? Please mention it in the comments section and we will get back to you.

0 responses on "Ethereum - Deploying Contract"

Leave a Message

Your email address will not be published. Required fields are marked *