ecosystem-contributions icon indicating copy to clipboard operation
ecosystem-contributions copied to clipboard

✨ Contribution Opportunity: Bedrock Contracts Architecture Diagram

Open smartcontracts opened this issue 2 years ago • 10 comments

What is a Contribution Opportunity?

A Contribution Opportunity is a concrete task that you can work on to contribute to the Optimism Collective.


Summary

The smart contracts for Optimism's upcoming Bedrock launch are now code-frozen. Currently, our existing architecture diagrams for the Bedrock smart contracts are out of date. OP Labs is looking for a contributor to create a high-quality architecture diagram of the Bedrock smart contracts that would make it easy for someone to understand how the contracts interact with one another.

Impact

Architecture diagrams help developers and OP Stack chain deployers understand how the various smart contracts within the Bedrock codebase interoperate.

Resources

smartcontracts avatar May 23 '23 18:05 smartcontracts

I want to do this! Planning to make it an interactive SVG so it can be embedded anywhere but lmk if you had something else in mind @smartcontracts

I'll make a rough outline to run past you before starting the SVG stuff

gigamesh avatar Jun 08 '23 14:06 gigamesh

Here is what I have in mind...

  • Each contract will be clickable, and clicking will show a tooltip with its description, maybe some additional info (ex: if its a predeploy or upgradeable) and a link to the solidity file.
  • At the top there will be different transaction scenarios listed. When each is selected, arrows between the contracts showing the respective code path will be displayed and the unassociated components will become disabled (see image below).
  • I plan to also add some animation to make things more clear. Might be cool to pop up the function & event names as they are called, and add a little clock to explain timing details.
  • I’ll put it all in a repo anyone can contribute to, and deploy a live version.

I might need some help understanding how GasPriceOracle & the fee vault contracts get called. I'll wait for any feedback before I continue. :)

Frame 1

gigamesh avatar Jun 09 '23 06:06 gigamesh

I'm Gerardo, a Solidity developer at BootNode. We're interested in getting closer to the Optimism ecosystem, and we thought this task represented a great opportunity for us to gain a better understanding of the architecture of the smart contracts and make a valuable contribution.

Here is a diagram of the bedrock smart contracts:

OptimismBedrockContracts-X2

Please let us know if this is accurate and if it meets your expectations. We welcome any feedback on how we can improve the diagram.

We tried to keep it simple by following the example of diagrams from previous versions and we hope it can be included as part of the documentation to help others understand how the contracts interact with each other

patitonar avatar Jun 15 '23 21:06 patitonar

This is really amazing work @patitonar, thank you! I know that @gigamesh is working on a similar diagram with interactivity. Maybe you could work together on making the diagram interactive? I really like @gigamesh's idea to have the ability to select specific user flows and highlight the contracts and functions that are used within those user flows.

smartcontracts avatar Jun 16 '23 00:06 smartcontracts

@patitonar That design is beautiful! Would you be game to let me make it interactive, or collab on a repo?

gigamesh avatar Jun 16 '23 05:06 gigamesh

Thanks for the kind words. We are glad you like the diagram

From BootNode we'd love to collaborate to improve this diagram making it interactive!

@gigamesh Is it ok for us to reach you on Discord? If not, what would be the best way for us to coordinate the next steps?

patitonar avatar Jun 16 '23 16:06 patitonar

We made the diagram in SVG format available in this public repo https://github.com/BootNodeDev/optimism-bedrock-diagram

It can be easily imported into the existing documentation, also, anyone can use it to extend it, make it interactive, or use it for any other cool ideas on future contributions.

@smartcontracts Does this diagram meet the expectations of the scope of this issue to consider it resolved? Do you have any feedback or required changes to get to that point?

patitonar avatar Jun 22 '23 18:06 patitonar

@patitonar this is great! I am a bit under the weather today but I will review this tomorrow.

smartcontracts avatar Jun 23 '23 01:06 smartcontracts

Hi @smartcontracts, did you have a chance to take a look at this?

patitonar avatar Jun 30 '23 14:06 patitonar

hi @smartcontracts friendly-ping over here :)

pablofullana avatar Jul 31 '23 16:07 pablofullana