DEV Community

Discussion on: How to Build a Full Stack NFT Marketplace - V2 (2022)

 
mateusasferreira profile image
Mateus Ferreira

Hey there! its a modifier that you're missing. I added this to my contract so I can use it in functions to ensure only the item's owner can execute it:


    modifier onlyItemOwner(uint256 id) {
        require(
            idToMarketItem[id].owner == msg.sender,
            "Only product owner can do this operation"
        );
        _;
    }

Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
javilonte profile image
Javilonte

thanksss