From 4ea35215486e36f1143c6a4b9cfc0344fbbd5e18 Mon Sep 17 00:00:00 2001 From: Jagadish Krishnamoorthy Date: Thu, 29 Dec 2022 02:42:35 -0800 Subject: [PATCH] ERC721: Use local variable to increment state variable Signed-off-by: Jagadish Krishnamoorthy --- src/tokens/ERC721.vy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tokens/ERC721.vy b/src/tokens/ERC721.vy index cc2d9fa5..0d5e4f59 100644 --- a/src/tokens/ERC721.vy +++ b/src/tokens/ERC721.vy @@ -543,7 +543,7 @@ def safe_mint(owner: address, uri: String[432]): # New tokens will be automatically assigned an incremental ID. # The first token ID will be zero. token_id: uint256 = self._counter - self._counter += 1 + self._counter = token_id + 1 # Theoretically, the following line could overflow # if all 2**256 token IDs were minted. However, # since we have bounded the dynamic array `_all_tokens`