# ParserError: Expected identifier but got '&'

**URL:** <https://forum.openzeppelin.com/t/parsererror-expected-identifier-but-got/20880>\
**Category:** Contracts\
**Tags:** etherscan-verify\
**Created:** [December 13, 2021, 9:07am UTC](https://forum.openzeppelin.com/t/parsererror-expected-identifier-but-got/20880 "2021-12-13T09:07:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frog\_Natio\_DAO](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frog_natio_dao/32/11323_2.png) [@Frog\_Natio\_DAO](https://forum.openzeppelin.com/u/Frog_Natio_DAO)\
**Post date:** [December 13, 2021, 9:07am UTC](https://forum.openzeppelin.com/t/parsererror-expected-identifier-but-got/20880/1 "2021-12-13T09:07:29Z")

</div>

While verifying Etherscan Contract with pragma solidity ^0.8.0;

CODE

```auto
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

```

ERROR

```auto
ParserError: Expected identifier but got '&'
 --> myc:1:8:
  |
1 | DEPLOY & RUN TRANSACTIONS
  | ^

```

Thanks

---

<div class="post-metadata">

**Author:** ![hasanza](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/hasanza/32/8321_2.png) [@hasanza](https://forum.openzeppelin.com/u/hasanza)\
**Post date:** [December 13, 2021, 4:58pm UTC](https://forum.openzeppelin.com/t/parsererror-expected-identifier-but-got/20880/2 "2021-12-13T16:58:05Z")

</div>

Hey, welcome to the OZ forums 🙂

Can you posed more of the file in question? It is possible that you used "&" in your string "DEPLOY & RUN TRANSACTIONS" and the compiler thinks it is part of the code due to some reason.

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [December 16, 2021, 8:17pm UTC](https://forum.openzeppelin.com/t/parsererror-expected-identifier-but-got/20880/3 "2021-12-16T20:17:41Z")

</div>

This was answered in the GitHub issue:

> <https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3018>
>
> While verifying Etherscan Contract with pragma solidity ^0.8.0;
> 
> CODE
> 
> \`\`\`
> …function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
> bytes memory buffer = new bytes(2 \* length + 2);
> buffer\[0\] = "0";
> buffer\[1\] = "x";
> for (uint256 i = 2 \* length + 1; i \> 1; --i) {
> buffer\[i\] = \_HEX\_SYMBOLS\[value & 0xf\];
> value \>\>= 4;
> }
> require(value == 0, "Strings: hex length insufficient");
> return string(buffer);
> }
> \`\`\`
> 
> ERROR
> 
> \`\`\`
> ParserError: Expected identifier but got '&'
> --\> myc:1:8:
> |
> 1 | DEPLOY & RUN TRANSACTIONS
> | ^
> \`\`\`
> 
> Thanks
