valory-xyz / open-aea

A framework for open autonomous economic agent (AEA) development - no package vendor is prioritised over other package vendors
https://open-aea.docs.autonolas.tech
Apache License 2.0
63 stars 14 forks source link

smart contract bytecode library linking #266

Closed Karrenbelt closed 2 years ago

Karrenbelt commented 2 years ago

Is your feature request related to a problem? Please describe.

Library dependencies present in smart contracts and their bytecode are an issue when trying to deploy them. Such features need to be processed and replaced with the on-chain address of the corresponding library. This is referred to as library linking

It will be important to have a means to obtain the library contract address in order to replace the bytecode where needed.

This issue was first encountered as part of the Keep3r system, and this PR showcases how to this can be addressed and shows a partial implementation of the tool

Describe the solution you'd like As access to the other repository is not guaranteed, shamelessly plagiarized myself: library_linking.txt

Describe alternatives you've considered ethpm LinkableContract. This requires a specific format of the package for import before this can be used. One should definitely look at their code and use what is needed as a template.

Additional context Add any other context or screenshots about the feature request here.

DavidMinarsch commented 2 years ago

I would consider this clearly outside the scope of open-aea or even open-autonomy. Both take finished smart contracts and wrap them.