MCPcopy Index your code
hub / github.com/darkforest-eth/eth

github.com/darkforest-eth/eth @v0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.3 ↗ · + Follow
6 symbols 14 edges 8 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dark Forest Smart Contracts

Development Guide

Installing Core Dependencies

  • Node (v12.18.0)
  • Yarn (Javascript Package Manager)
  • Ganache CLI

Installing The Correct Node Version Using NVM

Dark Forest is built and tested using Node.js v12.18.0 and might not run properly on other Node.js versions. We recommend using NVM to switch between multiple Node.js version on your machine.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install

After the installation is finished, you can run node --version to verify that you are running v12.18.0

Installing Yarn & Other Dev Dependencies

Refer to Yarn's official documentation for the installation guide.

After you have Yarn installed, run the following commands in the root director install the remaining dev depencies:

yarn global add ganache-cli
yarn install

Smart Contract Development Setup

All of our smartcontract related code are located in the /eth directory.

  • /eth/contracts contains the smartcontract code written in solidity
  • /eth/test contains the test for the smartcontract written in Javascript

Installing Dependenciees

Navigate to the /eth folder and run the following commands:

yarn add scrypt
yarn install

Note: We run yarn add scrypt as a hack too solve a node-gyp error that a lot of our developers have encountered.

Running Tests

yarn test

Deploying Contracts Locally

First, run oz init in the eth directory (press ENTER to accept defaults - typechain support is irrelevant).

Next, open a separate terminal and run a local blockchain with ganache-cli.

Finally, in your original terminal, run yarn run deploy:dev.

Core symbols most depended-on inside this repo

exec
called by 12
src/deploy.ts
run
called by 1
src/deploy.ts
deployWhitelist
called by 1
src/deploy.ts
deployCore
called by 1
src/deploy.ts
writeEnv
called by 1
src/deploy.ts

Shape

Function 5
Enum 1

Languages

TypeScript100%

Modules by API surface

src/deploy.ts6 symbols

For agents

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

⬇ download graph artifact