After creating cancel-item.js in scripts:
I was running yarn hardhat run scripts/cancel-item.js --network localhost
and I got this error:
reason: "Error: VM Exception while processing transaction: reverted with reason string 'ERC721: invalid token ID'",
code: 'UNPREDICTABLE_GAS_LIMIT',
method: 'estimateGas',
transaction: {
from: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266',
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
data: '0xb2ddee06000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000000000000000001',
accessList: null
},
error: ProviderError: Error: VM Exception while processing transaction: reverted with reason string 'ERC721: invalid token ID'
at HttpProvider.request (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/http.ts:78:19)
at AutomaticSenderProvider.request (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/accounts.ts:351:34)
at AutomaticGasProvider.request (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:136:34)
at AutomaticGasPriceProvider.request (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:153:36)
at ChainIdValidatorProvider.request (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/chainId.ts:66:34)
at BackwardsCompatibilityProviderAdapter.send (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/hardhat/src/internal/core/providers/backwards-compatibility.ts:36:27)
at EthersProviderWrapper.send (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:48)
at EthersProviderWrapper.<anonymous> (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:601:31)
at step (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.next (/Users/zahratest/Desktop/hardhat-nft-marketplace/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)