1

This example constructs the javascript code from a solidity code in a shell script.

https://github.com/okue/Hello-Ethereum/blob/master/bin/compile

Is there a function in javascript that can convert a solidity code to a javascript code without having to rely an external command solc?

1

solc is the Solidity compiler, is not a command that convert the solidity code in javascript. The compiler generate an output that contains the ABI, bytecode, metadata and other info as described here.

Once the code is compiled its bytecode will be deployed into the blockchain and its abi will be used as interface. The script you linked is doing this: it compiles the solidity code with solc and deploy it with web3, printing its address at the end.

You can see the same code here in javascript that does the same.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.