Skip to content

Commit

Permalink
remove solidity file pragma filed
Browse files Browse the repository at this point in the history
  • Loading branch information
wenlinlee committed Jun 27, 2024
1 parent d657b54 commit 626e187
Show file tree
Hide file tree
Showing 14 changed files with 2 additions and 37 deletions.
25 changes: 2 additions & 23 deletions src/main/java/console/contract/ConsoleContractImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,6 @@ public TransactionResponse deploySolidity(
try {
boolean isContractParallelAnalysis = false;
Version version = Version.V0_8_11;
try {
String flag =
client.getSystemConfigByKey("feature_evm_cancun")
.getSystemConfig()
.getValue();
if (Integer.parseInt(flag) == 1) {
version = Version.V0_8_26;
}
} catch (Exception e) {
version = Version.V0_8_11;
}
if (!inputParams.isEmpty()) {
int lastIndexOf = inputParams.lastIndexOf("-p");
if (lastIndexOf != -1) {
Expand Down Expand Up @@ -1088,20 +1077,10 @@ private String getSolidityAbi(String contractFileName) throws Exception {

List<SolidityCompiler.Option> defaultOptions = Arrays.asList(ABI, BIN, METADATA);
List<SolidityCompiler.Option> options = new ArrayList<>(defaultOptions);
Version version = Version.V0_8_11;
try {
String flag =
client.getSystemConfigByKey("feature_evm_cancun").getSystemConfig().getValue();
if (Integer.parseInt(flag) == 1) {
version = Version.V0_8_26;
}
} catch (Exception e) {
version = Version.V0_8_11;
}

logger.debug(
"compileSolToBinAndAbi, solc version:{} ,basePath: {}",
version,
Version.V0_8_11,
solFile.getParentFile().getCanonicalPath());
SolidityCompiler.Option basePath =
new SolidityCompiler.CustomOption(
Expand All @@ -1114,7 +1093,7 @@ private String getSolidityAbi(String contractFileName) throws Exception {
solFile,
(client.getCryptoType() == CryptoType.SM_TYPE),
true,
version,
Version.V0_8_11,
options.toArray(new SolidityCompiler.Option[0]));

if (logger.isDebugEnabled()) {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/Asset.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

import "./Table.sol";
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/Cast.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

abstract contract Cast {
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/contract/solidity/CastTest.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;

import "./Cast.sol";

contract CastTest {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/Crypto.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;
abstract contract Crypto
{
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/DelegateCallTest.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pragma solidity>=0.6.10 <0.8.20;


contract DelegateCallDest {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/EntryWrapper.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;
import "./Cast.sol";

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/EventSubDemo.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity>=0.6.10 <0.8.20;

contract EventSubDemo {

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/KVTableTest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

import "./Table.sol";
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/ShaTest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity>=0.6.10 <0.8.20;

pragma experimental ABIEncoderV2;

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/Table.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// 该接口文件定义了FISCO BCOS v3.1.0及以前版本的接口,使用时需要将该文件放在合约目录下
// 若要使用FISCO BCOS v3.2.0及以后版本的接口,请使用TableV320.sol,旧合约仍然能在新节点中使用
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

// KeyOrder指定Key的排序规则,字典序和数字序,如果指定为数字序,key只能为数字
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/TableTest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

import "./Table.sol";
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/TableTestV320.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;

import "./TableV320.sol";
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/contract/solidity/TableV320.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// 该接口文件定义了FISCO BCOS v3.2.0及以后版本的接口,使用时需要将该文件放在合约目录下
// 若要使用FISCO BCOS v3.1.0及以前版本的接口,请使用Table.sol,旧合约仍然能在新节点中使用
pragma solidity >=0.6.10 <0.8.20;
pragma experimental ABIEncoderV2;
import "./EntryWrapper.sol";

Expand Down

0 comments on commit 626e187

Please sign in to comment.