0

After compiling a contract that uses a library it is necessary to go into the compile contract bytecode and remove a piece that looks something like "_________library__address______" and replace it with the deployed library address.

Tools like Remix automatically add this now for testing.

My question is: Since a library is just a type of contract, could I add a contract address instead of a library address to the bytecode? (and suffer whatever consequences to the functionality of the contract)

I am trying to insert a proxy contract whose fallback function points to the library and I think this is how I would do it.

Thanks for your time.

  • There is nothing stopping you from editing byte code before deploying. you can try doing this on the test net to know what happens with the functionality – Sanjay S B Jan 9 at 8:50
  • Sure but I am not confident on the consequences of launching nonsense bytecode.. I can be overly cautious. But even if successful I am interested in learning more about why and caveats because I cannot find anything( someone else must have tried). If it fails it could prove nothing and I would again be looking to see if someone else has tried. I think the answer would be useful to other and the caveats or risks if there are any. – Duncan Brain Jan 10 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.