Coder Social home page Coder Social logo

forgenie / diamond-foundry Goto Github PK

View Code? Open in Web Editor NEW
76.0 76.0 11.0 313 KB

A modern framework for creating EIP2535 Diamonds ๐Ÿ’Ž

Home Page: https://docs.forgenie.com

License: MIT License

Shell 0.82% Solidity 99.18%
foundry smart-contracts solidity

diamond-foundry's People

Contributors

pegahcarter avatar urataps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

diamond-foundry's Issues

Separate `Base` facets

Currently all the facets are merged into a single one Base facet, so that it implements all the basic requirements of smart contracts and EIP2535.

We need to split them into separate facets as multiple projects do it. In this way we can upgrade in isolated manner.

It would be good, if we can compose the base facets into a single one, so that every created diamond complies with requirements.

ERC721A Facet

Take ERC721AUpgradeable and remove simple ERC721A dependency

Refactor error naming

Replace the error naming convention <Contract>_<method>_<name> for <Contract>_<name>

Enrich Diamond Factory functionality

Make DiamondFactory implement IBeacon interface that points to the most recent Diamond implementation. Create a deployDiamondBeacon method that creates a proxy to this diamond.

Also, consider a deployDiamondClone that deploys minimalistical non-upgradeable clones that point to the current diamond implementation.

We need this in order to be compatible with ERC1967.

Also, research other Proxy factories and outline functionalities that we need to support, example:https://github.com/maple-labs/proxy-factory/tree/main/contracts.

Allow diamond to remove interface if needed

supportsInterface should return false for facets that are removed, our options:

  1. We store supported interfaces for each facet in registry, and diamond removes by fetching interfaces from there.
    supportedInterfaces(address facet, bytes4[] interfaceIds)
  2. We have noDelegateCall method on each facet, diamond directly asks the facet, on add and on remove. We can get rid of some initializers, but get possible compatibility issue.
    supportedInterfaces(bytes4[] interfaceIds)

OZ-like `EnumerableBytes4Set`

We need to implement a library for EnumerableBytes4Set similar to OZ EnumerableBytes32Set where we can store 8 selectors in one storage slot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.