Skip to content

Commit

Permalink
rename ContractMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Jan 25, 2024
1 parent 7e53ce1 commit caaee36
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions neps/nep-0393.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,9 @@ The Soulbound Token follows the NFT [NEP-171](https://github.com/near/NEPs/blob/
All time related attributes are defined in milliseconds (as per NEP-171).

```rust
/// ContractMetadata defines contract wide attributes, which describes the whole contract.
/// IssuerMetadata defines contract wide attributes, which describes the whole contract.
/// Must be provided by the Issuer contract. See the `SBTIssuer` trait.
pub struct ContractMetadata {
pub struct IssuerMetadata {
/// Version with namespace, example: "sbt-1.0.0". Required.
pub spec: String,
/// Issuer Name, required, ex. "Mosaics"
Expand Down Expand Up @@ -472,12 +472,12 @@ SBTIssuer is the minimum required interface to be implemented by issuer. Other m

The issuer must provide metadata object of the Issuer. Optionally, Issuer can also provide metadata object for each token class.
Issuer level (contract) metadata, must provide information common to all tokens and all classes defined by the issuer. Class level metadata, must provide information common to all tokens of a given class. Information should be deduplicated and denormalized whenever possible.
Example: if all tokens of a give class share the same symbol and icon, then both icon and symbol must be defined in the `ClassMetadata` and left empty (`None`) in the token metadata level. If a particular SBT (token) has to have unique icon, but we would like to keep a default icon for all tokens of a given issuer, then we can have default icon defined in the `ContractMetadata.icon` and each SBT, that has to have different icon, can have it specified in `TokenMetadata.icon`.
Example: if all tokens of a give class share the same symbol and icon, then both icon and symbol must be defined in the `ClassMetadata` and left empty (`None`) in the token metadata level. If a particular SBT (token) has to have unique icon, but we would like to keep a default icon for all tokens of a given issuer, then we can have default icon defined in the `IssuerMetadata.icon` and each SBT, that has to have different icon, can have it specified in `TokenMetadata.icon`.

```rust
pub trait SBTIssuer {
/// returns contract metadata
fn sbt_metadata(&self) -> ContractMetadata;
fn sbt_metadata(&self) -> IssuerMetadata;
/// returns sbt class metadata, or None if class is not found.
fn sbt_class_metadata(&self, class: ClassId) -> Option<ClassMetadata>;
}
Expand Down

0 comments on commit caaee36

Please sign in to comment.