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?

user1424739
  • 131
  • 6

1 Answers1

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.

qbsp
  • 4,367
  • 2
  • 15
  • 26