The One Question bounty closes Thursday 10 December.

Join in
We Them Media logo We Them Media Support us

Web3bridge Students (Cohort XI) Share What They’ve Learned: EIP 2535 Diamond Standard

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

A Web3 Bridge Cohort 11 student explains the Diamond Standard, EIP-2535, which lets developers update a smart contract after deployment through facets behind one address. The benefits include one address instead of many redeployments and getting past the contract size limit. Aavegotchi and Decentraland are named as users.

Not by We Them Media Channel: Web3Bridge. Published Wednesday 1 January 2025.

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:00 A: This video is proudly brought to you by Breakthrough Bridge with LIX, our official sponsors for Cohort 11.

0:08 B: In this video, I'm going to be talking about

0:12 C: EIP-2535 Diamond Standard.

0:15 D: Diamond Standard is a finalized Ethereum Improvement Proposal. Its aim is to help smart contract developers to be able to modularize and update that smart contract after deployment. So basically, smart contract on blockchain, its whole essence is to be tamper-proof, meaning immediately it's been deployed, you can't update it. And what happens when there is an error? It means that either you delete it and update and deploy another one, or you manage the error like that. And this is a limitation. So Diamond Standard helps to update the smart contract. How this works, it's more technically- Diamond, it's a contract with external functions that is being supplied by contracts called facets. So facets are independent contracts that can share similar interface libraries and state variables. So when it's- so with Facets, you can write to Diamond. So Diamond is like a mother contract, it's like a proxy that can be used to interact with so many contracts.

1:43 C: One of the motivations for Diamond contract is a single address for multiple contract functionalities. For instance, I think this past week when we were working on the mini project, I think for every upgrade that my team was making to the smart contract, to what we're doing, they had to deploy a new address. They had to keep deploying addresses, and we had to keep changing addresses and changing ABIs. And so With a diamond contract, you don't need all of that. You just have a single address and then the different functionalities are then extended through that contract. And then, so there is no need for multiple addresses. You just have one address to manage all the different functionalities. And then the contract size too. Another motivation is that the contract size can then exceed 24 kilobytes. And so instead of having one very large contract. You can then have contracts that are broken into different, what we call different facets, or different facets. And so those different facets now all extend the functionality of the Diamond contract. There's so many motivations to using the Diamond standard, and what I just listed are a few of them.

3:05 B: The use cases are like the companies that are using it. You have Decentraland, We have the Aavegotchi and so on. So I'm going to be talking about Aavegotchi. So Aavegotchi is actually like a gaming company where players actually interact with NFTs, and these NFTs, they are backed by the AAVE token, AAVE token. So that's it. So now the reason for this diamond contract is for the con- the company to be able to like upgrade, you know, smart contracts. They can't be- like, the general knowledge is that when smart contract has been deployed, it can't be changed, right? So now the reason for all this contract, this facet, it is, it is, it is, it is, it is- the reason is because, like, so that we can actually make changes to the smart contract. Now, now, example, the game logic, the NFTs, and so on. So these things, now if they want to make contract to it, so they're going to make contract to the facets. So these facets is what make the contract to be upgradable.

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.