promise
AppRepository
  • Overview
  • Links
  • How to use
    • Exploring promises
    • Creating a promise
    • Interacting with promises
    • Verifying a Twitter account
    • Indexing an IPFS directory
  • Chainlink - External Adapters
    • Introduction
    • Twitter account verification
    • IPFS & Arweave verification
  • IPFS & Arweave
    • Sending to the IPFS network
    • Sending to Arweave with Bundlr
  • The Graph
    • Catching events from promises
Powered by GitBook
On this page
  • Creating a promise using the App
  • Filling up the form
  • Approving transactions
  • Creating a promise from the contract
  • Related resources
  1. How to use

Creating a promise

How to create a promise?

PreviousExploring promisesNextInteracting with promises

Last updated 2 years ago

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.

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).

  5. Upload as many files as needed (max 10 MB).

You must be included as a participant, so you won't be able to delete the row that includes your address.

You cannot add duplicate Ethereum addresses.

You need to upload file by file ; you can't upload a folder directly.

Files won't be uploaded to IPFS or Arweave until you click the Create button.

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.

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.

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

Parameter
Example input
Info

_promiseName

New promise

Any string. Max length is 70 characters.

_ipfsCid

bafybe...ci

Any IPFS CID.

_arweaveId

E1X...WU

Any Arweave ID.

_encryptedProof

...

It doesn't matter here, since it won't be able to get verified. At least one character must be provided.

_partyNames

['Bob']

An array of strings.

It needs to be encapsulated in brackets: [...].

Each name must be in quotes: 'name'.

Names must be separated by a comma: 'name', 'name'.

_partyTwitterHandles

['bobtwitter']

An array of strings.

It needs to be encapsulated in brackets: [...].

Each handle must be in quotes: 'handle'.

Handles must be separated by a comma: 'handle', 'handle'. The @ must not be provided. For no handle, an empty string must be supplied: ''.

_partyAddresses

[0x000...00]

An array of addresses.

It needs to be encapsulated in brackets: [...].

Addresses must be separated by a comma: '0x000...', '0x000...'.

You must put your address as the first one in the array, otherwise the transaction will be reverted.

All fields need to be filled up in order to submit the transaction.

The arrays _partyNames, _partyTwitterHandles and _partyAddresses need to have the same length.

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
Contracts
Chainlink

Therefore, the promise will be displayed with the tag "Not verified" on the App UI.

⚠️
Creating a promise (NewPromiseDrawer)
Uploading to IPFS
Uploading to Arweave
Encrypting hashes (AES 256)
PromiseFactory.sol
PromiseFactory (tests)
PromiseContract.sol
PromiseContract (tests)
VerifyStorage.sol
VerifyStorage (unit tests)
VerifyStorage (staging tests)
External Adapter - storage verification
Operator contract
Go to the dashboard from the menu.
Click "New promise" to create a promise.
The 'Create promise' drawer on the App.
Navigating to the contract to create a promise.
Using the menu to navigate to the dashboard
Creating a promise using the App
The window displayed for creating a promise on the App
Navigating to the contract from the App to create a promise