You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🧐 Motivation @openzeppelin/contracts-ethereum-package and @openzeppelin/contracts share many contracts names. The duplication prevents the correct compilation artifacts to be generated if a codebase uses both packages.
📝 Details
Most of the compilation frameworks do not handle well codebase with contract's name duplicate. For example, when generating the json artifacts, Truffle will not be able to generate correctly the files trufflesuite/truffle#1087.
As a result, it can prevent the integration with third-party tools. For example, we had to develop a specific detector in Slither to know what contracts names are reused. But if a codebase uses both @openzeppelin/contracts-ethereum-package and @openzeppelin/contracts, it is difficult for a user to avoid the duplicate names.
Example
A codebase that would have both an upgradeable ERC20 token a non-upgradeable one will be affected:
Running truffle compile on a codebase with these two files will result in one build/contracts/ERC20.json file that will either represent @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol or @openzeppelin/contracts/token/ERC20/ERC20.sol.
A better practice would be to have separate contract names according to the package.
Let me know if you have any questions,
Thanks!
The text was updated successfully, but these errors were encountered:
Hi,
🧐 Motivation
@openzeppelin/contracts-ethereum-package
and@openzeppelin/contracts
share many contracts names. The duplication prevents the correct compilation artifacts to be generated if a codebase uses both packages.📝 Details
Most of the compilation frameworks do not handle well codebase with contract's name duplicate. For example, when generating the json artifacts, Truffle will not be able to generate correctly the files trufflesuite/truffle#1087.
As a result, it can prevent the integration with third-party tools. For example, we had to develop a specific detector in Slither to know what contracts names are reused. But if a codebase uses both
@openzeppelin/contracts-ethereum-package
and@openzeppelin/contracts
, it is difficult for a user to avoid the duplicate names.Example
A codebase that would have both an upgradeable ERC20 token a non-upgradeable one will be affected:
Running
truffle compile
on a codebase with these two files will result in onebuild/contracts/ERC20.json
file that will either represent@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/ERC20.sol
or@openzeppelin/contracts/token/ERC20/ERC20.sol
.A better practice would be to have separate contract names according to the package.
Let me know if you have any questions,
Thanks!
The text was updated successfully, but these errors were encountered: