I am trying to get the owner of a NFT in solidity
& web3
by calling the Contract
and the token id
In Web3.js-v1.3.5
I've tried this so far, but the result isn't ever calledBack!
How can I handle this? and how can I write this in solidity
as well ?
var abi_ = [ {
"constant": true,
"inputs": [
{
"name": "_tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}]
const smartContractAddress = "0x495f947276749ce646f68ac8c248420045cb7b5e"
const contract = new web3.eth.Contract(abi_, smartContractAddress)
let owner = await contract.methods.ownerOf('91338127118827779192862936396890434745733899848224782300810335984505495486465').call()
//Code never reaches here
console.log(owner)