question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Storage for contracts with the same name

See original GitHub issue

Running sol2uml storage -c *same name* on folder with files, containing contracts with the same name, will return storage diagram for contract with the smallest filename in sort order.

Example:

main.sol:

pragma solidity ^0.8.7;

import {A as A1} from "./Lib1.sol";
import {A as A2} from "./Lib2.sol";

contract A is A1, Math2 {
    uint32 C1 = 0;
}

Lib1.sol:

pragma solidity ^0.8.7;

contract A {
    uint32 C2 = 0;
}

Lib2.sol:

pragma solidity ^0.8.7;

contract A {
    uint32 C3 = 0;
}

In this example storage will be generated for A from Lib1.sol. But if you rename main.sol in amain.sol result will be for A from amain.sol.

Maybe it can be fixed by choosing both filename and contract name?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
naddison36commented, Aug 15, 2022

Hmm, I’ll need to look into this one. Thanks for reporting.

2reactions
naddison36commented, Aug 9, 2022

Thanks for raising this issue. I’ve added a -cf, --contractFile <filename> option for storage diagrams in v2.1.5.

The contractFile can just be a filename like main.sol. Or it can be a relative filename from the working folder. eg src/contracts/main.sol.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is a Contract Repository? - ContractSafe
A contract repository is a place where contracts are stored. · The names "contract repository" and "document repository" are used interchangeably - they...
Read more >
Retrieve Storage Variable Name given Storage Location and ...
To summarize: I'm looking for a solution that retrieves the storage variable name provided I have the storage locations and the contract ......
Read more >
Contracts — Solidity 0.8.17 documentation
Function Overloading. A contract can have multiple functions of the same name but with different parameter types. This process is called “overloading” and...
Read more >
What Happens to a Contract When a Business Changes?
An explanation of what happens to a contract when a business has major changes, like a name change, sale, or bankruptcy.
Read more >
Collisions of Solidity Storage Layouts - MixBytes
Ethereum smart contract storage is a mapping uint256 to uint256. ... into the slot that, in turn, explains the absence of paused and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found