Closed Cheetah0x closed 1 month ago
This is related to aztec macros and we are soon about to migrate them all to meta programming (should be by next week). Once that is in master I will investigate whether this bug pertains.
@Cheetah0x Thanks for reporting the bug!
Bug Report: Incorrect Contract Storage Layout Generated with Token Dependency
Aztec Version: v0.54.0 Repo for Replication: aztec-artifact-bug
Bug Description
When adding the token contract as a dependency in Nargo.toml, without actually importing or using it in the contract, the generated Contract Storage Layout reflects the storage of the token contract instead of the contract being worked on.
In the provided example, the simple counter contract should have the following storage layout in the generated TypeScript artifact:
However, when adding the token contract as a dependency in Nargo.toml, without importing it in the contract, the storage layout that is generated incorrectly maps to the storage slots of the token contract:
Steps to Reproduce
Clone the repo: aztec-artifact-bug. Check the Nargo.toml file where the token contract is added as a dependency but not imported in the contract.
Compile the contract using:
Observe the incorrect storage layout in the generated TypeScript artifact.
Expected Behavior The generated storage layout should match the contract being worked on (e.g., the simple counter contract) and not the token contract when it’s merely a dependency in Nargo.toml but not actually imported.