Hi guys, I have a question. I am executing my contract in the Backend and I am adding a price to my mining in Backend, when I execute it with the price indicated it sends me an Error: Execution Reverted by the EVM
. I can't understand why. This is a part of my function and price validation.
function makeItem(IERC721 _nft, uint _tokenId, uint _price) external nonReentrant {
require(_price > 0, "Price must be greater than zero");
// increment itemCount
itemCount ++;
// transfer nft
_nft.transferFrom(msg.sender, address(this), _tokenId);
// add new item to items mapping
items[itemCount] = Item (
itemCount,
_nft,
_tokenId,
_price,
payable(msg.sender),
false
);
// emit Offered event
emit Offered(
itemCount,
address(_nft),
_tokenId,
_price,
msg.sender
);
}