> For the complete documentation index, see [llms.txt](https://unirep.gitbook.io/unirep/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://unirep.gitbook.io/unirep/package/cli/deploy-unirep-contract.md).

# Deploy Unirep Contract

Deploy a Unirep smart contract with an Ethereum account

* Config an ethereum provider before deploying a Unirep smart contract.
* Default: run a local hardhat node by

```
npx hardhat node
```

{% hint style="info" %}
By default it runs at <http://localhost:8545>\
And it will list 20 accounts including their private keys
{% endhint %}

## `deploy`

```bash
npx ts-node cli/index.ts deploy 
                  [-h] 
                  [-d DEPLOYER_PRIVKEY] 
                  [-e ETH_PROVIDER] 
                  [-l EPOCH_LENGTH] 
                  [-f ATTESTING_FEE]
```

* The address of the Unirep contract should be printed after executing the command.
* Then we have to use the address to perform the following actions.

### Options

```
  -d DEPLOYER_PRIVKEY, --deployer-privkey DEPLOYER_PRIVKEY
                        The deployer's Ethereum private key
  -e ETH_PROVIDER, --eth-provider ETH_PROVIDER
                        A connection string to an Ethereum provider. Default: http://localhost:8545
  -l EPOCH_LENGTH, --epoch-length EPOCH_LENGTH
                        The length of an epoch in seconds. Default: 30
  -f ATTESTING_FEE, --attesting-fee ATTESTING_FEE
                        The fee to make an attestation. Default: 0.01 eth (i.e., 10 * 16)
```

#### Options inherited from parent commands <a href="#options-inherited-from-parent-commands" id="options-inherited-from-parent-commands"></a>

```
  -h, --help            Show this help message and exit.
```

{% hint style="info" %}
source: [core/cli/deploy.ts](https://github.com/Unirep/Unirep/blob/main/packages/core/cli/deploy.ts)
{% endhint %}
