From 6eee9dc14ff64dd2eac24e4ae704e0b8fbb18ba9 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Sun, 22 Oct 2023 16:13:21 +0300 Subject: [PATCH] nep-393: add bool return to sbt_revoke_by_owner (#510) In the [reference](https://github.com/near-ndc/i-am-human/blob/cfc92b1/contracts/registry/src/registry.rs#L362) implementation we return `bool` in the `registry.sbt_revoke_by_owner` to signal if the operation should continue or it's finished. We forgot to push this update to the standard. This update also makes the API consistent with `sbt_recover` and `sbt_soul_transfer` --- neps/nep-0393.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/neps/nep-0393.md b/neps/nep-0393.md index 67b3361c2..9c10b0469 100644 --- a/neps/nep-0393.md +++ b/neps/nep-0393.md @@ -404,8 +404,15 @@ trait SBTRegistry { /// Must also emit `Burn` event if the SBT tokens are burned (removed). fn sbt_revoke(&mut self, tokens: Vec, burn: bool); - /// 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); + /// Similar to `sbt_revoke`. Allows SBT issuer to revoke all tokens by holder either by + /// burning or updating their expire time. When an owner has many tokens from the issuer, + /// the issuer may need to call this function multiple times, until all tokens are revoked. + /// Retuns true if all the tokens were revoked, false otherwise. + /// If false is returned issuer must call the method until true is returned + /// Must be called by an SBT contract. + /// Must emit `Revoke` event. + /// Must also emit `Burn` event if the SBT tokens are burned (removed). + fn sbt_revoke_by_owner(&mut self, owner: AccountId, burn: bool) -> 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).