I have two different projects. In one, the build/token.json
file contains an unlinked_binary
field. In the other, there's no unlinked_binary
, but there's bytecode
.
What's the difference between the two?
It's about Library Linking. To perform a call to an external
or public
function defined in a library the compiler must know the address of the library. If you do not provide it using the --libraries
option, the compiler will insert a temporary address placeholder instead. You can do linking separately to eliminate these placeholders.
unlinked_binary
is bytecode that still contains placeholders while bytecode
is the final bytecode that does not have any and can actually be deployed.