Skip to content

openlawteam/solcJ

This branch is 1 commit ahead of ether-camp/solcJ:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

06e5672 · May 28, 2021

History

46 Commits
Jan 8, 2019
Apr 1, 2019
Apr 1, 2019
Dec 13, 2016
Nov 15, 2019
May 28, 2021
Oct 27, 2016
Oct 27, 2016
Apr 1, 2019
Oct 27, 2016

Repository files navigation

solcJ

Solidity compiler binaries, packed into jar for use in Java based projects.

⛔ Deprecated ⛔

This project is not supported anymore. If you have any question or would like to contribute find us on Gitter.


Jars are available at: https://bintray.com/ethereum/maven/org.ethereum.solcJ-all/

Can be included in gradle via:

compile 'org.ethereum:solcJ-all:0.5.7'

We use jar in EthereumJ project, where we add addition layer of classes to interact with solc:

https://github.com/ethereum/ethereumj/tree/develop/ethereumj-core/src/main/java/org/ethereum/solidity/compiler

And then we use code snippet for compilation:

String contractSrc =
    "pragma solidity ^0.5.7;\n" +
            "contract a {" +
            "        function() {throw;}" +
            "}";

SolidityCompiler.Result res = SolidityCompiler.compile(
        contractSrc.getBytes(), true, ABI, BIN, INTERFACE, METADATA);
System.out.println("Out: '" + res.output + "'");
System.out.println("Err: '" + res.errors + "'");
CompilationResult result = CompilationResult.parse(res.output);

CompilationResult.ContractMetadata a = result.contracts.get("a");
CallTransaction.Contract contract = new CallTransaction.Contract(a.abi);
System.out.printf(contract.functions[0].toString());

About

DEPRECATED! Solidity compiler binaries, packed into jar for use in ethereumJ

Resources

Stars

Watchers

Forks

Packages 1

Languages

  • Java 57.7%
  • Dockerfile 25.0%
  • Shell 9.2%
  • Batchfile 8.1%