Skip to content

Commit

Permalink
add sbt_update_token_references method and event to the standard
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zaremba committed Sep 6, 2023
1 parent 51b14d9 commit ad56e5f
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions neps/nep-0393.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,15 @@ trait SBTRegistry {

/// Similar to `sbt_revoke`, but revokes all `owner`s tokens issued by the caller.
fn sbt_revoke_by_owner(&mut self, owner: AccountId, burn: bool);

/// Allows issuer to update token metadata reference and reference_hash.
/// * `updates` is a list of triples: (token ID, reference, reference base64-encoded sha256 hash).
/// Must emit `token_reference` event.
/// Panics if any of the token Ids don't exists.
fn sbt_update_token_references(
&mut self,
updates: Vec<(TokenId, Option<String>, Option<Base64VecU8>)>,
);
}
```

Expand Down Expand Up @@ -460,14 +469,14 @@ type u64 = number;
type Nep393Event {
standard: "nep393";
version: "1.0.0";
event: "mint" | "recover" | "renew" | "revoke" | "burn" | "ban" | "soul_transfer" ;
data: Mint | Recover | Renew | Revoke | Burn | Ban[] | SoulTransfer;
event: "mint" | "recover" | "renew" | "revoke" | "burn" | "ban" | "soul_transfer" | "token_reference" ;
data: Mint | Recover | Renew | Revoke | Burn | Ban[] | SoulTransfer | TokenReference;
}

/// An event emitted by the Registry when new SBT is created.
type Mint {
ctr: AccountId; // SBT Contract minting the tokens
tokens: [[AccountId, u64[]]]; // list of pairs (token owner, TokenId[])
tokens: (AccountId, u64[])[]; // list of pairs (token owner, TokenId[])
}

/// An event emitted when a recovery process succeeded to reassign SBTs, usually due to account
Expand Down Expand Up @@ -519,6 +528,9 @@ type SoulTransfer {
from: AccountId;
to: AccountId;
}

/// An event emitted when existing token metadata references are updated.
type TokenReference = u64[]; // list of token ids.
```

Whenever a recovery is made in a way that an existing SBT is burned, the `Burn` event MUST be emitted. If `Revoke` burns token then `Burn` event MUST be emitted instead of `Revoke`.
Expand Down

0 comments on commit ad56e5f

Please sign in to comment.