Hey Everyone Testing out a purchase function on my smart contract and running into this ERC1155 error when attempting to purchase an NFT for sale. Contract has been deployed via Remix on Ropsten network with Gas Limit of 300000000 and 1 ETH of Value. Solidity function will be pasted below but I'm thinking this is not a code error?
function createMarketSale(
address nftContract,
uint256 itemId,
uint256 amount,
bytes memory data
) public payable nonReentrant {
uint price = idToMarketItem[itemId].price;
uint tokenId = idToMarketItem[itemId].tokenId;
bool sold = idToMarketItem[itemId].sold;
require(msg.value == price, "Please submit the asking price in order to complete the purchase");
require(sold != true, "This Sale has alredy finnished");
emit MarketItemSold(
itemId,
msg.sender
);
idToMarketItem[itemId].seller.transfer(msg.value);
IERC1155(nftContract).safeTransferFrom(msg.sender, address(this), tokenId, amount, data);
idToMarketItem[itemId].owner = payable(msg.sender);
_itemsSold.increment();
idToMarketItem[itemId].sold = true;
}
I'm not entirely sure what funds I need in order to complete. The wallet I am making this transaction with has more than enough ETH to make this purchase. Any help would be greatly appreciated
Transaction Hash: 0xa0680bd6625b8a898e27b76dc20b51950b04ddfc3a5498b8102095292e23c174