SnowconeDAO
ResourcesMediaDocs
  • Introduction
  • Create
    • Make Your Snowcone Project
      • Project Details
      • Funding
      • Token
      • Rules
    • Governance Resources
      • Snapshot
      • Gnosis Safe
    • Community Resources
      • Make a Discord Server
  • Learn
    • Overview
    • Architecture
    • Administration
    • Risk
    • Glossary
      • Ballot
      • Data Source
      • Delegate
      • Discount Rate
      • Funding cycle
      • NFT rewards
      • Operator
      • Overflow
      • Payment terminal
      • Project
      • Redemption rate
      • Reserved tokens
      • Split allocator
      • Splits
      • Tokens
    • Tokenomics
  • Build
    • Getting Started
    • Basics
    • Project NFT
    • Programmable treasury
    • Treasury extensions
      • Ballot
      • Data Source
      • Pay delegate
      • Redemption Delegate
      • Split Allocator
    • Utilities
      • Project payer
      • Splits Payer
  • API
    • Data Structures
      • SNOW721PricingParams
      • SNOW721Tier
      • SNOW721TierParams
      • SNOWBitmapWord
      • SNOWDeployTiered721DelegateData
      • SNOWDidPayData
    • Contracts
      • SNWProjects
        • Event
          • Create
          • SetMetadata
          • SetTokenUriResolver
        • Properties
          • Count
          • metadataContentOf
          • tokenUriResolver
        • Read
          • supportsInterface
          • tokenURI
        • Write
          • createFor
          • setMetadataOf
          • setTokenUriResolver
  • Subgraph
    • Subgraph Entities
    • Sample Queries
Powered by GitBook

SnowconeDAO

On this page

Was this helpful?

Export as PDF
  1. API
  2. Contracts
  3. SNWProjects
  4. Write

setMetadataOf

Allows a project owner to set the project's metadata content for a particular domain namespace.

Only a project's owner or operator can set its metadata.

Applications can use the domain namespace as they wish.

Definition

function setMetadataOf(uint256 _projectId, SNWProjectMetadata calldata _metadata)
  external
  override
  requirePermission(ownerOf(_projectId), _projectId, SNOWperations.SET_METADATA) { ... }

Arguments:

  • _projectId is the ID of the project whose metadata is being changed.

  • _metadata is the struct containing metadata content, and domain within which the metadata applies.

Through the requirePermission modifier, the function is only accessible by the project's owner, or from an operator that has been given the SNWOperations.SET_METADATA permission by the project owner for the provided _projectId.

The function overrides a function definition from the ISNWProjects interface. The function doesn't return anything.

Body

// Store the project's new metadata content within the specified domain.
metadataContentOf[_projectId][_metadata.domain] = _metadata.content;

Internal references:

  • metadataContentOf

Emit a SetMetadataCid event with the relevant parameters.

emit SetMetadata(_projectId, _metadata, msg.sender);

Event references:

  • SetMetadata

Last updated 1 year ago

Was this helpful?