hello everyone , i got error
{
"error": "Failed to decode output: Error: hex data is odd-length (argument="value", value="0x0", code=INVALID_ARGUMENT, version=bytes/5.5.0)"
}
when call function mintNFT
Pls help me solve error.

Mar 13, 2023, 5:05 PM
Based on the error message, it seems that there is an issue with the input data being passed to the mintNFT function.
Mar 13, 2023, 5:07 PM
tid = mintDoNft(
lastOwner,
originalNftAddress,
originalNftId,
uint40(block.timestamp),
type(uint40).max
);
here my input data
Mar 13, 2023, 5:07 PM
Specially, the error message is indicating that the value being passed to the function is an odd-length hexadecimal string , which is not a valid input
lastOwner is likely the addres of the previous owner of the NFT
originalNFTAddress is the address of the original NFT contract.
originalNFTId is the id of the original NFT being used to create a new DoNFT
unit40 is current block timestamp
type.max is unclear why this value is being passed to the function
Mar 13, 2023, 5:10 PM
i try change to block.timestamp+10000000
Mar 13, 2023, 5:11 PM
Changing the block.timestamp value to block.timestep+10000000 may not resolve the issue you are experiencing with the mintDoNFT fucntion as error message seems to indicate an issue with the originalNFTId parameter.
Instead , you may want to focus on verifying the originalNFTId parameter and ensuring that it is a valid hexadecimal string of an evnen length, and that is corresponds to a valid NFT id on the original nft contract specified in the orignialNFTAddress parameter
Mar 13, 2023, 5:15 PM
function mintVNft(address originalNftAddress, uint256 originalNftId)
public
virtual
nonReentrant
returns (uint256 tid)
{
address lastOwner = IERC721(originalNftAddress).ownerOf(originalNftId);
IERC721(originalNftAddress).transferFrom(lastOwner, address(this), originalNftId);

tid = mintDoNft(
lastOwner,
originalNftAddress,
originalNftId,
uint40(block.timestamp),
type(uint40).max
);
oid2vid[originalNftAddress][originalNftId] = tid;

IERC4907(originalNftAddress).setUser(originalNftId, lastOwner, type(uint64).max);
}
originalNftId -> id of NFT minted
Mar 13, 2023, 5:22 PM
Based on the mintVNft function you provide, it seems that the mintDoNft function is being called with the orignialNftId parameter passed in from the mintVNft function.
1. Verify that the orignialNFTAddress parameter is the correct address for the origial NFT contract.
2. Verify that the originalNFTID parameter is a valid NFT ID on the original NFT contract specified in the orignialNFTAddress parameter.
3. Check the smart contract code for the mintDoNFT function to ensure that it is properly handling the inpurt parameters, including the originalNFTId paramenter.
Mar 13, 2023, 5:35 PM

© 2024 Draquery.com All rights reserved.