Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Undefined" as duplicate namespace storage-ast-validator.js #1396

Open
ssolson opened this issue Jan 29, 2023 · 0 comments
Open

"Undefined" as duplicate namespace storage-ast-validator.js #1396

ssolson opened this issue Jan 29, 2023 · 0 comments

Comments

@ssolson
Copy link

ssolson commented Jan 29, 2023

Hey I have been running the sample-project and the hardhat-router continuously gives me the following error for multiple storage definitions

☠ Duplicate namespaces slot found!
  > undefined found in storage contracts OwnableStorage,ProxyStorage,GlobalStorage,InitializableStorage,SettingsStorage

I believe this is a bug.
A console log of the namespaces and duplicates found in storage-ast-validator.js are:

namespaces [
  { contractName: 'OwnableStorage', slot: undefined },
  { contractName: 'ProxyStorage', slot: undefined },
  { contractName: 'GlobalStorage', slot: undefined },
  { contractName: 'InitializableStorage', slot: undefined },
  { contractName: 'SettingsStorage', slot: undefined }
]
duplicates [
  {
    slot: undefined,
    contracts: [
      'OwnableStorage',
      'ProxyStorage',
      'GlobalStorage',
      'InitializableStorage',
      'SettingsStorage'
    ]
  }
]

As a hack for now I do not push the "undefined" slot to the errors starting at L36 of storage-ast-validator.js:

    if (duplicates) {
      const details = duplicates.map(
        (d) => `  > ${d.slot} found in storage contracts ${d.contracts}\n`
      );

      duplicates.map(
        (d) => {
          if (d.slot == undefined) 
            {console.log('Found undefined namespace')} 
          else {
            errors.push({
              msg: `Duplicate namespaces slot found!\n${details.join('')}`,
            });
          }
        }
      );

    }

Is the undefined namespace truly an issue?
Reproduction code ssolson/sample-project@8b4740d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant