Skip to content

Web3 Unleashed Rental Marketplace issue-- ParserError: Expected '{' but got reserved keyword 'override' #5715

Discussion options

You must be logged in to vote

I think I figured it out. There was a breaking change in _beforeTokenTransfer about 9 days ago which requires _beforeTokenTransfer to have a fourth parameter.

Here's what my _beforeTokenTransfer function looks like now, and this was able to deploy without an error.

 function _beforeTokenTransfer(
    address from,
    address to,
    uint256 tokenId,
    uint256 /** batch **/
  ) internal virtual override {
    super._beforeTokenTransfer(from, to, tokenId, 1);

    if (from != to && _users[tokenId].user != address(0)) {
      delete _users[tokenId];
      emit UpdateUser(tokenId, address(0), 0);
    }
  }

Looks like the guide uses openzeppelin 4.7.3, and yarn installed 4.8.0.

EDIT: Forgot…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cds-amal
Comment options

@lpurdy01
Comment options

Answer selected by insanity54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants