I am building a library to help developers to create generative art in Solidity. I'd like to add a lot of features (internal methods) to this library to make it easy to create a variety of art.
I'm wondering if the Solidity linker is able to eliminate unused library methods.
Let's assume we have a library Foo with 100 methods.
library Foo {
function method1() pure internal { ... }
function method2() pure internal { ... }
...
function method100() pure internal { ... }
}
If somebody creates a smart contract, which uses only method1 of library Foo, does it bring all the code into the contract inlcuding unsed method2 to method100?
In most of modern development environments (such as C++, Swift, C#), the linker is smart enough to eliminate unsed code. I am wondering if the Solidity linker is able to perform such an optimization.