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

ContractRegistry is not able to load deep-nested solidity files #50

Closed
3Nigma opened this issue Apr 9, 2022 · 0 comments
Closed

ContractRegistry is not able to load deep-nested solidity files #50

3Nigma opened this issue Apr 9, 2022 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@3Nigma
Copy link
Contributor

3Nigma commented Apr 9, 2022

When bundling Strato with Rollup, there is an option to recurse (contracts.recurse) which, when set to true, it should recursively load all the solidity files from all directory levels found at contracts.path.

It does not work: The generated ContractRegistry maintains a flatten <contract name>: <contract ABI> reference from all processed solidity files. This means that if there's a contract A located in a.sol and a contract A located at b/a.sol, there will be 2 entries with the same key in ContractRegistry:

{
  A: <a.sol A contract ABI>,
  A: <b/a.sol A contract ABI>
}

which is an invalid state.

The correct prop names should come close to the ones present in #33 :

{
  A: <a.sol A contract ABI>,
  b/A: <b/a.sol A contract ABI>
}

Note: The props currently don't contain the name of the solidity file itself (as present in #33 's description) . This means that if, for the above example, there were also a contract A present in b/c.sol, you would again hit the same name conflict issue. We will resolve this on a separate ticket.

@3Nigma 3Nigma added the bug Something isn't working label Apr 9, 2022
@3Nigma 3Nigma added this to the 0.7.4 milestone Apr 9, 2022
@3Nigma 3Nigma self-assigned this Apr 9, 2022
victorholo added a commit that referenced this issue Apr 9, 2022
…-load-bug

`ContractRegistry` is now able to pick deeply nested solidity files when bundling
@3Nigma 3Nigma closed this as completed Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant