Exploring Smart Contracts || Cohort X Shares Insight
Web3Bridge·Wed, Oct 9, 2024, 12:00 AM
In this week's episode of "Student Insights," join us as our budding blockchain enthusiasts share their reflections on their latest learning journey. This week, our students delved into the fascinating world of smart contracts. From understanding the fundamentals to exploring real-world applications, they discuss their key takeaways, challenges, and moments of revelation. Get ready for an enlightening discussion filled with fresh perspectives and valuable insights into smart contracts. Tune in to discover what our students learned and how it's shaping their understanding of decentralized technologies. Don't miss out – hit play now and join the conversation! 🚀 #BlockchainEducation #SmartContracts #StudentReflections
Transcript
hello viewers thank you for constantly watching our videos weekly we excited to bring you another insightful and educating [Music] video so week five has been amazing this was the beginning of our smart contract we and Having learned the basics of um solidity we Dove R into to um writing smart contracts you know we learned about um the development tools that we use remix and how that majorly and we started off easy with a simple set geta you know contract that just sets data to the blockchain and retrieves that data and then we went into the more serious stuff like the rc20 standard the rc7 21 standard and then went as far as writing um three versions of a savings contract one to save ether another to save an a token and and another to save both E and A St Tok um The MENTOR kasini also took his time to teach us about best practices best practices like avoiding um re-entrancy and also Society checks we also went neck deep into testing using much and hard Heart Smart contract are executable executable program they run on the blockchain they are ex executed when predefined conditions are met they can be used independently and sometimes they and most times they implemented with DBS so the major reason why people use Smart contract is because they imitable another major reason why people use Smart contracts is because it is distributed T contract allows users to deposit ether and withdraw ether and ether is um the native currency of etherum blockchain how does this C contract Works made use of mapping which help us to keep track of of the users that save in the contract in the sa contract there are four major functions there's a deposit function and there a withdraw function there's a check balance function and there's a check contract balance function event management smart contract whereby we used it was nft G meaning that the attend is needed to have ANC 721 nft to be able to attend your event there's um there's a contract called simple storage which has a which has a state variable called underscore data and the underscore data is a type of number so we use some unsigned integer to assign a number for a state variable and we also have a function called set data where anybody can actually update the state of that data and then we also have um a another function called get data where you can actually get or retrieve the data from that state variable token standards are basically um agreed upon rules that guides development design and um implementation and also the um use of um these tokens right the lc20 and thec 721 these are the most um common token standard we use when we write smart contract rc2 stands for etherum request for comment number 20 is 20 just a token standard that follows the technical guide on how token should be bu on the ch blockchain um 20 token are digital asset that are there to set of um rules so these rules ensure that they are interoperable they are compatible they are fible and they are transferable for a token to be considered on the ethereum blockchain it has to implement some certain functions and events for it to be considered compliant the events that must be included include the transfer event and the approval events tokens have some functions that have to be there this include balance off approve transfer Among Us and you can also have some optional ones like symbol name all the stuff yeah 71 talking a token that follows 71 token standard and it's used for nfts you have seen them like crypto funds and every other NF people create so this can be physical assets presented in the blockchain or just digital assets that are made in the blockchain what makes nfts like unique of all the digital asset is because your the ID of the nft is being like mapped to the address of the owner so for every nft the only unit to is the ID so you can't see the same nft with with the same ID you can't see one NF with the same ID they have different IDs which makes them more secure and it it increases like operability because you can use it a non fible token like it's a digital asset so you can use it for anything it's cross platform provided you're using it on an ethereum blockchain and the only difference between the both of them is that the I 721 token has um an owner of to um function which means every token has a specific owner but the erc20 can be owned by anyone and can have the same value at any time so init testing uh is a software testing uh method where you test um your functions in units testing is the act of checking your codes units by units to be sure they are working properly we have different framework in testing we have the chai we have the mocker we also have the found and other languages we have the P test and J unit generally we there are different two types of unit test we have the tdd and the the T which is the test during development and the bdd which is the behavioral during development unting is good because it helps you to save uh money you don't it don't uh push things that are not working to uh production hoping that they will work so it's essential we test our code before push down to production because when it's very expensive to test your code when it's already on the blockchain interfaces and an interface is a way to define the behavior of a contract without actually implementing it we will have two use for this interes one is for implementation and secondly for interaction and in implementation all the functions are being used but in interaction we interact with already deployed contract on chain a multi letter is a kind of wallet that involved that involves two more um private keys to authorize the transactions multi signature is more secure than a single M signature is more secure than a single signature transaction some of the um some of the benefits of this um M Sig wet is the US and financial institution crowdfunding and um um and so many more liaries are a special type of smart contract that contains usable codes so lency libraries poster um code reability and um they allow developers to you know um add and Implement methods for um specific data types so similar to classes and objects in um in objectoriented programming so um these methods can be accessed using the dot notation but what are the benefits of a library the first one is the fact that a library is reusable the second one is the fact that it is economical the third one is the fact that a library are good adults to have in our qut there are some of the limitations of a library the first is a library do not have a storage a library cannot accept iters neither can it um have a payable function also libraries cannot be inherited nor inherit other smart contracts and lastly a library cannot be destroyed it is indestructible mod
Automatic transcript — names and jargon may be misspelled.