There’s more…

While compiling the contracts, the solidity compiler includes placeholders in the bytecode to add the location of libraries used. The placeholders are in the form of 40-byte substrings (__LibraryName__) including the name of the library. The address can be included by replacing those 40 symbols with the hex encoding of the address of the library contract.

The solc compiler provides an option to link the hex encoding during compile time. This can be done with the help of the --libraries attribute while compiling.

The input to the --libraries attribute can be a string:

--libraries "SafeMath:0x.. StringUtils:0x..."

 Or it can be a file that includes each library and address as a separate line:

--libraries <filename>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.158.36