Member Login - User Registration - Set as Homepage - Add to Favorites - Website Map The Basics of Web3 - Ep5!
Current location: Home > java > The Basics of Web3 - Ep5 Text

The Basics of Web3 - Ep5

Time: 2025-07-11 11:48:37 Source: Codora.ai Author: python Reading: 375 times
interacting with a smartcontract and edureka ai coursethen finally the last uhtype of transaction that you would seeis a transaction that's communicatingwith a smart contract this is wherewe're going to see call data come in soif you've heard this term call data uhwhat happens is when you are trying tocommunicate with a smart contract froman eoa you sign a transaction that hassome value in it it might be ether youhave some data in there that's going tobe the call data and that call data isgoing to Target an entry point on thecontract right so I did highlight herethe 5B 5B is actually an entry pointinto a contract at the lowest levelwhere you can actually say I want tostart executing op codes from that pointusing this parameter that's been encodedwithin the call data um I make thispoint of it being Bode just for thepurposes of being complete here althoughfor the most part as a web 3 developeryou're thinking about things in solidityso it's a little bit easier as adeveloper to think about these thingsversus taking a look at something likewhat's shown here which is the op codelevel L the low level uh and then othercontracts can communicate with eachother uh via something called a messagecall and a message call allows acontract to communicate with anothercontract encoding call data between uhthese contracts as well to Target otherentry points into other smart contractsthese message calls can also includevalue they can send ether from one smartcontract to another and they can alsoinclude a gas parameter to say this isthe max amount of gas that you'rewilling to you're allowed to spend outof this transaction now everything yousee here on this slide is onetransaction so in one transaction andyou've probably seen this if you'veinteracted with a blockchain before andyou've taken a look at something likeether scan in one transaction you couldsend some call data to a Smart contractand that smart contract can call manyother smart contracts and then at theend of the day it's going to walk allthe way back up to the original contractwhere the transaction is going toconclude um all of that is onetransaction and like I I said beforetransactions all have the evm tothemselves they happen sequentially sothey only occur one out of time so whenyou make your transaction it can callmany contracts which could change StateStorage across all these contracts comeall the way back up the call stack toyou concluding your transaction beforesomebody else's transaction happens soyou could interact with Unis Swap andUnis swap could exchange one erc20 foranother erc20 which are separate smartcontract s change the balances in bothof those smart contracts and then comeall the way back up to the original Unisswap contract uh before somebody elsegets to execute on theevm so what about when things go wrongyou may have heard this idea of atransaction failure or transactionrevert so when somebody transacts and umsomething goes wrong let's say theydon't have permission to do whateverthey did um you could do a transactioninto contract a and contract a couldcall into contract B and contract Bcould say no no no no no this is notokay and contract B whatever statechanges happen in contract B if it callsa revert it will actually revert thoseState changes and those State changeswon't occur contract a at that pointdoes have the ability to say I stillwant my state changes to occur if itdoesn't want to revert from therehowever if contract a does revert likeit does in this case where it's saying Iwant to require that the message call issuccessful then what you have at the endof the day is something called atransaction failure a transactionfailure and all reverts all cost gasbecause they did occur they did happenon the blockchain uh so you are stillasking the network to spend theirresources so at the end of the day as auser you do have to pay for that gas theeoa has to pay for the gas because thattransaction was included in a block andum now somebody has to pay for thattransaction beingthere so you may have heard heard mejust say the term or the idea that atransaction was included in a block sowe haven't really talked about ablockchain on a high level but now youmay understand that a TR a blockchainwhen you're thinking about it just interms of blocks is really just acollection of blocks it's a bunch ofblocks that each have a bunch oftransactions in them right so if youtake a look at this on the left handside you see that we have three blocksEach of which have three transactionsinside of them and each of thosetransactions is going to make some Statechange on the Block chain and theblockchain is going to agree upon somestate which now if we're thinking aboutthis at from the low level from the web3 developers perspective we know is abunch of accounts those accounts like anexternally owned account has an addressand a balance or if it's a smartcontract it may have code and storage tobe able to store changes to store uhvariables things like how many erc20tokens are stored in this Unis swap poolis something that Unis swap is going tohave to keep track track of inside ofits storage uh inside of that smartcontract great so what of ourtransaction takeaways transactiontakeaways are that transactionscommunicate value which could be thenative currency of the blockchain whichis the BL uh Native currency of theblockchain uh it would either be etherin ethereum's case or madic in polygon'scase whatever evm compatible chain youhave may have its own native currency uhis going to be data which is the calldataright which is going to Target somefunction on a smart contract it's goingto Target an entry point where it couldstart executing code on the smartcontract as long as the smart contractwas programmed in such a way that thatentry point is allowed and then gaspreferences saying hey what am I willingto spend per unit of gas and how muchgas am I willing to spend in thistransaction uh that way you can only runup a certain high level of a bill rightyou can only spend x amount as

(Editor in charge: news)

Related content
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep290
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep274
  • Web3 Developer in 2024 Roadmap_ Solidity, Smart Contract, and Blockchain Development [Full Course] - Ep39
  • Solana Developer Bootcamp 2024 - Learn Blockchain and Full Stack Web3 Development - Projects 1-9 - Ep68
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep231
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep25
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep226
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep54
Recommended content
  • Trailblazing women and their journeys to space - Ep4
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep263
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep44
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep69
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep32
  • Learn Blockchain, Solidity, and Full Stack Web3 Development with JavaScript – 32-Hour Course - Ep7