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

Loading player…

Hedera Workshop - ETHGlobal Bangkok 2024

ETHGlobalThu, Oct 9, 2025, 12:00 AM

Join us for an Hedera workshop with Brendan Graetz from Hedera. Create a fungible token using Hedera Token Service. Create an ERC20 token using Hedera Smart Contract Service. Discover how these 2 services can interoperate. This is a hands-on session - all you need are a browser and a github account. ETHGlobal Bangkok 2024 was a 3-day hackathon that took place November 15 to 17, 2024, and brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com

Transcript

[Music] now the first thing I'd like to say is that this is a very long Workshop that's 1 and 1/2 hours long originally but we're going to cut it down to just 20 minutes because uh East Global has a fast-paced format if you'd like to watch the full thing which I just ran yesterday um check out this QR code I'll leave it up on the screen for a second it's a YouTube video which uh includes a talk about herera that is just covering the basics um and uh it's just it's a non-technical talk effectively right okay so thank you a few more of you have joined us thank you just scan the QR code you can watch that YouTube video um uh this this later on and uh sorry one more this is a YouTube video scan that as well and you can watch it later on um and I think I'll start now okay so I'll introduce myself hi I'm Brendan I am uh developer relations engineer at hadera and hadera is a layer one blockchain that is evm compatible but is also a superet of the evm because it has a couple of other things um a consensus service and a token service and the token service is something that we'll talk about today as well so I'm going to jump straight into the demo now if you have followed the link right you should end up at hadera hackathon resources as a GitHub repo I'd encourage you to read everything else but for now let's just go go to let's build and then open up this link hadera tokens c yoa tutorial and when you go there you'll come to this tab GitHub read me and this has been set up such that you can be productive and build something on herera within 5 minutes or 10 minutes um and basically everything runs in your browser all you need is a GitHub account so um open this in a new tab right and if you've never used git pod before what it is is a Docker account with very good developer experience right that's that's the way I like to describe it so spin up a Docker instance that's what it's doing now and then let me just make this a bit bigger hang on don't want to make it that big all right so once you've got here what you'll see is Visual Studio code and it is running inside of your browser so this is not your desktop Visual Studio code but everything is as you might expect in terms of the UI you've got your files on the left you got your file editing area in the middle and you got a terminal at the bottom now what the terminal is doing is it's saying I'm going to help you to initialize the end file and in the background it is also going to um install all the dependencies and run them for you so it makes development very easy so um I'll just show you what theend file looks like at the moment it's basically empty right and you can you can fill these in manually if you like um but it's far easier to use this script so enter bip 39 seed phrase hit enter default generate a new one number of accounts three default as well RPC endpoint default all right you'll set one up for you and finally um enter your operator account private key so operator account is the account that you want to run your scripts using so just hit enter to use the default which is the first one that you've generated from your seed phrase and finally we have this step over here where it's saying hey you need to use a foret to fund your operator account so that you can begin using transactions so let's copy that um address that starts with 0x your evm address and hold on command and click the URL foret hoda.com and that'll open up in a new tab so if you've used a foret before this the next few steps will be quite familiar to you so just paste your address here press receive button then press I'm not a robot just in case you are press confirm transaction and within a couple of seconds you should see hbar successfully sent right that means that the account that you have generated inside of the script is now funded with 100 harar hbar being the cryptocurrency on hadera and you can use that to do transactions um for example create tokens deploy your smart contracts um Etc right so once you're back here here just click in the terminal one more time press enter and then it'll do some stuff in the background it's uh basically saying hey I'm going to make a few more accounts and then I'm going to transfer an amount of H bar from the first account to the other accounts so that they are also funded so at the end of it it says okay so here is the proposed. end file just type y enter and this file updates right so of course if you're doing this on mainnet not a good idea to show everyone else but this is test net so it's not a big problem okay so we can close the dot end file and you'll notice over here this little uh popup what it's just telling you here is that you've run your own instance of an RPC relay that's your Json RPC endpoint it's running here in the background you don't need to care about it just FYI right okay now we're ready so there are three different ways that we can do a token and I'll try to get through to all three of them if possible but most likely in 20 minutes I can only get to one or two so here we go right so let's start with um token HSS this is probably the the one that most of you are familiar with if you're evm developers right so I'm going to run this script over here what I'd like to point out is that we're running on herera and I'll make this a little bit smaller just so it's easier to see um you notice that I am not using any additional libraries to interact with herera network that you wouldn't with an evm Network I'm using VM over here you can use ejs web3js whatever you prefer it'll just um work as as expected now um let's run the script so CD token um hscs and then run the script do/ script and autoc complete run that now I've set up the scripts such that um whenever you see one of these purple lines what that means is that underneath it you've got a file URL we just uh hold on command and click on it and then it'll jump you to the part in the script where that action is about to occur so it's kind of like a self tutorial almost the script teaches you how it uses itself right and so what this is doing is is Reading in a solidity file and it says okay I've read the solidity file now this next step is going to fail right um because we haven't compiled the solidity file yet but let's just see what happens so you should get an error now what we're going to do is run the solidity compiler I've set up a script for this um what was it compile dasmart D contract and then run that so that runs Sol CJs I would like to highlight that this is the same solidity compiler that you would use on etherum or any other evm network nothing special about it so now you'll see that we have an avi file right Json uh Json interface uh description of your smart contract and you've got a bin file which is your evm bu code right the same set of bite code that you would use on uh any other evm network now let's rerun the script right and this time we're expecting it to succeed So reading in a solidity file reading in the API so that failed previously now it's running right so we got a B code we've also got our API um read in now I was checking that our RPC relay which is over here is running so let's just do that so that was successful now we'll submit an evm transaction so let's take a look at what's going to happen here here right so this client is an instance of VM the evm um library right evm client library and you're calling deploy contract on it and passing in the ABI and the B code these two files and then you're going to pass in Constructor arguments right for symbol and name and then submit the transaction to the network so let's go ahead and run that and this transaction will take maybe a couple of seconds and we're expecting a smart contract to be deployed at the end of it now when the smart contract is deployed it will only contain the bik code um and you will be able to see it on a block Explorer right so this thing over here this URL hash scan. testet contract SL address let's command click and open that and we can see over here that we have the smart contract that has been successfully deployed and you can see it on the um Explorer now what you'll see here is smart contract by code not very useful it's not human readable so are there developers who want to interact with your smart contract you know it's a token but they may not know it's a token unless they know how to reverse engineer uh evm bik code or something right but we have a solution to that right so we're going to do uh verification so sourcify is integrated with herera on hashan and we're just going to call that and it says okay verification status is perfect because has used this metadata Json that is the output of the solidity compiler Okay cool so what we're going to do instead of the next step is we're going to refresh this and we can see the same smart contract again right it's the exact same smart contract but check it out right previously we only had buy code now we also have the source code so you can see the full solidity source code of this particular token it's a standard erc20 token and then you can also have an API and you can even interact with the API if you want to Via a form similar to how you do it on ether scan all right so let's go back to git pod and go back to the terminal so what's happening next is we're going to interact for the smart contract right so this is an erc20 smart contract that has been deployed we're calling right contract via the VM uh client Side Library saying this is the token smart contract address and this is an ABI I'm identifying the function as transfer and the parameters are the two address and the amount so I'm transferring 100 units of this particular Tok token via Smart contract call let's go ahead and do that press enter in the terminal and this will be uh also should take a couple of seconds but it should be slightly faster than deployment and there we go all right so we can see the transaction um if we want to in hashan so we can take a look at that so we can see that there has been a smart contract transaction and because it's been verified we can actually see all of the results over here let me just make that a bit bigger you can see the from and two address you can see the signature which was the transfer function and the input and the output you know so everything is is as expected now let's query the token balance so now we're doing um client. read contract so passing in the token address the token API this time we're calling balance of function balance of is a view function so there's no transaction that needs to be sent to the network and so this should be much faster press enter and you get 100 units as expected right um just note that JavaScript numbers go up to 2 to^ 53 um whereas uh un 256 is 2 to^ 56 so therefore we use need to use big numbers hence the end that's just JavaScript notification all right so how long did we take to do all of that like including the setup all the way through till completing the first task anyone want to guess 6 minutes all right I think you got a timer have you there you go it was 9 minutes and 8 seconds but this particular task took um 5 minutes so yeah somewhere in between so uh what I what I what I wanted to do here is that um I'm I'm in devl and one of the things I'd like to optimize for is a good developer experience and a good developer experience is a fast one fast and error free so less frustration so if you can get from nothing right all the way through to completing your first task in this case creating a token deploying a smart contract in less than 10 minutes hopefully less than five in some cases so if I don't have explanations maybe under five then you know to me that's a good developer experience but I think it's important that you also know exactly how fast you can be productive on herera so I encourage you to try this out on your own I'll leave the QR code up later on and let's see I might have time for the next demo so I'm going to be a bit cheeky and do two uh and I might get cut off um halfway through so let's see how it goes so I mentioned earlier on that there's a smart contract way to do a token which you are familiar with that was an erc20 token there's also a hadera native way that uses hadera token service right so these tokens are intrinsically understood at a protocol level they don't need to go through a virtual machine execution layer so no evm is necessarily involved right it just um and it's much faster and much more efficient because there is no intermediary there's no uh VM so what you'll notice here is that instead of using the VM Library I am using hashgraph SDK right so this is the herera SDK and it comes in JavaScript Java go and a few other languages that you might already be familiar with so I'm going to open this file now so CD do do/ token dhts and this time because we're short of time I'm just going to run through it really quickly um I'm not going to do as many explanations so over here I'm going to create a new token create transaction and this is this is it this is all the code that you need to create a transaction that deploys a smart that that deploys a token no smart contract involved just one JavaScript function with change methods with the configuration parameters that's it I I'm not I'm not like uh hiding anything this is the entirety of token creation right that's presenter okay next one is over here we're going to sign the transaction and then we're going to deploy it uh send the transaction to the network all right and there we go we have a token right no uh no no smart contract was involved there's there's nothing uh hiding that it's just all in the SDK so here we have a fungible token with all the parameters that we've configured and we have balance in the one account that we um that we have the operator account now we're going to do something called token Association this is just an additional step you can't just transfer an HTS token to any random address it has to allow uh it to be transferred to it so that's a bit different from erc20 tokens which are you know they don't require that white list all right so we'll submit the token transfer transaction okay so now we've transferred the token as well and let's check it out right so we've got a transfer and we can see over here this is transaction fees essentially and this one is a token transfer we've transferred 100 units of the token with two decimal places so you know from this account to the other account and the transaction has been successful now let's take a look at how long that took us right so the total time that we took for both put together is just under 13 minutes and this HTS one actually just took us just over 1 minute that's how fast it is right um cool I think we might actually have how much longer sorry oh amazing okay so one more thing that I can demonstrate I might go three for three okay CD do do/ um token interrupt right this one has to be really fast this is this is more advanced right so I'm just going to go ahead and run this script right now you notice here what I'm going to be doing is interacting with the HTS token but without using um without using the herera SDK I'm using VM over here so I'm using evm tooling to talk to my HDs token to demonstrate interoperability sorry do/ scripts and run that right so reminder you have to do the previous scripts before before now obtain the evm address which we have saved before load the ABI um check the Json RPC endpoint um and then now we submit an evm transaction so now we're using VM and I'll show you what this looks like right we're using right contract from VM and somehow we're interacting with a Hader native service and it actually works right now let's query the token balance and previously we had at a 100 now it has 200 and it's complete and let's see that took us half a minute right so really fast now um how did that work behind the scenes right um let's see this is a bit this is a bit Advance this is hadera Improvement proposal similar to EIP and you can actually it does something called a proxy redirect facade but what that means is that if you're more comfortable with using evm developer Tools in clients side libraries you can still use HTS and it works seamlessly that's that's effectively what it I think I actually finished everything I wanted to demonstrate today so amazing do we have time for questions questions yes what kind of sorry indexer okay so the question was what kind of indexer does herera use um so it has something called a mirror node and the mirror node uh basically takes every transaction and it indexes it you can think of it as equivalent to an archival node what's interesting about herera is that it doesn't have uh the main nodes that execute they only keep state for a few minutes and then it discards everything else so the mirror nodes pick up the entire State and keep it so the consensus is different from complete State yeah so that's your that's effectively your indexer now you can also build third party indexes on top of that and some do exist um but maybe we can discuss that after this talk do we have another question all good amazing thank you very much [Music]

Automatic transcript — names and jargon may be misspelled.