OpenZeppelin Contract: Past and future roadmap
ETHCC 5 · July 2022 · 25:06
Hadrien Croubois reviews OpenZeppelin Contracts developments in governance and cross-chain operations. The presentation also examines the future contract-development roadmap as it stood at EthCC[5].
Speakers
Topics
From ETHCC 5, hosted by Ethereum France.
Transcript
person or remotely for those that are watching the stream uh hopefully for you it's not that hot i'm adrian i work at open zeppelin on the contract and i'm here to present you our roadmap both for the last year basically do a retrospect of what we did and and have some ideas about what's coming up next so first opens it at opens up and we have this thesis that we are all here building a very big like trillion dollar economy that's going to be powered by blockchain and smart contracts that include ethereum but also other chains possibly and this economy will be built by team like you using tools uh like possibly opens up in contracts or other and so at open
zapping we want to build the tools to empower the developers the creative minds to build this new open economy and we do that right now using like three big aspects which are all audits that i'm not going to talk about that that are important which are here to secure the open economy and that also that are already securing a lot of value on chain and we have a product that as a developer you can use which are opened up in contracts and defender now i'm most specialized on the contract side but i also mentioned defender because everything works together here and we are obviously available for ethereum mainnet but you're also targeting an increasing number of networks including non-vm networks like starkware so contract we released our latest
version a few days ago it's 4.7 but over the past year like we have a lot of version and a lot of growth this is numbers that we got just from our npm stats and there is like a very big increase and those numbers are like weekly download or monthly download i think so they're not just like like developers because there is no way we have five hundred thousand developers building on opensupply contracts but this gives you a trend on how this this economy is is growing right now and it's growing for our contract but also for our upgradable contracts and our upgrades plugin that i'm going to mention later it's not just us there are a lot of other relevant projects in this space in the open space thanks to transmission
for making me changes like just today because it changed the name of the repo this night but yeah there are a lot of other projects and you might be a lot lost in this space and i would not qualify those as competition even though it might be seen that way a lot of these projects are very complementary to what opens up in those in particular prb mass this is an amazing mass library that works very well in conjunction with with open zeppelin and and there are other projects that you might be interested in and the very important thing here is to understand what the philosophy of these different projects are and how they would match or not match your your practices and your and your objectives at open zaping we really focus on security that's obviously our main point we have code that has been here for a
long time we are battle tested that's one of our strong points but after security we really focus on extensibility customizability customizability readability and auditability that means that if you are someone like the ens and you want to build on 721 contracts that you want to add additional features because you're managing a registrar or something like that we want to provide all the tools so that you are able to customize the behavior and you we want to make sure that you will keep as much security as possible as you add features to your contract so we are really not a contract that you are supposed to deploy just like that without modification you could do that but we want to go way further than that obviously we don't want to compromise on performance gas is still a
strong point for us but it's not just the way we want to be judged it's gas it's just one element guesses are just one element of a complete system of addressing the need of the developers so about security this year we started working with sertora on an audit of oral contract or for 0.4 uh 4.0 version contracts and this includes a formal verification of contract including the governor that is one of our latest addition but also other contracts like the erc20 for voting and that kind of thing so we take security very seriously and we also have a big bounty because when you can add security on top of security that's also good
and we awarded a few bounties just a few weeks ago like i think so so it's never a big security flow that we find hopefully but as we care about security we care about the community being able to provide feedback and being incentivized to provide for providing feedback the right way so feel free to check out our code also whenever we're releasing a new version just before the release there is a release candidate phase and during the release candidate phase we increase the bounties so that's a very good moment as community members to check out our code and and check that there is no issues and that goes with the community code like it's part of it it's involving the community we want feedback we want you to require features we want you to
say features are not what you want and you should possibly change you want to engage to engage in discussion to review code and we will reward you with git co-app tokens for example laws are one of the things that that you could get by here maybe it's not as good as money but it's it's really shows that you are a good member of the community possibly a good open zaplin gitpop token might get you a job someday so let's go over some key features that that were implemented this year the first one is open zeppelin governor this was in version 4.3 and basically it's a modular governor that is based on compound designs and that works with many kinds of tokens including erc20 and erc721s with the
voting module we now have it supports time lock as an option both compound time locks or open zipline time locks we use we support component time lock so that it's easy for you to migrate from a governor bravo or governor alpha to an open zipline governor using your time log that has all the assets and the restrictions uh grant grants and yeah it's designed to be really modular so basically you can start with the basic boilerplate and then modules on top of it and yeah ens domain is using it and there are a lot of instances on mainnet and possibly also on other networks then there is the voting things voting is important but we don't want it to be just restricted to erc20 so we made an abstraction which is a votes abstraction and and it's very easy to implement it
on top of erc 721 so you can just very easily create a 721 tokens that allows the user to vote with their token just like they would with erc20s and be able to delegate them the same way so it's something we're exploring we'll go further we have plans but yeah plans are for the next slide and there is a crushing enable part that we introduced in 4.6 which is our first step toward more cross-chain aware contract basically building crushing applications is super hard and at open zeppelin we want to to do some of the abstractions so to do some of the work basically to build the tooling you need so that it's easier for you and you can focus on your business logic on on your code on what what is about you and not about like the broader
ecosystem for now it's mostly about receiving but we want to engage in more discussion to make it about emitting uh signals and when we'll have emitting and receiving we'll be able to build a lot of abstraction like erc 20 bridges or something like that so yeah this is one year feature uh there's quite a lot of things we've seen the governor there are 620 votes and the quotient enabled there are other stuff like we implemented four six to six we had one of the implementation we improved or investing wallets we improved our upgrade ability mechanism we added also low level utilities like double ended queues we added more mass we are nowhere near prbms but we still have some mass in in in open zip in contract to edit stuff for nfts we have an upgrades plugin that
is increasingly uh feature-rich so try it out and the idea is that we basically try to address all the needs of the ecosystem whatever you're building possibly like you could use or contract and if something is missing like as long as there is a strong use case behind that we will possibly build it if it can be reused by multiple teams that's being said and we also build the contract wizard and the idea with the contract wizard is that this is a great tool for you to start building a contract you could be lc207721 but also governors and it will basically create the code for you for like the simplest use cases and once it's built you can export it to remix or just download it and build on top of that so like if you want to do a governor start that way and and build on
top it's also a very good learning or teaching tool because it will address most of the issues that come with solidity08 in particular like having to override some function and sometimes people don't know how to override and how it's working and here by just clicking and clicking option you'll see the code change this is override appearing and disappearing so if you're a teacher in solidity that could also be a useful tool not just for creating contract but also for for for teaching and for having more people come into this space uh our objective for next year are as always we have a lot of ideas we have some ideas that are non-breaking change that we can achieve very fast or not very fast but decently fast and we have more braking changes like using
timestamp in instead of block numbers in in tokens and in governors that's going to require major changes so basically it will possibly be delayed until the next major version when we will be able to do breaking change because we don't want to do breaking change in minor versions we are not yet sure when uh 0.5 will be available but hopefully by this time next year it will be live for long and we will also to engage in more more developer tools we have an access control explorer that is like a ui to better understand access control that's coming up uh or upgrades plug-in will be improved uh continuously we want to transition that's also part of zero point of 5.0 to to diamond storage this will make uh upgradeable contracts
easier to manage it's been a bit of pain lately and we're always interested in participating in discussion like discussing erc discussing token bridges like voting interfaces so so whenever you're feeling like there is a need in this space for standardization and people should come together uh we will never i mean post not never but we are not unlikely to implement something that is not finalized and not doesn't have consensus in the community and we don't really want to be the one that are pushing towards consensus but we still want to be part of this discussion and provide uh insight and possibly prototypes and and the earlier we are involved in this process the the better it is we don't want to be leading this
process because this is a community process maybe in some cases we will lead it but we definitely want to listen to these conversations no cairo as i said we are not just targeting avm blockchains the very big news this year is that we are now providing smart contracts for cairo for the start net network and basically for now it's just taking what we have in open ziplin contract and porting the most like useful and commonly used features uh but also we are very much involved in icon abstractions so i can we provide icon contracts and and this will just expand and you can see what we already have but this is growing very very fast and and we have the wizard for cairo so if you don't know cairo and you want to
learn how to build a smart contract in cairo and you also want to learn about about the specificities there is no override system in cairo it's a bit different but like we have the wizard so again good learning tool if you want to get into cairo check it out it will definitely not be enough for you to learn cairo but it it will be one of the steps that you want to take and known to defender so as i said it's not just about the contract it's also about helping you interact with them we have the upgrades plugin for that the great plugin helps you like do upgrades in a secure way and we have defender which is our like online tool and defender is obviously supporting the open zipline contracts so we have a lot of features that are already supported
like from defender you could create and open the plain timelock you could just like have this amazing ui just like do like if it was like point and click stuff and create a time lock and this will deploy an open spring time lock which is compatible with all governors um we are able to do any any calls to any functions obviously as long as we have the target apis and defender will manage relaying these goals through hypnosis multisigs through governor through time logs through everything so if you have like a governor that is using a time lock but only a multiseek can create proposal like you understand that creating a proposal can be complex because in the end what you want to do
is like update some contracts but what you need to do is create a multisig proposal that will create a governor proposal that at some point we'll get into the time lock if it's successful and before it's executed and if you want to create all that by hand it can be painful like like encoding your function selector can be painful defender will take care of all of that for you and will show you that hey in the end what's happening is there is a transfer of ownership so like if you are into this kind of processes where you want to do upgrades and and maintenance operation even if you go through a multi-sig diagnosis yeah try out defender it's a great too you could also do contracts upgrade like you could also plan an upgrade to go to all that in addition to planning the
execution it will also check that the upgrade is compatible which is always a good thing because storage conflict can can ruin your day we've seen that happen obviously pause and unpause is something pretty simple but yeah you can you can do that you can unpause and pause so here you see like it's it's going to to make a mask and what you are signing is just creating a proposal on on on anagnosis or accepting a proposal and agnosis so so it's nice and and we have more features coming soon um we want to be able to batch transaction both uh using the the multiple mechanism that is in an open zipline contract so multicore is just a contract you can inherit from which will provide multiple abilities so that eoas can batch transactions that's pretty
nice but it will also provide multi-course mechanism through hypnosis or other approaches when they are supported we want to improve the support for access control in the in defender access control is in my opinion the better option than own ability because when you have a contract that is ownable there is just one owner with access control you can selectively say who is like a mentor a whitelister an admin that kind of things and in defender you'll be able to check what is the current permission of your contract and be able to update that in again a pretty like user-friendly way like hey we are granting the white history access it's it's pretty clear and and and doing transaction in admin
uh there is a lot of stuff coming up and if you're you're uh yeah yeah verifying deployed code there is more verifying people code directly so we want to build tooling so that whenever defender sees a contract it's able to identify which code was used and possibly get not just the api but also have a better understanding of what versions of the code were involved with that if we know what version of the call is involved we're also able to to give security warnings in case some contracts end up being vulnerable at some point and and we have a fix we could even propose and upgrade directly so yeah use defender if you want to be safe yeah user roles and permission like hey we want to have more granular access so that in the web 2 world you have your
team has multiple accounts that you restrict who can do at on your on your platform and uh yeah for you guys that are possibly like like dev uh like like infrastructure developers uh all the the features or defender uh will be available through mechanism like terraform or serverless so you'll be able to configure your your your context your execution your account in a repeatable way so that you can really smoothen your your processes and and basically like all the good features we showed you through clicks you can also automate through scripts that's basically the idea here are the links that you may want to
check out open the plain contract obviously but the docs the form go directly to defender most of you might be familiar with these links already and has i guess everybody here we are hiring so if you're interested in building like amazing tools to secure the open economy feel free to contact us we have some recruiters on site that you can just chat with whether you're decided you definitely want to join or just you are like considering and want to learn more about the company feel free to send them an email they're here for you yeah that's it and yeah we have plenty of time for questions [Applause] yeah i'll put that on the screen
education hello thanks for the talk um i have two questions my first question is about upgradeability which i have like philosophical issues with and i'm wondering like how you guys think about upgrade like you do a lot of it at open zeppelin and i'm curious if you're thinking about trying to do it differently maybe in a way that's more like immutable versioning rather than contracts with the same address that change so like what is your stance on that over there so upgradeability is a feature that some people think is a bag definitely it has to be taken with a grain of salt and it
always has to be addressed properly for example that's also why we have defender when we want to do an upgrade we think you should not be able to upgrade on your own they should be possibly at the ao at time basically using the ao plus a time lock to me is a better option you have your community voting on that and the time lock ensures that whatever happens people have the time to exit before the upgrade happen now obviously it has a layer of risk which we try to mitigate and as much as possible using the when we're exploring now because of the upgrades plugin basically what the breadth breaking does is it checks the storage layout of the previous contract and the storage areas of the new contract it verifies that it matches so that you are not overriding stuff or reading from the wrong places
to make sure that the logic continues to work now this has to be combined with obviously an audit of the new code to make sure that it behaves correctly there are other approaches to i mean all proxies are just like they redirect the entire course to a single contract and the reason we do that is because it's way simpler for us to provide these security systems levels when basically we move from one implementation to another we can just compare the implementation and it's decently easy to say like hey somehow the risk levels are limited if we were using something like a diamond proxy which are amazing by the way but if we were to use diamond proxies it would be way more difficult to check storage compatibility so one step we want to do is we want to
move towards still using like monolithic contracts but using the storage layout for version 5.0 and designing tooling that is able to verify the consistency of the storage layer that comes up with once we have that we may consider proposing a diamond proxies or other protons like that but i mean it's very easy for us to just implement a dime approximately we have prototype for those and shift this but we don't believe we have the tools that the users require to make that i mean if you're an advanced developer and you know what you're doing you can already do it like it's not that hard it's more about like providing this tooling in a very easier friendly way for newcomers to this space and and the
diamond standard it's still decently difficult to handle if you're if you don't know what you're doing so something we want to come to but yeah i understand the tension is kind of hard um my second question is thank you my second question is the left hand completely different i didn't know about the the access control the acl roles things you do which is super cool do you know of any applications like widespread applications that are using this that's a good question uh i know a few a few contracts that uses it like the example we have with the whitelister and the mentor too this is a real application that lives on mainnet but yeah i mean yeah it's a good question i mean also opens up in contract time lock uses access control under the food there
is an admin role an executor or a proposer that kind of thing so that's also an example but yeah and we want it to be more widespread and that's also why we will dedicate more resources to provide tooling so that it's easy to to understand because i know that will contract you just don't need to scan you click owner and that's it here it's more complex they need to be more tooling but we have some graph to explore access controls and we'll have uis on top of those sub graphs at some point we'll have better defender support so yeah it's it's mostly about tooling we think adoption is not just about providing the contract it's also providing the tooling to help people interact with the contracts yeah that makes sense yeah opens up in contracts we are not just doing contract like over half of our
bandwidth is dedicated to tooling that go with the contracts thank you very much hello hello thank you for the talk so i have a question regarding to the small contract specifically i noticed a lot of open sampling contracts are optimized for security we have extensive uh error messages etc but less so for guest optimization have you guys thought about creating a suite of contracts you know from the current ones to focus on gas optimization we've discussed that and we decided not
to do it and maintaining the contracts plus the readable version is already a lot of work our goal is not to have five different flavors of contracts that are optimized for five different objectives and and as i said there are other projects in this space that might have incentives that are more in line with you now that's true that the fact that we use reverse string for example this this consumes a lot of gas and we want to have i mean we have custom errors that are in solidity since like zero eight four so we want to use them widely the reason why we haven't like generalized the use of of of customers and you've seen it on our roadmap it's because we feel the tooling is not available i mean we want in each other scan to be able to see the
customer and what it is because initial scan you can see the stream now if it's just about that you can also configure the compiler to just throw away the the reverse strings and that will decrease your gas because you just have to know how to configure the compiler now about wider like gas optimization uh we are we are really looking into the to the gas cost and we're comparing our gas costs to other actors in this place some people think that we are way more expensive that's not true we are a bit more expensive not that much but we are a bit more expensive now if the reasoning is yeah you could just use hundreds of lines of assembly that nobody understands and if there is a bug nobody will see it on this until a hundred million dollars vanishes that that's not our high levels of you if you
want to do that go ahead i personally believe that the effort is better should better go towards optimizing the compilers and writing assembly but that's just me but yeah now we want the code to be extensible to be modifiable and to be readable those are points we don't really want to compromise on and that's true that sometimes it means that yeah we want someone to be able to override this function this means in this other function we need to do a check that we could otherwise not do but for the security of everybody we think it's better i mean when we're more expensive it's sometimes a percent or a fraction of a percent we don't think compromising the security is worth that much uh and again like we think security is more important than
gas that's that's one of the key things and and at some point our contract will be on l2's places where it matters a bit less that doesn't mean we want to waste gas by any means but we're not going to yeah other projects are doing that we have different routes and yeah you have you can choose yeah i think that's it if you have more questions you can just see me anytime this week or go to our github race question of the forum race issues that kind of things [Applause] you