Bunzz 🛠 Intro to Bunzz

ETHGlobal Tokyo 2023 · 12 Apr 2023 · 19:00

Trust Onyegbu of Bunzz walks through the Bunzz smart contract hub, which offers reviewed contract modules and a graphical interface for deploying and managing contracts on EVM chains. The demo explores the template explorer and documentation, deploys a simple ERC-20 token to the BSC testnet, copies the ABI and contract address into a React boilerplate, and mints tokens both from the app and through the Bunzz interface.

Speakers

Topics

From ETHGlobal Tokyo 2023, hosted by ETHGlobal.

Transcript

Building dApps have never been this easy. All right. My name is Trust Onyegbu. Developer and ecosystem at Buns. I'm excited to have you join us in this virtual workshop. We're going to take a dive deep on how Buns can simplify dApp developments and save you development time to launch and deploy smart contracts in 5 minutes. Buns is a smart contract ecosystem. A smart contract hub with all the 40 modules combinations across different use cases, supporting 100 EVM-based chains.

So far, we've had 8,000 or 5,500 deployed smart contracts. As a developer wanting to build blockchain applications, Buns ecosystem gives you access to over 100 reviewed contracts. Simplify development via a GUI on any EVM-based chain. Allowed you to manage your dApp, interact with your deployed smart contract easily via our easy-to-use UI. Buns supports popular contracts.

The Buns smart contract modules are being combined for different use cases for NFTs, for DeFi, ERC-20 tokens across ICOs, staking, and even DAOs. The Buns ecosystem supports EVM-compatible chains, Ethereum itself, Polygon, Avalanche, and so many more, giving you a wide array of your choice to deploy contracts and dApps on your preferred blockchain.

We're feature on different media, supporting a partner of communities, support developers to drive. Now, let's get started and take a dive deep on different parts of the dashboard to see how funds can help you as a developer simplify and attribute better dapps. The first, let's look at the explorer. The explorer gives us access to a number of available expansive model templates.

We can search the templates. We can see the name of the templates, the date it was launched, an overview of the templates, and who created them. Let's take a look at the payment splitter. If you click on the payment splitter, it takes you to a documented the documentation page for the payment splitter contracts. Allow you to see how to use it, the model parameters available, the functions, events, and the code. There's a change log and a position system to see previous changes and edit updates made on the smart contracts.

How to use this an overview and how this smart contract can be used. A guide by guide step to help developers use smart contracts and interact with it in their preferred web 3 library. The functions gives us the function available in the smart contracts across read and write functions. As you can see, clicking clicking on each of the functions gives you access to see the name, the type, and description of the function. Code, clicking on code takes us to overview of the code used in the smart contracts.

Now, payment splitter. Click on the payment splitter solidity of sole gives us access to call to see the code written that makes up the smart contract. Let's see the functions that can help you to view and check the code. Very soon, we're going to be launching the customized feature to allow you to customize the score the ID and add other features and increase the capacities as you see fit. You can share the contracts and share on Twitter and of course deploy.

Let's take a look at the documentation of Bonds. The documentation of Bonds gives you a more clear overview on how this can help you to build your dApps better. The image description of the Bonds platform. So, what Bonds get us started, the fundamentals. Smart contract help, how to interact. Smart contracts deployed on Bonds can be interacted using ethers.js, web3.py, web3.js or any other preferred library that you would like to use.

You can see the documentation guide on how to call and interact with the smart contract, connect your wallet and sign it. Boilerplates are very crucial to Bonds. We want to give developers a head start so that they can use Bonds to quickly build dApps as they see fit. We're going to be taking a look at how to launch a token, ERC based token, with the boilerplate and launch on on the BPSEBN and the BSC blockchain rather, using Bonds.

So, let's go back to the Bonds landing page. We can log in. You can sign up as you see fit. I've already logged in, so I will just log out for here versus So, yeah. So, already I can log in here. Okay. Put in the password. So, we are logged in to the Bounce dashboard. Because I'm not a first-time user, there are different dapps already in my on my dashboard.

But if you're a first-time user, you're definitely going to see the create dapp card. So, let's create a dapp. Clicking create a dapp takes you to the setup page. Since you're launching a crypto token, we're going to name it Trust, and so let's all launch the Trust token. And I'll simply say Trust token. I already have it there, but let's ignore that suggestion. So, Trust token. The next is to select the network name.

There are different options from mainnet to testnet across different EVM-based chain. Well, let's use BSC. Click next. Clicking next next and we to select the smart contract and what do you like to use? The same as you already know we want to use the ERC-20 token smart contracts, we can use this. But before we get that, these are Bounce models developed by the Bounce team.

These are also by the Bounce team. Now, all tab shows models smart contracts developed by the Bounce team alongside external developers. Of course, contracts have been reviewed by experts, but they're all in the all tab. But smart contracts are by the Bounce team and I'm following on the Blocks models are the bread templates. Let's quickly use the simple token to create a simple ERC-20 token as the use case. What's the name of our Trust Token?

What's the symbol? I'll call it CT. Okay, that's CT case for Trust Trust Token. Okay, for the token there, right? So, let's deploy. Deployment is a lot a lot so simple. Connect to MetaMask. Okay. So, I have not logged in. So, I'll do that quickly. Connected. So, let's deploy. Sign. Okay. So, transaction confirmed.

ERC-20 token to the BSC test net. What was the next thing to do? Now, we have been provided with the ABI and the contract address. It's very critical to interact in smart contract on your front end using any of your preferred library. There is a manage contract button, which gives you additional capacities to work and manage your smart contract. You can see the rights and the read function of these smart contracts.

And you can play with these the functions, interact with the smart contract using GUI. Similarly, what you have in Remix, but of course has a much broader explanation each of the functions, descriptions, and you can walk around it. And the rights are read with the GUI provided. They're already. We have the verification tab, which allows you to copy and use play information to verify the smart contracts in the block explorer of your choice.

Let's interact using the boiler plate provided. As discussed earlier, the boiler plate allows you gives you a quick start to building dApps across different use cases. We have the boiler plates for ERC-20, NFTs, mint and siphon, others are provided accordingly. Let's click on the token ERC-20. It takes us to the GitHub repo for this. I will have to simply clone this repo to our local directory, either using the Git command line or downloading the zip file and unzipping.

Let's download the zip file. I will unzip. So, we have to search OpenZeppelin and we locate the ERC-20 mint and boiler plate. We open it. Voilà. Let me make this bigger.

Close all this tabs. Fantastic. This is how it's going to be when you clone the ERC-20 mint and boiler plate here or IDE. We use the code in your preferred IDE that you you use. The first thing would be to install the NPM packages. Yarn install. Okay, they're already done. But if you the first time for you to clone the repo, you have to do that so to download all of the street packages needed for this.

Now, because I didn't provide it for us, we have to do two things to test our development and you can now edit and customize the same feedback on use case. The first would be to take a look at the ABI that JSON file. Remember that we haven't provided with the ABI of the smart contracts. We have to copy the ABI. Return back to the VS code. Delete the previous one and paste the one just copied. Because it can is difficult to read so we have to format it.

Yeah, much better. So easier to read so I'll save it. Second file we need to take a look at is dot EMB file. So we have to create a dot EMB file if it is not already done. That's dot dot EMB. Which is already here. And this are the two things you need to input. The React app chain ID and the React app's contract address. So the app is a React. One important is the contract address and the ID and the ID chain ID.

Remember that we deployed this on the BSC testnet and the BSC testnet chain ID 97. Hence we have 97. And we have to copy the smart contract address and replace what we already have here. And save. Once you've done that, it's now time to run. Of course, you can take a look at the other codes. The file that handles the minting button and the function involved in that and the progress message and the success message that pops up.

The app.js gives us access to the chain ID, the wireless connection functions, and the others. So, you can take time to go through the code and it takes an input into your own use case to build more user with that. Let's run this and check how this looks like. That will be here and run stats. Okay, let's take a look at rate thousand.

All right. So, this is how it looks. Yeah. To connect our contract. So, we have connected the contract. Brilliant. So, we asked to mint the contract. Now, let's confirm. Let's take a look at what we have. Let's copy the contract address and head over to the BSC blockchain explorer. Let's take a look at the beer chain. Okay sorry. BSC scan.

Guys, we're meant to be the testnet. This is actually the mainnet. Uh BSC. That would be testnet. Yeah. That's BSC. So, let's input the contract address we just copied and check it out. So, balance is zero. Or it's has been confirmed created. So, it's confirmed created. And a few events.

Okay. All So, this head back to or plum. You take a look at the contract interaction which we got from clicking on the manage contract. To test if this work, let's mint using the GUI. So, to be receiver here, let me just put 50.

This is 500,000. The tokens receiver. The our smart, sorry, our address here. So, put this here. And mint. So, what are the gas fees? Yes, I'll pay that. And it's going. All right, correct. Minted. So, you click on this bar success. So, the trust test token. STC and we have 0.05.

Okay let's only did that by sitting here. Pick one address. This mean to sell means it go for TCT. Which is the our token we deployed areas one address. So, this is how you can play around this. And you can do the same using the code. Uh you deploy it from your ID USD code. You can also do the same using the GUI here as well across posting, contracting, balance of allowance, you can revoke contract transfer, ownership, and post minting operations

as you seem fit. But this is you can look at the documentation for more use case. It gives you more clearer output on how you can simplify, how you can do better, how you can interact in different models, and of course take a look at uh the many models available across different use cases. They can launch on the market market tree app, the reflections on H code in case you want to build a freelance service on the blockchain with H code payment feature, just like you have my freelancer that's common on Fiverr and Upwork. The best one is contract and it's maintained.

There are reactors for NFT supermarket place and so on and so forth. So you can take a look and explore and deploy the smart contracts. Copy the ABI and the how to call it address key um call it address I've put into your front end to integrate as you seem fit any of the libraries available. We are keeping updating We're continuously updating the smart contract hub with new smart contracts for more new use cases across different applications to help developers build more dapps as you seem fit. Any questions you have you can drop this in the comment section. I'm very happy to connect or you can

join on Discord and ask a question or the community of developers on Discord as well. We can be happy to help you build and help you ask your questions as you come as well. Thank you very much and we can't wait to see what you will build using the Bluzelle smart platform.