From 6453f20308e3c7ebea546891b077d525d0d25db1 Mon Sep 17 00:00:00 2001 From: Sebastian Wojas Date: Tue, 21 Jul 2026 13:51:28 +0200 Subject: [PATCH 1/2] Apply suggested fix to seth/util.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- seth/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/seth/util.go b/seth/util.go index 5a7ca9072..32fe57e5a 100644 --- a/seth/util.go +++ b/seth/util.go @@ -117,7 +117,7 @@ func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rooKeyBuffer int64) (*F addrFunding.String(), WeiToEther(addrFunding).Text('f', 6), WeiToEther(requiredBalance).Text('f', 6), new(big.Int).Div(freeBalance, addrFunding).Int64(), - rooKeyBuffer) + rootKeyBuffer) } bd := &FundingDetails{ From 3673682f24ae079d069888cdbc66f173bca29a92 Mon Sep 17 00:00:00 2001 From: Sebastian Wojas Date: Tue, 21 Jul 2026 13:51:28 +0200 Subject: [PATCH 2/2] Apply suggested fix to seth/util.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- seth/util.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/seth/util.go b/seth/util.go index 32fe57e5a..24a89414e 100644 --- a/seth/util.go +++ b/seth/util.go @@ -47,7 +47,7 @@ func NewEphemeralKeys(addrs int64) ([]string, error) { } // CalculateSubKeyFunding calculates all required params to split funds from the root key to N test keys -func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rooKeyBuffer int64) (*FundingDetails, error) { +func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rootKeyBuffer int64) (*FundingDetails, error) { if err := m.validateAddressesKeyNum(0); err != nil { return nil, err } @@ -68,14 +68,14 @@ func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rooKeyBuffer int64) (*F networkTransferFee := gasPrice * gasLimit totalFee := new(big.Int).Mul(big.NewInt(networkTransferFee), big.NewInt(addrs)) - rootKeyBuffer := new(big.Int).Mul(big.NewInt(rooKeyBuffer), big.NewInt(1_000_000_000_000_000_000)) - freeBalance := new(big.Int).Sub(balance, big.NewInt(0).Add(totalFee, rootKeyBuffer)) + rootKeyBufferWei := new(big.Int).Mul(big.NewInt(rootKeyBuffer), big.NewInt(1_000_000_000_000_000_000)) + freeBalance := new(big.Int).Sub(balance, big.NewInt(0).Add(totalFee, rootKeyBufferWei)) L.Info(). Str("Balance (wei/ether)", fmt.Sprintf("%s/%s", balance.String(), WeiToEther(balance).Text('f', -1))). Str("Total fee (wei/ether)", fmt.Sprintf("%s/%s", totalFee.String(), WeiToEther(totalFee).Text('f', -1))). Str("Free Balance (wei/ether)", fmt.Sprintf("%s/%s", freeBalance.String(), WeiToEther(freeBalance).Text('f', -1))). - Str("Buffer (wei/ether)", fmt.Sprintf("%s/%s", rootKeyBuffer.String(), WeiToEther(rootKeyBuffer).Text('f', -1))). + Str("Buffer (wei/ether)", fmt.Sprintf("%s/%s", rootKeyBufferWei.String(), WeiToEther(rootKeyBufferWei).Text('f', -1))). Msg("Root key balance") if freeBalance.Cmp(big.NewInt(0)) < 0 { @@ -88,9 +88,9 @@ func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rooKeyBuffer int64) (*F " 2. Reduce number of ephemeral keys (current: %d)\n"+ " 3. Lower root_key_funds_buffer in config (current: %d ETH)", balance.String(), WeiToEther(balance).Text('f', 6), - new(big.Int).Add(totalFee, rootKeyBuffer).String(), WeiToEther(new(big.Int).Add(totalFee, rootKeyBuffer)).Text('f', 6), + new(big.Int).Add(totalFee, rootKeyBufferWei).String(), WeiToEther(new(big.Int).Add(totalFee, rootKeyBufferWei)).Text('f', 6), new(big.Int).Abs(freeBalance).String(), WeiToEther(new(big.Int).Abs(freeBalance)).Text('f', 6), - addrs, rooKeyBuffer) + addrs, rootKeyBuffer) } addrFunding := new(big.Int).Div(freeBalance, big.NewInt(addrs))