New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Exploring Smart Contract Interaction || Cohort X

Web3BridgeWed, Oct 9, 2024, 12:00 AM

The students in the cohort discuss interacting with smart contracts. They cover how to call various functions through a block explorer and using ethers.js. Join the journey and witness how the students learn about Web3 technology daily at Web3Bridge.

Transcript

[Music] hi everyone I'm B and during the course of this week at web three Bridge we learned about writing smart contract we learned about lots of smart contract from multi wallet to save e to different smart contract but what I'll be talking about today is about interacting with this smart contact [Music] un onchan interaction is basically basically interacting with the already deployed smart contract so it's just a way of user user experience so what we what we did basically was interacting with an already deployed smart contract which was our2 token so we interacted with the transfer function the balance the balance of function and the um transfer form function for contract interactions right for you to interact with a contract that has been deployed on on chain right it is done using an interface of that contract right and when you have the interface of that contract you need the contract address of that contract and also an interface to implement what we have on that contract on the contract deployed then you can now manipulate your way and also interact with the contract in your script folder from your um contract um folder right smart contract they live independently of their own self having their own State variables and their own functions so I will use um an analogy of a sticking dap to to make you understand how smart contract interacts with each other interactions are one of the use cases why we have interfaces in our smart contract now how is interaction made possible now in um solid is a made use of interface now interfaces um basically being used for two key things for implementation and interaction now when we deploy a smart contract on the Block Explorer like CIA now we want to interact with that contract that we have deployed so this week we deployed the contract you know on chain and now from our code days we run some interactions that reflected on the Block Explorer it was you know somehow intriguing but here here is what happened you know for us to actually sign some transactions you know on chain it requires a signer now we we utilized the E Library a JS library and then picked the signer I'm making available a private key with these two you know um elements we were able to interact with a contract on chain running transactions that through reflected on the Block Explorer so take for example you go to a particular platform and you want to STI maybe you want to STI using your ether let's say you want to use your ether to STI or maybe those of you that use optimism you want to use your dye to stick now this is what happens the sing contract will communicate to the contract of the D to know what is your balance in the D token maybe you say you want to take like 20 D so first of all it takes your address communicates with the diet contract and then knows how many diet does this guy has in his balance if you have up to five or maybe up to 20 as the amount that you stated what's going to happen is that it's going to allow you to stti but you don't have up to that is not going to allow you to STI so this is is very simple analogy of how smart contracts interact with each other [Music]

Automatic transcript — names and jargon may be misspelled.