Libraries and EthPM
When developing decentralized applications, it often doesn't make sense for every developer to reinvent the wheel when it comes to basic functions. For this reason, in order to act more like programming languages you may be more familiar with, Solidity supports libraries - pre-written, reusable pieces of code.
Library Driven Development in Solidity - Jorge Izquierdo, Aragon Medium, 2017 [8 min read]
This article from Jorge Izquierdo of Aragon provides a comprehensive review on how to develop more modular, reusable and elegant smart contract systems on top of the Ethereum Virtual Machine by using libraries.
One reason to start using Solidity Libraries - Piper Merriam, Ethereum Alarm Clock, 2015 [3 min read]
In this short article, Piper Merriam demonstrates another potential benefit of using libraries, that for contracts that are not called often, they can potentially be more gas efficient due to need to deploy less code on the chain.
Importing other Source Files - Solidity Documentation [3 min read]
Jumping back to the Layout of a Solidity Source File section of the Solidity Docs we saw earlier in this tutorial, we will read about how to import Solidity source files into each other so we don't have a messy single file with all of our contracts in it.
ERC: Ethereum Smart Contract Packaging Specification #190 - Ethereum GitHub, 2017 [5 min read]
A common standard called ERC190 was created to allow to make it as easy possible to use and develop common shared libraries. Learn about its basics by reading its specification.
Why Ethereum Needs Package Management - Tim Coulter, 2017 [4 min read]
This article, by Tim Coulter of Truffle, explains the concept behind EthPM, a dedicated package manager for Ethereum libraries that conforms to ERC190 standards.
EVM Smart Contract Packaging Specification - EthPM GitHub, 2016 [10 min read]
Next, read through the specification of EthPM to learn how to use these packages in your own projects.
Package Management via EthPM - Truffle Documentation [5 min read]
In this section from the Truffle Docs, read how to use EthPM within the Truffle Framework to install and use packages.
Dappsys - Dappsys Documentation [Resource]
Dappsys is a repository of very useful and heavily-audited Solidity Libraries that are exposed as EthPM packages. In this documentation, you can see what each library is used for and how to interact with it. When building larger contracts, consider using these as contract building blocks.