mandrean / cw-optimizoor

A blazingly fast compiling & optimization tool for CosmWasm smart contracts.
MIT License
49 stars 6 forks source link

When contracts import each other, the imported contracts skip the entry points #31

Open nicolaslara opened 1 year ago

nicolaslara commented 1 year ago

If you compile two contracts A and B where the B one imports the A, then A one will be built both as a contract and as a library.

As a consequence, the .wasm artifact for the A being built as a contract will be overwritten by the .wasm of A being built as a library. This means that there is no way to obtain A as a contract. This can be seen in the following workspace: https://github.com/osmosis-labs/osmosis/tree/main/x/ibc-hooks.

I think I know how to fix this, so I'll try to submit a PR when I have time, but leaving the issue here in case someone gets to it before me.