Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add solc 0.8.26 #39

Merged
merged 9 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- 0.4.25
- 0.5.2
- 0.6.10
- 0.8.11
- 0.8.26

## 使用

Expand All @@ -28,6 +30,12 @@

# 0.6.10 版本
compile group: 'org.fisco-bcos', name: 'solcJ', version: '0.6.10.0'

# 0.8.11 版本
compile group: 'org.fisco-bcos', name: 'solcJ', version: '0.8.11.0'

# 0.8.26 版本
compile group 'org.fisco-bcos', name: 'solcJ', version: '0.8.26.0'
```

- `Maven`
Expand All @@ -52,7 +60,20 @@
<artifactId>solcJ</artifactId>
<version>0.6.10.0</version>
</dependency>


#0.8.11 版本
<dependency>
<groupId>org.fisco-bcos</groupId>
<artifactId>solcJ</artifactId>
<version>0.8.11.0</version>
</dependency>

#0.8.26 版本
<dependency>
<groupId>org.fisco-bcos</groupId>
<artifactId>solcJ</artifactId>
<version>0.8.26.0</version>
</dependency>
```

## 接口
Expand Down
78 changes: 73 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ test {
}

jar {
dependsOn(['jarAll', 'jar0425', 'jar052', 'jar0610', 'jar0811', 'jarLinux', 'jarMac', 'jarWin'])
dependsOn(['jarAll', 'jar0425', 'jar052', 'jar0610', 'jar0811', 'jar0826', 'jarLinux', 'jarMac', 'jarWin'])
}

task jarAll(type: Jar) {
manifest {
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit,
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11",
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11, 0.8.26",
"Crypto" : "ecdsa, sm",
"OS-Name" : "linux, mac, win",
"OS-Arch" : "x86, arm",
Expand All @@ -122,9 +122,11 @@ task jar0425(type: Jar) {
exclude "native/ecdsa/linux/0.5.2", "native/ecdsa/mac/0.5.2", "native/ecdsa/win/0.5.2"
exclude "native/ecdsa/linux/0.6.10", "native/ecdsa/mac/0.6.10", "native/ecdsa/win/0.6.10"
exclude "native/ecdsa/linux/0.8.11", "native/ecdsa/mac/0.8.11", "native/ecdsa/win/0.8.11"
exclude "native/ecdsa/linux/0.8.26", "native/ecdsa/mac/0.8.26", "native/ecdsa/win/0.8.26"
exclude "native/sm/linux/0.5.2", "native/sm/mac/0.5.2", "native/sm/win/0.5.2"
exclude "native/sm/linux/0.6.10", "native/sm/mac/0.6.10", "native/sm/win/0.6.10"
exclude "native/sm/linux/0.8.11", "native/sm/mac/0.8.11", "native/sm/win/0.8.11"
exclude "native/sm/linux/0.8.26", "native/sm/mac/0.8.26", "native/sm/win/0.8.26"

archiveFileName = project.name + '-0.4.25-' + project.version + '.jar';
}
Expand All @@ -145,9 +147,11 @@ task jar052(type: Jar) {
exclude "native/ecdsa/linux/0.4.25", "native/ecdsa/mac/0.4.25", "native/ecdsa/win/0.4.25"
exclude "native/ecdsa/linux/0.6.10", "native/ecdsa/mac/0.6.10", "native/ecdsa/win/0.6.10"
exclude "native/ecdsa/linux/0.8.11", "native/ecdsa/mac/0.8.11", "native/ecdsa/win/0.8.11"
exclude "native/ecdsa/linux/0.8.26", "native/ecdsa/mac/0.8.26", "native/ecdsa/win/0.8.26"
exclude "native/sm/linux/0.4.25", "native/sm/mac/0.4.25", "native/sm/win/0.4.25"
exclude "native/sm/linux/0.6.10", "native/sm/mac/0.6.10", "native/sm/win/0.6.10"
exclude "native/sm/linux/0.8.11", "native/sm/mac/0.8.11", "native/sm/win/0.8.11"
exclude "native/sm/linux/0.8.26", "native/sm/mac/0.8.26", "native/sm/win/0.8.26"

archiveFileName = project.name + '-0.5.2-' + project.version + '.jar';
}
Expand All @@ -168,9 +172,11 @@ task jar0610(type: Jar) {
exclude "native/ecdsa/linux/0.4.25", "native/ecdsa/mac/0.4.25", "native/ecdsa/win/0.4.25"
exclude "native/ecdsa/linux/0.5.2", "native/ecdsa/mac/0.5.2", "native/ecdsa/win/0.5.2"
exclude "native/ecdsa/linux/0.8.11", "native/ecdsa/mac/0.8.11", "native/ecdsa/win/0.8.11"
exclude "native/ecdsa/linux/0.8.26", "native/ecdsa/mac/0.8.26", "native/ecdsa/win/0.8.26"
exclude "native/sm/linux/0.4.25", "native/sm/mac/0.4.25", "native/sm/win/0.4.25"
exclude "native/sm/linux/0.5.2", "native/sm/mac/0.5.2", "native/sm/win/0.5.2"
exclude "native/sm/linux/0.8.11", "native/sm/mac/0.8.11", "native/sm/win/0.8.11"
exclude "native/sm/linux/0.8.26", "native/sm/mac/0.8.26", "native/sm/win/0.8.26"

archiveFileName = project.name + '-0.6.10-' + project.version + '.jar';
}
Expand All @@ -191,19 +197,46 @@ task jar0811(type: Jar) {
exclude "native/ecdsa/linux/0.4.25", "native/ecdsa/mac/0.4.25", "native/ecdsa/win/0.4.25"
exclude "native/ecdsa/linux/0.5.2", "native/ecdsa/mac/0.5.2", "native/ecdsa/win/0.5.2"
exclude "native/ecdsa/linux/0.6.10", "native/ecdsa/mac/0.6.10", "native/ecdsa/win/0.6.10"
exclude "native/ecdsa/linux/0.8.26", "native/ecdsa/mac/0.8.26", "native/ecdsa/win/0.8.26"
exclude "native/sm/linux/0.4.25", "native/sm/mac/0.4.25", "native/sm/win/0.4.25"
exclude "native/sm/linux/0.5.2", "native/sm/mac/0.5.2", "native/sm/win/0.5.2"
exclude "native/sm/linux/0.6.10", "native/sm/mac/0.6.10", "native/sm/win/0.6.10"
exclude "native/sm/linux/0.8.26", "native/sm/mac/0.8.26", "native/sm/win/0.8.26"

archiveFileName = project.name + '-0.8.11-' + project.version + '.jar';
}

task jar0826(type: Jar) {
manifest {
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit,
"Solidity-Version" : "0.8.26",
"Crypto" : "ecdsa, sm",
"OS-Name" : "linux, mac, win",
"OS-Arch" : "x86, arm",
])
}

from sourceSets.main.output
exclude "native/ecdsa/linux/0.4.25", "native/ecdsa/mac/0.4.25", "native/ecdsa/win/0.4.25"
exclude "native/ecdsa/linux/0.5.2", "native/ecdsa/mac/0.5.2", "native/ecdsa/win/0.5.2"
exclude "native/ecdsa/linux/0.6.10", "native/ecdsa/mac/0.6.10", "native/ecdsa/win/0.6.10"
exclude "native/ecdsa/linux/0.8.11", "native/ecdsa/mac/0.8.11", "native/ecdsa/win/0.8.11"
exclude "native/sm/linux/0.4.25", "native/sm/mac/0.4.25", "native/sm/win/0.4.25"
exclude "native/sm/linux/0.5.2", "native/sm/mac/0.5.2", "native/sm/win/0.5.2"
exclude "native/sm/linux/0.6.10", "native/sm/mac/0.6.10", "native/sm/win/0.6.10"
exclude "native/sm/linux/0.8.11", "native/sm/mac/0.8.11", "native/sm/win/0.8.11"

archiveFileName = project.name + '-0.8.26-' + project.version + '.jar';
}

task jarLinux(type: Jar) {
manifest {
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit,
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11",
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11, 0.8.26",
"Crypto" : "ecdsa, sm",
"OS-Name" : "linux",
"OS-Arch" : "x86, arm",
Expand All @@ -222,7 +255,7 @@ task jarMac(type: Jar) {
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit,
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11",
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11, 0.8.26",
"Crypto" : "ecdsa, sm",
"OS-Name" : "mac",
"OS-Arch" : "x86, arm",
Expand All @@ -241,7 +274,7 @@ task jarWin(type: Jar) {
attributes(["Implementation-Timestamp": date,
"Git-Branch" : branch,
"Git-Commit" : commit,
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11",
"Solidity-Version" : "0.4.25, 0.5.2, 0.6.10, 0.8.11, 0.8.26",
"Crypto" : "ecdsa, sm",
"OS-Name" : "win",
"OS-Arch" : "x86",
Expand Down Expand Up @@ -448,6 +481,41 @@ publishing {
}
}

solc0826(MavenPublication) {

artifactId project.name + '-0.8.26'
groupId project.group
version project.version

artifact jar0826
artifact sourcesJar
artifact javadocJar

pom {
name = 'fisco-bcos'
description = 'fisco-bcos solcJ'
url = 'http://www.fisco-bcos.org'

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'zhangsan'
name = 'zhangsan'
email = '[email protected]'
}
}
scm {
connection = 'https://github.com/FISCO-BCOS/solcJ.git'
url = 'https://github.com/FISCO-BCOS/solcJ.git'
}
}
}

solcLinux(MavenPublication) {

artifactId project.name + '-linux'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ public static String runGetVersionOutput(boolean sm, Version version) throws IOE
try {
process.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/fisco/solc/compiler/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ public enum Version {
V0_4_25("0.4.25"),
V0_5_2("0.5.2"),
V0_6_10("0.6.10"),
V0_8_11("0.8.11");
V0_8_11("0.8.11"),
V0_8_26("0.8.26");

private String version;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/native/ecdsa/mac/0.8.26/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main/resources/native/ecdsa/win/0.8.26/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
solc.exe
msvcp140.dll
msvcp140_1.dll
msvcp140_2.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/native/sm/linux/0.8.26/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/native/sm/mac/0.8.26/arm/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file not shown.
1 change: 1 addition & 0 deletions src/main/resources/native/sm/mac/0.8.26/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
solc
Binary file added src/main/resources/native/sm/mac/0.8.26/solc/solc
Binary file not shown.
4 changes: 4 additions & 0 deletions src/main/resources/native/sm/win/0.8.26/solc/file.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
solc.exe
msvcp140.dll
msvcp140_1.dll
msvcp140_2.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions src/test/java/org/fisco/solc/compiler/test/SolcTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ public void smSolcTest() {
Assert.assertNotNull(solc);
Assert.assertTrue(solc.getExecutable().exists());
Assert.assertTrue(solc.getExecutable().canExecute());

solc = new Solc(true, Version.V0_8_26);
Assert.assertNotNull(solc);
Assert.assertTrue(solc.getExecutable().exists());
Assert.assertTrue(solc.getExecutable().canExecute());
}

@Test
public void ecdsaSolcTest() {

Solc solc = new Solc(false, Version.V0_4_25);
Assert.assertNotNull(solc);
Assert.assertTrue(solc.getExecutable().exists());
Expand All @@ -51,5 +57,10 @@ public void ecdsaSolcTest() {
Assert.assertNotNull(solc);
Assert.assertTrue(solc.getExecutable().exists());
Assert.assertTrue(solc.getExecutable().canExecute());

solc = new Solc(false, Version.V0_8_26);
Assert.assertNotNull(solc);
Assert.assertTrue(solc.getExecutable().exists());
Assert.assertTrue(solc.getExecutable().canExecute());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ public void compilerV0811Test() {
docTest(Version.V0_6_10);
}

@Test
public void compilerV0826Test() {
compileCharitySplitterFactory(false, Version.V0_8_26, true);
compileCharitySplitterFactory(false, Version.V0_8_26, false);
compileCharitySplitterFactory(true, Version.V0_8_26, true);
compileCharitySplitterFactory(true, Version.V0_8_26, false);
docTest(Version.V0_6_10);
}

private void compileCharitySplitterFactory(boolean sm, Version version, boolean isFile) {
try {
URL url =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public class SolidityCompilerVersionTest {
@SuppressWarnings("static-access")
@Test
public void smSolcVersionTest() throws Exception {
String versionOutput0 = SolidityCompiler.runGetVersionOutput(true, Version.V0_8_26);
Assert.assertTrue(versionOutput0.contains("0.8.26"));
Assert.assertTrue(versionOutput0.toLowerCase().contains("gm"));

String versionOutput = SolidityCompiler.runGetVersionOutput(true, Version.V0_8_11);
Assert.assertTrue(versionOutput.contains("0.8.11"));
Assert.assertTrue(versionOutput.toLowerCase().contains("gm"));
Expand All @@ -28,6 +32,10 @@ public void smSolcVersionTest() throws Exception {

@Test
public void ecdsaSolcVersionTest() throws Exception {
String versionOutput0 = SolidityCompiler.runGetVersionOutput(false, Version.V0_8_26);
Assert.assertTrue(versionOutput0.contains("0.8.26"));
Assert.assertFalse(versionOutput0.toLowerCase().contains("gm"));

String versionOutput = SolidityCompiler.runGetVersionOutput(false, Version.V0_8_11);
Assert.assertTrue(versionOutput.contains("0.8.11"));
Assert.assertFalse(versionOutput.toLowerCase().contains("gm"));
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/solidity/CharitySplitterFactory.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity >=0.6.0 <0.8.20;
pragma solidity >=0.6.0 <=0.8.26;

contract CharitySplitter {
address public owner;
Expand Down
Loading