# 3. Deployment

### 1. Deploy Token Factories

Uncomment the "Deploy Token Factories" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FTKLyLHKJtlEkWsHmDJQ5%2Fimage.png?alt=media&#x26;token=6c9921c5-2cab-443c-9237-d57de1012f46" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

Record the addresses from the console:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FcXyjnWjmVZX7GHT4lp97%2Fimage.png?alt=media&#x26;token=16c0cffe-ae25-4522-8f47-73db8746fd3a" alt=""><figcaption><p>Console output</p></figcaption></figure>

Update the getContracts() function with those addresses and uncomment them:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FKp8GfWofifKw9ShVltvy%2Fimage.png?alt=media&#x26;token=ff1d27c2-ed1f-4e4d-a047-efa9d2c2596a" alt=""><figcaption><p>getContracts() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

### 2. Deploy Token

Comment out the "Deploy Token Factories" section and uncomment the "Deploy Token" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FXEb0hO9QOuXGepvmucMV%2Fimage.png?alt=media&#x26;token=1c25febb-fb22-418f-88f6-c2921a0d4ae0" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

Record the addresses from the console:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FTR0JEPOvZzqmRsETrMM9%2Fimage.png?alt=media&#x26;token=b15b7024-8a17-4cf9-8f42-3875602be6c7" alt=""><figcaption><p>console output</p></figcaption></figure>

Update the getContracts() function with those addresses and uncomment them:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2F7pkQs4SmR4ZEYO0l0hdF%2Fimage.png?alt=media&#x26;token=d9f669e6-590e-4153-9902-66f768c593cb" alt=""><figcaption><p>getContracts() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

### 3. Deploy Voting System

Comment out the "Deploy Token" section and uncomment the "Deploy Voting System" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FCLQEEUQ7EzRUOXUs0xKm%2Fimage.png?alt=media&#x26;token=7c154f43-81fd-4a0e-91b9-a0e5247c1abc" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

Record the addresses from the console:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FjAS9wtpX30YD2f3sB6EK%2Fimage.png?alt=media&#x26;token=a267fdc7-b0e6-41a1-9706-29a7661819ba" alt=""><figcaption><p>console output</p></figcaption></figure>

Update the getContracts() function with those addresses and uncomment them:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FsxnbX2dc8ANzjsInh1ab%2Fimage.png?alt=media&#x26;token=9b66425d-a59e-49fb-97f0-18b2328e4517" alt=""><figcaption><p>getContracts() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

### 4. Deploy Ancillary Contracts

Comment out the "Deploy Voting System" section and uncomment the "Deploy Ancillary Contracts" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FMwXhFrcoXj4zwbJJ0XzJ%2Fimage.png?alt=media&#x26;token=083e55f1-901f-424f-873f-e133bac35971" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

Record the addresses from the console:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FAYOanKAF0MGoBjP1wemG%2Fimage.png?alt=media&#x26;token=1c4959d1-557f-4054-9205-f26e99d2bd53" alt=""><figcaption><p>console output</p></figcaption></figure>

Update the getContracts() function with those addresses and uncomment them:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FVRSI5QrpnNozUfGPHSIJ%2Fimage.png?alt=media&#x26;token=d40406e9-8439-4a26-a502-f34ce5918789" alt=""><figcaption><p>getContracts() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

### 5. Verify Token Contracts

Comment out the "Deploy Ancillary Contracts" section and uncomment the "Verify Token Contracts" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FTtS4Zkt2XmX9PRvIoyqf%2Fimage.png?alt=media&#x26;token=e8b851f5-5c54-4f66-8d89-24454ebe417a" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

The console should indicate that the verifications were successful.

### 6. Verify Voting Contracts

Comment out the "Verify Token Contracts" section and uncomment the "Verify Voting Contracts" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FGcMj6PSUVsPcoN5nTUGn%2Fimage.png?alt=media&#x26;token=3859602f-df0b-452b-b633-16d5f99e3146" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

The console should indicate that the verifications were successful.

### 7.  Verify Ancillary Contracts

Comment out the "Verify Voting Contracts" section and uncomment the "Verify Ancillary Contracts" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2F7YJCpNiLOvIg0qUyDMRf%2Fimage.png?alt=media&#x26;token=c1dc16e4-7869-4cf8-a4fd-1c72320193eb" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

The console should indicate that the verifications were successful.

### 8. Set up system

Comment out the "Verify Ancillary Contracts" section and uncomment the "Set Up System" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FGUpQEUPLNnsuqQRtQLwn%2Fimage.png?alt=media&#x26;token=e6479bd9-dda8-4770-913d-4c04a71c81da" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```

The console should indicate that system set up was successful.

### 9. Transfer Ownership

Comment out the "Set Up System" section and uncomment the "Transfer Ownership" section in main() of deploy.js:

<figure><img src="https://623574502-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC3xzGYE2iQZi10eNv4IG%2Fuploads%2FAbKhoAJvZwNvC77nzMQ2%2Fimage.png?alt=media&#x26;token=f3b3d4c6-51f1-4afa-aa2f-579fb19ef59c" alt=""><figcaption><p>main() in deploy.js</p></figcaption></figure>

Save the deploy.js file.

Run the command in the terminal:

```
yarn deploy
```
