The One Question bounty closes Thursday 10 December.

Join in
We Them Media logo We Them Media Support us

A Weekly Recap: What Cohort X Learned at Web3Bridge

The picture loads from YouTube. The player loads only when you press Play. Turn on captions in the player if you need them.

A Cohort X student recaps week six, mostly smart contracts. They cover why unit testing matters before deployment, on-chain versus off-chain NFTs, token swap contracts, an English auction for NFTs, and NFT-gated event contracts.

Not by We Them Media Channel: Web3Bridge. Published Monday 29 April 2024.

A weekly recap of what Cohort X learned, from smart contract interactions to decentralized applications, with standout projects and words from the participants.

Titles are the owner’s. It plays from their channel.

Transcript

This transcript may contain errors. This video belongs to Web3Bridge. Letters mark each change of speaker.

These are the speakers’ own words. We have not checked their claims.

0:07 A: Welcome everyone to week 6 here at Web3 Bridge, and once again it has been an amazing time learning, unlearning, and relearning. So this week we did a lot of smart contracts.

0:18 B: First of all, unit testing is needed in all smart contracts. It helps you have assurance, it helps you Keep sure of your functionality, that they are working this particular way you want them to work. So before deploying any smart contract, so

0:39 C: unit testing is just simply software testing method in which we test the functionalities of software applications.

0:47 B: By testing a functionality, it gives you full assurance that this is actually working the way you need it to work before deploying it to the blockchain. So

0:58 C: when you are building your smart contract, it is always very important to test for the functionalities of your smart contract, because once it is deployed on the chain, it cannot be changed. And you wouldn't want a situation where you, you write your smart contract and at the end of the day, when you, when you push it on your, on your, on chain and it is not working.

1:14 B: You can test the functionality, you can test the, the error message, the success message. Probably you can test to get result that your function, your contract is actually working This particular way you want it to work.

1:28 C: It is important for us to do the testing because we don't want disaster in our smart contract.

1:34 D: An on-chain NFT is an NFT that has all of its information on the blockchain. So it's the images, the metadata, everything about the NFT is on-chain and is different from a regular off-chain NFT in that it does not store, like I said, does not store its information on a decentralized platform like IPFS or Filecoin. But it's not very scalable and it's expensive to do because everything is on-chain. So the cost of like putting every single data on-chain is very high. So it's not as common as the off-chain NFT.

2:06 A: So a token swap contract is basically a smart contract that allows user 1 to swap token 1 for another token. The Ethers.js library is a JavaScript-based library that helps us in development lifecycle to interact with contract. It offers us a lot of very helpful methods and functions that help the development process be smoother, basically.

2:30 E: So the idea behind this English auction is about bringing multiple people together to bid for a particular NFT at the end goal where that particular NFT goes to the owner. This smart contract is all about having a group of people having a group of people bid for a particular NFT.

2:52 F: So the way this swap contract works is that I have like a pool in my smart contract where I put the token A and the token B. So users come to my smart contract or to my dApp and they click on the function to swap token A for token B, and from that contract I will give them like the opposite of what they want to Like swap, or a user comes, give me token A, and I check my pool of token B and give them that token B and swap it for my token A. So yeah, this, this is how like the general swapping works.

3:27 G: And what exactly is the NFT-gated smart contract? This is a contract that creates an event. It has a struct that takes up your title, your description, and also an array of addresses that, okay, you can inject some registered, you user addresses into it.

More from this hub

Something wrong, or a video you want off this page? Write to wethem.xyz@gmail.com and it is fixed or taken down within 48 hours.