From 3d3820beb0b7566aeb1304ad5eca640fb7654874 Mon Sep 17 00:00:00 2001 From: SoftwareMaestro16 Date: Fri, 11 Jul 2025 20:17:19 +0300 Subject: [PATCH] fix: incorrect NFT metadata loading in TelemintItem contract --- contracts_Tolk/07_telemint/messages.tolk | 2 +- contracts_Tolk/07_telemint/storage.tolk | 7 +++---- .../07_telemint/telemint-item-contract.tolk | 12 ++++++------ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/contracts_Tolk/07_telemint/messages.tolk b/contracts_Tolk/07_telemint/messages.tolk index 5192280..79e7cd9 100644 --- a/contracts_Tolk/07_telemint/messages.tolk +++ b/contracts_Tolk/07_telemint/messages.tolk @@ -105,4 +105,4 @@ struct ForwardPayloadInlineWrapper { struct (0x38127de1) ProvidedTeleitemBidInfo { bidAmount: coins bidTimestamp: uint32 -} +} \ No newline at end of file diff --git a/contracts_Tolk/07_telemint/storage.tolk b/contracts_Tolk/07_telemint/storage.tolk index 7c5b7ad..fe24ec9 100644 --- a/contracts_Tolk/07_telemint/storage.tolk +++ b/contracts_Tolk/07_telemint/storage.tolk @@ -46,7 +46,8 @@ struct ItemStorageNotInitialized { struct ItemStorage { config: Cell ownerAddress: address - content: Cell + content: cell + token: Cell auction: Cell? royaltyParams: Cell } @@ -89,14 +90,12 @@ fun ItemStorage.save(self) { contract.setData(self.toCell()) } - struct ItemConfig { index: uint256 collectionAddress: address } struct ItemContent { - nftContent: cell dns: cell? tokenInfo: Cell } @@ -158,4 +157,4 @@ fun AuctionConfig.isInvalid(self) { (self.minBidStep <= 0) | (self.minExtendTime > 60 * 60 * 24 * 7) | (self.duration > 60 * 60 * 24 * 365); -} +} \ No newline at end of file diff --git a/contracts_Tolk/07_telemint/telemint-item-contract.tolk b/contracts_Tolk/07_telemint/telemint-item-contract.tolk index 82f2b6c..43e4b0c 100644 --- a/contracts_Tolk/07_telemint/telemint-item-contract.tolk +++ b/contracts_Tolk/07_telemint/telemint-item-contract.tolk @@ -124,8 +124,8 @@ fun initializeItemOnDeployingByCollection(uninitedSt: ItemStorageNotInitialized, return { config: uninitedSt.config, ownerAddress, - content: ItemContent{ - nftContent: msg.nftContent, + content: msg.nftContent, + token: ItemContent{ dns: null, tokenInfo: msg.tokenInfo, }.toCell(), @@ -414,9 +414,9 @@ get fun get_nft_data(): NftDataReply { get fun get_telemint_token_name(): TelegramString { val storage = lazy ItemStorage.load(); - val itemContent = lazy storage.content.load(); - val tokenInfo = lazy itemContent.tokenInfo.load(); - return tokenInfo.tokenName; + val content = lazy storage.token.load(); + val tokenData = lazy content.tokenInfo.load(); + return tokenData.tokenName; } get fun get_telemint_auction_state(): AuctionStateReply { @@ -460,4 +460,4 @@ get fun get_telemint_auction_config(): AuctionConfigReply { get fun royalty_params(): RoyaltyParams { val storage = lazy ItemStorage.load(); return storage.royaltyParams.load(); -} +} \ No newline at end of file