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

Loading player…

Robert Benedek - Smart Contracts Demystified

ETHCluj MeetupThu, Apr 9, 2026, 12:00 AM

How self-executing contracts work, their applications, and why they’re the backbone of Web3.

Transcript

Benedict from smart contracts level executing agreement on blockchain. Third party. deployed blockchain respective requirements. Um so what um can a New era in technology. Correct.

Exact Facebook. Anything to say about it? web. Okay. centralized unit contract.

Smart contract. Correct. Exacting agreement. Okay. Smart contract.

Smart cont. on blockchain respective would you like to change in English?

Okay. Smart contracts demystified I guess. Okay. So um that blockchain. Big hacks, Bitcoin.

KYC. She trans. So foreign. See, peer-to-peer transactions direct my rapid efficient environment. For example, Facebook contract decentralized application.

Big companies centralizing everything. Smart contract make sense?

Okay. Um, traditional transactions, shopkeeper foreign. So, she vending machine contract. Whatever you Fore basically shopkeepers. Um, smart contract.

Transparent transactions. Okay. Smart contract contracts. Um public accessibility. Mhm.

Exact. Okay. Transparent transactions visible history blockchain. Um, autonomous functioning. for indifferent for example contract respective decentralized application smart contract blockchain direct blockchain.

Blockchain blockchain She's my most validator. requirements. Glimpse into contracts. respons. Okay.

Um, a single bug can lead to irreversible losses, uh, blocking or losing millions. Um, check. Yeah, exactity. Um, okay. Upgradeility contract patterns.

Smart contract. into the smart contract. Make sense? Um, smart contract code. Upgradeability.

Smart contract. smart contract make sense immutable code still let's work around compass smart contract malicious attackers to take advantage of your smart contract. Um, how can I break this if I were a hacker? General smart contract contracted smart contract. Hi.

Um I was tell I was saying about uh the the smart contract developer mindset. Um it was like uh about you have to take into consideration that once you deploy a smart contract uh you make you make sure that uh there are not like bugs or um different uh um potentially locking your uh money or um different uh problems that might arise. Um, and that the open source is also a blessing, but it's it's bad also because uh you might have uh users that can see the smart contract and can uh trust you. However, the attackers could see the smart contract also. So, you have to be careful and missing a require might might uh mean that losing the all the money in your smart contract.

So you have to have a mentality that how could I break my smart contract when I'm developing it uh if I was an hacker. Um I have here some real world examples um which uh are pretty big I would say. Um in my opinion the tokenization is the biggest but also defy it's a really big part of it. Uh do you have any like ideas about the DeFi or what it is what it means? Defi decentralized finance.

Sorry. Oh

sorry.

No. Um so uh decentralized finance is like banks but decentralized. So it's not an authority a centralized authority that's uh going to handle all the transaction and anything uh it's it's uh autonomous and uh anybody could interact with it uh while going there even on Saturday at 2 a.m. uh to make an exchange uh and get some I don't know funds that uh that you want.

Um tokenization uh is also a really important part uh where you have different uh assets that you want to tokenize. Uh then you have a a structure um asset. So you are going to input into a smart contract the asset ownership verification. So for example a Q KYC or different uh stuff like that and also some compliance checks. uh if if for example your fund will not allow users uh only from Romania for example um you are going to have this check you can add this check to the smart contract he will check oh okay so he is from Romania okay then I will allow him to buy my tokenized asset um asset valuation so then you're just going to evaluate your uh asset and uh say to the users um what is the price on it um then make issuing uh enough tokens for your asset.

So for example, if if I have a startup that I'm evaluating at $10 million, uh I might um issue like 1 million tokens and uh each uh each token would mean uh to price like $10 or something like that. Um and then the smart contracts are devel are developed and uh deployed on the smart on the blockchain. Um and everybody could interact with it. Uh however they have to uh be sure that they uh have these verifications and compliance checks. Um then I will uh have a marketplace or this is more for users interface.

So UX, but however, everybody could go and interact with it on blockchain if they knew like the smart contract and the address and then just issuing the tokens for each user that wants uh it. Uh I'm from token uh which is a tokenization um project. um it transform it. It makes real world asset uh tokenization and we are the founders of T-Rex protocol which is uh mainly used for the tokenization part. Um then we have the government voting uh system which also it's used usually in a de uh uh decentralized authorized u um um um in decentralized um entities and for example government.

It can be for uh having different parties um agreeing on some um specific rules. uh for example the ballot initiator uh means it's u the uh let's say I want to see if uh my community wants to have different uh um I don't know like the banner to be black or white I can imply or ask a question with multiple um answers and then the voters um can interact with my smart contract and u check um what is their opinion uh and this will be in a decentralized way. Uh so I can't um manipulate the votes. Uh this will be really good if you ask me for our government uh elections and even in America as much as I've seen. Um then will be like the supply management.

Um so you have a smart contract that's has different uh conditions that has to be in uh like uh it they have to be um requirements. Um you have the producer you have different u measurers devices EOT devices um then you're going down the chain to be sure that every at every step uh that specific requirements has been happening or have been happening uh and then you can check on chain that uh at the end um indeed it it has been u achieved uh those measurements. uh also is really good for watches or uh brand recognition. Uh you can um verify that your watch for example uh through through blockchain um has been an original piece. So you got it from the issuer.

Uh then you sold it to 10 persons maybe. Uh those 10 persons are now the owners and they can resell uh it further but with um maybe an NFT as um on a piece of um originality. So to make sure that it's an original piece um would you have some questions about this

or anything I discussed until now? I was think I was sawing that you are trying to

figuring something

like with you guys tokenizing an asset.

Okay.

Uh then what's the process of tokenizing a real world asset?

All right. So um I I'll go back a few slides. Um hope so let's say some investors we have this protocol um oh we have this T-Rex protocol which is a set of smart contracts that are deployed on a blockchain on Ethereum blockchain and uh they are um okay here and uh these assets are um uh these smart contracts uh have different uh um role. So for example, what some are for um ownership verification. So who can own this specific um piece of um asset then compliance checks which are a lot and uh they have to be documented.

So it's not just okay uh you you have to it's documented with the real um real world I would say uh companies or uh issuers of compliance and the clients are usually fund invest fund managers and so on. Um then you have all these real estate financial securities funds equity uh depth that you want to tokenize. So you want uh maybe you need some liquidity right you're a fund management manager and you need some liquidity but you can't really sold sell the the depth that uh you acquired maybe with I don't know three four% or something like that u but you need liquidity and how do you do those expire like in two years maybe uh but I needed some money now okay what I can do I can tokenize that debt into a um an tokenized asset and then I can sell that piece um for for example maybe you don't have 2 millions of dollars that you want to transfer but you have 10,000 and you wish you would get 4% on that 10,000 uh and then I will uh enable some uh smart contracts and I will deploy it I will have uh everything uh set up for your evaluation. Uh then when those two millions are issued as tokens, uh anybody you you could buy um percentages of uh the whole asset. So the whole depth for example, you are going to buy maybe just 10,000 out of those 2 millions.

But me as a fund manager uh I kind of get rid of the depth uh and I get some liquidity on hands and now you have the tokens which uh translates to 10,000 um 10,000 in depth in that depth that I issued sometimes in the future in the um history and you are going to uh be able to use them for example in maybe two years when it's the deadline for uh the depth and then I will um go and pay you back your I don't know 4% annually on those 10,000. Um make more sense now?

Yeah. Yeah.

Would you need any other explanation? Okay. Okay. I'll go further um as we are a little bit behind but okay. So that has been my presentation.

His is my LinkedIn if you want to uh link and uh yeah smart contracts domestify. Um, right now we I wanted to show you a little bit of um of how smart contracts um how you can interact with smart contract. A smart contract. Have you ever interacted with a smart contract?

A lot.

Yeah. Yeah. I bet you you did. Uh he's Catalin, one of the organizers. Um right so

one more time.

All right let me show you the um so here I have Ramix which is an IDA uh remote you can use it directly on the browser. Uh you have MetaMask which is an wallet um which you can use um you can use for interacting with uh decentralized applications directly on chain uh or directly on browsers. For example, this one um here you have some Sepia app it is a test net blockchain out for the Ethereum blockchain. Um so we don't spend real money to interact with this uh stuff. Uh you need some for the gas.

Um here we have a vending machine um contract. We had an analogy uh later on in the presentation where um you have a little piece of a little piece of solidity code. Um in here you would have um a public owner uh which is the owner of the vending machine. Uh this is going to be uh set in the constru in the constructor. Uh so the owner is going to be the msg sender uh which is the the the person who sends the the first transaction to deploy the smart contract and then we just initialize two items just so they be here.

Um all right. So us in our vending machine have a soda and chips. Uh we have um a mapping that is going to um store the items by the name. So we can also add more items if you want. Uh and then we have a structure which is an item represents an item.

Uh this is a structure. Uh I bet PRP used with it in like web two development and so on. um you have a price and a stock and here we might might add add multiple other uh fields for example uh an image URL or some description or I don't know um and then we have the item list which uh will um have all the all the names of the items that we want to add uh in our vending machine. So the items the products that we own right now or we use here we have different uh events. These are used uh after transactions they are shown on u on the blockchain uh and they are emitted uh there.

So you can on front end um like subscribed to one of the smart contracts or like to one to to uh yeah to one of the smart contracts and uh can get these uh events. uh so you can show beautiful uh I don't know uh front end UX experience it improves the UX experience uh because after maybe I added an item I want to also update my front end to show that item right and so on um then we have the add function uh add the item function uh we can see here we have an require which means that u um it's like a check if this check is not uh um okay then I will revert the transactions with the transaction with uh this message. Um all right and then here we emit the event uh that I said item addit uh this one. So um anybody would uh see this event on blockchain so we could update our front end UX. Um you can buy an item and uh then here we have more more checks but we might we want to have these checks before uh the before like um I don't know um subtracting the item stock.

So before we giving out the item we want to make sure that the user have money and so on. Um all right. So now we will compile the smart contract. Um and then we can deploy it. Um we we can inject the metam mask that I just talked about.

Um and now we are on sepoleia. We are going to deploy the smart contract. Uh which I am going to be the owner and I have to sign this uh transaction. we have to wait a little bit until it's deployed on the blockchain. Um and um we can write we can then go on sepoleia and check the transaction and everything that has happened on the blockchain.

Right now it's indexing but right in a few minutes is going to be all right. Now we can see that we have the deployed smart contract um where you can see the list of uh the items uh you can see who is the owner. These are are public functions so everybody can uh interact with those. However, um we might have like uh add item uh which is a function that nobody like except the owner can interact because I wouldn't like uh somebody uh external to go and add a new item that I don't own or so on. Then I can withdraw the funds.

Um right now there are zero zero eat. So I can't like I don't have what to withdraw. I only can do this if I am the owner. So it's normal because I don't want anybody to uh just check it and we check that with um a modifier that we have uh this one which um actually it's an access only to the owner. So it's some code that is executed uh for each function that we added this only owner modifier.

Um and uh here this is required as u from there so the code of the function the rest of the code of the function will function from there all right so uh now let's try to buy an item but maybe I want first to get the item price right we don't know how much is a solda All right. Well, okay. Now it works. All right. So, okay, we can see this big number.

We would say, "Oh my god, the soda is so expensive." But actually, um it's a price in way. And we is the smallest unit of Ethereum. Uh which um um which we interact with. So all the blockchain you're going to interact with way we don't have like uh decimals in blockchain.

um because like you can't input 0.1 it but you can uh describe that amount in way. So multiplying it by the 10 of the power of decimals we get this number and then we can uh say that we want to buy a soda right and now I will approve that I'm sending uh this amount of sepoleia eat to the smart contract so I can buy that specific item. um until the transaction is u confirmed. We can see that um this is the deploying uh transaction.

We can see uh multiple things here as the data that has been um uh inputed. Uh this is the smart contract data uh when we for when we uh deployed it on the blockchain. Um all right, our transaction now to buy an item has been happened. Uh it's a success. And here we can see um the function that we used um as well as uh different data that we sent.

We just sent soda because that's what I we wanted to buy. Um but you are going to see more Um all right you also have uh the logs the event logs. So um here are going to be the events that's are happening. Okay. And um now we can see here that the balance is 0.

001 it. And as I am the owner I can withdraw them. But let's say that I'm going to change the um my address respectively my um uh so let's say another user wants to connect to the smart contract and wants to interact with it uh he might want to withdraw my money but even though um we are being attention that is going to fail the transaction let's say we are still sending it this transaction is likely to fail because I'm not the owner I just changed users when I will try to uh withdraw it will of course fail because we have a require here to be uh when we withdraw to be the owner only owner okay it's going to be updated in in a minute but we can buy an item right but we have to send the right amount here so I will copy this amount and then I will buy an soda as a new user. or some user. I have prepared some tasks here that we could do uh like get an item, make more restock functions, add an item URL um or description contract pausing.

So when we want to vending machine to stop um however I don't think we have enough time, so it's just going to be questions if you have more. Um here we can see that uh the transactions to buy the transaction to buy on soda words um buy item and uh the soda and here it says not the owner. So for this withdraw function do you have idea why why here writes not owner

because it revers

exactly awesome so exactly that's why because we have this require this modifier which has this require uh if the msg sender is the owner um then it passes but if it's not we will revert the transaction with uh the not owner uh message. All right. So now if we go back to the owner, we can see here the balance of the smart contract has um has been updated. We have 0.02 and if we want to withdraw these funds, we can easily do.

So yeah, I just won 0.02 it on sepole testnet. Uh would you have any questions? Thank you. Now, I really like that example.

Oh, really? You love it. Thank you. Thank you. I really appreciate it.

Um, yeah. So, now we can see the balance of the smart contract has been um went back to zero and I got 0.02. It's uh richer. Thank you very much for attending this workshop.

Um I hope you like enjoyed uh and found something interesting in it uh and gave you a better understanding uh about like the an analogies different analogies that I used u uh while what a smart contract actually is uh basically an agreement on chain uh between uh peer-to-peer uh people. we eliminate the third party or the centralized authority so that uh we can interact uh decentralized with different people from around the world. Okay, thank you.

Automatic transcript — names and jargon may be misspelled.