diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index 776720b..b0fbdb6 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -2891,7 +2891,7 @@ checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "registry" -version = "1.5.0" +version = "1.6.0" dependencies = [ "anyhow", "cost", diff --git a/contracts/registry/CHANGELOG.md b/contracts/registry/CHANGELOG.md index e7ba14b..2f75146 100644 --- a/contracts/registry/CHANGELOG.md +++ b/contracts/registry/CHANGELOG.md @@ -21,11 +21,20 @@ Change log entries are to be added to the Unreleased section. Example entry: ### Features +### Breaking Changes + +### Bug Fixes + +## v1.6.0 (2023-10-08) + +### Features + - New `GovBan` flag. Reserved for accounts with a history of misconduct, limiting their governance role while maintaining their voting rights as valued members of the Voting Body. +- `sbt_revoke_by_owner` returns true if the issuer should continue to call the method to revoke all tokens. Otherwise the function return false. Moreover, the method has been improved and optimized. ### Breaking Changes -### Bug Fixes +- `sbt_mint` will set `issue_at` to the current time in milliseconds, if the value was not provided. ## v1.5.0 (2023-09-07) diff --git a/contracts/registry/Cargo.toml b/contracts/registry/Cargo.toml index cefd7c9..704d3a1 100644 --- a/contracts/registry/Cargo.toml +++ b/contracts/registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "registry" -version = "1.5.0" +version = "1.6.0" authors = ["Robert Zaremba 'https://zaremba.ch/'"] edition = { workspace = true } repository = { workspace = true } diff --git a/contracts/registry/src/lib.rs b/contracts/registry/src/lib.rs index c4fe80f..75f6553 100644 --- a/contracts/registry/src/lib.rs +++ b/contracts/registry/src/lib.rs @@ -715,6 +715,7 @@ impl Contract { let ret_token_ids = (token..token + num_tokens).collect(); let mut supply_by_class = HashMap::new(); let mut per_recipient: HashMap> = HashMap::new(); + let now = env::block_timestamp_ms(); for (owner, metadatas) in token_spec { // no need to check ongoing_soult_tx, because it will automatically ban the source account @@ -723,8 +724,11 @@ impl Contract { let recipient_tokens = per_recipient.entry(owner.clone()).or_default(); let metadatas_len = metadatas.len(); - for metadata in metadatas { + for mut metadata in metadatas { require!(metadata.class > 0, "Class must be > 0"); + if metadata.issued_at.is_none() { + metadata.issued_at = Some(now); + } let prev = self.balances.insert( &balance_key(owner.clone(), issuer_id, metadata.class), &token, @@ -937,7 +941,7 @@ mod tests { fn mk_metadata(class: ClassId, expires_at: Option) -> TokenMetadata { TokenMetadata { class, - issued_at: None, + issued_at: Some(START), expires_at, reference: Some("abc".to_owned()), reference_hash: Some(vec![61, 61].into()),