Ethereum – Interacting with Deployed Contract

Last updated on Oct 20 2021
Avinash Malviya

Table of Contents

Ethereum – Interacting with Deployed Contract

Now, you are ready to interact with the contract that you have deployed. Go back to MyEtherWallet desktop and click on the “Interact with Contract” tab as shown in the screenshot below −

Page 1 Image 1 6
Interact Contract

Paste the contract address that you previously copied in the “Contract Address” field. You also need to paste the “ABI / JSON Interface” of the contract on the above screen.
To get the ABI, go to the Remix window and click on the ABI button as shown in the screenshot below.

Page 2 Image 2 5
ABI
The ABI / JSON interface will be copied to the clipboard. Paste this in your favorite editor to examine the generated interface, which is shown below −
ABI / JSON Interface

[

{

"constant": false,

"inputs": [

{

"name": "newDeposit",

"type": "uint256"

}

],

"name": "send",

"outputs": [],

"payable": false,

"stateMutability": "nonpayable",

"type": "function"

},

{

"inputs": [

{

"name": "initialAmount",

"type": "uint256"

},

{

"name": "initialValue",

"type": "uint256"

}

],

"payable": false,

"stateMutability": "nonpayable",

"type": "constructor"

},

{

"constant": true,

"inputs": [],

"name": "getAmount",

"outputs": [

{

"name": "",

"type": "uint256"

}

],

"payable": false,

"stateMutability": "view",

"type": "function"

},

{

"constant": true,

"inputs": [],

"name": "getBalance",

"outputs": [

{

"name": "",

"type": "uint256"

}

],

"payable": false,

"stateMutability": "view",

"type": "function"

}

]

After you paste this JSON in the MyEtherWallet interface, you will notice that the ACCESS button below the JSON interface is now activated, as shown below −

Page 4 Image 3 1
ACCESS button

Click Access button to access the contract.
Upon clicking the Access button, the contract address and function selection dropdown will appear on the screen like in the Remix editor. This is shown in the screenshot below −

Page 4 Image 4 1
Dropdown

You may check the various functions of the contract as in the case of Remix deployment. Note that the contact is now deployed on an external Ganache Blockchain. Check the getAmount function; you will get the Amount value of zero and the getBalance will show a balance of 1000.
Now try sending some money. It will present you a textedit control for entering the amount. When you write the contract, some “gas” would be used and you will be asked to confirm the transaction before writing it to the Blockchain. The transaction would be executed in a short while depending on the mining timing set by you on the Ganache server. After this, you can reexamine the value and the amount fields of the contract to verify that these are indeed modified.
You may now examine the Ganache desktop to view the transactions that you have performed so far. A sample output is shown below −

Page 5 Image 5
Examine

So far, you were both the contract creator and the contract executor. This does not make much sense, as you expect others to use your contract. For this, we will create another client for our Ganache Blockchain and send some money from the newly created account # 2 to the contract creator at account # 1.
So, this brings us to the end of blog. This Tecklearn ‘Ethereum – Interacting with Deployed 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 - Interacting with Deployed Contract"

Leave a Message

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