As I understand it, the logic to deploy contract that uses library is as below: supposed that
MetaCoin contract use
TestLiblibrary first, then get a library contract address
- Get contract bytecodes that links library address by command
solc --optimize --bin MetaCoin.sol --libraries "TestLib:<address>"
MetaCoincontract by the bycodes
The above is the direct way to deploy contract that uses library.
However, how to deploy it in an indirect way? in other words, how to create a contract B that uses a library via contract A? How to link library to contract B?