Comment on page
Smart contract libraries
A library typically contains resources that are meant to be highly reusable. The two most common examples of this are patterns of execution behavior and implementations of standards. In ICON, other contracts may be used as libraries as well as traditional Java libraries.
// From https://github.com/icon-project/java-score-examples/blob/master/multisig-wallet/src/main/java/com/iconloop/score/example/MultiSigWallet.java
// Adding official icon-java libraries
// adding java core libraries
// Add whatever other libraries are useful as well
public class MultiSigWallet
Using libraries is very useful to enhance the development process. For one, it can add increase security if you choose a library that is well audited and maintained. Additionally, it can speed up the process of developing and debugging code if you choose a library that is well documented and uses common patterns.
One major concern that a developer should be aware of is that a library may do things that you are not expecting. If you are unfamiliar with a certain aspect of a library, then you may introduce issues into your code. Make sure to review and test your code before deploying, and to be receptive and responsive to issues that may pop up after deploying.
One good rule of thumb for deciding whether or not to use a library is to check if the library is well-used. A well-used library may have a lot of stars on Github or a lot of references to usage in common developer forums. If a library is well-used, then it is less likely to have bugs, more likely to have a community that can help debug, and more likely to be maintained into the future.