Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/FydeTreasury/Diamond-Foundry
Foundry version of Diamond Pattern (EIP-2535) reference implementation
https://github.com/FydeTreasury/Diamond-Foundry
Last synced: about 2 months ago
JSON representation
Foundry version of Diamond Pattern (EIP-2535) reference implementation
- Host: GitHub
- URL: https://github.com/FydeTreasury/Diamond-Foundry
- Owner: FydeTreasury
- Created: 2022-10-18T16:21:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-24T02:50:07.000Z (over 1 year ago)
- Last Synced: 2024-08-04T01:02:37.812Z (5 months ago)
- Language: Solidity
- Homepage:
- Size: 110 KB
- Stars: 77
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-foundry - Diamond-Foundry - Foundry implementation of EIP2535 Diamond standard. (Templates & Libraries)
README
# Diamond Proxy Template for Foundry
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
## Description
This is a reference implementation for EIP-2535 Diamonds by [Nick Mudge](www.github.com/mudgen) translated for use in foundry . To learn about other implementations go here: https://github.com/mudgen/diamondNote: The loupe functions in DiamondLoupeFacet.sol MUST be added to a diamond and are required by the EIP-2535 Diamonds standard.
Note: In this implementation the loupe functions are NOT gas optimized. The facets, facetFunctionSelectors, facetAddresses loupe functions are not meant to be called on-chain and may use too much gas or run out of gas when called in on-chain transactions. In this implementation these functions should be called by off-chain software like websites and Javascript libraries etc., where gas costs do not matter.
## Dependencies
- Install [foundry](https://book.getfoundry.sh)
- Install [string-utils](https://github.com/Arachnid/solidity-stringutils)
- Install [solhint](https://github.com/protofire/solhint)## Installation Instructions
- clone the repo
```bash
$ git clone https://www.github.com/ArcStreetCapital/Diamond-Foundry.git
```
- install all of the dependencies via
```bash
$ forge install
```
## Testing
To run all of the tests use the command
```bash
$ forge test --ffi --match-path test/DiamondTests.t.sol
```
## Deployment
To deploy diamond with standard facets, create .env, start anvil and use command
```bash
$ forge script script/deployDiamond.s.sol:DeployScript --fork-url http://localhost:8545 --broadcast --ffi
```
Or deploy to testnet, for example
```bash
$ forge script script/deployDiamond.s.sol:DeployScript --rpc-url $GOERLI_RPC_URL --broadcast --verify -vvvv --ffi```
## Contributing
Feel free to create issues and contribute by cloning the repo and adding your changes
to your own branch.## Authors
- 👤 Nick Mudge: , Github: [mudgen](https://www.github.com/mudgen)
- 👤 Timo Neumann: , Github: [Teamo0](https://www.github.com/Teamo0)
- 👤 Rohan Sundar: , Github: [rsundar](https://www.github.com/rsundar)## Contributors