Skip to content

Commit

Permalink
0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
p00temkin committed Jun 30, 2024
1 parent d47d0c4 commit 9129219
Show file tree
Hide file tree
Showing 8 changed files with 12,775 additions and 12,493 deletions.
25,117 changes: 12,633 additions & 12,484 deletions evmchainindex.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>crypto.forestfish</groupId>
<artifactId>forestfish</artifactId>
<version>0.2.6</version>
<version>0.2.7</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/crypto/forestfish/enums/evm/EVMChain.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public enum EVMChain {
AILAYER,
ETERNAL,
COINSEC,
BINARYCHAIN,
WATERFALL,
OX,
KINGDOM,
TREASURE,
Expand Down Expand Up @@ -211,6 +213,7 @@ public enum EVMChain {
DOGECHAIN,
BERACHAINBARTIOTEST,
SIBERIUM,
ZEROTEST,
KAICHAIN,
RANGERS,
CMRANGERS,
Expand Down Expand Up @@ -419,6 +422,7 @@ public enum EVMChain {
METISGOERLITEST,
BERACHAINARTIOTEST,
FANTOMTEST,
BINARYCHAINTEST,
MILKOMEDAA1TEST,
MILKOMEDAC1TEST,
AILAYERTEST,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1353,6 +1353,66 @@ public static HashMap<EVMChain, EVMChainInfo> getMainnetEVMNetworks() {
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.PROOF, proof);

// waterfall
EVMChainInfo waterfall = new EVMChainInfo(
EVMChain.WATERFALL.toString(),
"Waterfall Network",
181L,
BlockchainType.PUBLIC.toString(),
new EVMCurrency("Waterfall Network Gas Token", "WATER", 18),
EVMPriceMechanism.LEGACY.toString(),30,
"30000000000", //30 gwei
null, // enforced min gasprice
"300000", //300k units
new ArrayList<String>() {{
this.add("https://rpc.waterfall.network/");
}},
new ArrayList<String>(), // archive nodes (if available)
new ArrayList<String>(),
new ArrayList<String>(),
new ArrayList<String>() {{
this.add("<TODO>");
}},
new ArrayList<String>() {{
this.add("<TODO>");
}},
new ArrayList<String>() {{
this.add("https://chainlist.org/chain/181");
}},
BlockchainTokenDetailsEVM.generateDummyTokenIndex(),
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.WATERFALL, waterfall);

// binarychain
EVMChainInfo binarychain = new EVMChainInfo(
EVMChain.BINARYCHAIN.toString(),
"BinaryChain Mainnet",
987L,
BlockchainType.PUBLIC.toString(),
new EVMCurrency("BinaryChain Mainnet Gas Token", "BNRY", 18),
EVMPriceMechanism.LEGACY.toString(),30,
"30000000000", //30 gwei
null, // enforced min gasprice
"300000", //300k units
new ArrayList<String>() {{
this.add("https://rpc.binarychain.org");
}},
new ArrayList<String>(), // archive nodes (if available)
new ArrayList<String>(),
new ArrayList<String>(),
new ArrayList<String>() {{
this.add("https://explorer.binarychain.org");
}},
new ArrayList<String>() {{
this.add("<TODO>");
}},
new ArrayList<String>() {{
this.add("https://chainlist.org/chain/987");
}},
BlockchainTokenDetailsEVM.generateDummyTokenIndex(),
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.BINARYCHAIN, binarychain);

// kaichain
EVMChainInfo kaichain = new EVMChainInfo(
EVMChain.KAICHAIN.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3471,6 +3471,36 @@ public static HashMap<EVMChain, EVMChainInfo> getTestnetEVMNetworks() {
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.TAOTEST, tao_test);

// binarychain_test
EVMChainInfo binarychain_test = new EVMChainInfo(
EVMChain.BINARYCHAINTEST.toString(),
"BinaryChain Testnet",
9876L,
BlockchainType.PUBLIC.toString(),
new EVMCurrency("BinaryChain Testnet Gas Token", "BNRY", 18),
EVMPriceMechanism.LEGACY.toString(),30,
"30000000000", //30 gwei
null, // enforced min gasprice
"300000", //300k units
new ArrayList<String>() {{
this.add("https://rpctestnet.binarychain.org");
}},
new ArrayList<String>(), // archive nodes (if available)
new ArrayList<String>(),
new ArrayList<String>(),
new ArrayList<String>() {{
this.add("https://explorer.testnet.binarychain.org");
}},
new ArrayList<String>() {{
this.add("https://faucet.testnet.binarychain.org");
}},
new ArrayList<String>() {{
this.add("https://chainlist.org/chain/9876");
}},
BlockchainTokenDetailsEVM.generateDummyTokenIndex(),
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.BINARYCHAINTEST, binarychain_test);

// xchain_test
EVMChainInfo xchain_test = new EVMChainInfo(
EVMChain.XCHAINTEST.toString(),
Expand Down Expand Up @@ -9276,6 +9306,7 @@ public static HashMap<EVMChain, EVMChainInfo> getTestnetEVMNetworks() {
new ArrayList<String>() {{
this.add("https://bartio.rpc.berachain.com");
this.add("https://bera-testnet.nodeinfra.com");
this.add("https://bartio.rpc.b-harvest.io");
}},
new ArrayList<String>(), // archive nodes (if available)
new ArrayList<String>(),
Expand All @@ -9293,6 +9324,35 @@ public static HashMap<EVMChain, EVMChainInfo> getTestnetEVMNetworks() {
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.BERACHAINBARTIOTEST, berachainbartio_test);

// zero_test
EVMChainInfo zero_test = new EVMChainInfo(
EVMChain.ZEROTEST.toString(),
"Zero Test network",
4457845L,
BlockchainType.PUBLIC.toString(),
new EVMCurrency("Zero Test network Gas Token", "ETH", 18),
EVMPriceMechanism.LEGACY.toString(),30,
"30000000000", //30 gwei
null, // enforced min gasprice
"1000000", //1M units
new ArrayList<String>() {{
this.add("https://rpc.zerion.io/v1/zero-sepolia");
}},
new ArrayList<String>(), // archive nodes (if available)
new ArrayList<String>(),
new ArrayList<String>(),
new ArrayList<String>() {{
this.add("https://explorer.zero.network");
}},
new ArrayList<String>() {{
this.add("https://bridge.zero.network/");
}},
new ArrayList<String>() {{
this.add("https://chainlist.org/chain/4457845");
}},
BlockchainTokenDetailsEVM.generateDummyTokenIndex(),
BlockchainTokenDetailsEVM.generateDummyNFTIndex());
networks.put(EVMChain.ZEROTEST, zero_test);

// berachainartio_test
EVMChainInfo berachainartio_test = new EVMChainInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ public String getBalanceInETH() {
}

public String getBalanceInETHPrettyPrint() {
if (balanceInETH.startsWith("0.00")) {
return "..." + this.balanceInETH;
if (false ||
balanceInETH.startsWith("0.00") ||
balanceInETH.contains("E-") ||
false) {
return "0";
//return "... " + this.balanceInETH;
} else {
return this.balanceInETH;
}
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/crypto/forestfish/utils/EVMUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ public static String sendTXWithNativeCurrency(EVMBlockChainConnector _connector,
return null;
}

private static String sendTXWithNativeCurrency_LegacyPricingMechanism(EVMBlockChainConnector _connector, Credentials _from_wallet_credentials, String _target_address, EVMNativeValue _evmNativeValue, boolean _haltOnUnconfirmedTX) {
public static String sendTXWithNativeCurrency_LegacyPricingMechanism(EVMBlockChainConnector _connector, Credentials _from_wallet_credentials, String _target_address, EVMNativeValue _evmNativeValue, boolean _haltOnUnconfirmedTX) {
return sendTXWithNativeCurrency_LegacyPricingMechanism_WithCustomNonce(_connector, _from_wallet_credentials, _target_address, _evmNativeValue, _haltOnUnconfirmedTX, null, false);
}

Expand Down Expand Up @@ -3319,6 +3319,7 @@ public static void evmpingpong(EVMChain _chain, String wallet001_name, String _w

}


public static boolean isValidPrivateKey(String _privateKey) {

if (_privateKey == null || _privateKey.isEmpty()) {
Expand Down Expand Up @@ -3413,8 +3414,9 @@ public static EVMPortfolioSimple createEVMPortfolioSimple(EVMPortfolio _evm_port
return new EVMPortfolioSimple(_evm_portfolio.getAccount_address(), _evm_portfolio.getChainportfolio());
}

public static String sendTX(EVMBlockChainConnector _connector, Credentials cred, String wolfwallet001_address, EVMNativeValue val_to_withdraw, boolean haltOnUnconfirmedTX) {
public static String sendTX(EVMBlockChainConnector _connector, Credentials cred, String to_address, EVMNativeValue val_to_withdraw, boolean haltOnUnconfirmedTX) {
String txhash = null;
LOGGER.info("sendTX from " + cred.getAddress() + " to " + to_address);

// force custom behavior for chain?
if (_connector.getChain() == EVMChain.MANTLETEST) {
Expand All @@ -3423,9 +3425,9 @@ public static String sendTX(EVMBlockChainConnector _connector, Credentials cred,
Long nonce_to_use = pendingTX.getNonce_finalized().longValue();
LOGGER.info("Since we are dealing with " + _connector.getChain().toString() + " going to set nonce to " + nonce_to_use);
if ("LEGACY".equals(_connector.getChaininfo().getPriceMechanism())) {
txhash = EVMUtils.sendTXWithNativeCurrency_LegacyPricingMechanism_WithCustomNonce(_connector, cred, wolfwallet001_address, val_to_withdraw, haltOnUnconfirmedTX, BigInteger.valueOf(nonce_to_use), false);
txhash = EVMUtils.sendTXWithNativeCurrency_LegacyPricingMechanism_WithCustomNonce(_connector, cred, to_address, val_to_withdraw, haltOnUnconfirmedTX, BigInteger.valueOf(nonce_to_use), false);
} else if ("EIP1559".equals(_connector.getChaininfo().getPriceMechanism())) {
txhash = EVMUtils.sendTXWithNativeCurrency_EIP1559PricingMechanism_WithCustomNonce(_connector, cred, wolfwallet001_address, val_to_withdraw, haltOnUnconfirmedTX, BigInteger.valueOf(nonce_to_use), false);
txhash = EVMUtils.sendTXWithNativeCurrency_EIP1559PricingMechanism_WithCustomNonce(_connector, cred, to_address, val_to_withdraw, haltOnUnconfirmedTX, BigInteger.valueOf(nonce_to_use), false);
} else {
LOGGER.error("Unable to handle pricing mechanism named: " + _connector.getChaininfo().getPriceMechanism());
SystemUtils.halt();
Expand All @@ -3434,9 +3436,9 @@ public static String sendTX(EVMBlockChainConnector _connector, Credentials cred,
}

if ("LEGACY".equals(_connector.getChaininfo().getPriceMechanism())) {
txhash = EVMUtils.sendTXWithNativeCurrency_LegacyPricingMechanism(_connector, cred, wolfwallet001_address, val_to_withdraw, haltOnUnconfirmedTX);
txhash = EVMUtils.sendTXWithNativeCurrency_LegacyPricingMechanism(_connector, cred, to_address, val_to_withdraw, haltOnUnconfirmedTX);
} else if ("EIP1559".equals(_connector.getChaininfo().getPriceMechanism())) {
txhash = EVMUtils.sendTXWithNativeCurrency_EIP1559PricingMechanism(_connector, cred, wolfwallet001_address, val_to_withdraw, haltOnUnconfirmedTX);
txhash = EVMUtils.sendTXWithNativeCurrency_EIP1559PricingMechanism(_connector, cred, to_address, val_to_withdraw, haltOnUnconfirmedTX);
} else {
LOGGER.error("Unable to handle pricing mechanism named: " + _connector.getChaininfo().getPriceMechanism());
SystemUtils.halt();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ public void check() {
this.put("Berachain bArtio", EVMChain.BERACHAINBARTIOTEST);
this.put("Zilliqa 2 EVM proto-testnet", EVMChain.ZILLIQA2PTEST);
this.put("Autonomys Testnet Nova Domain", EVMChain.AUTONOMYSTEST);
this.put("Waterfall Network", EVMChain.WATERFALL);
this.put("BinaryChain Mainnet", EVMChain.BINARYCHAIN);
this.put("BinaryChain Testnet", EVMChain.BINARYCHAINTEST);
}};

HashMap<String, Boolean> skipnodeurls = new HashMap<String, Boolean>() {{
Expand Down

0 comments on commit 9129219

Please sign in to comment.