# Social Curation Protocol

Pronounced ‘rah rah!’ like a cheer, the goal of RARA’s protocol is to give a voice to a world of curators.

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FzmZFX17ejQt6yir93nyg%2FSocial%20Curation%20Protocol.gif?alt=media&amp;token=32c8398f-9b43-4a24-9e48-b9c9406d2ea9" alt=""><figcaption></figcaption></figure>

RARA is a protocol for adding social commentary to Non-Fungible Tokens (NFTs). The goal of the protocol is to:

* Enable cross-platform commentary for NFTs,
* Reward the curation of NFTs with free collectibles, and
* Prioritize user's likes and preferences for NFT discovery.&#x20;

Powered by NFT-backed "reactions", the protocol enables anyone to react, comment, or tag NFTs.

#### The Loud Paper

View RARA's Loud Paper [here](https://rara.mirror.xyz/czut-1X7ubQcAwt3PnNPQHJ3DHn2TiQJvm4nxR8AwpQ). Note: Release v1.1 of the protocol enabling free curation is not documented in the Loud Paper. An updated Louder Paper will be published soon.


# Curation Adds Context

RARA adds social context.

We believe that the act of curation is all about [adding context](https://lwsnbaker.mirror.xyz/ftt7ojZG2q9txxCz1IRDEoSQGQ2CyY53gCJtsJ6uyA4). As a social curation protocol we give users the tools to do just that by leveraging some of the most used social tools on the Internet: reactions, comments, and tags.

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FIziv89D3mbOSnFHx1Enr%2FCuration%20Adds%20Context.png?alt=media&amp;token=06f8c22a-b22a-4cfa-9eb9-77b677caf410" alt=""><figcaption><p>Curators adding context to NFTs</p></figcaption></figure>

* `Reactions` are used to express all the things that words cannot.  They provide a shorthand for us to add emotional and communal context to the things we love (or hate) in the form of emojis and memes -- cultural products that are, in every way, native to the internet.&#x20;
* `Comments` give us a way to add context in words that are completely our own.  They give us the space to share stories, to discuss ideas, to speak directly to the audience in the language of our choosing, using as many or as few words as we need.
* `Tags` help us organize things into discoverable groups -- shared, open conversations that reach across the internet to find and grow communities around the content that matters. &#x20;

Builders can look up curation activity for any NFT using [TheGraph](/protocol-data/graphql-subgraph). Consumers can search all curation activity on any NFT platform and see activity on [RA! Like Tokens](broken://pages/MNi4f3RZ14LOpm3TZSuK).&#x20;


# Use Cases

Web 2.5 tools for the next million users

RARA's provides Web2.5 tools for bridging the next wave of users into Web3. React, comment, or tag an NFT to generate a free RA! Like Token that captures the moment on-chain.

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FAnT4MWgfDo7bHj0Uq4EN%2FUse%20Cases.png?alt=media&amp;token=aedff676-061a-4529-a6d9-76f8fd505e67" alt=""><figcaption></figcaption></figure>

### **Mobile Apps**

* **Web3 Emojis, GIFs, and Likes.** Replace centralized like buttons and GIFs with Web3 `reactions` with [react](/protocol-features/react).
* **NFT Filters.** Create filters for photo NFTs using `reactions` and generate free RA! like tokens to capture the moment.

### **Social Apps**

* **Live NFT Commentary.** Goodbye cold start problem. Get new users into the conversation quick with live and historical `comments` on NFTs.
* **Community Memes.** Embrace your community memes by enabling collectors to [register](/protocol-features/register) their NFTs as `reactions`. It's free utility, friend.
* **Build "For You" feeds.** Use RARA curation [graph](/protocol-data/graphql-subgraph) to build feeds customized to a users likes and preferences.
* **Decentralize #hashtags.** Use the `tag` feature to build indexable lists.

### **NFT Marketplaces**

* **Bid & Offer Comments.** Send Comments on Bids and Offers
* **Smart NFT Recommendations.** Recommend NFTs to buy based on a user's preferences with RARA engagement data.

### **Music NFT Apps**

* **Playlist.** Use `tags` to add NFTs to public or private playlist.
* **Time-Stamped Comments.** Show user comments and reactions directly on songs.

### **Gaming.**&#x20;

* Use reactions for in-game consumables to gamify user engagement with in world NFTs


# "For You" Feeds

Build user experiences custom fit for each person's taste.

The protocol's curation data is great data for identifying popular and trending NFTs based on user curation activity. Reactions and comments are explicit user likes.&#x20;

Ways to use curation graph data:

* **Feeds.** Customize user feeds based on prior engagement history ("*Someone with similar NFT likes as you just commented on this NFT"*).
* **Recommendations.** Recommend NFTs to users based on NFTs they've liked and commented on in the past. &#x20;


# Reactions

The protocol is powered by NFT-backed reactions

Users [react](/protocol-features/react) to curate NFTs. Spending reactions enables users to add comments and tags to an NFT, too. Reaction can be used as:&#x20;

* Web3 emojis, likes, GIFs, and memes;
* Filters for Photo NFTs; and
* In-Game Consumables.

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2Ftsx8GOdgj3q35BKN125S%2FReactions.png?alt=media&amp;token=5809b478-b758-4fda-a85c-16c80e0b05bf" alt=""><figcaption><p>Web2 to Web3</p></figcaption></figure>

Reactions are one-time use ERC-1155 tokens generated by the registered NFT’s media. Anyone can [register](/major-concepts/registration) an NFT they own as a reaction. We call these users "Makers".&#x20;

Once a reaction is registered, anyone can use it to curate an NFT via [react](/protocol-features/react). We call these users "Curators". Every time you react to an NFT, a free [RA! Like Token](broken://pages/MNi4f3RZ14LOpm3TZSuK) is generated.&#x20;

All curation and RA! like tokens are free! Transaction costs are generally only 1-2 cents in $MATIC.


# Registration

Registering NFTs allow them to be used as reactions in RARA's protocol.

To create Reactions, NFT owners ("Makers") must [register](/protocol-features/register) NFTs with RARA. Registration is simply proving ownership of the NFT to the protocol contracts by the owner’s wallet. It does NOT involve sending the NFT to a different address, wrapping the NFT into another contract, or allowing any other contract to move the NFT on the owner's behalf. This allows the user to maintain control over the NFT with their highest security, but still use the NFT in the RARA protocol.

When a wallet registers an NFT, they interact with the MakerRegistrar Contract. The address that owns the NFT calls the “registerNFT()” function and passes the relevant information, such as the NFT address and NFT ID. The contracts will then verify that the calling address owns the NFT, and if so, register it in the protocol. From then on, the owner of the NFT can sell Reactions or claim any accrued Taker rewards.

### Cross Chain&#x20;

Since the RARA protocol runs on the Polygon L2 and most really valuable NFTs live on Ethereum L1, RARA has built a way to bridge registration from L1 to L2. To do this, the owner of the L1 NFT can interact with the RootRegistrar Contract and call the “registerNFT” function. This logic will perform the same ownership checks on L1 as would occur on L2, and then send a message up to the contracts on L2 that will allow the NFT to be registered. Internally, the contracts keep track of the “chain ID” that each NFT lives on in order to distinguish L1 and L2 NFTs. Once the register transaction is confirmed on L1, it will take about 15 minutes for the message to be relayed up to L2 before the NFT is fully registered in the protocol.

### Source ID&#x20;

When an NFT is registered in the system, it is assigned a Source ID. This is a unique ID derived from hashing the chain ID, NFT Address, and NFT ID. See “\_deriveSourceId()” in the MakerRegistrar Contract. This ID is used to identify the NFT for any future references across contract calls. The Source ID is a 1-to-1 mapping of ID to NFT.

### Option Bits&#x20;

When an NFT is registered in the system, the caller can optionally specify Option Bits. This input parameter signals intent of the caller to transform the original NFT in some way to be used as a Reaction. This could be adding a border to the image, resizing it, or cropping it.

Transform ID In order to reference NFTs used as Reactions, a Transform ID is used to combine the 1-to-1 Source ID and Options Bits combination. Since an NFT can be registered multiple times with different Option Bits, this unique ID will be a 1-to-1 mapping between the “transformed” Reaction NFT and the ID. The Transform ID is a hash of the Source ID plus the Option Bits.


# RA! Like Tokens

Souldbound memories for curators

Every [react](/protocol-features/react) transaction generates a free RA! like token is generated. RA! tokens records a user's reaction, comment, and tags on a newly generated NFT.

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FRt1zPbLenlIxc8MNY4aK%2FRA!%20Like%20Tokens.png?alt=media&amp;token=cda413c6-f4ae-4d00-a8c4-8037bbd80c97" alt=""><figcaption><p>Framework for generating a RA! Like Token inside of a hexagon</p></figcaption></figure>

As a [soulbound](https://decrypt.co/resources/what-are-soulbound-tokens-building-blocks-for-a-web3-decentralized-society) token, RA! like tokens are non-transferrable proof-of-curations. *Who said it first?* Now provable on-chain.

Each curated NFT generates a unique RA! like token contract that users can explore on any NFT platform.&#x20;


# Glossary of Terms

The protocol uses specific terms to refer to different concepts.  Below are some of the terms you should become acquainted with.

#### Reaction

This is the core primitive of the RARA protocol. Reactions are one-time use ERC-1155 tokens that power curation in RARA.

#### Maker

A maker is the address that owns an NFT that is [registered](/protocol-features/register) as a reaction in the protocol.&#x20;

#### Creator

A creator is the address that minted and created an NFT.&#x20;

#### Curator

A curator is the address that [reacts](/protocol-features/react) to curate NFTs into the protocol. Spending a reaction on an NFT is the act of "Curating".

#### Taker

A taker is the address that owns an NFT that curated with Reactions.&#x20;

#### Referrer

Any application can integrate the RARA protocol as a referrer as further detailed in [Optional Curation Incentives](/protocol-features/optional-curation-incentives).


# Register

Registering NFTs allow them to be used as reactions in the RARA protocol.

{% hint style="info" %}
L1 registrations use the RootRegistrar ABI, L2 registrations use the MakerRegistar ABI
{% endhint %}

{% tabs %}
{% tab title="Parameter Types" %}

```
{
    nftContractAddress: Address, // The Address of the NFT you want to Register
    nftId: Uint256, // Token ID of the NFT you want to Register
    creatorAddress: Address, // The Address receiving a cut of Maker rewards
    creatorSaleBasisPoints: Uint256 // The basis points set aside for the Maker
    optionBits: Uint256, // Parameter version of the Reaction you're using
    ipfsMetadataHash: String // Additional metadata saved with registration
}
```

{% endtab %}

{% tab title="MakerRegistrar ABI" %}

## Maker Registrar Contract Addresses

```
// Polygon Mainnet
0x47CD3266FA94E40613B37a88D98196325Cd28412

// Polygon Mumbai
0x06493B0362b3892EEc7C63023e8bC0C0c64646eb
```

## Maker Registrar Contract ABI

```typescript
Maker Registrar Contract ABI
{
  address: "0x06493B0362b3892EEc7C63023e8bC0C0c64646eb", // Mumbai Address
  abi:[{
    name: 'registerNft',
    stateMutability: 'nonpayable',
    type: 'function',
    inputs: [{
        internalType: 'address',
        name: 'nftContractAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'nftId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'creatorAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'creatorSaleBasisPoints',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'optionBits',
        type: 'uint256',
      },
      {
        internalType: 'string',
        name: 'ipfsMetadataHash',
        type: 'string',
      },
    ],
    outputs: [],
  }]
}
```

{% endtab %}

{% tab title="RootRegistrar ABI" %}

## Root Registrar Contract Addresses

```
// Ethereum Mainnet
0x2665Aa3846EC61e6D28A0d9F76b70047719F3664

// Goerli Mumbai
0x33066F8848967a16FC27bc1b2f347c9345Ed8b33
```

## Root Registrar Contract ABI

```typescript
Root Registrar Contract ABI
{
  address: "0x33066F8848967a16FC27bc1b2f347c9345Ed8b33", // Goerli Address
  abi:[{
    name: 'registerNft',
    stateMutability: 'nonpayable',
    type: 'function',
    inputs: [
      {
        internalType: 'address',
        name: 'nftContractAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'nftId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'creatorAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'creatorSaleBasisPoints',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'optionBits',
        type: 'uint256',
      },
      {
        internalType: 'string',
        name: 'ipfsMetadataHash',
        type: 'string',
      },
    ],
    outputs: [],
  }]
}
```

{% endtab %}

{% tab title="Example" %}

## Register a Reaction with `ethers.js` and `ipfs-http-client`

{% hint style="info" %}
See **MakerRegistar ABI** or **RootRegistrar ABI** tab for contract definitions
{% endhint %}

### \[Optional] Save Registration Metadata to IPFS

If you'd like to include a Reaction Name or Tags with your Reaction, you'll need to save that information to IPFS first.  If you just want to register a Reaction you can skip this step.

{% code overflow="wrap" %}

```typescript
import { client } from 'ipfs-http-client'

interface IRegistrationMetadata {
    name?: String;
    tags?: String[];
}

// Instantiate a new IPFS Client -- we use an IPFS node hosted by theGraph
const client = create(new URL('https://api.thegraph.com/ipfs/api/v0/'));

// Create a metadata blob to store comments and/or tags.
const registrationMetadata: IRegistrationMetadata = {
    name: "My Cool Reaction",
    tags: ["rara", "social", "curation"]
}

// Save registration metadata on IPFS to generate an ipfsCID.  Keep this ipfsCID handy as we'll use it in the next step.
const { ipfsCID } = await client.add(JSON.stringify(registrationMetadata));
```

{% endcode %}

### Register an NFT for use as a Reaction

To register a Reaction for use in the protocol, you'll use the `registerNft` function of either the `RootRegistrar` (a bridge for L1 NFTs) or the `MakerRegistrar` (for L2 NFTs).  All parameters are required (see the Parameters section for more details).

```typescript
import { Contract, constants } from 'ethers'

// Select an NFT to register as a reaction
const NFT = {
    contractAddress: 0x2953399124f0cbb46d2cbacd8a89cf0599974963,
    tokenId: 107136376226630408484522358727913128313617592685310283300071728450490266025985
}

// Instantiate the MakerRegistrar contract and attach a signer 
const MakerRegistrar = new Contract(
    makerRegistar.address, 
    makerRegistar.abi,
    signer
);

// Call the registerNft function with required parameters 
const transaction = await MakerRegistar.registerNft(
    NFT.contractAddress, // Contract Address of the NFT to register
    NFT.tokenId, // Token ID of the NFT to register
    constants.AddressZero, // creatorAddress
    constants.Zero, // creatorSaleBasisPoints
    constants.Zero, // optionBits
    ipfsCID // "QmUgmdW3N8tgh5hZXna4p7sHxqTAhvf7CZhguoLhE7NsgV"
);

// await completion of registerNft function call
const receipt = await transaction.wait()
```

This example uses the `MakerRegistrar` to register an L2 NFT.  If you'd like to register an L1 NFT, simply switch out the `MakerRegistrar` for the `RootRegistrar`.
{% endtab %}
{% endtabs %}

## Parameters

{% hint style="info" %}
All parameters are required
{% endhint %}

#### nftContractAddress

Contract Address of the NFT receiving reactions

#### nftTokenId

Token ID of the NFT receiving reactions

#### creatorAddress

The address of the creator of this NFT. If a `creatorAddress` is set, they will receive a portion of the Maker Rewards generated each time this Reaction is spent based on the following `creatorSaleBasisPoints` parameter.  Use `addressZero` to leave the `creatorAddress` parameter unset.

#### creatorSaleBasisPoints

Basis points allocated to the creator as a portion of the MakerRewards generated during a reaction sale.  Use `0` if no basis points should be allocated to the creator.

#### optionBits

This parameter can be used to create different versions of the reaction NFT. Use `0` if `optionBits` are not set.

#### IPFSMetadataHash

This parameter can be used to embed additional data about the user interaction.  Use `maxInt256` if `ipfsMetadataHash` is not set.

## Source Code

View the protocol on [Github](https://github.com/rara-social/rara-protocol/blob/088d1105a0b6667beb82f943e4109e9a3c8eba76/contracts/Maker/MakerRegistrar.sol#L80).


# React

React to an NFT using a RARA reaction. This will generate an NFT (“Like Token”) for the Reactor. Add metadata to the reaction by including an IPFS hash.

{% tabs %}
{% tab title="Parameter Types" %}

<pre class="language-javascript"><code class="lang-javascript"><strong>{
</strong>    transformId: Uint256, // The ID of the Reaction Transform you want to use
    quantity: Uint256, // The number of Reactions you'd like to send
    referrerAddress: Address, // The Address that should receive referrer cuts
    optionBits: Uint256, // Parameter version of the Reaction you're using
    takerNFTChainId: Uint256, // Chain ID of the NFT receiving the Reaction
    takerNFTAddress: Address, // Contract Address of the NFT receiving the Reaction
    takerNFTId: Uint256, // Token ID of the NFT receiving the Reaction
    curatorVaultOverride: Address, // Override used for alternate Curator Vaults
    ipfsMetadataHash: String // Additional metadata to be saved with Reaction
}
</code></pre>

{% endtab %}

{% tab title="ReactionVault" %}

## Reaction Vault Contract Addresses

```
// Polygon Mainnet
0xE5BA5c73378BC8Da94738CB04490680ae3eab88C

// Polygon Mumbai
0xA374674F97885BD378059708e97f7117CB74683d
```

## Reaction Vault Contract ABI

```typescript
Reaction Vault ABI
{
  address: "0xA374674F97885BD378059708e97f7117CB74683d", // Mumbai Address
  abi:[{
    name: 'react',
    stateMutability: 'payable',
    type: 'function',
    inputs: [
      {
        internalType: 'uint256',
        name: 'transformId',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'quantity',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'referrer',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'optionBits',
        type: 'uint256',
      },
      {
        internalType: 'uint256',
        name: 'takerNftChainId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'takerNftAddress',
        type: 'address',
      },
      {
        internalType: 'uint256',
        name: 'takerNftId',
        type: 'uint256',
      },
      {
        internalType: 'address',
        name: 'curatorVaultOverride',
        type: 'address',
      },
      {
        internalType: 'string',
        name: 'ipfsMetadataHash',
        type: 'string',
      },
    ],
    outputs: []
  }]
}
```

{% endtab %}

{% tab title="Example" %}

## Send a Reaction with `ethers.js` and `ipfs-http-client`

{% hint style="info" %}
See **ReactionVault** tab for contract definitions
{% endhint %}

### \[Optional] Save Reaction Metadata to IPFS

If you'd like to include a Comment or Tags with your Reaction, you'll need to save that information to IPFS first.  If you just want to send a Reaction you can skip this step.

{% code overflow="wrap" %}

```typescript
import { client } from 'ipfs-http-client'

interface IReactionMetadata {
    comment?: String;
    tags?: String[];
}

// Instantiate a new IPFS Client -- we use an IPFS node hosted by theGraph
const client = create(new URL('https://api.thegraph.com/ipfs/api/v0/'));

// Create a metadata blob to store comments and/or tags.
const reactionMetadata: IReactionMetadata = {
    comment: "My first comment using the RARA! Social Curation Protocol",
    tags: ["rara", "social", "curation"]
}

// Save reaction metadata on IPFS to generate an ipfsCID.  Keep this ipfsCID handy as we'll use it in the next step.
const { ipfsCID } = await client.add(JSON.stringify(reactionMetadata));
```

{% endcode %}

### Send a Reaction and Reaction Metadata to an NFT

To send a Reaction to an NFT, use the `react` function of the `ReactionVault`.  All parameters are required (see the Parameters section for more details).

```typescript
import { Contract, constants } from 'ethers'

// Select an NFT to receive the reaction
const TakerNFT = {
    chainId: 80001,
    contractAddress: 0x2953399124f0cbb46d2cbacd8a89cf0599974963,
    tokenId: 107136376226630408484522358727913128313617592685310283300071728450490266025985
}

// Instantiate a Reaction Vault contract and attach a signer 
const ReactionVault = new Contract(
    reactionVault.address, 
    reactionVault.abi,
    signer
);

// Call the React function with required parameters 
const transaction = await ReactionVault.react(
    102265098525112739997130475423667270810501597805004267158805479941320194430532, //transformId,
    1, //quantity
    constants.AddressZero, // referrerAddress
    constants.Zero, // optionBits
    TakerNFT.chainId, // takerNFT Chain ID
    TakerNFT.contractAddress, // takerNFT Contract Address
    TakerNFT.tokenId, // takerNFT ID
    constants.AddressZero, // curatorVaultOverride
    ipfsCID // "QmV3wpfESJdZTaY262rZMqGSmH8cV9ThDDxRaKDm1ZmoWs"
);

// await completion of React function call
const receipt = await transaction.wait()
```

{% endtab %}
{% endtabs %}

## Parameters

{% hint style="info" %}
All parameters are required
{% endhint %}

#### transformId

The ID of the reaction to be used. Only [registered](/protocol-features/register) reactions can be used.

#### quantity

The number of reactions to be sent. If value is sent, the reaction quantity must equal the `value / reactionPrice`

#### referrerAddress

The address of the referring party. If value is sent, the referrer will be rewarded with `value * saleReferrerBasisPoints`.  Use `addressZero` if no `referrerAddress` is set.

#### optionBits

This parameter can be used to create different versions of the reaction NFT. Use `0` if `optionBits` are not set.

#### takerNFTChainId

Chain ID of the NFT receiving reactions

#### takerNFTContractAddress

Contract Address of the NFT receiving reactions

#### takerNFTTokenId

Token ID of the NFT receiving reactions

#### curatorVaultOverride

This parameter allows for multiple Curator Vaults. Use `addressZero` if `curatorVaultOverride` is not set.

#### IPFSMetadataHash

This parameter can be used to embed additional data about the user interaction.  Use `maxInt256` if `ipfsMetadataHash` is not set.

## Source Code

View the protocol on [Github](https://github.com/rara-social/rara-protocol/blob/088d1105a0b6667beb82f943e4109e9a3c8eba76/contracts/Reactions/ReactionVault.sol#L575).


# Optional Curation Incentives

As of Release v1.1, RARA's protocol enables free curation or paid curation via purchasing and spending reactions in return for Curation Tokens.

## Free Reactions vs. Paid Reactions

The RARA protocol's **React** function can be called with or without sending value (MATIC).

* Free Reactions: build social graph; get like tokens
* Paid Reactions: (features of Free) + reward creators & owners. Invest in virality.&#x20;


# Buy Reactions

Once an NFT is registered in the protocol, users can purchase reactions based on the NFT. To do this, the caller interacts with the ReactionVault Contract by calling the “buyReaction()” function. The user will specify the Transform ID of the Reaction NFT to purchase and how many they would like to purchase.

When the Reaction is purchased, the protocol Payment Token and Reaction Price are looked up in the ParameterManager Contract and then used to determine how many payment tokens will be transferred from the caller’s wallet to the protocol. For example if the Payment Token is USDC and the reaction price is 1 USDC, then if the caller purchases 10 reactions, 10 USDC will be moved into the protocol from the caller’s address. These funds must be pre-authorized with an “approve” call on the payment token ERC-20 contract.

Once the payment has been received, the protocol will then mint ERC-1155 NFT contracts into the destination wallet specified by the buyer. These NFTs are non-transferable reactions and can only be spent (burned) in the protocol.

### Funds

When funds are used to purchase reactions, they are allocated in different buckets.

#### Referrer&#x20;

If the transaction includes an optional referrer address passed into the “buyReaction()” function call, that address will be assigned a percentage of the purchase price. This is provided to incentivize other protocols and applications to incorporate the RARA protocol.&#x20;

#### Curator Liability&#x20;

A majority of the funds will be set aside to be used when the purchased reactions are spent (burned) in the future.&#x20;

#### Maker and Creator&#x20;

The Maker, or owner who registered the NFT, will be allocated a percentage of the purchase price. If the Maker specified a Creator address when registering, they will also be allocated a percentage of the Maker’s amount.

The splits of the funds are defined by the parameters defined in the protocol and are stored in the ParameterManager Contract.

### Buy Reaction Function

![](https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2Fn8ko5shF1ySyc2OUntOw%2FScreen%20Shot%202022-04-11%20at%201.29.33%20PM.png?alt=media\&token=0a95530b-0c51-4cef-b85e-e7c19f37e5b8)

The `transformId` parameter should be looked up from previous NFT registrations in order to purchase the correct Reaction.  If an EOA account is buying reactions then `destinationWallet` should just be the account's address that is making the purchase, as this could be used to send the reactions to a different address if desired. &#x20;

If the `referrer` address is specified, that address will be credited a percentage of the purchase price.  If your application is facilitating and building web3 transactions for users to buy reactions, you should set your address in this parameter to earn rewards denominated in payment tokens for every purchase you facilitate.

The `optionBits` parameter can be left as `0` until further functionality has been implemented.


# Spend Reactions

Once a Reaction NFT has been purchased, it can be used by spending it on a Taker NFT. This Taker NFT can be any ERC-721 or ERC-1155 compliant contract on Ethereum mainnet or the Polygon L2. By spending a reaction on a Taker NFT, the reaction will be burned from the owner’s wallet and an on-chain event will tag the target NFT as the destination of the spend. To spend a reaction, the owner would call “spendReaction()” in the ReactionVault Contract. The spender will specify the details about the target Taker NFT, which reaction to spend, how many to spend, and some additional information.

When the reaction spend takes place, the protocol will look up the Curator Liability that was set aside for these reactions at purchase time and determine how to allocate the funds.

#### Referrer&#x20;

If the transaction includes an optional referrer address passed into the “spendReaction()” function call, that address will be assigned a percentage of the Curator Liability. This is provided to incentivize other protocols and applications to incorporate the RARA protocol.

The remaining funds will be used to buy Curation Tokens correlated to the Taker NFT. These Curation Tokens will then be split amongst the Taker NFT Owner and the account that spent the reactions. The allocation percent is set protocol wide in the ParameterManager Contract.

The Curation Tokens purchased for the spender are sent back to their wallet address. The Curation Tokens purchased for the Taker are stored in the ReactionVault Contract until they are claimed by the Taker.

### Curator Vault Override

Potentially different types of Curator Vaults can be incorporated into the protocol. For example, a time based event could be used where reaction spends are only valid during a specific period. If the protocol would like to use Curator Vaults other than the default, they can be whitelisted in the ParameterManager Contract. Once whitelisted, the reaction spender can specify to use the different Curator Vault in the “spendReaction()” function call.

### IPFS Metadata

Additional data may want to be associated with the reaction spend. This could be comments, labels, search terms, or any other data that is not storable on blockchain. If this metadata would like to be included in the reaction spend, the spender can store this metadata in IPFS and then pass through the IPFS hash to be included in the spend event, to permanently associate this IPFS data with the spend event.

### Spend Reaction Function

![](https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FVf4s09ejNlMowqD4fYNQ%2FScreen%20Shot%202022-04-11%20at%201.36.11%20PM.png?alt=media\&token=447142f6-bf99-4ba2-9850-61c45a2c91ac)

Unspecified optional parameters should be set to `0` or the `0x0` address.


# Curation Tokens

Curation Tokens are a way for users to speculate on the virality of a Taker NFT and are minted to the spender of a Reaction in response to that user curating in the protocol. When a reaction is spent/burned, the associated Curator Liability associated with that reaction is used to buy ERC-155 compliant Curation Tokens for the target Taker NFT. The purchased Curation Tokens are then split between the Spender and the Taker who owns the NFT.

Each Taker NFT has a unique bonding curve that tokens can be bought and sold into. The only way to buy a Curation Share is to spend a reaction on that Taker NFT. Once purchased, Curation Shares can be transferred to other addresses or sold back into the bonding curve.

#### Sigmoid Curve

The bonding curve for Curation Tokens is shaped as a sigmoid curve. Token supply starts at 0 and early investors get a low price. Once other investors start buying in, the price starts to rise. Once a large number of tokens have been issued, the growth in the price levels off. There is high risk to reward in the beginning and low risk to reward at the end.

![](https://lh5.googleusercontent.com/6wCRaCdOmsSDufs-YkfW2n6x7hcXDBKZg2NJA9YrI5NVBw3rTnJO-a9q5L_9h-YH4cgFQpFqtU_OcWaRIl56682Pcbxqas9aPPdVQRcWhvX06mPT1mSHNbR2HN6agdrTog4qbJhF)

The curve for technology adoption matches a sigmoid curve where early adopters slowly buy into new technology, it gains some traction and goes vertical, and then levels off once the majority of users have joined in.

![](https://lh5.googleusercontent.com/8nhkgkVsV_5fNnHYSzg7lyvICSqMDsZxT3ADh3z2GbRCcCRcBm4B_7BIa89JnlADQ2Raxp-oHHRMWOOLaNtNZtnEC4EMKWpb5ZjWsGScsdCsF6N265RQCjYULY_9ezut4aVeAKiE)

Users curating NFTs will have to determine when to sell their accumulated Curation Shares for a specific NFT. If they think the NFT will gain more traction and have more reactions spent against it, they are incentivized to hold on to the tokens as they will appreciate in value. If they think the NFT has reached its peak in virality and no more reactions will be spent against it, then they should sell. This individual decision among many players allows the protocol to show aggregate sentiment towards NFTs and which NFTs are gaining traction and which NFTs are lagging behind.

#### Taker Rewards

On each Reaction Spend, the Taker is allocated a percentage of the Curation Tokens bought from the bonding curve. To accumulate these rewards, the Taker does not need to interact with the protocol. Only when they would like to claim the rewards would they need to prove ownership of the Taker NFT to the protocol. These unclaimed Curation Tokens will be held in the ReactionVault Contract until they are claimed by the NFT owner.

#### **Claiming Taker Rewards**

To claim the Curation Token rewards accumulated to a Taker NFT, the current owner of the NFT must prove ownership of the NFT before they can claim rewards. To do this, the owner must register the NFT into the protocol. This is the same process as registering an NFT in the protocol in order to sell Reactions. Likewise, the owner can specify a percentage of any rewards that should go to the creator of the NFT in order to support royalty schemes between the current owner and the original creator or artist.

Once the NFT is registered in the protocol, the Taker can claim the rewards by calling “withdrawTakerRewards()” in the ReactionVault Contract. This logic will then sell any accumulated Curation Tokens. If the Taker specified a Creator to split rewards with during the registration process, the percentage will be set aside for the creator, and the remaining amount of payment tokens from the Curation Token sale will be sent to the Taker.

### Claim Function

![](https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FMnyVDehO64Qhe30TyjPM%2FScreen%20Shot%202022-04-11%20at%201.43.56%20PM.png?alt=media\&token=619194f0-7b58-4928-b224-64e5642d7acb)

When calling the function to claim Taker Rewards, the calling account must be the same account that registered the NFT in the protocol.

Both the active Payment Token in the protocol and the default Curator Vault addresses can be looked up in the `ParameterManager` contract on chain.

The `curatorTokenId` is the ERC-1155 token ID that is being sold.

The `tokensToBurn` is simply the amount that the owner is requesting to be claimed and sold and then all proceeds will be sent to the `refundToAddress`.

### Transferring NFTs and Impacts on Rewards

Since the RARA protocol lives on more than one blockchain and can use NFTs on both Ethereum Mainnet and Polygon, it does not actively look up NFT owner addresses during day to day interactions.  Instead, when the NFT is registered, it stores and caches the current owners address in the MakerRegistrar.sol contract on Polygon.  This address is then used for allocating rewards.  This means that when you sell or transfer your registered NFT, the protocol does not automatically know this has happened.

If you move your NFT to a new address, simply re-register the NFT with the new account and the new owner address will be updated.

If you currently have accumulated Rewards, claim them before selling or transferring the NFT as the new owner could come claim ownership and withdraw the previously accumulated rewards.

If you acquire an NFT that was previously registered under a different owner, re-register the NFT so that only you can claim any new rewards that are generated.


# Claiming ERC20 Rewards

In the following scenarios, ERC20 payment tokens will be set aside as rewards to be claimed at a future date. Each owner of these rewards can let them accumulate and withdraw them at any point.

#### Maker Reward

Awarded to the owner who registered an NFT whenever a Reaction is purchased based on that NFT.

#### Maker Creator Reward

Awarded to the Creator of an NFT whenever a Reaction is purchased based on that NFT. The Maker must specify this Creator and percentage cut when registering the NFT.

#### Purchase Referrer Reward

Awarded to the application or user who facilitated the purchase of a Reaction. The referrer address is included in the purchase transaction parameters.

#### Spend Referrer Reward

Awarded to the application or user who facilitated the spending of a reaction against a Taker NFT. The referrer address is included in the spend transaction parameters.

#### Taker Creator Reward

Awarded to the Creator of an NFT whenever the associated Taker claims rewards and sells Curation Tokens. The Taker must specify this Creator and percentage cut when registering the NFT.

Each of these rewards are allocated for a specific address and payment token. If the same account or address is used for multiple purposes, all rewards will accumulate in the same manner for that account. These rewards can be looked up via the “ownerToRewardsMapping” mapping in the ReactionVault Contract.

To claim any rewards, the function “withdrawErc20Rewards()” must be called in the Reaction Vault Contract. The logic will look up the balance of the rewards for the calling account and transfer the balance of rewards to that account.

### Claim Function

![](https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2Fr5wQBj7soRnxCKUJ6vsT%2FScreen%20Shot%202022-04-11%20at%201.48.35%20PM.png?alt=media\&token=823600db-fcac-46f4-97b7-5cedde7c18ea)

Any address that has accumulated tokens can call the claim function and any owed tokens will   transferred back to that address.

The current active payment token address can be queried from the `ParameterManager` contract in the protocol.


# GraphQL Subgraph

View protocol curation graph data using graphQL

### GraphQL Subgraph&#x20;

The Graph is an indexing protocol for organizing blockchain data and making it easily accessible with GraphQL. RARA has developed a subgraph to make RARA protocol data easily available.

* [theGraph Playground](https://thegraph.com/hosted-service/subgraph/rara-social/rara-social-curation-protocol)

### Entity Definitions

* **Source**: a “Source” entity represents an external NFT that has been registered with the RARA protocol for use as a reaction.&#x20;
* **Transform**: a “Transform” entity represents a specific version of an external NFT that has been registered with the RARA protocol for use as a reaction. This concept allows for multiple versions of an external NFT to be represented in the RARA protocol.&#x20;
* **Reaction**: a “Reaction” entity represents a transform that has been purchased by a user to use as a reaction to a curated NFT.
* **UserReaction**: a “UserReaction” entity is a representation of a single reaction owned by a single user.&#x20;
* **UserSpend**: a “UserSpend” entity is a representation of a specific use of a reaction to a curated NFT by a user. This entity includes the user’s NFT exhibit tags and comments. ​​
* **CuratorVaultToken**: a “​​CuratorVaultToken” entity represents an external NFT that has been curated with the RARA protocol.
* **UserSell**: a “UserSell” entity is created each time a user sells curation tokens.
* **UserPosition**: a “UserPosition” entity represents a user’s balance in a specific ​​CuratorVaultToken&#x20;
* **UserEarning**: a “UserEarning” entity represents a single user’s royalty earnings.

### Contract Event Diagram&#x20;

This diagram illustrates the relationship between contract functions, contract events, and the graph entities:

* [Contract Event Diagram](https://docs.google.com/drawings/d/1KvYW_xUW6QL3wyIvNb-t4BnOA-fzm9zOwyiaoDrQr4E/edit?usp=sharing)

### Source Code

* Entity Schema
  * [Schema](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/schema.graphql)
* Event Mappings
  * [MakerRegistrar](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/MakerRegistrar.ts)
  * [ReactionVault](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/ReactionVault.ts)
  * [CuratorVault](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/CuratorVault.ts)


# Event Diagram

Contracts, Events, and GraphQL entities

## Event Diagram

<figure><img src="https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2F3HXm2ntruXiRtZFVzZ1d%2FGraph%20Data%20Flow%20-%201.1.png?alt=media&amp;token=284c748b-c45d-4138-8b02-fa7b749e0860" alt=""><figcaption><p>Relationships between contract functions, contract events and graphQL entities</p></figcaption></figure>


# Permissions

The RaRa protocol is managed via a permission system implemented in the AddressManager.sol contract.  This allows specified addresses on the chain to take administrative actions.  These include:

* Updating contract implementations
* Updating parameters (such as the price of 1 reaction)
* Updating protocol addresses
* Updating the default Bonding Curve implementation
* Others

It should be noted that there is some risk associated with upgradeable contracts and parameter management, but in no way can anyone or any contract involved in the protocol take ownership of your NFTs or move them in any manner.  To use the protocol, you only prove ownership of an NFT at registration and do not give any approvals to the protocol for the NFT or move the NFT in any protocol owned contracts or addresses.

#### Administrative Multisig

The protocol is currently managed via a 2-of-4 Gnosis multisig wallet by the team.  This will ensure multiple parties are responsible for managing any changes to the protocol and allow multiple confirmations from different members before any changes go into effect.&#x20;


# Source Code

### Github Repo

See the Github Repo for source code and code level documentation.

<https://github.com/rara-social/rara-protocol>

### Contract Addresses

The latest deployment addresses for each network are stored in the deployment artifacts.  The main protocol runs on the Polygon network, but testnet deployments can be found on Mumbai.

<https://github.com/rara-social/rara-protocol/tree/main/deployments>

### Registration

* MakerRegistrar.sol
* IMakerRegistrar.sol
* MakerRegistrarStorage.sol
* NftOwnership.sol

### Reactions

* ReactionVault.sol
* IReactionVault.sol
* ReactionVault.sol
* ReactionNFT1155.sol

### Curation Tokens

* SigmoidCuratorVault.sol
* SigmoidCuratorVaultStorage.sol
* ICuratorVault.sol
* CuratorToken1155.sol
* Sigmoid.sol
* ExtendedMath.sol

### Chain Bridge

* ChildRegistrar.sol
* RootRegistrar.sol

### Protocol Administration

#### Parameters

* ParameterManager.sol
* IParameterManager.sol
* ParameterManagerStorage.sol

#### Permissions

* RoleManager.sol
* IRoleManager.sol
* RoleManagerStorage.sol

#### Address Manager

* AddressManager.sol
* IAddressManager.sol
* AddressManagerStorage.sol


# GraphQL Subgraph

View and query RARA Protocol data via theGraph

### GraphQL Subgraph&#x20;

* [theGraph Playground](https://thegraph.com/hosted-service/subgraph/rara-social/rara-social-curation-protocol)
* HTTP API&#x20;
  * <https://api.thegraph.com/subgraphs/name/rara-social/rara-social-curation-protocol> -&#x20;
* WebSocket API&#x20;
  * wss\://api.thegraph.com/subgraphs/name/rara-social/rara-social-curation-protocol

### Entity Definitions

* **Source**: a “Source” entity represents an external NFT that has been registered with the RARA protocol for use as a reaction.&#x20;
* **Transform**: a “Transform” entity represents a specific version of an external NFT that has been registered with the RARA protocol for use as a reaction. This concept allows for multiple versions of an external NFT to be represented in the RARA protocol.&#x20;
* **Reaction**: a “Reaction” entity represents a transform that has been purchased by a user to use as a reaction to a curated NFT.
* **UserReaction**: a “UserReaction” entity is a representation of a single reaction owned by a single user.&#x20;
* **UserSpend**: a “UserSpend” entity is a representation of a specific use of a reaction to a curated NFT by a user. This entity includes the user’s NFT exhibit tags and comments. ​​
* **CuratorVaultToken**: a “​​CuratorVaultToken” entity represents an external NFT that has been curated with the RARA protocol.
* **UserPosition**: a “UserPosition” entity represents a user’s balance in a specific ​​CuratorVaultToken&#x20;
* **UserEarning**: a “UserEarning” entity represents a single user’s royalty earnings.

### Contract Event Diagram&#x20;

This diagram illustrates the relationship between contract functions, contract events, and the graph entities:

* [Contract Event Diagram](https://docs.google.com/drawings/d/1KvYW_xUW6QL3wyIvNb-t4BnOA-fzm9zOwyiaoDrQr4E/edit?usp=sharing)

### Source Code

* [Schema](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/schema.graphql)
* Mappings
  * [MakerRegistrar](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/MakerRegistrar.ts)
  * [ReactionVault](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/ReactionVault.ts)
  * [CuratorVault](https://github.com/rara-social/rara-protocol/blob/main/subgraph/src/mapping/CuratorVault.ts)


# Integration Guide

This guide is intended for software developers that wish to programmatically interact with the RARA protocol and/or consume & analyze RARA protocol data.

### Protocol Goals&#x20;

RARA is a social curation protocol open to anyone wishing to curate NFTs with others. The objectives of the protocol are: Reward discovery and curation of NFTs; Enable personal expression through NFT-backed reactions; and Create public, composable curation data.

Curation is the act of adding context and, in the case of RARA, social context. Protocol users add social context to NFTs by burning NFT-based reactions on NFTs. The media of the curated NFT and the media of each Reaction create a media graph of society’s most loved NFTs.&#x20;

### Protocol Summary&#x20;

NFTs owners can register their NFTs to be sold as Reactions. Reactions are purchased and burned in order to curate and comment on NFT’s. The USDC value of the reaction is deposited in a bonding curve; each curated NFT has a separate bonding curve. When a reaction is burned the user receives Curator Tokens which represent shares of the bonding curve. Curator Tokens can be redeemed for USDC


# Protocol Interactions

There are five main contract interactions in the RARA protocol:&#x20;

* Comment/React on a NFT
* Sell Curator Tokens&#x20;
* Register an NFT for use as a reaction&#x20;
* Withdraw Royalties&#x20;
* Withdraw Taker Rewards&#x20;

### Comment/React to an NFT&#x20;

The main interaction in the RARA protocol is reacting to NFTs. This is a two-step process: 1) buying reactions using USDC, and 2) spending reactions. When a reaction is spent the underlying USDC is moved into the curated NFT’s bonding curve and the user is issued CuratorVault tokens.

* Contract Source Code: [ReactionVault](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol)
* ABI: [ReactionVault.json](https://github.com/rara-social/rara-protocol/blob/main/deployments/polygon/ReactionVault.json)&#x20;
* Chain: Polygon (137)&#x20;
* Deployed Address: [0xE5BA5c73378BC8Da94738CB04490680ae3eab88C](https://polygonscan.com/address/0xE5BA5c73378BC8Da94738CB04490680ae3eab88C)
* Functions&#x20;
  * [buyReaction()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol#L115-L138)
  * [spendReaction()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol#L348-L379)
  * [react()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol#L575-L626)

### Sell Curator Tokens

Users can redeem curator tokens for USDC.

* Contract Source Code: [SigmoidCuratorVault](https://github.com/rara-social/rara-protocol/blob/main/contracts/SigmoidCuratorVault/SigmoidCuratorVault.sol)&#x20;
* ABI: [SigmoidCuratorVault.json](https://github.com/rara-social/rara-protocol/blob/main/deployments/polygon/SigmoidCuratorVault.json)&#x20;
* Chain: Polygon (137)&#x20;
* Deployed Address: [0x7D278Aa2d95ABa7C969c9F316be6f0cFE0D18A50](https://polygonscan.com/address/0x7D278Aa2d95ABa7C969c9F316be6f0cFE0D18A50)&#x20;
* Functions&#x20;
  * [sellCuratorTokens()](https://github.com/rara-social/rara-protocol/blob/main/contracts/SigmoidCuratorVault/SigmoidCuratorVault.sol#L175-L220)&#x20;

### Register an NFT to use as a Reaction

NFTs owners can register their NFTs to be sold as Reactions. The MakerRegistrar contract will attempt to use the royalty registry contracts (EIP2981) to honor creator royalties. The MakerRegistrar contract registerNFT function also includes optional parameters to set creator addresses and royalty amounts; these values will be used if the NFT is not present in the royalty registry.

Polygon NFT’s:&#x20;

* Contract Source Code: [MakerRegistrar](https://github.com/rara-social/rara-protocol/blob/main/contracts/Maker/MakerRegistrar.sol)&#x20;
* ABI: [MakerRegistrar.json](https://github.com/rara-social/rara-protocol/blob/main/deployments/polygon/MakerRegistrar.json)&#x20;
* Chain: Polygon (137)&#x20;
* Deployed Address: [0x47CD3266FA94E40613B37a88D98196325Cd28412](https://polygonscan.com/address/0x47CD3266FA94E40613B37a88D98196325Cd28412)&#x20;
* Functions&#x20;
  * [registerNFT()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Maker/MakerRegistrar.sol#L78-L116)&#x20;
  * [deregisterNFT()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Maker/MakerRegistrar.sol#L217-L232)

Ethereum Mainnet NFT’s:&#x20;

* Contract Source Code: [RootRegistrar](https://github.com/rara-social/rara-protocol/blob/main/contracts/Bridge/RootRegistrar.sol)&#x20;
* ABI: [RootRegistrar.json ](https://github.com/rara-social/rara-protocol/blob/main/deployments/mainnet/RootRegistrar.json)
* Chain: Ethereum Mainnet (1)&#x20;
* Deployed Address: [0x2665Aa3846EC61e6D28A0d9F76b70047719F3664](https://etherscan.io/address/0x2665aa3846ec61e6d28a0d9f76b70047719f3664)&#x20;
* Functions&#x20;
  * [registerNFT()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Bridge/RootRegistrar.sol#L43-L91)&#x20;
  * [deregisterNFT()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Bridge/RootRegistrar.sol#L93-L113)&#x20;

### Withdraw Royalties&#x20;

Royalties are generated by protocol activity. There are three types of royalties: “Maker rewards” are paid to the owner of the reaction when a reaction is sold, “Creator rewards” which are paid to the creator of the reaction when a reaction is sold, and “Referrer rewards”, which are paid to the referrer of the transaction when a reaction is sold or spent.

* Contract Source Code: [ReactionVault](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol)&#x20;
* ABI: [ReactionVault.json](https://github.com/rara-social/rara-protocol/blob/main/deployments/polygon/ReactionVault.json)&#x20;
* Chain: Polygon (137)&#x20;
* Deployed Address: [0xE5BA5c73378BC8Da94738CB04490680ae3eab88C](https://polygonscan.com/address/0xE5BA5c73378BC8Da94738CB04490680ae3eab88C)&#x20;
* Functions&#x20;
  * [withdrawErc20Rewards()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol#L590-L612)&#x20;

### Withdraw Taker Rewards

When a reaction is spent a portion of the reaction’s underlying USDC is spent on curator tokens that are reserved for the owner of the curated NFT (the “Taker”). The Taker can redeem their curator tokens for USDC using the function below. Note: the curated NFT must be registered via the MakerRegistrar contract in order to prove ownership before the withdrawTakerRewards() function is called.

* Contract Source Code: [ReactionVault](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol)&#x20;
* ABI: [ReactionVault.json](https://github.com/rara-social/rara-protocol/blob/main/deployments/polygon/ReactionVault.json)&#x20;
* Chain: Polygon (137)&#x20;
* Deployed Address: [0xE5BA5c73378BC8Da94738CB04490680ae3eab88C](https://polygonscan.com/address/0xE5BA5c73378BC8Da94738CB04490680ae3eab88C)&#x20;
* Functions&#x20;
  * [withdrawTakerRewards()](https://github.com/rara-social/rara-protocol/blob/main/contracts/Reactions/ReactionVault.sol#L624-L734)


# Security and Vulnerability Reporting

#### Reporting

RARA is currently working on setting up a responsible disclosure based bug bounty program.  Until that is formally launched, please chime in on the "support-help" channel in our discord server to initiate a private discussion about any possible vulnerabilities or security concerns.

{% embed url="<https://discord.gg/yAmrRhNT>" %}

#### Audit

The protocol smart contracts were audited by Quantstamp and finalized in May of 2022.  Details of the audit can be found in the source [repo on Github](https://github.com/rara-social/rara-protocol).


# FAQ

**Do I need to transfer or give any approvals for an NFT I own to use RaRa?**

No.  When you register an NFT, the smart contracts will only verify that the calling address currently owns the NFT.  The RaRa protocol will not move your NFT and you will not need to wrap it in the protocol or provide any allowances to do so.

**When I register my NFT I see a symbol on Etherscan that says "Error in internal Transaction: Reverted" even though the overall transaction was successful.  What does this mean?**

You may see this symbol next to a register transaction even though the registration is successful.  This simply means that one of the internal calls made by the smart contract failed.  When verifying ownership of an NFT, the smart contracts try several methods to determine this and one of them may fail even if another one succeeds.  As long as the overall transaction was not failed/reverted the registration is successful and you can proceed to use it in the protocol.

![](https://649352923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg1ALwzq64rcdnV8nMWhu%2Fuploads%2FbC3wIFpng7Cf1ih6qs3p%2FScreen%20Shot%202022-05-26%20at%2012.33.15%20PM.png?alt=media\&token=58a6593e-1e69-4de5-8bf2-2501e3ba207f)

**What chains does the protocol support?**

All of the business logic for the RaRa protocol runs on the L2 Polygon network.  However NFTs on both Mainnet Ethereum and Polygon can be registered into the protocol.  If you register an NFT on Mainnet Ethereum, it may take up to 30 minutes for the L1->L2 bridge functionality to propagate up to Polygon.


