-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9842f76
commit 81bf73d
Showing
2 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,115 @@ | ||
# GNO Voting Power | ||
|
||
This repo is a collection of subgraphs which aggregate the balance of GNO held in multiple contracts on several networks. | ||
This repo is a collection of subgraphs which aggregate the balance of GNO held in multiple contracts across different networks. | ||
|
||
Currently, it tracks GNO balances in: | ||
|
||
- Ethereum Mainnet: | ||
- [x] GNO | ||
- [x] LGNO | ||
- [x] Uniswap v3 | ||
- [x] Balancer | ||
- Gnosis Chain: | ||
- [x] GNO | ||
- [x] mGNO | ||
- [x] sGNO | ||
- [x] LGNO | ||
- [x] Beacon Chain validator deposits | ||
- [x] 1Hive | ||
- [x] Swapper | ||
- [x] SushiSwap | ||
- [x] Elk | ||
- [x] Baoswap | ||
- [x] Symmetric | ||
|
||
These subgraphs allow the calculation of voting power associated with these balances for various dApps and protocols. | ||
|
||
## Prerequisites | ||
Before you start, make sure you have the following tools installed on your machine: | ||
|
||
- [Node.js](https://nodejs.org/) v18 or higher | ||
- [Yarn](https://yarnpkg.com/) | ||
- [Graph CLI](https://github.com/graphprotocol/graph-cli) | ||
|
||
## Installation | ||
|
||
1. Clone this repository: | ||
``` | ||
git clone https://github.com/username/subgraph-voting-power.git | ||
``` | ||
|
||
2. Install the dependencies with Yarn: | ||
``` | ||
yarn install | ||
``` | ||
|
||
## Available Scripts | ||
clean | ||
Removes generated directories (to clean up before rebuilding): | ||
``` | ||
yarn clean | ||
``` | ||
|
||
codegen | ||
Generates TypeScript code from the GraphQL schema and entities for both networks: | ||
``` | ||
yarn codegen | ||
``` | ||
|
||
build | ||
Builds the subgraph for Ethereum: | ||
``` | ||
yarn build | ||
``` | ||
|
||
build:gc | ||
Builds the subgraph for Gnosis Chain: | ||
``` | ||
yarn build:gc | ||
``` | ||
|
||
doall | ||
Executes the full sequence: clean, code generation, and build for both Ethereum and Gnosis Chain: | ||
``` | ||
yarn doall | ||
``` | ||
|
||
deploy | ||
Deploys the subgraph for Ethereum to The Graph Studio: | ||
``` | ||
yarn deploy | ||
``` | ||
|
||
deploy:gc | ||
Deploys the subgraph for Gnosis Chain to The Graph Studio: | ||
``` | ||
yarn deploy:gc | ||
``` | ||
|
||
test | ||
Runs tests to verify the functionality of the subgraph: | ||
``` | ||
yarn test | ||
``` | ||
|
||
## Running Tests | ||
This project uses matchstick-as for testing subgraphs written in AssemblyScript. | ||
|
||
Run the tests with the command: | ||
|
||
``` | ||
yarn test | ||
``` | ||
|
||
The tests will use the generated files and simulate events to verify that the mappings and entities in the subgraph function as expected. | ||
|
||
## Deploying the Subgraph | ||
### On Ethereum Mainnet | ||
To deploy the subgraph to the Ethereum Mainnet, first make sure you are connected to The Graph Studio. Then, use the following command to deploy: | ||
|
||
``` | ||
yarn deploy | ||
``` | ||
|
||
### On Gnosis Chain | ||
To deploy the subgraph to Gnosis Chain, use the following command: | ||
|
||
``` | ||
yarn deploy:gc | ||
``` | ||
|
||
## Contributing | ||
Contributions are welcome! If you find a bug or have improvement ideas, feel free to open an issue or submit a pull request. | ||
|
||
## License | ||
This project is licensed as UNLICENSED. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters