Ethereum - Interacting with Deployed Contract (2024)

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 −

Ethereum - Interacting with Deployed Contract (1)

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.

Ethereum - Interacting with Deployed Contract (2)

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 −

Ethereum - Interacting with Deployed Contract (3)

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 −

Ethereum - Interacting with Deployed Contract (4)

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 −

Ethereum - Interacting with Deployed Contract (5)

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.

Advertisem*nts

Ethereum - Interacting with Deployed Contract (2024)
Top Articles
Here’s When and Why We Get a Bonus Day in February 2024
A Complete Guide To HTML Mailto Attribute
Blanchard St Denis Funeral Home Obituaries
Jeremy Corbell Twitter
Miss Carramello
Mohawkind Docagent
[2024] How to watch Sound of Freedom on Hulu
Cranberry sauce, canned, sweetened, 1 slice (1/2" thick, approx 8 slices per can) - Health Encyclopedia
Superhot Unblocked Games
Directions To O'reilly's Near Me
Chile Crunch Original
Wilmot Science Training Program for Deaf High School Students Expands Across the U.S.
Boston Gang Map
Convert 2024.33 Usd
Marvon McCray Update: Did He Pass Away Or Is He Still Alive?
Trivago Sf
97226 Zip Code
Ubg98.Github.io Unblocked
Persona 5 Royal Fusion Calculator (Fusion list with guide)
Puss In Boots: The Last Wish Showtimes Near Cinépolis Vista
Dwc Qme Database
Rimworld Prison Break
The EyeDoctors Optometrists, 1835 NW Topeka Blvd, Topeka, KS 66608, US - MapQuest
Olivia Maeday
Synergy Grand Rapids Public Schools
Dove Cremation Services Topeka Ks
Weather October 15
Ullu Coupon Code
Winterset Rants And Raves
Ehome America Coupon Code
Kids and Adult Dinosaur Costume
2012 Street Glide Blue Book Value
Kvoa Tv Schedule
Family Fare Ad Allendale Mi
The Syracuse Journal-Democrat from Syracuse, Nebraska
Alpha Asher Chapter 130
Mcgiftcardmall.con
Stanley Steemer Johnson City Tn
„Wir sind gut positioniert“
How to Print Tables in R with Examples Using table()
Kenner And Stevens Funeral Home
Comanche Or Crow Crossword Clue
Reli Stocktwits
Mother Cabrini, the First American Saint of the Catholic Church
Bridgeport Police Blotter Today
Oefenpakket & Hoorcolleges Diagnostiek | WorldSupporter
Diamond Desires Nyc
De Donde Es El Area +63
8663831604
When Is The First Cold Front In Florida 2022
Obituary Roger Schaefer Update 2020
Fetllife Com
Latest Posts
Article information

Author: Jeremiah Abshire

Last Updated:

Views: 6417

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Jeremiah Abshire

Birthday: 1993-09-14

Address: Apt. 425 92748 Jannie Centers, Port Nikitaville, VT 82110

Phone: +8096210939894

Job: Lead Healthcare Manager

Hobby: Watching movies, Watching movies, Knapping, LARPing, Coffee roasting, Lacemaking, Gaming

Introduction: My name is Jeremiah Abshire, I am a outstanding, kind, clever, hilarious, curious, hilarious, outstanding person who loves writing and wants to share my knowledge and understanding with you.