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
Always use named import syntax, don’t import full files. This restricts what is being imported to just the named items, not everything in the file. Importing full files can result in solc complaining about duplicate definitions and slither erroring, especially as repos grow and have more dependencies with overlapping names.
Good: import {MyContract} from "src/MyContract.sol" to only import MyContract.
Bad: import "src/MyContract.sol" imports everything in MyContract.sol. (Importing forge-std/Test or Script can be an exception here, so you get the console library, etc).
(House keeping)
Source: Foundry > Best Practices
For example:
This:
celo-monorepo/packages/protocol/test-sol/unit/common/FeeHandlerSeller.t.sol
Line 6 in e83b1b7
Instead of this:
celo-monorepo/packages/protocol/test-sol/unit/common/Accounts.t.sol
Line 5 in e83b1b7
Not only is this better from a bug prevention perspective, but it also make it explicit where contracts are defined when they are inherited.
The text was updated successfully, but these errors were encountered: