MCPcopy Index your code
hub / github.com/dcgtc/dgrants

github.com/dcgtc/dgrants @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
213 symbols 609 edges 89 files 29 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dgrants

Directory Structure

.
├── app                     # Frontend Vue.js application
├── contracts               # Smart contracts
├── doc                     # Project documentation including the protocol definition
├── lerna.json              # Lerna config
├── package.json            # Root package configuration
├── tsconfig.json           # Typescript configuration
├── tsconfig.settings.json  # Typescript configuration
├── types                   # Shared types
├── vetur.config.js         # Vetur configuration
├── yarn.lock               # Yarn lock file
└── README.md

Contributing Guideline

Checkout the CONTRIBUTING.md if you'd like to help with building dGrants

Development

This project is a monorepo with two packages:

  • contracts/ contains the smart contracts
  • app/ is a frontend

Dependencies

To ensure that everyone is using the same version of nodejs on this project, volta is recommended!

Set your env files

Copy app/.env.template to app/.env and edit, providing your own env vars. You will have to supply a Blocknative API key and an Alchemy API key. Both services have free tiers which are sufficient for development.

cp app/.env.template app/.env

Copy contracts/.env.template to contracts/.env and edit, providing your own env vars

cp contracts/.env.template contracts/.env

You will have to supply an Alchemy API Key. An account with their free tier is sufficient for development. You'll also need a Fleek IPFS endpoint key in your .env file.

Develop

yarn
yarn dev

Lint

yarn lint

Test

yarn test

Build

yarn build

Note: Subdirectory Development

If you are working on one component or the other, you can use workspace aliases to run commands defined in the corresponding package.json independently.

For example, to run smart contract tests only:

yarn contracts test

or to start the frontend locally in development mode:

yarn app dev

Version Management & Changelogs

Versioning and Changelogs are managed by Lerna.

Version Management

Guidance around when to increase versions is coming soon.

To increase the version number and include the short hash of the git commit ID, use the following commands.

$ yarn bump:patch
$ yarn bump:minor
$ yarn bump:major

To promote a pre-release version to release which removes the short hash from the version, use the following commands.

$ yarn release:patch
$ yarn release:minor
$ yarn release:major

Changelog Requirements

In order for merged PRs to be added to the changelog, you must use one of the following tags in Github for each PR.

  • enhancement - A feature or addition to the codebase
  • bug - A fix for a bug
  • breaking - A change that breaks compatability or requires configuration changes
  • documentation - Changes or additions to documentation
  • internal - Changes or updates to build mechanisms

Help Build Decentralized Gitcoin

As of August 2021, Gitcoin Holdings is Hiring Engineers -- Say hi in the #decentralize-gitcoin channel on the Gitcoin Discord to get involve

Extension points exported contracts — how you extend this code

SwapSummary (Interface)
(no doc)
types/src/grantRoundManagers.d.ts
MerkleDistributorInfo (Interface)
(no doc)
utils/src/merkle-distributor/parse-balance-map.ts
ImportMeta (Interface)
(no doc)
app/src/shims.d.ts
Signers (Interface)
(no doc)
contracts/types/index.ts
Donation (Interface)
(no doc)
types/src/grantRoundManagers.d.ts
L1ChainInfo (Interface)
(no doc)
app/src/utils/chains.ts
SwapSummaryUniV2 (Interface)
(no doc)
types/src/grantRoundManagers.d.ts
L2ChainInfo (Interface)
(no doc)
app/src/utils/chains.ts

Core symbols most depended-on inside this repo

balanceOf
called by 54
contracts/test/utils.ts
approve
called by 28
contracts/test/utils.ts
setBalance
called by 20
contracts/test/utils.ts
snapshotGasCost
called by 13
contracts/test/snapshotGasCost.ts
encodeRoute
called by 12
contracts/test/utils.ts
metadataId
called by 11
app/src/utils/utils.ts
save
called by 11
app/src/store/settings.ts
syncStorage
called by 10
app/src/utils/data/utils.ts

Shape

Function 170
Method 26
Class 8
Interface 8
Enum 1

Languages

TypeScript100%

Modules by API surface

app/src/utils/utils.ts34 symbols
app/src/store/cart.ts17 symbols
contracts/test/utils.ts15 symbols
utils/src/merkle-distributor/merkle-tree.ts14 symbols
app/src/utils/data/grantRounds.ts11 symbols
app/src/utils/data/contributions.ts10 symbols
app/src/store/wallet.ts9 symbols
contracts/scripts/ScriptLogger.ts8 symbols
app/src/utils/data/ipfs.ts8 symbols
utils/src/merkle-distributor/balance-tree.ts7 symbols
app/src/utils/data/grants.ts7 symbols
app/src/store/settings.ts7 symbols

For agents

$ claude mcp add dgrants \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact