@@ -15,7 +15,7 @@ contract HtsSystemContract is IHederaTokenService {
1515 /**
1616 * The slot's value contains the next token ID to use when a token is being created.
1717 *
18- * This slot is used in the `0x167` address.
18+ * This slot is used in the `0x167` address.
1919 * It cannot be used as a state variable directly.
2020 * This is because JS' `getHtsStorageAt` implementation assumes all state variables
2121 * declared here are part of the token address space.
@@ -28,7 +28,7 @@ contract HtsSystemContract is IHederaTokenService {
2828 // See `__redirectForToken` for more details.
2929 //
3030 // Moreover, these variables must match the slots defined in `SetTokenInfo`.
31- string internal tokenType;
31+ string internal tokenType;
3232 uint8 internal decimals;
3333 TokenInfo internal _tokenInfo;
3434
@@ -412,18 +412,10 @@ contract HtsSystemContract is IHederaTokenService {
412412 function getNonFungibleTokenInfo (address token , int64 serialNumber )
413413 htsCall external
414414 returns (int64 , NonFungibleTokenInfo memory ) {
415- (int64 responseCode , TokenInfo memory tokenInfo ) = getTokenInfo (token);
416- require (responseCode == HederaResponseCodes.SUCCESS, "getNonFungibleTokenInfo: failed to get token data " );
417- (, NonFungibleTokenInfo memory nonFungibleTokenInfo ) = IHederaTokenService (token).getNonFungibleTokenInfo (
415+ return IHederaTokenService (token).getNonFungibleTokenInfo (
418416 token,
419417 serialNumber
420418 );
421- nonFungibleTokenInfo.tokenInfo = tokenInfo;
422- nonFungibleTokenInfo.serialNumber = serialNumber;
423- nonFungibleTokenInfo.spenderId = IERC721 (token).getApproved (uint256 (uint64 (serialNumber)));
424- nonFungibleTokenInfo.ownerId = IERC721 (token).ownerOf (uint256 (uint64 (serialNumber)));
425-
426- return (responseCode, nonFungibleTokenInfo);
427419 }
428420
429421 function isToken (address token ) htsCall external returns (int64 , bool ) {
@@ -595,11 +587,16 @@ contract HtsSystemContract is IHederaTokenService {
595587 if (selector == this .getNonFungibleTokenInfo.selector ) {
596588 require (msg .data .length >= 92 , "getNonFungibleTokenInfo: Not enough calldata " );
597589 uint256 serialId = uint256 (bytes32 (msg .data [60 :92 ]));
598- NonFungibleTokenInfo memory info ;
590+ NonFungibleTokenInfo memory nonFungibleTokenInfo ;
599591 (int64 creationTime , bytes memory metadata ) = __nftInfo (serialId);
600- info.creationTime = creationTime;
601- info.metadata = metadata;
602- return abi.encode (HederaResponseCodes.SUCCESS, info);
592+ nonFungibleTokenInfo.tokenInfo = _tokenInfo;
593+ nonFungibleTokenInfo.serialNumber = int64 (int256 (serialId));
594+ nonFungibleTokenInfo.ownerId = __ownerOf (serialId);
595+ nonFungibleTokenInfo.creationTime = creationTime;
596+ nonFungibleTokenInfo.metadata = metadata;
597+ nonFungibleTokenInfo.spenderId = __getApproved (serialId);
598+
599+ return abi.encode (HederaResponseCodes.SUCCESS, nonFungibleTokenInfo);
603600 }
604601 if (selector == this ._update.selector ) {
605602 require (msg .data .length >= 124 , "update: Not enough calldata " );
0 commit comments