Solidity Tutorial: all about Libraries
12 min readAug 1, 2019
Table of Contents
- What are Libraries in Solidity?
- How to create a library contract?
- How to deploy libraries?
- How to use a Library in a smart contract?
- How to interact with libraries?
- Understanding functions in libraries.
- Events and Libraries
- Mappings in Library = more functionalities !
- Using structs inside Libraries
- Linking libraries with other libraries
- Using modifier inside libraries
- What you can’t do with Libraries in Solidity?
- Some popular existing libraries
References
1. What are Libraries in Solidity?
Libraries can be seen as implicit base contracts of the contracts that use them (Solidity doc)
A library
in Solidity is a different type of smart contract that contains reusable code. Once deployed on the blockchain (only once), it is assigned a specific address and its properties / methods can be reused many times by other contracts in the Ethereum network.