From caf2e9663894c940b54a4773c4bbc6336563be43 Mon Sep 17 00:00:00 2001 From: Luka la d Date: Fri, 1 Sep 2023 21:18:40 +0200 Subject: [PATCH] update tokenURI --- contracts/NumberRunnerClub.sol | 8 ++++++-- package-lock.json | 8 ++++---- package.json | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/contracts/NumberRunnerClub.sol b/contracts/NumberRunnerClub.sol index 7701d8a..feb21a2 100644 --- a/contracts/NumberRunnerClub.sol +++ b/contracts/NumberRunnerClub.sol @@ -6,8 +6,12 @@ import "@ensdomains/ens-contracts/contracts/registry/ENS.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@chainlink/contracts/src/v0.8/VRFV2WrapperConsumerBase.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; +import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; +using Strings for uint256; + + contract KingAuction is VRFV2WrapperConsumerBase, Ownable { using ABDKMath64x64 for int128; @@ -262,7 +266,7 @@ contract NumberRunnerClub is ERC721URIStorage, Ownable, ReentrancyGuard { for (uint8 i = 0; i < _n; i++) { uint256 newItemId = startId + 2 * i; _mint(msg.sender, newItemId); - _setTokenURI(newItemId, string(abi.encodePacked("ipfs://QmPp5WG6DFfXM1sHshkA9sU6je8rWbjivrZjQmmGBXVEr7/NumberRunner#", newItemId, ".json"))); + _setTokenURI(newItemId, string(abi.encodePacked("ipfs://QmUSL1sxdiSPMUL1s39qpjENXi6kQTmLY1icq9KVjYmc4N/NumberRunner", newItemId.toString(), ".json"))); pieceDetails[5].totalMinted++; userColor[msg.sender] == 1 ? pieceDetails[5].blackMinted++ : pieceDetails[5].whiteMinted++; totalMinted++; @@ -316,7 +320,7 @@ contract NumberRunnerClub is ERC721URIStorage, Ownable, ReentrancyGuard { } _mint(msg.sender, newItemId); - _setTokenURI(newItemId, string(abi.encodePacked("ipfs://QmPp5WG6DFfXM1sHshkA9sU6je8rWbjivrZjQmmGBXVEr7/NumberRunner#", newItemId, ".json"))); + _setTokenURI(newItemId, string(abi.encodePacked("ipfs://QmUSL1sxdiSPMUL1s39qpjENXi6kQTmLY1icq9KVjYmc4N/NumberRunner", newItemId.toString(), ".json"))); pieceDetails[_pieceType].totalMinted++; userColor[msg.sender] == 1 ? pieceDetails[_pieceType].blackMinted++ : pieceDetails[_pieceType].whiteMinted++; totalMinted++; diff --git a/package-lock.json b/package-lock.json index afedf68..f773cd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "devDependencies": { "@chainlink/contracts": "^0.5.1", "@ensdomains/ens-contracts": "^0.0.21", - "@openzeppelin/contracts": "^4.9.1", + "@openzeppelin/contracts": "^4.9.3", "truffle": "^5.8.4" } }, @@ -1384,9 +1384,9 @@ ] }, "node_modules/@openzeppelin/contracts": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.2.tgz", - "integrity": "sha512-mO+y6JaqXjWeMh9glYVzVu8HYPGknAAnWyxTRhGeckOruyXQMNnlcW6w/Dx9ftLeIQk6N+ZJFuVmTwF7lEIFrg==", + "version": "4.9.3", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-4.9.3.tgz", + "integrity": "sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg==", "dev": true }, "node_modules/@openzeppelin/contracts-v0.7": { diff --git a/package.json b/package.json index fcf7ffb..5b78255 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "@chainlink/contracts": "^0.5.1", "@ensdomains/ens-contracts": "^0.0.21", - "@openzeppelin/contracts": "^4.9.1", + "@openzeppelin/contracts": "^4.9.3", "truffle": "^5.8.4" } }