Skip to content

Commit 3e9d3d5

Browse files
committed
# modified: src/main/java/org/web3/Main.java
1 parent 20846cb commit 3e9d3d5

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/main/java/org/web3/Main.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,26 @@ public static void main(String[] args) throws Exception {
7272
BigInteger blockNumber1 = contract1.getBlockNumber().sendAsync().get();
7373
System.out.println("blockNumber:" + blockNumber1);
7474

75-
IERC165 erc165 = IERC165.load("0x7bAFa845D7d6Ffbd40697Ead682508486e32970b", web3j,
76-
new ReadonlyTransactionManager(web3j, null), contractGasProvider);
77-
String IERC6551Account_V3 = "0x6faff5f1";
78-
Boolean bool = erc165.supportsInterface(Numeric.hexStringToByteArray(IERC6551Account_V3)).sendAsync().get();
79-
System.out.println(bool);
75+
try {
76+
String ERC6551Account = "0x7bAFa845D7d6Ffbd40697Ead682508486e32970b";
77+
IERC165 erc165 = IERC165.load(ERC6551Account, web3j,
78+
new ReadonlyTransactionManager(web3j, null), contractGasProvider);
79+
String IERC6551Account_V3 = "0x6faff5f1";
80+
Boolean is_V3 = erc165.supportsInterface(Numeric.hexStringToByteArray(IERC6551Account_V3)).sendAsync()
81+
.get();
82+
if (is_V3) {
83+
// This v3
84+
// TODO: handle
85+
} else {
86+
// This v2
87+
// TODO: handle
88+
}
89+
90+
} catch (Exception e) {
91+
// TODO: handle exception
92+
System.out.println(e);
93+
}
94+
8095
}
8196

8297
public static void getTokenURI(Web3j web3j, String multicalladdress, String tokenAddress,

0 commit comments

Comments
 (0)