# Get External Library address

**URL:** <https://forum.soliditylang.org/t/get-external-library-address/1778>\
**Category:** Uncategorized\
**Created:** [August 8, 2023, 1:08pm UTC](https://forum.soliditylang.org/t/get-external-library-address/1778 "2023-08-08T13:08:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![INastro](https://avatars.discourse-cdn.com/v4/letter/i/ea666f/32.png) [@INastro](https://forum.soliditylang.org/u/INastro)\
**Post date:** [August 8, 2023, 1:08pm UTC](https://forum.soliditylang.org/t/get-external-library-address/1778/1 "2023-08-08T13:08:39Z")

</div>

Is there a way to get an external library address?

---

<div class="post-metadata">

**Author:** ![barakman](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/barakman/32/830_2.png) [@barakman](https://forum.soliditylang.org/u/barakman)\
**Post date:** [August 8, 2023, 2:14pm UTC](https://forum.soliditylang.org/t/get-external-library-address/1778/2 "2023-08-08T14:14:47Z")

</div>

From [the official documentation](https://docs.soliditylang.org/en/v0.8.21/contracts.html#libraries):

> It is possible to obtain the address of a library by converting the library type to the `address` type, i.e. using `address(LibraryName)`.
> 
> As the compiler does not know the address where the library will be deployed, the compiled hex code will contain placeholders of the form ` __$30bbc0abd4d6364515865950d3e0d10953$__ `. The placeholder is a 34 character prefix of the hex encoding of the keccak256 hash of the fully qualified library name, which would be for example `libraries/bigint.sol:BigInt` if the library was stored in a file called `bigint.sol` in a `libraries/` directory. Such bytecode is incomplete and should not be deployed. Placeholders need to be replaced with actual addresses. You can do that by either passing them to the compiler when the library is being compiled or by using the linker to update an already compiled binary.
