From 07b2cfd256fca9eaa407810617c62e55e060f0d0 Mon Sep 17 00:00:00 2001 From: lwYeo Date: Wed, 11 Aug 2021 23:35:44 +0800 Subject: [PATCH] Fix only replay-protected (EIP-155) txn error --- Crypto LP Compounder/Compounder.cs | 3 ++- Crypto LP Compounder/Settings/CompounderSettings.cs | 2 ++ Crypto LP Compounder/Settings/settings_WBNB-MOMA.json | 1 + Crypto LP Compounder/Settings/settings_WFTM-TOMB.json | 1 + Crypto LP Compounder/Settings/settings_WFTM-YEL.json | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Crypto LP Compounder/Compounder.cs b/Crypto LP Compounder/Compounder.cs index eef2987..3b4d716 100644 --- a/Crypto LP Compounder/Compounder.cs +++ b/Crypto LP Compounder/Compounder.cs @@ -174,6 +174,7 @@ public Compounder(Settings.CompounderSettings settings) Log.WriteLine("IsLogAll: " + _Settings.IsLogAll.ToString()); Log.WriteLine("RPC URL: " + _Settings.RPC_URL); Log.WriteLine("RPC_Timeout: " + _Settings.RPC_Timeout.ToString() + " s"); + Log.WriteLine("RPC_ChainID: " + _Settings.RPC_ChainID?.ToString() ?? "null"); Log.WriteLine("GasPriceOffsetGwei:" + _Settings.GasPriceOffsetGwei.ToString() + " Gwei"); Log.WriteLine("FixedGasPriceGwei: " + sFixedGasGwei); Log.WriteLine("MinGasPriceGwei: " + _Settings.GetUserMinGasPrice().ToString() + " Gwei"); @@ -201,7 +202,7 @@ public Compounder(Settings.CompounderSettings settings) Log.WriteLine("PoolID: " + _Settings.Farm.FarmPoolID.ToString()); Log.WriteLine("ProcessAllRewards: " + _Settings.Farm.ProcessAllRewards.ToString()); - Account account = new(Crypto_Crypt.Factory.Instance.Decrypt(_Settings.Wallet.PrivateKeyCrypt)); + Account account = new(Crypto_Crypt.Factory.Instance.Decrypt(_Settings.Wallet.PrivateKeyCrypt), _Settings.RPC_ChainID); if (!account.Address.Equals(_Settings.Wallet.Address, StringComparison.OrdinalIgnoreCase)) { diff --git a/Crypto LP Compounder/Settings/CompounderSettings.cs b/Crypto LP Compounder/Settings/CompounderSettings.cs index 5b555a0..abf6f39 100644 --- a/Crypto LP Compounder/Settings/CompounderSettings.cs +++ b/Crypto LP Compounder/Settings/CompounderSettings.cs @@ -347,6 +347,8 @@ public BigInteger GetGasPrice(Web3 web3) public uint RPC_Timeout { get; set; } = 120; + public ulong? RPC_ChainID { get; set; } = null; + public float GasPriceOffsetGwei { get; set; } = 0.0f; public float FixedGasPriceGwei { get; set; } = 0.0f; diff --git a/Crypto LP Compounder/Settings/settings_WBNB-MOMA.json b/Crypto LP Compounder/Settings/settings_WBNB-MOMA.json index 83057e3..7fe0377 100644 --- a/Crypto LP Compounder/Settings/settings_WBNB-MOMA.json +++ b/Crypto LP Compounder/Settings/settings_WBNB-MOMA.json @@ -3,6 +3,7 @@ "IsLogAll": true, "RPC_URL": "https://bsc-dataseed1.binance.org/", "RPC_Timeout": 120, + "RPC_ChainID": 56, "GasPriceOffsetGwei": 0.0, "FixedGasPriceGwei": 0.0, "MinGasPriceGwei": 0.0, diff --git a/Crypto LP Compounder/Settings/settings_WFTM-TOMB.json b/Crypto LP Compounder/Settings/settings_WFTM-TOMB.json index 6088f24..a65a3f7 100644 --- a/Crypto LP Compounder/Settings/settings_WFTM-TOMB.json +++ b/Crypto LP Compounder/Settings/settings_WFTM-TOMB.json @@ -3,6 +3,7 @@ "IsLogAll": true, "RPC_URL": "https://rpc.fantom.network/", "RPC_Timeout": 120, + "RPC_ChainID": 250, "GasPriceOffsetGwei": 0.0, "FixedGasPriceGwei": 0.0, "MinGasPriceGwei": 0.0, diff --git a/Crypto LP Compounder/Settings/settings_WFTM-YEL.json b/Crypto LP Compounder/Settings/settings_WFTM-YEL.json index 2793576..7cd5670 100644 --- a/Crypto LP Compounder/Settings/settings_WFTM-YEL.json +++ b/Crypto LP Compounder/Settings/settings_WFTM-YEL.json @@ -3,6 +3,7 @@ "IsLogAll": true, "RPC_URL": "https://rpc.fantom.network/", "RPC_Timeout": 120, + "RPC_ChainID": 250, "GasPriceOffsetGwei": 0.0, "FixedGasPriceGwei": 0.0, "MinGasPriceGwei": 0.0,