> ## Documentation Index
> Fetch the complete documentation index at: https://docs.state.space/llms.txt
> Use this file to discover all available pages before exploring further.

# Hardhat Plugin

Hardhat users have the option of using the State Space Hardhat plugin.

This example uses the [Tokeny T-REX](https://github.com/TokenySolutions/T-REX) contracts.

## Install Plugin

<CodeGroup>
  ```bash Install theme={null}
  npm install @state-space/hardhat
  ```

  ```bash Update theme={null}
  npm install @state-space/hardhat
  ```
</CodeGroup>

## Import Plugin

Add the following statements to your `hardhat.config.ts` file:

```ts hardhat.config.ts theme={null}
import "@state-space/hardhat"; //import the State Space plugin
import { extractAccountNames } from "@state-space/hardhat"; //returns the names of EOAs from a custom deployment so they appear in Workbench
```

## Update Hardhat config file

In the `hardhat.config.ts` file, add the `statespace` object property to the Hardhat config. Below is an example deployment setup with added lines highlighted:

```ts Example hardhat.config.ts {3,4,14-28} theme={null}
import "@nomicfoundation/hardhat-toolbox";
import { HardhatUserConfig } from "hardhat/config";
import "@state-space/hardhat";
import { extractAccountNames } from "@state-space/hardhat";

const config: HardhatUserConfig = {
	solidity: {
		version: "0.8.17",
		settings: {
			
		},
	},

	statespace: {
		//team: "team-slug",
        //project: "Project Name",
		deployments: {
			"Full Suite": async () => {
				const { deployFullSuiteFixture } = await import(
					"./test/fixtures/deploy-full-suite.fixture"
				);
				const accounts = await deployFullSuiteFixture();
				return {
					accountNames: extractAccountNames(accounts),
				};
			},
		},
	},
    ...

```

## Deploy & Upload

Run the `push` command to deploy and upload your project. Login to [State Space Workbench](https://state.space/me) to view your project.

If this is your first time, you will be asked to authenticate using your State Space login via a web link.

```bash theme={null}
npx hardhat state-space push
```

<Tip>If you do not see your project, make sure you selected the correct team as specified in the `hardhat.config.ts` file.</Tip>
