> For the complete documentation index, see [llms.txt](https://polarzero.gitbook.io/promise/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://polarzero.gitbook.io/promise/how-to-use/creating-a-promise.md).

# Creating a promise

<figure><img src="/files/5zcJ31IIASLWfGQw6Vp3" alt="Using the menu to navigate to the dashboard"><figcaption><p>Go to the dashboard from the menu.</p></figcaption></figure>

<figure><img src="/files/G0JbPAFE5wKXLLZUBPAK" alt="Creating a promise using the App"><figcaption><p>Click "New promise" to create a promise.</p></figcaption></figure>

There are two ways of creating a promise:

* using the App ;
* from the contract.

## Creating a promise using the App

Using the App to create a promise will allow its content to get verified, and spare you the trouble of sending it to IPFS, and eventually to Arweave.&#x20;

<figure><img src="/files/DJ2uypIZIrUY9sjtteul" alt="The window displayed for creating a promise on the App"><figcaption><p>The 'Create promise' drawer on the App.</p></figcaption></figure>

### Filling up the form

The process is rather straightforward:

1. Enter a name for your promise (max 70 characters).
2. Input data for at least one participant:
   * Name (min 2 - max 30 characters) ;
   * Ethereum address (a valid Ethereum address) ;
   * Twitter username (optional ; a valid Twitter handle).
3. Add as many participants as needed.
4. Choose whether you want to send the files to Arweave (if you do so, you will need to sign a message to connect your wallet to the Bundlr network [Sending to Arweave with Bundlr](/promise/ipfs-and-arweave/sending-to-arweave-with-bundlr.md)).
5. Upload as many files as needed (max 10 MB).

{% hint style="warning" %}
You must be included as a participant, so you won't be able to delete the row that includes your address.
{% endhint %}

{% hint style="warning" %}
You cannot add duplicate Ethereum addresses.
{% endhint %}

{% hint style="warning" %}
You need to upload file by file ; you can't upload a folder directly.
{% endhint %}

{% hint style="info" %}
Files won't be uploaded to IPFS or Arweave until you click the **Create** button.
{% endhint %}

### Approving transactions

Once you click **Create**, the process of "uploading" to IPFS / Arweave and submitting the transaction will start.

If you chose not to send the content to Arweave, you will only need to confirm one transaction, which will create the promise contract holding all its information.

If you chose to send the content to Arweave, there are a few additional steps:

1. **Funding your Bundlr wallet**: you will be prompted to confirm a transaction, that will transfer the required amount in MATIC to your Bundlr wallet ; it will be used for sending the files to the Arweave blockchain.
2. **Authorizing Bundlr**: you will be asked to sign a message to authorize Bundlr to send the files on Arweave.

Once you have completed these steps, the promise will be created, and available both in the **Explore promises** and the **Dashboard** pages.

## Creating a promise from the contract

The promise creation window provides a link to create the promise by directly interacting with the contract.

{% hint style="warning" %}
If you create a promise from the contract, without using the App, we won't be able to verify that the files have indeed been uploaded to IPFS & Arweave.

Therefore, the promise will be displayed with the tag ":warning:**Not verified**" on the App UI.
{% endhint %}

<figure><img src="/files/p8B4hyY4qzRd7TQR4YU2" alt="Navigating to the contract from the App to create a promise"><figcaption><p>Navigating to the contract to create a promise.</p></figcaption></figure>

Once in the `createPromiseContract` function, you will need to provide the following parameters:

<table><thead><tr><th width="252.5">Parameter</th><th width="100">Example input</th><th>Info</th></tr></thead><tbody><tr><td><code>_promiseName</code></td><td>New promise</td><td>Any string.<br>Max length is 70 characters.</td></tr><tr><td><code>_ipfsCid</code></td><td>bafybe...ci</td><td>Any IPFS CID.</td></tr><tr><td><code>_arweaveId</code></td><td>E1X...WU</td><td>Any Arweave ID.</td></tr><tr><td><code>_encryptedProof</code></td><td>...</td><td>It doesn't matter here, since it won't be able to get verified. At least one character must be provided.</td></tr><tr><td><code>_partyNames</code></td><td>['Bob']</td><td><p>An array of strings.</p><p>It needs to be encapsulated in brackets: <code>[...]</code>.</p><p>Each name must be in quotes: <code>'name'</code>. </p><p>Names must be separated by a comma: <code>'name', 'name'</code>. </p></td></tr><tr><td><code>_partyTwitterHandles</code></td><td>['bobtwitter']</td><td><p>An array of strings.</p><p>It needs to be encapsulated in brackets: <code>[...]</code>.</p><p>Each handle must be in quotes: <code>'handle'</code>. </p><p>Handles must be separated by a comma: <code>'handle', 'handle'</code>.<br>The @ must not be provided.<br>For no handle, an empty string must be supplied: <code>''</code>.</p></td></tr><tr><td><code>_partyAddresses</code></td><td>[0x000...00]</td><td><p>An array of addresses.</p><p>It needs to be encapsulated in brackets: <code>[...]</code>.</p><p>Addresses must be separated by a comma: <code>'0x000...', '0x000...'</code>.</p></td></tr></tbody></table>

{% hint style="warning" %}
You must put your address as the first one in the array, otherwise the transaction will be reverted.
{% endhint %}

{% hint style="info" %}
All fields need to be filled up in order to submit the transaction.
{% endhint %}

{% hint style="info" %}
The arrays `_partyNames`*,* `_partyTwitterHandles` and `_partyAddresses` need to have the same length.
{% endhint %}

When all the fields have been filled correctly, you can submit the transaction, and refresh the App to see your promise displayed.

## Related resources

| App                                                                                                                                                               |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Creating a promise (NewPromiseDrawer)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/frontend/components/user-dashboard/NewPromiseDrawer.js) |
| [Uploading to IPFS](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/frontend/systems/tasks/uploadToIPFS.js)                                     |
| [Uploading to Arweave](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/frontend/systems/tasks/uploadToArweave.js)                               |
| [Encrypting hashes (AES 256)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/frontend/systems/tasks/encryptAES256.js)                          |

| Contracts                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------- |
| [PromiseFactory.sol](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/contracts/PromiseFactory.sol)           |
| [PromiseFactory (tests)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/test/unit/PromiseFactory.test.js)   |
| [PromiseContract.sol](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/contracts/PromiseContract.sol)         |
| [PromiseContract (tests)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/test/unit/PromiseContract.test.js) |

| Chainlink                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [VerifyStorage.sol](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/contracts/VerifyStorage.sol)                            |
| [VerifyStorage (unit tests)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/test/unit/VerifyStorageMock.test.js)           |
| [VerifyStorage (staging tests)](https://github.com/polar0/chainlink-fall-2022-hackathon/blob/main/backend/hardhat/test/staging/VerifyStorage.staging.test.js) |
| [External Adapter - storage verification](https://github.com/polar0/chainlink-fall-2022-hackathon/tree/main/backend/chainlink-ea-storage-verification)        |
| [Operator contract](https://mumbai.polygonscan.com/address/0xd4d1fe6ff0a871ccf37bcfbce3135f548e5f05b5)                                                        |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://polarzero.gitbook.io/promise/how-to-use/creating-a-promise.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
