# Getting started with the contracts

All contract code can be viewed in the [contracts repo](https://github.com/railgun-privacy/contract). Deployment addresses (including testnet deployments) can be viewed in the [deployments repo](https://github.com/railgun-community/deployments).

To setup a local development environment:

1. Clone the contracts repo (`git clone git@github.com:railgun-privacy/contract.git`)
2. Install dependencies (`cd contract && npm install`)
3. Run a local development network in a new terminal window (`cd contract && npx hardhat node`)
4. Deploy contracts to development network (`npx hardhat deploy:test --network localhost`)

After running the `deploy:test` hardhat script you should see something like the following printed to your terminal:

```json
{
  "delegator": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
  "governorRewardsImplementation": "",
  "governorRewardsProxy": "",
  "implementation": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
  "proxy": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
  "proxyAdmin": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
  "rail": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
  "staking": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
  "testERC20": "0x202CCe504e04bEd6fC0521238dDf04Bc9E8E15aB",
  "testERC721": "0xf4B146FbA71F41E0592668ffbF264F1D186b2Ca8",
  "treasuryImplementation": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
  "treasuryProxy": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
  "voting": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
  "weth9": "0x8198f5d8F8CfFE8f9C413d98a0A55aEB8ab9FbB7",
  "relayAdapt": "0x0355B7B8cb128fA5692729Ab3AAa199C1753f726"
}
```

You will primarily be interacting with the `proxy` contract which is a EIP1967 `Transparent Upgradeable Proxy` for the `implementation` contract. Functions on the proxy are only accessible when called by the`proxyAdmin` contract so function selector clashes are not an issue.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.railgun.org/developer-guide/engine-1/getting-started-with-the-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
