Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEP: SBT Metadata Standard #504

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
review
  • Loading branch information
robert-zaremba committed Sep 28, 2023
commit 37aaa74bb436d25525f4d7300a7d2460f9706eaf
19 changes: 13 additions & 6 deletions neps/nep-504.md
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@ NEP: 504
Title: SBT Metadata Interface
Authors: Robert Zaremba (@robert-zaremba)
Status: New
DiscussionsTo: https://github.com/nearprotocol/neps/pull/0000
DiscussionsTo: https://github.com/nearprotocol/neps/pull/393
Type: Contract Standard
Version: 1.0.0
Created: 2023-08-21
LastUpdated: 2023-09-06
LastUpdated: 2023-09-29
---

## Summary
@@ -42,7 +42,9 @@ pub struct ClassMetadata {
pub name: String,
/// If defined, should be used instead of `contract_metadata.symbol`.
pub symbol: Option<String>,
/// Icon content (SVG) or a link to an Icon. If it doesn't start with a scheme (eg: https://)
/// An URL to an Icon. To protect fellow developers from unintentionally triggering any
/// SSRF vulnerabilities with URL parsers, we don't allow to set an image bytes here.
/// If it doesn't start with a scheme (eg: https://)
/// then `contract_metadata.base_uri` should be prepended.
pub icon: Option<String>,
/// JSON or an URL to a JSON file with more info. If it doesn't start with a scheme
@@ -69,10 +71,15 @@ We define a `ReferenceBase` type. All entries are optional, and don't have to be

```rust
struct ReferenceBase {
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
// Human readable description.
description: Option<String>,
// URL to a website.
website: Option<String>,
// Information how to get a token.
minting_info: Option<String>,
// Time (as Unixt Time in miliseconds), when the class or issuer was created.
created_at: u64,
// Map of social media kind to the profile link.
social_media: Map<String, String>,
// keys are contact types
contact: Map<String, Vec<String>>,
@@ -149,17 +156,17 @@ type Nep504Event {
standard: "nep504";
version: "1.0.0";
event: "class" | "contract";
data: Class | Contract ;
data: Class | Contract;
}

/// An event emitted by an SBT Issuer when Class Metadata are updated.
type Class {
type ClassEvent {
classes: ClassId[]; // list of class IDs whose metadata has been updated
}

/// An event emitted by an SBT Issuer when Contract Metadata is updated.
/// Note: it's an empty object
type Class { }
type ContractEvent { }
```

## Reference Implementation