Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/opixelum/proxy-diamond-patterns-gas-analysis
Gas cost comparison between the proxy & diamond patterns.
https://github.com/opixelum/proxy-diamond-patterns-gas-analysis
blockchain diamond evm foundry patterns proxy solidity
Last synced: 18 days ago
JSON representation
Gas cost comparison between the proxy & diamond patterns.
- Host: GitHub
- URL: https://github.com/opixelum/proxy-diamond-patterns-gas-analysis
- Owner: opixelum
- Created: 2023-12-08T20:33:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-12T10:19:37.000Z (about 1 year ago)
- Last Synced: 2024-11-14T18:31:37.009Z (3 months ago)
- Topics: blockchain, diamond, evm, foundry, patterns, proxy, solidity
- Language: Solidity
- Homepage:
- Size: 3.94 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Proxy and Diamond Patterns Gas Analysis
We will compare the gas cost of each operation (deploy, upgrade, call) for each,
and also the complexity of the code. Also, we use the
[Yul-based optimizer](https://docs.soliditylang.org/en/v0.8.21/internals/optimizer.html)
with a
[runs](https://docs.soliditylang.org/en/v0.8.21/internals/optimizer.html#optimizer-parameter-runs)
value of 2,000,000 in order to have the best gas cost possible.IMPORTANT: here we use the smart contract development framework **Foundry**,
which runs tests on a local blockchain, which may differ a bit from the real EVM
ones. Also, new EIPs are coming, which will change the gas cost of some
operations.## Getting Started
### Prerequisites
- [Foundry](https://getfoundry.sh/)
### Installation
1. Clone the repo.
Using SSH:
```console
git clone ssh://[email protected]:7222/AB272349/pattern-comparison.git
```Using HTTPS:
```console
git clone https://freyja.intra.cea.fr/AB272349/pattern-comparison.git
```2. Go to the repo.
```console
cd pattern-comparison
```3. Install dependencies.
```console
forge install
```### Usage
- Compile contracts.
```console
forge build
```- Run tests.
```console
forge test
```- Run tests with gas reports.
```console
forge test --gas-report
```- Run tests with traces.
```console
forge test --vvvvv
```