If you are creating test scripts in solidity, you may have come across these import statement:
import "truffle/Assert.sol"; import "truffle/DeployedAddresses.sol"; import "../contracts/HelloWorld.sol";
The last one is easy to understand because it is your smart contract in the “contracts” folder but what about Assert.sol and DeployedAddresses.sol?
First of all, “truffle” refers to the global truffle repo which can be found at usr/local/lib/node_modules/truffle.
Assert.sol lives at: usr/local/lib/node_modules/truffle/build/Assert.sol
The trick is, what about DeployedAddresses.sol? You won’t find this file in the global truffle repo and a terminal search will be
The reason is because this file is dynamically created at test time. (Kindalike the geth.ipc file that gets generated when geth is running but disappears when geth is stopped).
“truffle” is a meta package, ie “these packages do not contain actual software, they simply depend on other packages to be installed“. In fact, if you look at the deploy.js source code, you’ll see the DeployedAddresses file get created via the code.