forgenie / diamond-foundry Goto Github PK
View Code? Open in Web Editor NEWA modern framework for creating EIP2535 Diamonds ๐
Home Page: https://docs.forgenie.com
License: MIT License
A modern framework for creating EIP2535 Diamonds ๐
Home Page: https://docs.forgenie.com
License: MIT License
NFT facet should be implemented first #33
Instead of tokenIds we can create incremental nonces for each diamond
There is no need to keep them as separated facets, since Introspection has only one function anyways
Pull Request #6
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.
Take ERC721AUpgradeable and remove simple ERC721A dependency
currently diamondCut is not protected by owner
Instead of rewriting our own facets like ERC20 and others, we should use the OpenZeppelin library for security guarantees.
Replace the error naming convention <Contract>_<method>_<name> for <Contract>_<name>
That includes structs, events and errors
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.
Add document generation
supportsInterface
should return false for facets that are removed, our options:
supportedInterfaces(address facet, bytes4[] interfaceIds)
supportedInterfaces(bytes4[] interfaceIds)
ERC721 Facet with mint, burn functionality
We need to implement a library for EnumerableBytes4Set
similar to OZ EnumerableBytes32Set
where we can store 8 selectors in one storage slot.
We need a way to initialize a diamond when adding multiple facets, which potentially contain their own initializers.
We could it similarly to Multicall3
but with delegatecall
, but it should be permitted only to diamonds during the deployment process. As delegating to unknown addresses can induce unforeseen consequences.
Check implementation for simple calls here https://github.com/mds1/multicall
For example, we could make another fallback that resolves to some default behavior if no Facet was found in the diamond.
Other fallback approaches are also welcome
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.