i do auction of nft contract. I have a complex structure:
Usershas array of
Usercontracts, instance of
NFTcontract and instance of
NFtcontract has createNFT and transferNFT methods.
Auctionscontract has array of
Auctioncontracts and methods to create new auction (
auctions.push(new Auction(some, params)))
Auctioncontract receives in constructor some params and tokenId of nft. And there are methods:
finalizeAuction(transfer eth to owner and transfer nft to bidder) in Auction contract
Usercontract has methods:
Userscall createNFT and save
auctionInstancein Users call
createAuction. Also, user can
So, we have 2 users. The first creates new NFT, provide tokenId in
createAuction. The second places a bid. Then the first finalize auction. BUT I GET ERROR -
Revert ERC721: transfer caller is not owner nor approved. I know what there is setApproveForAll method, but where to call it??
I don't even know why the owner is not approved!
I tried in
NFT contract call
setApproveForAll(userAddress), next in
Auctions do that for
Auction contract. But any way it is ERROR.
How is setApproveForAll works?? How to fix that? Please help me;)