Need a quick help

Hi, Can someone tell me how to fix this error, I have been trying to change it multiple timed but it still doesn’t allow me to compile it because of this error

ParserError: Invalid token. _name = “name“;

Hi welcome to the OZ forums!

ParserError: Invalid token. _name = “name“;
This makes me think you are trying to assign a string where it should be a parameter. In examples you have to pass the arguments when you deploy your contract, these arguments will be for the name, decimals, ticker, etc.

Please follow the tutorial over at OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat

It is fantastic for giving you a basic understanding of how these contracts compile and work.

To add to what @Yoshiko said,

Assuming you’re using ERC20 (same goes for ERC721 though), the contract name is set as a constructor parameter to the base ERC20 contract, you cannot manually overwrite the variable.

Please check out Contracts Wizard for guidance.

1 Like