# Aria Protocol Docs

Welcome to the documentation for Aria Protocol

This document serves as a comprehensive resource for both new users and technically inclined users looking to understand or build on the Aria Protocol.

### **For New Users**

We recommend starting with the **Quickstart Guide**, available at [Quickstart Guide](/about-aria/quickstart-guide).  which walks you through the entire onboarding process — from creating a wallet and funding it with $IP (used for transaction fees) to staking your tokens and earning royalty rewards.

### For Developers and Technical Users

For technical users or developers, we have extensive documentation available under the [Technical Docs](/technical-docs/contract-docs) section. This includes detailed explanations of system architecture, fund flow, admin permissions, liquidity mechanics, and smart contract interfaces — everything you need to understand how Aria works under the hood.


# What is Aria Protocol?

Aria Protocol is the onchain Protocol enabling investors to access and earn from iconic IP RWA (Intellectual Property Real-World Assets). Built on Story, the purpose built L1 blockchain for IP, Aria Protocol brings IP rights, starting with music, onchain as fungible, liquid tokens.&#x20;

At present, the ecosystem is made up of three parts:\
**Aria Protocol**, the infrastructure\
**Aria Foundation**, the steward\
**Aria Protocol Labs Inc.**, a core development company

Together, they bring iconic IP rights onchain as fungible and liquid crypto assets expanding accessibility and monetization of historically illiquid IP for investors, rights holders, creators, and fans.

### **Aria Protocol**

Aria Protocol is the onchain infrastructure enabling investors to access and earn from iconic IP RWA (intellectual property real-world assets). It does this by bringing real-world IP rights, starting with music, onchain as fungible and liquid crypto assets. The Protocol is not owned or operated by any single entity.&#x20;

### What can you do with Aria Protocol?

Aria Protocol enables investors to access and earn from intellectual property (IP) rights, something that was previously inaccessible to all but the biggest players. IP rights are tokenized on the Protocol as IP RWA tokens (Intellectual Property Real-World Asset tokens), making them fungible and liquid.&#x20;

With $APL, the first IP RWA token launched on Aria Protocol, holders are entitled to receive a share of royalties generated by the underlying IP assets. Users can hold and stake tokens to keep collecting royalties, or sell them to another buyer on a decentralized marketplace.

Aria Protocol additionally enables rights holders to make their IP remixable. As demonstrated by the launch of 3 songs by acclaimed Korean artist and actress NANA, in combination with a Global Remix Contest, producers are able to remix the tracks with all submissions having the chance to win prizes and a worldwide label release. The income from the released remixes will be tokenized on the Aria Protocol, with the net royalties flowing to both remixers and $APL holders.&#x20;

### How does Aria Protocol work?

Aria Protocol enables users to purchase IP RWA (Intellectual Property Real World Assets) tokens that they can access and earn from.&#x20;

In the case of $APL, the first IP RWA token on Aria Protocol, it is linked to a portfolio of real-world royalty-generating music catalog rights where stakers are eligible to receive a portion of such royalties, with the IP rights acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.).&#x20;

There were three basic steps in the lifecycle of $APL: Fundraising, Staking, and Royalty Collection.

#### Step 1: Fundraising

Before the $APL intellectual property rights were tokenized and royalties could be distributed, rights were acquired. Funds for the $APL portfolio were raised via the Stakestone LiquidityPad. Aria Management Company (affiliated with Aria Protocol Labs Inc.) then finalized the purchase of the intellectual property rights and began collecting the royalties associated with the purchased IP assets offchain. The users who participated in the fundraiser claimed their $APL tokens representing the assets, proportional to the amount that they contributed to the fundraiser. &#x20;

#### Step 2: Staking

Once the royalty rights to the underlying intellectual property were tokenized and distributed to users, users were able to stake their holdings in order to earn royalties. While staked, users will earn royalties associated with the underlying $APL assets.

#### Step 3: Royalty Collection

Once staked, an $APL token becomes a $stAPL token, a staked version of the token that accrues royalties over time.&#x20;

For example:  &#x20;

At launch, the exchange rate is 1:1 (1 $stAPL = 1 $APL). As royalties from the portfolio are collected offchain and used to buy back $APL on the open market, those tokens are deposited into the staking pool, increasing the amount of $APL backing each $stAPL.

As a result, the value of $stAPL gradually increases relative to $APL.&#x20;

To realize these rewards, users have two options:

**Option 1:** Unstake via Aria WebApp&#x20;

\* They go to the Aria Protocol webapp and click on the Stake tab

\* Unstake any amount of their $stAPL

\* Their $stAPL is then burned automatically, and the equivalent amount of $APL is sent to their wallet at the current exchange rate

They can then choose to hold or restake, or may be able to convert their $APL into other tokens via a DEX, if available for trading.<br>

**Option 2:** Swap $stAPL on a DEX&#x20;

They can trade their $stAPL for $APL directly on a supported DEX (if available for trading). They can similarly choose to hold, stake, or convert their $APL into other cryptocurrencies or fiat.

\* Exchange $stAPL for $APL at current market rates

\* They retain full flexibility

Please note, the DEX market price may not reflect the onchain exchange rate due to arbitrage so be sure to check prices before swapping.

Once they have $APL again, they can restake to continue earning, or sell it for USDC or other assets via decentralized exchanges.

Don’t worry if this sounds technical. Aria Protocol’s platform provides a clean user experience with guided steps, and a full help center to walk you through everything.

### What exactly are IP RWA tokens?

IP RWA stands for Intellectual Property Real World Assets, a new asset class at the heart of how Aria Protocol operates. Historically, access to valuable intellectual property rights has been limited to large institutions and industry insiders. Aria Protocol changes that by bringing IP rights onchain through IP RWA tokens.

IP RWA Tokens are ERC-20 tokens built on the Story blockchain. They are fungible tokens backed by a portfolio of real world IP asset rights, acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.). By tokenizing IP rights in this way, Aria Protocol makes it possible for anyone to access and earn from assets that were previously illiquid and inaccessible.

<br>


# The Aria Foundation

The Aria Foundation is the independent steward operating Aria Protocol. It manages ecosystem resources and community programs, represents the Protocol publicly, and oversees community governance (when implemented). The Foundation also coordinates with contributors and builders like Aria Protocol Labs Inc. to deliver core applications and grow adoption. It also supports partnerships, and ensures that IP monetization is transparent and accessible.

The Foundation’s mission is to grow the IP RWA market by expanding access to and monetization of historically illiquid IP rights through the Protocol.


# Aria Protocol Labs Inc.

Aria Protocol Labs Inc. is a core development company contracted by the Aria Foundation to build applications and tools for Aria Protocol. Aria Protocol Labs Inc. develops early user experiences, onboards creators and partners, and accelerates adoption of IP rights-backed assets. While Aria Protocol Labs Inc. is a key contributor today, the Protocol may continue to grow through many builders in the future.


# Quickstart Guide

This quickstart guide will tell you everything you need to know about getting started with Aria Protocol. It will cover everything you need to know, even if you have never used crypto before.

Aria Protocol’s quickstart guide covers

\* Terminology you may encounter

\* How to get and link a wallet

\* Seeding your wallet with $IP to pay transaction fees

\* Claiming assets (for StakeStone depositors)

\* Earning royalties from your assets

\* Collecting earned royalties

These are all the basic components on how you can get started on Aria Protocol, and start earning royalties

<br>


# Terminology

When using Aria Protocol, you may come across a few key terms that are central to how the protocol works. This page provides a concise overview of those terms and what they mean in context.

### Story and $IP

Story is the Layer 1 blockchain that Aria Protocol is built on. As a foundational network, all transactions and smart contract operations on Aria Protocol are executed directly on Story.

$IP is the native token of the Story blockchain. Within the Aria ecosystem, it’s primarily used to pay for gas fees, the transaction fees that keep the network secure and running efficiently.

To learn more about Story, visit Story’s [official documentation](https://docs.story.foundation/introduction).

### IP RWA

IP RWA stands for \*Intellectual Property Real World Asset\* and denotes a category of token. IP RWA tokens are fungible tokens backed by a portfolio of real world IP asset rights, acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.). These are fungible and liquid crypto assets.&#x20;

\> Many IP RWA tokens may be launched on Aria Protocol, each backed by different IP rights assets.

Explore the [IP RWA technical documentation](https://docs.ariaprotocol.xyz/technical-docs/aria-protocol/tokens-and-nfts/iprwa).

### stIPRWA

stIPRWA refers to Staked IP RWA token. When users stake an IP RWA token on Aria Protocol, they receive stIPRWA in return, for example staking $APL for $stAPL.&#x20;

In the case of $APL, this token accrues royalties over time and must be staked to earn royalties.&#x20;

There is no lock-up period enforced by the Protocol for stakers. Users can unstake anytime, though some campaigns may offer incentives for longer staking.

Learn more in the [stIPRWA documentation](https://docs.ariaprotocol.xyz/technical-docs/aria-protocol/tokens-and-nfts/stiprwa).

### $APL

$APL stands for the Aria Premiere Launch token and is the first IP RWA token launched on Aria Protocol. $APL tokens represent the Aria Premiere Launch catalog, a collection of partial income rights to 48 iconic songs acquired to date from the $10.95 million USDC raised using StakeStone’s LiquidityPad. Following the launch of remixable IP and the Aria Global Remix Contest featuring 3 songs from South Korean artist and actress NANA, the token will also be linked to any remixes of the 3 tracks released by a label.&#x20;

Each $APL token is a fungible token backed by iconic music rights acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.).  Holders, as owners of the $APL token, are entitled to receive a share of royalties generated by the underlying IP assets.

### DEX

DEX stands for Decentralized Exchange. These platforms allow users to trade cryptocurrencies directly with one another without relying on a centralized intermediary. DEXs operate on blockchain infrastructure, offering enhanced privacy and allowing users to maintain custody of their assets and private keys.

### CEX

CEX stands for Centralized Exchange. These are traditional trading platforms run by centralized entities that facilitate buying and selling of cryptocurrencies. CEXs typically offer greater liquidity, fiat onramps, and user-friendly experiences but require users to trust the exchange with their assets and personal data. Most CEXs also require KYC compliance.

<br>


# Getting and Linking a Wallet

Aria Protocol can be used with any WalletConnect compatible wallet. If you don't have a wallet yet, we recommend using MetaMask. MetaMask has [instructions on their website](https://support.metamask.io/start/getting-started-with-metamask/) to help you set up your own wallet.

If you participated in the Aria Premiere Launch via StakeStone, you MUST connect the same wallet you used to deposit USDC in order to claim your tokens! If the wallet you used is not WalletConnect-compatible, then you may link it to a compatible wallet, through a process such as [this one](https://support.metamask.io/start/how-to-import-an-account/).

## Linking the Wallet

In the top right corner, there is a button that says **Connect Wallet**. Upon pressing it, you will be greeted with a screen like this:

<figure><img src="/files/N273d3MGiANa4S8inPyK" alt=""><figcaption></figcaption></figure>

In our example, since we are using MetaMask, we will click on MetaMask, and be greeted with a screen prompting for you to connect your wallet.

<figure><img src="/files/smhi64x7xVrNlmkZVg8r" alt=""><figcaption><p>The wallet connection prompt in MetaMask</p></figcaption></figure>

Simply press connect and approve the connection, then you will have a wallet connected to Aria!


# Purchasing $IP

To transact on the Story blockchain, the Layer 1 network that powers Aria Protocol, you’ll need $IP to cover gas fees. These fees are small payments required to process transactions and help maintain the stability and security of the Story network.

How much you should purchase depends on the amount of transactions you will do, but transactions are generally cheap. In general, most users won't need more than one $IP, unless they are making lots of transactions. For a more in depth look, we have an entry in our FAQ detailing how much transactions cost [FAQ](/faq#how-much-usdip-should-i-buy)

## Centralized Exchange

One of the easiest ways to purchase $IP is from a Centralized Exchange. It allows you to easily purchase cryptocurrency with a debit card or bank account. However, in order to make these transactions, they generally require **KYC verification**. This is where you must prove your identity to the exchange before making transactions, similar to how you must prove your identity to open a bank account.

One of the exchanges that offers the ability to purchase $IP is \*\*Coinbase\*\*. You can find the $IP token [on Coinbase at this link](https://www.coinbase.com/price/ip).

<figure><img src="/files/QLu0tEdeUsVoSDrgOwqt" alt=""><figcaption><p>Purchasing the $IP from Coinbase</p></figcaption></figure>

You can simply link a debit card, and place an order to buy $IP. Once your order goes through, you will be able to send the $IP you purchased off of Coinbase, and into your wallet. For MetaMask, you will click on the "Receive" button in order to get the address of your wallet.

<figure><img src="/files/XLxmQlKhyjcqMgOFk6TY" alt=""><figcaption><p>Getting the address to your wallet</p></figcaption></figure>

You will then see a screen like this, which shows you the address of your wallet. This is how your wallet is identified on the blockchain, and how Coinbase will know where to send the funds.

<figure><img src="/files/1DcXyA8vmoOFEtkSGrQq" alt=""><figcaption><p>Copying your wallet address</p></figcaption></figure>

Once you have your address, you will want to copy it so you can paste it into Coinbase later.

<figure><img src="/files/RB71sbfLrNlx3XyDShng" alt=""><figcaption></figcaption></figure>

Back in Coinbase, you will want to click the send button in order to send your newly purchased $IP to your wallet. Upon clicking it, you will see a screen asking for the wallet to send to.

<figure><img src="/files/gBWK075ROVxP7YuwOEwj" alt=""><figcaption><p>Choosing the wallet to send to</p></figcaption></figure>

From here, you will paste in your wallet address from earlier, and press send.

<figure><img src="/files/xkF9Xp7GUcmL6Xrd67oa" alt=""><figcaption><p>Sending to the wallet</p></figcaption></figure>

After a short while, you will see your funds appear in your wallet!

<figure><img src="/files/j0NXmdCSgWprMq5G3xYN" alt=""><figcaption><p>Funds have arrived!</p></figcaption></figure>

You now have $IP in your wallet that is connected to Aria Protocol, and will be able to pay gas fees.&#x20;


# Buying Assets

This page is hidden, in the future it will contain information about how to participate in fundraises


# Claiming Assets

The $APL token is exclusively claimable by those who participated in the initial fundraising round via StakeStone. This fundraising phase is now closed. Following the launch, $APL may be available for purchase on decentralized exchanges supported by the Story network such as PiperX or StoryHunt once trading begins, depending on market availability and jurisdiction. This may give non-StakeStone participants an opportunity to get involved.

### Claiming $APL for StakeStone Depositors

If you were a StakeStone depositor, you must connect the same wallet that was used to deposit USDC in order to claim your $APL tokens.

For step-by-step instructions, see: [Getting and Linking a Wallet](/about-aria/quickstart-guide/getting-and-linking-a-wallet)<br>

Once your wallet is connected to the Aria Protocol WebApp, navigate to the Claim tab. Your eligible $APL balance should appear and be ready to claim.&#x20;

<figure><img src="/files/WpjhOJ2z8Uwow3Afvf5a" alt=""><figcaption></figcaption></figure>

When claiming, you must have a small amount of $IP in your wallet to pay the gas fee for the transaction. If you don't have any yet, you can review how to purchase some in [Purchasing $IP](/about-aria/quickstart-guide/purchasing-usdip).

If you have enough $IP in your wallet to pay the gas fee, you can click the Claim Tokens button to deposit your $APL tokens into your wallet!

Need more help follow along with our loom guide [here](https://www.loom.com/share/189eb83dd78b4e6083d420db0a217cd6?sid=7f47a985-f675-4339-b89b-6395fb468583)!


# Earning Royalties

The first IP RWA token on Aria Protocol, is the $APL token. To earn royalties, you’ll need to stake your $APL tokens. Staking allows you to receive a portion of royalty distributions generated by the underlying assets.&#x20;

Please see the following as an example of the user flow for earning royalties with $APL.&#x20;

For example, once you’ve claimed your $APL, you can then stake it by navigating to the Stake tab in the left sidebar of the Aria WebApp&#x20;

<figure><img src="/files/wENtUNpf8Zv1FQ1aIxNX" alt=""><figcaption></figcaption></figure>

It's as simple as that, your tokens are now earning royalties and you will also earn Aria Points for staking!

Need more help? Follow along with our loom guide [here](https://www.loom.com/share/e61bbc151ebb49d09a1cb22d63499b14?sid=f2440ff5-aac4-4cee-9007-3900e1b82a21).


# Collecting Royalties

## **Understanding Staking and Royalties**

For the first IP RWA token, $APL, royalties generated from the underlying music IP assets are collected offchain by Aria Management Company (affiliated with Aria Protocol Labs Inc.). These funds are then used to buy back $APL tokens on the open market, which are deposited into the staking contract.

This increases the total $APL backing all staked tokens without changing your $stAPL balance. As a result, the exchange rate between $stAPL and $APL increases over time, reflecting your share of growing royalty income.

Therefore, whilst your $stAPL maintains a fixed quantity in your wallet, its exchange rate to $APL increases as royalties are received and sent to buyback $APL.&#x20;

Royalties will be distributed on a regular basis.

## **How it works:**

**Example:** (assume you are the only staker in the pool):&#x20;

* You stake 100 $APL, and receive 100 $stAPL\
  (At launch, 1 $APL = 1 $stAPL. This rate increases as royalties are bought back.)
* Over time, buybacks add more $APL to the staking pool
* Let’s say 10 $APL in royalties are added, so now:
  * 1 $stAPL = 1.1 $APL
  * Your 100 $stAPL is now worth 110 $APL

Important: Royalties are distributed post-tax based on the underlying IP performance. You will be able to see your accrued royalties on the Aria dashboard in the form of their $APL value. \*

\***Disclaimer**: Any references to $APL yield are illustrative and based on forward-looking assumptions. Actual results may vary and are not guaranteed. This information is provided for general informational purposes only and does not constitute investment advice or an offer to sell or the solicitation of an offer to buy any asset. For a comprehensive overview of our $APL disclosures, please refer to the full $APL disclosures page on the Aria Protocol WebApp [here](https://app.ariaprotocol.xyz/claimandstaking.pdf)

## **How to Access your accrued Royalties**

There are **two options** to access accrued royalties. One method involves claiming them directly from Aria Protocol, and the alternative method involves swapping $stAPL to $APL on a DEX.

### **Option 1:** Unstake via Aria WebApp&#x20;

* Go to the Aria WebApp and click on the Stake tab
* Unstake any amount of your $stAPL
* Your $stAPL is then burned automatically, and the equivalent amount of $APL is sent to your wallet at the current exchange rate

You can then choose to hold or restake, or may be able to convert your $APL into other tokens via a DEX, if available for trading.

### Need more help? Follow along with our loom [here](https://www.loom.com/share/45fd87cb4197417585ed34be22505d7d?sid=4a70e649-f78c-4ad2-ab0b-805156ef1dcb)

### **Option 2:** Swap $stAPL on a DEX&#x20;

Trading assets on a DEX is only recommended for more advanced users.&#x20;

You can trade your $stAPL for $APL directly on a supported DEX (if available for trading). You can similarly choose to hold, stake, or convert your $APL into other cryptocurrencies or fiat.

* Exchange $stAPL for $APL at current market rates
* You retain full flexibility

Please note, the DEX market price may not reflect the onchain exchange rate due to arbitrage so be sure to check prices before swapping.

Each DEX requires different steps to use. We have included links to the documentation to each one.

Storyhunt:[ https://storyhunt.gitbook.io/storyhunt-dex/core-products-and-features/ip-native-exchange](https://storyhunt.gitbook.io/storyhunt-dex/core-products-and-features/ip-native-exchange)

PiperX:[ https://docs.piperx.xyz/user-guide/how-to-swap](https://docs.piperx.xyz/user-guide/how-to-swap)

## DEX User Flow Example:

* User A initially holds 100 $APL and stakes it for 100 $stAPL&#x20;
* Over the next month, royalties generate an additional 10 $APL, which are added to the staking contract and reflected in the exchange rate of $stAPL to $APL.
* As a result, 1 $stAPL = 1.1 $APL based on the current contract rate.

**At this point, User A has two options:**

* Unstake via Aria: 100 $stAPL will be burned and 110 $APL will be sent
* Sell on a DEX: Swap 100 $stAPL for $APL at the prevailing market rate


# Selling Assets

Describe how to sell the assets to crypto and fiat


# FAQ

### What am I buying when purchasing Aria Protocol IP RWA tokens?

When you purchase an Aria Protocol IP RWA token, such as $APL, you’re acquiring a blockchain-based asset. These tokens are minted on the Story blockchain and are fungible tokens linked to a portfolio of real world IP asset rights. In the case of $APL, these rights are acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.), giving token holders the right to receive a portion of royalties generated from the underlying IP. You must be holding and staking tokens to access royalties.

### How do I accrue royalties?

As described above, royalties are earned by staking $APL tokens. Once staked, you’ll receive royalties based on the revenue produced by the underlying IP assets.

For a step-by-step guide on how to stake, check out  [Earning Royalties](/about-aria/quickstart-guide/earning-royalties)

### What is a wallet and why do I need it?

Aria Protocol is built on blockchain technology, which means you control your tokens, not a central authority. A wallet is your personal digital account that lets you hold, send, and receive tokens securely. You’ll need one to claim, stake, and manage your Aria Protocol tokens.

To set up and connect a wallet to Aria Protocol, see our [Getting and Linking a Wallet](/about-aria/quickstart-guide/getting-and-linking-a-wallet)

### What is Story?

Story Protocol is building an open system that empowers IP rights holders, including writers, scientists, artists, to protect, track, and share their work online. Today, it’s often difficult to prove ownership, receive proper credit, or earn revenue when others use your content. Story aims to solve this by enabling clear attribution, fair licensing, and seamless remixing of creative works.

Learn more about their vision here: <https://www.story.foundation/blog/vision>

### What is $IP, why do I need it, and how can I get it?

$IP is the native token of the Story Protocol. It is used to pay gas fees; small payments required to perform transactions on the network. These fees help support and incentivize the decentralized infrastructure that powers Story.

Unlike traditional systems run by centralized servers (often funded by ads or subscriptions), decentralized networks rely on many independent participants. These participants run the network on their computers and are compensated through gas fees for processing transactions.

Since Aria Protocol runs on Story, you’ll need $IP to perform any onchain actions such as claiming, staking, or trading Aria Protocol IP RWA tokens.

It can be purchased on either a CEX (Centralized Exchange) or a DEX (Decentralized Exchange). A quick and easy way to buy $IP is through the Centralized Exchange, [Coinbase](https://www.coinbase.com/price/ip.).  For an in depth guide, take a look at [Purchasing $IP](/about-aria/quickstart-guide/purchasing-usdip)

Read more about $IP here: [https://www.story.foundation/blog/introducing-ip](<https://www.story.foundation/blog/introducing-ip&#xA;>)

### How much $IP should I buy?

The price of transactions changes based on market conditions, however in general, they cost from fractions of a cent to a few cents (USD). Most users won't ever need more than a few USD worth of $IP. However, if you are ever running low, you can simply top up your wallet again with more $IP.


# IP RWA

## What is IP RWA?

IP RWA is a **type of ERC-20 compliant token**. It stands for **Intellectual Property Real World Assets**. IP RWA is a type of token, not a token itself.

## Function

IP RWA allows ownership of IP rights to be divided among multiple holders. In the case of $APL, each token represents the ability to claim future royalty revenue generated by the underlying IP assets.

## Technical Implementation

In the case of $APL, the IP RWA token was created after a fundraise. The total supply of $APL the vault created is a set value, determined during the fundraise.

## Distribution

In the case of $APL, the IP RWA was allocated proportionally to fundraiser participants based on the amount of stablecoins they contributed to the Stakestone LiquidityPad vault. The amount of $APL each user was able to claim was determined by the formula `(userDeposit / totalDeposit * totalSupply)` .

## Properties

In the case of $APL, the IP RWA tokens are transferable, can be staked to earn revenue based on potential royalties, and are backed by IP rights acquired by Aria Management Company (associated with Aria Protocol Labs Inc.)

<br>


# stIPRWA

## Description

stIPRWA are **ERC-20 compliant tokens** received from staking IP RWA tokens. These tokens **earn royalties** from the IP while staked.

## Function

stIPRWA represents IP RWA tokens committed to the staking protocol. In the case of $APL they earn royalties.

## Technical Implementation

stIPRWA is minted when a user **stakes their IP RWA tokens**. They are free to stake or unstake at any time. However, unstaking cannot happen in the same block as the staking occurs.

## Mechanics

In the case of $APL, as offchain royalties accrue from the underlying assets, these will be used to buyback $APL. This will cause the $stAPL to $APL ratio to increase over time as royalties accumulate, similar to liquid staking tokens. When the user unstakes, they will receive back their original $APL tokens, along with the extra earned by the royalties.

## Benefits

In the case of $APL, holders automatically accrue their share of royalty distributions while holding these staked tokens.


# $APL

$APL is the first IP RWA (Intellectual Property Real-World Asset) token launched on Aria Protocol. It is a fungible token backed by iconic music rights acquired by Aria Management Company (affiliated with Aria Protocol Labs Inc.).

The $APL token represents the Aria Premiere Launch catalog; a collection of partial rights to 48 iconic songs acquired to date from the $10.95 million USDC raised using StakeStone’s LiquidityPad.

Following the launch of remixable IP and the Aria Global Remix Contest featuring 3 songs from South Korean artist and actress NANA, the token will also be linked to any remixes of the 3 tracks released by a label.&#x20;

Holders are entitled to a share of potential real-world revenue generated by the underlying IP assets.

$APL brings a new kind of asset onchain: income-generating IP you can own, stake, and earn from.&#x20;

For the complete list of assets, you can check out APL's [Asset List](/ip-rwa-tokens/usdapl/asset-list), or check out the tokenomics at [Tokenomics](/ip-rwa-tokens/usdapl/tokenomics).

Token and Contract Addresses:

* `APL: 0xfE82012eCcE57a188E5f9f3fC1Cb2D335C58F1f5`
* `stAPL: 0xb5461c1FD0312Cd4bF037058F8a391e6A42F9639`
* `Staking contract: 0x73d600Db8E7bea28a99AED83c2B62a7Ea35ac477`


# Asset List

List of assets contained in APL

| Asset                        | Artist                                        | Publishing % Stake | Rights type                              |
| ---------------------------- | --------------------------------------------- | ------------------ | ---------------------------------------- |
| Peaches                      | Justin Bieber                                 | 20.0%              | Publishing Copyrights + Producing Income |
| Peaches (Remix)              | Justin Bieber, USHER, Snoop Dogg, Ludacris    | 20.0%              | Publishing Copyrights + Producing Income |
| Peaches (Masterkraft Remix)  | Justin Bieber, Alpha P, Omah Lay, Masterkraft | 20.0%              | Publishing Copyrights + Producing Income |
| Prisoner                     | Miley Cyrus, Dua Lipa                         | 17.0%              | Publishing Copyrights                    |
| Daisies                      | Katy Perry                                    | 16.7%              | Publishing Copyrights                    |
| Lost                         | Maroon 5                                      | 18.0%              | Publishing Copyrights                    |
| Nobody's Love                | Maroon 5                                      | 10.0%              | Publishing Copyrights                    |
| Prisoner                     | Miley Cyrus, Dua Lipa                         | 17.0%              | Publishing Copyrights                    |
| Daisies                      | Katy Perry                                    | 16.7%              | Publishing Copyrights                    |
| Lost                         | Maroon 5                                      | 18.0%              | Publishing Copyrights                    |
| Nobody's Love                | Maroon 5                                      | 10.0%              | Publishing Copyrights                    |
| FLOWER                       | JISOO,지수                                      | 14.0%              | Publishing Copyrights                    |
| Yeah Yeah Yeah               | BLACKPINK                                     | 25.0%              | Publishing Copyrights                    |
| VIBE(FEAT.JIMIN OF BTS)      | 태양                                            | 19.0%              | Publishing Copyrights                    |
| Still Life                   | 빅뱅,BIGBANG                                    | 19.2%              | Publishing Copyrights                    |
| Seed                         | 태양                                            | 48.0%              | Publishing Copyrights                    |
| SHOONG!                      | 태양                                            | 27.0%              | Publishing Copyrights                    |
| Ready For Love               | BLACKPINK,블랙핑크                                | 7.5%               | Publishing Copyrights                    |
| INSPIRATION(FEAT.BEENZINO)   | 태양                                            | 25.0%              | Publishing Copyrights                    |
| VINGLEVINGLE (PROD. R.TEE)   | HEIZE,헤이즈,헤이즈(HEIZE)                          | 14.0%              | Publishing Copyrights                    |
| You Right                    | 네이처,NATURE                                    | 33.4%              | Publishing Copyrights                    |
| NIGHTFALL(FEAT.BRYAN CHASE)  | 태양                                            | 15.0%              | Publishing Copyrights                    |
| Reason                       | 태양                                            | 18.0%              | Publishing Copyrights                    |
| XOXO                         | 전소미                                           | 2.0%               | Publishing Copyrights                    |
| Girls                        | NATURE,네이처                                    | 22.9%              | Publishing Copyrights                    |
| DISCO ENERGY (FEAT. JUSTHIS) | UHM JUNG HWA,엄정화                              | 20.0%              | Publishing Copyrights                    |
| DO RE MI FA SOL              | 박봄,PARK BOM                                   | 16.7%              | Publishing Copyrights                    |
| Nomad                        | ZION.T,GEN HOSHINO                            | 10.0%              | Publishing Copyrights                    |
| I'm Done                     | 네이처,NATURE                                    | 20.8%              | Publishing Copyrights                    |
| CHOOSE ME (FEAT. VINCE)      | TANAKA,다나카(TANAKA)                            | 10.0%              | Publishing Copyrights                    |
| About You                    | VINCE                                         | 40.0%              | Publishing Copyrights                    |
| DIVE                         | NATURE,네이처                                    | 25.0%              | Publishing Copyrights                    |
| B B B(NEVER SAY GOOD BYE)    | NATURE,네이처                                    | 25.0%              | Publishing Copyrights                    |
| Freedom In Flow              | KUSH,R.TEE,VINCE,KUSH,R TEE,VINCE             | 5.0%               | Publishing Copyrights                    |
| FLOWER                       | JISOO,지수                                      | 25.0%              | Publishing Copyrights                    |
| Yeah Yeah Yeah               | BLACKPINK                                     | 35.0%              | Publishing Copyrights                    |
| All Eyes On Me               | JISOO,지수                                      | 8.0%               | Publishing Copyrights                    |
| Still Life                   | 빅뱅,BIGBANG                                    | 12.5%              | Publishing Copyrights                    |
| Ready For Love               | BLACKPINK,블랙핑크                                | 7.5%               | Publishing Copyrights                    |
| VINGLEVINGLE (PROD. R.TEE)   | HEIZE,헤이즈,헤이즈(HEIZE)                          | 39.0%              | Publishing Copyrights                    |
| You Right                    | 네이처,NATURE                                    | 33.3%              | Publishing Copyrights                    |
| DO RE MI FA SOL              | 박봄,PARK BOM                                   | 39.6%              | Publishing Copyrights                    |
| Girls                        | NATURE,네이처                                    | 22.9%              | Publishing Copyrights                    |
| FXXKED UP                    | 전소미                                           | 5.0%               | Publishing Copyrights                    |
| NIGHTFALL(FEAT.BRYAN CHASE)  | 태양                                            | 10.0%              | Publishing Copyrights                    |
| Dear Me                      | PSY                                           | 15.0%              | Publishing Copyrights                    |
| Everyday                     | PSY                                           | 20.0%              | Publishing Copyrights                    |
| I'm Done                     | 네이처,NATURE                                    | 45.8%              | Publishing Copyrights                    |
| I Luv U                      | HENRY,헨리                                      | 8.3%               | Publishing Copyrights                    |
| Hold Me                      | 존박,임채언                                        | 40.3%              | Publishing Copyrights                    |
| Only U                       | IMFACT,임팩트                                    | 50.0%              | Publishing Copyrights                    |
| After You                    | 조현아                                           | 33.3%              | Publishing Copyrights                    |
| NA NA NA                     | IMFACT,임팩트                                    | 35.4%              | Publishing Copyrights                    |
| Dive                         | NATURE,네이처                                    | 25.0%              | Publishing Copyrights                    |
| B B B(NEVER SAY GOOD BYE)    | NATURE,네이처                                    | 25.0%              | Publishing Copyrights                    |
| Clock                        | B O Y,B.O.Y,비오브유                              | 13.9%              | Publishing Copyrights                    |
| The Light                    | IMFACT,임팩트                                    | 29.2%              | Publishing Copyrights                    |
| Sobaniiteyo                  | 대성,D-LITE                                     | 13.9%              | Publishing Copyrights                    |
| The Truth Untold             | BTS                                           | 18.0%              | Publishing Copyrights                    |
| Black Mamba                  | aespa                                         | 7.3%               | Publishing Copyrights                    |
| People You Know              | Selena Gomez                                  | 7.5%               | Publishing Copyrights                    |
| Like It's Christmas          | Jonas Brothers                                | 2.0%               | Publishing Copyrights                    |
| Paris                        | Sabrina Carpenter                             | 33.3%              | Publishing Copyrights                    |
| I Rise                       | Madonna                                       | 33.3%              | Publishing Copyrights                    |


# Tokenomics

$APL token supply, staking, and liquidity

## Token Distribution <a href="#docs-internal-guid-6389e350-7fff-434a-8a61-6ccdf9c5834b" id="docs-internal-guid-6389e350-7fff-434a-8a61-6ccdf9c5834b"></a>

The entire supply of $APL (10,947,535.00 tokens) is allocated to participants in the Aria Premiere Launch StakeStone LiquidityPad, based on their ownership of AriaDebutLP tokens at the time of snapshot:

* **Distribution Mechanism**: Pro-rata distribution
* **Snapshot Date**: May 16, 2025, 12:00 UTC
* **Eligibility**: Only available to claim by holders of AriaDebutLP tokens

**No additional minting or inflation will occur. $APL is a capped-supply token.**

## Staking <a href="#docs-internal-guid-bfd8ab69-7fff-58ca-adc6-e1f0b752afb7" id="docs-internal-guid-bfd8ab69-7fff-58ca-adc6-e1f0b752afb7"></a>

Staking Features:

* **Instant Staking**: Stake $APL to instantly receive $stAPL
* **Zero Lock-Up**: Unstake anytime with no economic penalties
* **Ownership Retention**: $stAPL represents your staked APL; you remain in control

Automated Rewards: Royalties generated from IP assets are used to buy back $APL from open market operations

## Token Utility <a href="#docs-internal-guid-4ee1966a-7fff-12f8-630c-a0720a86ccdb" id="docs-internal-guid-4ee1966a-7fff-12f8-630c-a0720a86ccdb"></a>

* **Royalty Participation**: Earn from IP royalties through staking
* **DeFi Composability**: Trade $APL and $stAPL across decentralized liquidity pools
* **Protocol Trajectory**: Guide strategy and direction of acquired IP

## Liquidity & Market Access <a href="#docs-internal-guid-f587d98e-7fff-91f6-742b-abcca6f6c653" id="docs-internal-guid-f587d98e-7fff-91f6-742b-abcca6f6c653"></a>

To ensure seamless trading and liquidity for $APL holders, decentralized liquidity pools will be launched across major DeFi platforms.

### Initial Trading Platforms:

* PiperX: <https://app.piperx.xyz/>
* Story Hunt: <https://app.storyhunt.xyz/>

## In Summary

$APL is a next-generation token bridging decentralized finance and real-world intellectual property assets. Through its crypto-native design and real-world IP exposure, $APL empowers a global community to access premium IP assets at scale.

## Disclaimer

This post is for informational purposes only and does not constitute investment advice, legal guidance, or a solicitation to buy or sell any assets in any jurisdiction. Any references to potential yield, participation, or economic exposure are illustrative only and do not guarantee financial performance. All investing involves risk. Always conduct your own due diligence before making financial decisions. Aria Protocol works closely with regulatory partners to ensure compliance and investor protection and is committed to transparency and responsible innovation in the IP and blockchain space. Participation in Aria Protocol’s products may be restricted by jurisdiction and subject to compliance requirements. Please consult legal, financial, and tax advisors before engaging with tokenized IP assets.

For a comprehensive overview of our $APL disclosures, please refer to the full $APL disclosures page on the Aria WebApp [here](https://app.ariaprotocol.xyz/claimandstaking.pdf)


# Token and Money Flow: Flow of User Funds for $APL

### Initial Entry: USDC to $APL

The process begins when users deposit USDC into the Stakestone LiquidityPad vault. These funds are used to acquire real-world IP assets. When the vault closed and the assets were acquired, the protocol minted $APL.&#x20;

Users could then claim their $APL token to the same wallet used during the USDC deposit phase.

### Staking Phase: $APL to $stAPL

To earn royalties, users stake their $APL tokens into Aria Protocol’s staking contracts and receive $stAPL in return. While the original $APL is held in the contract, $stAPL passively accrues royalties.

### Unstaking Phase: $stAPL back to $APL

When ready to claim royalties, users can unstake their $stAPL This action burns the $stAPL tokens and returns $APL to the user at the current exchange rate, which reflects both their original stake and accumulated royalties.

### Exit: $APL to USDC

Users can then take their IPRWA tokens to a decentralized exchange (DEX) and swap them for USDC. Aria helps maintain market liquidity by periodically buying back IPRWA using royalty income, enabling smoother exits for users.

## Flow of Royalty Funds

### 1. Royalties Received: Fiat → USDC

When underlying IP assets generate royalty income in fiat currency (e.g., from Spotify, YouTube, Sync Licensing, etc.), Aria Management Company (affiliated with Aria Protocol Labs Inc.) converts that income into USDC via a centralized onramp such as Coinbase.

### 2. Conversion: USDC to $APL

Aria Management Company (affiliated with Aria Protocol Labs Inc.) then uses the USDC to purchase $APL tokens from a liquidity pool on a supported DEX (e.g., USDC/$APL pair).

### 3. Distribution: IPRWA to Stakers

The acquired $APL tokens are deposited into the staking contract, increasing the total backing for $stAPL holders. Over time, this raises the exchange rate of $stAPL → $APL, delivering royalties proportionally to stakers.


# Geofencing and Accessibility

$APL tokens **will NOT** be available for claim in the following regions:

\* Belarus

\* Crimea

\* Cuba

\* Donetsk

\* Iran

\* Kherson

\* Luhansk

\* North Korea

\* Russia

\* Ukraine

\* United Kingdom

\* United States

\* Zaporizhzhia

<br>


# Introducing $ARIAIP

## Introducing $ARIAIP: Powering the Future of Iconic IP RWA&#x20;

<figure><img src="/files/DiuCpsYb22kxa4xRhwqQ" alt="" width="375"><figcaption></figcaption></figure>

$ARIAIP is the native token powering the Aria Protocol, the infrastructure enabling investors to access and earn from iconic Intellectual Property Real-World Assets (“IP RWA”).&#x20;

As a governance and utility token, $ARIAIP is the coordination layer for community participation across the entire Protocol. $ARIAIP aligns the community of investors, rights holders and creators by powering liquidity, decision-making and community benefits across the Protocol’s growing landscape of IP RWA from institutional music portfolios to licensed remixes. &#x20;

### The Role of $ARIAIP &#x20;

* Governance Participation: shaping the future of the Protocol.
* Liquidity for IP RWA Ecosystem: enabling active markets for IP RWA tokens.
* Token-Gated Community Benefits: unlocking access to potential features, collaborations, ecosystem opportunities and benefits when staking. &#x20;

$ARIAIP advances the Aria Foundation’s mission to grow the IP RWA market by expanding access to and monetization of historically illiquid IP rights through the Aria Protocol. As Aria Protocol scales, $ARIAIP will continue to unify the growing range of participants and IP RWA into a single, aligned economic engine.&#x20;

### Where IP Meets Infrastructure: Aria Protocol and Foundation

Some of the most valuable assets on Earth are intangible, the songs we listen to, the stories we read and watch, the characters we love, and the icons that define generations. These assets hold deep emotional significance and substantial financial value. Until now, accessing that value has been difficult for many, locked behind legal complexities, private markets, and outdated infrastructure. This has limited how it can be monetized. Aria Foundation is changing that.&#x20;

Aria Foundation’s mission is to grow the IP RWA market by expanding access to and monetization of historically illiquid IP rights through the Aria Protocol. The Protocol enables investors to access and earn from iconic IP RWA by bringing real-world IP rights, starting with music, onchain as fungible, liquid tokens.&#x20;

Aria Protocol is stewarded by the Aria Foundation, which supports the ongoing development of the Protocol and ensures it grows transparently and in service of the community. As the Protocol evolves, the Foundation is proud to introduce the native token $ARIAIP.&#x20;

### Token Overview

* Token Name & Symbol: $ARIAIP
* Type: Story-native ERC-20
* Chain: Story&#x20;
* Supply: 1,000,000,000 (capped)
* Circulating Supply at Launch: 330,000,000 $ARIAIP (33% of total supply) &#x20;
* Contract address: 0xC9cbbD8f211300Dd0e7a3933b7AeEdAC6F61Dd52

Full documentation: The token has been audited by [Guardian](https://guardianaudits.com/). For more information see full documentation here: <https://docs.ariaprotocol.xyz/technical-docs/aria-protocol/usdariaip/security>

### Core Utilities of $ARIAIP:&#x20;

<p align="center"><img src="/files/s0FAgh72KCDMOC6nYDaE" alt="" data-size="original"></p>

* **Governance Participation:** Community governance may include decisions such as Protocol upgrades, new asset classes to be supported, treasury spending, incentive structures, and licensing frameworks for remixable or programmable IP. These governance rights serve as the mechanism for guiding how Aria Protocol grows and evolves. Governance will begin following the launch.&#x20;
* **Liquidity for IP RWA Ecosystem:** $ARIAIP will be paired with IPRWA tokens in liquidity pools, enabling permissionless trading and price discovery for IP-backed assets.
* **Token-Gated Community Benefits:** $ARIAIP stakers may unlock early access to potential creator collaborations, Protocol features, as well as ecosystem opportunities and benefits, rewarding active participation in the Aria economy.
  * The first of these will include a 15% discount code to use on digital art framing site [Muse Frame](https://www.museframe.io/?srsltid=AfmBOoqT_HnWXzTwzM6pXBO017j-aMCPAudrKKu1c0BVJMT0Jhn98ZJK) for $ARIAIP stakers. &#x20;

### $ARIAIP Distribution

<figure><img src="/files/kXwKqWCtfoq7vUVbaSYR" alt=""><figcaption></figcaption></figure>

### $ARIAIP Supply Schedule&#x20;

| Category                                                                          | Allocation            | Vesting/Emissions Schedule                                        |
| --------------------------------------------------------------------------------- | --------------------- | ----------------------------------------------------------------- |
| <p>Core Team</p><p><br></p>                                                       | 21%                   | 20% unlocked after 1-year cliff; 2-year linear vesting thereafter |
| Early Investors                                                                   | 18%                   | 20% unlocked after 1-year lockup; 2-year linear unlock thereafter |
| <p>Ecosystem & Partners</p><p> Strategic grants and initiatives</p>               | <p>21%</p><p><br></p> | 33% unlocked at TGE; 3-year linear unlock thereafter              |
| <p>Community Growth</p><p>Rewards for protocol participation and contribution</p> | <p>21%</p><p>  </p>   | 33% unlocked at TGE; 3-year linear unlock thereafter              |
| <p>Foundation</p><p>Reserved for protocol development </p>                        | <p>10%</p><p><br></p> | 100% unlocked at TGE                                              |
| <p>Initial Liquidity</p><p>Community Airdrop + CEX and DEX Liquidity</p>          | <p>9%</p><p> </p>     | 100% unlocked at TGE                                              |

At TGE, 33% of supply (330M $ARIAIP) will be unlocked. This includes tokens from Community Growth, Ecosystem and Partners, Foundation, and Initial Liquidity.&#x20;

The $ARIAIP unlock and estimated emissions schedule is presented as follows:

<br>

<figure><img src="/files/7DqYhmUfydmcfuMvU8tZ" alt="" width="375"><figcaption></figcaption></figure>

**Community Growth**&#x20;

Community Growth will reward active participation in the Aria ecosystem from TGE onwards, which may include actions such as staking, voting, and more. &#x20;

### $ARIAIP Community Airdrop Claim Eligibility & Snapshot

The airdrop claim will come from “Initial Liquidity” of 9%, with 5% allocated to the airdrop.&#x20;

* Eligible Groups: community participants who have earned Aria Points in Season 1 + the Story $IP community, including $IP stakers. At TGE:&#x20;
  * 3% of the airdrop allocation will be claimable by Aria Points holders
  * 2% of the total supply of $ARIAIP will be claimable by the $IP community (1% to $IP stakers and 1% to $IP holders)&#x20;
* Snapshot: Nov 5th at 1PM UTC
* Access: Distribution will occur via a claim mechanism rather than a direct airdrop. Participants will need to manually claim their allocation.&#x20;

#### **Important Notes**

$ARIAIP tokens will NOT be available for claim in the following countries: Cuba, Iran, North Korea, Belarus, Russia, UK, Crimea, Luhansk, Donetsk, Zaporizhzhia, Kherson, Ukraine.

If you’re new to Aria Protocol, you can learn more about the Aria Foundation and how it relates to the protocol [here](https://ariaprotocol.xyz/blog).

#### **What to do next?**&#x20;

Make sure you’re following Aria Protocol on [X](https://x.com/Aria_Protocol) and [join the Discord ](https://discord.com/invite/ariaprotocol)for all updates on eligibility and claiming over the next couple of days.&#x20;

For more important information on $ARIAIP, please read the Foundation's Disclaimers:&#x20;

**About Aria Protocol**&#x20;

Aria Protocol enables investors to access and earn from iconic IP RWA (Real-World Assets). Built on Story, the purpose built L1 blockchain for IP, Aria Protocol brings IP rights, starting with music, onchain as fungible and liquid crypto assets. Aria Protocol Labs Inc., founded by music industry veterans including David Kostiner (co-founder of Counsel LLP and IODA, acquired by Sony Music), leads Aria Protocol’s development and strategy under mandate from the Aria Foundation. In 2025, the first tokenized IP asset, $APL, was launched on Aria Protocol representing royalties from partial rights tied to songs performed by Justin Bieber, Miley Cyrus, and BLACKPINK. Soon the $APL token will also be linked to remixes of 3 tracks from renowned South Korean artist and actress, NANA.<br>

**About The Aria Foundation**

The Aria Foundation supports the growth of the IP RWA market by expanding access to and monetization of historically illiquid IP rights through the Aria Protocol. Based in the Cayman Islands, the Foundation is responsible for the long-term stewardship of the Protocol, including governance, grants, and ecosystem partnerships. It funds developer initiatives, liquidity programs, and tools that help IP holders, creators, and investors participate in onchain IP markets.&#x20;

<br>

<br>


# Security

### Overview & Introduction

This page is the only official source for verified $ARIA token and IPRWA suite contract addresses, audit information, and security status.

Aria follows a security-first and transparency-driven approach. The information here allows the community to verify what’s deployed and understand our trust and safety practices.

This documentation serves to:

* List official contract addresses
* Summarize security audits and findings
* Describe upgrade and admin controls
* Outline staking and liquidity mechanisms
* Provide contact points for responsible disclosure

#### Version & Maintenance

* Last updated: November 2025
* Maintained by: Aria Foundation Security & Engineering Team

***

### Audit Information

* Audit partners: name of the firm who audited the contract.
  * [Guardian](https://guardianaudits.com/)
* Scope of the audit: token contract, staking contract, liquidity contracts, governance modules, etc.

Additional and frequent audits occur on each major upgrade of these contracts.

{% file src="/files/FcBF74A1APIqndgeWsyt" %}

{% file src="/files/BLpGUZQo3fyeubdVqAry" %}


# Contracts

#### Contract Addresses

Important: Only interact with the contracts listed below.

Any unlisted address should be considered unverified and potentially malicious<br>

Token Contract:&#x20;

* (Story) $ARIAIP: [0xC9cbbD8f211300Dd0e7a3933b7AeEdAC6F61Dd52](https://www.storyscan.io/address/0xC9cbbD8f211300Dd0e7a3933b7AeEdAC6F61Dd52)
* (BSC) $ARIAIP: [0x2a7e3392458307493c86388d5e544aad93286836](https://bscscan.com/address/0x2a7e3392458307493c86388d5e544aad93286836)&#x20;
* Badges NFT:
  * [0xC01dFE03619e595F9663ac9A45F3c0282d0A0b22](https://www.storyscan.io/address/0xC01dFE03619e595F9663ac9A45F3c0282d0A0b22?tab=index)
  * Deployed at: [Sep 04 2025 20:22:29 PM (+02:00 UTC)](https://www.storyscan.io/tx/0x5535f5305c6186a81434af96cfa200f2fb6f866fb530d97d7da96c61db0e16c7)

Staking Contract:

* $APL staking:
  * [0x73d600Db8E7bea28a99AED83c2B62a7Ea35ac477](https://www.storyscan.io/address/0x73d600Db8E7bea28a99AED83c2B62a7Ea35ac477?tab=index)
  * Deployed at: [Jun 25 2025 21:50:24 PM (+02:00 UTC)](https://www.storyscan.io/tx/0x6d14915d5a66cacfce264ed29ce3696963851cd857f0a106afc7660cbb0151ac)

Claim(s):

* $APL vault:
  * [0xC8daB535B052a3daDe6D266B96277FEa7865dAdC](https://www.storyscan.io/address/0xC8daB535B052a3daDe6D266B96277FEa7865dAdC?tab=index)
  * Deployed at: [Jun 25 2025 21:20:38 PM (+02:00 UTC)](https://www.storyscan.io/tx/0xd84e216d8b85b111ebdd26c7f2b6c963d610760a3d3c10cbaf692ce0ef904729)
* Badges:
  * [0x94A997F6B004fc23E1B237dc0E8b95d35A8A0Da1](https://www.storyscan.io/address/0x94A997F6B004fc23E1B237dc0E8b95d35A8A0Da1)
  * Deployed at: [Sep 04 2025 20:27:33 PM (+02:00 UTC)](https://www.storyscan.io/tx/0xb51d6e38a676ef3d97ae4950fd4de418bbc80310a06e4536806f43ec14b6412f)

Legal:

* [0x5E8291e5799277429eb26da2Ff0364f6C39701CD](https://www.storyscan.io/address/0x5E8291e5799277429eb26da2Ff0364f6C39701CD?tab=index)
* Deployed at: [Jun 25 2025 21:30:13 PM (+02:00 UTC)](https://www.storyscan.io/tx/0xd9b5fbef6f2d9293cf7f04b4d126b7c770cbb203b34562cd0342e31676cc8b55)

Liquidity Pool Contracts

* APL/USDC.e:
  * PiperX: [0xb6a137017a2414ecb7de6f0599581d1ab9c3ade3](https://www.storyscan.io/address/0xB6A137017A2414Ecb7De6F0599581d1Ab9C3ADE3)
  * Storyhunt: [0xaab8353dab066a1bfd3a097d96ec7cbdce1bc231](https://www.storyscan.io/address/0xaaB8353DAb066A1bFd3A097d96EC7cBdce1BC231)
  * Both deployed around: June 26 2025 11:23:17 UTC
* APL/stAPL

  * PiperX:
    * [0x517cedb3592e35f582893ae1812e8607db5ded5d](https://www.storyscan.io/address/0x517CEDB3592e35f582893Ae1812E8607Db5DEd5D)
    * Deployed around: June 30 2025 08:56:54 UTC
  * Storyhunt:
    * [0x1c763a27a0f66ea692cee68456a451acfad16eb0](https://www.storyscan.io/address/0x1c763a27a0f66ea692CEe68456a451aCFAd16EB0)
    * Deployed around: July 4 2025 08:26:04 UTC

  Governance Contracts (if separate)

  * None yet

***

#### Staking & Liquidity Mechanisms

* Technical description of staking
  * Stakers earn rewards in the same deposited IPRWA; stake APL to earn more APL
  * As a receipt of deposited IPRWA, user receives stIPRWA
  * The ratio IPRWA:stIPRWA is constantly updated as:
    * IPRWA royalties are deposited in staking contract
    * Users unstake/claim rewards
  * On every user’s (un)stake royalties are distributed according to APR and elapsed time since last distribution<br>
* How liquidity pool contracts are deployed/structured.
  * Uniswap v3 based
  * Fees: both PiperX and Storyhunt
    * USDC.e/APL: 0.3%
    * stAPL/APL: 0.05%<br>


# Trust

### Future Updates

* All major upgrades, audits, and key changes to contract ownership or upgradeability will be announced through official Aria communication channels and verified on-chain via multisig announcements.

### Safety Practices

#### Core Safety Principles

* Verified Sources Only: Users should interact only with the official contract addresses, channels, and interfaces listed in this documentation. Any unlisted addresses or domains are unauthorized and potentially malicious.

#### User Education & Best Practices

* Only trust links from official Aria domains and channels.
* Never share private keys, seed phrases, or wallet recovery details with any third party claiming to represent Aria.
* Double-check token symbols and addresses against this page before interacting or approving transactions.

### Official Channels

* Website: [ariaprotocol.xyz](https://ariaprotocol.xyz)
* Twitter/X: [@AriaProtocol](https://twitter.com/AriaProtocol)
* Discord: <https://discord.com/invite/ariaprotocol>&#x20;
* GitHub: [AriaProtocol](https://github.com/AriaProtocol)


# Litepaper

{% file src="/files/IvNWC4t1dSr4LYSvEpOI" %}


# $ARIAIP: Q\&A

## Explaining the $ARIAIP token

#### **Q: Since $ARIAIP is issued on Story and $IP already exists, how do the two relate?**

**A:** $ARIAIP and $IP are fully independent. While both exist on Story, they serve different purposes and are not designed to interoperate. $IP is the native token of Story – the AI-native infrastructure layer for the $80 trillion global intellectual property (IP) economy. $IP powers the ecosystem of decentralized applications for IP registration, licensing, and monetization enabling anyone to create, collaborate, and capture value at internet scale. $ARIAIP is the coordination layer for community participation across the entire Aria Protocol. The two operate in parallel but are not directly linked. Read more about $IP [here](https://www.story.foundation/blog/introducing-ip).

#### **Q: What is $IP?**

A: $IP is the native token of Story, the AI-native infrastructure layer for the $80 trillion global intellectual property (IP) economy. $IP powers the ecosystem of decentralized applications for IP registration, licensing, and monetization enabling anyone to create, collaborate, and capture value at internet scale.

See details on $IP [here](https://www.story.foundation/blog/introducing-ip).&#x20;

#### Q: What is $ARIAIP&#x20;

A: $ARIAIP is the native token and coordination layer of Aria Protocol. It facilitates participation from the community of investors, rights holders and creators by powering governance participation, liquidity for the IP RWA ecosystem and token-gated community benefits.&#x20;

#### Q: What is $ARIAIP and how does it differ from IP RWA tokens?

A: $ARIAIP is the native token and coordination layer of Aria Protocol. It facilitates participation from the community of investors, rights holders and creators by powering governance participation, liquidity for the IP RWA ecosystem and token-gated community benefits.&#x20;

IP RWA stands for Intellectual Property Real World Asset and denotes a category of token pioneered by Aria Protocol. IP RWA tokens are fungible tokens linked to a portfolio of real world IP asset rights.  Depending on the rights encoded, these tokens may provide access to royalty income, enable onchain composability, or both, giving investors new opportunities and allowing creators to explore novel ways to monetize their IP. The first IP RWA token launched on Aria Protocol is called $APL and it represents partial income rights to holders of $APL for the underlying royalty-generating[ 48 music tracks](https://ariaprotocol.xyz/assets) to date performed by global superstars including Justin Bieber, Miley Cyrus, BLACKPINK, and BTS.&#x20;

Stakers of $APL earn royalties generated by the underlying IP, daily. With the announcement in October of remixable IP on Aria, $APL will soon also be linked to remixes of 3 tracks from renowned Korean artist and actress, NANA.&#x20;

#### Q: Who’s eligible to claim?

The Community Airdrop Claim on <https://app.ariaprotocol.xyz/airdrop> has been designed to reward the early Aria + Story communities. If you earned Aria Points by supporting and contributing to the Protocol in Season 1 and/or are part of the Story $IP community, including $IP stakers, at the snapshot Nov 5th at 1PM UTC you will be eligible.&#x20;

Read more on the full [Claim Guide](https://ariaprotocol.xyz/blog/get-ready-for-ariaip-claim-guide). To claim, log in with the wallet associated with Aria Protocol where you have received your Aria Points to reveal your eligibility. For a breakdown of the allocation read the [Tokenomics](https://ariaprotocol.xyz/blog/introducing-ariaip-powering-the-future-of-iconic-ip-rwa).&#x20;

Note: The Site and the Airdrop are not available to residents of Cuba, Iran, North Korea, Belarus or Russia; to residents of the United Kingdom; to residents of the Crimea, Luhansk, Donetsk, Zaporizhzhia or Kherson regions of Ukraine; or to residents of any other jurisdiction in which accessing or using the Site, the Token or the Protocol is prohibited (collectively, the “Prohibited Jurisdictions”).

Disclaimer:

Aria Foundation and its affiliates and subsidiaries (the “Foundation Group”) intends to (i) launch and provide ongoing liquidity to liquidity pools for the $ARIAIP token and other tokenized Intellectual Property Real World Assets (IPRWAs) on decentralized exchanges and (ii) buy and sell $ARIAIP tokens and IPRWA tokens on such exchanges (or otherwise in the open market) at its sole discretion. See full disclaimer[ here](https://ariaprotocol.xyz/aria-trading-disclaimer).

### $ARIAIP Utility

#### Q: What kinds of decisions will $ARIAIP holders govern?

A: Through onchain voting $ARIAIP stakers may participate in decisions such as Protocol upgrades, new asset classes supported, treasury spending, incentive structures, and licensing frameworks for remixable or programmable IP. These governance rights serve as the mechanism for guiding how Aria Protocol grows and evolves. Governance will begin following the launch.&#x20;

#### Q: Will $ARIAIP stakers or LPs earn rewards beyond governance rights?

A:  $ARIAIP will power governance participation, liquidity for the IP RWA ecosystem and token-gated community benefits. Details around reward structures or emissions models will be shared in the future.&#x20;

#### Q: How does liquidity work with $ARIAIP?

A: $ARIAIP will be paired with IP RWA tokens in liquidity pools, enabling permissionless trading and transparent price discovery for IP-backed assets.

#### Q: Will emissions start at TGE or slightly after, and are they part of the initial 33% live at launch?

A: Emissions will begin at TGE and are included as part of the initial 33% of tokens that go live at launch. Read the [Tokenomics](https://ariaprotocol.xyz/blog/introducing-ariaip-powering-the-future-of-iconic-ip-rwa) blog for more information.&#x20;

#### Q: What if I have more than 1 wallet?&#x20;

A: If you have received Aria Points associated with your participation across multiple wallets, you will need to log in with each wallet to reveal your eligibility and claim the associated $ARIAIP tokens for each one. For a breakdown of the allocation read the [Tokenomics](https://ariaprotocol.xyz/blog/introducing-ariaip-powering-the-future-of-iconic-ip-rwa). For details on how to claim view the [Claim Guide](https://ariaprotocol.xyz/blog/get-ready-for-ariaip-claim-guide). &#x20;

#### Q: What can I do with my $ARIAIP tokens?&#x20;

A: You can provide liquidity in pools where $ARIAIP is paired with IP RWA such as $APL. Once governance is implemented you will be able to vote in Protocol wide decisions, shaping the future of Aria Protocol. You will also be able to access community benefits when made available to $ARIAIP stakers. The first of these will include a 15% discount code to use on digital art framing site [Muse Frame](https://www.museframe.io/?srsltid=AfmBOoqT_HnWXzTwzM6pXBO017j-aMCPAudrKKu1c0BVJMT0Jhn98ZJK) for $ARIAIP stakers. &#x20;

Make sure to follow [Aria\_Protocol on X](https://x.com/Aria_Protocol) and join the [Discord](https://discord.com/invite/ariaprotocol) to stay updated.&#x20;

#### Q: Are there any fees to claim?&#x20;

A: Yes, you users will need to have some $IP to pay for gas and be able to claim $ARIAIP.

#### Q: What are the tokenomics of $ARIAIP?

A: View the [Tokenomics here](https://ariaprotocol.xyz/blog/introducing-ariaip-powering-the-future-of-iconic-ip-rwa).

#### Q: What is the core team’s vesting schedule?&#x20;

A: 1-year cliff, 2-year linear vesting thereafter.

### Security, Audits & Contracts

#### Q: Has the $ARIAIP token contract been audited?

A: Yes. The $ARIAIP token contract has undergone a full audit to ensure safety and reliability. See audit reports [here](https://docs.ariaprotocol.xyz/usdariaip/introducing-usdariaip/security).

#### Q: What is the $ARIAIP contract address, and when will it be available?

A: The official $ARIAIP token contract addresses are as follows:

The $ARIAIP contract address on Story: 0xC9cbbD8f211300Dd0e7a3933b7AeEdAC6F61Dd52

The $ARIAIP contract address on BSC: 0x2a7e3392458307493c86388d5e544aad93286836

<br>


# Legal and Compliance

### MiCA Whitepaper&#x20;

{% file src="/files/YxpqbHoXZMWhcCBrGimF" %}


# Contract Docs

* [aria](/technical-docs/contract-docs/aria)
* [ip](/technical-docs/contract-docs/ip)
* [iprwa](/technical-docs/contract-docs/iprwa)
* [legal](/technical-docs/contract-docs/legal)


# aria

* [claim](/technical-docs/contract-docs/aria/claim)
* [token](/technical-docs/contract-docs/aria/token)


# claim

* [AriaTokenClaim](/technical-docs/contract-docs/aria/claim/ariatokenclaim)


# AriaTokenClaim

**Inherits:** OwnableUpgradeable, UUPSUpgradeable

**Author:** Aria Protocol

Merkle claim for Aria Token

## State Variables

### claimRoot

Retreive the current claim root.

```solidity
bytes32 public claimRoot;
```

### ariaToken

Address of the aria erc20 token.

```solidity
IERC20 public ariaToken;
```

### tokensClaimed

Mapping of address to boolean of if an address has claim their tokens.

```solidity
mapping(address => bool) public tokensClaimed;
```

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

```solidity
function initialize(address _ariaToken, bytes32 _claimRoot, address _owner) external initializer;
```

### claim

Claim aria tokens.

```solidity
function claim(uint256 amount, bytes32[] calldata proof) public;
```

**Parameters**

| Name     | Type        | Description                                          |
| -------- | ----------- | ---------------------------------------------------- |
| `amount` | `uint256`   | Number of tokens claimable by a user.                |
| `proof`  | `bytes32[]` | Merkle proof proving a user is able to claim tokens. |

### updateClaimRoot

Updates the claim root.

*Only callable by owner.*

```solidity
function updateClaimRoot(bytes32 _claimRoot) external onlyOwner;
```

**Parameters**

| Name         | Type      | Description     |
| ------------ | --------- | --------------- |
| `_claimRoot` | `bytes32` | New claim root. |

### withdraw

Withdraws all tokens held by contract

*The zero address denotes ETH*

*Only callable by owner.*

```solidity
function withdraw(address _tokenAddress) external onlyOwner;
```

**Parameters**

| Name            | Type      | Description                   |
| --------------- | --------- | ----------------------------- |
| `_tokenAddress` | `address` | Address of tokens to withdraw |

### \_authorizeUpgrade

Internal function called when trying to perform upgrade

*Only callable by owner.*

```solidity
function _authorizeUpgrade(address) internal virtual override onlyOwner;
```

## Events

### TokensClaimed

```solidity
event TokensClaimed(bytes32 indexed root, address indexed claimer, uint256 amount);
```


# token

* [Aria](/technical-docs/contract-docs/aria/token/aria)


# Aria

**Inherits:** ERC20, ERC20Burnable, ERC20Permit

**Author:** Aria Protocol

Aria token ERC20 implementation with pre-minted supply, burning capabilities, and ability to use Permit.

## Functions

### constructor

```solidity
constructor(address initialOwner) ERC20("Aria", "ARIA") ERC20Permit("Aria");
```


# ip

* [IPClaim](/technical-docs/contract-docs/ip/ipclaim)


# IPClaim

**Inherits:** AccessControl, Pausable, Whitelist, VaultWhitelistAdmin, UUPSUpgradeable

## State Variables

### claimedIP

```solidity
mapping(address => uint256) public claimedIP;
```

### ipToken

*Address(0) to claim native IP, otherwise ERC20*

```solidity
address public ipToken;
```

### startTime

```solidity
uint256 public startTime;
```

### endTime

```solidity
uint256 public endTime;
```

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

```solidity
function initialize(bytes32 _merkleRoot, address _admin) external initializer;
```

### depositIP

```solidity
function depositIP() external payable onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### claim

*Can only claim once, even if merkle tree updates a user's amount*

```solidity
function claim(bytes32[] calldata _proof, uint256 _amount) external whenNotPaused;
```

**Parameters**

| Name      | Type        | Description                                           |
| --------- | ----------- | ----------------------------------------------------- |
| `_proof`  | `bytes32[]` | Merkle proof for the user                             |
| `_amount` | `uint256`   | The whole amount of $IP the user is entitled to claim |

### pause

```solidity
function pause() external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE) whenNotPaused;
```

### unpause

```solidity
function unpause() external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE) whenPaused;
```

### setEndTime

```solidity
function setEndTime(uint256 _endTime) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### setIPToken

*Admin can change token to be claimed at any time without any checks - made on purpose*

*If `address(0)` is set, it means ETH/IP is being claimed*

```solidity
function setIPToken(address _ipToken) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### setStartTime

```solidity
function setStartTime(uint256 _startTime) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### withdrawAnyToken

\*Admin can withdraw any token, at any time, including the IP token, without any checks

* made on purpose\*

```solidity
function withdrawAnyToken(address _token, address _to, uint256 _amount)
    external
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### merkleRoot

```solidity
function merkleRoot() external view returns (bytes32);
```

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address newImplementation)
    internal
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### \_transfer

```solidity
function _transfer(address _token, address payable _to, uint256 _amount) internal;
```

## Events

### Claimed

```solidity
event Claimed(address indexed account, uint256 indexed amount);
```

### EndTimeSet

```solidity
event EndTimeSet(uint256 indexed oldEndTime, uint256 indexed newEndTime);
```

### IPDeposited

```solidity
event IPDeposited(address indexed ipToken, uint256 amount);
```

### IPTokenSet

```solidity
event IPTokenSet(address indexed oldIPToken, address indexed newIPToken);
```

### StartTimeSet

```solidity
event StartTimeSet(uint256 indexed oldStartTime, uint256 indexed newStartTime);
```

## Errors

### IPClaim\_\_Ended

```solidity
error IPClaim__Ended();
```

### IPClaim\_\_EndTimeBeforeStartTime

```solidity
error IPClaim__EndTimeBeforeStartTime();
```

### IPClaim\_\_NotStarted

```solidity
error IPClaim__NotStarted();
```

### IPClaim\_\_NotWhitelisted

```solidity
error IPClaim__NotWhitelisted();
```

### IPClaim\_\_StartTimeAfterEndTime

```solidity
error IPClaim__StartTimeAfterEndTime();
```

### IPClaim\_\_TransferFailed

```solidity
error IPClaim__TransferFailed();
```

### IPClaim\_\_WholeAmountClaimed

```solidity
error IPClaim__WholeAmountClaimed();
```

### IPClaim\_\_ZeroAddress

```solidity
error IPClaim__ZeroAddress();
```

### IPClaim\_\_ZeroAmount

```solidity
error IPClaim__ZeroAmount();
```


# iprwa

* [lib](/technical-docs/contract-docs/iprwa/lib)
* [staking](/technical-docs/contract-docs/iprwa/staking)
* [vault](/technical-docs/contract-docs/iprwa/vault)
* [StoryAddrs](/technical-docs/contract-docs/iprwa/storyaddrs)
* [Constants](/technical-docs/contract-docs/iprwa/constants)


# lib

* [Errors](/technical-docs/contract-docs/iprwa/lib/errors)
* [IStakedERC20](/technical-docs/contract-docs/iprwa/lib/istakederc20)


# Errors

Library for all Aria contract custom errors.

## Errors

### AriaIPRWAVault\_\_ZeroAmount

Thrown when the amount is zero

```solidity
error AriaIPRWAVault__ZeroAmount();
```

### AriaIPRWAVault\_\_ZeroRoyaltyTokenDistributionWorkflowsAddress

Thrown when the royalty token distribution workflows address is zero

```solidity
error AriaIPRWAVault__ZeroRoyaltyTokenDistributionWorkflowsAddress();
```

### AriaIPRWAVault\_\_ZeroRoyaltyModuleAddress

Thrown when the royalty module address is zero

```solidity
error AriaIPRWAVault__ZeroRoyaltyModuleAddress();
```

### AriaIPRWAVault\_\_ZeroTokenizerModuleAddress

Thrown when the tokenizer module address is zero

```solidity
error AriaIPRWAVault__ZeroTokenizerModuleAddress();
```

### AriaIPRWAVault\_\_ZeroFractionalTokenTemplateAddress

Thrown when the fractional token template address is zero

```solidity
error AriaIPRWAVault__ZeroFractionalTokenTemplateAddress();
```

### AriaIPRWAVault\_\_ZeroAdminAddress

Thrown when the admin address is zero

```solidity
error AriaIPRWAVault__ZeroAdminAddress();
```

### AriaIPRWAVault\_\_ExpirationTimeNotInFuture

Thrown when the expiration time is not in the future

```solidity
error AriaIPRWAVault__ExpirationTimeNotInFuture(uint256 expirationTime, uint256 currentTime);
```

**Parameters**

| Name             | Type      | Description                  |
| ---------------- | --------- | ---------------------------- |
| `expirationTime` | `uint256` | The provided expiration time |
| `currentTime`    | `uint256` | The current time             |

### AriaIPRWAVault\_\_ZeroFundReceiverAddress

Thrown when the fund receiver address is zero

```solidity
error AriaIPRWAVault__ZeroFundReceiverAddress();
```

### AriaIPRWAVault\_\_ZeroUsdcContractAddress

Thrown when the USDC contract address is zero

```solidity
error AriaIPRWAVault__ZeroUsdcContractAddress();
```

### AriaIPRWAVault\_\_ZeroSPGNftContractAddress

Thrown when the spg nft contract address is zero

```solidity
error AriaIPRWAVault__ZeroSPGNftContractAddress();
```

### AriaIPRWAVault\_\_FractionalTokenNotSet

Thrown when the fractional token is not set

```solidity
error AriaIPRWAVault__FractionalTokenNotSet();
```

### AriaIPRWAVault\_\_CallerNotAdmin

Thrown when the caller is not the admin

```solidity
error AriaIPRWAVault__CallerNotAdmin(address caller, address admin);
```

**Parameters**

| Name     | Type      | Description                 |
| -------- | --------- | --------------------------- |
| `caller` | `address` | The function caller address |
| `admin`  | `address` | The admin address           |

### AriaIPRWAVault\_\_InvalidUSDCAddress

Thrown when the USDC address is invalid

```solidity
error AriaIPRWAVault__InvalidUSDCAddress();
```

### AriaIPRWAVault\_\_UnsupportedIERC20

Thrown when the token is not supported

```solidity
error AriaIPRWAVault__UnsupportedIERC20();
```

### AriaIPRWAVault\_\_VaultNotOpen

Thrown when the vault is not open

```solidity
error AriaIPRWAVault__VaultNotOpen(FundraiseState currentState);
```

**Parameters**

| Name           | Type             | Description                    |
| -------------- | ---------------- | ------------------------------ |
| `currentState` | `FundraiseState` | The current state of the vault |

### AriaIPRWAVault\_\_VaultNotCanceled

Thrown when the vault is not canceled

```solidity
error AriaIPRWAVault__VaultNotCanceled(FundraiseState currentState);
```

**Parameters**

| Name           | Type             | Description                    |
| -------------- | ---------------- | ------------------------------ |
| `currentState` | `FundraiseState` | The current state of the vault |

### AriaIPRWAVault\_\_NoRefundableDeposit

Thrown when there is no refundable deposit

```solidity
error AriaIPRWAVault__NoRefundableDeposit(address claimer, address token);
```

**Parameters**

| Name      | Type      | Description                                              |
| --------- | --------- | -------------------------------------------------------- |
| `claimer` | `address` | The address of the claimer                               |
| `token`   | `address` | The address of the token that the claimer wants to claim |

### AriaIPRWAVault\_\_VaultNotClosed

Thrown when the vault is not closed

```solidity
error AriaIPRWAVault__VaultNotClosed(FundraiseState currentState);
```

**Parameters**

| Name           | Type             | Description                    |
| -------------- | ---------------- | ------------------------------ |
| `currentState` | `FundraiseState` | The current state of the vault |

### AriaIPRWAVault\_\_ZeroDepositAmount

Thrown when the deposit amount is zero

```solidity
error AriaIPRWAVault__ZeroDepositAmount(address depositor, address token);
```

**Parameters**

| Name        | Type      | Description                                                  |
| ----------- | --------- | ------------------------------------------------------------ |
| `depositor` | `address` | The address of the depositor                                 |
| `token`     | `address` | The address of the token that the depositor wants to deposit |

### AriaIPRWAVault\_\_ClaimerNotEligible

Thrown when the claimer is not eligible to claim the fractionalized IP tokens

```solidity
error AriaIPRWAVault__ClaimerNotEligible(address claimer, address usdc);
```

**Parameters**

| Name      | Type      | Description                                         |
| --------- | --------- | --------------------------------------------------- |
| `claimer` | `address` | The address of the claimer                          |
| `usdc`    | `address` | The USDC address used to deposit into the fundraise |

### AriaIPRWAVault\_\_ClaimerAlreadyClaimed

Thrown when the claimer has already claimed the fractionalized IP tokens

```solidity
error AriaIPRWAVault__ClaimerAlreadyClaimed(address claimer);
```

**Parameters**

| Name      | Type      | Description                |
| --------- | --------- | -------------------------- |
| `claimer` | `address` | The address of the claimer |

### AriaIPRWAVault\_\_WhitelistDisabled

Thrown when the whitelist is disabled

```solidity
error AriaIPRWAVault__WhitelistDisabled();
```

### AriaIPRWAVault\_\_WhitelistProofInvalid

Thrown when the whitelist merkle proof is invalid

```solidity
error AriaIPRWAVault__WhitelistProofInvalid();
```

### AriaIPRWAVault\_\_CallerNotWhitelisted

Thrown when the caller is not whitelisted

```solidity
error AriaIPRWAVault__CallerNotWhitelisted();
```

### AriaIPRWAVault\_\_ActiveDepositsExist

Thrown when there are active deposits

```solidity
error AriaIPRWAVault__ActiveDepositsExist(address token, uint256 totalDeposits);
```

**Parameters**

| Name            | Type      | Description              |
| --------------- | --------- | ------------------------ |
| `token`         | `address` | The address of the token |
| `totalDeposits` | `uint256` | The total deposits       |

### AriaIPRWAVault\_\_FractionalTokenSupplyLessThanTotalDeposits

Thrown when the fractional token total supply is less than the total deposits

```solidity
error AriaIPRWAVault__FractionalTokenSupplyLessThanTotalDeposits(
    uint256 fractionalTokenTotalSupply, uint256 totalDeposits
);
```

**Parameters**

| Name                         | Type      | Description                              |
| ---------------------------- | --------- | ---------------------------------------- |
| `fractionalTokenTotalSupply` | `uint256` | The total supply of the fractional token |
| `totalDeposits`              | `uint256` | The total deposits                       |

### AriaIPRWAVault\_\_FractionalTokenAlreadyDeployed

Thrown when the fractional token is already deployed

```solidity
error AriaIPRWAVault__FractionalTokenAlreadyDeployed(address fractionalToken);
```

**Parameters**

| Name              | Type      | Description                         |
| ----------------- | --------- | ----------------------------------- |
| `fractionalToken` | `address` | The address of the fractional token |

### AriaIPRWAVault\_\_NoRaise

Thrown when there is no raise has been made.\`\`

```solidity
error AriaIPRWAVault__NoRaise();
```

### AriaIPRWAVault\_\_NothingToRecover

Thrown when there is nothing to recover

```solidity
error AriaIPRWAVault__NothingToRecover();
```

### AriaIPRWAVault\_\_ZeroMintTimelockDuration

Thrown when trying to set a mint timelock duration of zero

```solidity
error AriaIPRWAVault__ZeroMintTimelockDuration();
```

### AriaIPRWAVault\_\_ZeroMintAmount

Thrown when the mint amount is zero during initiation.

```solidity
error AriaIPRWAVault__ZeroMintAmount();
```

### AriaIPRWAVault\_\_MintAlreadyPending

Thrown when initiating a mint while another is already pending.

```solidity
error AriaIPRWAVault__MintAlreadyPending();
```

### AriaIPRWAVault\_\_TimelockCalculationOverflow

Thrown if calculating the unlock timestamp results in an overflow.

```solidity
error AriaIPRWAVault__TimelockCalculationOverflow();
```

### AriaIPRWAVault\_\_NoPendingExecution

Thrown when attempting to execute a timelocked action when none is pending.

```solidity
error AriaIPRWAVault__NoPendingExecution();
```

### AriaIPRWAVault\_\_TimelockNotReached

Thrown when attempting to execute a timelocked action before the timelock is reached.

```solidity
error AriaIPRWAVault__TimelockNotReached(uint48 unlockTimestamp);
```

**Parameters**

| Name              | Type     | Description                              |
| ----------------- | -------- | ---------------------------------------- |
| `unlockTimestamp` | `uint48` | The timestamp when the timelock expires. |

### AriaIPRWAVault\_\_DurationUpdateAlreadyPending

Thrown when attempting to initiate a duration update while another is pending.

```solidity
error AriaIPRWAVault__DurationUpdateAlreadyPending();
```

### AriaIPRWAVault\_\_CannotSetZeroTimelockDuration

Thrown when attempting to set the withdrawal timelock duration to zero.

```solidity
error AriaIPRWAVault__CannotSetZeroTimelockDuration();
```

### AriaIPRWAVault\_\_FractionalTokenCapExceeded

Thrown when the fractional token cap is exceeded on upcoming claim

```solidity
error AriaIPRWAVault__FractionalTokenCapExceeded();
```

### AriaIPRWAVault\_\_InvalidClaimDeadline

Thrown when the claim deadline is invalid

```solidity
error AriaIPRWAVault__InvalidClaimDeadline();
```

### AriaIPRWAVaultFactory\_\_CallerNotAdmin

Thrown when the caller is not the factory admin

```solidity
error AriaIPRWAVaultFactory__CallerNotAdmin(address caller, address admin);
```

**Parameters**

| Name     | Type      | Description                 |
| -------- | --------- | --------------------------- |
| `caller` | `address` | The function caller address |
| `admin`  | `address` | The admin address           |

### AriaIPRWAVaultFactory\_\_ZeroAdminAddress

Thrown when the admin address is zero

```solidity
error AriaIPRWAVaultFactory__ZeroAdminAddress();
```

### AriaIPRWAVaultFactory\_\_ZeroVaultTemplateAddress

Thrown when the vault template address is zero

```solidity
error AriaIPRWAVaultFactory__ZeroVaultTemplateAddress();
```

### AriaIPDistributionContract\_\_CallerNotAdmin

Thrown when the caller is not the admin

```solidity
error AriaIPDistributionContract__CallerNotAdmin(address caller, address admin);
```

**Parameters**

| Name     | Type      | Description                 |
| -------- | --------- | --------------------------- |
| `caller` | `address` | The function caller address |
| `admin`  | `address` | The admin address           |

### AriaIPDistributionContract\_\_ZeroRoyaltyModuleAddress

Thrown when the royalty module address is zero

```solidity
error AriaIPDistributionContract__ZeroRoyaltyModuleAddress();
```

### AriaIPDistributionContract\_\_ZeroUpgradeableBeaconAddress

Thrown when the upgradeable beacon address is zero

```solidity
error AriaIPDistributionContract__ZeroUpgradeableBeaconAddress();
```

### AriaIPDistributionContract\_\_ZeroFractionalTokenAddress

Thrown when the fractional token address is zero

```solidity
error AriaIPDistributionContract__ZeroFractionalTokenAddress();
```

### AriaIPDistributionContract\_\_ZeroAdminAddress

Thrown when the admin address is zero

```solidity
error AriaIPDistributionContract__ZeroAdminAddress();
```

### AriaIPDistributionContract\_\_ZeroIpIdAddress

Thrown when the IP ID address is zero

```solidity
error AriaIPDistributionContract__ZeroIpIdAddress();
```

### AriaIPDistributionContract\_\_ZeroProtocolTreasuryAddress

Thrown when the protocol treasury address is zero

```solidity
error AriaIPDistributionContract__ZeroProtocolTreasuryAddress();
```

### AriaIPDistributionContract\_\_ZeroRewardTokenAddress

Thrown when the reward token address is zero

```solidity
error AriaIPDistributionContract__ZeroRewardTokenAddress();
```

### AriaIPDistributionContract\_\_ZeroFractionalTokenAllocPoints

Thrown when the fractional token alloc points is zero

```solidity
error AriaIPDistributionContract__ZeroFractionalTokenAllocPoints();
```

### AriaIPDistributionContract\_\_ZeroStakingTokenAddress

Thrown when the staking token address is zero

```solidity
error AriaIPDistributionContract__ZeroStakingTokenAddress();
```

### AriaIPDistributionContract\_\_ZeroDepositAmount

Thrown when the deposit amount is zero

```solidity
error AriaIPDistributionContract__ZeroDepositAmount();
```

### AriaIPDistributionContract\_\_ZeroWithdrawAmount

Thrown when the withdraw amount is zero

```solidity
error AriaIPDistributionContract__ZeroWithdrawAmount();
```

### AriaIPDistributionContract\_\_ZeroRewardDistributionPeriod

Thrown when the reward distribution period is zero

```solidity
error AriaIPDistributionContract__ZeroRewardDistributionPeriod();
```

### AriaIPDistributionContract\_\_StakingPoolAlreadyExists

Thrown when attempting to add a staking pool that already exists

```solidity
error AriaIPDistributionContract__StakingPoolAlreadyExists(address stakingToken);
```

**Parameters**

| Name           | Type      | Description                      |
| -------------- | --------- | -------------------------------- |
| `stakingToken` | `address` | The address of the staking token |

### AriaIPDistributionContract\_\_InsufficientStakedBalance

Thrown when the staker's staked balance is insufficient

```solidity
error AriaIPDistributionContract__InsufficientStakedBalance(
    address staker, address stakingToken, uint256 stakedBalance, uint256 withdrawAmount
);
```

**Parameters**

| Name             | Type      | Description                              |
| ---------------- | --------- | ---------------------------------------- |
| `staker`         | `address` | The address of the staker                |
| `stakingToken`   | `address` | The address of the staking token         |
| `stakedBalance`  | `uint256` | The staker's staked balance              |
| `withdrawAmount` | `uint256` | The amount of staking tokens to withdraw |

### AriaIPDistributionContract\_\_NoRewardsToClaim

Thrown when there are no rewards to claim

```solidity
error AriaIPDistributionContract__NoRewardsToClaim(address claimer);
```

**Parameters**

| Name      | Type      | Description                |
| --------- | --------- | -------------------------- |
| `claimer` | `address` | The address of the claimer |

### AriaIPDistributionContract\_\_IpRoyaltyVaultNotDeployed

Thrown when the IP royalty vault is not deployed

```solidity
error AriaIPDistributionContract__IpRoyaltyVaultNotDeployed(address ipId);
```

**Parameters**

| Name   | Type      | Description |
| ------ | --------- | ----------- |
| `ipId` | `address` | The IP ID   |


# IStakedERC20

**Inherits:** IERC20

**Author:** Aria Protocol

## Functions

### mint

Mints tokens and sends them to a user

```solidity
function mint(address _receiver, uint256 _amount) external;
```

**Parameters**

| Name        | Type      | Description                                       |
| ----------- | --------- | ------------------------------------------------- |
| `_receiver` | `address` | Address that will receive the newly minted tokens |
| `_amount`   | `uint256` | Number of tokens being minted                     |

### burn

Burns tokens owned by a user

```solidity
function burn(address _from, uint256 _amount) external;
```

**Parameters**

| Name      | Type      | Description                                |
| --------- | --------- | ------------------------------------------ |
| `_from`   | `address` | Address that will have their tokens burned |
| `_amount` | `uint256` | Number of tokens being burned              |


# staking

* [IPRWAStaking](/technical-docs/contract-docs/iprwa/staking/iprwastaking)
* [StakedIPRWA](/technical-docs/contract-docs/iprwa/staking/stakediprwa)


# IPRWAStaking

**Inherits:** UUPSUpgradeable, AccessControlUpgradeable, Pausable

**Author:** Aria Protocol

Staking contract for IPRWA token

## State Variables

### STAKE\_LOCK\_SLOT

STATE VARIABLES ///

Slot for the stake lock

```solidity
bytes32 private constant STAKE_LOCK_SLOT = 0xe750219e856dc1045ee53321d6403a2f5fd45d5721d9656823eb6ce52a38051a;
```

### iprwaToken

Address of the IPRWA token

```solidity
IERC20 public iprwaToken;
```

### stakedIPRWAToken

Address of the staked IPRWA token.

```solidity
IStakedERC20 public stakedIPRWAToken;
```

### legal

Address of the legal contract that checks blacklist and license.

```solidity
address public legal;
```

### UD60x18\_SCALE\_PRECISION

Scale precision for the stIPRWA:IPRWA ratio - scaled by 10^27

```solidity
UD60x18 public UD60x18_SCALE_PRECISION;
```

### usersNetIPRWADeposited

Amount of IPRWA solely deposited by users into the contract (not accounting for deposited rewards)

```solidity
uint256 public usersNetIPRWADeposited;
```

## Functions

### stakelock

CONSTRUCTOR

Modifier to prevent staking/unstaking during the same transaction

```solidity
modifier stakelock();
```

### constructor

CONSTRUCTOR

to avoid parity hack

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

INITIALIZER

Initializer function needed to set values when called behind a proxy

```solidity
function initialize(address _iprwaToken, address _stakedIPRWAToken, address _legal, address _owner)
    external
    initializer;
```

**Parameters**

| Name                | Type      | Description                                                      |
| ------------------- | --------- | ---------------------------------------------------------------- |
| `_iprwaToken`       | `address` | Address of the IPRWA token                                       |
| `_stakedIPRWAToken` | `address` | Address of the Staked IPRWA token                                |
| `_legal`            | `address` | Address of the legal contract that checks blacklist and license. |
| `_owner`            | `address` | Address of the initial owner of the contract                     |

### stake

STAKING FUNCTIONS

Stake IPRWA tokens

*Assumes this contract has approval to move IPRWA tokens*

```solidity
function stake(uint256 _amount) external stakelock whenNotPaused;
```

**Parameters**

| Name      | Type      | Description                       |
| --------- | --------- | --------------------------------- |
| `_amount` | `uint256` | Number of IPRWA tokens to staking |

### unstake

Unstake stIPRWA token in exchange for IPRWA tokens

*Assumes this contract has approval to move stIPRWA tokens*

```solidity
function unstake(uint256 _amount) external stakelock whenNotPaused;
```

**Parameters**

| Name      | Type      | Description                                                              |
| --------- | --------- | ------------------------------------------------------------------------ |
| `_amount` | `uint256` | Number of stIPRWA tokens to unstake, a.k.a. net user deposit w/o rewards |

### stIPRWAperIPRWA

EXTERNAL FUNCTIONS ///

Returns the stIPRWA:IPRWA ratio - scaled by 10^27

```solidity
function stIPRWAperIPRWA() external view returns (uint256);
```

### iprwaPerStIPRWA

Returns the IPRWA:stIPRWA ratio - scaled by 10^27

```solidity
function iprwaPerStIPRWA() external view returns (uint256);
```

### \_stIPRWAPerIPRWA

INTERNAL FUNCTIONS

*stIPRWA:IPRWA ratio = (total stIPRWA supply - stIPRWA contract balance) / (IPRWA in contract)*

```solidity
function _stIPRWAPerIPRWA() internal view returns (UD60x18);
```

### \_iprwaPerStIPRWA

*IPRWA:stIPRWA = (IPRWA in contract) / (total stIPRWA supply - stIPRWA contract balance)*

```solidity
function _iprwaPerStIPRWA() internal view returns (UD60x18);
```

### \_getIPRWAValue

```solidity
function _getIPRWAValue(uint256 _stIPRWAAmount) internal view returns (uint256);
```

### \_getStiprwaValue

```solidity
function _getStiprwaValue(uint256 _iprwaAmount) internal view returns (uint256);
```

### withdraw

ADMIN FUNCTIONS

Withdraw tokens from the contract.

*A \_tokenAddress of address(0) denotes ETH*

*Only callable by the contract owner*

```solidity
function withdraw(address _tokenAddress, uint256 _amount) external onlyRole(DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name            | Type      | Description                             |
| --------------- | --------- | --------------------------------------- |
| `_tokenAddress` | `address` | Address of token to withdraw tokens for |
| `_amount`       | `uint256` | Number of tokens to withdraw            |

### setIPRWAToken

Sets the address for the IPRWA token

*Only callable by the contract owner*

```solidity
function setIPRWAToken(address _iprwaToken) external onlyRole(DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name          | Type      | Description                 |
| ------------- | --------- | --------------------------- |
| `_iprwaToken` | `address` | Address for the IPRWA token |

### setStakedIPRWAToken

Sets the address for the stIPRWA token

*Only callable by the contract owner*

```solidity
function setStakedIPRWAToken(address _stakedIPRWAToken) external onlyRole(DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name                | Type      | Description                   |
| ------------------- | --------- | ----------------------------- |
| `_stakedIPRWAToken` | `address` | Address for the stIPRWA token |

### setPauseState

```solidity
function setPauseState(bool paused_) external;
```

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address newImplementation) internal virtual override onlyRole(DEFAULT_ADMIN_ROLE);
```

## Events

### IPRWAStaked

EVENTS

Event emitted when IPRWA tokens are staked

```solidity
event IPRWAStaked(address indexed _user, uint256 _iprwaIn, uint256 _stIPRWAOut);
```

### IPRWAUnstaked

Event emitted when IPRWA tokens are unstaked

```solidity
event IPRWAUnstaked(address indexed _user, uint256 _stIPRWAIn, uint256 _iprwaOut);
```

### FundsWithdrawn

Event emitted when funds are withdrawn

```solidity
event FundsWithdrawn(address indexed _tokenAddress, uint256 indexed _amount);
```

## Errors

### EmptyAmount

CUSTOM ERRORS

Error thrown when trying to stake/unstake 0 tokens.

```solidity
error EmptyAmount();
```

### Unauthorized

Error thrown when msg sender is unauthorized

```solidity
error Unauthorized();
```

### BalanceTooLow

Error thrown when user does not have enough balance

```solidity
error BalanceTooLow(uint256 _balance, uint256 _requiredAmount);
```

### IncorrectSignatureLength

Error thrown when Signature length is incorrect

```solidity
error IncorrectSignatureLength();
```


# StakedIPRWA

**Inherits:** ERC20Upgradeable, ERC20PermitUpgradeable, AccessControlUpgradeable, UUPSUpgradeable

**Author:** Aria Protocol

ERC20 contract representing liquid staked IPRWA tokens.

## State Variables

### STAKED\_IPRWA\_MINTER\_BURNER\_ROLE

CONSTANTS

```solidity
bytes32 public constant STAKED_IPRWA_MINTER_BURNER_ROLE =
    0x61422bb1aed0fd47fe58f64cad18f106f0dbc262decd5fd435187cb36ab5a827;
```

## Functions

### constructor

CONSTRUCTOR

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

INITIALIZER

```solidity
function initialize(string memory _name, string memory _symbol, address _owner) external initializer;
```

### mint

MINT/BURN FUNCTIONS

Mints tokens to the receiver

*Only callable by an address that has the STAKED\_IPRWA\_MINTER\_BURNER\_ROLE role*

```solidity
function mint(address _receiver, uint256 _amount) external onlyRole(STAKED_IPRWA_MINTER_BURNER_ROLE);
```

**Parameters**

| Name        | Type      | Description                          |
| ----------- | --------- | ------------------------------------ |
| `_receiver` | `address` | Address of user receiving the tokens |
| `_amount`   | `uint256` | Number of tokens being minted        |

### burn

Burns tokens owned by a user

*Only callable by an address that has the STAKED\_IPRWA\_MINTER\_BURNER\_ROLE role*

```solidity
function burn(address _from, uint256 _amount) external onlyRole(STAKED_IPRWA_MINTER_BURNER_ROLE);
```

**Parameters**

| Name      | Type      | Description                                   |
| --------- | --------- | --------------------------------------------- |
| `_from`   | `address` | Address of user whose tokens are being burned |
| `_amount` | `uint256` | Number of tokens being burned                 |

### \_authorizeUpgrade

ADMIN FUNCTIONS

```solidity
function _authorizeUpgrade(address newImplementation) internal virtual override onlyRole(DEFAULT_ADMIN_ROLE);
```

## Events

### StakedIPRWAMinted

EVENTS

Event emitted when Staked IPRWA tokens are minted

```solidity
event StakedIPRWAMinted(address indexed _receiver, uint256 _amount);
```

### StakedIPRWABurned

Event emitted when Staked IPRWA tokens are burned

```solidity
event StakedIPRWABurned(address indexed _from, uint256 _amount);
```


# vault

* [admin](/technical-docs/contract-docs/iprwa/vault/admin)
* [factory](/technical-docs/contract-docs/iprwa/vault/factory)
* [fundraise](/technical-docs/contract-docs/iprwa/vault/fundraise)
* [lib](/technical-docs/contract-docs/iprwa/vault/lib)
* [view](/technical-docs/contract-docs/iprwa/vault/view)
* [whitelist](/technical-docs/contract-docs/iprwa/vault/whitelist)
* [AriaIPRWAVault](/technical-docs/contract-docs/iprwa/vault/ariaiprwavault)
* [AriaIPRWAVaultStorage](/technical-docs/contract-docs/iprwa/vault/ariaiprwavaultstorage)
* [FundraiseState](/technical-docs/contract-docs/iprwa/vault/fundraisestate)
* [VaultType](/technical-docs/contract-docs/iprwa/vault/vaulttype)
* [IAriaIPRWAVault](/technical-docs/contract-docs/iprwa/vault/iariaiprwavault)


# admin

* [children](/technical-docs/contract-docs/iprwa/vault/admin/children)
* [interfaces](/technical-docs/contract-docs/iprwa/vault/admin/interfaces)
* [VaultAdmin](/technical-docs/contract-docs/iprwa/vault/admin/vaultadmin)


# children

* [VaultAssetRegistryAdmin](/technical-docs/contract-docs/iprwa/vault/admin/children/vaultassetregistryadmin)
* [VaultFundraiseAdmin](/technical-docs/contract-docs/iprwa/vault/admin/children/vaultfundraiseadmin)
* [VaultWhitelistAdmin](/technical-docs/contract-docs/iprwa/vault/admin/children/vaultwhitelistadmin)


# VaultFundraiseAdmin

**Inherits:** IVaultFundraiseAdmin, AccessControlInternal

Contains the admin and view functions for the VaultFundraise submodule.

The admin could make a flashloan attack when fundraise is enabled (see Pashov's audit report). If you do not trust the admin, do not interact with this contract.

## Functions

### cancelRaise

Cancels the fundraise vault, only when the vault is Open

*Only the admin can cancel the vault*

```solidity
function cancelRaise() external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### closeRaise

Closes the fundraise vault, only when the vault is Open

*Only the admin can close the vault*

```solidity
function closeRaise() external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### updateUsdcContractAddress

Admin updates the USDC contract address

*Only USDC is supported for the fundraise, admin MUST BE VERY CAREFUL on USDC address update.*

```solidity
function updateUsdcContractAddress(address newUSDC)
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name      | Type      | Description |
| --------- | --------- | ----------- |
| `newUSDC` | `address` |             |

### withdraw

Transfers all funds to the fund receiver, only when the vault is Closed

*Only the admin can withdraw funds*

```solidity
function withdraw()
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE)
    returns (address[] memory tokens, uint256[] memory withdrawnAmounts);
```

**Returns**

| Name               | Type        | Description                           |
| ------------------ | ----------- | ------------------------------------- |
| `tokens`           | `address[]` | The addresses of the tokens withdrawn |
| `withdrawnAmounts` | `uint256[]` | The amounts of the tokens withdrawn   |

### withdraw

```solidity
function withdraw(address token) external override onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### \_initializeFundraise

Initializes the fundraise-specific parts of the vault. Called by the main vault's initialize function.

```solidity
function _initializeFundraise(VaultFundraiseStorage.Setup memory setup) internal;
```


# VaultAssetRegistryAdmin

**Inherits:** IVaultAssetRegistryAdmin, AccessControlInternal

Handles IP asset registry and other admin functions related to IP assets

## Functions

### registerIPAndFractionalize

Admin registers the IP and fractionalizes it, only when the vault is Closed

\*Aria must deploy an SPG NFT before calling this function + grant MINTER\_ROLE to the AriaIPRWAVault contract on the SPG NFT contract. The registration is made through `REGISTRATION_WORKFLOWS.createCollection(...)`, see <https://docs.story.foundation/developers/smart-contracts-guide/register-ip-asset#scenario-%232%3A-you-want-to-create-an-spg-nft-contract-to-do-minting-for-you> There are different sorts of IP on Aria:

* financialized IP: partial copyright and income streams
* remixable IP: programmable assets Either two SPG NFT will be created to handle these differents cases OR an SPG NFT will be created per tokenised IP\*

```solidity
function registerIPAndFractionalize(
    address spgNftContract,
    WorkflowStructs.IPMetadata memory ipMetadata,
    WorkflowStructs.LicenseTermsData[] memory licenseTermsData,
    address fractionalTokenTemplate,
    address fractionalTokenReceiver
)
    external
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE)
    returns (uint256 tokenId, address ipId, uint256[] memory licenseTermsIds, address fractionalToken);
```

**Parameters**

| Name                      | Type                                 | Description                                                                                                                                          |
| ------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `spgNftContract`          | `address`                            | The address of the SPG NFT contract The spgNFTContract used here has to have 0 mint fee and have MINTER\_ROLE granted to the AriaIPRWAVault contract |
| `ipMetadata`              | `WorkflowStructs.IPMetadata`         | The metadata of the IP                                                                                                                               |
| `licenseTermsData`        | `WorkflowStructs.LicenseTermsData[]` | The license terms data to be attached to the IP                                                                                                      |
| `fractionalTokenTemplate` | `address`                            | The template of the fractional token                                                                                                                 |
| `fractionalTokenReceiver` | `address`                            | The receiver of the fractional token - usually staking contract, to collect royalties and distributed to stakers.                                    |

**Returns**

| Name              | Type        | Description                              |
| ----------------- | ----------- | ---------------------------------------- |
| `tokenId`         | `uint256`   | The token ID of the IP                   |
| `ipId`            | `address`   | The IP ID                                |
| `licenseTermsIds` | `uint256[]` | The license terms IDs attached to the IP |
| `fractionalToken` | `address`   | The address of the fractional token      |

### setAllIpMetadata

*Call AFTER setTokenURI as it calls under the hood SPGNFT.tokenURI(tokenId)*

```solidity
function setAllIpMetadata(
    address coreMetadataModule,
    address ipId,
    string memory metadataURI,
    bytes32 metadataHash,
    bytes32 nftMetadataHash
) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name                 | Type      | Description                                                                                                                                                                                                 |
| -------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `coreMetadataModule` | `address` |                                                                                                                                                                                                             |
| `ipId`               | `address` |                                                                                                                                                                                                             |
| `metadataURI`        | `string`  |                                                                                                                                                                                                             |
| `metadataHash`       | `bytes32` | The hash of metadata at metadataURI. Use bytes32(0) to indicate that the metadata is not available.                                                                                                         |
| `nftMetadataHash`    | `bytes32` | A bytes32 hash representing the metadata of the NFT. This metadata is associated with the IP Asset and is accessible via the NFT's TokenURI. Use bytes32(0) to indicate that the metadata is not available. |

### setTokenURI

*Call BEFORE setAllIpMetadata*

```solidity
function setTokenURI(address spgNftContract, uint256 tokenId, string memory tokenURI)
    external
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### updateFractionalTokenTotalSupply

Admin updates the total supply of the fractional token

```solidity
function updateFractionalTokenTotalSupply(uint104 newTotalSupply)
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name             | Type      | Description                                                                                                                                                                                           |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `newTotalSupply` | `uint104` | The new total supply of the fractional token - capped to uint104 to avoid overflow in `_fundraiseCalculateClaim(...)`. A fractional token with 18 decimals can have a max supply of \~20T (trillion). |

### \_deployFractionalToken

*deploy fractional token*

```solidity
function _deployFractionalToken(address ipId, address fractionalTokenTemplate)
    internal
    returns (address fractionalToken);
```

**Parameters**

| Name                      | Type      | Description                          |
| ------------------------- | --------- | ------------------------------------ |
| `ipId`                    | `address` | The IP ID                            |
| `fractionalTokenTemplate` | `address` | The template of the fractional token |

**Returns**

| Name              | Type      | Description                         |
| ----------------- | --------- | ----------------------------------- |
| `fractionalToken` | `address` | The address of the fractional token |

### \_emitIPRegisteredAndFractionalized

```solidity
function _emitIPRegisteredAndFractionalized(
    address ipId,
    address spgNftContract,
    uint256 tokenId,
    uint256[] memory licenseTermsIds,
    address fractionalToken,
    address fractionalTokenReceiver
) internal;
```

### \_getScaledTotalDeposits

*Scales the total USDC deposits to a target number of decimals. This is used to compare USDC amounts (typically 6 decimals) with fractional token amounts (typically 18 decimals).*

```solidity
function _getScaledTotalDeposits(address usdcContract, uint8 targetDecimals) internal view returns (uint256);
```

**Parameters**

| Name             | Type      | Description                                         |
| ---------------- | --------- | --------------------------------------------------- |
| `usdcContract`   | `address` |                                                     |
| `targetDecimals` | `uint8`   | The target decimals to scale the total deposits to. |

**Returns**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `<none>` | `uint256` | The total deposits, scaled to targetDecimals. |

### \_registerIpAndAttachTermsAndCollectRoyaltyTokens

*register IP and attach terms and collect royalty tokens*

```solidity
function _registerIpAndAttachTermsAndCollectRoyaltyTokens(
    address spgNftContract,
    WorkflowStructs.IPMetadata memory ipMetadata,
    WorkflowStructs.LicenseTermsData[] memory licenseTermsData
) internal returns (address ipId, uint256 tokenId, uint256[] memory licenseTermsIds);
```

**Parameters**

| Name               | Type                                 | Description                                     |
| ------------------ | ------------------------------------ | ----------------------------------------------- |
| `spgNftContract`   | `address`                            | The address of the SPG NFT contract             |
| `ipMetadata`       | `WorkflowStructs.IPMetadata`         | The metadata of the IP                          |
| `licenseTermsData` | `WorkflowStructs.LicenseTermsData[]` | The license terms data to be attached to the IP |

**Returns**

| Name              | Type        | Description                              |
| ----------------- | ----------- | ---------------------------------------- |
| `ipId`            | `address`   | The IP ID                                |
| `tokenId`         | `uint256`   | The token ID of the IP                   |
| `licenseTermsIds` | `uint256[]` | The license terms IDs attached to the IP |


# VaultWhitelistAdmin

**Inherits:** AccessControlInternal

Handles administrative functions for the whitelist module.

## Functions

### setMerkleRoot

Sets the Merkle root for the whitelist.

*Only the owner (admin) can call this function.*

```solidity
function setMerkleRoot(bytes32 _merkleRoot) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name          | Type      | Description          |
| ------------- | --------- | -------------------- |
| `_merkleRoot` | `bytes32` | The new Merkle root. |

### \_setMerkleRoot

```solidity
function _setMerkleRoot(bytes32 _merkleRoot) internal;
```

## Events

### MerkleRootSet

```solidity
event MerkleRootSet(bytes32 oldMerkleRoot, bytes32 newMerkleRoot);
```


# interfaces

* [IVaultAdmin](/technical-docs/contract-docs/iprwa/vault/admin/interfaces/ivaultadmin)
* [IVaultAssetRegistryAdmin](/technical-docs/contract-docs/iprwa/vault/admin/interfaces/ivaultassetregistryadmin)
* [IVaultFundraiseAdmin](/technical-docs/contract-docs/iprwa/vault/admin/interfaces/ivaultfundraiseadmin)


# IVaultAssetRegistryAdmin

Interface for the IP asset registry admin functions

## Functions

### registerIPAndFractionalize

Admin registers the IP and fractionalizes it, only when the vault is Closed

\*Aria must deploy an SPG NFT before calling this function + grant MINTER\_ROLE to the AriaIPRWAVault contract on the SPG NFT contract. The registration is made through `REGISTRATION_WORKFLOWS.createCollection(...)`, see <https://docs.story.foundation/developers/smart-contracts-guide/register-ip-asset#scenario-%232%3A-you-want-to-create-an-spg-nft-contract-to-do-minting-for-you> There are different sorts of IP on Aria:

* financialized IP: partial copyright and income streams
* remixable IP: programmable assets Either two SPG NFT will be created to handle these differents cases OR an SPG NFT will be created per tokenised IP\*

```solidity
function registerIPAndFractionalize(
    address spgNftContract,
    WorkflowStructs.IPMetadata memory ipMetadata,
    WorkflowStructs.LicenseTermsData[] memory licenseTermsData,
    address fractionalTokenTemplate,
    address fractionalTokenReceiver
) external returns (uint256 tokenId, address ipId, uint256[] memory licenseTermsIds, address fractionalToken);
```

**Parameters**

| Name                      | Type                                 | Description                                                                                                                                          |
| ------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `spgNftContract`          | `address`                            | The address of the SPG NFT contract The spgNFTContract used here has to have 0 mint fee and have MINTER\_ROLE granted to the AriaIPRWAVault contract |
| `ipMetadata`              | `WorkflowStructs.IPMetadata`         | The metadata of the IP                                                                                                                               |
| `licenseTermsData`        | `WorkflowStructs.LicenseTermsData[]` | The license terms data to be attached to the IP                                                                                                      |
| `fractionalTokenTemplate` | `address`                            | The template of the fractional token                                                                                                                 |
| `fractionalTokenReceiver` | `address`                            | The receiver of the fractional token - usually staking contract, to collect royalties and distributed to stakers.                                    |

**Returns**

| Name              | Type        | Description                              |
| ----------------- | ----------- | ---------------------------------------- |
| `tokenId`         | `uint256`   | The token ID of the IP                   |
| `ipId`            | `address`   | The IP ID                                |
| `licenseTermsIds` | `uint256[]` | The license terms IDs attached to the IP |
| `fractionalToken` | `address`   | The address of the fractional token      |

### updateFractionalTokenTotalSupply

Admin updates the total supply of the fractional token

```solidity
function updateFractionalTokenTotalSupply(uint104 newTotalSupply) external;
```

**Parameters**

| Name             | Type      | Description                                                                                                                                                                                           |
| ---------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `newTotalSupply` | `uint104` | The new total supply of the fractional token - capped to uint104 to avoid overflow in `_fundraiseCalculateClaim(...)`. A fractional token with 18 decimals can have a max supply of \~20T (trillion). |

## Events

### FractionalTokenTotalSupplyUpdated

Emitted when the fractional token total supply is updated

```solidity
event FractionalTokenTotalSupplyUpdated(uint256 previousTotalSupply, uint256 newTotalSupply);
```

**Parameters**

| Name                  | Type      | Description                                       |
| --------------------- | --------- | ------------------------------------------------- |
| `previousTotalSupply` | `uint256` | The previous total supply of the fractional token |
| `newTotalSupply`      | `uint256` | The new total supply of the fractional token      |

### IPRegisteredAndFractionalized

Emitted when the fractional token is minted

```solidity
event IPRegisteredAndFractionalized(
    address indexed ipId,
    address spgNftContract,
    uint256 tokenId,
    uint256[] licenseTermsIds,
    address indexed fractionalToken,
    address indexed fractionalTokenReceiver
);
```

**Parameters**

| Name                      | Type        | Description                                                                                                       |
| ------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
| `ipId`                    | `address`   | The address of the newly registered IP                                                                            |
| `spgNftContract`          | `address`   | The address of the SPG NFT contract that was used to register the IP                                              |
| `tokenId`                 | `uint256`   | The token id in the SPG NFT contract that was used to register the IP                                             |
| `licenseTermsIds`         | `uint256[]` | The license terms IDs attached to the IP                                                                          |
| `fractionalToken`         | `address`   | The address of the fractional token                                                                               |
| `fractionalTokenReceiver` | `address`   | The receiver of the fractional token - usually staking contract, to collect royalties and distributed to stakers. |


# IVaultAdmin

Interface for basic admin functions of the Aria IP Vault

## Functions

### amIAdmin

*Simplest self admin check*

```solidity
function amIAdmin() external view returns (bool);
```

### initFundraise

Initializes the vault for fundraise.

*Can not initialize both a fundraise and a whitelist vault.*

```solidity
function initFundraise(
    address admin,
    StoryAddrs memory storyAddrs,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    VaultFundraiseStorage.Setup memory fundraiseSetup,
    uint48 mintTimelockDuration,
    uint256 claimDeadline,
    address legal
) external;
```

**Parameters**

| Name                   | Type                                           | Description                                                                                        |
| ---------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `admin`                | `address`                                      | The address of the admin of the vault                                                              |
| `storyAddrs`           | `StoryAddrs`                                   | The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract. |
| `tokenDetails`         | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token to be deployed                                                 |
| `fundraiseSetup`       | `VaultFundraiseStorage.Setup`                  | The setup of the fundraise                                                                         |
| `mintTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token mints.                               |
| `claimDeadline`        | `uint256`                                      | The deadline for the users to claim the fractional token.                                          |
| `legal`                | `address`                                      | The address of the legal contract that checks blacklist and license.                               |

### initWhitelist

Initializes the vault for whitelist.

*Can not initialize both a fundraise and a whitelist vault.*

```solidity
function initWhitelist(
    address admin,
    StoryAddrs memory storyAddrs,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    bytes32 merkleRoot,
    uint48 mintTimelockDuration,
    uint256 claimDeadline,
    address legal
) external;
```

**Parameters**

| Name                   | Type                                           | Description                                                                                        |
| ---------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `admin`                | `address`                                      | The address of the admin of the vault                                                              |
| `storyAddrs`           | `StoryAddrs`                                   | The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract. |
| `tokenDetails`         | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token to be deployed                                                 |
| `merkleRoot`           | `bytes32`                                      | The merkle root of the whitelist                                                                   |
| `mintTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token mints.                               |
| `claimDeadline`        | `uint256`                                      | The deadline for the users to claim the fractional token.                                          |
| `legal`                | `address`                                      | The address of the legal contract that checks blacklist and license.                               |

### recoverLostTokens

Recovers lost tokens

*Only the admin can recover lost tokens, including fractional tokens as they are minted not sent to the vault.*

```solidity
function recoverLostTokens(address token, address to) external;
```

**Parameters**

| Name    | Type      | Description                              |
| ------- | --------- | ---------------------------------------- |
| `token` | `address` | The address of the token to be recovered |
| `to`    | `address` | The address of the recipient             |

### setClaimDeadline

Sets the claim deadline

*Can only be called by the admin.*

```solidity
function setClaimDeadline(uint256 newClaimDeadline) external;
```

**Parameters**

| Name               | Type      | Description            |
| ------------------ | --------- | ---------------------- |
| `newClaimDeadline` | `uint256` | The new claim deadline |

### initFractionalTokenMint

Initiates a timelocked mint of the vault's fractional tokens by the admin.

*Can only be called by the owner. Records the mint details and sets the unlock timestamp. A mint must be executed via `execFractionalTokenMint` at/after the timelock passes. Reverts if there is already a pending mint.*

```solidity
function initFractionalTokenMint(address recipient, uint256 amount) external;
```

**Parameters**

| Name        | Type      | Description                               |
| ----------- | --------- | ----------------------------------------- |
| `recipient` | `address` | The address to receive the minted tokens. |
| `amount`    | `uint256` | The amount of fractional tokens to mint.  |

### execFractionalTokenMint

Executes a previously initiated fractional token mint after the timelock duration.

*Can be triggered by anyone. Checks if the timelock has passed and transfers the tokens. Resets the pending mint state. Reverts if no mint is pending or the timelock has not been reached.*

```solidity
function execFractionalTokenMint() external;
```

### initTimelockUpdate

Initiates a timelocked update for the admin fractional token mint duration.

*Can only be called by the owner. Uses the current timelock duration for the delay. A duration update must be executed via `execTimelockUpdate` after the timelock passes. Reverts if there is already a duration update pending.*

```solidity
function initTimelockUpdate(uint48 newDuration) external;
```

**Parameters**

| Name          | Type     | Description                           |
| ------------- | -------- | ------------------------------------- |
| `newDuration` | `uint48` | The proposed new duration in seconds. |

### execTimelockUpdate

Executes a previously initiated update to the admin fractional token mint duration.

*Can only be called by anyone. Checks if the timelock has passed and updates the duration. Resets the pending duration update state. Reverts if no duration update is pending or the timelock has not been reached.*

```solidity
function execTimelockUpdate() external;
```

## Events

### ClaimDeadlineUpdated

Emitted when the claim deadline is updated

```solidity
event ClaimDeadlineUpdated(uint256 oldClaimDeadline, uint256 newClaimDeadline);
```

**Parameters**

| Name               | Type      | Description            |
| ------------------ | --------- | ---------------------- |
| `oldClaimDeadline` | `uint256` | The old claim deadline |
| `newClaimDeadline` | `uint256` | The new claim deadline |

### LostTokensRecovered

Emitted when lost tokens are recovered

*Accounts for funds deposited through fundraise. These funds are not recoverable.*

```solidity
event LostTokensRecovered(address indexed token, address indexed to, uint256 indexed amount);
```

**Parameters**

| Name     | Type      | Description                        |
| -------- | --------- | ---------------------------------- |
| `token`  | `address` | The address of the token recovered |
| `to`     | `address` | The address of the recipient       |
| `amount` | `uint256` | The amount of the token recovered  |

### MintInitiated

Emitted when a fractional token mint is initiated by the admin.

```solidity
event MintInitiated(address indexed recipient, uint256 amount, uint48 mintExec);
```

**Parameters**

| Name        | Type      | Description                                         |
| ----------- | --------- | --------------------------------------------------- |
| `recipient` | `address` | The address that will receive the tokens.           |
| `amount`    | `uint256` | The amount of fractional tokens requested for mint. |
| `mintExec`  | `uint48`  | The timestamp when the mint can be executed.        |

### MintExecuted

Emitted when a fractional token mint is executed at/after the timelock.

```solidity
event MintExecuted(address indexed recipient, uint256 amount);
```

**Parameters**

| Name        | Type      | Description                             |
| ----------- | --------- | --------------------------------------- |
| `recipient` | `address` | The address that received the tokens.   |
| `amount`    | `uint256` | The amount of fractional tokens minted. |

### TimelockDurationUpdateInitiated

Emitted when an update to the fractional token mint timelock duration is initiated.

```solidity
event TimelockDurationUpdateInitiated(uint48 newDuration, uint48 mintExec);
```

**Parameters**

| Name          | Type     | Description                                             |
| ------------- | -------- | ------------------------------------------------------- |
| `newDuration` | `uint48` | The proposed new duration in seconds.                   |
| `mintExec`    | `uint48` | The timestamp when the duration update can be executed. |

### TimelockDurationUpdateExecuted

Emitted when a fractional token mint timelock duration update is executed.

```solidity
event TimelockDurationUpdateExecuted(uint48 oldDuration, uint48 newDuration);
```

**Parameters**

| Name          | Type     | Description                       |
| ------------- | -------- | --------------------------------- |
| `oldDuration` | `uint48` | The previous duration in seconds. |
| `newDuration` | `uint48` | The new duration in seconds.      |


# IVaultFundraiseAdmin

Interface for the VaultFundraise Admin functions.

## Functions

### cancelRaise

Cancels the fundraise vault, only when the vault is Open

*Only the admin can cancel the vault*

```solidity
function cancelRaise() external;
```

### closeRaise

Closes the fundraise vault, only when the vault is Open

*Only the admin can close the vault*

```solidity
function closeRaise() external;
```

### withdraw

Transfers all funds to the fund receiver, only when the vault is Closed

*Only the admin can withdraw funds*

```solidity
function withdraw() external returns (address[] memory tokens, uint256[] memory withdrawnAmounts);
```

**Returns**

| Name               | Type        | Description                           |
| ------------------ | ----------- | ------------------------------------- |
| `tokens`           | `address[]` | The addresses of the tokens withdrawn |
| `withdrawnAmounts` | `uint256[]` | The amounts of the tokens withdrawn   |

### withdraw

Transfers all funds to the fund receiver, only when the vault is Closed

*Only the admin can withdraw funds*

```solidity
function withdraw(address token) external;
```

**Parameters**

| Name    | Type      | Description                          |
| ------- | --------- | ------------------------------------ |
| `token` | `address` | The address of the token to withdraw |

### updateUsdcContractAddress

Admin updates the USDC contract address

```solidity
function updateUsdcContractAddress(address newUsdcContractAddress) external;
```

**Parameters**

| Name                     | Type      | Description                          |
| ------------------------ | --------- | ------------------------------------ |
| `newUsdcContractAddress` | `address` | The address of the new USDC contract |

## Events

### FundraiseInitialized

Emitted when the fundraise is initialized

```solidity
event FundraiseInitialized(VaultFundraiseStorage.Setup setup);
```

**Parameters**

| Name    | Type                          | Description                        |
| ------- | ----------------------------- | ---------------------------------- |
| `setup` | `VaultFundraiseStorage.Setup` | The initial setup of the fundraise |

### TokensWithdrawn

Emitted when tokens are withdrawn from the vault by the fund receiver

```solidity
event TokensWithdrawn(address indexed receiver, address[] indexed tokens, uint256[] amounts);
```

**Parameters**

| Name       | Type        | Description                           |
| ---------- | ----------- | ------------------------------------- |
| `receiver` | `address`   | The address of the fund receiver      |
| `tokens`   | `address[]` | The addresses of the tokens withdrawn |
| `amounts`  | `uint256[]` | The amounts of the tokens withdrawn   |

### UsdcContractAddressUpdated

Emitted when the USDC contract address is updated

```solidity
event UsdcContractAddressUpdated(address indexed prevUSDC, address indexed newUSDC);
```

**Parameters**

| Name       | Type      | Description                               |
| ---------- | --------- | ----------------------------------------- |
| `prevUSDC` | `address` | The address of the previous USDC contract |
| `newUSDC`  | `address` | The address of the new USDC contract      |

### VaultCanceled

Emitted when the vault is canceled

```solidity
event VaultCanceled();
```

### VaultClosed

Emitted when the vault is closed

```solidity
event VaultClosed();
```


# VaultAdmin

**Inherits:** IVaultAdmin, Initializable, AccessControl, ReentrancyGuardUpgradeable, VaultAssetRegistryAdmin, VaultFundraiseAdmin, VaultWhitelistAdmin, Pausable

Contains the admin functions, constructor, initializer, immutable variables and state checking for AriaIPRWAVault.

## Functions

### initFundraise

Initializes the vault for fundraise.

*Can not initialize both a fundraise and a whitelist vault.*

```solidity
function initFundraise(
    address admin,
    StoryAddrs memory storyAddrs,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    VaultFundraiseStorage.Setup memory fundraiseSetup,
    uint48 mintTimelockDuration,
    uint256 claimDeadline,
    address legal
) public override initializer;
```

**Parameters**

| Name                   | Type                                           | Description                                                                                        |
| ---------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `admin`                | `address`                                      | The address of the admin of the vault                                                              |
| `storyAddrs`           | `StoryAddrs`                                   | The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract. |
| `tokenDetails`         | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token to be deployed                                                 |
| `fundraiseSetup`       | `VaultFundraiseStorage.Setup`                  | The setup of the fundraise                                                                         |
| `mintTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token mints.                               |
| `claimDeadline`        | `uint256`                                      | The deadline for the users to claim the fractional token.                                          |
| `legal`                | `address`                                      | The address of the legal contract that checks blacklist and license.                               |

### initWhitelist

Initializes the vault for whitelist.

*Can not initialize both a fundraise and a whitelist vault.*

```solidity
function initWhitelist(
    address admin,
    StoryAddrs memory storyAddrs,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    bytes32 merkleRoot,
    uint48 mintTimelockDuration,
    uint256 claimDeadline,
    address legal
) public override initializer;
```

**Parameters**

| Name                   | Type                                           | Description                                                                                        |
| ---------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `admin`                | `address`                                      | The address of the admin of the vault                                                              |
| `storyAddrs`           | `StoryAddrs`                                   | The addresses of the Story Protocol's contracts - zero addr check is done in the factory contract. |
| `tokenDetails`         | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token to be deployed                                                 |
| `merkleRoot`           | `bytes32`                                      | The merkle root of the whitelist                                                                   |
| `mintTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token mints.                               |
| `claimDeadline`        | `uint256`                                      | The deadline for the users to claim the fractional token.                                          |
| `legal`                | `address`                                      | The address of the legal contract that checks blacklist and license.                               |

### amIAdmin

*Simplest self admin check*

```solidity
function amIAdmin() external view returns (bool);
```

### execFractionalTokenMint

Executes a previously initiated fractional token mint after the timelock duration.

*Can be triggered by anyone. Checks if the timelock has passed and transfers the tokens. Resets the pending mint state. Reverts if no mint is pending or the timelock has not been reached.*

```solidity
function execFractionalTokenMint() external override nonReentrant;
```

### execTimelockUpdate

Executes a previously initiated update to the admin fractional token mint duration.

*Can only be called by anyone. Checks if the timelock has passed and updates the duration. Resets the pending duration update state. Reverts if no duration update is pending or the timelock has not been reached.*

```solidity
function execTimelockUpdate() external nonReentrant;
```

### initFractionalTokenMint

Initiates a timelocked mint of the vault's fractional tokens by the admin.

*Can only be called by the owner. Records the mint details and sets the unlock timestamp. A mint must be executed via `execFractionalTokenMint` at/after the timelock passes. Reverts if there is already a pending mint.*

```solidity
function initFractionalTokenMint(address recipient, uint256 amount)
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE)
    nonReentrant;
```

**Parameters**

| Name        | Type      | Description                               |
| ----------- | --------- | ----------------------------------------- |
| `recipient` | `address` | The address to receive the minted tokens. |
| `amount`    | `uint256` | The amount of fractional tokens to mint.  |

### initTimelockUpdate

Initiates a timelocked update for the admin fractional token mint duration.

*Can only be called by the owner. Uses the current timelock duration for the delay. A duration update must be executed via `execTimelockUpdate` after the timelock passes. Reverts if there is already a duration update pending.*

```solidity
function initTimelockUpdate(uint48 newDuration)
    external
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE)
    nonReentrant;
```

**Parameters**

| Name          | Type     | Description                           |
| ------------- | -------- | ------------------------------------- |
| `newDuration` | `uint48` | The proposed new duration in seconds. |

### recoverLostTokens

Recovers lost tokens

*Only the admin can recover lost tokens, including fractional tokens as they are minted not sent to the vault.*

```solidity
function recoverLostTokens(address token, address to)
    external
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name    | Type      | Description                              |
| ------- | --------- | ---------------------------------------- |
| `token` | `address` | The address of the token to be recovered |
| `to`    | `address` | The address of the recipient             |

### setClaimDeadline

```solidity
function setClaimDeadline(uint256 newClaimDeadline) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### setPauseState

```solidity
function setPauseState(bool paused_) external;
```

### \_initVault

```solidity
function _initVault(
    address admin,
    StoryAddrs memory storyAddrs,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    VaultType vaultType,
    uint48 mintTimelockDuration,
    uint256 claimDeadline,
    address legal
) internal;
```

### \_execTimelockUpdate

Internal function to execute a pending timelock duration update if the timelock has passed.

```solidity
function _execTimelockUpdate() internal;
```

### \_isTimelockUpdateReady

```solidity
function _isTimelockUpdateReady(uint48 updatemintExec) internal view returns (bool);
```

### \_getAdjustedMintAmount

Calculates the mint amount adjusted to token's cap.

```solidity
function _getAdjustedMintAmount(address fractionalTokenAddress, uint256 requestedAmount)
    internal
    view
    returns (uint256);
```

**Parameters**

| Name                     | Type      | Description                                      |
| ------------------------ | --------- | ------------------------------------------------ |
| `fractionalTokenAddress` | `address` | The address of the ERC20Capped fractional token. |
| `requestedAmount`        | `uint256` | The amount of tokens requested to be minted.     |

**Returns**

| Name     | Type      | Description                                                                                                               |
| -------- | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| `<none>` | `uint256` | The actual amount that can be minted, respecting the cap. Returns 0 if the cap is already met or if requestedAmount is 0. |


# factory

* [AriaIPRWAVaultFactory](/technical-docs/contract-docs/iprwa/vault/factory/ariaiprwavaultfactory)
* [IAriaIPRWAVaultFactory](/technical-docs/contract-docs/iprwa/vault/factory/iariaiprwavaultfactory)


# IAriaIPRWAVaultFactory

Interface for the AriaIPRWAVaultFactory contract

## Functions

### initialize

Initializes the factory

```solidity
function initialize(StoryAddrs memory storyAddrs, address admin_, address vaultTemplate_) external;
```

**Parameters**

| Name             | Type         | Description                     |
| ---------------- | ------------ | ------------------------------- |
| `storyAddrs`     | `StoryAddrs` | The story addresses             |
| `admin_`         | `address`    | The address of the admin        |
| `vaultTemplate_` | `address`    | The address of `AriaIPRWAVault` |

### deployFundraiseIpVault

Deploys a new fundraise IP vault

*zero address checks skipped: they are checked in the AriaIPRWAVault initializer*

```solidity
function deployFundraiseIpVault(
    address admin,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    VaultFundraiseStorage.Setup memory fundraiseSetup,
    uint48 withdrawalTimelockDuration,
    uint256 claimDeadline,
    address legal
) external returns (address ipVault);
```

**Parameters**

| Name                         | Type                                           | Description                                                                |
| ---------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------- |
| `admin`                      | `address`                                      | The address of the admin                                                   |
| `tokenDetails`               | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token                                        |
| `fundraiseSetup`             | `VaultFundraiseStorage.Setup`                  | The setup of the fundraise                                                 |
| `withdrawalTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token withdrawals. |
| `claimDeadline`              | `uint256`                                      | The deadline for the users to claim the fractional token.                  |
| `legal`                      | `address`                                      | The address of the legal contract that checks blacklist and license.       |

**Returns**

| Name      | Type      | Description                          |
| --------- | --------- | ------------------------------------ |
| `ipVault` | `address` | The address of the deployed IP Vault |

### deployWhitelistIpVault

Deploys a new whitelist IP vault

*zero address checks skipped: they are checked in the AriaIPRWAVault initializer*

```solidity
function deployWhitelistIpVault(
    address admin,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    bytes32 merkleRoot,
    uint48 withdrawalTimelockDuration,
    uint256 claimDeadline,
    address legal
) external returns (address ipVault);
```

**Parameters**

| Name                         | Type                                           | Description                                                                |
| ---------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------- |
| `admin`                      | `address`                                      | The address of the admin                                                   |
| `tokenDetails`               | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token                                        |
| `merkleRoot`                 | `bytes32`                                      | The merkle root of the whitelist                                           |
| `withdrawalTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token withdrawals. |
| `claimDeadline`              | `uint256`                                      | The deadline for the users to claim the fractional token.                  |
| `legal`                      | `address`                                      | The address of the legal contract that checks blacklist and license.       |

**Returns**

| Name      | Type      | Description                          |
| --------- | --------- | ------------------------------------ |
| `ipVault` | `address` | The address of the deployed IP Vault |

### setVaultTemplate

Sets the vault template

```solidity
function setVaultTemplate(address newVault) external;
```

**Parameters**

| Name       | Type      | Description                           |
| ---------- | --------- | ------------------------------------- |
| `newVault` | `address` | The address of the new vault template |

### isAdmin

```solidity
function isAdmin(address account) external view returns (bool);
```

**Returns**

| Name     | Type   | Description                     |
| -------- | ------ | ------------------------------- |
| `<none>` | `bool` | True if the caller is the admin |

### getStoryAddrs

Returns the story addresses

```solidity
function getStoryAddrs() external view returns (StoryAddrs memory);
```

**Returns**

| Name     | Type         | Description                    |
| -------- | ------------ | ------------------------------ |
| `<none>` | `StoryAddrs` | storyAddrs The story addresses |

### getVaultTemplate

Returns the address of the vault template

```solidity
function getVaultTemplate() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `address` | vaultTemplate The address of the vault template |

## Events

### FundraiseIpVaultDeployed

Emitted when a new fundraise IP vault is deployed

```solidity
event FundraiseIpVaultDeployed(address indexed ipVault);
```

**Parameters**

| Name      | Type      | Description                     |
| --------- | --------- | ------------------------------- |
| `ipVault` | `address` | The address of the new IP vault |

### WhitelistIpVaultDeployed

Emitted when a new whitelist IP vault is deployed

```solidity
event WhitelistIpVaultDeployed(address indexed ipVault);
```

**Parameters**

| Name      | Type      | Description                     |
| --------- | --------- | ------------------------------- |
| `ipVault` | `address` | The address of the new IP vault |


# AriaIPRWAVaultFactory

**Inherits:** IAriaIPRWAVaultFactory, UUPSUpgradeable, AccessControl

This contract is used to deploy new AriaIPRWAVault instances

## State Variables

### AriaIPRWAVaultFactoryStorageLocation

```solidity
bytes32 public constant AriaIPRWAVaultFactoryStorageLocation =
    0x7921dd9d2a27003607aeccbdc5d8b1cb6480ee25e74a8450b0073a735a571f00;
```

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

Initializes the factory

```solidity
function initialize(StoryAddrs memory storyAddrs, address admin_, address vaultTemplate_) external initializer;
```

**Parameters**

| Name             | Type         | Description                     |
| ---------------- | ------------ | ------------------------------- |
| `storyAddrs`     | `StoryAddrs` | The story addresses             |
| `admin_`         | `address`    | The address of the admin        |
| `vaultTemplate_` | `address`    | The address of `AriaIPRWAVault` |

### deployFundraiseIpVault

Deploys a new fundraise IP vault

*zero address checks skipped: they are checked in the AriaIPRWAVault initializer*

```solidity
function deployFundraiseIpVault(
    address admin,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    VaultFundraiseStorage.Setup memory fundraiseSetup,
    uint48 withdrawalTimelockDuration,
    uint256 claimDeadline,
    address legal
) external returns (address ipVault);
```

**Parameters**

| Name                         | Type                                           | Description                                                                |
| ---------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------- |
| `admin`                      | `address`                                      | The address of the admin                                                   |
| `tokenDetails`               | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token                                        |
| `fundraiseSetup`             | `VaultFundraiseStorage.Setup`                  | The setup of the fundraise                                                 |
| `withdrawalTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token withdrawals. |
| `claimDeadline`              | `uint256`                                      | The deadline for the users to claim the fractional token.                  |
| `legal`                      | `address`                                      | The address of the legal contract that checks blacklist and license.       |

**Returns**

| Name      | Type      | Description                          |
| --------- | --------- | ------------------------------------ |
| `ipVault` | `address` | The address of the deployed IP Vault |

### deployWhitelistIpVault

Deploys a new whitelist IP vault

*zero address checks skipped: they are checked in the AriaIPRWAVault initializer*

```solidity
function deployWhitelistIpVault(
    address admin,
    AriaIPRWAVaultStorage.FractionalTokenDetails memory tokenDetails,
    bytes32 merkleRoot,
    uint48 withdrawalTimelockDuration,
    uint256 claimDeadline,
    address legal
) external returns (address ipVault);
```

**Parameters**

| Name                         | Type                                           | Description                                                                |
| ---------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------- |
| `admin`                      | `address`                                      | The address of the admin                                                   |
| `tokenDetails`               | `AriaIPRWAVaultStorage.FractionalTokenDetails` | The details of the fractional token                                        |
| `merkleRoot`                 | `bytes32`                                      | The merkle root of the whitelist                                           |
| `withdrawalTimelockDuration` | `uint48`                                       | The timelock duration (in seconds) for admin fractional token withdrawals. |
| `claimDeadline`              | `uint256`                                      | The deadline for the users to claim the fractional token.                  |
| `legal`                      | `address`                                      | The address of the legal contract that checks blacklist and license.       |

**Returns**

| Name      | Type      | Description                          |
| --------- | --------- | ------------------------------------ |
| `ipVault` | `address` | The address of the deployed IP Vault |

### setVaultTemplate

Sets the vault template

```solidity
function setVaultTemplate(address newVault) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name       | Type      | Description                           |
| ---------- | --------- | ------------------------------------- |
| `newVault` | `address` | The address of the new vault template |

### isAdmin

```solidity
function isAdmin(address account) external view returns (bool);
```

**Returns**

| Name     | Type   | Description                     |
| -------- | ------ | ------------------------------- |
| `<none>` | `bool` | True if the caller is the admin |

### getStoryAddrs

```solidity
function getStoryAddrs() external view returns (StoryAddrs memory);
```

### getVaultTemplate

Returns the address of the vault template

```solidity
function getVaultTemplate() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `address` | vaultTemplate The address of the vault template |

### \_authorizeUpgrade

*Hook to authorize the upgrade according to UUPSUpgradeable*

*Enforced to be only callable by the protocol admin in governance.*

```solidity
function _authorizeUpgrade(address newImplementation)
    internal
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

**Parameters**

| Name                | Type      | Description                           |
| ------------------- | --------- | ------------------------------------- |
| `newImplementation` | `address` | The address of the new implementation |

### \_deployInitProxy

```solidity
function _deployInitProxy(bytes memory data) internal returns (address ipVault);
```

### \_getAriaIPRWAVaultFactoryStorage

*Returns the storage struct of AriaIPRWAVaultFactory.*

```solidity
function _getAriaIPRWAVaultFactoryStorage() private pure returns (AriaIPRWAVaultFactoryStorage storage $);
```

## Events

### VaultTemplateUpdated

```solidity
event VaultTemplateUpdated(address oldVaultTemplate, address newVaultTemplate);
```

## Structs

### AriaIPRWAVaultFactoryStorage

*Storage structure for the AriaIPRWAVaultFactory*

**Note:** storage-location: erc7201:aria-protocol.AriaIPRWAVaultFactory

```solidity
struct AriaIPRWAVaultFactoryStorage {
    StoryAddrs storyAddrs;
    address vaultTemplate;
}
```


# fundraise

* [IVaultFundraiseUser](/technical-docs/contract-docs/iprwa/vault/fundraise/ivaultfundraiseuser)
* [VaultFundraise](/technical-docs/contract-docs/iprwa/vault/fundraise/vaultfundraise)
* [VaultFundraiseStorage](/technical-docs/contract-docs/iprwa/vault/fundraise/vaultfundraisestorage)


# IVaultFundraiseUser

Interface for the VaultFundraise User functions.

## Functions

### deposit

Deposits USDC to the vault, only when the vault is Open

```solidity
function deposit(address usdc, uint128 amount) external;
```

**Parameters**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `usdc`   | `address` | The USDC address to deposit for the fundraise |
| `amount` | `uint128` | The amount of the USDC token to deposit       |

### claimRefund

Claims refund, only when the vault is Canceled

```solidity
function claimRefund(address usdc) external returns (uint128 amount);
```

**Parameters**

| Name   | Type      | Description                                                                   |
| ------ | --------- | ----------------------------------------------------------------------------- |
| `usdc` | `address` | The USDC address to claim refund for, used as payment token for the fundraise |

**Returns**

| Name     | Type      | Description                          |
| -------- | --------- | ------------------------------------ |
| `amount` | `uint128` | The amount of the USDC token claimed |

## Events

### DepositReceived

Emitted when a deposit is received by the vault

```solidity
event DepositReceived(address indexed depositor, address indexed token, uint128 amount);
```

**Parameters**

| Name        | Type      | Description                       |
| ----------- | --------- | --------------------------------- |
| `depositor` | `address` | The address of the depositor      |
| `token`     | `address` | The address of the token received |
| `amount`    | `uint128` | The amount of the token received  |

### RefundClaimed

Emitted when a refund is claimed by the depositor

```solidity
event RefundClaimed(address indexed claimer, address indexed token, uint128 amount);
```

**Parameters**

| Name      | Type      | Description                      |
| --------- | --------- | -------------------------------- |
| `claimer` | `address` | The address of the claimer       |
| `token`   | `address` | The address of the token claimed |
| `amount`  | `uint128` | The amount of the token claimed  |


# VaultFundraise

**Inherits:** IVaultFundraiseUser, ReentrancyGuardUpgradeable, PausableInternal

Handles the user-facing deposit and refund logic for the fundraise.

Users can only claim their refund if the admin allows it. Centralization is made on purpose. As a user you accept to expose your self at vault's terms or conditions changes.

Require the admin to register the IP and fractionalize it when the fundraise is closed. If you do not trust the admin will do it, DO NOT deposit funds into the fundraise.

## Functions

### claimRefund

Claims refund, only when the vault is Canceled

```solidity
function claimRefund(address usdc) external virtual override nonReentrant whenNotPaused returns (uint128 amount);
```

**Parameters**

| Name   | Type      | Description                                                                   |
| ------ | --------- | ----------------------------------------------------------------------------- |
| `usdc` | `address` | The USDC address to claim refund for, used as payment token for the fundraise |

**Returns**

| Name     | Type      | Description                          |
| -------- | --------- | ------------------------------------ |
| `amount` | `uint128` | The amount of the USDC token claimed |

### deposit

Deposits USDC to the vault, only when the vault is Open

```solidity
function deposit(address usdc, uint128 amount) external virtual override nonReentrant whenNotPaused;
```

**Parameters**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `usdc`   | `address` | The USDC address to deposit for the fundraise |
| `amount` | `uint128` | The amount of the USDC token to deposit       |

### \_checkFundraise

```solidity
function _checkFundraise(VaultFundraiseStorage.FundraiseLayout storage $, address claimer, address usdc) internal;
```

### \_fundraiseCalculateClaim

```solidity
function _fundraiseCalculateClaim(
    VaultFundraiseStorage.FundraiseLayout storage $,
    address claimer,
    address usdc,
    uint256 totalSupplyOfFractionalToken
) internal view returns (uint256);
```


# VaultFundraiseStorage

Library defining the storage layout for VaultFundraise submodule.

## State Variables

### \_FUNDRAISE\_STORAGE\_LOCATION

**Note:** storage-location: erc7201:aria-protocol.AriaIPRWAVault.Fundraise

```solidity
bytes32 internal constant _FUNDRAISE_STORAGE_LOCATION =
    0xe36dd38548499b58d3fbf36ee168c9d1aec283faddba88cc1ca409b4aad71e00;
```

## Functions

### load

*Returns the storage struct of VaultFundraise.*

```solidity
function load() internal pure returns (FundraiseLayout storage $);
```

## Structs

### Setup

*Storage struct for the setup of the fundraise*

```solidity
struct Setup {
    uint256 expirationTime;
    address fundReceiver;
    address usdcContractAddress;
}
```

**Properties**

| Name                  | Type      | Description                                                |
| --------------------- | --------- | ---------------------------------------------------------- |
| `expirationTime`      | `uint256` | The expiration time of the vault (0 if no expiration)      |
| `fundReceiver`        | `address` | The address of the fund receiver (a safe/multisig address) |
| `usdcContractAddress` | `address` | The address of the USDC contract                           |

### FundraiseLayout

*Storage structure for the VaultFundraise submodule*

```solidity
struct FundraiseLayout {
    Setup setup;
    FundraiseState state;
    EnumerableSet.AddressSet usdcInVault;
    mapping(address token => uint256 totalDeposited) totalDeposits;
    mapping(address user => mapping(address token => uint128 amount)) deposits;
}
```

**Properties**

| Name            | Type                                                                | Description                                                      |
| --------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------- |
| `setup`         | `Setup`                                                             | The setup of the fundraise                                       |
| `state`         | `FundraiseState`                                                    | The state of the vault either Open, Closed, or Canceled          |
| `usdcInVault`   | `EnumerableSet.AddressSet`                                          | The set of tokens in the vault (should only be USDC)             |
| `totalDeposits` | `mapping(address token => uint256 totalDeposited)`                  | The total deposits received for each token (should only be USDC) |
| `deposits`      | `mapping(address user => mapping(address token => uint128 amount))` | The deposit token address and amount information of the users    |


# lib

* [VaultStateChecker](/technical-docs/contract-docs/iprwa/vault/lib/vaultstatechecker)


# VaultStateChecker

Library for checking and updating the vault state based on expiration time.

## Functions

### \_checkAndUpdateState

*Checks if the vault has passed its expiration time and updates the state to Closed if needed.*

```solidity
function _checkAndUpdateState(VaultFundraiseStorage.FundraiseLayout storage $) internal;
```

**Parameters**

| Name | Type                                    | Description                       |
| ---- | --------------------------------------- | --------------------------------- |
| `$`  | `VaultFundraiseStorage.FundraiseLayout` | The vault storage layout pointer. |


# view

* [IVaultView](/technical-docs/contract-docs/iprwa/vault/view/ivaultview)
* [VaultView](/technical-docs/contract-docs/iprwa/vault/view/vaultview)


# IVaultView

Interface for the read-only functions of the Aria IP Vault

## Functions

### getDepositedAmount

Returns the deposited amount of a user for a token

```solidity
function getDepositedAmount(address user, address token) external view returns (uint256);
```

**Parameters**

| Name    | Type      | Description              |
| ------- | --------- | ------------------------ |
| `user`  | `address` | The address of the user  |
| `token` | `address` | The address of the token |

**Returns**

| Name     | Type      | Description                                           |
| -------- | --------- | ----------------------------------------------------- |
| `<none>` | `uint256` | amount The deposited amount of the user for the token |

### getExpirationTime

Returns the expiration time of the vault

```solidity
function getExpirationTime() external view returns (uint256);
```

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `uint256` | expirationTime The expiration time of the vault |

### getFundReceiver

Returns the address of the fund receiver

```solidity
function getFundReceiver() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `<none>` | `address` | fundReceiver The address of the fund receiver |

### getTotalDeposited

Returns the total deposited amount of a token

```solidity
function getTotalDeposited(address token) external view returns (uint256);
```

**Parameters**

| Name    | Type      | Description              |
| ------- | --------- | ------------------------ |
| `token` | `address` | The address of the token |

**Returns**

| Name     | Type      | Description                                            |
| -------- | --------- | ------------------------------------------------------ |
| `<none>` | `uint256` | totalDeposited The total deposited amount of the token |

### getUsdcContractAddress

Returns the address of the USDC contract

```solidity
function getUsdcContractAddress() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                          |
| -------- | --------- | ---------------------------------------------------- |
| `<none>` | `address` | usdcContractAddress The address of the USDC contract |

### getState

Returns the state of the vault

```solidity
function getState() external view returns (FundraiseState);
```

**Returns**

| Name     | Type             | Description                  |
| -------- | ---------------- | ---------------------------- |
| `<none>` | `FundraiseState` | state The state of the vault |

### merkleRoot

Returns the current Merkle root.

```solidity
function merkleRoot() external view returns (bytes32);
```

### getClaimDeadline

Returns the claim deadline

```solidity
function getClaimDeadline() external view returns (uint256);
```

**Returns**

| Name     | Type      | Description                      |
| -------- | --------- | -------------------------------- |
| `<none>` | `uint256` | claimDeadline The claim deadline |

### getFractionalTokenReceiver

Returns the address of the fractional token receiver - usually staking contract, to collect royalties and distributed to stakers.

```solidity
function getFractionalTokenReceiver() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                                          |
| -------- | --------- | -------------------------------------------------------------------- |
| `<none>` | `address` | fractionalTokenReceiver The address of the fractional token receiver |

### getFractionalToken

Returns the address of the fractional token (0 if not fractionalized)

```solidity
function getFractionalToken() external view returns (address);
```

**Returns**

| Name     | Type      | Description                                         |
| -------- | --------- | --------------------------------------------------- |
| `<none>` | `address` | fractionalToken The address of the fractional token |

### getFractionalTokenClaimed

```solidity
function getFractionalTokenClaimed(address usdc, address user) external view returns (bool);
```

**Parameters**

| Name   | Type      | Description                      |
| ------ | --------- | -------------------------------- |
| `usdc` | `address` | The address of the USDC contract |
| `user` | `address` | The address of the user          |

**Returns**

| Name     | Type   | Description                                                                 |
| -------- | ------ | --------------------------------------------------------------------------- |
| `<none>` | `bool` | claimed Whether the fractional token has been claimed for `user` for `usdc` |

### getFractionalTokenClaimedWhitelist

*For whitelist, there is a workaround. Always use `_USDC_WHITELIST` as `usdc` as users have not deposited USDC.*

```solidity
function getFractionalTokenClaimedWhitelist(address user) external view returns (bool);
```

**Parameters**

| Name   | Type      | Description             |
| ------ | --------- | ----------------------- |
| `user` | `address` | The address of the user |

**Returns**

| Name     | Type   | Description                                                                    |
| -------- | ------ | ------------------------------------------------------------------------------ |
| `<none>` | `bool` | claimed Whether the fractional token has been claimed for `user` for whitelist |

### getFractionalTokenName

Returns the name of the fractional token

```solidity
function getFractionalTokenName() external view returns (string memory);
```

**Returns**

| Name     | Type     | Description                                          |
| -------- | -------- | ---------------------------------------------------- |
| `<none>` | `string` | fractionalTokenName The name of the fractional token |

### getFractionalTokenSymbol

Returns the symbol of the fractional token

```solidity
function getFractionalTokenSymbol() external view returns (string memory);
```

**Returns**

| Name     | Type     | Description                                              |
| -------- | -------- | -------------------------------------------------------- |
| `<none>` | `string` | fractionalTokenSymbol The symbol of the fractional token |

### getIpId

Returns the ID of the IP (0 if not registered)

```solidity
function getIpId() external view returns (address);
```

**Returns**

| Name     | Type      | Description           |
| -------- | --------- | --------------------- |
| `<none>` | `address` | ipId The ID of the IP |

### getLegal

Returns the address of the legal contract

```solidity
function getLegal() external view returns (address);
```

**Returns**

| Name     | Type      | Description                             |
| -------- | --------- | --------------------------------------- |
| `<none>` | `address` | legal The address of the legal contract |

### getStoryAddrs

Returns the story addresses

```solidity
function getStoryAddrs() external view returns (StoryAddrs memory);
```

**Returns**

| Name     | Type         | Description                    |
| -------- | ------------ | ------------------------------ |
| `<none>` | `StoryAddrs` | storyAddrs The story addresses |

### getTimelockData

Returns the timelock data for the fractional token mint

```solidity
function getTimelockData() external view returns (AriaIPRWAVaultStorage.MintTimelock memory);
```

**Returns**

| Name     | Type                                 | Description                                                  |
| -------- | ------------------------------------ | ------------------------------------------------------------ |
| `<none>` | `AriaIPRWAVaultStorage.MintTimelock` | timelockData The timelock data for the fractional token mint |

### getTotalSupplyOfFractionalToken

Returns the total supply of the fractional token

```solidity
function getTotalSupplyOfFractionalToken() external view returns (uint256);
```

**Returns**

| Name     | Type      | Description                                                           |
| -------- | --------- | --------------------------------------------------------------------- |
| `<none>` | `uint256` | totalSupplyOfFractionalToken The total supply of the fractional token |

### getVaultType

Returns the type of the vault

```solidity
function getVaultType() external view returns (VaultType);
```

**Returns**

| Name     | Type        | Description                     |
| -------- | ----------- | ------------------------------- |
| `<none>` | `VaultType` | vaultType The type of the vault |


# VaultView

**Inherits:** IVaultView

Contains the read-only view/pure functions for the AriaIPRWAVault. This contract reads directly from AriaIPRWAVaultStorage.

## Functions

### getDepositedAmount

Returns the deposited amount of a user for a token

```solidity
function getDepositedAmount(address user, address token) external view override returns (uint256);
```

**Parameters**

| Name    | Type      | Description              |
| ------- | --------- | ------------------------ |
| `user`  | `address` | The address of the user  |
| `token` | `address` | The address of the token |

**Returns**

| Name     | Type      | Description                                           |
| -------- | --------- | ----------------------------------------------------- |
| `<none>` | `uint256` | amount The deposited amount of the user for the token |

### getExpirationTime

Returns the expiration time of the vault

```solidity
function getExpirationTime() external view override returns (uint256);
```

**Returns**

| Name     | Type      | Description                                     |
| -------- | --------- | ----------------------------------------------- |
| `<none>` | `uint256` | expirationTime The expiration time of the vault |

### getFundReceiver

Returns the address of the fund receiver

```solidity
function getFundReceiver() external view override returns (address);
```

**Returns**

| Name     | Type      | Description                                   |
| -------- | --------- | --------------------------------------------- |
| `<none>` | `address` | fundReceiver The address of the fund receiver |

### getTotalDeposited

Returns the total deposited amount of a token

```solidity
function getTotalDeposited(address token) external view override returns (uint256);
```

**Parameters**

| Name    | Type      | Description              |
| ------- | --------- | ------------------------ |
| `token` | `address` | The address of the token |

**Returns**

| Name     | Type      | Description                                            |
| -------- | --------- | ------------------------------------------------------ |
| `<none>` | `uint256` | totalDeposited The total deposited amount of the token |

### getUsdcContractAddress

Returns the address of the USDC contract

```solidity
function getUsdcContractAddress() external view override returns (address);
```

**Returns**

| Name     | Type      | Description                                          |
| -------- | --------- | ---------------------------------------------------- |
| `<none>` | `address` | usdcContractAddress The address of the USDC contract |

### getState

Returns the state of the vault

```solidity
function getState() external view override returns (FundraiseState);
```

**Returns**

| Name     | Type             | Description                  |
| -------- | ---------------- | ---------------------------- |
| `<none>` | `FundraiseState` | state The state of the vault |

### merkleRoot

Returns the current Merkle root.

```solidity
function merkleRoot() external view override returns (bytes32);
```

### getClaimDeadline

Returns the claim deadline

```solidity
function getClaimDeadline() external view override returns (uint256);
```

**Returns**

| Name     | Type      | Description                      |
| -------- | --------- | -------------------------------- |
| `<none>` | `uint256` | claimDeadline The claim deadline |

### getFractionalTokenReceiver

Returns the address of the fractional token receiver - usually staking contract, to collect royalties and distributed to stakers.

```solidity
function getFractionalTokenReceiver() external view override returns (address);
```

**Returns**

| Name     | Type      | Description                                                          |
| -------- | --------- | -------------------------------------------------------------------- |
| `<none>` | `address` | fractionalTokenReceiver The address of the fractional token receiver |

### getFractionalToken

Returns the address of the fractional token (0 if not fractionalized)

```solidity
function getFractionalToken() external view override returns (address);
```

**Returns**

| Name     | Type      | Description                                         |
| -------- | --------- | --------------------------------------------------- |
| `<none>` | `address` | fractionalToken The address of the fractional token |

### getFractionalTokenClaimed

```solidity
function getFractionalTokenClaimed(address usdc, address user) external view override returns (bool);
```

**Parameters**

| Name   | Type      | Description                      |
| ------ | --------- | -------------------------------- |
| `usdc` | `address` | The address of the USDC contract |
| `user` | `address` | The address of the user          |

**Returns**

| Name     | Type   | Description                                                                 |
| -------- | ------ | --------------------------------------------------------------------------- |
| `<none>` | `bool` | claimed Whether the fractional token has been claimed for `user` for `usdc` |

### getFractionalTokenClaimedWhitelist

*For whitelist, there is a workaround. Always use `_USDC_WHITELIST` as `usdc` as users have not deposited USDC.*

```solidity
function getFractionalTokenClaimedWhitelist(address user) external view override returns (bool);
```

**Parameters**

| Name   | Type      | Description             |
| ------ | --------- | ----------------------- |
| `user` | `address` | The address of the user |

**Returns**

| Name     | Type   | Description                                                                    |
| -------- | ------ | ------------------------------------------------------------------------------ |
| `<none>` | `bool` | claimed Whether the fractional token has been claimed for `user` for whitelist |

### getFractionalTokenName

Returns the name of the fractional token

```solidity
function getFractionalTokenName() external view override returns (string memory);
```

**Returns**

| Name     | Type     | Description                                          |
| -------- | -------- | ---------------------------------------------------- |
| `<none>` | `string` | fractionalTokenName The name of the fractional token |

### getFractionalTokenSymbol

Returns the symbol of the fractional token

```solidity
function getFractionalTokenSymbol() external view override returns (string memory);
```

**Returns**

| Name     | Type     | Description                                              |
| -------- | -------- | -------------------------------------------------------- |
| `<none>` | `string` | fractionalTokenSymbol The symbol of the fractional token |

### getIpId

Returns the ID of the IP (0 if not registered)

```solidity
function getIpId() external view override returns (address);
```

**Returns**

| Name     | Type      | Description           |
| -------- | --------- | --------------------- |
| `<none>` | `address` | ipId The ID of the IP |

### getLegal

Returns the address of the legal contract

```solidity
function getLegal() external view override returns (address);
```

**Returns**

| Name     | Type      | Description                             |
| -------- | --------- | --------------------------------------- |
| `<none>` | `address` | legal The address of the legal contract |

### getStoryAddrs

Returns the story addresses

```solidity
function getStoryAddrs() external view override returns (StoryAddrs memory);
```

**Returns**

| Name     | Type         | Description                    |
| -------- | ------------ | ------------------------------ |
| `<none>` | `StoryAddrs` | storyAddrs The story addresses |

### getTimelockData

Returns the timelock data for the fractional token mint

```solidity
function getTimelockData() external view override returns (AriaIPRWAVaultStorage.MintTimelock memory);
```

**Returns**

| Name     | Type                                 | Description                                                  |
| -------- | ------------------------------------ | ------------------------------------------------------------ |
| `<none>` | `AriaIPRWAVaultStorage.MintTimelock` | timelockData The timelock data for the fractional token mint |

### getTotalSupplyOfFractionalToken

Returns the total supply of the fractional token

```solidity
function getTotalSupplyOfFractionalToken() external view override returns (uint256);
```

**Returns**

| Name     | Type      | Description                                                           |
| -------- | --------- | --------------------------------------------------------------------- |
| `<none>` | `uint256` | totalSupplyOfFractionalToken The total supply of the fractional token |

### getVaultType

Returns the type of the vault

```solidity
function getVaultType() external view override returns (VaultType);
```

**Returns**

| Name     | Type        | Description                     |
| -------- | ----------- | ------------------------------- |
| `<none>` | `VaultType` | vaultType The type of the vault |


# whitelist

* [whitelist](/technical-docs/contract-docs/iprwa/vault/whitelist)
* [WhitelistStorage](/technical-docs/contract-docs/iprwa/vault/whitelist/whiteliststorage)


# WhitelistStorage

Library defining the storage layout for the Whitelist submodule.

## State Variables

### \_WHITELIST\_STORAGE\_LOCATION

**Note:** storage-location: erc7201:aria-protocol.AriaIPRWAVault.Whitelist

```solidity
bytes32 internal constant _WHITELIST_STORAGE_LOCATION =
    0x7988169b8d12cfaa4bde80f77a174263686c25bbc59bde731dcc4b288ad38f00;
```

## Functions

### load

*Returns the storage struct of the Whitelist module.*

```solidity
function load() internal pure returns (WhitelistLayout storage $);
```

## Structs

### WhitelistLayout

*Storage structure for the Whitelist submodule.*

```solidity
struct WhitelistLayout {
    bytes32 merkleRoot;
}
```

**Properties**

| Name         | Type      | Description                       |
| ------------ | --------- | --------------------------------- |
| `merkleRoot` | `bytes32` | The Merkle root of the whitelist. |


# Whitelist

Core whitelist module logic, including Merkle proof verification.

## Functions

### \_checkWhitelist

Verifies if an address is whitelisted for a specific amount using a Merkle proof.

*Internal function to be used by vault on fractionalised token minting. If whitelisting is disabled, this function reverts.*

```solidity
function _checkWhitelist(bytes32[] calldata _proof, address _account, uint256 _amount) internal view returns (bool);
```

**Parameters**

| Name       | Type        | Description                             |
| ---------- | ----------- | --------------------------------------- |
| `_proof`   | `bytes32[]` | The Merkle proof.                       |
| `_account` | `address`   | The address to verify.                  |
| `_amount`  | `uint256`   | The amount associated with the address. |

**Returns**

| Name     | Type   | Description                                                             |
| -------- | ------ | ----------------------------------------------------------------------- |
| `<none>` | `bool` | True if proof is valid or if whitelisting is disabled. False otherwise. |

### \_computeLeaf

Helper function to compute the keccak256 hash of the packed address and amount.

*Used to generate leaf nodes for the Merkle tree.*

*Hashes of the leafs are generated using keccak256(bytes.concat(keccak256(abi.encode(...)))), which is the same as OpenZeppelin/merkle-tree package.*

```solidity
function _computeLeaf(address _account, uint256 _amount) internal view returns (bytes32);
```

**Parameters**

| Name       | Type      | Description                             |
| ---------- | --------- | --------------------------------------- |
| `_account` | `address` | The address to hash.                    |
| `_amount`  | `uint256` | The amount associated with the address. |

**Returns**

| Name     | Type      | Description         |
| -------- | --------- | ------------------- |
| `<none>` | `bytes32` | The keccak256 hash. |


# IAriaIPRWAVault

Interface for users interactions with the Aria IP Vault

## Functions

### claimFractionalTokens

Caller claims the fractionalized IP tokens from fundraise, only when the vault is Closed.

```solidity
function claimFractionalTokens(address usdc) external returns (address fractionalToken, uint256 amountClaimed);
```

**Parameters**

| Name   | Type      | Description                                                                                                                                                           |
| ------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `usdc` | `address` | The USDC address used to deposit funds into the fundraise. As it can change over the fundraise lifetime, it is required to specify the USDC address used for deposit. |

**Returns**

| Name              | Type      | Description                                |
| ----------------- | --------- | ------------------------------------------ |
| `fractionalToken` | `address` | The address of the fractional token        |
| `amountClaimed`   | `uint256` | The amount of the fractional token claimed |

### claimFractionalTokens

Caller claims the fractionalized IP tokens depending on the whitelist, vault state not relevant.

```solidity
function claimFractionalTokens(bytes32[] calldata _proof, uint256 _amount)
    external
    returns (address fractionalToken, uint256 amountClaimed);
```

**Parameters**

| Name      | Type        | Description                                  |
| --------- | ----------- | -------------------------------------------- |
| `_proof`  | `bytes32[]` | The proof of the whitelist                   |
| `_amount` | `uint256`   | The amount to claim of the fractional tokens |

**Returns**

| Name              | Type      | Description                                |
| ----------------- | --------- | ------------------------------------------ |
| `fractionalToken` | `address` | The address of the fractional token        |
| `amountClaimed`   | `uint256` | The amount of the fractional token claimed |

## Events

### FractionalTokenClaimed

Emitted when the fractional token is claimed

```solidity
event FractionalTokenClaimed(address indexed claimer, uint256 amountClaimed);
```

**Parameters**

| Name            | Type      | Description                                |
| --------------- | --------- | ------------------------------------------ |
| `claimer`       | `address` | The address of the claimer                 |
| `amountClaimed` | `uint256` | The amount of the fractional token claimed |


# AriaIPRWAVault

**Inherits:** UUPSUpgradeable, IAriaIPRWAVault, ERC721Holder, VaultAdmin, VaultFundraise, VaultView, Whitelist

Main contract orchestrating vault logic by inheriting fundraise, admin, and view functionalities. Directly implements fractional token claim function.

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### claimFractionalTokens

Caller claims the fractionalized IP tokens from fundraise, only when the vault is Closed.

```solidity
function claimFractionalTokens(address usdc)
    external
    override
    nonReentrant
    whenNotPaused
    returns (address fractionalToken, uint256 amountClaimed);
```

**Parameters**

| Name   | Type      | Description                                                                                                                                                           |
| ------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `usdc` | `address` | The USDC address used to deposit funds into the fundraise. As it can change over the fundraise lifetime, it is required to specify the USDC address used for deposit. |

**Returns**

| Name              | Type      | Description                                |
| ----------------- | --------- | ------------------------------------------ |
| `fractionalToken` | `address` | The address of the fractional token        |
| `amountClaimed`   | `uint256` | The amount of the fractional token claimed |

### claimFractionalTokens

Caller claims the fractionalized IP tokens from fundraise, only when the vault is Closed.

```solidity
function claimFractionalTokens(bytes32[] calldata _proof, uint256 _amount)
    external
    override
    nonReentrant
    whenNotPaused
    returns (address fractionalToken, uint256 amountClaimed);
```

**Parameters**

| Name      | Type        | Description |
| --------- | ----------- | ----------- |
| `_proof`  | `bytes32[]` |             |
| `_amount` | `uint256`   |             |

**Returns**

| Name              | Type      | Description                                |
| ----------------- | --------- | ------------------------------------------ |
| `fractionalToken` | `address` | The address of the fractional token        |
| `amountClaimed`   | `uint256` | The amount of the fractional token claimed |

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address newImplementation)
    internal
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### \_checkClaim

```solidity
function _checkClaim(AriaIPRWAVaultStorage.VaultLayout storage $, address usdc, address claimer) internal view;
```

### \_checkLegal

```solidity
function _checkLegal(address legal, address claimer) internal view;
```

### \_mintAndEmitEvent

```solidity
function _mintAndEmitEvent(
    AriaIPRWAVaultStorage.VaultLayout storage $,
    address usdc,
    address claimer,
    uint256 amountClaimed
) internal;
```


# AriaIPRWAVaultStorage

Library defining the storage layout for AriaIPRWAVault

## State Variables

### \_USDC\_WHITELIST

```solidity
address internal constant _USDC_WHITELIST = address(0x1111);
```

### \_VAULT\_STORAGE\_LOCATION

```solidity
bytes32 internal constant _VAULT_STORAGE_LOCATION = 0xe7b1abf471f6912a1af2d62d0d4c101e77095c0310eb81a682a961d537170900;
```

## Functions

### load

*Returns the storage struct of AriaIPRWAVault.*

```solidity
function load() internal pure returns (VaultLayout storage $);
```

## Structs

### FractionalTokenDetails

*Storage strXuct for fractional token details to be used.*

```solidity
struct FractionalTokenDetails {
    string fractionalTokenName;
    string fractionalTokenSymbol;
    uint104 fractionalTokenTotalSupply;
}
```

**Properties**

| Name                         | Type      | Description                              |
| ---------------------------- | --------- | ---------------------------------------- |
| `fractionalTokenName`        | `string`  | The name of the fractional token         |
| `fractionalTokenSymbol`      | `string`  | The symbol of the fractional token       |
| `fractionalTokenTotalSupply` | `uint104` | The total supply of the fractional token |

### MintTimelock

*Storage structure for admin fractional token mint timelock.*

```solidity
struct MintTimelock {
    uint256 pendingAmount;
    address pendingRecipient;
    uint48 mintExec;
    uint48 timelockDuration;
    uint48 pendingTimelockDuration;
    uint48 timelockDurationExec;
}
```

**Properties**

| Name                      | Type      | Description                                                                                                               |
| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| `pendingAmount`           | `uint256` | The amount of fractional tokens pending for mint.                                                                         |
| `pendingRecipient`        | `address` | The recipient address for the pending mint.                                                                               |
| `mintExec`                | `uint48`  | The Unix timestamp when the admin mint becomes executable.                                                                |
| `timelockDuration`        | `uint48`  | The timelock duration to wait for every new admin mint - will never be zero (checked in contract initializer and setter). |
| `pendingTimelockDuration` | `uint48`  | The new timelock duration to be used for the mint.                                                                        |
| `timelockDurationExec`    | `uint48`  | The Unix timestamp when the new timelock duration can be applied.                                                         |

### VaultLayout

*Storage structure for the AriaIPRWAVault*

```solidity
struct VaultLayout {
    StoryAddrs storyAddrs;
    FractionalTokenDetails tokenDetails;
    VaultType vaultType;
    address ipId;
    address fractionalToken;
    address fractionalTokenReceiver;
    mapping(address usdc => mapping(address user => bool claimed)) fractionalTokenClaimed;
    MintTimelock timelock;
    uint256 claimDeadline;
    address legal;
}
```

**Properties**

| Name                      | Type                                                             | Description                                                                                                                                                                           |
| ------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `storyAddrs`              | `StoryAddrs`                                                     | The addresses of the Story Protocol's contracts                                                                                                                                       |
| `tokenDetails`            | `FractionalTokenDetails`                                         | The details of the fractional token                                                                                                                                                   |
| `vaultType`               | `VaultType`                                                      | The type of the vault either Fundraise or Whitelist. Only a single type can be used at a time. Can not be updated once set.                                                           |
| `ipId`                    | `address`                                                        | The ID of the IP                                                                                                                                                                      |
| `fractionalToken`         | `address`                                                        | The address of deployed fractional token                                                                                                                                              |
| `fractionalTokenReceiver` | `address`                                                        | The address of fractional token receiver - usually staking contract, to collect royalties and distributed to stakers.                                                                 |
| `fractionalTokenClaimed`  | `mapping(address usdc => mapping(address user => bool claimed))` | The flag to check if the user has claimed the fractional token for a given USDC address. In whitelist, there is a workaround with \_USDC\_WHITELIST as users have not deposited USDC. |
| `timelock`                | `MintTimelock`                                                   | State for the admin's fractional token mint timelock.                                                                                                                                 |
| `claimDeadline`           | `uint256`                                                        | The deadline for the users to claim the fractional token.                                                                                                                             |
| `legal`                   | `address`                                                        | The address of the legal contract that checks blacklist and license.                                                                                                                  |


# FundraiseState

The state of the vault Open: Anyone can deposit USDC to the vault. The admin can cancel or close the vault. Closed: The admin can withdraw all funds to the fund receiver + user can claim their fractional tokens. Canceled: The users can claim their full refund.

```solidity
enum FundraiseState {
    None,
    Open,
    Closed,
    Canceled
}
```


# VaultType

The type of the vault.

*A single type can be used at a time. Can not be updated once set. None: The vault is not initialized Fundraise: The vault is initialized for a fundraise Whitelist: The vault is initialized for a whitelist*

```solidity
enum VaultType {
    None,
    Fundraise,
    Whitelist
}
```


# Constants

### PAUSABLE\_ROLE

```solidity
bytes32 constant PAUSABLE_ROLE = 0xb497b1ddf9f996bde9f32a3072044948570151e5ffe3a9aef9c5cbfefdd42ba4;
```


# StoryAddrs

*Storage structure for the Story Protocol's contracts*

```solidity
struct StoryAddrs {
    IRoyaltyTokenDistributionWorkflows rtDistributionWorkflows;
    IRoyaltyModule royaltyModule;
    ITokenizerModule tokenizerModule;
}
```

**Properties**

| Name                      | Type                                 | Description                                      |
| ------------------------- | ------------------------------------ | ------------------------------------------------ |
| `rtDistributionWorkflows` | `IRoyaltyTokenDistributionWorkflows` |                                                  |
| `royaltyModule`           | `IRoyaltyModule`                     | The address of Story Protocol's royalty module   |
| `tokenizerModule`         | `ITokenizerModule`                   | The address of Story Protocol's tokenizer module |


# legal

* [interfaces](/technical-docs/contract-docs/iprwa/vault/admin/interfaces)
* [modules](/technical-docs/contract-docs/legal/modules)
* [Legal](/technical-docs/contract-docs/legal/legal)


# interfaces

* [IBlacklist](/technical-docs/contract-docs/legal/interfaces/iblacklist)
* [ILicense](/technical-docs/contract-docs/legal/interfaces/ilicense)


# IBlacklist

## Functions

### blacklistedAccounts

Returns all blacklisted accounts.

```solidity
function blacklistedAccounts() external view returns (address[] memory);
```

### blacklistedLength

Returns the number of blacklisted accounts.

```solidity
function blacklistedLength() external view returns (uint256);
```

### isBlacklisted

Returns true if the account is blacklisted.

```solidity
function isBlacklisted(address account) external view returns (bool);
```

## Events

### Blacklisted

Emitted when an account is added to the blacklist.

```solidity
event Blacklisted(address indexed account);
```

### Unblacklisted

Emitted when an account is removed from the blacklist.

```solidity
event Unblacklisted(address indexed account);
```

## Errors

### Blacklist\_\_AlreadyBlacklisted

```solidity
error Blacklist__AlreadyBlacklisted();
```

### Blacklist\_\_Blacklisted

```solidity
error Blacklist__Blacklisted();
```

### Blacklist\_\_NotBlacklisted

```solidity
error Blacklist__NotBlacklisted();
```


# ILicense

## Functions

### signLicense

Allows a user to sign the current license.

```solidity
function signLicense(bytes calldata signature) external;
```

### contentURIHash

Returns the hash of the current license URI.

```solidity
function contentURIHash() external view returns (bytes32);
```

### licenseURI

Returns the URI of the current license.

```solidity
function licenseURI() external view returns (string memory);
```

### licenseURIOf

Returns the URI of a specific license version.

```solidity
function licenseURIOf(uint256 version) external view returns (string memory);
```

### licenseVersion

Returns the current license version.

```solidity
function licenseVersion() external view returns (uint256);
```

### hasSignedCurrentLicense

Returns true if the account has signed the current license version.

```solidity
function hasSignedCurrentLicense(address account) external view returns (bool);
```

## Events

### LicenseSigned

Emitted when an account signs a license version.

```solidity
event LicenseSigned(address indexed account, uint256 indexed version);
```

### LicenseURIUpdated

Emitted when a new license URI is set.

```solidity
event LicenseURIUpdated(uint256 indexed version, string indexed uri, bytes32 indexed contentHash);
```

### LicenseSignatureRevoked

Emitted when a license signature is revoked.

```solidity
event LicenseSignatureRevoked(address indexed account, uint256 indexed version);
```

## Errors

### License\_\_AlreadySigned

```solidity
error License__AlreadySigned();
```

### License\_\_InvalidURI

```solidity
error License__InvalidURI();
```

### License\_\_NotSigned

```solidity
error License__NotSigned();
```

### License\_\_NoLicenseToSign

```solidity
error License__NoLicenseToSign();
```

### License\_\_SignatureNotFound

```solidity
error License__SignatureNotFound();
```

### License\_\_InvalidSignature

```solidity
error License__InvalidSignature();
```


# modules

* [Blacklist](/technical-docs/contract-docs/legal/modules/blacklist)
* [BlacklistLayout](/technical-docs/contract-docs/legal/modules/blacklistlayout)
* [BlacklistStorage](/technical-docs/contract-docs/legal/modules/blackliststorage)
* [License](/technical-docs/contract-docs/legal/modules/license)
* [LicenseLayout](/technical-docs/contract-docs/legal/modules/licenselayout)
* [LicenseStorage](/technical-docs/contract-docs/legal/modules/licensestorage)


# Blacklist

**Inherits:** IBlacklist, AccessControlInternal

## Functions

### setBacklistValue

```solidity
function setBacklistValue(address account, bool value) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### blacklistedAccounts

Returns all blacklisted accounts.

```solidity
function blacklistedAccounts() external view override returns (address[] memory);
```

### blacklistedLength

Returns the number of blacklisted accounts.

```solidity
function blacklistedLength() external view override returns (uint256);
```

### isBlacklisted

Returns true if the account is blacklisted.

```solidity
function isBlacklisted(address account) external view override returns (bool);
```


# BlacklistLayout

```solidity
struct BlacklistLayout {
    EnumerableSet.AddressSet blacklisted;
}
```


# BlacklistStorage

## State Variables

### \_BLACKLIST\_STORAGE\_LOCATION

```solidity
bytes32 internal constant _BLACKLIST_STORAGE_LOCATION = 0x0;
```

## Functions

### load

```solidity
function load() internal pure returns (BlacklistLayout storage $);
```


# License

**Inherits:** ILicense, AccessControlInternal, EIP712

## State Variables

### SIGN\_LICENSE\_TYPEHASH

```solidity
bytes32 private constant SIGN_LICENSE_TYPEHASH = keccak256("SignLicense(string licenseURI,bytes32 contentURIHash)");
```

## Functions

### signLicense

User

```solidity
function signLicense(bytes calldata signature) external override;
```

### revokeCurrentSignature

Admin

```solidity
function revokeCurrentSignature(address account) external onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### setLicenseURI

```solidity
function setLicenseURI(string memory uri, bytes32 contentHash)
    external
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```

### licenseVersion

```solidity
function licenseVersion() public view override returns (uint256);
```

### licenseURIOf

```solidity
function licenseURIOf(uint256 version) public view override returns (string memory);
```

### licenseURI

```solidity
function licenseURI() external view override returns (string memory);
```

### contentURIHash

```solidity
function contentURIHash() external view override returns (bytes32);
```

### hasSignedCurrentLicense

```solidity
function hasSignedCurrentLicense(address account) external view override returns (bool);
```

### \_buildDigest

```solidity
function _buildDigest() internal view virtual returns (bytes32);
```

### \_domainNameAndVersion

```solidity
function _domainNameAndVersion() internal view override returns (string memory name, string memory version);
```

### \_domainNameAndVersionMayChange

```solidity
function _domainNameAndVersionMayChange() internal pure override returns (bool result);
```

### \_setLicenseURI

```solidity
function _setLicenseURI(string memory uri, bytes32 contentHash) internal;
```


# LicenseLayout

```solidity
struct LicenseLayout {
    uint256 licenseVersion;
    bytes32 contentURIHash;
    mapping(uint256 version => string) licenseURIOf;
    mapping(address account => bytes) signatures;
}
```


# LicenseStorage

## State Variables

### \_LICENSE\_STORAGE\_LOCATION

```solidity
bytes32 internal constant _LICENSE_STORAGE_LOCATION = 0x0;
```

## Functions

### load

```solidity
function load() internal pure returns (LicenseLayout storage $);
```


# Legal

**Inherits:** Initializable, AccessControl, Blacklist, License, UUPSUpgradeable

## Functions

### constructor

**Note:** oz-upgrades-unsafe-allow: constructor

```solidity
constructor();
```

### initialize

```solidity
function initialize(address _owner) external initializer;
```

### \_authorizeUpgrade

```solidity
function _authorizeUpgrade(address newImplementation)
    internal
    override
    onlyRole(AccessControlStorage.DEFAULT_ADMIN_ROLE);
```


# Remixing

When an asset is **remixed**, a process where a derivative work is made of an IP asset, an on chain asset is tokenized for this and will be distributed to the derivative work creator, the original IP's token stakers, and sold to the public on DEX's.

Assets can either be **parents assets** or **child assets**. A Parent asset is an original work, not remixed from any other asset, while a child asset is derived from a parent token — an original work.

The distribution of liquidity for child tokens is:

* 25% retained by the parent work creator
* 50% airdropped to stakers of the original IP
* 25% sold to the public on DEX's

When an asset is remixed, the royalties will remain completely with the parent asset — there is no splitting up of royalty revenue from the parent asset among child assets. All royalty for the child asset will come from revenue generated by the child asset.


# Security

Describe admin limitations so that way users know their funds are secure


# Aria Protocol


# Tokens and NFTs


# $IP

## What is $IP?

$IP is the token used by **Story Protocol**, the layer 1 blockchain which Aria Protocol is built on top of.

## Function

$IP is used to pay gas fees when making transactions on the Story network.

## Distribution

$IP tokens are available for purchase and trade on both centralized exchanges and decentralized exchanges.

Read more about $IP here: [https://www.story.foundation/blog/introducing-ip](<https://www.story.foundation/blog/introducing-ip&#xA;>)

<br>


# Staking Tickets

## Description

ERC-721 Tokens (NFTs) representing IPRWA held to be converted to stIPRWA.

## Function

Locks IPRWA tokens for a predetermined time before they can be converted to stIPRWA.

## Technical Implementation

Contains metadata about the amount of IPRWA locked, and when they become redeemable to stIPRWA.

## Lifecycle

1. Created when staking begins
2. Held during lock period
3. Burned when redeemed for stIPRWA


