sol-rs icon indicating copy to clipboard operation
sol-rs copied to clipboard

Let's have a wrapper around libsolc

Open kirushik opened this issue 7 years ago • 6 comments

It will allow us to compile contracts (and extract ABIs) without any need to shell-out to the compiler. Also will allow some advanced instumentation techniques (like custom opcodes maybe?) for #7

UPD: renamed the issue to follow the @axic suggestion about wrapping.

kirushik avatar Dec 13 '17 14:12 kirushik

where does one find libsolidity? a google search didn't bring up any meaningful results

snd avatar Dec 18 '17 13:12 snd

@snd I referred to this: https://github.com/ethereum/solidity/tree/develop/libsolidity Haven't looked if it exposes all the knobs and levers necessary, though.

kirushik avatar Dec 18 '17 16:12 kirushik

I'd strongly suggest a wrapper around https://github.com/ethereum/solidity/tree/develop/libsolc (it makes sense with #25) if you really want to go ahead with an unsupported method at the moment - which is binding to the sources directly.

axic avatar Dec 22 '17 14:12 axic

@axic while we have you here, maybe you can share you opinion about what's most likely to go wrong if we bind directly to the compiler sources? Like, I understand that we're voiding all the possible warranties and such (so we won't treat your answer as a compatibility commitment or anything) — but it will definitely help to know our risks upfront.

PS. Thanks for correcting me about libsolidity and libsolc. I should've investigated the options more thoroughly instead of just skimming the repo structure and opening this issue.

kirushik avatar Dec 22 '17 15:12 kirushik

It will allow us to compile contracts (and extract ABIs) without any need to shell-out to the compiler.

personally i don't think shelling out to the compiler is much of a problem

Also will allow some advanced instumentation techniques (like custom opcodes maybe?) for #7

that could be great. we'll have to weigh up whether it justifies binding to the sources, which is more complex than shelling out

snd avatar Jun 07 '18 22:06 snd

@kirushik sorry didn't see this ping :(

Nothing should go wrong really and that API is meant to be stable (but of course no guarantees on that!), however since we don't ship official releases of libsolc, you'd need to find the proper commits and compile the sources directly together with Rust.

axic avatar Jun 12 '18 21:06 axic