How to Interact with Smart Contracts on Ethereum Blockchain

In this video, we'll write our first Solidity smart contract

Now that we know we have a connection between our browser and our Ethereum node Let's make a connection to our contract

Remember that in order to create a JavaScript representation of our contract, we need to load the abi

Let's copy the abi that we compiled earlier into this project. Only I'm going to rename it to counter_sol_Counter_abi.json

In the code, we can require this .json file -- this is possible because of the nwb config, if you're building using another method you could always just copy and paste the abi here in the code t counterAbi = require('./counter_sol_Counter_abi.json');

We can log it out and make sure it loaded. Great nsole.log(counterAbi);

Also remember that our particular instance of the counter contract lives at a specific address on the blockchain. I hope you saved the contract address from last time.

let contractAddr = '0x4575e7fcf12a110060ebc1e3b2b85706ddfbc97e';

This lesson preview is part of the Intro to Programming Ethereum ĐApps course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to Intro to Programming Ethereum ĐApps, plus 80+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course Intro to Programming Ethereum ĐApps