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*

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)

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

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

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

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

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

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

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