diff --git a/aptos-move/framework/aptos-token/sources/token.move b/aptos-move/framework/aptos-token/sources/token.move index ea1c84abcc4ad..f700d0cc07717 100644 --- a/aptos-move/framework/aptos-token/sources/token.move +++ b/aptos-move/framework/aptos-token/sources/token.move @@ -545,10 +545,12 @@ module aptos_token::token { &mut collections.collection_data, token_id.token_data_id.collection ); - collection_data.supply = collection_data.supply - 1; - // delete the collection data if the collection supply equals 0 - if (collection_data.supply == 0) { - destroy_collection_data(table::remove(&mut collections.collection_data, collection_data.name)); + if (collection_data.maximum > 0) { + collection_data.supply = collection_data.supply - 1; + // delete the collection data if the collection supply equals 0 + if (collection_data.supply == 0) { + destroy_collection_data(table::remove(&mut collections.collection_data, collection_data.name)); + }; }; }; }; @@ -617,10 +619,14 @@ module aptos_token::token { &mut collections.collection_data, token_id.token_data_id.collection ); - collection_data.supply = collection_data.supply - 1; - // delete the collection data if the collection supply equals 0 - if (collection_data.supply == 0) { - destroy_collection_data(table::remove(&mut collections.collection_data, collection_data.name)); + + // only update and check the supply for unlimited collection + if (collection_data.maximum > 0){ + collection_data.supply = collection_data.supply - 1; + // delete the collection data if the collection supply equals 0 + if (collection_data.supply == 0) { + destroy_collection_data(table::remove(&mut collections.collection_data, collection_data.name)); + }; }; }; };