From 1e31c0a11d01bb20203a464ee51585def50c03b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sat, 31 Aug 2024 21:23:01 +0200 Subject: [PATCH 01/44] Version 0.8 refactoring --- README.md | 2 + crypto/crypto.go | 8 +- crypto/ecdsa.go | 46 +- crypto/ecdsa_test.go | 156 ++-- crypto/transaction.go | 109 --- crypto/transaction_test.go | 137 --- rpc/client.go | 497 +++++++---- rpc/hijack_address.go | 71 ++ rpc/hijack_address_test.go | 89 ++ rpc/hijack_chainid.go | 59 ++ rpc/hijack_chainid_test.go | 133 +++ rpc/hijack_error.go | 12 + rpc/hijack_gasfee.go | 165 ++++ rpc/hijack_gasfee_test.go | 128 +++ rpc/hijack_gaslimit.go | 71 ++ rpc/hijack_gaslimit_test.go | 107 +++ rpc/hijack_nonce.go | 76 ++ rpc/hijack_nonce_test.go | 111 +++ rpc/hijack_sign.go | 147 ++++ rpc/hijack_sign_test.go | 120 +++ rpc/hijack_simulate.go | 96 +++ rpc/hijack_simulate_test.go | 138 +++ rpc/hijack_util.go | 92 ++ rpc/methods_client.go | 71 ++ rpc/methods_client_test.go | 148 ++++ rpc/methods_common.go | 380 +++++++++ rpc/methods_common_test.go | 1269 ++++++++++++++++++++++++++++ rpc/methods_filter.go | 80 ++ rpc/methods_filter_test.go | 64 ++ rpc/methods_privatetransactions.go | 29 + rpc/methods_wallet.go | 67 ++ rpc/mocks_test.go | 12 +- rpc/rpc.go | 91 +- rpc/transport/hijack.go | 131 +++ rpc/transport/http.go | 3 + rpc/util.go | 49 +- types/call.go | 10 + types/call_accesslist.go | 76 ++ types/call_dynamicfee.go | 83 ++ types/call_legacy.go | 71 ++ types/embed.go | 197 +++++ types/structs.go | 767 ++--------------- types/structs_test.go | 195 ++--- types/tx.go | 64 ++ types/tx_accesslist.go | 300 +++++++ types/tx_accesslist_test.go | 134 +++ types/tx_decoder.go | 146 ++++ types/tx_decoder_test.go | 364 ++++++++ types/tx_dynamicfee.go | 322 +++++++ types/tx_dynamicfee_test.go | 137 +++ types/tx_legacy.go | 275 ++++++ types/tx_legacy_test.go | 147 ++++ types/tx_test.go | 32 + types/types.go | 4 +- types/types_test.go | 9 - types/units.go | 7 + types/util.go | 58 ++ types/util_test.go | 17 + wallet/key.go | 2 +- wallet/key_priv.go | 2 +- wallet/key_rpc.go | 22 +- 61 files changed, 6924 insertions(+), 1481 deletions(-) delete mode 100644 crypto/transaction.go delete mode 100644 crypto/transaction_test.go create mode 100644 rpc/hijack_address.go create mode 100644 rpc/hijack_address_test.go create mode 100644 rpc/hijack_chainid.go create mode 100644 rpc/hijack_chainid_test.go create mode 100644 rpc/hijack_error.go create mode 100644 rpc/hijack_gasfee.go create mode 100644 rpc/hijack_gasfee_test.go create mode 100644 rpc/hijack_gaslimit.go create mode 100644 rpc/hijack_gaslimit_test.go create mode 100644 rpc/hijack_nonce.go create mode 100644 rpc/hijack_nonce_test.go create mode 100644 rpc/hijack_sign.go create mode 100644 rpc/hijack_sign_test.go create mode 100644 rpc/hijack_simulate.go create mode 100644 rpc/hijack_simulate_test.go create mode 100644 rpc/hijack_util.go create mode 100644 rpc/methods_client.go create mode 100644 rpc/methods_client_test.go create mode 100644 rpc/methods_common.go create mode 100644 rpc/methods_common_test.go create mode 100644 rpc/methods_filter.go create mode 100644 rpc/methods_filter_test.go create mode 100644 rpc/methods_privatetransactions.go create mode 100644 rpc/methods_wallet.go create mode 100644 rpc/transport/hijack.go create mode 100644 types/call.go create mode 100644 types/call_accesslist.go create mode 100644 types/call_dynamicfee.go create mode 100644 types/call_legacy.go create mode 100644 types/embed.go create mode 100644 types/tx.go create mode 100644 types/tx_accesslist.go create mode 100644 types/tx_accesslist_test.go create mode 100644 types/tx_decoder.go create mode 100644 types/tx_decoder_test.go create mode 100644 types/tx_dynamicfee.go create mode 100644 types/tx_dynamicfee_test.go create mode 100644 types/tx_legacy.go create mode 100644 types/tx_legacy_test.go create mode 100644 types/tx_test.go create mode 100644 types/units.go create mode 100644 types/util_test.go diff --git a/README.md b/README.md index 26e124a..654e211 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![Run Tests](https://github.com/defiweb/go-eth/actions/workflows/test.yml/badge.svg)](https://github.com/defiweb/go-eth/actions/workflows/test.yml) +**README IS OUTDATED ON THIS BRANCH** + # go-eth This library is a Go package designed to interact with the Ethereum blockchain. This package provides robust tools for diff --git a/crypto/crypto.go b/crypto/crypto.go index 6c9283d..4b663c7 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -16,7 +16,7 @@ type Signer interface { SignMessage(data []byte) (*types.Signature, error) // SignTransaction signs a transaction. - SignTransaction(tx *types.Transaction) error + SignTransaction(tx types.Transaction) error } // Recoverer is an interface for recovering addresses from signatures. @@ -28,7 +28,7 @@ type Recoverer interface { RecoverMessage(data []byte, sig types.Signature) (*types.Address, error) // RecoverTransaction recovers the address from a transaction. - RecoverTransaction(tx *types.Transaction) (*types.Address, error) + RecoverTransaction(tx types.Transaction) (*types.Address, error) } // AddMessagePrefix adds the Ethereum message prefix to the given data as @@ -56,7 +56,7 @@ func (s *ecSigner) SignMessage(data []byte) (*types.Signature, error) { return ecSignMessage(s.key, data) } -func (s *ecSigner) SignTransaction(tx *types.Transaction) error { +func (s *ecSigner) SignTransaction(tx types.Transaction) error { return ecSignTransaction(s.key, tx) } @@ -68,6 +68,6 @@ func (r *ecRecoverer) RecoverMessage(data []byte, sig types.Signature) (*types.A return ecRecoverMessage(data, sig) } -func (r *ecRecoverer) RecoverTransaction(tx *types.Transaction) (*types.Address, error) { +func (r *ecRecoverer) RecoverTransaction(tx types.Transaction) (*types.Address, error) { return ecRecoverTransaction(tx) } diff --git a/crypto/ecdsa.go b/crypto/ecdsa.go index 032460e..9b6935e 100644 --- a/crypto/ecdsa.go +++ b/crypto/ecdsa.go @@ -56,15 +56,12 @@ func ecSignMessage(key *ecdsa.PrivateKey, data []byte) (*types.Signature, error) } // ecSignTransaction signs the given transaction with the given private key. -func ecSignTransaction(key *ecdsa.PrivateKey, tx *types.Transaction) error { +func ecSignTransaction(key *ecdsa.PrivateKey, tx types.Transaction) error { if key == nil { return fmt.Errorf("missing private key") } - from := ECPublicKeyToAddress(&key.PublicKey) - if tx.From != nil && *tx.From != from { - return fmt.Errorf("invalid signer address: %s", tx.From) - } - hash, err := signingHash(tx) + txd := tx.TransactionData() + hash, err := tx.CalculateSigningHash(Keccak256) if err != nil { return err } @@ -73,21 +70,18 @@ func ecSignTransaction(key *ecdsa.PrivateKey, tx *types.Transaction) error { return err } sv, sr, ss := sig.V, sig.R, sig.S - switch tx.Type { - case types.LegacyTxType: - if tx.ChainID != nil { - sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*tx.ChainID*2)) + if tx.Type() == types.LegacyTxType { + if txd.ChainID != nil { + sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*txd.ChainID*2)) sv = new(big.Int).Add(sv, big.NewInt(35)) } else { sv = new(big.Int).Add(sv, big.NewInt(27)) } - case types.AccessListTxType: - case types.DynamicFeeTxType: - default: - return fmt.Errorf("unsupported transaction type: %d", tx.Type) } - tx.From = &from - tx.Signature = types.SignatureFromVRSPtr(sv, sr, ss) + txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) + if cd, ok := tx.(types.HasCallData); ok { + cd.CallData().SetFrom(ECPublicKeyToAddress(&key.PublicKey)) + } return nil } @@ -128,19 +122,19 @@ func ecRecoverMessage(data []byte, sig types.Signature) (*types.Address, error) } // ecRecoverTransaction recovers the Ethereum address from the given transaction. -func ecRecoverTransaction(tx *types.Transaction) (*types.Address, error) { - if tx.Signature == nil { +func ecRecoverTransaction(tx types.Transaction) (*types.Address, error) { + txd := tx.TransactionData() + if txd.Signature == nil { return nil, fmt.Errorf("signature is missing") } - sig := *tx.Signature - switch tx.Type { - case types.LegacyTxType: - if tx.Signature.V.Cmp(big.NewInt(35)) >= 0 { + sig := *txd.Signature + if tx.Type() == types.LegacyTxType { + if sig.V.Cmp(big.NewInt(35)) >= 0 { x := new(big.Int).Sub(sig.V, big.NewInt(35)) // Derive the chain ID from the signature. chainID := new(big.Int).Div(x, big.NewInt(2)) - if tx.ChainID != nil && *tx.ChainID != chainID.Uint64() { + if txd.ChainID != nil && *txd.ChainID != chainID.Uint64() { return nil, fmt.Errorf("invalid chain ID: %d", chainID) } @@ -149,12 +143,8 @@ func ecRecoverTransaction(tx *types.Transaction) (*types.Address, error) { } else { sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) } - case types.AccessListTxType: - case types.DynamicFeeTxType: - default: - return nil, fmt.Errorf("unsupported transaction type: %d", tx.Type) } - hash, err := signingHash(tx) + hash, err := tx.CalculateSigningHash(Keccak256) if err != nil { return nil, err } diff --git a/crypto/ecdsa_test.go b/crypto/ecdsa_test.go index 1ea2b71..1b1417f 100644 --- a/crypto/ecdsa_test.go +++ b/crypto/ecdsa_test.go @@ -39,13 +39,12 @@ func Test_ecSignMessage(t *testing.T) { func Test_ecSignTransaction(t *testing.T) { t.Run("legacy", func(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := (&types.Transaction{}). - SetType(types.LegacyTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) err := ecSignTransaction(key.ToECDSA(), tx) require.NoError(t, err) @@ -55,14 +54,13 @@ func Test_ecSignTransaction(t *testing.T) { }) t.Run("legacy-eip155", func(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := (&types.Transaction{}). - SetType(types.LegacyTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetChainID(1337) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + tx.SetChainID(1337) err := ecSignTransaction(key.ToECDSA(), tx) require.NoError(t, err) @@ -72,13 +70,13 @@ func Test_ecSignTransaction(t *testing.T) { }) t.Run("access-list", func(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := (&types.Transaction{}). - SetType(types.AccessListTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)) + tx := types.NewTransactionAccessList() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) err := ecSignTransaction(key.ToECDSA(), tx) require.NoError(t, err) @@ -88,14 +86,14 @@ func Test_ecSignTransaction(t *testing.T) { }) t.Run("dynamic-fee", func(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := (&types.Transaction{}). - SetType(types.DynamicFeeTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetMaxFeePerGas(big.NewInt(20000000000)). - SetMaxPriorityFeePerGas(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)) + tx := types.NewTransactionDynamicFee() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetMaxFeePerGas(big.NewInt(20000000000)) + tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) err := ecSignTransaction(key.ToECDSA(), tx) require.NoError(t, err) @@ -135,74 +133,72 @@ func Test_ecRecoverMessage(t *testing.T) { func Test_ecRecoverTransaction(t *testing.T) { t.Run("legacy", func(t *testing.T) { - tx := (&types.Transaction{}). - SetType(types.LegacyTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("1b"), - hexutil.MustHexToBigInt("2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470"), - hexutil.MustHexToBigInt("615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537"), - )) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + tx.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("1b"), + hexutil.MustHexToBigInt("2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470"), + hexutil.MustHexToBigInt("615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537"), + )) addr, err := ecRecoverTransaction(tx) require.NoError(t, err) assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) }) t.Run("legacy-eip155", func(t *testing.T) { - tx := (&types.Transaction{}). - SetType(types.LegacyTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetChainID(1337). - SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("a95"), - hexutil.MustHexToBigInt("14702a15dd7739397f25e3902a0c2bf6989e93888201139aac2c67a8f33a2f3f"), - hexutil.MustHexToBigInt("4a10ba6cf47ace7e3c847e38583f5b1e1c7d8a862f4b43cd74480a03007363f7"), - )) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + tx.SetChainID(1337) + tx.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("a95"), + hexutil.MustHexToBigInt("14702a15dd7739397f25e3902a0c2bf6989e93888201139aac2c67a8f33a2f3f"), + hexutil.MustHexToBigInt("4a10ba6cf47ace7e3c847e38583f5b1e1c7d8a862f4b43cd74480a03007363f7"), + )) addr, err := ecRecoverTransaction(tx) require.NoError(t, err) assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) }) t.Run("access-list", func(t *testing.T) { - tx := (&types.Transaction{}). - SetType(types.AccessListTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("1"), - hexutil.MustHexToBigInt("dc1fcd0c6f56eddc8dbe70635690cce521276b8a6e167f8e57e4064db8a5738e"), - hexutil.MustHexToBigInt("2743f261c001ee472c9664258708eaf849fc85623ee337d2018d37fc6f397d8c"), - )) + tx := types.NewTransactionAccessList() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + tx.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("1"), + hexutil.MustHexToBigInt("dc1fcd0c6f56eddc8dbe70635690cce521276b8a6e167f8e57e4064db8a5738e"), + hexutil.MustHexToBigInt("2743f261c001ee472c9664258708eaf849fc85623ee337d2018d37fc6f397d8c"), + )) addr, err := ecRecoverTransaction(tx) require.NoError(t, err) assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) }) t.Run("dynamic-fee", func(t *testing.T) { - tx := (&types.Transaction{}). - SetType(types.DynamicFeeTxType). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetMaxFeePerGas(big.NewInt(20000000000)). - SetMaxPriorityFeePerGas(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("0"), - hexutil.MustHexToBigInt("62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152"), - hexutil.MustHexToBigInt("57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572"), - )) + tx := types.NewTransactionDynamicFee() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetMaxFeePerGas(big.NewInt(20000000000)) + tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + tx.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("0"), + hexutil.MustHexToBigInt("62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152"), + hexutil.MustHexToBigInt("57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572"), + )) addr, err := ecRecoverTransaction(tx) require.NoError(t, err) diff --git a/crypto/transaction.go b/crypto/transaction.go deleted file mode 100644 index 4cd9a4d..0000000 --- a/crypto/transaction.go +++ /dev/null @@ -1,109 +0,0 @@ -package crypto - -import ( - "fmt" - "math/big" - - "github.com/defiweb/go-rlp" - - "github.com/defiweb/go-eth/types" -) - -func signingHash(t *types.Transaction) (types.Hash, error) { - var ( - chainID = uint64(1) - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - accessList = (types.AccessList)(nil) - ) - if t.ChainID != nil { - chainID = *t.ChainID - } - if t.Nonce != nil { - nonce = *t.Nonce - } - if t.GasPrice != nil { - gasPrice = t.GasPrice - } - if t.GasLimit != nil { - gasLimit = *t.GasLimit - } - if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas - } - if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas - } - if t.To != nil { - to = t.To[:] - } - if t.Value != nil { - value = t.Value - } - if t.AccessList != nil { - accessList = t.AccessList - } - switch t.Type { - case types.LegacyTxType: - list := rlp.NewList( - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - ) - if t.ChainID != nil && *t.ChainID != 0 { - list.Append( - rlp.NewUint(chainID), - rlp.NewUint(0), - rlp.NewUint(0), - ) - } - bin, err := list.EncodeRLP() - if err != nil { - return types.Hash{}, err - } - return Keccak256(bin), nil - case types.AccessListTxType: - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - &t.AccessList, - ).EncodeRLP() - if err != nil { - return types.Hash{}, err - } - bin = append([]byte{byte(t.Type)}, bin...) - return Keccak256(bin), nil - case types.DynamicFeeTxType: - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - &accessList, - ).EncodeRLP() - if err != nil { - return types.Hash{}, err - } - bin = append([]byte{byte(t.Type)}, bin...) - return Keccak256(bin), nil - default: - return types.Hash{}, fmt.Errorf("invalid transaction type: %d", t.Type) - } -} diff --git a/crypto/transaction_test.go b/crypto/transaction_test.go deleted file mode 100644 index 5fe8017..0000000 --- a/crypto/transaction_test.go +++ /dev/null @@ -1,137 +0,0 @@ -package crypto - -import ( - "fmt" - "math/big" - "testing" - - "github.com/stretchr/testify/require" - - "github.com/defiweb/go-eth/types" -) - -func Test_singingHash(t1 *testing.T) { - tests := []struct { - tx *types.Transaction - want types.Hash - }{ - // Empty transaction: - { - tx: &types.Transaction{}, - want: types.MustHashFromHex("5460be86ce1e4ca0564b5761c6e7070d9f054b671f5404268335000806423d75", types.PadNone), - }, - // Legacy transaction: - { - tx: (&types.Transaction{}). - SetType(types.LegacyTxType). - SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetGasPrice(big.NewInt(1000000000)). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1), - want: types.MustHashFromHex("1efbe489013ac8c0dad2202f68ac12657471df8d80f70e0683ec07b0564a32ca", types.PadNone), - }, - // Access list transaction: - { - tx: (&types.Transaction{}). - SetType(types.AccessListTxType). - SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetGasPrice(big.NewInt(1000000000)). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetAccessList(types.AccessList{ - types.AccessTuple{ - Address: types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []types.Hash{ - types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), - types.MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), - }, - }, - }), - want: types.MustHashFromHex("71cba0039a020b7a524d7746b79bf6d1f8a521eb1a76715d00116ef1c0f56107", types.PadNone), - }, - // Dynamic fee transaction with access list: - { - tx: (&types.Transaction{}). - SetType(types.DynamicFeeTxType). - SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetMaxPriorityFeePerGas(big.NewInt(1000000000)). - SetMaxFeePerGas(big.NewInt(2000000000)). - SetAccessList(types.AccessList{ - types.AccessTuple{ - Address: types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []types.Hash{ - types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), - types.MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), - }, - }, - }), - want: types.MustHashFromHex("a66ab756479bfd56f29658a8a199319094e84711e8a2de073ec136ef5179c4c9", types.PadNone), - }, - // Dynamic fee transaction with no access list: - { - tx: (&types.Transaction{}). - SetType(types.DynamicFeeTxType). - SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetMaxPriorityFeePerGas(big.NewInt(1000000000)). - SetMaxFeePerGas(big.NewInt(2000000000)), - want: types.MustHashFromHex("c3266152306909bfe339f90fad4f73f958066860300b5a22b98ee6a1d629706c", types.PadNone), - }, - // Example from EIP-155: - { - tx: (&types.Transaction{}). - SetType(types.LegacyTxType). - SetChainID(1). - SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(types.SignatureFromVRS( - func() *big.Int { - v, _ := new(big.Int).SetString("37", 10) - return v - }(), - func() *big.Int { - v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) - return v - }(), - func() *big.Int { - v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) - return v - }(), - )), - want: types.MustHashFromHex("daf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53", types.PadNone), - }, - } - for n, tt := range tests { - t1.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - sh, err := signingHash(tt.tx) - require.NoError(t1, err) - require.Equal(t1, tt.want, sh) - }) - } -} diff --git a/rpc/client.go b/rpc/client.go index 5737513..5e569fe 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -1,227 +1,414 @@ package rpc import ( - "context" "fmt" + "math/big" + "reflect" + "sort" + "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" "github.com/defiweb/go-eth/wallet" ) -// Client allows to interact with the Ethereum node. +// Client is a default RPC client that provides access to the standard Ethereum +// JSON-RPC APIs. type Client struct { - baseClient - - keys map[types.Address]wallet.Key - defaultAddr *types.Address - txModifiers []TXModifier + MethodsCommon + MethodsFilter + MethodsWallet + MethodsClient } -type ClientOptions func(c *Client) error +type ClientOptionsContext struct { + Transport transport.Transport // Transport instance that will be passed to the client. + Decoder types.TransactionDecoder // Transaction decoder that will be passed to the client. + Custom map[string]any // Custom data that may be used by client options. +} -// TXModifier allows to modify the transaction before it is signed or sent to -// the node. -type TXModifier interface { - Modify(ctx context.Context, client RPC, tx *types.Transaction) error +type ClientOption interface { + Apply(cfg *ClientOptionsContext, client any) error + Order() int } -type TXModifierFunc func(ctx context.Context, client RPC, tx *types.Transaction) error +// WithTransport sets the transport for the client. +func WithTransport(t transport.Transport) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = t + return nil + }, + } +} -func (f TXModifierFunc) Modify(ctx context.Context, client RPC, tx *types.Transaction) error { - return f(ctx, client, tx) +// WithTransactionDecoder sets the transaction decoder for the client. +// The default decoder is types.DefaultTransactionDecoder. +// +// Using custom decoder allows to decode custom transaction types that may be +// present in some L2 implementations. +func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Decoder = decoder + return nil + }, + } } -// WithTransport sets the transport for the client. -func WithTransport(transport transport.Transport) ClientOptions { - return func(c *Client) error { - c.transport = transport - return nil +// WithPostHijackers adds hijackers that are applied after all other hijackers +// applied by the client. +func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{}) + return nil + }, + order: 100, } } -// WithKeys allows to set keys that will be used to sign data. -// It allows to emulate the behavior of the RPC methods that require a key. +// WithKeys allows to emulate the behavior of the RPC methods that require +// a private key to sign the data. // // The following methods are affected: // - Accounts - returns the addresses of the provided keys // - Sign - signs the data with the provided key -// - SignTransaction - signs transaction with the provided key -// - SendTransaction - signs transaction with the provided key and sends it -// using SendRawTransaction -func WithKeys(keys ...wallet.Key) ClientOptions { - return func(c *Client) error { - for _, k := range keys { - c.keys[k.Address()] = k - } - return nil +// - SignTransaction - signs transaction +// - SendTransaction - signs transaction and sends it using SendRawTransaction +// +// This option will modify the provided transaction instance. +func WithKeys(keys ...wallet.Key) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackSign{keys: keys}) + return nil + }, + order: 200, } } -// WithDefaultAddress sets the call "from" address if it is not set in the -// following methods: -// - SignTransaction -// - SendTransaction -// - Call -// - EstimateGas -func WithDefaultAddress(addr types.Address) ClientOptions { - return func(c *Client) error { - c.defaultAddr = &addr - return nil +// WithSimulate simulates the transaction, by calling eth_call with the same +// parameters before sending the transaction. +// +// It works with eth_sendTransaction, eth_sendRawTransaction, and +// eth_sendPrivateTransaction methods. +func WithSimulate() ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{}) + return nil + }, + order: 300, } } -// WithTXModifiers allows to modify the transaction before it is signed and -// sent to the node. +type NonceOptions struct { + UsePendingBlock bool // UsePendingBlock indicates whether to use the pending block. + Replace bool // Replace is true if the nonce should be replaced even if it is already set. +} + +// WithNonce sets the nonce in the transaction. // -// Modifiers will be applied in the order they are provided. -func WithTXModifiers(modifiers ...TXModifier) ClientOptions { - return func(c *Client) error { - c.txModifiers = append(c.txModifiers, modifiers...) - return nil +// This option will modify the provided transaction instance. +func WithNonce(opts NonceOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackNonce{ + usePendingBlock: opts.UsePendingBlock, + replace: opts.Replace, + }) + return nil + }, + order: 400, } } -// NewClient creates a new RPC client. -// The WithTransport option is required. -func NewClient(opts ...ClientOptions) (*Client, error) { - c := &Client{keys: make(map[types.Address]wallet.Key)} - for _, opt := range opts { - if err := opt(c); err != nil { - return nil, err - } - } - if c.transport == nil { - return nil, fmt.Errorf("rpc client: transport is required") - } - return c, nil +type LegacyGasFeeOptions struct { + Multiplier float64 // Multiplier is applied to the gas price. + MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. + MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. + Replace bool // Replace is true if the gas price should be replaced even if it is already set. + AllowChangeType bool // AllowChangeType is true if the transaction type can be changed if it does not support legacy price data. } -// Accounts implements the RPC interface. -func (c *Client) Accounts(ctx context.Context) ([]types.Address, error) { - if len(c.keys) > 0 { - var res []types.Address - for _, key := range c.keys { - res = append(res, key.Address()) - } - return res, nil +// WithLegacyGasFee estimates the gas price and sets it in the transaction. +// +// It only works with eth_sendTransaction method, raw transactions are not supported. +// +// This option will modify the provided transaction instance. +func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + if opts.Multiplier == 0 { + return fmt.Errorf("rpc client: gas price multiplier must be greater than 0") + } + ctx.Transport = addHijacker(ctx.Transport, &hijackLegacyGasFee{ + multiplier: opts.Multiplier, + minGasPrice: opts.MinGasPrice, + maxGasPrice: opts.MaxGasPrice, + replace: opts.Replace, + allowChangeType: opts.AllowChangeType, + }) + return nil + }, + order: 500, } - return c.baseClient.Accounts(ctx) } -// Sign implements the RPC interface. -func (c *Client) Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) { - if len(c.keys) == 0 { - return c.baseClient.Sign(ctx, account, data) +type DynamicGasFeeOptions struct { + GasPriceMultiplier float64 // GasPriceMultiplier is applied to the gas price. + PriorityFeePerGasMultiplier float64 // PriorityFeePerGasMultiplier is applied to the priority fee per gas. + MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. + MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. + MinPriorityFeePerGas *big.Int // MinPriorityFeePerGas is the minimum priority fee per gas, or nil if there is no lower bound. + MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas, or nil if there is no upper bound. + Replace bool // Replace is true if the gas price should be replaced even if it is already set. + AllowChangeType bool // AllowChangeType is true if the transaction type can be changed if it does not support dynamic price data. +} + +// WithDynamicGasFee estimates the gas price and sets it in the transaction. +// +// It only works with eth_sendTransaction method, raw transactions are not supported. +// +// This option will modify the provided transaction instance. +func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + if opts.GasPriceMultiplier == 0 || opts.PriorityFeePerGasMultiplier == 0 { + return fmt.Errorf("rpc client: gas price and priority fee multipliers must be greater than 0") + } + ctx.Transport = addHijacker(ctx.Transport, &hijackDynamicGasFee{ + gasPriceMultiplier: opts.GasPriceMultiplier, + priorityFeePerGasMultiplier: opts.PriorityFeePerGasMultiplier, + minGasPrice: opts.MinGasPrice, + maxGasPrice: opts.MaxGasPrice, + minPriorityFeePerGas: opts.MinPriorityFeePerGas, + maxPriorityFeePerGas: opts.MaxPriorityFeePerGas, + replace: opts.Replace, + allowChangeType: opts.AllowChangeType, + }) + return nil + }, + order: 600, } - if key := c.findKey(&account); key != nil { - return key.SignMessage(ctx, data) +} + +type GasLimitOptions struct { + Multiplier float64 // Multiplier is applied to the gas limit. + MinGas uint64 // MinGas is the minimum gas limit, or 0 if there is no lower bound. + MaxGas uint64 // MaxGas is the maximum gas limit, or 0 if there is no upper bound. + Replace bool // Replace is true if the gas limit should be replaced even if it is already set. +} + +// WithGasLimit estimates the gas limit and sets it in the transaction. +// +// This option will modify the provided transaction instance. +func WithGasLimit(opts GasLimitOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + if opts.Multiplier == 0 { + return fmt.Errorf("rpc client: gas limit multiplier must be greater than 0") + } + ctx.Transport = addHijacker(ctx.Transport, &hijackGasLimit{ + multiplier: opts.Multiplier, + minGas: opts.MinGas, + maxGas: opts.MaxGas, + replace: opts.Replace, + }) + return nil + }, + order: 700, } - return nil, fmt.Errorf("rpc client: no key found for address %s", account) } -// SignTransaction implements the RPC interface. -func (c *Client) SignTransaction(ctx context.Context, tx *types.Transaction) ([]byte, *types.Transaction, error) { - tx, err := c.PrepareTransaction(ctx, tx) - if err != nil { - return nil, nil, err +type AddressOptions struct { + Address types.Address // Address is the default address to use. + Replace bool // Replace is true if the address should be replaced even if it is already set. +} + +// WithDefaultAddress sets the default address for calls and transactions. +// +// To send a call with to a zero address, it must be set explicitly in the call. +// +// This option will modify the provided transaction and call instances. +func WithDefaultAddress(opts AddressOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackAddress{ + address: opts.Address, + replace: opts.Replace, + }) + return nil + }, + order: 800, } - if len(c.keys) == 0 { - return c.baseClient.SignTransaction(ctx, tx) +} + +type ChainIDOptions struct { + ChainID uint64 // ChainID is the chain ID to use. If 0, then value is fetched from the node. + Replace bool // Replace is true if the chain ID should be replaced even if it is already set. +} + +// WithChainID sets the chain ID in the transaction. +// It only works with eth_sendTransaction method. +// +// This option will modify the provided transaction instance. +func WithChainID(opts ChainIDOptions) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackChainID{ + chainID: opts.ChainID, + replace: opts.Replace, + }) + return nil + }, + order: 900, } - if key := c.findKey(tx.Call.From); key != nil { - if err := key.SignTransaction(ctx, tx); err != nil { - return nil, nil, err - } - raw, err := tx.Raw() - if err != nil { - return nil, nil, err - } - return raw, tx, nil +} + +// WithPreHijackers adds hijackers that are applied before any other hijackers +// applied by the client. +func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { + return &option{ + apply: func(ctx *ClientOptionsContext, _ any) error { + ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{recoverer: crypto.ECRecoverer}) + return nil + }, + order: 1000, } - return nil, nil, fmt.Errorf("rpc client: no key found for address %s", tx.Call.From) } -// SendTransaction implements the RPC interface. -func (c *Client) SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, *types.Transaction, error) { - tx, err := c.PrepareTransaction(ctx, tx) - if err != nil { - return nil, nil, err +type ClientOptions func(c *ClientOptionsContext, client any) error + +// NewClient creates a new RPC client. +// +// The WithTransport option is required. +func NewClient(opts ...ClientOption) (*Client, error) { + ctx := &ClientOptionsContext{} + client := &Client{} + if err := applyOptions(ctx, opts); err != nil { + return nil, fmt.Errorf("rpc client: option error: %w", err) } - if len(c.keys) == 0 { - return c.baseClient.SendTransaction(ctx, tx) + if ctx.Decoder == nil { + ctx.Decoder = types.DefaultTransactionDecoder } - if key := c.findKey(tx.Call.From); key != nil { - if err := key.SignTransaction(ctx, tx); err != nil { - return nil, nil, err - } - raw, err := tx.Raw() - if err != nil { - return nil, nil, err - } - txHash, err := c.SendRawTransaction(ctx, raw) - if err != nil { - return nil, nil, err - } - return txHash, tx, nil + if ctx.Transport == nil { + return nil, fmt.Errorf("rpc client: transport is required") } - return nil, nil, fmt.Errorf("rpc client: no key found for address %s", tx.Call.From) + client.MethodsCommon.Transport = ctx.Transport + client.MethodsFilter.Transport = ctx.Transport + client.MethodsWallet.Transport = ctx.Transport + client.MethodsClient.Transport = ctx.Transport + client.MethodsCommon.Decoder = ctx.Decoder + return client, nil } -// PrepareTransaction prepares the transaction by applying transaction -// modifiers and setting the default address if it is not set. +// NewCustomClient returns a new custom client. A custom client may implement +// additional methods that are not part of the standard client. // -// A copy of the modified transaction is returned. -func (c *Client) PrepareTransaction(ctx context.Context, tx *types.Transaction) (*types.Transaction, error) { - if tx == nil { - return nil, fmt.Errorf("rpc client: transaction is nil") +// The WithTransport option is required. +// +// This method automatically initializes the client fields that are nil +// and recursively sets the all fields that are of the transport.Transport or +// types.TransactionDecoder types. +func NewCustomClient[T any](opts ...ClientOption) (*T, error) { + ctx := &ClientOptionsContext{} + client := new(T) + if err := applyOptions(ctx, opts); err != nil { + return nil, fmt.Errorf("rpc client: option error: %w", err) } - txCpy := tx.Copy() - if txCpy.Call.From == nil && c.defaultAddr != nil { - defaultAddr := *c.defaultAddr - txCpy.Call.From = &defaultAddr + if ctx.Decoder == nil { + ctx.Decoder = types.DefaultTransactionDecoder + } + if ctx.Transport == nil { + return nil, fmt.Errorf("rpc client: transport is required") } - for _, modifier := range c.txModifiers { - if err := modifier.Modify(ctx, c, txCpy); err != nil { - return nil, err + setFields(ctx, reflect.ValueOf(client)) + return client, nil +} + +type option struct { + apply func(*ClientOptionsContext, any) error + order int +} + +func (o *option) Apply(ctx *ClientOptionsContext, client any) error { + return o.apply(ctx, client) +} + +func (o *option) Order() int { + return o.order +} + +func applyOptions(c *ClientOptionsContext, opts []ClientOption) error { + sort.Slice(opts, func(i, j int) bool { + return opts[i].Order() < opts[j].Order() + }) + for _, opt := range opts { + if err := opt.Apply(c, nil); err != nil { + return err } } - return txCpy, nil + return nil } -// Call implements the RPC interface. -func (c *Client) Call(ctx context.Context, call *types.Call, block types.BlockNumber) ([]byte, *types.Call, error) { - if call == nil { - return nil, nil, fmt.Errorf("rpc client: call is nil") +func setFields(ctx *ClientOptionsContext, r reflect.Value) { + for r.Kind() == reflect.Ptr || r.Kind() == reflect.Interface { + r = r.Elem() } - callCpy := call.Copy() - if callCpy.From == nil && c.defaultAddr != nil { - defaultAddr := *c.defaultAddr - callCpy.From = &defaultAddr + if r.Kind() != reflect.Struct { + return + } + for n := 0; n < r.NumField(); n++ { + f := r.Field(n) + if !f.CanInterface() { + continue + } + t := f.Type() + switch { + case t == transportTy: + if f.CanSet() { + f.Set(reflect.ValueOf(ctx.Transport)) + } + case t == decoderTy: + if f.CanSet() { + f.Set(reflect.ValueOf(ctx.Decoder)) + } + default: + if initPtr(f) { + setFields(ctx, f) + } + } } - return c.baseClient.Call(ctx, callCpy, block) } -// EstimateGas implements the RPC interface. -func (c *Client) EstimateGas(ctx context.Context, call *types.Call, block types.BlockNumber) (uint64, *types.Call, error) { - if call == nil { - return 0, nil, fmt.Errorf("rpc client: call is nil") +func initPtr(r reflect.Value) bool { + if !r.CanInterface() { + return false + } + if r.Kind() != reflect.Ptr { + return true + } + if !r.IsNil() { + return true } - callCpy := call.Copy() - if callCpy.From == nil && c.defaultAddr != nil { - defaultAddr := *c.defaultAddr - callCpy.From = &defaultAddr + if r.CanSet() { + r.Set(reflect.New(r.Type().Elem())) + return true } - return c.baseClient.EstimateGas(ctx, callCpy, block) + return false } -// findKey finds a key by address. -func (c *Client) findKey(addr *types.Address) wallet.Key { - if addr == nil { - return nil +func addHijacker(t transport.Transport, hijackers ...transport.Hijacker) transport.Transport { + if h, ok := t.(*transport.Hijack); ok { + h.Use(hijackers...) + return h } - if key, ok := c.keys[*addr]; ok { - return key - } - return nil + return transport.NewHijacker(t, hijackers...) } + +var ( + transportTy = reflect.TypeOf((*transport.Transport)(nil)).Elem() + decoderTy = reflect.TypeOf((*types.TransactionDecoder)(nil)).Elem() +) diff --git a/rpc/hijack_address.go b/rpc/hijack_address.go new file mode 100644 index 0000000..9b38ba3 --- /dev/null +++ b/rpc/hijack_address.go @@ -0,0 +1,71 @@ +package rpc + +import ( + "context" + "fmt" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackAddress hijacks "eth_sendTransaction" and "eth_call" methods and +// sets the "from" field. +type hijackAddress struct { + address types.Address + replace bool +} + +func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + var cd *types.EmbedCallData + switch method { + case "eth_sendTransaction": + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "address", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Get transaction call data: + if tx, ok := tx.(types.HasCallData); ok { + cd = tx.CallData() + } + case "eth_call", "eth_estimateGas": + // Verify arguments: + c, ok := args[0].(types.Call) + if !ok { + return &ErrHijackFailed{name: "address", err: fmt.Errorf("invalid call type: %T", args[0])} + } + + // Get call data: + if c, ok := c.(types.HasCallData); ok { + cd = c.CallData() + } + default: + return next(ctx, t, result, method, args...) + } + + // If call data is nil or the "from" field is already set, continue: + if cd == nil || (h.replace && cd.From != nil) { + return next(ctx, t, result, method, args...) + } + + // Update the "from" field and continue: + cd.From = &h.address + return next(ctx, t, result, method, args...) + } + } +} + +func (h *hijackAddress) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (h *hijackAddress) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/hijack_address_test.go b/rpc/hijack_address_test.go new file mode 100644 index 0000000..b1b8148 --- /dev/null +++ b/rpc/hijack_address_test.go @@ -0,0 +1,89 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +func TestHijackAddress(t *testing.T) { + tt := []struct { + name string + chainID *hijackAddress + method string + args []any + request []string + response []string + }{ + { + name: "set address", + chainID: &hijackAddress{replace: false, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetFrom(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + { + name: "replace address", + chainID: &hijackAddress{replace: true, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetFrom(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x2222222222222222222222222222222222222222"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, tc.chainID) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_chainid.go b/rpc/hijack_chainid.go new file mode 100644 index 0000000..f5f5ed0 --- /dev/null +++ b/rpc/hijack_chainid.go @@ -0,0 +1,59 @@ +package rpc + +import ( + "context" + "fmt" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackChainID hijacks "eth_sendTransaction" method and sets the "chainID" +// field. +type hijackChainID struct { + chainID uint64 + replace bool +} + +func (c *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + chainID := c.chainID + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if method != "eth_sendTransaction" || len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Get the transaction data: + txd := tx.TransactionData() + if !c.replace && txd.ChainID != nil { + return next(ctx, t, result, method, args...) + } + + // Get the chain ID from the RPC node: + if chainID == 0 { + chainID, err = (&MethodsCommon{Transport: t}).ChainID(ctx) + if err != nil { + return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("failed to get chain ID: %w", err)} + } + } + + // Update the "chainID" field and continue: + txd.ChainID = &chainID + return next(ctx, t, result, method, args...) + } + } +} + +func (c *hijackChainID) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (c *hijackChainID) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/hijack_chainid_test.go b/rpc/hijack_chainid_test.go new file mode 100644 index 0000000..4c85ff1 --- /dev/null +++ b/rpc/hijack_chainid_test.go @@ -0,0 +1,133 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +const mockHijackChainIDCallValidResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x01" + } +` + +const mockHijackChainIDSendTransactionValidResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111111111111111111111111111" + } +` + +func TestHijackChainID(t *testing.T) { + tt := []struct { + name string + chainID *hijackChainID + method string + args []any + request []string + response []*http.Response + }{ + { + name: "set chainID", + chainID: &hijackChainID{}, + method: "eth_sendTransaction", + args: []any{types.NewTransactionAccessList()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId": "0x1"}]}`, + }, + response: []*http.Response{ + { + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDCallValidResponse)), + }, + { + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), + }, + }, + }, + { + name: "do not replace chainID", + chainID: &hijackChainID{replace: false}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetChainID(2) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"chainId": "0x2"}]}`, + }, + response: []*http.Response{ + { + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), + }, + }, + }, + { + name: "replace chainID", + chainID: &hijackChainID{replace: true}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetChainID(2) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId": "0x1"}]}`, + }, + response: []*http.Response{ + { + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDCallValidResponse)), + }, + { + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), + }, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return res, nil + } + hijacker := transport.NewHijacker(httpMock, tc.chainID) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_error.go b/rpc/hijack_error.go new file mode 100644 index 0000000..7484681 --- /dev/null +++ b/rpc/hijack_error.go @@ -0,0 +1,12 @@ +package rpc + +import "fmt" + +type ErrHijackFailed struct { + name string + err error +} + +func (e *ErrHijackFailed) Name() string { return e.name } +func (e *ErrHijackFailed) Error() string { return fmt.Sprintf("%s hijacker failed: %v", e.name, e.err) } +func (e *ErrHijackFailed) Unwrap() error { return e.err } diff --git a/rpc/hijack_gasfee.go b/rpc/hijack_gasfee.go new file mode 100644 index 0000000..7388bf2 --- /dev/null +++ b/rpc/hijack_gasfee.go @@ -0,0 +1,165 @@ +package rpc + +import ( + "context" + "fmt" + "math/big" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackLegacyGasFee hijacks "eth_sendTransaction" method and sets the +// "gasPrice" field using the estimate provided by the RPC node. +type hijackLegacyGasFee struct { + multiplier float64 + minGasPrice *big.Int + maxGasPrice *big.Int + replace bool + allowChangeType bool +} + +func (h *hijackLegacyGasFee) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if method != "eth_sendTransaction" || len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Change transaction type if needed: + if h.allowChangeType { + tx = convertTXToLegacyPrice(tx) + args[0] = tx + } + + // Get legacy price data: + lpd := getLegacyPriceData(tx) + if lpd == nil { + return next(ctx, t, result, method, args...) + } + + // Skip if already set: + if !h.replace && lpd.GasPrice != nil { + return next(ctx, t, result, method, args...) + } + + // Get gas price from RPC node: + gasPrice, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + if err != nil { + return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("failed to get gas price: %w", err)} + } + + // Update gas price and continue: + gasPrice, _ = new(big.Float).Mul(new(big.Float).SetInt(gasPrice), big.NewFloat(h.multiplier)).Int(nil) + if h.minGasPrice != nil && gasPrice.Cmp(h.minGasPrice) < 0 { + gasPrice = h.minGasPrice + } + if h.maxGasPrice != nil && gasPrice.Cmp(h.maxGasPrice) > 0 { + gasPrice = h.maxGasPrice + } + lpd.GasPrice = gasPrice + return next(ctx, t, result, method, args...) + } + } +} + +func (h *hijackLegacyGasFee) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (h *hijackLegacyGasFee) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} + +// hijackDynamicGasFee hijacks "eth_sendTransaction" method and sets the +// "maxFeePerGas" and "maxPriorityFeePerGas" fields using the estimate provided +// by the RPC node. +type hijackDynamicGasFee struct { + gasPriceMultiplier float64 + priorityFeePerGasMultiplier float64 + minGasPrice *big.Int + maxGasPrice *big.Int + minPriorityFeePerGas *big.Int + maxPriorityFeePerGas *big.Int + replace bool + allowChangeType bool +} + +func (h *hijackDynamicGasFee) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if method != "eth_sendTransaction" || len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Change transaction type if needed: + if h.allowChangeType { + tx = convertTXToDynamicFee(tx) + args[0] = tx + } + + // Get dynamic fee data: + dfd := getDynamicFeeData(tx) + if dfd == nil { + return next(ctx, t, result, method, args...) + } + + // Skip if already set: + if !h.replace && dfd.MaxFeePerGas != nil && dfd.MaxPriorityFeePerGas != nil { + return next(ctx, t, result, method, args...) + } + + // Get gas price from RPC node: + maxFeePerGas, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + if err != nil { + return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get gas price: %w", err)} + } + priorityFeePerGas, err := (&MethodsCommon{Transport: t}).MaxPriorityFeePerGas(ctx) + if err != nil { + return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get priority fee per gas: %w", err)} + } + + // Update gas price and continue: + maxFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(maxFeePerGas), big.NewFloat(h.gasPriceMultiplier)).Int(nil) + priorityFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(priorityFeePerGas), big.NewFloat(h.priorityFeePerGasMultiplier)).Int(nil) + if h.minGasPrice != nil && maxFeePerGas.Cmp(h.minGasPrice) < 0 { + maxFeePerGas = h.minGasPrice + } + if h.maxGasPrice != nil && maxFeePerGas.Cmp(h.maxGasPrice) > 0 { + maxFeePerGas = h.maxGasPrice + } + if h.minPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.minPriorityFeePerGas) < 0 { + priorityFeePerGas = h.minPriorityFeePerGas + } + if h.maxPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.maxPriorityFeePerGas) > 0 { + priorityFeePerGas = h.maxPriorityFeePerGas + } + if maxFeePerGas.Cmp(priorityFeePerGas) < 0 { + priorityFeePerGas = maxFeePerGas + } + dfd.MaxFeePerGas = maxFeePerGas + dfd.MaxPriorityFeePerGas = priorityFeePerGas + return next(ctx, t, result, method, args...) + } + } +} + +func (h *hijackDynamicGasFee) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (h *hijackDynamicGasFee) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/hijack_gasfee_test.go b/rpc/hijack_gasfee_test.go new file mode 100644 index 0000000..bcd1e12 --- /dev/null +++ b/rpc/hijack_gasfee_test.go @@ -0,0 +1,128 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +func TestHijackLegacyGasFee(t *testing.T) { + tt := []struct { + name string + gasLimit *hijackLegacyGasFee + method string + args []any + request []string + response []string + }{ + { + name: "set gas price", + gasLimit: &hijackLegacyGasFee{multiplier: 1.0}, + method: "eth_sendTransaction", + args: []any{types.NewTransactionLegacy()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"gasPrice":"0x1000"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1000"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, tc.gasLimit) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} + +func TestHijackDynamicGasFee(t *testing.T) { + tt := []struct { + name string + gasLimit *hijackDynamicGasFee + method string + args []any + request []string + response []string + }{ + { + name: "set gas price", + gasLimit: &hijackDynamicGasFee{gasPriceMultiplier: 1.0, priorityFeePerGasMultiplier: 1.0}, + method: "eth_sendTransaction", + args: []any{types.NewTransactionDynamicFee()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_maxPriorityFeePerGas","params":[]}`, + `{"jsonrpc":"2.0","id":3,"method":"eth_sendTransaction","params":[{"maxFeePerGas":"0x1000","maxPriorityFeePerGas":"0x100"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1000"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x100"}`, + `{"jsonrpc":"2.0","id":3,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, tc.gasLimit) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_gaslimit.go b/rpc/hijack_gaslimit.go new file mode 100644 index 0000000..49c64ce --- /dev/null +++ b/rpc/hijack_gaslimit.go @@ -0,0 +1,71 @@ +package rpc + +import ( + "context" + "fmt" + "math/big" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackGasLimit hijacks "eth_sendTransaction" method and sets the "gasLimit" +// field using the estimate provided by the RPC node. +type hijackGasLimit struct { + multiplier float64 + minGas uint64 + maxGas uint64 + replace bool +} + +func (c *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if method != "eth_sendTransaction" || len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Get transaction call data: + var txcd *types.EmbedCallData + if tx, ok := tx.(types.HasCallData); ok { + txcd = tx.CallData() + } + + // If the gas limit is already set, continue: + if !c.replace && txcd.GasLimit != nil { + return next(ctx, t, result, method, args...) + } + + // Get the gas estimate from the RPC node: + gasLimit, err := (&MethodsCommon{Transport: t}).EstimateGas(ctx, tx.Call(), types.LatestBlockNumber) + if err != nil { + return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("failed to estimate gas: %w", err)} + } + + // Update the gas limit and continue: + gasLimit, _ = new(big.Float).Mul(new(big.Float).SetUint64(gasLimit), big.NewFloat(c.multiplier)).Uint64() + if c.minGas > 0 && gasLimit < c.minGas { + gasLimit = c.minGas + } + if c.maxGas > 0 && gasLimit > c.maxGas { + gasLimit = c.maxGas + } + txcd.GasLimit = &gasLimit + return next(ctx, t, result, method, args...) + } + } +} + +func (c *hijackGasLimit) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (c *hijackGasLimit) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/hijack_gaslimit_test.go b/rpc/hijack_gaslimit_test.go new file mode 100644 index 0000000..a33a5c3 --- /dev/null +++ b/rpc/hijack_gaslimit_test.go @@ -0,0 +1,107 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +func TestHijackGasLimit(t *testing.T) { + tt := []struct { + name string + gasLimit *hijackGasLimit + method string + args []any + request []string + response []string + }{ + { + name: "set gas limit", + gasLimit: &hijackGasLimit{multiplier: 1.0}, + method: "eth_sendTransaction", + args: []any{types.NewTransactionAccessList()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{}, "latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"gas":"0x1000"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1000"}`, + `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + { + name: "do not replace gas limit", + gasLimit: &hijackGasLimit{multiplier: 1.0, replace: false}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetGasLimit(2) + tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111", "gas": "0x2"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + { + name: "replace gas limit", + gasLimit: &hijackGasLimit{multiplier: 1.0, replace: true}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetGasLimit(2) + tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_estimateGas","params":[{"from":"0x1111111111111111111111111111111111111111", "gas":"0x2"}, "latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111", "gas": "0x1"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x01"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, tc.gasLimit) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_nonce.go b/rpc/hijack_nonce.go new file mode 100644 index 0000000..f90dadc --- /dev/null +++ b/rpc/hijack_nonce.go @@ -0,0 +1,76 @@ +package rpc + +import ( + "context" + "fmt" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackNonce hijacks "eth_sendTransaction" method and sets the "nonce" +// field using the "eth_getTransactionCount" RPC method. +type hijackNonce struct { + usePendingBlock bool + replace bool +} + +func (c *hijackNonce) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if method != "eth_sendTransaction" || len(args) == 0 { + return next(ctx, t, result, method, args...) + } + + // Verify arguments: + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // If the nonce is already set, continue: + txd := tx.TransactionData() + if !c.replace && txd.Nonce != nil { + return next(ctx, t, result, method, args...) + } + + // Get transaction call data: + var txcd *types.EmbedCallData + if tx, ok := tx.(types.HasCallData); ok { + txcd = tx.CallData() + } + + // It is some strange transaction type with no call data, continue: + if txcd == nil { + return next(ctx, t, result, method, args...) + } + + // The "from" field must be set to obtain the nonce: + if txcd.From == nil { + return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("'from' field not set")} + } + + // Get the latest nonce: + block := types.LatestBlockNumber + if c.usePendingBlock { + block = types.PendingBlockNumber + } + nonce, err := (&MethodsCommon{Transport: t}).GetTransactionCount(ctx, *txcd.From, block) + if err != nil { + return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("failed to get transaction count: %w", err)} + } + + // Update the nonce and continue: + txd.Nonce = &nonce + return next(ctx, t, result, method, args...) + } + } +} + +func (c *hijackNonce) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (c *hijackNonce) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/hijack_nonce_test.go b/rpc/hijack_nonce_test.go new file mode 100644 index 0000000..67d3d65 --- /dev/null +++ b/rpc/hijack_nonce_test.go @@ -0,0 +1,111 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +func TestHijackNonce(t *testing.T) { + tt := []struct { + name string + nonce *hijackNonce + method string + args []any + request []string + response []string + }{ + { + name: "set nonce", + nonce: &hijackNonce{}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionCount","params":["0x1111111111111111111111111111111111111111","latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111", "nonce": "0x1"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x01"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + { + name: "do not replace nonce", + nonce: &hijackNonce{replace: false}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetNonce(2) + tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111", "nonce": "0x2"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + { + name: "replace nonce", + nonce: &hijackNonce{replace: true}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionAccessList() + tx.SetNonce(2) + tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) + return tx + }()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionCount","params":["0x1111111111111111111111111111111111111111","latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111", "nonce": "0x1"}]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x01"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, tc.nonce) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_sign.go b/rpc/hijack_sign.go new file mode 100644 index 0000000..93bc83b --- /dev/null +++ b/rpc/hijack_sign.go @@ -0,0 +1,147 @@ +package rpc + +import ( + "context" + "fmt" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" + "github.com/defiweb/go-eth/wallet" +) + +// hijackSign hijacks calls to the methods that require account access +// and simulates their behavior using the provided keys. +type hijackSign struct { + keys []wallet.Key +} + +func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) error { + switch { + case method == "eth_accounts": + accounts, ok := result.(*[]types.Address) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", args[0])} + } + k.hijackAccountsCall(accounts) + case method == "eth_sign" && len(args) == 2: + signature, ok := result.(*types.Signature) + if !ok { + return fmt.Errorf("invalid result type: %T", result) + } + account, ok := args[0].(types.Address) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", args[0])} + } + data, ok := args[1].([]byte) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid data type: %T", args[0])} + } + return k.hijackSignCall(ctx, signature, account, data) + case method == "eth_signTransaction" && len(args) == 1: + raw, ok := result.(*[]byte) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", result)} + } + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + return k.hijackSignTransactionCall(ctx, raw, tx) + case method == "eth_sendTransaction" && len(args) == 1: + hash, ok := result.(*types.Hash) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", args[0])} + } + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + return k.hijackSendTransactionCall(ctx, t, next, hash, tx) + default: + return next(ctx, t, result, method, args...) + } + return nil + } + } +} + +func (k *hijackSign) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (k *hijackSign) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} + +func (k *hijackSign) hijackAccountsCall(result *[]types.Address) { + *result = make([]types.Address, len(k.keys)) + for n, key := range k.keys { + (*result)[n] = key.Address() + } +} + +func (k *hijackSign) hijackSignCall(ctx context.Context, result *types.Signature, account types.Address, data []byte) error { + for _, key := range k.keys { + if key.Address() != account { + continue + } + signature, err := key.SignMessage(ctx, data) + if err != nil { + return err + } + *result = *signature + return nil + } + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", account)} +} + +func (k *hijackSign) hijackSignTransactionCall(ctx context.Context, result *[]byte, tx types.Transaction) error { + if len(k.keys) == 0 { + return fmt.Errorf("no keys found") + } + txcd := getCallData(tx) + if txcd.From == nil { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("'from' field not set")} + } + for _, key := range k.keys { + if key.Address() != *txcd.From { + continue + } + if err := key.SignTransaction(ctx, tx); err != nil { + return &ErrHijackFailed{name: "sign", err: err} + } + raw, err := tx.EncodeRLP() + if err != nil { + return &ErrHijackFailed{name: "sign", err: err} + } + *result = raw + return nil + } + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *txcd.From)} +} + +func (k *hijackSign) hijackSendTransactionCall(ctx context.Context, t transport.Transport, next transport.CallFunc, result *types.Hash, tx types.Transaction) error { + if len(k.keys) == 0 { + return fmt.Errorf("no keys found") + } + txcd := getCallData(tx) + if txcd.From == nil { + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("'from' field not set")} + } + for _, key := range k.keys { + if key.Address() != *txcd.From { + continue + } + if err := key.SignTransaction(ctx, tx); err != nil { + return &ErrHijackFailed{name: "sign", err: err} + } + raw, err := tx.EncodeRLP() + if err != nil { + return &ErrHijackFailed{name: "sign", err: err} + } + return next(ctx, t, result, "eth_sendRawTransaction", types.Bytes(raw)) + } + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *txcd.From)} +} diff --git a/rpc/hijack_sign_test.go b/rpc/hijack_sign_test.go new file mode 100644 index 0000000..00c7815 --- /dev/null +++ b/rpc/hijack_sign_test.go @@ -0,0 +1,120 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "reflect" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" + "github.com/defiweb/go-eth/wallet" +) + +func TestHijackSign(t *testing.T) { + key1 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x01")) // 0x7e5f4552091a69125d5dfcb7b8c2659029395bdf + key2 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x02")) // 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf + + tt := []struct { + name string + sign *hijackSign + method string + args []any + wantResult any + request []string + response []string + }{ + { + name: "accounts", + sign: &hijackSign{}, + method: "eth_accounts", + args: []any{}, + wantResult: []types.Address{ + key1.Address(), + key2.Address(), + }, + request: []string{}, + response: []string{}, + }, + { + name: "sign", + sign: &hijackSign{}, + method: "eth_sign", + args: []any{ + key1.Address(), + []byte("hello"), + }, + wantResult: types.MustSignatureFromHex("0xe5ddc160e4c8f92de507c7db9b982d4f9b7197bfa421864aeadc586bc96b09ae0ba0c5b131650ae4994cff1839341d00f3735ef5abc62ac8fe2cf50f65208e2a1b"), + request: []string{}, + response: []string{}, + }, + { + name: "sign transaction", + sign: &hijackSign{}, + method: "eth_signTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionLegacy() + tx.SetFrom(types.MustAddressFromHex("0x7e5f4552091a69125d5dfcb7b8c2659029395bdf")) + return tx + }()}, + wantResult: hexutil.MustHexToBytes("0xf8498080808080801ba060ac8da6fc016ee487d06e93fec9768941a182638546857f6242cd86581d0174a02bea91a940d7647518956970f9ecd63847ed9aaa3a451ef7e20c89823f847082"), + request: []string{}, + response: []string{}, + }, + { + name: "send transaction", + sign: &hijackSign{}, + method: "eth_sendTransaction", + args: []any{func() types.Transaction { + tx := types.NewTransactionLegacy() + tx.SetFrom(types.MustAddressFromHex("0x7e5f4552091a69125d5dfcb7b8c2659029395bdf")) + return tx + }()}, + wantResult: types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_sendRawTransaction","params":["0xf8498080808080801ba060ac8da6fc016ee487d06e93fec9768941a182638546857f6242cd86581d0174a02bea91a940d7647518956970f9ecd63847ed9aaa3a451ef7e20c89823f847082"]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + tc.sign.keys = []wallet.Key{key1, key2} + hijacker := transport.NewHijacker(httpMock, tc.sign) + + result := reflect.New(reflect.TypeOf(tc.wantResult)) + err := hijacker.Call(ctx, result.Interface(), tc.method, tc.args...) + assert.Equal(t, tc.wantResult, result.Elem().Interface()) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + require.NoError(t, err) + }) + } +} diff --git a/rpc/hijack_simulate.go b/rpc/hijack_simulate.go new file mode 100644 index 0000000..d4268fc --- /dev/null +++ b/rpc/hijack_simulate.go @@ -0,0 +1,96 @@ +package rpc + +import ( + "context" + "errors" + "fmt" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackSimulate hijacks "eth_send*Transaction" methods and simulates the +// transaction execution before sending it. +type hijackSimulate struct { + decoder types.RPCTransactionDecoder + recoverer crypto.Recoverer +} + +// Call implements the transport.Hijacker interface. +func (h *hijackSimulate) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + switch method { + case "eth_sendTransaction": + // Verify arguments: + if len(args) == 0 { + return &ErrHijackFailed{name: "simulate", err: errors.New("missing transaction data")} + } + tx, ok := args[0].(types.Transaction) + if !ok { + return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("invalid transaction type: %T", args[0])} + } + + // Simulate transaction: + if err := h.simulate(ctx, t, tx); err != nil { + return &ErrHijackFailed{name: "simulate", err: err} + } + case "eth_sendRawTransaction", "eth_sendPrivateTransaction": + // Verify arguments: + if len(args) == 0 { + return &ErrHijackFailed{name: "simulate", err: errors.New("missing transaction data")} + } + raw, ok := args[0].(types.Bytes) + if !ok { + return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("invalid transaction data type: %T", args[0])} + } + + // Decode raw transaction: + tx, err := h.decoder.DecodeRLP(raw) + if err != nil { + return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("failed to decode transaction: %w", err)} + } + + // Simulate transaction: + if err := h.simulate(ctx, t, tx); err != nil { + return &ErrHijackFailed{name: "simulate", err: err} + } + } + return next(ctx, t, result, method, args...) + } + } +} + +// Subscribe implements the transport.Hijacker interface. +func (h *hijackSimulate) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +// Unsubscribe implements the transport.Hijacker interface. +func (h *hijackSimulate) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} + +func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx types.Transaction) error { + // Recover transaction sender if not present: + txd := tx.TransactionData() + if txc, ok := tx.(types.HasCallData); ok && txd.Signature != nil && txc.CallData().From == nil { + from, err := h.recoverer.RecoverTransaction(tx) + if err != nil { + return fmt.Errorf("unable to recover transaction sender: %w", err) + } + txc.CallData().From = from + } + + // Get call data from transaction and execute it: + call := tx.Call() + if call == nil { + return errors.New("unable to create call data from transaction") + } + if _, err := (&MethodsCommon{Transport: t}).Call(ctx, call, types.LatestBlockNumber); err != nil { + return err + } + + return nil +} diff --git a/rpc/hijack_simulate_test.go b/rpc/hijack_simulate_test.go new file mode 100644 index 0000000..36a470b --- /dev/null +++ b/rpc/hijack_simulate_test.go @@ -0,0 +1,138 @@ +package rpc + +import ( + "bytes" + "context" + "fmt" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +func TestHijackSimulate(t *testing.T) { + tt := []struct { + name string + method string + args []any + request []string + response []string + wantResult any + wantErr string + }{ + { + name: "send valid transaction", + method: "eth_sendTransaction", + args: []any{ + func() types.Transaction { + tx := types.NewTransactionLegacy() + _, _ = tx.DecodeRLP(hexutil.MustHexToBytes("0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83")) + return tx + }(), + }, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","value":"0xde0b6b3a7640000"},"latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId":"0x1","from":"0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","nonce":"0x9","value":"0xde0b6b3a7640000","v":"0x25","r":"0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276","s":"0x67cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"}]}`, + }, + response: []string{ + `{"jsonrpc": "2.0","id": 1,"result": "0x01"}`, + `{"jsonrpc": "2.0","id": 1,"result": "0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + wantResult: "0x1111111111111111111111111111111111111111111111111111111111111111", + }, + { + name: "send valid raw transaction", + method: "eth_sendRawTransaction", + args: []any{types.MustBytesFromHex("0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83")}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","value":"0xde0b6b3a7640000"},"latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendRawTransaction","params":["0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x01"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + wantResult: "0x1111111111111111111111111111111111111111111111111111111111111111", + }, + { + name: "send valid private transaction", + method: "eth_sendPrivateTransaction", + args: []any{types.MustBytesFromHex("0xc9808080808080808080")}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{},"latest"]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendPrivateTransaction","params":["0xc9808080808080808080"]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"result":"0x01"}`, + `{"jsonrpc":"2.0","id":2,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, + }, + wantResult: "0x1111111111111111111111111111111111111111111111111111111111111111", + }, + { + name: "send invalid raw transaction", + method: "eth_sendTransaction", + args: []any{types.NewTransactionLegacy()}, + request: []string{ + `{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{},"latest"]}`, + }, + response: []string{ + `{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"revert","data":"0x08c379a0"}}`, + }, + wantErr: "revert", + }, + { + name: "invalid raw data", + method: "eth_sendRawTransaction", + args: []any{types.MustBytesFromHex("c9")}, + request: []string{}, + response: []string{}, + wantErr: "failed to decode transaction", + }, + } + for _, tc := range tt { + t.Run(tc.name, func(t *testing.T) { + ctx := context.Background() + httpMock := newHTTPMock() + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + require.NotEmpty(t, tc.request) + require.NotEmpty(t, tc.response) + + body, err := io.ReadAll(req.Body) + require.NoError(t, err) + require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + + res := tc.response[0] + tc.request = tc.request[1:] + tc.response = tc.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil + } + hijacker := transport.NewHijacker(httpMock, &hijackSimulate{ + decoder: types.DefaultTransactionDecoder, + recoverer: crypto.ECRecoverer, + }) + + var result any + err := hijacker.Call(ctx, &result, tc.method, tc.args...) + assert.Len(t, tc.request, 0) + assert.Len(t, tc.response, 0) + + if tc.wantErr != "" { + require.Error(t, err) + require.Contains(t, err.Error(), tc.wantErr) + return + } + require.NoError(t, err) + assert.Equal(t, tc.wantResult, result) + }) + } +} diff --git a/rpc/hijack_util.go b/rpc/hijack_util.go new file mode 100644 index 0000000..eb3ad32 --- /dev/null +++ b/rpc/hijack_util.go @@ -0,0 +1,92 @@ +package rpc + +import "github.com/defiweb/go-eth/types" + +func getCallData(tx types.Transaction) *types.EmbedCallData { + if tx, ok := tx.(types.HasCallData); ok { + return tx.CallData() + } + return nil +} + +func getLegacyPriceData(tx types.Transaction) *types.EmbedLegacyPriceData { + if tx, ok := tx.(types.HasLegacyPrice); ok { + return tx.LegacyPriceData() + } + return nil +} + +func getAccessListData(tx types.Transaction) *types.EmbedAccessListData { + if tx, ok := tx.(types.HasAccessListData); ok { + return tx.AccessListData() + } + return nil +} + +func getDynamicFeeData(tx types.Transaction) *types.EmbedDynamicFeeData { + if tx, ok := tx.(types.HasDynamicFeeData); ok { + return tx.DynamicFeeData() + } + return nil +} + +func convertTXToLegacyPrice(tx types.Transaction) types.Transaction { + if getLegacyPriceData(tx) != nil { + return tx + } + typ := types.LegacyTxType + if getAccessListData(tx) != nil { + typ = types.AccessListTxType + } + return convertTX(tx, typ) +} + +func convertTXToDynamicFee(tx types.Transaction) types.Transaction { + if getDynamicFeeData(tx) != nil { + return tx + } + return convertTX(tx, types.DynamicFeeTxType) +} + +func convertTX(tx types.Transaction, typ types.TransactionType) types.Transaction { + switch typ { + case types.LegacyTxType: + ltx := types.NewTransactionLegacy() + ltx.SetTransactionData(tx.TransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + ltx.SetCallData(tx.CallData()) + } + if tx, ok := tx.(types.HasLegacyPrice); ok { + ltx.SetLegacyPriceData(tx.LegacyPriceData()) + } + return ltx + case types.AccessListTxType: + altx := types.NewTransactionAccessList() + altx.SetTransactionData(tx.TransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + altx.SetCallData(tx.CallData()) + } + if tx, ok := tx.(types.HasLegacyPrice); ok { + altx.SetLegacyPriceData(tx.LegacyPriceData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + altx.SetAccessListData(tx.AccessListData()) + } + return altx + case types.DynamicFeeTxType: + dftx := types.NewTransactionDynamicFee() + dftx.SetTransactionData(tx.TransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + dftx.SetCallData(tx.CallData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + dftx.SetAccessListData(tx.AccessListData()) + } + if tx, ok := tx.(types.HasDynamicFeeData); ok { + dftx.SetDynamicFeeData(tx.DynamicFeeData()) + } + return dftx + default: + return nil + } +} diff --git a/rpc/methods_client.go b/rpc/methods_client.go new file mode 100644 index 0000000..774e40a --- /dev/null +++ b/rpc/methods_client.go @@ -0,0 +1,71 @@ +package rpc + +import ( + "context" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// MethodsClient is a collection of RPC methods that provide information about +// the node. +// +// Note: Some JSON-RPC APIs do not support these methods. +type MethodsClient struct { + Transport transport.Transport +} + +// ClientVersion performs web3_clientVersion RPC call. +// +// It returns the current client version. +func (c *MethodsClient) ClientVersion(ctx context.Context) (string, error) { + var res string + if err := c.Transport.Call(ctx, &res, "web3_clientVersion"); err != nil { + return "", err + } + return res, nil +} + +// NetworkID performs net_version RPC call. +// +// It returns the current network ID. +func (c *MethodsClient) NetworkID(ctx context.Context) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "net_version"); err != nil { + return 0, err + } + return res.Big().Uint64(), nil +} + +// Listening performs net_listening RPC call. +// +// It returns true if the client is actively listening for network. +func (c *MethodsClient) Listening(ctx context.Context) (bool, error) { + var res bool + if err := c.Transport.Call(ctx, &res, "net_listening"); err != nil { + return false, err + } + return res, nil +} + +// PeerCount performs net_peerCount RPC call. +// +// It returns the number of connected peers. +func (c *MethodsClient) PeerCount(ctx context.Context) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "net_peerCount"); err != nil { + return 0, err + } + return res.Big().Uint64(), nil +} + +// Syncing performs eth_syncing RPC call. +// +// It returns an object with data about the sync status or false. +func (c *MethodsClient) Syncing(ctx context.Context) (*types.SyncStatus, error) { + var res types.SyncStatus + if err := c.Transport.Call(ctx, &res, "eth_syncing"); err != nil { + return nil, err + } + return &res, nil +} diff --git a/rpc/methods_client_test.go b/rpc/methods_client_test.go new file mode 100644 index 0000000..dbba980 --- /dev/null +++ b/rpc/methods_client_test.go @@ -0,0 +1,148 @@ +package rpc + +import ( + "bytes" + "context" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +const mockClientVersionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "web3_clientVersion", + "params": [] + } +` + +const mockClientVersionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2" + } +` + +func TestBaseClient_ClientVersion(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsClient{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockClientVersionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockClientVersionResponse)), + }, nil + } + + clientVersion, err := client.ClientVersion(context.Background()) + require.NoError(t, err) + assert.Equal(t, "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2", clientVersion) +} + +const mockNetworkIDRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "net_version", + "params": [] + } +` + +const mockNetworkIDResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_NetworkID(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsClient{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockNetworkIDRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockNetworkIDResponse)), + }, nil + } + + networkID, err := client.NetworkID(context.Background()) + require.NoError(t, err) + assert.Equal(t, uint64(1), networkID) +} + +const mockListeningRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "net_listening", + "params": [] + } +` + +const mockListeningResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": true + } +` + +func TestBaseClient_Listening(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsClient{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockListeningRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockListeningResponse)), + }, nil + } + + listening, err := client.Listening(context.Background()) + require.NoError(t, err) + assert.True(t, listening) +} + +const mockPeerCountRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "net_peerCount", + "params": [] + } +` + +const mockPeerCountResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_PeerCount(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsClient{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockPeerCountRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockPeerCountResponse)), + }, nil + } + + peerCount, err := client.PeerCount(context.Background()) + require.NoError(t, err) + assert.Equal(t, uint64(1), peerCount) +} diff --git a/rpc/methods_common.go b/rpc/methods_common.go new file mode 100644 index 0000000..aea62e5 --- /dev/null +++ b/rpc/methods_common.go @@ -0,0 +1,380 @@ +package rpc + +import ( + "context" + "errors" + "fmt" + "math/big" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// MethodsCommon is a collection of methods that are commonly supported by +// Ethereum JSON-RPC APIs. +type MethodsCommon struct { + Transport transport.Transport + Decoder types.TransactionDecoder +} + +// +// Account methods: +// + +// GetBalance performs eth_getBalance RPC call. +// +// It returns the balance of the account of given address in wei. +func (c *MethodsCommon) GetBalance(ctx context.Context, address types.Address, block types.BlockNumber) (*big.Int, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getBalance", address, block); err != nil { + return nil, err + } + return res.Big(), nil +} + +// GetCode performs eth_getCode RPC call. +// +// It returns the contract code at the given address. +func (c *MethodsCommon) GetCode(ctx context.Context, account types.Address, block types.BlockNumber) ([]byte, error) { + var res types.Bytes + if err := c.Transport.Call(ctx, &res, "eth_getCode", account, block); err != nil { + return nil, err + } + return res.Bytes(), nil +} + +// GetStorageAt performs eth_getStorageAt RPC call. +// +// It returns the value of key in the contract storage at the given +// address. +func (c *MethodsCommon) GetStorageAt(ctx context.Context, account types.Address, key types.Hash, block types.BlockNumber) (*types.Hash, error) { + var res types.Hash + if err := c.Transport.Call(ctx, &res, "eth_getStorageAt", account, key, block); err != nil { + return nil, err + } + return &res, nil +} + +// GetTransactionCount performs eth_getTransactionCount RPC call. +// +// It returns the number of transactions sent from the given address. +func (c *MethodsCommon) GetTransactionCount(ctx context.Context, account types.Address, block types.BlockNumber) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getTransactionCount", account, block); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("transaction count is too big") + } + return res.Big().Uint64(), nil +} + +// +// Block methods: +// + +// BlockByHash performs eth_getBlockByHash RPC call. +// +// It returns information about a block by hash. +func (c *MethodsCommon) BlockByHash(ctx context.Context, hash types.Hash, full bool) (*types.Block, error) { + var res types.Block + if err := c.Transport.Call(ctx, &res, "eth_getBlockByHash", hash, full); err != nil { + return nil, err + } + return &res, nil +} + +// BlockByNumber performs eth_getBlockByNumber RPC call. +// +// It returns the block with the given number. +func (c *MethodsCommon) BlockByNumber(ctx context.Context, number types.BlockNumber, full bool) (*types.Block, error) { + var res types.Block + if err := c.Transport.Call(ctx, &res, "eth_getBlockByNumber", number, full); err != nil { + return nil, err + } + return &res, nil +} + +// GetBlockTransactionCountByHash performs eth_getBlockTransactionCountByHash RPC call. +// +// It returns the number of transactions in the block with the given hash. +func (c *MethodsCommon) GetBlockTransactionCountByHash(ctx context.Context, hash types.Hash) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByHash", hash); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("transaction count is too big") + } + return res.Big().Uint64(), nil +} + +// GetBlockTransactionCountByNumber implements the RPC interface. +func (c *MethodsCommon) GetBlockTransactionCountByNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByNumber", number); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("transaction count is too big") + } + return res.Big().Uint64(), nil +} + +// GetUncleByBlockHashAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. +// +// It returns information about an uncle of a block by number and uncle index position. +func (c *MethodsCommon) GetUncleByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.Block, error) { + var res types.Block + if err := c.Transport.Call(ctx, &res, "eth_getUncleByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { + return nil, err + } + return &res, nil +} + +// GetUncleByBlockNumberAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. +// +// It returns information about an uncle of a block by hash and uncle index position. +func (c *MethodsCommon) GetUncleByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.Block, error) { + var res types.Block + if err := c.Transport.Call(ctx, &res, "eth_getUncleByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { + return nil, err + } + return &res, nil +} + +// GetUncleCountByBlockHash performs eth_getUncleCountByBlockHash RPC call. +// +// It returns the number of uncles in the block with the given hash. +func (c *MethodsCommon) GetUncleCountByBlockHash(ctx context.Context, hash types.Hash) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getUncleCountByBlockHash", hash); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("uncle count is too big") + } + return res.Big().Uint64(), nil +} + +// GetUncleCountByBlockNumber performs eth_getUncleCountByBlockNumber RPC call. +// +// It returns the number of uncles in the block with the given block number. +func (c *MethodsCommon) GetUncleCountByBlockNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_getUncleCountByBlockNumber", number); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("uncle count is too big") + } + return res.Big().Uint64(), nil +} + +// SubscribeNewHeads performs eth_subscribe RPC call with "newHeads" +// subscription type. +// +// It creates a subscription that will send new block headers. +// +// Subscription channel will be closed when the context is canceled. +func (c *MethodsCommon) SubscribeNewHeads(ctx context.Context) (<-chan types.Block, error) { + return subscribe[types.Block](ctx, c.Transport, "newHeads") +} + +// +// Transaction methods: +// + +// Call performs eth_call RPC call. +// +// It executes a new message call immediately without creating a +// transaction on the blockchain. +// +// If call also implements types.Transaction, then a Call method of the +// transaction will be used to create a call. +func (c *MethodsCommon) Call(ctx context.Context, call types.Call, block types.BlockNumber) ([]byte, error) { + if call == nil { + return nil, errors.New("rpc client: call is nil") + } + if tx, ok := call.(types.Transaction); ok { + call = tx.Call() + } + var res types.Bytes + if err := c.Transport.Call(ctx, &res, "eth_call", call, block); err != nil { + return nil, err + } + return res, nil +} + +// EstimateGas performs eth_estimateGas RPC call. +// +// It estimates the gas necessary to execute a specific transaction. +// +// If call also implements types.Transaction, then a Call method of the +// transaction will be used to create a call. +func (c *MethodsCommon) EstimateGas(ctx context.Context, call types.Call, block types.BlockNumber) (uint64, error) { + if call == nil { + return 0, errors.New("rpc client: call is nil") + } + if tx, ok := call.(types.Transaction); ok { + call = tx.Call() + } + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_estimateGas", call, block); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, errors.New("gas estimate is too big") + } + return res.Big().Uint64(), nil +} + +// SendRawTransaction performs eth_sendRawTransaction RPC call. +// +// It sends an encoded transaction to the network. +func (c *MethodsCommon) SendRawTransaction(ctx context.Context, data []byte) (*types.Hash, error) { + var res types.Hash + if err := c.Transport.Call(ctx, &res, "eth_sendRawTransaction", types.Bytes(data)); err != nil { + return nil, err + } + return &res, nil +} + +// GetTransactionByHash performs eth_getTransactionByHash RPC call. +// +// It returns the information about a transaction requested by transaction. +func (c *MethodsCommon) GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.TransactionOnChain, error) { + res := types.TransactionOnChain{Decoder: c.Decoder} + if err := c.Transport.Call(ctx, &res, "eth_getTransactionByHash", hash); err != nil { + return nil, err + } + return &res, nil +} + +// GetTransactionByBlockHashAndIndex performs eth_getTransactionByBlockHashAndIndex RPC call. +// +// It returns the information about a transaction requested by transaction. +func (c *MethodsCommon) GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.TransactionOnChain, error) { + res := types.TransactionOnChain{Decoder: c.Decoder} + if err := c.Transport.Call(ctx, &res, "eth_getTransactionByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { + return nil, err + } + return &res, nil +} + +// GetTransactionByBlockNumberAndIndex performs eth_getTransactionByBlockNumberAndIndex RPC call. +// +// It returns the information about a transaction requested by transaction. +func (c *MethodsCommon) GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.TransactionOnChain, error) { + res := types.TransactionOnChain{Decoder: c.Decoder} + if err := c.Transport.Call(ctx, &res, "eth_getTransactionByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { + return nil, err + } + return &res, nil +} + +// GetTransactionReceipt performs eth_getTransactionReceipt RPC call. +// +// It returns the receipt of a transaction by transaction hash. +func (c *MethodsCommon) GetTransactionReceipt(ctx context.Context, hash types.Hash) (*types.TransactionReceipt, error) { + var res types.TransactionReceipt + if err := c.Transport.Call(ctx, &res, "eth_getTransactionReceipt", hash); err != nil { + return nil, err + } + return &res, nil +} + +// GetBlockReceipts performs eth_getBlockReceipts RPC call. +// +// It returns all transaction receipts for a given block hash or number. +func (c *MethodsCommon) GetBlockReceipts(ctx context.Context, block types.BlockNumber) ([]*types.TransactionReceipt, error) { + var res []*types.TransactionReceipt + if err := c.Transport.Call(ctx, &res, "eth_getBlockReceipts", block); err != nil { + return nil, err + } + return res, nil +} + +// SubscribeNewPendingTransactions performs eth_subscribe RPC call with +// "newPendingTransactions" subscription type. +// +// It creates a subscription that will send new pending transactions. +// +// Subscription channel will be closed when the context is canceled. +func (c *MethodsCommon) SubscribeNewPendingTransactions(ctx context.Context) (<-chan types.Hash, error) { + return subscribe[types.Hash](ctx, c.Transport, "newPendingTransactions") +} + +// +// Logs methods: +// + +// GetLogs performs eth_getLogs RPC call. +// +// It returns logs that match the given query. +func (c *MethodsCommon) GetLogs(ctx context.Context, query *types.FilterLogsQuery) ([]types.Log, error) { + var res []types.Log + if err := c.Transport.Call(ctx, &res, "eth_getLogs", query); err != nil { + return nil, err + } + return res, nil +} + +// SubscribeLogs performs eth_subscribe RPC call with "logs" subscription +// type. +// +// It creates a subscription that will send logs that match the given query. +// +// Subscription channel will be closed when the context is canceled. +func (c *MethodsCommon) SubscribeLogs(ctx context.Context, query *types.FilterLogsQuery) (<-chan types.Log, error) { + return subscribe[types.Log](ctx, c.Transport, "logs", query) +} + +// Network status methods: + +// ChainID performs eth_chainId RPC call. +// +// It returns the current chain ID. +func (c *MethodsCommon) ChainID(ctx context.Context) (uint64, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_chainId"); err != nil { + return 0, err + } + if !res.Big().IsUint64() { + return 0, fmt.Errorf("chain id is too big") + } + return res.Big().Uint64(), nil +} + +// BlockNumber performs eth_blockNumber RPC call. +// +// It returns the current block number. +func (c *MethodsCommon) BlockNumber(ctx context.Context) (*big.Int, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_blockNumber"); err != nil { + return nil, err + } + return res.Big(), nil +} + +// GasPrice performs eth_gasPrice RPC call. +// +// It returns the current price per gas in wei. +func (c *MethodsCommon) GasPrice(ctx context.Context) (*big.Int, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_gasPrice"); err != nil { + return nil, err + } + return res.Big(), nil +} + +// MaxPriorityFeePerGas performs eth_maxPriorityFeePerGas RPC call. +// +// It returns the estimated maximum priority fee per gas. +func (c *MethodsCommon) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_maxPriorityFeePerGas"); err != nil { + return nil, err + } + return res.Big(), nil +} diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go new file mode 100644 index 0000000..c5711ee --- /dev/null +++ b/rpc/methods_common_test.go @@ -0,0 +1,1269 @@ +package rpc + +import ( + "bytes" + "context" + "io" + "math/big" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/types" +) + +const mockBlockResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "number": "0x11", + "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "parentHash": "0x3333333333333333333333333333333333333333333333333333333333333333", + "nonce": "0x4444444444444444", + "sha3Uncles": "0x5555555555555555555555555555555555555555555555555555555555555555", + "logsBloom": "0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", + "transactionsRoot": "0x7777777777777777777777777777777777777777777777777777777777777777", + "stateRoot": "0x8888888888888888888888888888888888888888888888888888888888888888", + "receiptsRoot": "0x9999999999999999999999999999999999999999999999999999999999999999", + "miner": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "difficulty": "0xbbbbbb", + "totalDifficulty": "0xcccccc", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", + "size": "0xdddddd", + "gasLimit": "0xeeeeee", + "gasUsed": "0xffffff", + "timestamp": "0x54e34e8e", + "transactions": [ + { + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "nonce": "0x22", + "blockHash": "0x3333333333333333333333333333333333333333333333333333333333333333", + "blockNumber": "0x4444", + "transactionIndex": "0x01", + "from": "0x5555555555555555555555555555555555555555", + "to": "0x6666666666666666666666666666666666666666", + "value": "0x2540be400", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "input": "0x777777777777" + } + ], + "uncles": [ + "0x8888888888888888888888888888888888888888888888888888888888888888" + ] + } + } +` + +const mockOnChainTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x22", + "from": "0x3333333333333333333333333333333333333333", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "hash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "input": "0x555555555555", + "nonce": "0x66", + "to": "0x7777777777777777777777777777777777777777", + "transactionIndex": "0x0", + "value": "0x2540be400", + "v": "0x88", + "r": "0x9999999999999999999999999999999999999999999999999999999999999999", + "s": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + } +` + +const mockGetBalanceRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getBalance", + "params": [ + "0x1111111111111111111111111111111111111111", + "latest" + ] + } +` + +const mockGetBalanceResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x0234c8a3397aab58" + } +` + +func TestBaseClient_GetBalance(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetBalanceRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetBalanceResponse)), + }, nil + } + + balance, err := client.GetBalance( + context.Background(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + types.LatestBlockNumber, + ) + + require.NoError(t, err) + assert.Equal(t, big.NewInt(158972490234375000), balance) +} + +const mockGetCodeRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getCode", + "params": [ + "0x1111111111111111111111111111111111111111", + "0x2" + ] + } +` + +const mockGetCodeResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x3333333333333333333333333333333333333333333333333333333333333333" + } +` + +func TestBaseClient_GetCode(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetCodeRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetCodeResponse)), + }, nil + } + + code, err := client.GetCode( + context.Background(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + types.MustBlockNumberFromHex("0x2"), + ) + + require.NoError(t, err) + assert.Equal(t, "0x3333333333333333333333333333333333333333333333333333333333333333", hexutil.BytesToHex(code)) +} + +const mockGetStorageAtRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getStorageAt", + "params": [ + "0x1111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222222222222222222222222222", + "0x1" + ] + } +` + +const mockGetStorageAtResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x3333333333333333333333333333333333333333333333333333333333333333" + } +` + +func TestBaseClient_GetStorageAt(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetStorageAtRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetStorageAtResponse)), + }, nil + } + + storage, err := client.GetStorageAt( + context.Background(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", types.PadNone), *storage) +} + +const mockGetTransactionCountRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getTransactionCount", + "params": [ + "0x1111111111111111111111111111111111111111", + "0x1" + ] + } +` + +const mockGetTransactionCountResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_GetTransactionCount(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetTransactionCountRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionCountResponse)), + }, nil + } + + transactionCount, err := client.GetTransactionCount( + context.Background(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + assert.Equal(t, uint64(1), transactionCount) +} + +const mockBlockByHashRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getBlockByHash", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111", + true + ] + } +` + +func TestBaseClient_BlockByHash(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockBlockByHashRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlockResponse)), + }, nil + } + + block, err := client.BlockByHash( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + true, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) +} + +const mockBlockByNumberRequest = ` + { + "method": "eth_getBlockByNumber", + "params": [ + "0x1", + true + ], + "id": 1, + "jsonrpc": "2.0" + } +` + +func TestBaseClient_BlockByNumber(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockBlockByNumberRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlockResponse)), + }, nil + } + + block, err := client.BlockByNumber( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + true, + ) + + require.NoError(t, err) + assert.Equal(t, big.NewInt(0x11), block.Number) + assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) + assert.Equal(t, types.MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", types.PadNone), block.ParentHash) + assert.Equal(t, hexutil.MustHexToBigInt("0x4444444444444444"), block.Nonce) + assert.Equal(t, types.MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), block.Sha3Uncles) + assert.Equal(t, hexutil.MustHexToBytes("0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666"), block.LogsBloom) + assert.Equal(t, types.MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", types.PadNone), block.TransactionsRoot) + assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.StateRoot) + assert.Equal(t, types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone), block.ReceiptsRoot) + assert.Equal(t, types.MustAddressFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), block.Miner) + assert.Equal(t, hexutil.MustHexToBigInt("0xbbbbbb"), block.Difficulty) + assert.Equal(t, hexutil.MustHexToBigInt("0xcccccc"), block.TotalDifficulty) + assert.Equal(t, hexutil.MustHexToBytes("0x0000000000000000000000000000000000000000000000000000000000000000"), block.ExtraData) + assert.Equal(t, hexutil.MustHexToBigInt("0xdddddd").Uint64(), block.Size) + assert.Equal(t, hexutil.MustHexToBigInt("0xeeeeee").Uint64(), block.GasLimit) + assert.Equal(t, hexutil.MustHexToBigInt("0xffffff").Uint64(), block.GasUsed) + assert.Equal(t, int64(1424182926), block.Timestamp.Unix()) + require.Len(t, block.Transactions, 1) + require.Len(t, block.Uncles, 1) + + tx := block.Transactions[0].Transaction.(*types.TransactionLegacy) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), block.Transactions[0].Hash) + assert.Equal(t, uint64(0x22), *tx.Nonce) + assert.Equal(t, types.MustAddressFromHexPtr("0x5555555555555555555555555555555555555555"), tx.From) + assert.Equal(t, types.MustAddressFromHexPtr("0x6666666666666666666666666666666666666666"), tx.To) + assert.Equal(t, big.NewInt(10000000000), tx.Value) + assert.Equal(t, uint64(30400), *tx.GasLimit) + assert.Equal(t, big.NewInt(10000000000000), tx.GasPrice) + assert.Equal(t, hexutil.MustHexToBytes("0x777777777777"), tx.Input) + assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.Uncles[0]) +} + +const mockGetBlockTransactionCountByHashRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getBlockTransactionCountByHash", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111" + ] + } +` + +const mockGetBlockTransactionCountByHashResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_GetBlockTransactionCountByHash(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetBlockTransactionCountByHashRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetBlockTransactionCountByHashResponse)), + }, nil + } + + transactionCount, err := client.GetBlockTransactionCountByHash( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + ) + + require.NoError(t, err) + assert.Equal(t, uint64(1), transactionCount) +} + +const mockGetBlockTransactionCountByNumberRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getBlockTransactionCountByNumber", + "params": [ + "0x1" + ] + } +` + +const mockGetBlockTransactionCountByNumberResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x2" + } +` + +func TestBaseClient_GetBlockTransactionCountByNumber(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetBlockTransactionCountByNumberRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetBlockTransactionCountByNumberResponse)), + }, nil + } + + transactionCount, err := client.GetBlockTransactionCountByNumber( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + assert.Equal(t, uint64(2), transactionCount) +} + +const mockGetUncleByBlockHashAndIndexRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getUncleByBlockHashAndIndex", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x0" + ] + } +` + +func TestBaseClient_GetUncleByBlockHashAndIndex(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetUncleByBlockHashAndIndexRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlockResponse)), + }, nil + } + + block, err := client.GetUncleByBlockHashAndIndex( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + 0, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) +} + +const mockGetUncleByBlockNumberAndIndexRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getUncleByBlockNumberAndIndex", + "params": [ + "0x1", + "0x2" + ] + } +` + +func TestBaseClient_GetUncleByBlockNumberAndIndex(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetUncleByBlockNumberAndIndexRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlockResponse)), + }, nil + } + + block, err := client.GetUncleByBlockNumberAndIndex( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + 2, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) +} + +const mockGetUncleCountByBlockHashRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getUncleCountByBlockHash", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111" + ] + } +` + +const mockGetUncleCountByBlockHashResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_GetUncleCountByBlockHash(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetUncleCountByBlockHashRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetUncleCountByBlockHashResponse)), + }, nil + } + + uncleCount, err := client.GetUncleCountByBlockHash( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + ) + + require.NoError(t, err) + assert.Equal(t, uint64(1), uncleCount) +} + +const mockGetUncleCountByBlockNumberRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getUncleCountByBlockNumber", + "params": [ + "0x1" + ] + } +` + +const mockGetUncleCountByBlockNumberResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x2" + } +` + +func TestBaseClient_GetUncleCountByBlockNumber(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetUncleCountByBlockNumberRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetUncleCountByBlockNumberResponse)), + }, nil + } + + uncleCount, err := client.GetUncleCountByBlockNumber( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + assert.Equal(t, uint64(2), uncleCount) +} + +// TODO: SubscribeNewHeads + +const mockCallRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_call", + "params": [ + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "value": "0x2540be400", + "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" + }, + "0x1" + ] + } +` + +const mockCallResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f300000000000000000000000078d1ad571a1a09d60d9bbf25894b44e4c8859595000000000000000000000000286834935f4a8cfb4ff4c77d5770c2775ae2b0e7000000000000000000000000b86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e" + } +` + +func TestBaseClient_Call(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockCallRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockCallResponse)), + }, nil + } + + from := types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111") + to := types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222") + gasLimit := uint64(30400) + gasPrice := big.NewInt(10000000000000) + value := big.NewInt(10000000000) + input := hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333") + response, err := client.Call( + context.Background(), + &types.CallLegacy{ + EmbedCallData: types.EmbedCallData{ + From: from, + To: to, + GasLimit: &gasLimit, + Value: value, + Input: input, + }, + EmbedLegacyPriceData: types.EmbedLegacyPriceData{ + GasPrice: gasPrice, + }, + }, + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + assert.Equal(t, hexutil.MustHexToBytes("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f300000000000000000000000078d1ad571a1a09d60d9bbf25894b44e4c8859595000000000000000000000000286834935f4a8cfb4ff4c77d5770c2775ae2b0e7000000000000000000000000b86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e"), response) +} + +const mockEstimateGasRequest = ` + { + "id": 1, + "jsonrpc": "2.0", + "method": "eth_estimateGas", + "params": [ + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "value": "0x2540be400", + "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" + }, + "latest" + ] + } +` + +const mockEstimateGasResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x5208" + } +` + +func TestBaseClient_EstimateGas(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockEstimateGasRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockEstimateGasResponse)), + }, nil + } + + gasLimit := uint64(30400) + gas, err := client.EstimateGas( + context.Background(), + &types.CallLegacy{ + EmbedCallData: types.EmbedCallData{ + From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + GasLimit: &gasLimit, + Value: big.NewInt(10000000000), + Input: hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), + }, + EmbedLegacyPriceData: types.EmbedLegacyPriceData{ + GasPrice: big.NewInt(10000000000000), + }, + }, + types.LatestBlockNumber, + ) + + require.NoError(t, err) + assert.Equal(t, uint64(21000), gas) +} + +const mockSendRawTransactionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_sendRawTransaction", + "params": [ + "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" + ] + } +` + +const mockSendRawTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111111111111111111111111111" + } +` + +func TestBaseClient_SendRawTransaction(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSendRawTransactionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSendRawTransactionResponse)), + }, nil + } + + txHash, err := client.SendRawTransaction( + context.Background(), + hexutil.MustHexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) +} + +const mockGetTransactionByHashRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getTransactionByHash", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111" + ] + } +` + +func TestBaseClient_GetTransactionByHash(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetTransactionByHashRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockOnChainTransactionResponse)), + }, nil + } + + onChainTX, err := client.GetTransactionByHash( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), onChainTX.BlockHash) + assert.Equal(t, big.NewInt(0x22), onChainTX.BlockNumber) + assert.Equal(t, uint64(0x0), *onChainTX.TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), onChainTX.Hash) + + tx := onChainTX.Transaction.(*types.TransactionLegacy) + assert.Equal(t, types.MustAddressFromHexPtr("0x3333333333333333333333333333333333333333"), tx.From) + assert.Equal(t, types.MustAddressFromHexPtr("0x7777777777777777777777777777777777777777"), tx.To) + assert.Equal(t, big.NewInt(10000000000), tx.Value) + assert.Equal(t, uint64(30400), *tx.GasLimit) + assert.Equal(t, big.NewInt(10000000000000), tx.GasPrice) + assert.Equal(t, hexutil.MustHexToBytes("0x555555555555"), tx.Input) + assert.Equal(t, uint64(0x66), *tx.Nonce) + assert.Equal(t, uint64(0x88), tx.Signature.V.Uint64()) + assert.Equal(t, hexutil.MustHexToBytes("0x9999999999999999999999999999999999999999999999999999999999999999"), tx.Signature.R.Bytes()) + assert.Equal(t, hexutil.MustHexToBytes("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), tx.Signature.S.Bytes()) +} + +const mockGetTransactionByBlockHashAndIndexRequest = ` + { + "id": 1, + "jsonrpc": "2.0", + "method": "eth_getTransactionByBlockHashAndIndex", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x0" + ] + } +` + +func TestBaseClient_GetTransactionByBlockHashAndIndex(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetTransactionByBlockHashAndIndexRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockOnChainTransactionResponse)), + }, nil + } + + onChainTX, err := client.GetTransactionByBlockHashAndIndex( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + 0, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), onChainTX.BlockHash) + assert.Equal(t, big.NewInt(0x22), onChainTX.BlockNumber) + assert.Equal(t, uint64(0x0), *onChainTX.TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), onChainTX.Hash) +} + +const mockGetTransactionByBlockNumberAndIndexRequest = ` + { + "id": 1, + "jsonrpc": "2.0", + "method": "eth_getTransactionByBlockNumberAndIndex", + "params": [ + "0x1", + "0x2" + ] + } +` + +func TestBaseClient_GetTransactionByBlockNumberAndIndex(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetTransactionByBlockNumberAndIndexRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockOnChainTransactionResponse)), + }, nil + } + + onChainTX, err := client.GetTransactionByBlockNumberAndIndex( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + 2, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), onChainTX.BlockHash) + assert.Equal(t, big.NewInt(0x22), onChainTX.BlockNumber) + assert.Equal(t, uint64(0x0), *onChainTX.TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), onChainTX.Hash) +} + +const mockGetTransactionReceiptRequest = ` + { + "id": 1, + "jsonrpc": "2.0", + "method": "eth_getTransactionReceipt", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111" + ] + } +` + +const mockGetTransactionReceiptResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "contractAddress": null, + "cumulativeGasUsed": "0x33333", + "effectiveGasPrice":"0x4444444444", + "from": "0x5555555555555555555555555555555555555555", + "gasUsed": "0x66666", + "logs": [ + { + "address": "0x7777777777777777777777777777777777777777", + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", + "logIndex": "0x8", + "removed": false, + "topics": [ + "0x9999999999999999999999999999999999999999999999999999999999999999" + ], + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11" + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", + "status": "0x1", + "to": "0x7777777777777777777777777777777777777777", + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11", + "type": "0x0" + } + } +` + +func TestBaseClient_GetTransactionReceipt(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetTransactionReceiptRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionReceiptResponse)), + }, nil + } + + receipt, err := client.GetTransactionReceipt( + context.Background(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + ) + + status := uint64(1) + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipt.TransactionHash) + assert.Equal(t, uint64(17), receipt.TransactionIndex) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipt.BlockHash) + assert.Equal(t, big.NewInt(0x2222), receipt.BlockNumber) + assert.Equal(t, (*types.Address)(nil), receipt.ContractAddress) + assert.Equal(t, hexutil.MustHexToBigInt("0x33333").Uint64(), receipt.CumulativeGasUsed) + assert.Equal(t, hexutil.MustHexToBigInt("0x4444444444"), receipt.EffectiveGasPrice) + assert.Equal(t, hexutil.MustHexToBigInt("0x66666").Uint64(), receipt.GasUsed) + assert.Equal(t, types.MustAddressFromHex("0x5555555555555555555555555555555555555555"), receipt.From) + assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipt.To) + assert.Equal(t, hexutil.MustHexToBytes("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000"), receipt.LogsBloom) + assert.Equal(t, &status, receipt.Status) + require.Len(t, receipt.Logs, 1) + assert.Equal(t, types.MustHashFromHexPtr("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipt.Logs[0].TransactionHash) + assert.Equal(t, uint64(17), *receipt.Logs[0].TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipt.Logs[0].BlockHash) + assert.Equal(t, big.NewInt(0x2222), receipt.Logs[0].BlockNumber) + assert.Equal(t, uint64(8), *receipt.Logs[0].LogIndex) + assert.Equal(t, hexutil.MustHexToBytes("0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35"), receipt.Logs[0].Data) + assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipt.Logs[0].Address) + assert.Equal(t, []types.Hash{types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone)}, receipt.Logs[0].Topics) + assert.Equal(t, false, receipt.Logs[0].Removed) +} + +const mockGetBlockReceiptsRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getBlockReceipts", + "params": [ + "0x1" + ] + } +` + +const mockGetBlockReceiptsResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "contractAddress": null, + "cumulativeGasUsed": "0x33333", + "effectiveGasPrice": "0x4444444444", + "from": "0x5555555555555555555555555555555555555555", + "gasUsed": "0x66666", + "logs": [ + { + "address": "0x7777777777777777777777777777777777777777", + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", + "logIndex": "0x8", + "removed": false, + "topics": [ + "0x9999999999999999999999999999999999999999999999999999999999999999" + ], + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11" + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", + "status": "0x1", + "to": "0x7777777777777777777777777777777777777777", + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11", + "type": "0x0" + } + ] + } +` + +func TestBaseClient_GetBlockReceipts(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetBlockReceiptsRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetBlockReceiptsResponse)), + }, nil + } + + receipts, err := client.GetBlockReceipts( + context.Background(), + types.MustBlockNumberFromHex("0x1"), + ) + + require.NoError(t, err) + require.Len(t, receipts, 1) + assert.Equal(t, types.MustHashFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipts[0].TransactionHash) + assert.Equal(t, uint64(17), receipts[0].TransactionIndex) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipts[0].BlockHash) + assert.Equal(t, big.NewInt(0x2222), receipts[0].BlockNumber) + assert.Equal(t, (*types.Address)(nil), receipts[0].ContractAddress) + assert.Equal(t, hexutil.MustHexToBigInt("0x33333").Uint64(), receipts[0].CumulativeGasUsed) + assert.Equal(t, hexutil.MustHexToBigInt("0x4444444444"), receipts[0].EffectiveGasPrice) + assert.Equal(t, hexutil.MustHexToBigInt("0x66666").Uint64(), receipts[0].GasUsed) + assert.Equal(t, types.MustAddressFromHex("0x5555555555555555555555555555555555555555"), receipts[0].From) + assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipts[0].To) + assert.Equal(t, hexutil.MustHexToBytes("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000"), receipts[0].LogsBloom) + status := uint64(1) + assert.Equal(t, &status, receipts[0].Status) + require.Len(t, receipts[0].Logs, 1) + assert.Equal(t, types.MustHashFromHexPtr("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipts[0].Logs[0].TransactionHash) + assert.Equal(t, uint64(17), *receipts[0].Logs[0].TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipts[0].Logs[0].BlockHash) + assert.Equal(t, big.NewInt(0x2222), receipts[0].Logs[0].BlockNumber) + assert.Equal(t, uint64(8), *receipts[0].Logs[0].LogIndex) + assert.Equal(t, hexutil.MustHexToBytes("0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35"), receipts[0].Logs[0].Data) + assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipts[0].Logs[0].Address) + assert.Equal(t, []types.Hash{types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone)}, receipts[0].Logs[0].Topics) + assert.Equal(t, false, receipts[0].Logs[0].Removed) +} + +// TODO: SubscribeNewPendingTransactions + +const mockGetLogsRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getLogs", + "params": [ + { + "fromBlock": "0x1", + "toBlock": "0x2", + "address": "0x3333333333333333333333333333333333333333", + "topics": [ + "0x4444444444444444444444444444444444444444444444444444444444444444" + ] + } + ] + } +` + +const mockGetLogsResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "address": "0x3333333333333333333333333333333333333333", + "topics": [ + "0x4444444444444444444444444444444444444444444444444444444444444444" + ], + "data": "0x68656c6c6f21", + "blockNumber": "0x1", + "transactionHash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "transactionIndex": "0x0", + "blockHash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "logIndex": "0x0", + "removed": false + } + ] + } +` + +func TestBaseClient_GetLogs(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetLogsRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetLogsResponse)), + }, nil + } + + from := types.MustBlockNumberFromHex("0x1") + to := types.MustBlockNumberFromHex("0x2") + logs, err := client.GetLogs(context.Background(), &types.FilterLogsQuery{ + FromBlock: &from, + ToBlock: &to, + Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, + Topics: [][]types.Hash{ + {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, + }, + }) + require.NoError(t, err) + require.Len(t, logs, 1) + assert.Equal(t, types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), logs[0].Address) + assert.Equal(t, types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].Topics[0]) + assert.Equal(t, hexutil.MustHexToBytes("0x68656c6c6f21"), logs[0].Data) + assert.Equal(t, big.NewInt(1), logs[0].BlockNumber) + assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].TransactionHash) + assert.Equal(t, uint64(0), *logs[0].TransactionIndex) + assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].BlockHash) + assert.Equal(t, uint64(0), *logs[0].LogIndex) + assert.Equal(t, false, logs[0].Removed) +} + +// TODO: SubscribeLogs + +const mockChanIDRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_chainId", + "params": [] + } +` + +const mockChanIDResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_ChainID(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockChanIDRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockChanIDResponse)), + }, nil + } + + chainID, err := client.ChainID(context.Background()) + require.NoError(t, err) + assert.Equal(t, uint64(1), chainID) +} + +const mockBlockNumberRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_blockNumber", + "params": [] + } +` + +const mockBlockNumberResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_BlockNumber(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockBlockNumberRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlockNumberResponse)), + }, nil + } + + blockNumber, err := client.BlockNumber(context.Background()) + + require.NoError(t, err) + assert.Equal(t, big.NewInt(1), blockNumber) +} + +const mockGasPriceRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_gasPrice", + "params": [] + } +` + +const mockGasPriceResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x09184e72a000" + } +` + +func TestBaseClient_GasPrice(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGasPriceRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGasPriceResponse)), + }, nil + } + + gasPrice, err := client.GasPrice(context.Background()) + require.NoError(t, err) + assert.Equal(t, big.NewInt(10000000000000), gasPrice) +} + +const mockMaxPriorityFeePerGasRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_maxPriorityFeePerGas", + "params": [] + } +` + +const mockMaxPriorityFeePerGasResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockMaxPriorityFeePerGasRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockMaxPriorityFeePerGasResponse)), + }, nil + } + + gasPrice, err := client.MaxPriorityFeePerGas(context.Background()) + require.NoError(t, err) + assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) +} diff --git a/rpc/methods_filter.go b/rpc/methods_filter.go new file mode 100644 index 0000000..2f525b9 --- /dev/null +++ b/rpc/methods_filter.go @@ -0,0 +1,80 @@ +package rpc + +import ( + "context" + "math/big" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// MethodsFilter is a collection of RPC methods to interact with filters. +// +// Note: Some JSON-RPC APIs do not support these methods. +type MethodsFilter struct { + Transport transport.Transport +} + +// NewFilter implements the RPC interface. +func (c *MethodsFilter) NewFilter(ctx context.Context, query *types.FilterLogsQuery) (*big.Int, error) { + var res *types.Number + if err := c.Transport.Call(ctx, &res, "eth_newFilter", query); err != nil { + return nil, err + } + return res.Big(), nil +} + +// NewBlockFilter implements the RPC interface. +func (c *MethodsFilter) NewBlockFilter(ctx context.Context) (*big.Int, error) { + var res *types.Number + if err := c.Transport.Call(ctx, &res, "eth_newBlockFilter"); err != nil { + return nil, err + } + return res.Big(), nil + +} + +// NewPendingTransactionFilter implements the RPC interface. +func (c *MethodsFilter) NewPendingTransactionFilter(ctx context.Context) (*big.Int, error) { + var res *types.Number + if err := c.Transport.Call(ctx, &res, "eth_newPendingTransactionFilter"); err != nil { + return nil, err + } + return res.Big(), nil +} + +// UninstallFilter implements the RPC interface. +func (c *MethodsFilter) UninstallFilter(ctx context.Context, id *big.Int) (bool, error) { + var res bool + if err := c.Transport.Call(ctx, &res, "eth_uninstallFilter", types.NumberFromBigInt(id)); err != nil { + return false, err + } + return res, nil +} + +// GetFilterChanges implements the RPC interface. +func (c *MethodsFilter) GetFilterChanges(ctx context.Context, id *big.Int) ([]types.Log, error) { + var res []types.Log + if err := c.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { + return nil, err + } + return res, nil +} + +// GetFilterLogs implements the RPC interface. +func (c *MethodsFilter) GetFilterLogs(ctx context.Context, id *big.Int) ([]types.Log, error) { + var res []types.Log + if err := c.Transport.Call(ctx, &res, "eth_getFilterLogs", types.NumberFromBigInt(id)); err != nil { + return nil, err + } + return res, nil +} + +// GetBlockFilterChanges implements the RPC interface. +func (c *MethodsFilter) GetBlockFilterChanges(ctx context.Context, id *big.Int) ([]types.Hash, error) { + var res []types.Hash + if err := c.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { + return nil, err + } + return res, nil +} diff --git a/rpc/methods_filter_test.go b/rpc/methods_filter_test.go new file mode 100644 index 0000000..7438166 --- /dev/null +++ b/rpc/methods_filter_test.go @@ -0,0 +1,64 @@ +package rpc + +import ( + "bytes" + "context" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/types" +) + +const mockNewFilterRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_newFilter", + "params": [ + { + "fromBlock": "0x1", + "toBlock": "0x2", + "address": "0x3333333333333333333333333333333333333333", + "topics": ["0x4444444444444444444444444444444444444444444444444444444444444444"] + } + ] + } +` + +const mockNewFilterResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_NewFilter(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockNewFilterRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockNewFilterResponse)), + }, nil + } + + from := types.MustBlockNumberFromHex("0x1") + to := types.MustBlockNumberFromHex("0x2") + id, err := client.NewFilter(context.Background(), &types.FilterLogsQuery{ + FromBlock: &from, + ToBlock: &to, + Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, + Topics: [][]types.Hash{ + {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, + }, + }) + require.NoError(t, err) + assert.Equal(t, "1", id.String()) +} diff --git a/rpc/methods_privatetransactions.go b/rpc/methods_privatetransactions.go new file mode 100644 index 0000000..4905b65 --- /dev/null +++ b/rpc/methods_privatetransactions.go @@ -0,0 +1,29 @@ +package rpc + +import ( + "context" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// MethodsPrivateTransaction implements unofficial RPC methods for private transactions. +type MethodsPrivateTransaction struct { + Transport transport.Transport +} + +func (c *MethodsPrivateTransaction) CancelPrivateTransaction(ctx context.Context, hash types.Hash) (bool, error) { + var res bool + if err := c.Transport.Call(ctx, &res, "eth_cancelPrivateTransaction", hash); err != nil { + return false, err + } + return res, nil +} + +func (c *MethodsPrivateTransaction) SendPrivateTransaction(ctx context.Context, data []byte) (*types.Hash, error) { + var res types.Hash + if err := c.Transport.Call(ctx, &res, "eth_sendPrivateTransaction", types.Bytes(data)); err != nil { + return nil, err + } + return &res, nil +} diff --git a/rpc/methods_wallet.go b/rpc/methods_wallet.go new file mode 100644 index 0000000..f1339ef --- /dev/null +++ b/rpc/methods_wallet.go @@ -0,0 +1,67 @@ +package rpc + +import ( + "context" + "errors" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// MethodsWallet is a collection of RPC methods that require private keys to +// perform operations. +// +// Note: Public JSON-RPC APIs do not support these methods. +type MethodsWallet struct { + Transport transport.Transport +} + +// Accounts performs eth_accounts RPC call. +// +// It returns the list of addresses owned by the client. +func (c *MethodsWallet) Accounts(ctx context.Context) ([]types.Address, error) { + var res []types.Address + if err := c.Transport.Call(ctx, &res, "eth_accounts"); err != nil { + return nil, err + } + return res, nil +} + +// Sign performs eth_sign RPC call. +// +// It signs the given data with the given address. +func (c *MethodsWallet) Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) { + var res types.Signature + if err := c.Transport.Call(ctx, &res, "eth_sign", account, types.Bytes(data)); err != nil { + return nil, err + } + return &res, nil +} + +// SignTransaction performs eth_signTransaction RPC call. +// +// It signs the given transaction and returns the raw transaction data. +func (c *MethodsWallet) SignTransaction(ctx context.Context, tx types.Transaction) ([]byte, error) { + if tx == nil { + return nil, errors.New("rpc client: transaction is nil") + } + var res signTransactionResult + if err := c.Transport.Call(ctx, &res, "eth_signTransaction", tx); err != nil { + return nil, err + } + return res.Raw, nil +} + +// SendTransaction performs eth_sendTransaction RPC call. +// +// It sends a transaction to the network. +func (c *MethodsCommon) SendTransaction(ctx context.Context, tx types.Transaction) (*types.Hash, error) { + if tx == nil { + return nil, errors.New("rpc client: transaction is nil") + } + var res types.Hash + if err := c.Transport.Call(ctx, &res, "eth_sendTransaction", tx); err != nil { + return nil, err + } + return &res, nil +} diff --git a/rpc/mocks_test.go b/rpc/mocks_test.go index 24fdab1..97d6382 100644 --- a/rpc/mocks_test.go +++ b/rpc/mocks_test.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "errors" + "io" "net/http" "testing" @@ -22,8 +23,7 @@ func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { type httpMock struct { *transport.HTTP - Request *http.Request - ResponseMock *http.Response + Handler func(req *http.Request) (*http.Response, error) } func newHTTPMock() *httpMock { @@ -32,8 +32,7 @@ func newHTTPMock() *httpMock { URL: "http://localhost", HTTPClient: &http.Client{ Transport: roundTripFunc(func(req *http.Request) (*http.Response, error) { - h.Request = req - return h.ResponseMock, nil + return h.Handler(req) }), }, }) @@ -118,3 +117,8 @@ func (k *keyMock) VerifyHash(ctx context.Context, hash types.Hash, sig types.Sig func (k keyMock) VerifyMessage(ctx context.Context, data []byte, sig types.Signature) bool { return false } + +func readBody(r *http.Request) string { + body, _ := io.ReadAll(r.Body) + return string(body) +} diff --git a/rpc/rpc.go b/rpc/rpc.go index 1c5c03c..c268e80 100644 --- a/rpc/rpc.go +++ b/rpc/rpc.go @@ -8,72 +8,7 @@ import ( ) // RPC is an RPC client for the Ethereum-compatible nodes. -type RPC interface { - // ClientVersion performs web3_clientVersion RPC call. - // - // It returns the current client version. - ClientVersion(ctx context.Context) (string, error) - - // Listening performs net_listening RPC call. - // - // It returns true if the client is actively listening for network. - Listening(ctx context.Context) (bool, error) - - // PeerCount performs net_peerCount RPC call. - // - // It returns the number of connected peers. - PeerCount(ctx context.Context) (uint64, error) - - // ProtocolVersion performs eth_protocolVersion RPC call. - // - // It returns the current Ethereum protocol version. - ProtocolVersion(ctx context.Context) (uint64, error) - - // Syncing performs eth_syncing RPC call. - // - // It returns an object with data about the sync status or false. - Syncing(ctx context.Context) (*types.SyncStatus, error) - - // NetworkID performs net_version RPC call. - // - // It returns the current network ID. - NetworkID(ctx context.Context) (uint64, error) - - // ChainID performs eth_chainId RPC call. - // - // It returns the current chain ID. - ChainID(ctx context.Context) (uint64, error) - - // GasPrice performs eth_gasPrice RPC call. - // - // It returns the current price per gas in wei. - GasPrice(ctx context.Context) (*big.Int, error) - - // Accounts performs eth_accounts RPC call. - // - // It returns the list of addresses owned by the client. - Accounts(ctx context.Context) ([]types.Address, error) - - // BlockNumber performs eth_blockNumber RPC call. - // - // It returns the current block number. - BlockNumber(ctx context.Context) (*big.Int, error) - - // GetBalance performs eth_getBalance RPC call. - // - // It returns the balance of the account of given address in wei. - GetBalance(ctx context.Context, address types.Address, block types.BlockNumber) (*big.Int, error) - - // GetStorageAt performs eth_getStorageAt RPC call. - // - // It returns the value of key in the contract storage at the given - // address. - GetStorageAt(ctx context.Context, account types.Address, key types.Hash, block types.BlockNumber) (*types.Hash, error) - - // GetTransactionCount performs eth_getTransactionCount RPC call. - // - // It returns the number of transactions sent from the given address. - GetTransactionCount(ctx context.Context, account types.Address, block types.BlockNumber) (uint64, error) +type RPC2 interface { // GetBlockTransactionCountByHash performs eth_getBlockTransactionCountByHash RPC call. // @@ -90,16 +25,6 @@ type RPC interface { // It returns the number of uncles in the block with the given hash. GetUncleCountByBlockHash(ctx context.Context, hash types.Hash) (uint64, error) - // GetUncleCountByBlockNumber performs eth_getUncleCountByBlockNumber RPC call. - // - // It returns the number of uncles in the block with the given block number. - GetUncleCountByBlockNumber(ctx context.Context, number types.BlockNumber) (uint64, error) - - // GetCode performs eth_getCode RPC call. - // - // It returns the contract code at the given address. - GetCode(ctx context.Context, account types.Address, block types.BlockNumber) ([]byte, error) - // Sign performs eth_sign RPC call. // // It signs the given data with the given address. @@ -110,14 +35,14 @@ type RPC interface { // It signs the given transaction. // // If transaction was internally mutated, the mutated call is returned. - SignTransaction(ctx context.Context, tx *types.Transaction) ([]byte, *types.Transaction, error) + SignTransaction(ctx context.Context, tx types.Transaction) (types.Transaction, error) // SendTransaction performs eth_sendTransaction RPC call. // // It sends a transaction to the network. // // If transaction was internally mutated, the mutated call is returned. - SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, *types.Transaction, error) + SendTransaction(ctx context.Context, tx types.Transaction) (*types.Hash, error) // SendRawTransaction performs eth_sendRawTransaction RPC call. // @@ -130,14 +55,14 @@ type RPC interface { // transaction on the blockchain. // // If call was internally mutated, the mutated call is returned. - Call(ctx context.Context, call *types.Call, block types.BlockNumber) ([]byte, *types.Call, error) + Call(ctx context.Context, call types.Call, block types.BlockNumber) ([]byte, error) // EstimateGas performs eth_estimateGas RPC call. // // It estimates the gas necessary to execute a specific transaction. // // If call was internally mutated, the mutated call is returned. - EstimateGas(ctx context.Context, call *types.Call, block types.BlockNumber) (uint64, *types.Call, error) + EstimateGas(ctx context.Context, call types.Call, block types.BlockNumber) (uint64, error) // BlockByHash performs eth_getBlockByHash RPC call. // @@ -152,17 +77,17 @@ type RPC interface { // GetTransactionByHash performs eth_getTransactionByHash RPC call. // // It returns the information about a transaction requested by transaction. - GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.OnChainTransaction, error) + GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.TransactionOnChain, error) // GetTransactionByBlockHashAndIndex performs eth_getTransactionByBlockHashAndIndex RPC call. // // It returns the information about a transaction requested by transaction. - GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.OnChainTransaction, error) + GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.TransactionOnChain, error) // GetTransactionByBlockNumberAndIndex performs eth_getTransactionByBlockNumberAndIndex RPC call. // // It returns the information about a transaction requested by transaction. - GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.OnChainTransaction, error) + GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.TransactionOnChain, error) // GetTransactionReceipt performs eth_getTransactionReceipt RPC call. // diff --git a/rpc/transport/hijack.go b/rpc/transport/hijack.go new file mode 100644 index 0000000..0351894 --- /dev/null +++ b/rpc/transport/hijack.go @@ -0,0 +1,131 @@ +package transport + +import ( + "context" + "encoding/json" +) + +const hijackerKey = "goeth_transport_hijackers" + +type ( + // Hijacker is used to intercept and modify calls to the underlying + // Transport. It employs the middleware pattern to facilitate the use of + // multiple hijackers. The 'next' function should be invoked to proceed + // with the call chain. The transport provided to the 'next' function is an + // instance of the underlying Transport. Using it will bypass any + // subsequent hijackers. + Hijacker interface { + // Call returns a CallFunc that intercepts and modifies the Call + // method. If nil is returned, the Call method is not modified. + Call() func(next CallFunc) CallFunc + + // Subscribe returns a SubscribeFunc that intercepts and modifies the + // Subscribe method. If nil is returned, the Subscribe method is not + // modified. + Subscribe() func(next SubscribeFunc) SubscribeFunc + + // Unsubscribe returns an UnsubscribeFunc that intercepts and modifies + // the Unsubscribe method. If nil is returned, the Unsubscribe method + // is not modified. + Unsubscribe() func(next UnsubscribeFunc) UnsubscribeFunc + } + + CallFunc func(ctx context.Context, t Transport, result any, method string, args ...any) error + SubscribeFunc func(ctx context.Context, t SubscriptionTransport, method string, args ...any) (ch chan json.RawMessage, id string, err error) + UnsubscribeFunc func(ctx context.Context, t SubscriptionTransport, id string) error +) + +// Hijack is a wrapper around another Transport that allows for hijacking +// and modifying the behavior of the underlying Transport. +// +// To use Hijack, create a new Hijack instance with the underlying Transport +// and then use the Use method to add any number of hijackers. The hijackers +// will be called in the order they are added. +// +// Hijackers must implement one or more of the Hijacker, SubscribeHijacker, +// and UnsubscribeHijacker interfaces. +type Hijack struct { + transport Transport + callFunc CallFunc + subFunc SubscribeFunc + unsubFunc UnsubscribeFunc +} + +func NewHijacker(t Transport, hs ...Hijacker) *Hijack { + h := &Hijack{ + transport: t, + callFunc: defCall, + subFunc: defSub, + unsubFunc: defUnsub, + } + h.Use(hs...) + return h +} + +func (h *Hijack) Use(hs ...Hijacker) { + for _, m := range hs { + if m == nil { + continue + } + if call := m.Call(); call != nil { + h.callFunc = call(h.callFunc) + } + if sub := m.Subscribe(); sub != nil { + h.subFunc = sub(h.subFunc) + } + if unsub := m.Unsubscribe(); unsub != nil { + h.unsubFunc = unsub(h.unsubFunc) + } + } +} + +func (h *Hijack) Call(ctx context.Context, result any, method string, args ...any) error { + hs := getHijackers(ctx) + if len(hs) == 0 { + return h.callFunc(ctx, h.transport, result, method, args...) + } + fn := h.callFunc + for i := len(hs) - 1; i >= 0; i-- { + if call := hs[i].Call(); call != nil { + fn = call(fn) + } + } + return fn(ctx, h.transport, result, method, args...) +} + +func (h *Hijack) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { + if s, ok := h.transport.(SubscriptionTransport); ok { + return h.subFunc(ctx, s, method, args...) + } + return nil, "", ErrNotSubscriptionTransport +} + +func (h *Hijack) Unsubscribe(ctx context.Context, id string) error { + if s, ok := h.transport.(SubscriptionTransport); ok { + return h.unsubFunc(ctx, s, id) + } + return ErrNotSubscriptionTransport +} + +func WithHijackers(ctx context.Context, hs ...Hijacker) context.Context { + return context.WithValue(ctx, hijackerKey, append(getHijackers(ctx), hs...)) +} + +func getHijackers(ctx context.Context) []Hijacker { + if hs, ok := ctx.Value(hijackerKey).([]Hijacker); ok { + return hs + } + return nil +} + +func defCall(ctx context.Context, t Transport, result any, method string, args ...any) error { + return t.Call(ctx, result, method, args...) +} + +func defSub(ctx context.Context, t SubscriptionTransport, method string, args ...any) (ch chan json.RawMessage, id string, err error) { + return t.Subscribe(ctx, method, args...) +} + +func defUnsub(ctx context.Context, t SubscriptionTransport, id string) error { + return t.Unsubscribe(ctx, id) +} diff --git a/rpc/transport/http.go b/rpc/transport/http.go index 413c84e..dd04655 100644 --- a/rpc/transport/http.go +++ b/rpc/transport/http.go @@ -68,6 +68,9 @@ func (h *HTTP) Call(ctx context.Context, result any, method string, args ...any) if err := json.NewDecoder(httpRes.Body).Decode(rpcRes); err != nil { // If the response is not a valid JSON-RPC response, return the HTTP // status code as the error code. + if httpRes.StatusCode >= 200 && httpRes.StatusCode < 300 { + return fmt.Errorf("failed to unmarshal RPC response: %w", err) + } return NewHTTPError(httpRes.StatusCode, nil) } if rpcRes.Error != nil { diff --git a/rpc/util.go b/rpc/util.go index 5bade5c..b75b480 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -1,32 +1,65 @@ package rpc import ( + "context" "encoding/json" + "errors" + "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) +// subscribe creates a subscription to the given method and returns a channel +// that will receive the subscription messages. The messages are unmarshalled +// to the T type. The subscription is unsubscribed and channel closed when the +// context is cancelled. +func subscribe[T any](ctx context.Context, t transport.Transport, method string, params ...any) (chan T, error) { + st, ok := t.(transport.SubscriptionTransport) + if !ok { + return nil, errors.New("transport does not support subscriptions") + } + rawCh, subID, err := st.Subscribe(ctx, method, params...) + if err != nil { + return nil, err + } + msgCh := make(chan T) + go func() { + defer close(msgCh) + defer st.Unsubscribe(ctx, subID) + for { + select { + case <-ctx.Done(): + return + case raw, ok := <-rawCh: + if !ok { + return + } + var msg T + if err := json.Unmarshal(raw, &msg); err != nil { + continue + } + msgCh <- msg + } + } + }() + return msgCh, nil +} + // signTransactionResult is the result of an eth_signTransaction request. // Some backends return only RLP encoded data, others return a JSON object, // this type can handle both. type signTransactionResult struct { - Raw types.Bytes `json:"raw"` - Tx *types.Transaction `json:"tx"` + Raw types.Bytes `json:"raw"` } func (s *signTransactionResult) UnmarshalJSON(input []byte) error { if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { return json.Unmarshal(input, &s.Raw) } - type alias struct { - Raw types.Bytes `json:"raw"` - Tx *types.Transaction `json:"tx"` - } - var dec alias + var dec signTransactionResult if err := json.Unmarshal(input, &dec); err != nil { return err } - s.Tx = dec.Tx s.Raw = dec.Raw return nil } diff --git a/types/call.go b/types/call.go new file mode 100644 index 0000000..442e823 --- /dev/null +++ b/types/call.go @@ -0,0 +1,10 @@ +package types + +import "encoding/json" + +type Call interface { + json.Marshaler + json.Unmarshaler + + HasCallData +} diff --git a/types/call_accesslist.go b/types/call_accesslist.go new file mode 100644 index 0000000..9bc638b --- /dev/null +++ b/types/call_accesslist.go @@ -0,0 +1,76 @@ +package types + +import "encoding/json" + +type CallAccessList struct { + EmbedCallData + EmbedLegacyPriceData + EmbedAccessListData +} + +func NewCallAccessList() *CallAccessList { + return &CallAccessList{} +} + +func (c *CallAccessList) Copy() *CallAccessList { + if c == nil { + return nil + } + return &CallAccessList{ + EmbedCallData: *c.EmbedCallData.Copy(), + EmbedLegacyPriceData: *c.EmbedLegacyPriceData.Copy(), + EmbedAccessListData: *c.EmbedAccessListData.Copy(), + } +} + +func (c *CallAccessList) MarshalJSON() ([]byte, error) { + call := &jsonCallAccessList{ + From: c.From, + To: c.To, + Data: c.Input, + AccessList: c.AccessList, + } + if c.GasLimit != nil { + call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) + } + if c.GasPrice != nil { + call.GasPrice = NumberFromBigIntPtr(c.GasPrice) + } + if c.Value != nil { + value := NumberFromBigInt(c.Value) + call.Value = &value + } + return json.Marshal(call) +} + +func (c *CallAccessList) UnmarshalJSON(data []byte) error { + call := &jsonCallAccessList{} + if err := json.Unmarshal(data, call); err != nil { + return err + } + c.From = call.From + c.To = call.To + if call.GasLimit != nil { + gas := call.GasLimit.Big().Uint64() + c.GasLimit = &gas + } + if call.GasPrice != nil { + c.GasPrice = call.GasPrice.Big() + } + if call.Value != nil { + c.Value = call.Value.Big() + } + c.Input = call.Data + c.AccessList = call.AccessList + return nil +} + +type jsonCallAccessList struct { + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + GasPrice *Number `json:"gasPrice,omitempty"` + Value *Number `json:"value,omitempty"` + Data Bytes `json:"data,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` +} diff --git a/types/call_dynamicfee.go b/types/call_dynamicfee.go new file mode 100644 index 0000000..951b801 --- /dev/null +++ b/types/call_dynamicfee.go @@ -0,0 +1,83 @@ +package types + +import "encoding/json" + +type CallDynamicFee struct { + EmbedCallData + EmbedDynamicFeeData + EmbedAccessListData +} + +func NewCallDynamicFee() *CallDynamicFee { + return &CallDynamicFee{} +} + +func (c *CallDynamicFee) Copy() *CallDynamicFee { + if c == nil { + return nil + } + return &CallDynamicFee{ + EmbedCallData: *c.EmbedCallData.Copy(), + EmbedDynamicFeeData: *c.EmbedDynamicFeeData.Copy(), + EmbedAccessListData: *c.EmbedAccessListData.Copy(), + } +} + +func (c *CallDynamicFee) MarshalJSON() ([]byte, error) { + call := &jsonCallDynamicFee{ + From: c.From, + To: c.To, + Data: c.Input, + AccessList: c.AccessList, + } + if c.GasLimit != nil { + call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) + } + if c.MaxFeePerGas != nil { + call.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) + } + if c.MaxPriorityFeePerGas != nil { + call.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) + } + if c.Value != nil { + value := NumberFromBigInt(c.Value) + call.Value = &value + } + return json.Marshal(call) +} + +func (c *CallDynamicFee) UnmarshalJSON(data []byte) error { + call := &jsonCallDynamicFee{} + if err := json.Unmarshal(data, call); err != nil { + return err + } + c.From = call.From + c.To = call.To + if call.GasLimit != nil { + gas := call.GasLimit.Big().Uint64() + c.GasLimit = &gas + } + if call.MaxFeePerGas != nil { + c.MaxFeePerGas = call.MaxFeePerGas.Big() + } + if call.MaxPriorityFeePerGas != nil { + c.MaxPriorityFeePerGas = call.MaxPriorityFeePerGas.Big() + } + if call.Value != nil { + c.Value = call.Value.Big() + } + c.Input = call.Data + c.AccessList = call.AccessList + return nil +} + +type jsonCallDynamicFee struct { + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` + MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` + Value *Number `json:"value,omitempty"` + Data Bytes `json:"data,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` +} diff --git a/types/call_legacy.go b/types/call_legacy.go new file mode 100644 index 0000000..63e07e8 --- /dev/null +++ b/types/call_legacy.go @@ -0,0 +1,71 @@ +package types + +import "encoding/json" + +type CallLegacy struct { + EmbedCallData + EmbedLegacyPriceData +} + +func NewCallLegacy() *CallLegacy { + return &CallLegacy{} +} + +func (c *CallLegacy) Copy() *CallLegacy { + if c == nil { + return nil + } + return &CallLegacy{ + EmbedCallData: *c.EmbedCallData.Copy(), + EmbedLegacyPriceData: *c.EmbedLegacyPriceData.Copy(), + } +} + +func (c CallLegacy) MarshalJSON() ([]byte, error) { + call := &jsonCallLegacy{ + From: c.From, + To: c.To, + Data: c.Input, + } + if c.GasLimit != nil { + call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) + } + if c.GasPrice != nil { + call.GasPrice = NumberFromBigIntPtr(c.GasPrice) + } + if c.Value != nil { + value := NumberFromBigInt(c.Value) + call.Value = &value + } + return json.Marshal(call) +} + +func (c *CallLegacy) UnmarshalJSON(data []byte) error { + call := &jsonCallLegacy{} + if err := json.Unmarshal(data, call); err != nil { + return err + } + c.From = call.From + c.To = call.To + if call.GasLimit != nil { + gas := call.GasLimit.Big().Uint64() + c.GasLimit = &gas + } + if call.GasPrice != nil { + c.GasPrice = call.GasPrice.Big() + } + if call.Value != nil { + c.Value = call.Value.Big() + } + c.Input = call.Data + return nil +} + +type jsonCallLegacy struct { + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + GasPrice *Number `json:"gasPrice,omitempty"` + Value *Number `json:"value,omitempty"` + Data Bytes `json:"data,omitempty"` +} diff --git a/types/embed.go b/types/embed.go new file mode 100644 index 0000000..e1a2551 --- /dev/null +++ b/types/embed.go @@ -0,0 +1,197 @@ +package types + +import "math/big" + +// Embedded types are used to embed common fields and methods into call and +// transaction types. + +type HasCallData interface { + CallData() *EmbedCallData + SetCallData(data *EmbedCallData) +} + +type HasTransactionData interface { + TransactionData() *EmbedTransactionData + SetTransactionData(data *EmbedTransactionData) +} + +type HasLegacyPrice interface { + LegacyPriceData() *EmbedLegacyPriceData + SetLegacyPriceData(data *EmbedLegacyPriceData) +} + +type HasAccessListData interface { + AccessListData() *EmbedAccessListData + SetAccessListData(data *EmbedAccessListData) +} + +type HasDynamicFeeData interface { + DynamicFeeData() *EmbedDynamicFeeData + SetDynamicFeeData(data *EmbedDynamicFeeData) +} + +// EmbedCallData is set of common fields for calls and transactions. +type EmbedCallData struct { + From *Address // From is the sender address. + To *Address // To is the recipient address. nil means contract creation. + GasLimit *uint64 // GasLimit is the gas limit, if 0, there is no limit. + Value *big.Int // Value is the amount of wei to send. + Input []byte // Input is the input data. +} + +func (c *EmbedCallData) CallData() *EmbedCallData { + return c +} + +func (c *EmbedCallData) SetCallData(data *EmbedCallData) { + *c = *data +} + +func (c *EmbedCallData) SetFrom(from Address) { + c.From = &from +} + +func (c *EmbedCallData) SetTo(to Address) { + c.To = &to +} + +func (c *EmbedCallData) SetGasLimit(gasLimit uint64) { + c.GasLimit = &gasLimit +} + +func (c *EmbedCallData) SetValue(value *big.Int) { + c.Value = value +} + +func (c *EmbedCallData) SetInput(input []byte) { + c.Input = input +} + +func (c *EmbedCallData) Copy() *EmbedCallData { + if c == nil { + return nil + } + return &EmbedCallData{ + From: copyPtr(c.From), + To: copyPtr(c.To), + GasLimit: copyPtr(c.GasLimit), + Value: copyBigInt(c.Value), + Input: copyBytes(c.Input), + } +} + +// EmbedTransactionData is a set of common fields for transactions. +type EmbedTransactionData struct { + ChainID *uint64 + Nonce *uint64 + Signature *Signature +} + +func (c *EmbedTransactionData) TransactionData() *EmbedTransactionData { + return c +} + +func (c *EmbedTransactionData) SetTransactionData(data *EmbedTransactionData) { + *c = *data +} + +func (c *EmbedTransactionData) SetChainID(chainID uint64) { + c.ChainID = &chainID +} + +func (c *EmbedTransactionData) SetNonce(nonce uint64) { + c.Nonce = &nonce +} + +func (c *EmbedTransactionData) SetSignature(signature Signature) { + c.Signature = &signature +} + +func (c *EmbedTransactionData) Copy() *EmbedTransactionData { + return &EmbedTransactionData{ + ChainID: copyPtr(c.ChainID), + Nonce: copyPtr(c.Nonce), + Signature: c.Signature.Copy(), + } +} + +type EmbedLegacyPriceData struct { + GasPrice *big.Int +} + +func (c *EmbedLegacyPriceData) LegacyPriceData() *EmbedLegacyPriceData { + return c +} + +func (c *EmbedLegacyPriceData) SetLegacyPriceData(data *EmbedLegacyPriceData) { + *c = *data +} + +func (c *EmbedLegacyPriceData) SetGasPrice(gasPrice *big.Int) { + c.GasPrice = gasPrice +} + +func (c *EmbedLegacyPriceData) Copy() *EmbedLegacyPriceData { + if c == nil { + return nil + } + return &EmbedLegacyPriceData{ + GasPrice: copyBigInt(c.GasPrice), + } +} + +type EmbedAccessListData struct { + AccessList AccessList +} + +func (c *EmbedAccessListData) AccessListData() *EmbedAccessListData { + return c +} + +func (c *EmbedAccessListData) SetAccessListData(data *EmbedAccessListData) { + *c = *data +} + +func (c *EmbedAccessListData) SetAccessList(accessList AccessList) { + c.AccessList = accessList +} + +func (c *EmbedAccessListData) Copy() *EmbedAccessListData { + if c == nil { + return nil + } + return &EmbedAccessListData{ + AccessList: c.AccessList.Copy(), + } +} + +type EmbedDynamicFeeData struct { + MaxFeePerGas *big.Int + MaxPriorityFeePerGas *big.Int +} + +func (c *EmbedDynamicFeeData) DynamicFeeData() *EmbedDynamicFeeData { + return c +} + +func (c *EmbedDynamicFeeData) SetDynamicFeeData(data *EmbedDynamicFeeData) { + *c = *data +} + +func (c *EmbedDynamicFeeData) SetMaxFeePerGas(maxFeePerGas *big.Int) { + c.MaxFeePerGas = maxFeePerGas +} + +func (c *EmbedDynamicFeeData) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) { + c.MaxPriorityFeePerGas = maxPriorityFeePerGas +} + +func (c *EmbedDynamicFeeData) Copy() *EmbedDynamicFeeData { + if c == nil { + return nil + } + return &EmbedDynamicFeeData{ + MaxFeePerGas: copyBigInt(c.MaxFeePerGas), + MaxPriorityFeePerGas: copyBigInt(c.MaxPriorityFeePerGas), + } +} diff --git a/types/structs.go b/types/structs.go index 6ebcb73..16b7d9d 100644 --- a/types/structs.go +++ b/types/structs.go @@ -10,713 +10,6 @@ import ( "github.com/defiweb/go-rlp" ) -// Call represents a call to a contract or a contract creation if To is nil. -type Call struct { - From *Address // From is the sender address. - To *Address // To is the recipient address. nil means contract creation. - GasLimit *uint64 // GasLimit is the gas limit, if 0, there is no limit. - GasPrice *big.Int // GasPrice is the gas price in wei per gas unit. - Value *big.Int // Value is the amount of wei to send. - Input []byte // Input is the input data. - - // EIP-2930 fields: - AccessList AccessList // AccessList is the list of addresses and storage keys that the transaction can access. - - // EIP-1559 fields: - MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas the sender is willing to pay. - MaxFeePerGas *big.Int // MaxFeePerGas is the maximum fee per gas the sender is willing to pay. -} - -func NewCall() *Call { - return &Call{} -} - -func (c *Call) SetFrom(from Address) *Call { - c.From = &from - return c -} - -func (c *Call) SetTo(to Address) *Call { - c.To = &to - return c -} - -func (c *Call) SetGasLimit(gasLimit uint64) *Call { - c.GasLimit = &gasLimit - return c -} - -func (c *Call) SetGasPrice(gasPrice *big.Int) *Call { - c.GasPrice = gasPrice - return c -} - -func (c *Call) SetValue(value *big.Int) *Call { - c.Value = value - return c -} - -func (c *Call) SetInput(input []byte) *Call { - c.Input = input - return c -} - -func (c *Call) SetAccessList(accessList AccessList) *Call { - c.AccessList = accessList - return c -} - -func (c *Call) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) *Call { - c.MaxPriorityFeePerGas = maxPriorityFeePerGas - return c -} - -func (c *Call) SetMaxFeePerGas(maxFeePerGas *big.Int) *Call { - c.MaxFeePerGas = maxFeePerGas - return c -} - -func (c Call) Copy() *Call { - var ( - from *Address - to *Address - gasLimit *uint64 - gasPrice *big.Int - value *big.Int - input []byte - accessList AccessList - maxPriorityFeePerGas *big.Int - maxFeePerGas *big.Int - ) - if c.From != nil { - from = new(Address) - copy(from[:], c.From[:]) - } - if c.To != nil { - to = new(Address) - copy(to[:], c.To[:]) - } - if c.GasLimit != nil { - gasLimit = new(uint64) - *gasLimit = *c.GasLimit - } - if c.GasPrice != nil { - gasPrice = new(big.Int).Set(c.GasPrice) - } - if c.Value != nil { - value = new(big.Int).Set(c.Value) - } - if c.Input != nil { - input = make([]byte, len(c.Input)) - copy(input, c.Input) - } - if c.AccessList != nil { - accessList = c.AccessList.Copy() - } - if c.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = new(big.Int).Set(c.MaxPriorityFeePerGas) - } - if c.MaxFeePerGas != nil { - maxFeePerGas = new(big.Int).Set(c.MaxFeePerGas) - } - return &Call{ - From: from, - To: to, - GasLimit: gasLimit, - GasPrice: gasPrice, - Value: value, - Input: input, - AccessList: accessList, - MaxPriorityFeePerGas: maxPriorityFeePerGas, - MaxFeePerGas: maxFeePerGas, - } -} - -func (c Call) MarshalJSON() ([]byte, error) { - call := &jsonCall{ - From: c.From, - To: c.To, - Data: c.Input, - AccessList: c.AccessList, - } - if c.GasLimit != nil { - call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) - } - if c.GasPrice != nil { - call.GasPrice = NumberFromBigIntPtr(c.GasPrice) - } - if c.MaxFeePerGas != nil { - call.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) - } - if c.MaxPriorityFeePerGas != nil { - call.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) - } - if c.Value != nil { - value := NumberFromBigInt(c.Value) - call.Value = &value - } - return json.Marshal(call) -} - -func (c *Call) UnmarshalJSON(data []byte) error { - call := &jsonCall{} - if err := json.Unmarshal(data, call); err != nil { - return err - } - c.From = call.From - c.To = call.To - if call.GasLimit != nil { - gas := call.GasLimit.Big().Uint64() - c.GasLimit = &gas - } - if call.GasPrice != nil { - c.GasPrice = call.GasPrice.Big() - } - if call.MaxFeePerGas != nil { - c.MaxFeePerGas = call.MaxFeePerGas.Big() - } - if call.MaxPriorityFeePerGas != nil { - c.MaxPriorityFeePerGas = call.MaxPriorityFeePerGas.Big() - } - if call.Value != nil { - c.Value = call.Value.Big() - } - c.Input = call.Data - c.AccessList = call.AccessList - return nil -} - -type jsonCall struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Value *Number `json:"value,omitempty"` - Data Bytes `json:"data,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` -} - -// TransactionType is the type of transaction. -type TransactionType uint64 - -// Transaction types. -const ( - LegacyTxType TransactionType = iota - AccessListTxType - DynamicFeeTxType -) - -// Transaction represents a transaction. -type Transaction struct { - Call - - // Transaction data: - Type TransactionType // Type is the transaction type. - Nonce *uint64 // Nonce is the number of transactions made by the sender prior to this one. - Signature *Signature // Signature of the transaction. - - // EIP-2930 fields: - ChainID *uint64 // ChainID is the chain ID of the transaction. -} - -func NewTransaction() *Transaction { - return &Transaction{} -} - -func (t *Transaction) SetFrom(from Address) *Transaction { - t.From = &from - return t -} - -func (t *Transaction) SetTo(to Address) *Transaction { - t.To = &to - return t -} - -func (t *Transaction) SetGasLimit(gasLimit uint64) *Transaction { - t.GasLimit = &gasLimit - return t -} - -func (t *Transaction) SetGasPrice(gasPrice *big.Int) *Transaction { - t.GasPrice = gasPrice - return t -} - -func (t *Transaction) SetValue(value *big.Int) *Transaction { - t.Value = value - return t -} - -func (t *Transaction) SetInput(input []byte) *Transaction { - t.Input = input - return t -} - -func (t *Transaction) SetAccessList(accessList AccessList) *Transaction { - t.AccessList = accessList - return t -} - -func (t *Transaction) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) *Transaction { - t.MaxPriorityFeePerGas = maxPriorityFeePerGas - return t -} - -func (t *Transaction) SetMaxFeePerGas(maxFeePerGas *big.Int) *Transaction { - t.MaxFeePerGas = maxFeePerGas - return t -} - -func (t *Transaction) SetType(transactionType TransactionType) *Transaction { - t.Type = transactionType - return t -} - -func (t *Transaction) SetNonce(nonce uint64) *Transaction { - t.Nonce = &nonce - return t -} - -func (t *Transaction) SetSignature(signature Signature) *Transaction { - t.Signature = &signature - return t -} - -func (t *Transaction) SetChainID(chainID uint64) *Transaction { - t.ChainID = &chainID - return t -} - -// Raw returns the raw transaction data that could be sent to the network. -func (t Transaction) Raw() ([]byte, error) { - return t.EncodeRLP() -} - -func (t *Transaction) Copy() *Transaction { - var ( - nonce *uint64 - signature *Signature - chainID *uint64 - ) - if t.Nonce != nil { - nonce = new(uint64) - *nonce = *t.Nonce - } - if t.Signature != nil { - signature = t.Signature.Copy() - } - if t.ChainID != nil { - chainID = new(uint64) - *chainID = *t.ChainID - } - return &Transaction{ - Call: *t.Call.Copy(), - Type: t.Type, - Nonce: nonce, - Signature: signature, - ChainID: chainID, - } -} - -func (t Transaction) MarshalJSON() ([]byte, error) { - transaction := &jsonTransaction{} - transaction.To = t.To - transaction.From = t.From - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.GasPrice != nil { - transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) - } - if t.MaxFeePerGas != nil { - transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) - } - if t.MaxPriorityFeePerGas != nil { - transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - transaction.AccessList = t.AccessList - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - return json.Marshal(transaction) -} - -func (t *Transaction) UnmarshalJSON(data []byte) error { - transaction := &jsonTransaction{} - if err := json.Unmarshal(data, transaction); err != nil { - return err - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.GasPrice != nil { - t.GasPrice = transaction.GasPrice.Big() - } - if transaction.MaxFeePerGas != nil { - t.MaxFeePerGas = transaction.MaxFeePerGas.Big() - } - if transaction.MaxPriorityFeePerGas != nil { - t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - t.AccessList = transaction.AccessList - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } - return nil -} - -//nolint:funlen -func (t Transaction) EncodeRLP() ([]byte, error) { - var ( - chainID = uint64(1) - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - accessList = (AccessList)(nil) - v = big.NewInt(0) - r = big.NewInt(0) - s = big.NewInt(0) - ) - if t.ChainID != nil { - chainID = *t.ChainID - } - if t.Nonce != nil { - nonce = *t.Nonce - } - if t.GasPrice != nil { - gasPrice = t.GasPrice - } - if t.GasLimit != nil { - gasLimit = *t.GasLimit - } - if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas - } - if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas - } - if t.To != nil { - to = t.To[:] - } - if t.Value != nil { - value = t.Value - } - if t.AccessList != nil { - accessList = t.AccessList - } - if t.Signature != nil { - v = t.Signature.V - r = t.Signature.R - s = t.Signature.S - } - switch t.Type { - case LegacyTxType: - return rlp.NewList( - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() - case AccessListTxType: - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - &t.AccessList, - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() - if err != nil { - return nil, err - } - return append([]byte{byte(t.Type)}, bin...), nil - case DynamicFeeTxType: - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - &accessList, - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() - if err != nil { - return nil, err - } - return append([]byte{byte(t.Type)}, bin...), nil - default: - return nil, fmt.Errorf("unknown transaction type: %d", t.Type) - } -} - -//nolint:funlen -func (t *Transaction) DecodeRLP(data []byte) (int, error) { - if len(data) == 0 { - return 0, fmt.Errorf("empty data") - } - var ( - list *rlp.ListItem - chainID = &rlp.UintItem{} - nonce = &rlp.UintItem{} - gasPrice = &rlp.BigIntItem{} - gasLimit = &rlp.UintItem{} - maxPriorityFeePerGas = &rlp.BigIntItem{} - maxFeePerGas = &rlp.BigIntItem{} - to = &rlp.StringItem{} - value = &rlp.BigIntItem{} - input = &rlp.StringItem{} - accessList = &AccessList{} - v = &rlp.BigIntItem{} - r = &rlp.BigIntItem{} - s = &rlp.BigIntItem{} - ) - switch { - case data[0] >= 0x80: // LegacyTxType - t.Type = LegacyTxType - list = rlp.NewList( - nonce, - gasPrice, - gasLimit, - to, - value, - input, - v, - r, - s, - ) - case data[0] == byte(AccessListTxType): - t.Type = AccessListTxType - data = data[1:] - list = rlp.NewList( - chainID, - nonce, - gasPrice, - gasLimit, - to, - value, - input, - accessList, - v, - r, - s, - ) - case data[0] == byte(DynamicFeeTxType): - t.Type = DynamicFeeTxType - data = data[1:] - list = rlp.NewList( - chainID, - nonce, - maxPriorityFeePerGas, - maxFeePerGas, - gasLimit, - to, - value, - input, - accessList, - v, - r, - s, - ) - default: - return 0, fmt.Errorf("invalid transaction type: %d", data[0]) - } - if _, err := rlp.DecodeTo(data, list); err != nil { - return 0, err - } - t.ChainID = &chainID.X - t.Nonce = &nonce.X - t.GasPrice = gasPrice.X - t.GasLimit = &gasLimit.X - t.MaxPriorityFeePerGas = maxPriorityFeePerGas.X - t.MaxFeePerGas = maxFeePerGas.X - t.To = AddressFromBytesPtr(to.Bytes()) - t.Value = value.X - if len(input.Bytes()) > 0 { - t.Input = input.Bytes() - } - if len(*accessList) > 0 { - t.AccessList = *accessList - } - if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { - t.Signature = &Signature{ - V: v.X, - R: r.X, - S: s.X, - } - } - return len(data), nil -} - -// Hash returns the hash of the transaction (transaction ID). -func (t Transaction) Hash(h HashFunc) (Hash, error) { - raw, err := t.Raw() - if err != nil { - return Hash{}, err - } - return h(raw), nil -} - -type jsonTransaction struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Input Bytes `json:"input,omitempty"` - Nonce *Number `json:"nonce,omitempty"` - Value *Number `json:"value,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` - V *Number `json:"v,omitempty"` - R *Number `json:"r,omitempty"` - S *Number `json:"s,omitempty"` -} - -// OnChainTransaction represents a transaction that is included in a block. -type OnChainTransaction struct { - Transaction - - // On-chain fields, only available when the transaction is included in a block: - Hash *Hash // Hash of the transaction. - BlockHash *Hash // BlockHash is the hash of the block where this transaction was in. - BlockNumber *big.Int // BlockNumber is the block number where this transaction was in. - TransactionIndex *uint64 // TransactionIndex is the index of the transaction in the block. -} - -type jsonOnChainTransaction struct { - jsonTransaction - Hash *Hash `json:"hash,omitempty"` - BlockHash *Hash `json:"blockHash,omitempty"` - BlockNumber *Number `json:"blockNumber,omitempty"` - TransactionIndex *Number `json:"transactionIndex,omitempty"` -} - -func (t OnChainTransaction) MarshalJSON() ([]byte, error) { - transaction := &jsonOnChainTransaction{} - transaction.To = t.To - transaction.From = t.From - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.GasPrice != nil { - transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) - } - if t.MaxFeePerGas != nil { - transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) - } - if t.MaxPriorityFeePerGas != nil { - transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - transaction.AccessList = t.AccessList - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - transaction.Hash = t.Hash - transaction.BlockHash = t.BlockHash - if t.BlockNumber != nil { - transaction.BlockNumber = NumberFromBigIntPtr(t.BlockNumber) - } - if t.TransactionIndex != nil { - transaction.TransactionIndex = NumberFromUint64Ptr(*t.TransactionIndex) - } - return json.Marshal(transaction) -} - -func (t *OnChainTransaction) UnmarshalJSON(data []byte) error { - transaction := &jsonOnChainTransaction{} - if err := json.Unmarshal(data, transaction); err != nil { - return err - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.GasPrice != nil { - t.GasPrice = transaction.GasPrice.Big() - } - if transaction.MaxFeePerGas != nil { - t.MaxFeePerGas = transaction.MaxFeePerGas.Big() - } - if transaction.MaxPriorityFeePerGas != nil { - t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - t.AccessList = transaction.AccessList - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } - t.Hash = transaction.Hash - t.BlockHash = transaction.BlockHash - if transaction.BlockNumber != nil { - t.BlockNumber = transaction.BlockNumber.Big() - } - if transaction.TransactionIndex != nil { - index := transaction.TransactionIndex.Big().Uint64() - t.TransactionIndex = &index - } - return nil -} - // AccessList is an EIP-2930 access list. type AccessList []AccessTuple @@ -812,6 +105,60 @@ func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { return n, nil } +type TransactionOnChain struct { + Decoder JSONTransactionDecoder // Decoder is an optional transaction decoder, if nil, the default decoder is used. + Transaction Transaction // Transaction is the transaction data. + Hash *Hash // Hash of the transaction. + BlockHash *Hash // BlockHash is the hash of the block where this transaction was in. + BlockNumber *big.Int // BlockNumber is the block number where this transaction was in. + TransactionIndex *uint64 // TransactionIndex is the index of the transaction in the block. +} + +func (t *TransactionOnChain) MarshalJSON() ([]byte, error) { + ocd := &jsonOnChainTransaction{} + ocd.Hash = t.Hash + ocd.BlockHash = t.BlockHash + ocd.BlockNumber = NumberFromBigIntPtr(t.BlockNumber) + if t.TransactionIndex != nil { + ocd.TransactionIndex = NumberFromUint64Ptr(*t.TransactionIndex) + } + return marshalJSONInline( + t.Transaction, + ocd, + ) +} + +func (t *TransactionOnChain) UnmarshalJSON(data []byte) error { + ocd := &jsonOnChainTransaction{} + if err := json.Unmarshal(data, ocd); err != nil { + return err + } + t.Hash = ocd.Hash + t.BlockHash = ocd.BlockHash + t.BlockNumber = ocd.BlockNumber.Big() + if ocd.TransactionIndex != nil { + index := ocd.TransactionIndex.Big().Uint64() + t.TransactionIndex = &index + } + dec := t.Decoder + if dec == nil { + dec = DefaultTransactionDecoder + } + tx, err := dec.DecodeJSON(data) + if err != nil { + return err + } + t.Transaction = tx + return nil +} + +type jsonOnChainTransaction struct { + Hash *Hash `json:"hash,omitempty"` + BlockHash *Hash `json:"blockHash,omitempty"` + BlockNumber *Number `json:"blockNumber,omitempty"` + TransactionIndex *Number `json:"transactionIndex,omitempty"` +} + // TransactionReceipt represents transaction receipt. type TransactionReceipt struct { TransactionHash Hash // TransactionHash is the hash of the transaction. @@ -884,7 +231,7 @@ type jsonTransactionReceipt struct { BlockHash Hash `json:"blockHash"` BlockNumber Number `json:"blockNumber"` From Address `json:"from"` - To Address `json:"to"` + To Address `json:"To"` CumulativeGasUsed Number `json:"cumulativeGasUsed"` EffectiveGasPrice Number `json:"effectiveGasPrice"` GasUsed Number `json:"gasUsed"` @@ -914,7 +261,7 @@ type Block struct { GasUsed uint64 // GasUsed is the total used gas by all transactions in this block. Timestamp time.Time // Timestamp is the time at which the block was collated. Uncles []Hash // Uncles is the list of uncle hashes. - Transactions []OnChainTransaction // Transactions is the list of transactions in the block. + Transactions []TransactionOnChain // Transactions is the list of transactions in the block. TransactionHashes []Hash // TransactionHashes is the list of transaction hashes in the block. ExtraData []byte // ExtraData is the "extra data" field of this block. } @@ -1003,7 +350,7 @@ type jsonBlock struct { } type jsonBlockTransactions struct { - Objects []OnChainTransaction + Objects []TransactionOnChain Hashes []Hash } diff --git a/types/structs_test.go b/types/structs_test.go index 112020b..9a2e343 100644 --- a/types/structs_test.go +++ b/types/structs_test.go @@ -7,162 +7,65 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - - "github.com/defiweb/go-eth/hexutil" ) -//nolint:funlen -func TestTransaction_RLP(t1 *testing.T) { +func TestTransactionOnChain_JSON(t *testing.T) { tests := []struct { - tx *Transaction - want []byte + tx *TransactionOnChain + json string }{ - // Empty transaction: - { - tx: (&Transaction{}). - SetGasLimit(0). - SetGasPrice(big.NewInt(0)). - SetNonce(0). - SetValue(big.NewInt(0)), - want: hexutil.MustHexToBytes("c9808080808080808080"), - }, - // Legacy transaction: - { - tx: (&Transaction{}). - SetType(LegacyTxType). - SetFrom(MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetGasPrice(big.NewInt(1000000000)). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")), - want: hexutil.MustHexToBytes("f87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), - }, - // Access list transaction: { - tx: (&Transaction{}). - SetType(AccessListTxType). - SetFrom(MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetGasPrice(big.NewInt(1000000000)). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetAccessList(AccessList{ - AccessTuple{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}), - want: hexutil.MustHexToBytes("01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), - }, - // Dynamic fee transaction: - { - tx: (&Transaction{}). - SetType(DynamicFeeTxType). - SetFrom(MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetMaxPriorityFeePerGas(big.NewInt(1000000000)). - SetMaxFeePerGas(big.NewInt(2000000000)). - SetAccessList(AccessList{ - AccessTuple{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, + json: ` + { + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "gasPrice": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "blockNumber": "0x3", + "transactionIndex": "0x4" + } + `, + tx: &TransactionOnChain{ + Transaction: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - }), - want: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), - }, - // Dynamic fee transaction with no access list: - { - tx: (&Transaction{}). - SetType(DynamicFeeTxType). - SetFrom(MustAddressFromHex("0x1111111111111111111111111111111111111111")). - SetTo(MustAddressFromHex("0x2222222222222222222222222222222222222222")). - SetGasLimit(100000). - SetInput([]byte{1, 2, 3, 4}). - SetNonce(1). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f")). - SetChainID(1). - SetMaxPriorityFeePerGas(big.NewInt(1000000000)). - SetMaxFeePerGas(big.NewInt(2000000000)), - want: hexutil.MustHexToBytes("02f8770101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304c06fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), - }, - // Example from EIP-155: - { - tx: (&Transaction{}). - SetType(LegacyTxType). - SetChainID(1). - SetTo(MustAddressFromHex("0x3535353535353535353535353535353535353535")). - SetGasLimit(21000). - SetGasPrice(big.NewInt(20000000000)). - SetNonce(9). - SetValue(big.NewInt(1000000000000000000)). - SetSignature(SignatureFromVRS( - func() *big.Int { - v, _ := new(big.Int).SetString("37", 10) - return v - }(), - func() *big.Int { - v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) - return v - }(), - func() *big.Int { - v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) - return v - }(), - )), - want: hexutil.MustHexToBytes("f86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"), + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + Hash: MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), + BlockHash: MustHashFromHexPtr("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + BlockNumber: big.NewInt(3), + TransactionIndex: ptr(uint64(4)), + }, }, } for n, tt := range tests { - t1.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - // Encode - rlp, err := tt.tx.Raw() - require.NoError(t1, err) - assert.Equal(t1, tt.want, rlp) + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + tx := &TransactionOnChain{} - // Decode - tx := new(Transaction) - _, err = tx.DecodeRLP(rlp) - require.NoError(t1, err) - equalTx(t1, tt.tx, tx) - }) - } -} + err := tx.UnmarshalJSON([]byte(tt.json)) + require.NoError(t, err) + assert.Equal(t, tt.tx, tx) -func equalTx(t *testing.T, expected, got *Transaction) { - assert.Equal(t, expected.Type, got.Type) - assert.Equal(t, expected.To, got.To) - assert.Equal(t, expected.GasLimit, got.GasLimit) - assert.Equal(t, expected.GasPrice, got.GasPrice) - assert.Equal(t, expected.Input, got.Input) - assert.Equal(t, expected.Nonce, got.Nonce) - assert.Equal(t, expected.Value, got.Value) - assert.Equal(t, expected.Signature, got.Signature) - if expected.Type != LegacyTxType { - assert.Equal(t, expected.ChainID, got.ChainID) - } - assert.Equal(t, expected.MaxPriorityFeePerGas, got.MaxPriorityFeePerGas) - assert.Equal(t, expected.MaxFeePerGas, got.MaxFeePerGas) - for i, accessTuple := range expected.AccessList { - assert.Equal(t, accessTuple.Address, got.AccessList[i].Address) - assert.Equal(t, accessTuple.StorageKeys, got.AccessList[i].StorageKeys) + j, err := tx.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.json, string(j)) + }) } } diff --git a/types/tx.go b/types/tx.go new file mode 100644 index 0000000..867fbe0 --- /dev/null +++ b/types/tx.go @@ -0,0 +1,64 @@ +package types + +import ( + "encoding/json" + + "github.com/defiweb/go-rlp" +) + +// TransactionType is the type of transaction. +type TransactionType uint8 + +// Transaction types. +const ( + LegacyTxType TransactionType = iota + AccessListTxType + DynamicFeeTxType + BlobTxType +) + +type Transaction interface { + json.Marshaler + json.Unmarshaler + rlp.Item + + HasTransactionData + + // Type returns the type of the transaction. + Type() TransactionType + + // Call returns the call associated with the transaction. The call is a + // copy and can be modified. It may return nil if it is impossible to + // create a call. + Call() Call + + // CalculateHash calculates the hash of the transaction. + CalculateHash(h HashFunc) (Hash, error) + + // CalculateSigningHash calculates the signing hash of the transaction. + CalculateSigningHash(h HashFunc) (Hash, error) +} + +// TransactionDecoder is an interface that is used to decode transactions of +// unknown types. +// +// Decoder may not set the From field of the transaction. +// To get signer of the transaction, use the Recoverer interface. +type TransactionDecoder interface { + RPCTransactionDecoder + JSONTransactionDecoder +} + +// RPCTransactionDecoder is an interface that is used to decode transactions +// from RLP encoded data. +type RPCTransactionDecoder interface { + // DecodeRLP decodes the RLP encoded transaction data. + DecodeRLP(data []byte) (Transaction, error) +} + +// JSONTransactionDecoder is an interface that is used to decode transactions +// from JSON encoded data. +type JSONTransactionDecoder interface { + // DecodeJSON decodes the JSON encoded transaction data. + DecodeJSON(data []byte) (Transaction, error) +} diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go new file mode 100644 index 0000000..c9c33f9 --- /dev/null +++ b/types/tx_accesslist.go @@ -0,0 +1,300 @@ +package types + +import ( + "encoding/json" + "fmt" + "math/big" + + "github.com/defiweb/go-rlp" +) + +type TransactionAccessList struct { + EmbedCallData + EmbedTransactionData + EmbedLegacyPriceData + EmbedAccessListData +} + +func NewTransactionAccessList() *TransactionAccessList { + return &TransactionAccessList{} +} + +func (t *TransactionAccessList) Type() TransactionType { + return AccessListTxType +} + +func (t *TransactionAccessList) Call() Call { + return &CallAccessList{ + EmbedCallData: *t.EmbedCallData.Copy(), + EmbedLegacyPriceData: *t.EmbedLegacyPriceData.Copy(), + EmbedAccessListData: *t.EmbedAccessListData.Copy(), + } +} + +func (t *TransactionAccessList) CalculateHash(h HashFunc) (Hash, error) { + raw, err := t.EncodeRLP() + if err != nil { + return ZeroHash, err + } + return h(raw), nil +} + +func (t *TransactionAccessList) CalculateSigningHash(h HashFunc) (Hash, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasPrice = big.NewInt(0) + gasLimit = uint64(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasPrice != nil { + gasPrice = t.GasPrice + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(gasPrice), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + ).EncodeRLP() + if err != nil { + return ZeroHash, err + } + bin = append([]byte{byte(AccessListTxType)}, bin...) + return h(bin), nil +} + +//nolint:funlen +func (t TransactionAccessList) EncodeRLP() ([]byte, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasPrice = big.NewInt(0) + gasLimit = uint64(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + v = big.NewInt(0) + r = big.NewInt(0) + s = big.NewInt(0) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasPrice != nil { + gasPrice = t.GasPrice + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + if t.Signature != nil { + v = t.Signature.V + r = t.Signature.R + s = t.Signature.S + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(gasPrice), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + rlp.NewBigInt(v), + rlp.NewBigInt(r), + rlp.NewBigInt(s), + ).EncodeRLP() + if err != nil { + return nil, err + } + return append([]byte{byte(AccessListTxType)}, bin...), nil +} + +//nolint:funlen +func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { + *t = TransactionAccessList{} + if len(data) == 0 { + return 0, fmt.Errorf("empty data") + } + if data[0] != byte(AccessListTxType) { + return 0, fmt.Errorf("invalid transaction type: %d", data[0]) + } + data = data[1:] + var ( + list *rlp.ListItem + chainID = &rlp.UintItem{} + nonce = &rlp.UintItem{} + gasPrice = &rlp.BigIntItem{} + gasLimit = &rlp.UintItem{} + to = &rlp.StringItem{} + value = &rlp.BigIntItem{} + input = &rlp.StringItem{} + accessList = &AccessList{} + v = &rlp.BigIntItem{} + r = &rlp.BigIntItem{} + s = &rlp.BigIntItem{} + ) + list = rlp.NewList( + chainID, + nonce, + gasPrice, + gasLimit, + to, + value, + input, + accessList, + v, + r, + s, + ) + if _, err := rlp.DecodeTo(data, list); err != nil { + return 0, err + } + if chainID.X != 0 { + t.ChainID = &chainID.X + } + if nonce.X != 0 { + t.Nonce = &nonce.X + } + if gasPrice.X.Sign() != 0 { + t.GasPrice = gasPrice.X + } + if gasLimit.X != 0 { + t.GasLimit = &gasLimit.X + } + if len(to.Bytes()) > 0 { + t.To = AddressFromBytesPtr(to.Bytes()) + } + if value.X.Sign() != 0 { + t.Value = value.X + } + if len(input.Bytes()) > 0 { + t.Input = input.Bytes() + } + if len(*accessList) > 0 { + t.AccessList = *accessList + } + if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + t.Signature = &Signature{ + V: v.X, + R: r.X, + S: s.X, + } + } + return len(data), nil +} + +func (t *TransactionAccessList) MarshalJSON() ([]byte, error) { + transaction := &jsonTransactionAccessList{} + if t.ChainID != nil { + transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) + } + transaction.To = t.To + transaction.From = t.From + if t.GasLimit != nil { + transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) + } + if t.GasPrice != nil { + transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) + } + transaction.Input = t.Input + if t.Nonce != nil { + transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) + } + if t.Value != nil { + transaction.Value = NumberFromBigIntPtr(t.Value) + } + transaction.AccessList = t.AccessList + if t.Signature != nil { + transaction.V = NumberFromBigIntPtr(t.Signature.V) + transaction.R = NumberFromBigIntPtr(t.Signature.R) + transaction.S = NumberFromBigIntPtr(t.Signature.S) + } + return json.Marshal(transaction) +} + +func (t *TransactionAccessList) UnmarshalJSON(data []byte) error { + transaction := &jsonTransactionAccessList{} + if err := json.Unmarshal(data, transaction); err != nil { + return err + } + if transaction.ChainID != nil { + chainID := transaction.ChainID.Big().Uint64() + t.ChainID = &chainID + } + t.To = transaction.To + t.From = transaction.From + if transaction.GasLimit != nil { + gas := transaction.GasLimit.Big().Uint64() + t.GasLimit = &gas + } + if transaction.GasPrice != nil { + t.GasPrice = transaction.GasPrice.Big() + } + t.Input = transaction.Input + if transaction.Nonce != nil { + nonce := transaction.Nonce.Big().Uint64() + t.Nonce = &nonce + } + if transaction.Value != nil { + t.Value = transaction.Value.Big() + } + t.AccessList = transaction.AccessList + if transaction.V != nil && transaction.R != nil && transaction.S != nil { + t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) + } + return nil +} + +type jsonTransactionAccessList struct { + ChainID *Number `json:"chainId,omitempty"` + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + GasPrice *Number `json:"gasPrice,omitempty"` + Input Bytes `json:"input,omitempty"` + Nonce *Number `json:"nonce,omitempty"` + Value *Number `json:"value,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` + V *Number `json:"v,omitempty"` + R *Number `json:"r,omitempty"` + S *Number `json:"s,omitempty"` +} + +var _ Transaction = (*TransactionAccessList)(nil) diff --git a/types/tx_accesslist_test.go b/types/tx_accesslist_test.go new file mode 100644 index 0000000..5f025f0 --- /dev/null +++ b/types/tx_accesslist_test.go @@ -0,0 +1,134 @@ +package types + +import ( + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" +) + +func TestTransactionAccessList_RLP(t *testing.T) { + tests := []struct { + tx *TransactionAccessList + want []byte + }{ + { + tx: &TransactionAccessList{}, + want: hexutil.MustHexToBytes("01cb80808080808080c0808080"), + }, + { + tx: &TransactionAccessList{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + want: hexutil.MustHexToBytes("01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + // Encode: + rlp, err := tt.tx.EncodeRLP() + require.NoError(t1, err) + assert.Equal(t1, tt.want, rlp) + + // Decode: + tx := NewTransactionAccessList() + _, err = tx.DecodeRLP(rlp) + tx.From = tt.tx.From + require.NoError(t1, err) + equalTX(t1, tx, tt.tx) + }) + } +} + +func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { + tests := []struct { + tx *TransactionAccessList + want Hash + }{ + { + tx: &TransactionAccessList{}, + want: MustHashFromHex("0xc0157440e7609b2ddee74686831421f05b238ed4c981363e64df8eb1c1ea6afc", PadNone), + }, + { + tx: &TransactionAccessList{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + want: MustHashFromHex("0x46ba790cdf341de06f08944eecd84721e9ae3c4324098f882597d9817eeba63b", PadNone), + }, + { + tx: &TransactionAccessList{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: AccessList{ + AccessTuple{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + }, + }, + }, + want: MustHashFromHex("0x71cba0039a020b7a524d7746b79bf6d1f8a521eb1a76715d00116ef1c0f56107", PadNone), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + sh, err := tt.tx.CalculateSigningHash(keccak256) + require.NoError(t1, err) + require.Equal(t1, tt.want, sh) + }) + } +} diff --git a/types/tx_decoder.go b/types/tx_decoder.go new file mode 100644 index 0000000..6835c51 --- /dev/null +++ b/types/tx_decoder.go @@ -0,0 +1,146 @@ +package types + +import ( + "encoding/json" + "fmt" +) + +// DefaultTransactionDecoder is used to decode transactions when no other +// decoder is specified. Default implementation is used to decode Ethereum +// transactions. +var DefaultTransactionDecoder = &TypedTransactionDecoder{ + Types: map[TransactionType]func() Transaction{ + LegacyTxType: func() Transaction { return NewTransactionLegacy() }, + AccessListTxType: func() Transaction { return NewTransactionAccessList() }, + DynamicFeeTxType: func() Transaction { return NewTransactionDynamicFee() }, + }, + IgnoreUnknownTypes: true, +} + +// TypedTransactionDecoder is am implementation of TransactionDecoder that +// could decode different types of transactions specified in the Types map. +type TypedTransactionDecoder struct { + // Types is a map of transaction types to their constructors. + Types map[TransactionType]func() Transaction + + // IgnoreUnknownTypes specifies whether to ignore unknown transaction types + // or return an error. + IgnoreUnknownTypes bool +} + +func (e *TypedTransactionDecoder) DecodeRLP(data []byte) (Transaction, error) { + if len(data) == 0 { + return nil, fmt.Errorf("empty transaction data") + } + typ := TransactionType(data[0]) + if typ >= 0x80 { + typ = LegacyTxType + } + tx := e.new(typ) + if e.IgnoreUnknownTypes && tx == nil { + return &TransactionUnknown{UnknownType: typ}, nil + } + if tx == nil { + return nil, fmt.Errorf("unknown transaction type: %d", typ) + } + _, err := tx.DecodeRLP(data) + if err != nil { + return nil, fmt.Errorf("failed to decode transaction: %w", err) + } + return tx, nil +} + +func (e *TypedTransactionDecoder) DecodeJSON(data []byte) (Transaction, error) { + typ, err := jsonTXType(data) + if err != nil { + return nil, err + } + tx := e.new(typ) + if e.IgnoreUnknownTypes && tx == nil { + return &TransactionUnknown{UnknownType: typ}, nil + } + if tx == nil { + return nil, fmt.Errorf("unknown transaction type: %d", typ) + } + if err := json.Unmarshal(data, tx); err != nil { + return nil, fmt.Errorf("failed to unmarshal transaction: %w", err) + } + return tx, nil +} + +func (e *TypedTransactionDecoder) new(typ TransactionType) Transaction { + if f, ok := e.Types[typ]; ok { + return f() + } + return nil +} + +// TransactionUnknown represent a transaction of unknown type. +// +// This type is returned by TransactionDecoder when it is unable to decode a +// transaction of a specific type. +type TransactionUnknown struct { + UnknownType TransactionType +} + +func (t *TransactionUnknown) MarshalJSON() ([]byte, error) { + return nil, fmt.Errorf("unable to marshal unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) UnmarshalJSON(_ []byte) error { + return fmt.Errorf("unable to unmarshal unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) EncodeRLP() ([]byte, error) { + return nil, fmt.Errorf("unable to encode unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) DecodeRLP(_ []byte) (int, error) { + return 0, fmt.Errorf("unable to decode unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) TransactionData() *EmbedTransactionData { return nil } + +func (t *TransactionUnknown) SetTransactionData(_ *EmbedTransactionData) {} + +func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } + +func (t *TransactionUnknown) Call() Call { return nil } + +func (t *TransactionUnknown) CalculateHash(_ HashFunc) (Hash, error) { + return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) CalculateSigningHash(_ HashFunc) (Hash, error) { + return ZeroHash, fmt.Errorf("unable to calculate signing hash of unknown transaction type: %d", t.UnknownType) +} + +// jsonTXType returns the type of the transaction encoded in JSON. +// +// If type is not specified, it tries to guess the type using the same rules as +// in go-ethereum code: +// https://github.com/ethereum/go-ethereum/blob/5b3e3cd2bee284db7d7deaa5986544d356410dcb/internal/ethapi/transaction_args.go#L472 +func jsonTXType(data []byte) (TransactionType, error) { + var tx struct { + Type *Number `json:"type"` + AccessList *nilUnmarshaler `json:"accessList"` + MaxFeePerGas *nilUnmarshaler `json:"maxFeePerGas"` + } + if err := json.Unmarshal(data, &tx); err != nil { + return 0, fmt.Errorf("failed to unmarshal transaction: %w", err) + } + if tx.Type != nil { + return TransactionType((*tx.Type).Big().Uint64()), nil + } + if tx.MaxFeePerGas != nil { + return DynamicFeeTxType, nil + } + if tx.AccessList != nil { + return AccessListTxType, nil + } + return LegacyTxType, nil +} + +type nilUnmarshaler struct{} + +func (*nilUnmarshaler) UnmarshalJSON([]byte) error { return nil } diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go new file mode 100644 index 0000000..f54e3a8 --- /dev/null +++ b/types/tx_decoder_test.go @@ -0,0 +1,364 @@ +package types + +import ( + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" +) + +func TestTransaction_RLP(t *testing.T) { + tests := []struct { + tx Transaction + rlp []byte + }{ + { + tx: &TransactionLegacy{}, + rlp: hexutil.MustHexToBytes("c9808080808080808080"), + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(38)), + Nonce: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + rlp: hexutil.MustHexToBytes("f87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(9)), + Signature: SignatureFromVRSPtr( + func() *big.Int { + v, _ := new(big.Int).SetString("37", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) + return v + }(), + ), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(20000000000), + }, + }, + rlp: hexutil.MustHexToBytes("f86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"), + }, + { + tx: &TransactionAccessList{}, + rlp: hexutil.MustHexToBytes("01cb80808080808080c0808080"), + }, + { + tx: &TransactionAccessList{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + rlp: hexutil.MustHexToBytes("01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + { + tx: &TransactionDynamicFee{}, + rlp: hexutil.MustHexToBytes("02cc8080808080808080c0808080"), + }, + { + tx: &TransactionDynamicFee{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + rlp: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + tx, err := DefaultTransactionDecoder.DecodeRLP(tt.rlp) + require.NoError(t, err) + assert.Equal(t, tt.tx, tx) + }) + } +} + +func TestTransaction_JSON(t *testing.T) { + tests := []struct { + tx Transaction + json string + }{ + { + tx: &TransactionLegacy{}, + json: `{}`, + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + json: ` + { + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "gasPrice": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + } + `, + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(9)), + Signature: SignatureFromVRSPtr( + func() *big.Int { + v, _ := new(big.Int).SetString("37", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) + return v + }(), + ), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(20000000000), + }, + }, + json: ` + { + "to": "0x3535353535353535353535353535353535353535", + "gas": "0x5208", + "gasPrice": "0x4a817c800", + "nonce": "0x9", + "value": "0xde0b6b3a7640000", + "v": "0x25", + "r": "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276", + "s": "0x67cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83" + } + `, + }, + { + tx: &TransactionAccessList{}, + json: ` + { + "type": "0x1" + } + `, + }, + { + tx: &TransactionAccessList{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + json: ` + { + "chainId": "0x1", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "gasPrice": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + } + `, + }, + { + tx: &TransactionDynamicFee{}, + json: ` + { + "type": "0x2" + } + `, + }, + { + tx: &TransactionDynamicFee{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + json: ` + { + "chainId": "0x1", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "Nonce": "0x1", + "value": "0xde0b6b3a7640000", + "AccessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + } + `, + }, + { + tx: &TransactionLegacy{}, + json: ` + { + "accessList": [], + "maxFeePerGas": "0x0", + "type": "0x0" + } + `, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + tx, err := DefaultTransactionDecoder.DecodeJSON([]byte(tt.json)) + require.NoError(t, err) + assert.Equal(t, tt.tx, tx) + }) + } +} diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go new file mode 100644 index 0000000..3ff8081 --- /dev/null +++ b/types/tx_dynamicfee.go @@ -0,0 +1,322 @@ +package types + +import ( + "encoding/json" + "fmt" + "math/big" + + "github.com/defiweb/go-rlp" +) + +type TransactionDynamicFee struct { + EmbedCallData + EmbedTransactionData + EmbedAccessListData + EmbedDynamicFeeData +} + +func NewTransactionDynamicFee() *TransactionDynamicFee { + return &TransactionDynamicFee{} +} + +func (t *TransactionDynamicFee) Type() TransactionType { + return DynamicFeeTxType +} + +func (t *TransactionDynamicFee) Call() Call { + return &CallDynamicFee{ + EmbedCallData: *t.EmbedCallData.Copy(), + EmbedAccessListData: *t.EmbedAccessListData.Copy(), + EmbedDynamicFeeData: *t.EmbedDynamicFeeData.Copy(), + } +} + +func (t *TransactionDynamicFee) CalculateHash(h HashFunc) (Hash, error) { + raw, err := t.EncodeRLP() + if err != nil { + return ZeroHash, err + } + return h(raw), nil +} + +func (t *TransactionDynamicFee) CalculateSigningHash(h HashFunc) (Hash, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasLimit = uint64(0) + maxPriorityFeePerGas = big.NewInt(0) + maxFeePerGas = big.NewInt(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.MaxPriorityFeePerGas != nil { + maxPriorityFeePerGas = t.MaxPriorityFeePerGas + } + if t.MaxFeePerGas != nil { + maxFeePerGas = t.MaxFeePerGas + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(maxPriorityFeePerGas), + rlp.NewBigInt(maxFeePerGas), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + ).EncodeRLP() + if err != nil { + return ZeroHash, err + } + bin = append([]byte{byte(DynamicFeeTxType)}, bin...) + return h(bin), nil +} + +//nolint:funlen +func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasLimit = uint64(0) + maxPriorityFeePerGas = big.NewInt(0) + maxFeePerGas = big.NewInt(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + v = big.NewInt(0) + r = big.NewInt(0) + s = big.NewInt(0) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.MaxPriorityFeePerGas != nil { + maxPriorityFeePerGas = t.MaxPriorityFeePerGas + } + if t.MaxFeePerGas != nil { + maxFeePerGas = t.MaxFeePerGas + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + if t.Signature != nil { + v = t.Signature.V + r = t.Signature.R + s = t.Signature.S + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(maxPriorityFeePerGas), + rlp.NewBigInt(maxFeePerGas), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + rlp.NewBigInt(v), + rlp.NewBigInt(r), + rlp.NewBigInt(s), + ).EncodeRLP() + if err != nil { + return nil, err + } + return append([]byte{byte(DynamicFeeTxType)}, bin...), nil +} + +//nolint:funlen +func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { + *t = TransactionDynamicFee{} + if len(data) == 0 { + return 0, fmt.Errorf("empty data") + } + if data[0] != byte(DynamicFeeTxType) { + return 0, fmt.Errorf("invalid transaction type: %d", data[0]) + } + data = data[1:] + var ( + list *rlp.ListItem + chainID = &rlp.UintItem{} + nonce = &rlp.UintItem{} + gasLimit = &rlp.UintItem{} + maxPriorityFeePerGas = &rlp.BigIntItem{} + maxFeePerGas = &rlp.BigIntItem{} + to = &rlp.StringItem{} + value = &rlp.BigIntItem{} + input = &rlp.StringItem{} + accessList = &AccessList{} + v = &rlp.BigIntItem{} + r = &rlp.BigIntItem{} + s = &rlp.BigIntItem{} + ) + list = rlp.NewList( + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, + accessList, + v, + r, + s, + ) + if _, err := rlp.DecodeTo(data, list); err != nil { + return 0, err + } + if chainID.X != 0 { + t.ChainID = &chainID.X + } + if nonce.X != 0 { + t.Nonce = &nonce.X + } + if maxPriorityFeePerGas.X.Sign() != 0 { + t.MaxPriorityFeePerGas = maxPriorityFeePerGas.X + } + if maxFeePerGas.X.Sign() != 0 { + t.MaxFeePerGas = maxFeePerGas.X + } + if gasLimit.X != 0 { + t.GasLimit = &gasLimit.X + } + if len(to.Bytes()) > 0 { + t.To = AddressFromBytesPtr(to.Bytes()) + } + if value.X.Sign() != 0 { + t.Value = value.X + } + if len(input.Bytes()) > 0 { + t.Input = input.Bytes() + } + if len(*accessList) > 0 { + t.AccessList = *accessList + } + if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + t.Signature = &Signature{ + V: v.X, + R: r.X, + S: s.X, + } + } + return len(data), nil +} + +func (t *TransactionDynamicFee) MarshalJSON() ([]byte, error) { + transaction := &jsonTransactionDynamicFee{} + if t.ChainID != nil { + transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) + } + transaction.To = t.To + transaction.From = t.From + if t.GasLimit != nil { + transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) + } + if t.MaxFeePerGas != nil { + transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) + } + if t.MaxPriorityFeePerGas != nil { + transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) + } + transaction.Input = t.Input + if t.Nonce != nil { + transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) + } + if t.Value != nil { + transaction.Value = NumberFromBigIntPtr(t.Value) + } + transaction.AccessList = t.AccessList + if t.Signature != nil { + transaction.V = NumberFromBigIntPtr(t.Signature.V) + transaction.R = NumberFromBigIntPtr(t.Signature.R) + transaction.S = NumberFromBigIntPtr(t.Signature.S) + } + return json.Marshal(transaction) +} + +func (t *TransactionDynamicFee) UnmarshalJSON(data []byte) error { + transaction := &jsonTransactionDynamicFee{} + if err := json.Unmarshal(data, transaction); err != nil { + return err + } + if transaction.ChainID != nil { + chainID := transaction.ChainID.Big().Uint64() + t.ChainID = &chainID + } + t.To = transaction.To + t.From = transaction.From + if transaction.GasLimit != nil { + gas := transaction.GasLimit.Big().Uint64() + t.GasLimit = &gas + } + if transaction.MaxFeePerGas != nil { + t.MaxFeePerGas = transaction.MaxFeePerGas.Big() + } + if transaction.MaxPriorityFeePerGas != nil { + t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() + } + t.Input = transaction.Input + if transaction.Nonce != nil { + Nonce := transaction.Nonce.Big().Uint64() + t.Nonce = &Nonce + } + if transaction.Value != nil { + t.Value = transaction.Value.Big() + } + t.AccessList = transaction.AccessList + if transaction.V != nil && transaction.R != nil && transaction.S != nil { + t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) + } + return nil +} + +type jsonTransactionDynamicFee struct { + ChainID *Number `json:"chainId,omitempty"` + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` + MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` + Input Bytes `json:"input,omitempty"` + Nonce *Number `json:"nonce,omitempty"` + Value *Number `json:"value,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` + V *Number `json:"v,omitempty"` + R *Number `json:"r,omitempty"` + S *Number `json:"s,omitempty"` +} + +var _ Transaction = (*TransactionDynamicFee)(nil) diff --git a/types/tx_dynamicfee_test.go b/types/tx_dynamicfee_test.go new file mode 100644 index 0000000..35e4756 --- /dev/null +++ b/types/tx_dynamicfee_test.go @@ -0,0 +1,137 @@ +package types + +import ( + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" +) + +func TestTransactionDynamicFee_RLP(t *testing.T) { + tests := []struct { + tx *TransactionDynamicFee + want []byte + }{ + { + tx: &TransactionDynamicFee{}, + want: hexutil.MustHexToBytes("02cc8080808080808080c0808080"), + }, + { + tx: &TransactionDynamicFee{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + want: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + // Encode: + rlp, err := tt.tx.EncodeRLP() + require.NoError(t1, err) + assert.Equal(t1, tt.want, rlp) + + // Decode: + tx := NewTransactionDynamicFee() + _, err = tx.DecodeRLP(rlp) + tx.From = tt.tx.From + require.NoError(t1, err) + equalTX(t1, tx, tt.tx) + }) + } +} + +func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { + tests := []struct { + tx *TransactionDynamicFee + want Hash + }{ + { + tx: &TransactionDynamicFee{}, + want: MustHashFromHex("0x292edeba1be7c90f4dbaed50c44b7f6378633f933202ffe4f547e5a5c2ca3304", PadNone), + }, + { + tx: &TransactionDynamicFee{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + }, + want: MustHashFromHex("0xc3266152306909bfe339f90fad4f73f958066860300b5a22b98ee6a1d629706c", PadNone), + }, + { + tx: &TransactionDynamicFee{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: AccessList{ + AccessTuple{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + }, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + }, + want: MustHashFromHex("0xa66ab756479bfd56f29658a8a199319094e84711e8a2de073ec136ef5179c4c9", PadNone), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + sh, err := tt.tx.CalculateSigningHash(keccak256) + require.NoError(t1, err) + require.Equal(t1, tt.want, sh) + }) + } +} diff --git a/types/tx_legacy.go b/types/tx_legacy.go new file mode 100644 index 0000000..eebb163 --- /dev/null +++ b/types/tx_legacy.go @@ -0,0 +1,275 @@ +package types + +import ( + "encoding/json" + "fmt" + "math/big" + + "github.com/defiweb/go-rlp" +) + +type TransactionLegacy struct { + EmbedCallData + EmbedTransactionData + EmbedLegacyPriceData +} + +func NewTransactionLegacy() *TransactionLegacy { + return &TransactionLegacy{} +} + +func (t *TransactionLegacy) Type() TransactionType { + return LegacyTxType +} + +func (t *TransactionLegacy) Call() Call { + return &CallLegacy{ + EmbedCallData: *t.EmbedCallData.Copy(), + EmbedLegacyPriceData: *t.EmbedLegacyPriceData.Copy(), + } +} + +func (t *TransactionLegacy) CalculateHash(h HashFunc) (Hash, error) { + raw, err := t.EncodeRLP() + if err != nil { + return ZeroHash, err + } + return h(raw), nil +} + +func (t *TransactionLegacy) CalculateSigningHash(h HashFunc) (Hash, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasPrice = big.NewInt(0) + gasLimit = uint64(0) + to = ([]byte)(nil) + value = big.NewInt(0) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasPrice != nil { + gasPrice = t.GasPrice + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + list := rlp.NewList( + rlp.NewUint(nonce), + rlp.NewBigInt(gasPrice), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + ) + if t.ChainID != nil && *t.ChainID != 0 { + list.Append( + rlp.NewUint(chainID), + rlp.NewUint(0), + rlp.NewUint(0), + ) + } + bin, err := list.EncodeRLP() + if err != nil { + return ZeroHash, err + } + return h(bin), nil +} + +//nolint:funlen +func (t TransactionLegacy) EncodeRLP() ([]byte, error) { + var ( + nonce = uint64(0) + gasPrice = big.NewInt(0) + gasLimit = uint64(0) + to = ([]byte)(nil) + value = big.NewInt(0) + v = big.NewInt(0) + r = big.NewInt(0) + s = big.NewInt(0) + ) + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasPrice != nil { + gasPrice = t.GasPrice + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.Signature != nil { + v = t.Signature.V + r = t.Signature.R + s = t.Signature.S + } + return rlp.NewList( + rlp.NewUint(nonce), + rlp.NewBigInt(gasPrice), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + rlp.NewBigInt(v), + rlp.NewBigInt(r), + rlp.NewBigInt(s), + ).EncodeRLP() +} + +//nolint:funlen +func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { + *t = TransactionLegacy{} + if len(data) == 0 { + return 0, fmt.Errorf("empty data") + } + var ( + list *rlp.ListItem + nonce = &rlp.UintItem{} + gasPrice = &rlp.BigIntItem{} + gasLimit = &rlp.UintItem{} + to = &rlp.StringItem{} + value = &rlp.BigIntItem{} + input = &rlp.StringItem{} + v = &rlp.BigIntItem{} + r = &rlp.BigIntItem{} + s = &rlp.BigIntItem{} + ) + list = rlp.NewList( + nonce, + gasPrice, + gasLimit, + to, + value, + input, + v, + r, + s, + ) + if _, err := rlp.DecodeTo(data, list); err != nil { + return 0, err + } + if nonce.X != 0 { + t.Nonce = &nonce.X + } + if gasPrice.X.Sign() != 0 { + t.GasPrice = gasPrice.X + } + if gasLimit.X != 0 { + t.GasLimit = &gasLimit.X + } + if len(to.Bytes()) > 0 { + t.To = AddressFromBytesPtr(to.Bytes()) + } + if value.X.Sign() != 0 { + t.Value = value.X + } + if len(input.Bytes()) > 0 { + t.Input = input.Bytes() + } + if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + t.Signature = &Signature{ + V: v.X, + R: r.X, + S: s.X, + } + // Derive chain ID from the V value. + if v.X.Cmp(big.NewInt(35)) >= 0 { + x := new(big.Int).Sub(v.X, big.NewInt(35)) + x = x.Div(x, big.NewInt(2)) + chainID := x.Uint64() + t.ChainID = &chainID + } + } + return len(data), nil +} + +func (t *TransactionLegacy) MarshalJSON() ([]byte, error) { + transaction := &jsonTransactionLegacy{} + transaction.To = t.To + transaction.From = t.From + if t.ChainID != nil { + transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) + } + if t.GasLimit != nil { + transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) + } + if t.GasPrice != nil { + transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) + } + transaction.Input = t.Input + if t.Nonce != nil { + transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) + } + if t.Value != nil { + transaction.Value = NumberFromBigIntPtr(t.Value) + } + if t.Signature != nil { + transaction.V = NumberFromBigIntPtr(t.Signature.V) + transaction.R = NumberFromBigIntPtr(t.Signature.R) + transaction.S = NumberFromBigIntPtr(t.Signature.S) + } + return json.Marshal(transaction) +} + +func (t *TransactionLegacy) UnmarshalJSON(data []byte) error { + transaction := &jsonTransactionLegacy{} + if err := json.Unmarshal(data, transaction); err != nil { + return err + } + if transaction.ChainID != nil { + chainID := transaction.ChainID.Big().Uint64() + t.ChainID = &chainID + } + t.To = transaction.To + t.From = transaction.From + if transaction.GasLimit != nil { + gas := transaction.GasLimit.Big().Uint64() + t.GasLimit = &gas + } + if transaction.GasPrice != nil { + t.GasPrice = transaction.GasPrice.Big() + } + t.Input = transaction.Input + if transaction.Nonce != nil { + nonce := transaction.Nonce.Big().Uint64() + t.Nonce = &nonce + } + if transaction.Value != nil { + t.Value = transaction.Value.Big() + } + if transaction.V != nil && transaction.R != nil && transaction.S != nil { + t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) + } + return nil +} + +type jsonTransactionLegacy struct { + ChainID *Number `json:"chainId,omitempty"` + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + GasPrice *Number `json:"gasPrice,omitempty"` + Input Bytes `json:"input,omitempty"` + Nonce *Number `json:"nonce,omitempty"` + Value *Number `json:"value,omitempty"` + V *Number `json:"v,omitempty"` + R *Number `json:"r,omitempty"` + S *Number `json:"s,omitempty"` +} + +var _ Transaction = (*TransactionLegacy)(nil) diff --git a/types/tx_legacy_test.go b/types/tx_legacy_test.go new file mode 100644 index 0000000..61677a7 --- /dev/null +++ b/types/tx_legacy_test.go @@ -0,0 +1,147 @@ +package types + +import ( + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" +) + +func TestTransactionLegacy_RLP(t *testing.T) { + tests := []struct { + tx *TransactionLegacy + want []byte + }{ + { + tx: &TransactionLegacy{}, + want: hexutil.MustHexToBytes("c9808080808080808080"), + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + want: hexutil.MustHexToBytes("f87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + // Example from EIP-155: + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(9)), + Signature: SignatureFromVRSPtr( + func() *big.Int { + v, _ := new(big.Int).SetString("37", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) + return v + }(), + ), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(20000000000), + }, + }, + want: hexutil.MustHexToBytes("f86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + // Encode: + rlp, err := tt.tx.EncodeRLP() + require.NoError(t1, err) + assert.Equal(t1, tt.want, rlp) + + // Decode: + tx := NewTransactionLegacy() + _, err = tx.DecodeRLP(rlp) + tx.From = tt.tx.From + tx.ChainID = tt.tx.ChainID + require.NoError(t1, err) + equalTX(t1, tx, tt.tx) + }) + } +} + +func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { + tests := []struct { + tx *TransactionLegacy + want Hash + }{ + { + tx: &TransactionLegacy{}, + want: MustHashFromHex("0x5460be86ce1e4ca0564b5761c6e7070d9f054b671f5404268335000806423d75", PadNone), + }, + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(1000000000), + }, + }, + want: MustHashFromHex("0x1efbe489013ac8c0dad2202f68ac12657471df8d80f70e0683ec07b0564a32ca", PadNone), + }, + // Example from EIP-155: + { + tx: &TransactionLegacy{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(9)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + EmbedLegacyPriceData: EmbedLegacyPriceData{ + GasPrice: big.NewInt(20000000000), + }, + }, + want: MustHashFromHex("0xdaf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53", PadNone), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + sh, err := tt.tx.CalculateSigningHash(keccak256) + require.NoError(t1, err) + require.Equal(t1, tt.want, sh) + }) + } +} diff --git a/types/tx_test.go b/types/tx_test.go new file mode 100644 index 0000000..bce5837 --- /dev/null +++ b/types/tx_test.go @@ -0,0 +1,32 @@ +package types + +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" +) + +func equalTX(t *testing.T, actual, expected Transaction) { + assert.Equal(t, derefType(reflect.TypeOf(actual)), derefType(reflect.TypeOf(expected))) + assert.Equal(t, actual.TransactionData(), expected.TransactionData()) + if _, ok := expected.(HasCallData); ok { + assert.Equal(t, actual.(HasCallData).CallData(), actual.(HasCallData).CallData()) + } + if _, ok := actual.(HasLegacyPrice); ok { + assert.Equal(t, expected.(HasLegacyPrice).LegacyPriceData(), actual.(HasLegacyPrice).LegacyPriceData()) + } + if _, ok := actual.(HasAccessListData); ok { + assert.Equal(t, expected.(HasAccessListData).AccessListData(), actual.(HasAccessListData).AccessListData()) + } + if _, ok := actual.(HasDynamicFeeData); ok { + assert.Equal(t, expected.(HasDynamicFeeData).DynamicFeeData(), actual.(HasDynamicFeeData).DynamicFeeData()) + } +} + +func derefType(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Ptr || t.Kind() == reflect.Interface { + t = t.Elem() + } + return t +} diff --git a/types/types.go b/types/types.go index 4bcaf41..f498036 100644 --- a/types/types.go +++ b/types/types.go @@ -295,11 +295,11 @@ func HashFromBigInt(i *big.Int) (Hash, error) { x := new(big.Int).Set(i).And(i, m) b = x.Bytes() if len(b) != HashLength || b[0]&0x80 == 0 { - return Hash{}, fmt.Errorf("number too large to convert to hash") + return Hash{}, fmt.Errorf("number too large To convert To hash") } } if len(b) > HashLength { - return Hash{}, fmt.Errorf("number too large to convert to hash") + return Hash{}, fmt.Errorf("number too large To convert To hash") } return HashFromBytes(b, PadLeft) } diff --git a/types/types_test.go b/types/types_test.go index b6e6c4a..b3beddb 100644 --- a/types/types_test.go +++ b/types/types_test.go @@ -7,7 +7,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "golang.org/x/crypto/sha3" ) func Test_AddressType_Unmarshal(t *testing.T) { @@ -623,11 +622,3 @@ func Test_HashFromBigInt(t *testing.T) { }) } } - -func keccak256(data ...[]byte) Hash { - h := sha3.NewLegacyKeccak256() - for _, i := range data { - h.Write(i) - } - return MustHashFromBytes(h.Sum(nil), PadNone) -} diff --git a/types/units.go b/types/units.go new file mode 100644 index 0000000..668f265 --- /dev/null +++ b/types/units.go @@ -0,0 +1,7 @@ +package types + +const ( + WeiDenomination = 1 + GWeiDenomination = 1e9 + EtherDenomination = 1e18 +) diff --git a/types/util.go b/types/util.go index f55e0b3..d63dfaa 100644 --- a/types/util.go +++ b/types/util.go @@ -2,6 +2,7 @@ package types import ( "bytes" + "encoding/json" "fmt" "math/big" @@ -99,6 +100,38 @@ func numberUnmarshalText(input []byte, output *big.Int) error { return nil } +// marshalJSONInline marshals given values into a single JSON object. +// The given values must marshal into JSON objects. If same field is present in +// multiple values, both are included in the result resulting in an invalid +// JSON object. +func marshalJSONInline(vs ...any) ([]byte, error) { + var ( + buf bytes.Buffer + comma bool + ) + buf.WriteByte('{') + for _, v := range vs { + b, err := json.Marshal(v) + if err != nil { + return nil, err + } + if len(b) > 0 && b[0] != '{' && b[len(b)-1] != '}' { + return nil, fmt.Errorf("expected JSON object, got %s", b) + } + if len(b) <= 2 { + continue + } + if comma { + comma = false + buf.WriteByte(',') + } + comma = true + buf.Write(b[1 : len(b)-1]) + } + buf.WriteByte('}') + return buf.Bytes(), nil +} + // naiveQuote returns a double-quoted string. It does not perform any escaping. func naiveQuote(i []byte) []byte { b := make([]byte, len(i)+2) @@ -116,3 +149,28 @@ func naiveUnquote(i []byte) []byte { } return i } + +func copyPtr[T any](p *T) *T { + if p == nil { + return nil + } + c := *p + return &c +} + +func copyBytes(p []byte) []byte { + if p == nil { + return nil + } + c := make([]byte, len(p)) + copy(c, p) + return c +} + +func copyBigInt(p *big.Int) *big.Int { + if p == nil { + return nil + } + c := new(big.Int).Set(p) + return c +} diff --git a/types/util_test.go b/types/util_test.go new file mode 100644 index 0000000..57bb092 --- /dev/null +++ b/types/util_test.go @@ -0,0 +1,17 @@ +package types + +import ( + "golang.org/x/crypto/sha3" +) + +func keccak256(data ...[]byte) Hash { + h := sha3.NewLegacyKeccak256() + for _, i := range data { + h.Write(i) + } + return MustHashFromBytes(h.Sum(nil), PadNone) +} + +func ptr[T any](x T) *T { + return &x +} diff --git a/wallet/key.go b/wallet/key.go index 74e8f85..e67af44 100644 --- a/wallet/key.go +++ b/wallet/key.go @@ -15,7 +15,7 @@ type Key interface { SignMessage(ctx context.Context, data []byte) (*types.Signature, error) // SignTransaction signs the given transaction. - SignTransaction(ctx context.Context, tx *types.Transaction) error + SignTransaction(ctx context.Context, tx types.Transaction) error // VerifyMessage verifies whether the given data is signed by the key. VerifyMessage(ctx context.Context, data []byte, sig types.Signature) bool diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 3c4e371..30f7a3a 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -83,7 +83,7 @@ func (k *PrivateKey) SignMessage(_ context.Context, data []byte) (*types.Signatu } // SignTransaction implements the Key interface. -func (k *PrivateKey) SignTransaction(_ context.Context, tx *types.Transaction) error { +func (k *PrivateKey) SignTransaction(_ context.Context, tx types.Transaction) error { return k.sign.SignTransaction(tx) } diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index 36c4851..e7be053 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -2,6 +2,7 @@ package wallet import ( "context" + "fmt" "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/types" @@ -11,7 +12,7 @@ import ( // sign messages and transactions. type RPCSigningClient interface { Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) - SignTransaction(ctx context.Context, tx *types.Transaction) ([]byte, *types.Transaction, error) + SignTransaction(ctx context.Context, tx types.Transaction) ([]byte, error) } // KeyRPC is an Ethereum key that uses an RPC client to sign messages and transactions. @@ -19,6 +20,7 @@ type KeyRPC struct { client RPCSigningClient address types.Address recover crypto.Recoverer + decoder types.RPCTransactionDecoder } // NewKeyRPC returns a new KeyRPC. @@ -27,6 +29,7 @@ func NewKeyRPC(client RPCSigningClient, address types.Address) *KeyRPC { client: client, address: address, recover: crypto.ECRecoverer, + decoder: types.DefaultTransactionDecoder, } } @@ -41,12 +44,23 @@ func (k *KeyRPC) SignMessage(ctx context.Context, data []byte) (*types.Signature } // SignTransaction implements the Key interface. -func (k *KeyRPC) SignTransaction(ctx context.Context, tx *types.Transaction) error { - _, signedTX, err := k.client.SignTransaction(ctx, tx) +func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) error { + raw, err := k.client.SignTransaction(ctx, tx) if err != nil { return err } - *tx = *signedTX + stx, err := k.decoder.DecodeRLP(raw) + if err != nil { + return fmt.Errorf("failed to decode signed transaction: %w", err) + } + tx.SetTransactionData(stx.TransactionData()) + addr, err := k.recover.RecoverTransaction(tx) + if err != nil { + return fmt.Errorf("failed to verify signed transaction: %w", err) + } + if *addr != k.address { + return fmt.Errorf("failed to verify signed transaction: recovered address does not match key address") + } return err } From e6f208e00788bde087009066c53fbf3ffac4c852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 3 Sep 2024 02:14:27 +0200 Subject: [PATCH 02/44] Update examples --- examples/call-abi/main.go | 8 +-- examples/call/main.go | 8 +-- examples/contract-json-abi/main.go | 10 +++- examples/events/main.go | 10 ++-- examples/send-tx/main.go | 82 +++++++++++++++--------------- 5 files changed, 62 insertions(+), 56 deletions(-) diff --git a/examples/call-abi/main.go b/examples/call-abi/main.go index 07ebfcd..31b6f0e 100644 --- a/examples/call-abi/main.go +++ b/examples/call-abi/main.go @@ -73,12 +73,12 @@ func main() { }) // Prepare a call. - call := types.NewCall(). - SetTo(types.MustAddressFromHex("0xcA11bde05977b3631167028862bE2a173976CA11")). - SetInput(calldata) + call := types.NewCallLegacy() + call.SetTo(types.MustAddressFromHex("0xcA11bde05977b3631167028862bE2a173976CA11")) + call.SetInput(calldata) // Call the contract. - b, _, err := c.Call(context.Background(), call, types.LatestBlockNumber) + b, err := c.Call(context.Background(), call, types.LatestBlockNumber) if err != nil { panic(err) } diff --git a/examples/call/main.go b/examples/call/main.go index 1acbe17..c1928b2 100644 --- a/examples/call/main.go +++ b/examples/call/main.go @@ -31,12 +31,12 @@ func main() { calldata := balanceOf.MustEncodeArgs("0xd8da6bf26964af9d7eed9e03e53415d37aa96045") // Prepare a call. - call := types.NewCall(). - SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")). - SetInput(calldata) + call := types.NewCallLegacy() + call.SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")) + call.SetInput(calldata) // Call balanceOf. - b, _, err := c.Call(context.Background(), call, types.LatestBlockNumber) + b, err := c.Call(context.Background(), call, types.LatestBlockNumber) if err != nil { panic(err) } diff --git a/examples/contract-json-abi/main.go b/examples/contract-json-abi/main.go index 2c9ed85..685df92 100644 --- a/examples/contract-json-abi/main.go +++ b/examples/contract-json-abi/main.go @@ -3,12 +3,13 @@ package main import ( "fmt" "math/big" + "os" "github.com/defiweb/go-eth/abi" ) func main() { - erc20, err := abi.LoadJSON("erc20.json") + erc20, err := abi.LoadJSON(abiPath()) if err != nil { panic(err) } @@ -24,3 +25,10 @@ func main() { fmt.Printf("Transfer calldata: 0x%x\n", calldata) } + +func abiPath() string { + if _, err := os.Stat("./erc20.json"); err == nil { + return "./key.json" + } + return "./examples/contract-json-abi/erc20.json" +} diff --git a/examples/events/main.go b/examples/events/main.go index 77eb0bc..0cef80a 100644 --- a/examples/events/main.go +++ b/examples/events/main.go @@ -27,11 +27,11 @@ func main() { transfer := abi.MustParseEvent("Transfer(address indexed src, address indexed dst, uint256 wad)") // Create filter query. - query := types.NewFilterLogsQuery(). - SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")). - SetFromBlock(types.BlockNumberFromUint64Ptr(16492400)). - SetToBlock(types.BlockNumberFromUint64Ptr(16492400)). - SetTopics([]types.Hash{transfer.Topic0()}) + query := types.NewFilterLogsQuery() + query.SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")) + query.SetFromBlock(types.BlockNumberFromUint64Ptr(16492400)) + query.SetToBlock(types.BlockNumberFromUint64Ptr(16492400)) + query.SetTopics([]types.Hash{transfer.Topic0()}) // Fetch logs for WETH transfer events. logs, err := c.GetLogs(context.Background(), query) diff --git a/examples/send-tx/main.go b/examples/send-tx/main.go index 3b6545f..99dde7d 100644 --- a/examples/send-tx/main.go +++ b/examples/send-tx/main.go @@ -4,18 +4,18 @@ import ( "context" "fmt" "math/big" + "os" "github.com/defiweb/go-eth/abi" "github.com/defiweb/go-eth/rpc" "github.com/defiweb/go-eth/rpc/transport" - "github.com/defiweb/go-eth/txmodifier" "github.com/defiweb/go-eth/types" "github.com/defiweb/go-eth/wallet" ) func main() { // Load the private key. - key, err := wallet.NewKeyFromJSON("./key.json", "test123") + k, err := wallet.NewKeyFromJSON(keyPath(), "test123") if err != nil { panic(err) } @@ -32,42 +32,33 @@ func main() { rpc.WithTransport(t), // Specify a key for signing transactions. If provided, the client - // uses it with SignTransaction, SendTransaction, and Sign methods - // instead of relying on the node for signing. - rpc.WithKeys(key), - - // Specify a default address for SendTransaction when the transaction - // does not have a 'From' field set. - rpc.WithDefaultAddress(key.Address()), - - // TX modifiers enable modifications to the transaction before signing - // and sending to the node. While not mandatory, without them, transaction - // parameters like gas limit, gas price, and nonce must be set manually. - rpc.WithTXModifiers( - // GasLimitEstimator automatically estimates the gas limit for the - // transaction. - txmodifier.NewGasLimitEstimator(txmodifier.GasLimitEstimatorOptions{ - Multiplier: 1.25, - }), - - // GasFeeEstimator automatically estimates the gas price for the - // transaction based on the current market conditions. - txmodifier.NewEIP1559GasFeeEstimator(txmodifier.EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.25, - PriorityFeePerGasMultiplier: 1.25, - }), - - // NonceProvider automatically sets the nonce for the transaction. - txmodifier.NewNonceProvider(txmodifier.NonceProviderOptions{ - UsePendingBlock: false, - }), - - // ChainIDProvider automatically sets the chain ID for the transaction. - txmodifier.NewChainIDProvider(txmodifier.ChainIDProviderOptions{ - Replace: false, - Cache: true, - }), - ), + // will sign transactions before sending them to the node. + rpc.WithKeys(k), + + // Specify the default "from" address for transactions. + rpc.WithDefaultAddress(rpc.AddressOptions{ + Address: k.Address(), + }), + + // Estimate gas limit for transactions if not provided explicitly. + rpc.WithGasLimit(rpc.GasLimitOptions{ + Multiplier: 1.25, + }), + + // Estimate gas price for transactions if not provided explicitly. + rpc.WithDynamicGasFee(rpc.DynamicGasFeeOptions{ + GasPriceMultiplier: 1.25, + PriorityFeePerGasMultiplier: 1.25, + }), + + // Automatically set the chain ID for transactions. + rpc.WithChainID(rpc.ChainIDOptions{}), + + // Automatically set the nonce for transactions. + rpc.WithNonce(rpc.NonceOptions{}), + + // Simulate transactions before sending them to the node. + rpc.WithSimulate(), ) if err != nil { panic(err) @@ -80,11 +71,11 @@ func main() { calldata := transfer.MustEncodeArgs("0xd8da6bf26964af9d7eed9e03e53415d37aa96045", new(big.Int).Mul(big.NewInt(100), big.NewInt(1e6))) // Prepare a transaction. - tx := types.NewTransaction(). - SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")). - SetInput(calldata) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")) + tx.SetInput(calldata) - txHash, _, err := c.SendTransaction(context.Background(), tx) + txHash, err := c.SendTransaction(context.Background(), tx) if err != nil { panic(err) } @@ -92,3 +83,10 @@ func main() { // Print the transaction hash. fmt.Printf("Transaction hash: %s\n", txHash.String()) } + +func keyPath() string { + if _, err := os.Stat("./key.json"); err == nil { + return "./key.json" + } + return "./examples/send-tx/key.json" +} From ec2d04e03157b149db32b52b80454c4287d67b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 3 Sep 2024 02:15:03 +0200 Subject: [PATCH 03/44] Remove txmodifier --- txmodifier/chainid.go | 82 -------------- txmodifier/chainid_test.go | 89 --------------- txmodifier/gasfee.go | 149 ------------------------- txmodifier/gasfee_test.go | 204 ---------------------------------- txmodifier/gaslimit.go | 57 ---------- txmodifier/gaslimit_test.go | 63 ----------- txmodifier/nonce.go | 60 ---------- txmodifier/nonce_test.go | 69 ------------ txmodifier/txmodifier_test.go | 41 ------- 9 files changed, 814 deletions(-) delete mode 100644 txmodifier/chainid.go delete mode 100644 txmodifier/chainid_test.go delete mode 100644 txmodifier/gasfee.go delete mode 100644 txmodifier/gasfee_test.go delete mode 100644 txmodifier/gaslimit.go delete mode 100644 txmodifier/gaslimit_test.go delete mode 100644 txmodifier/nonce.go delete mode 100644 txmodifier/nonce_test.go delete mode 100644 txmodifier/txmodifier_test.go diff --git a/txmodifier/chainid.go b/txmodifier/chainid.go deleted file mode 100644 index 9cc9bee..0000000 --- a/txmodifier/chainid.go +++ /dev/null @@ -1,82 +0,0 @@ -package txmodifier - -import ( - "context" - "fmt" - "sync" - - "github.com/defiweb/go-eth/rpc" - "github.com/defiweb/go-eth/types" -) - -// ChainIDProvider is a transaction modifier that sets the chain ID of the -// transaction. -// -// To use this modifier, add it using the WithTXModifiers option when creating -// a new rpc.Client. -type ChainIDProvider struct { - mu sync.Mutex - chainID uint64 - replace bool - cache bool -} - -// ChainIDProviderOptions is the options for NewChainIDProvider. -type ChainIDProviderOptions struct { - // ChainID is the chain ID that will be set for the transaction. - // If 0, the chain ID will be queried from the node. - ChainID uint64 - - // Replace is true if the transaction chain ID should be replaced even if - // it is already set. - Replace bool - - // Cache is true if the chain ID will be cached instead of being queried - // for each transaction. Cached chain ID will be used for all RPC clients - // that use the same ChainIDProvider instance. - // - // If ChainID is set, this option is ignored. - Cache bool -} - -// NewChainIDProvider returns a new ChainIDProvider. -func NewChainIDProvider(opts ChainIDProviderOptions) *ChainIDProvider { - if opts.ChainID != 0 { - opts.Cache = true - } - return &ChainIDProvider{ - chainID: opts.ChainID, - replace: opts.Replace, - cache: opts.Cache, - } -} - -// Modify implements the rpc.TXModifier interface. -func (p *ChainIDProvider) Modify(ctx context.Context, client rpc.RPC, tx *types.Transaction) error { - if !p.replace && tx.ChainID != nil { - return nil - } - if !p.cache { - chainID, err := client.ChainID(ctx) - if err != nil { - return fmt.Errorf("chain ID provider: %w", err) - } - tx.ChainID = &chainID - return nil - } - p.mu.Lock() - defer p.mu.Unlock() - var cid uint64 - if p.chainID != 0 { - cid = p.chainID - } else { - chainID, err := client.ChainID(ctx) - if err != nil { - return fmt.Errorf("chain ID provider: %w", err) - } - p.chainID = chainID - cid = chainID - } - tx.ChainID = &cid - return nil -} diff --git a/txmodifier/chainid_test.go b/txmodifier/chainid_test.go deleted file mode 100644 index c67189c..0000000 --- a/txmodifier/chainid_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package txmodifier - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/defiweb/go-eth/types" -) - -func TestChainIDSetter_Modify(t *testing.T) { - ctx := context.Background() - fromAddress := types.MustAddressFromHex("0x1234567890abcdef1234567890abcdef12345678") - - t.Run("cache chain ID", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}} - rpcMock := new(mockRPC) - - provider := NewChainIDProvider(ChainIDProviderOptions{ - ChainID: 1, - }) - _ = provider.Modify(ctx, rpcMock, tx) - - assert.Equal(t, uint64(1), *tx.ChainID) - }) - - t.Run("query RPC node", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}} - rpcMock := new(mockRPC) - rpcMock.On("ChainID", ctx).Return(uint64(1), nil) - - provider := NewChainIDProvider(ChainIDProviderOptions{ - Replace: false, - Cache: false, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, uint64(1), *tx.ChainID) - }) - - t.Run("replace chain ID", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}, ChainID: uint64Ptr(2)} - rpcMock := new(mockRPC) - rpcMock.On("ChainID", ctx).Return(uint64(1), nil) - - provider := NewChainIDProvider(ChainIDProviderOptions{ - Replace: true, - Cache: false, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.NotEqual(t, uint64(2), *tx.ChainID) - }) - - t.Run("do not replace chain ID", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}, ChainID: uint64Ptr(2)} - rpcMock := new(mockRPC) - rpcMock.On("ChainID", ctx).Return(uint64(1), nil) - - provider := NewChainIDProvider(ChainIDProviderOptions{ - Replace: false, - Cache: false, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.NotEqual(t, uint64(1), *tx.ChainID) - }) - - t.Run("cache chain ID", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}, ChainID: uint64Ptr(2)} - rpcMock := new(mockRPC) - rpcMock.On("ChainID", ctx).Return(uint64(1), nil).Once() - - provider := NewChainIDProvider(ChainIDProviderOptions{ - Replace: true, - Cache: true, - }) - _ = provider.Modify(ctx, rpcMock, tx) - _ = provider.Modify(ctx, rpcMock, tx) - }) -} - -func uint64Ptr(i uint64) *uint64 { - return &i -} diff --git a/txmodifier/gasfee.go b/txmodifier/gasfee.go deleted file mode 100644 index 5678a95..0000000 --- a/txmodifier/gasfee.go +++ /dev/null @@ -1,149 +0,0 @@ -package txmodifier - -import ( - "context" - "fmt" - "math/big" - - "github.com/defiweb/go-eth/rpc" - "github.com/defiweb/go-eth/types" -) - -// LegacyGasFeeEstimator is a transaction modifier that estimates gas fee -// using the rpc.GasPrice method. -// -// It sets transaction type to types.LegacyTxType or types.AccessListTxType if -// an access list is provided. -// -// To use this modifier, add it using the WithTXModifiers option when creating -// a new rpc.Client. -type LegacyGasFeeEstimator struct { - multiplier float64 - minGasPrice *big.Int - maxGasPrice *big.Int - replace bool -} - -// LegacyGasFeeEstimatorOptions is the options for NewLegacyGasFeeEstimator. -type LegacyGasFeeEstimatorOptions struct { - Multiplier float64 // Multiplier is applied to the gas price. - MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. - MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. - Replace bool // Replace is true if the gas price should be replaced even if it is already set. -} - -// NewLegacyGasFeeEstimator returns a new LegacyGasFeeEstimator. -func NewLegacyGasFeeEstimator(opts LegacyGasFeeEstimatorOptions) *LegacyGasFeeEstimator { - return &LegacyGasFeeEstimator{ - multiplier: opts.Multiplier, - minGasPrice: opts.MinGasPrice, - maxGasPrice: opts.MaxGasPrice, - replace: opts.Replace, - } -} - -// Modify implements the rpc.TXModifier interface. -func (e *LegacyGasFeeEstimator) Modify(ctx context.Context, client rpc.RPC, tx *types.Transaction) error { - if !e.replace && tx.GasPrice != nil { - return nil - } - gasPrice, err := client.GasPrice(ctx) - if err != nil { - return fmt.Errorf("legacy gas fee estimator: failed to get gas price: %w", err) - } - gasPrice, _ = new(big.Float).Mul(new(big.Float).SetInt(gasPrice), big.NewFloat(e.multiplier)).Int(nil) - if e.minGasPrice != nil && gasPrice.Cmp(e.minGasPrice) < 0 { - gasPrice = e.minGasPrice - } - if e.maxGasPrice != nil && gasPrice.Cmp(e.maxGasPrice) > 0 { - gasPrice = e.maxGasPrice - } - tx.GasPrice = gasPrice - tx.MaxFeePerGas = nil - tx.MaxPriorityFeePerGas = nil - switch { - case tx.AccessList != nil: - tx.Type = types.AccessListTxType - default: - tx.Type = types.LegacyTxType - } - return nil -} - -// EIP1559GasFeeEstimator is a transaction modifier that estimates gas fee -// using the rpc.GasPrice and rpc.MaxPriorityFeePerGas methods. -// -// It sets transaction type to types.DynamicFeeTxType. -type EIP1559GasFeeEstimator struct { - gasPriceMultiplier float64 - priorityFeePerGasMultiplier float64 - minGasPrice *big.Int - maxGasPrice *big.Int - minPriorityFeePerGas *big.Int - maxPriorityFeePerGas *big.Int - replace bool -} - -// EIP1559GasFeeEstimatorOptions is the options for NewEIP1559GasFeeEstimator. -type EIP1559GasFeeEstimatorOptions struct { - GasPriceMultiplier float64 // GasPriceMultiplier is applied to the gas price. - PriorityFeePerGasMultiplier float64 // PriorityFeePerGasMultiplier is applied to the priority fee per gas. - MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. - MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. - MinPriorityFeePerGas *big.Int // MinPriorityFeePerGas is the minimum priority fee per gas, or nil if there is no lower bound. - MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas, or nil if there is no upper bound. - Replace bool // Replace is true if the gas price should be replaced even if it is already set. -} - -// NewEIP1559GasFeeEstimator returns a new EIP1559GasFeeEstimator. -// -// To use this modifier, add it using the WithTXModifiers option when creating -// a new rpc.Client. -func NewEIP1559GasFeeEstimator(opts EIP1559GasFeeEstimatorOptions) *EIP1559GasFeeEstimator { - return &EIP1559GasFeeEstimator{ - gasPriceMultiplier: opts.GasPriceMultiplier, - priorityFeePerGasMultiplier: opts.PriorityFeePerGasMultiplier, - minGasPrice: opts.MinGasPrice, - maxGasPrice: opts.MaxGasPrice, - minPriorityFeePerGas: opts.MinPriorityFeePerGas, - maxPriorityFeePerGas: opts.MaxPriorityFeePerGas, - replace: opts.Replace, - } -} - -// Modify implements the rpc.TXModifier interface. -func (e *EIP1559GasFeeEstimator) Modify(ctx context.Context, client rpc.RPC, tx *types.Transaction) error { - if !e.replace && tx.MaxFeePerGas != nil && tx.MaxPriorityFeePerGas != nil { - return nil - } - maxFeePerGas, err := client.GasPrice(ctx) - if err != nil { - return fmt.Errorf("EIP-1559 gas fee estimator: failed to get gas price: %w", err) - } - priorityFeePerGas, err := client.MaxPriorityFeePerGas(ctx) - if err != nil { - return fmt.Errorf("EIP-1559 gas fee estimator: failed to get max priority fee per gas: %w", err) - } - maxFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(maxFeePerGas), big.NewFloat(e.gasPriceMultiplier)).Int(nil) - priorityFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(priorityFeePerGas), big.NewFloat(e.priorityFeePerGasMultiplier)).Int(nil) - if e.minGasPrice != nil && maxFeePerGas.Cmp(e.minGasPrice) < 0 { - maxFeePerGas = e.minGasPrice - } - if e.maxGasPrice != nil && maxFeePerGas.Cmp(e.maxGasPrice) > 0 { - maxFeePerGas = e.maxGasPrice - } - if e.minPriorityFeePerGas != nil && priorityFeePerGas.Cmp(e.minPriorityFeePerGas) < 0 { - priorityFeePerGas = e.minPriorityFeePerGas - } - if e.maxPriorityFeePerGas != nil && priorityFeePerGas.Cmp(e.maxPriorityFeePerGas) > 0 { - priorityFeePerGas = e.maxPriorityFeePerGas - } - if maxFeePerGas.Cmp(priorityFeePerGas) < 0 { - priorityFeePerGas = maxFeePerGas - } - tx.GasPrice = nil - tx.MaxFeePerGas = maxFeePerGas - tx.MaxPriorityFeePerGas = priorityFeePerGas - tx.Type = types.DynamicFeeTxType - return nil -} diff --git a/txmodifier/gasfee_test.go b/txmodifier/gasfee_test.go deleted file mode 100644 index aa27699..0000000 --- a/txmodifier/gasfee_test.go +++ /dev/null @@ -1,204 +0,0 @@ -package txmodifier - -import ( - "context" - "errors" - "math/big" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/defiweb/go-eth/types" -) - -func TestLegacyGasFeeEstimator_Modify(t *testing.T) { - ctx := context.Background() - - t.Run("successful gas fee estimation", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(1000), nil) - estimator := NewLegacyGasFeeEstimator(LegacyGasFeeEstimatorOptions{ - Multiplier: 1.5, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(1500), tx.GasPrice) - assert.Equal(t, types.LegacyTxType, tx.Type) - }) - - t.Run("gas fee estimation error", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return((*big.Int)(nil), errors.New("rpc error")) - - estimator := NewLegacyGasFeeEstimator(LegacyGasFeeEstimatorOptions{ - Multiplier: 1.5, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "failed to get gas price") - }) - - t.Run("gas fee below min bound", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(300), nil) - - estimator := NewLegacyGasFeeEstimator(LegacyGasFeeEstimatorOptions{ - Multiplier: 1.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(500), tx.GasPrice) // should be clamped to minGasPrice - }) - - t.Run("gas fee above max bound", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(2500), nil) - - estimator := NewLegacyGasFeeEstimator(LegacyGasFeeEstimatorOptions{ - Multiplier: 1.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(2000), tx.GasPrice) // should be clamped to maxGasPrice - }) -} - -func TestEIP1559GasFeeEstimator_Modify(t *testing.T) { - ctx := context.Background() - - t.Run("successful gas fee estimation", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(1000), nil) - rpcMock.On("MaxPriorityFeePerGas", ctx).Return(big.NewInt(5), nil) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.5, - PriorityFeePerGasMultiplier: 2.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - MinPriorityFeePerGas: big.NewInt(2), - MaxPriorityFeePerGas: big.NewInt(10), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(1500), tx.MaxFeePerGas) - assert.Equal(t, big.NewInt(10), tx.MaxPriorityFeePerGas) - assert.Equal(t, types.DynamicFeeTxType, tx.Type) - }) - - t.Run("gas fee estimation error (GasPrice call error)", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return((*big.Int)(nil), errors.New("rpc error")) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.5, - PriorityFeePerGasMultiplier: 2.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - MinPriorityFeePerGas: big.NewInt(2), - MaxPriorityFeePerGas: big.NewInt(10), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "failed to get gas price") - }) - - t.Run("gas fee estimation error (MaxPriorityFeePerGas call error)", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(1000), nil) - rpcMock.On("MaxPriorityFeePerGas", ctx).Return((*big.Int)(nil), errors.New("rpc error")) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.5, - PriorityFeePerGasMultiplier: 2.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - MinPriorityFeePerGas: big.NewInt(2), - MaxPriorityFeePerGas: big.NewInt(10), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "failed to get max priority fee per gas") - }) - - t.Run("gas fee below min bound", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(300), nil) - rpcMock.On("MaxPriorityFeePerGas", ctx).Return(big.NewInt(1), nil) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.0, - PriorityFeePerGasMultiplier: 1.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - MinPriorityFeePerGas: big.NewInt(2), - MaxPriorityFeePerGas: big.NewInt(10), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(500), tx.MaxFeePerGas) // should be clamped to minGasPrice - assert.Equal(t, big.NewInt(2), tx.MaxPriorityFeePerGas) // should be clamped to minPriorityFeePerGas - }) - - t.Run("gas fee above max bound", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(2500), nil) - rpcMock.On("MaxPriorityFeePerGas", ctx).Return(big.NewInt(12), nil) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.0, - PriorityFeePerGasMultiplier: 1.0, - MinGasPrice: big.NewInt(500), - MaxGasPrice: big.NewInt(2000), - MinPriorityFeePerGas: big.NewInt(2), - MaxPriorityFeePerGas: big.NewInt(10), - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(2000), tx.MaxFeePerGas) // should be clamped to maxGasPrice - assert.Equal(t, big.NewInt(10), tx.MaxPriorityFeePerGas) // should be clamped to maxPriorityFeePerGas - }) - - t.Run("gas tip fee higher than gas fee", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("GasPrice", ctx).Return(big.NewInt(500), nil) - rpcMock.On("MaxPriorityFeePerGas", ctx).Return(big.NewInt(2500), nil) - - estimator := NewEIP1559GasFeeEstimator(EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.0, - PriorityFeePerGasMultiplier: 1.0, - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, big.NewInt(500), tx.MaxFeePerGas) - assert.Equal(t, big.NewInt(500), tx.MaxPriorityFeePerGas) // should not be higher than tx.MaxFeePerGas - }) -} diff --git a/txmodifier/gaslimit.go b/txmodifier/gaslimit.go deleted file mode 100644 index f9c4891..0000000 --- a/txmodifier/gaslimit.go +++ /dev/null @@ -1,57 +0,0 @@ -package txmodifier - -import ( - "context" - "fmt" - "math/big" - - "github.com/defiweb/go-eth/rpc" - "github.com/defiweb/go-eth/types" -) - -// GasLimitEstimator is a transaction modifier that estimates gas limit -// using the rpc.EstimateGas method. -// -// To use this modifier, add it using the WithTXModifiers option when creating -// a new rpc.Client. -type GasLimitEstimator struct { - multiplier float64 - minGas uint64 - maxGas uint64 - replace bool -} - -// GasLimitEstimatorOptions is the options for NewGasLimitEstimator. -type GasLimitEstimatorOptions struct { - Multiplier float64 // Multiplier is applied to the gas limit. - MinGas uint64 // MinGas is the minimum gas limit, or 0 if there is no lower bound. - MaxGas uint64 // MaxGas is the maximum gas limit, or 0 if there is no upper bound. - Replace bool // Replace is true if the gas limit should be replaced even if it is already set. -} - -// NewGasLimitEstimator returns a new GasLimitEstimator. -func NewGasLimitEstimator(opts GasLimitEstimatorOptions) *GasLimitEstimator { - return &GasLimitEstimator{ - multiplier: opts.Multiplier, - minGas: opts.MinGas, - maxGas: opts.MaxGas, - replace: opts.Replace, - } -} - -// Modify implements the rpc.TXModifier interface. -func (e *GasLimitEstimator) Modify(ctx context.Context, client rpc.RPC, tx *types.Transaction) error { - if !e.replace && tx.GasLimit != nil { - return nil - } - gasLimit, _, err := client.EstimateGas(ctx, &tx.Call, types.LatestBlockNumber) - if err != nil { - return fmt.Errorf("gas limit estimator: failed to estimate gas limit: %w", err) - } - gasLimit, _ = new(big.Float).Mul(new(big.Float).SetUint64(gasLimit), big.NewFloat(e.multiplier)).Uint64() - if gasLimit < e.minGas || (e.maxGas > 0 && gasLimit > e.maxGas) { - return fmt.Errorf("gas limit estimator: estimated gas limit %d is out of range [%d, %d]", gasLimit, e.minGas, e.maxGas) - } - tx.GasLimit = &gasLimit - return nil -} diff --git a/txmodifier/gaslimit_test.go b/txmodifier/gaslimit_test.go deleted file mode 100644 index abc0f02..0000000 --- a/txmodifier/gaslimit_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package txmodifier - -import ( - "context" - "errors" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/defiweb/go-eth/types" -) - -func TestGasLimitEstimator_Modify(t *testing.T) { - ctx := context.Background() - - t.Run("successful gas estimation", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("EstimateGas", ctx, &tx.Call, types.LatestBlockNumber).Return(uint64(1000), &tx.Call, nil) - - estimator := NewGasLimitEstimator(GasLimitEstimatorOptions{ - Multiplier: 1.5, - MinGas: 500, - MaxGas: 2000, - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, uint64(1500), *tx.GasLimit) - }) - - t.Run("gas estimation error", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("EstimateGas", ctx, &tx.Call, types.LatestBlockNumber).Return(uint64(0), &tx.Call, errors.New("rpc error")) - - estimator := NewGasLimitEstimator(GasLimitEstimatorOptions{ - Multiplier: 1.5, - MinGas: 500, - MaxGas: 2000, - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "failed to estimate gas") - }) - - t.Run("gas out of range", func(t *testing.T) { - tx := &types.Transaction{} - rpcMock := new(mockRPC) - rpcMock.On("EstimateGas", ctx, &tx.Call, types.LatestBlockNumber).Return(uint64(3000), &tx.Call, nil) - - estimator := NewGasLimitEstimator(GasLimitEstimatorOptions{ - Multiplier: 1.5, - MinGas: 500, - MaxGas: 2000, - }) - err := estimator.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "estimated gas") - }) -} diff --git a/txmodifier/nonce.go b/txmodifier/nonce.go deleted file mode 100644 index 1856c22..0000000 --- a/txmodifier/nonce.go +++ /dev/null @@ -1,60 +0,0 @@ -package txmodifier - -import ( - "context" - "errors" - "fmt" - - "github.com/defiweb/go-eth/rpc" - "github.com/defiweb/go-eth/types" -) - -// NonceProvider is a transaction modifier that sets the nonce for the -// transaction. -// -// To use this modifier, add it using the WithTXModifiers option when creating -// a new rpc.Client. -type NonceProvider struct { - usePendingBlock bool - replace bool -} - -// NonceProviderOptions is the options for NewNonceProvider. -// -// If UsePendingBlock is true, then the next transaction nonce is fetched from -// the pending block. Otherwise, the next transaction nonce is fetched from the -// latest block. Using the pending block is not recommended as the behavior -// of the GetTransactionCount method on the pending block may be different -// between different Ethereum clients. -type NonceProviderOptions struct { - UsePendingBlock bool // UsePendingBlock indicates whether to use the pending block. - Replace bool // Replace is true if the nonce should be replaced even if it is already set. -} - -// NewNonceProvider returns a new NonceProvider. -func NewNonceProvider(opts NonceProviderOptions) *NonceProvider { - return &NonceProvider{ - usePendingBlock: opts.UsePendingBlock, - replace: opts.Replace, - } -} - -// Modify implements the rpc.TXModifier interface. -func (p *NonceProvider) Modify(ctx context.Context, client rpc.RPC, tx *types.Transaction) error { - if !p.replace && tx.Nonce != nil { - return nil - } - if tx.From == nil { - return errors.New("nonce provider: missing from address") - } - block := types.LatestBlockNumber - if p.usePendingBlock { - block = types.PendingBlockNumber - } - pendingNonce, err := client.GetTransactionCount(ctx, *tx.From, block) - if err != nil { - return fmt.Errorf("nonce provider: %w", err) - } - tx.Nonce = &pendingNonce - return nil -} diff --git a/txmodifier/nonce_test.go b/txmodifier/nonce_test.go deleted file mode 100644 index b526068..0000000 --- a/txmodifier/nonce_test.go +++ /dev/null @@ -1,69 +0,0 @@ -package txmodifier - -import ( - "context" - "errors" - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/defiweb/go-eth/types" -) - -func TestNonceProvider_Modify(t *testing.T) { - ctx := context.Background() - fromAddress := types.MustAddressFromHex("0x1234567890abcdef1234567890abcdef12345678") - - t.Run("nonce fetch from latest block", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}} - rpcMock := new(mockRPC) - rpcMock.On("GetTransactionCount", ctx, fromAddress, types.LatestBlockNumber).Return(uint64(10), nil) - - provider := NewNonceProvider(NonceProviderOptions{ - UsePendingBlock: false, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, uint64(10), *tx.Nonce) - }) - - t.Run("nonce fetch from pending block", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}} - rpcMock := new(mockRPC) - rpcMock.On("GetTransactionCount", ctx, fromAddress, types.PendingBlockNumber).Return(uint64(11), nil) - - provider := NewNonceProvider(NonceProviderOptions{ - UsePendingBlock: true, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.NoError(t, err) - assert.Equal(t, uint64(11), *tx.Nonce) - }) - - t.Run("missing from address", func(t *testing.T) { - txWithoutFrom := &types.Transaction{} - provider := NewNonceProvider(NonceProviderOptions{ - UsePendingBlock: true, - }) - err := provider.Modify(ctx, nil, txWithoutFrom) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "nonce provider: missing from address") - }) - - t.Run("nonce fetch error", func(t *testing.T) { - tx := &types.Transaction{Call: types.Call{From: &fromAddress}} - rpcMock := new(mockRPC) - rpcMock.On("GetTransactionCount", ctx, fromAddress, types.LatestBlockNumber).Return(uint64(0), errors.New("rpc error")) - - provider := NewNonceProvider(NonceProviderOptions{ - UsePendingBlock: false, - }) - err := provider.Modify(ctx, rpcMock, tx) - - assert.Error(t, err) - assert.Contains(t, err.Error(), "nonce provider") - }) -} diff --git a/txmodifier/txmodifier_test.go b/txmodifier/txmodifier_test.go deleted file mode 100644 index 71f2d71..0000000 --- a/txmodifier/txmodifier_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package txmodifier - -import ( - "context" - "math/big" - - "github.com/stretchr/testify/mock" - - "github.com/defiweb/go-eth/rpc" - "github.com/defiweb/go-eth/types" -) - -type mockRPC struct { - rpc.Client - mock.Mock -} - -func (m *mockRPC) ChainID(ctx context.Context) (uint64, error) { - args := m.Called(ctx) - return args.Get(0).(uint64), args.Error(1) -} - -func (m *mockRPC) EstimateGas(ctx context.Context, call *types.Call, block types.BlockNumber) (uint64, *types.Call, error) { - args := m.Called(ctx, call, block) - return args.Get(0).(uint64), call, args.Error(2) -} - -func (m *mockRPC) GasPrice(ctx context.Context) (*big.Int, error) { - args := m.Called(ctx) - return args.Get(0).(*big.Int), args.Error(1) -} - -func (m *mockRPC) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, error) { - args := m.Called(ctx) - return args.Get(0).(*big.Int), args.Error(1) -} - -func (m *mockRPC) GetTransactionCount(ctx context.Context, address types.Address, block types.BlockNumber) (uint64, error) { - args := m.Called(ctx, address, block) - return args.Get(0).(uint64), args.Error(1) -} From 2f6e13fbab68917f64ea6f5956f19dd8df0dd6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 3 Sep 2024 02:17:41 +0200 Subject: [PATCH 04/44] Do not use fluent setters in FilterLogsQuery --- types/structs.go | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/types/structs.go b/types/structs.go index 16b7d9d..27c6943 100644 --- a/types/structs.go +++ b/types/structs.go @@ -514,39 +514,32 @@ func NewFilterLogsQuery() *FilterLogsQuery { return &FilterLogsQuery{} } -func (q *FilterLogsQuery) SetAddresses(addresses ...Address) *FilterLogsQuery { +func (q *FilterLogsQuery) SetAddresses(addresses ...Address) { q.Address = addresses - return q } -func (q *FilterLogsQuery) AddAddresses(addresses ...Address) *FilterLogsQuery { +func (q *FilterLogsQuery) AddAddresses(addresses ...Address) { q.Address = append(q.Address, addresses...) - return q } -func (q *FilterLogsQuery) SetFromBlock(fromBlock *BlockNumber) *FilterLogsQuery { +func (q *FilterLogsQuery) SetFromBlock(fromBlock *BlockNumber) { q.FromBlock = fromBlock - return q } -func (q *FilterLogsQuery) SetToBlock(toBlock *BlockNumber) *FilterLogsQuery { +func (q *FilterLogsQuery) SetToBlock(toBlock *BlockNumber) { q.ToBlock = toBlock - return q } -func (q *FilterLogsQuery) SetTopics(topics ...[]Hash) *FilterLogsQuery { +func (q *FilterLogsQuery) SetTopics(topics ...[]Hash) { q.Topics = topics - return q } -func (q *FilterLogsQuery) AddTopics(topics ...[]Hash) *FilterLogsQuery { +func (q *FilterLogsQuery) AddTopics(topics ...[]Hash) { q.Topics = append(q.Topics, topics...) - return q } -func (q *FilterLogsQuery) SetBlockHash(blockHash *Hash) *FilterLogsQuery { +func (q *FilterLogsQuery) SetBlockHash(blockHash *Hash) { q.BlockHash = blockHash - return q } func (q FilterLogsQuery) MarshalJSON() ([]byte, error) { From 37ed39f47a82efe15893c16526756558c5e6d203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 8 Sep 2024 21:25:42 +0200 Subject: [PATCH 05/44] Fix encoding of negative values --- abi/encode.go | 6 +-- abi/error.go | 2 +- abi/event.go | 2 +- abi/method.go | 2 +- abi/num.go | 47 ++++++++++++++++-- abi/num_test.go | 118 +++++++++++++++++++++++++++++++++++++--------- abi/value_test.go | 4 +- 7 files changed, 147 insertions(+), 34 deletions(-) diff --git a/abi/encode.go b/abi/encode.go index 52566ea..8cb57ca 100644 --- a/abi/encode.go +++ b/abi/encode.go @@ -207,7 +207,7 @@ func encodeInt(v *big.Int, size int) (Words, error) { if err := x.SetBigInt(v); err != nil { return nil, err } - if err := w.SetBytesPadLeft(x.Bytes()); err != nil { + if err := x.FillBytes(w[:]); err != nil { return nil, err } return Words{w}, nil @@ -224,7 +224,7 @@ func encodeUint(v *big.Int, size int) (Words, error) { if err := x.SetBigInt(v); err != nil { return nil, err } - if err := w.SetBytesPadLeft(x.Bytes()); err != nil { + if err := x.FillBytes(w[:]); err != nil { return nil, err } return Words{w}, nil @@ -259,5 +259,5 @@ func writeInt(w *Word, x int) error { if err := i32.SetInt(x); err != nil { return err } - return w.SetBytesPadLeft(i32.Bytes()) + return i32.FillBytes(w[:]) } diff --git a/abi/error.go b/abi/error.go index 1aad25c..63068f4 100644 --- a/abi/error.go +++ b/abi/error.go @@ -193,6 +193,6 @@ func (e *Error) generateSignature() { } func (e *Error) calculateFourBytes() { - id := crypto.Keccak256([]byte(e.Signature())) + id := crypto.Keccak([]byte(e.Signature())) copy(e.fourBytes[:], id[:4]) } diff --git a/abi/event.go b/abi/event.go index 6927774..3f6ec50 100644 --- a/abi/event.go +++ b/abi/event.go @@ -199,7 +199,7 @@ func (e *Event) String() string { } func (e *Event) calculateTopic0() { - e.topic0 = crypto.Keccak256([]byte(e.signature)) + e.topic0 = types.Hash(crypto.Keccak([]byte(e.signature))) } func (e *Event) generateSignature() { diff --git a/abi/method.go b/abi/method.go index 8542f01..9b5581a 100644 --- a/abi/method.go +++ b/abi/method.go @@ -305,6 +305,6 @@ func (m *Method) generateSignature() { } func (m *Method) calculateFourBytes() { - id := crypto.Keccak256([]byte(m.Signature())) + id := crypto.Keccak([]byte(m.Signature())) copy(m.fourBytes[:], id[:4]) } diff --git a/abi/num.go b/abi/num.go index 55ea08c..0aba0c5 100644 --- a/abi/num.go +++ b/abi/num.go @@ -40,11 +40,12 @@ func (i *intX) BitSize() int { return i.size } -// BitLen returns the number of bits required to represent x. +// BitLen returns the number of bits required to represent the integer. func (i *intX) BitLen() int { return signedBitLen(i.val) } +// IsInt returns true if the integer can be represented as an int. func (i *intX) IsInt() bool { if !i.val.IsInt64() { return false @@ -59,6 +60,7 @@ func (i *intX) IsInt() bool { return true } +// Int returns the int64 representation of the integer. func (i *intX) Int() (int, error) { if !i.val.IsInt64() { return 0, fmt.Errorf("abi: int overflow") @@ -73,6 +75,7 @@ func (i *intX) Int() (int, error) { return int(i.val.Int64()), nil } +// Int64 returns the int64 representation of the integer. func (i *intX) Int64() (int64, error) { if !i.val.IsInt64() { return 0, fmt.Errorf("abi: int64 overflow") @@ -80,7 +83,7 @@ func (i *intX) Int64() (int64, error) { return i.val.Int64(), nil } -// BigInt returns the value of the integer as a big integer. +// BigInt returns the *big.Int representation of the integer. func (i *intX) BigInt() *big.Int { return i.val } @@ -95,6 +98,24 @@ func (i *intX) Bytes() []byte { return r } +// FillBytes fills the byte slice r with the value of the integer as a +// big-endian byte slice. If the byte slice is smaller than the integer, +// an error is returned. The byte slice cannot be larger than 256 bits. +// Negative values are two's complement encoded. +func (i *intX) FillBytes(r []byte) error { + bitLen := len(r) * 8 + if bitLen < i.size { + return fmt.Errorf("abi: cannot fill %d-bit integer to %d bytes", i.size, len(r)) + } + if bitLen > 256 { + return fmt.Errorf("abi: cannot fill byte slices larger than 256 bits") + } + x := new(big.Int).Set(i.val).And(i.val, MaxUint[bitLen]) + x.FillBytes(r) + return nil +} + +// SetInt sets the value of the integer to x. func (i *intX) SetInt(x int) error { if bits.Len(uint(x)) > i.size { return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit int", bits.Len(uint(x)), i.size) @@ -103,6 +124,7 @@ func (i *intX) SetInt(x int) error { return nil } +// SetInt64 sets the value of the integer to x. func (i *intX) SetInt64(x int64) error { if bits.Len64(uint64(x)) > i.size { return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit int64", bits.Len64(uint64(x)), i.size) @@ -156,6 +178,7 @@ func newUintX(bitSize int) *uintX { } } +// Uint returns the uint representation of the integer. func (i *uintX) Uint() (int, error) { if !i.val.IsUint64() { return 0, fmt.Errorf("abi: uint overflow") @@ -167,6 +190,7 @@ func (i *uintX) Uint() (int, error) { return int(i.val.Uint64()), nil } +// Uint64 returns the uint64 representation of the integer. func (i *uintX) Uint64() (uint64, error) { if !i.val.IsUint64() { return 0, fmt.Errorf("abi: int64 overflow") @@ -174,7 +198,7 @@ func (i *uintX) Uint64() (uint64, error) { return i.val.Uint64(), nil } -// BigInt returns the value of the integer as a big integer. +// BigInt returns the *big.Int representation of the integer. func (i *uintX) BigInt() *big.Int { return i.val } @@ -188,6 +212,22 @@ func (i *uintX) Bytes() []byte { return r } +// FillBytes fills the byte slice r with the value of the integer as a +// big-endian byte slice. If the byte slice is smaller than the integer, +// an error is returned. The byte slice cannot be larger than 256 bits. +func (i *uintX) FillBytes(r []byte) error { + bitLen := len(r) * 8 + if bitLen < i.size { + return fmt.Errorf("abi: cannot fill %d-bit integer to %d bytes", i.size, len(r)) + } + if bitLen > 256 { + return fmt.Errorf("abi: cannot fill byte slices larger than 256 bits") + } + i.val.FillBytes(r) + return nil +} + +// SetUint sets the value of the integer to x. func (i *uintX) SetUint(x uint) error { if bits.Len(x) > i.size { return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit int", bits.Len(x), i.size) @@ -196,6 +236,7 @@ func (i *uintX) SetUint(x uint) error { return nil } +// SetUint64 sets the value of the integer to x. func (i *uintX) SetUint64(x uint64) error { if bits.Len64(x) > i.size { return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit int64", bits.Len64(x), i.size) diff --git a/abi/num_test.go b/abi/num_test.go index c440445..53ec6ec 100644 --- a/abi/num_test.go +++ b/abi/num_test.go @@ -75,6 +75,29 @@ func TestIntX_Bytes(t *testing.T) { } } +func TestIntX_SetIntUint(t *testing.T) { + tests := []struct { + x uint64 + bitLen int + want bool + }{ + {x: 0, bitLen: 8, want: true}, + {x: 1, bitLen: 8, want: true}, + {x: 255, bitLen: 8, want: true}, + {x: 256, bitLen: 8, want: false}, + {x: 0, bitLen: 32, want: true}, + {x: 1, bitLen: 32, want: true}, + {x: math.MaxUint32, bitLen: 32, want: true}, + {x: math.MaxUint32 + 1, bitLen: 32, want: false}, + {x: math.MaxUint64, bitLen: 64, want: true}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, canSetUint(tt.x, tt.bitLen)) + }) + } +} + func TestIntX_SetBytes(t *testing.T) { tests := []struct { val *intX @@ -146,6 +169,78 @@ func TestIntX_SetBytes(t *testing.T) { } } +func TestIntX_FillBytes(t *testing.T) { + tests := []struct { + val *intX + set *big.Int + want []byte + wantErr bool + }{ + { + val: newIntX(8), + set: big.NewInt(0), + want: []byte{0x00}, + }, + { + val: newIntX(8), + set: big.NewInt(1), + want: []byte{0x01}, + }, + { + val: newIntX(8), + set: big.NewInt(-1), + want: []byte{0xff}, + }, + { + val: newIntX(8), + set: big.NewInt(127), + want: []byte{0x7f}, + }, + { + val: newIntX(8), + set: big.NewInt(-128), + want: []byte{0x80}, + }, + { + val: newIntX(8), + set: big.NewInt(1), + want: []byte{0x00, 0x01}, + }, + { + val: newIntX(8), + set: big.NewInt(-1), + want: []byte{0xff, 0xff}, + }, + // Too small slice + { + val: newIntX(16), + set: big.NewInt(0), + want: []byte{0x00}, + wantErr: true, + }, + // Too large slice + { + val: newIntX(8), + set: big.NewInt(0), + want: make([]byte, 33), + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + require.NoError(t, tt.val.SetBigInt(tt.set)) + res := make([]byte, len(tt.want)) + err := tt.val.FillBytes(res) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, res) + } + }) + } +} + func Test_signedBitLen(t *testing.T) { tests := []struct { arg *big.Int @@ -196,29 +291,6 @@ func Test_canSetInt(t *testing.T) { } } -func TestIntX_SetIntUint(t *testing.T) { - tests := []struct { - x uint64 - bitLen int - want bool - }{ - {x: 0, bitLen: 8, want: true}, - {x: 1, bitLen: 8, want: true}, - {x: 255, bitLen: 8, want: true}, - {x: 256, bitLen: 8, want: false}, - {x: 0, bitLen: 32, want: true}, - {x: 1, bitLen: 32, want: true}, - {x: math.MaxUint32, bitLen: 32, want: true}, - {x: math.MaxUint32 + 1, bitLen: 32, want: false}, - {x: math.MaxUint64, bitLen: 64, want: true}, - } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - assert.Equal(t, tt.want, canSetUint(tt.x, tt.bitLen)) - }) - } -} - func bigIntStr(s string) *big.Int { i, ok := new(big.Int).SetString(s, 0) if !ok { diff --git a/abi/value_test.go b/abi/value_test.go index 2fe8ad5..83e23bb 100644 --- a/abi/value_test.go +++ b/abi/value_test.go @@ -278,13 +278,13 @@ func TestEncodeABI(t *testing.T) { }, { name: "int8#127", - val: &IntValue{Size: 256}, + val: &IntValue{Size: 8}, arg: big.NewInt(127), want: Words{padL("7f")}, }, { name: "int8#-128", - val: &IntValue{Size: 256}, + val: &IntValue{Size: 8}, arg: big.NewInt(-128), want: Words{padR("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80")}, }, From 13c6e78fcf0a03cad985ca2bdcf6894397a82fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 8 Sep 2024 21:29:48 +0200 Subject: [PATCH 06/44] Add initial support for blob TXs --- abi/error.go | 2 +- abi/event.go | 2 +- abi/method.go | 2 +- crypto/crypto.go | 84 +- crypto/ecdsa.go | 152 - crypto/ecdsa/ecdsa.go | 136 + crypto/{ => ecdsa}/ecdsa_test.go | 2 +- crypto/keccak.go | 16 - crypto/keccak/keccak.go | 20 + crypto/{ => keccak}/keccak_test.go | 12 +- crypto/kzg4844/kzg4844.go | 124 + crypto/kzg4844/trusted_setup.json | 4167 ++++++++++++++++++++++++++++ crypto/txsign/txsign.go | 73 + go.mod | 11 +- go.sum | 35 +- rpc/base.go | 484 ---- rpc/base_test.go | 2087 -------------- rpc/client.go | 5 +- rpc/client_test.go | 189 -- rpc/hijack_simulate.go | 7 +- rpc/hijack_simulate_test.go | 4 +- rpc/hijack_util.go | 16 + rpc/methods_common.go | 11 + rpc/methods_common_test.go | 34 + types/call_blob.go | 126 + types/embed.go | 45 + types/structs.go | 53 + types/tx.go | 4 +- types/tx_accesslist.go | 10 +- types/tx_accesslist_test.go | 2 +- types/tx_blob.go | 411 +++ types/tx_blob_test.go | 153 + types/tx_decoder.go | 9 +- types/tx_decoder_test.go | 115 +- types/tx_dynamicfee.go | 10 +- types/tx_dynamicfee_test.go | 4 +- types/tx_legacy.go | 10 +- types/tx_legacy_test.go | 4 +- types/tx_test.go | 3 + types/types.go | 88 +- types/types_test.go | 2 +- types/util.go | 18 + types/util_test.go | 12 - wallet/key_json_v3.go | 7 +- wallet/key_priv.go | 36 +- wallet/key_rpc.go | 10 +- 46 files changed, 5682 insertions(+), 3125 deletions(-) delete mode 100644 crypto/ecdsa.go create mode 100644 crypto/ecdsa/ecdsa.go rename crypto/{ => ecdsa}/ecdsa_test.go (99%) delete mode 100644 crypto/keccak.go create mode 100644 crypto/keccak/keccak.go rename crypto/{ => keccak}/keccak_test.go (53%) create mode 100644 crypto/kzg4844/kzg4844.go create mode 100644 crypto/kzg4844/trusted_setup.json create mode 100644 crypto/txsign/txsign.go delete mode 100644 rpc/base.go delete mode 100644 rpc/base_test.go delete mode 100644 rpc/client_test.go create mode 100644 types/call_blob.go create mode 100644 types/tx_blob.go create mode 100644 types/tx_blob_test.go diff --git a/abi/error.go b/abi/error.go index 63068f4..1aad25c 100644 --- a/abi/error.go +++ b/abi/error.go @@ -193,6 +193,6 @@ func (e *Error) generateSignature() { } func (e *Error) calculateFourBytes() { - id := crypto.Keccak([]byte(e.Signature())) + id := crypto.Keccak256([]byte(e.Signature())) copy(e.fourBytes[:], id[:4]) } diff --git a/abi/event.go b/abi/event.go index 3f6ec50..859acd4 100644 --- a/abi/event.go +++ b/abi/event.go @@ -199,7 +199,7 @@ func (e *Event) String() string { } func (e *Event) calculateTopic0() { - e.topic0 = types.Hash(crypto.Keccak([]byte(e.signature))) + e.topic0 = types.Hash(crypto.Keccak256([]byte(e.signature))) } func (e *Event) generateSignature() { diff --git a/abi/method.go b/abi/method.go index 9b5581a..8542f01 100644 --- a/abi/method.go +++ b/abi/method.go @@ -305,6 +305,6 @@ func (m *Method) generateSignature() { } func (m *Method) calculateFourBytes() { - id := crypto.Keccak([]byte(m.Signature())) + id := crypto.Keccak256([]byte(m.Signature())) copy(m.fourBytes[:], id[:4]) } diff --git a/crypto/crypto.go b/crypto/crypto.go index 4b663c7..33e07d6 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -1,73 +1,23 @@ package crypto import ( - "crypto/ecdsa" - "fmt" - - "github.com/defiweb/go-eth/types" + "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/crypto/keccak" + "github.com/defiweb/go-eth/crypto/kzg4844" ) -// Signer is an interface for signing data. -type Signer interface { - // SignHash signs a hash. - SignHash(hash types.Hash) (*types.Signature, error) - - // SignMessage signs a message. - SignMessage(data []byte) (*types.Signature, error) - - // SignTransaction signs a transaction. - SignTransaction(tx types.Transaction) error -} - -// Recoverer is an interface for recovering addresses from signatures. -type Recoverer interface { - // RecoverHash recovers the address from a hash and signature. - RecoverHash(hash types.Hash, sig types.Signature) (*types.Address, error) - - // RecoverMessage recovers the address from a message and signature. - RecoverMessage(data []byte, sig types.Signature) (*types.Address, error) - - // RecoverTransaction recovers the address from a transaction. - RecoverTransaction(tx types.Transaction) (*types.Address, error) -} - -// AddMessagePrefix adds the Ethereum message prefix to the given data as -// defined in EIP-191. -func AddMessagePrefix(data []byte) []byte { - return []byte(fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)) -} - -// ECSigner returns a Signer implementation for ECDSA. -func ECSigner(key *ecdsa.PrivateKey) Signer { return &ecSigner{key} } - -// ECRecoverer is a Recoverer implementation for ECDSA. -var ECRecoverer Recoverer = &ecRecoverer{} - -type ( - ecSigner struct{ key *ecdsa.PrivateKey } - ecRecoverer struct{} +// Default implementations of the crypto functions. +var ( + Keccak256 = keccak.Hash256 + ECPublicKeyToAddress = ecdsa.PublicKeyToAddress + ECSignHash = ecdsa.SignHash + ECRecoverHash = ecdsa.RecoverHash + ECSignMessage = ecdsa.SignMessage + ECRecoverMessage = ecdsa.RecoverMessage + KZGBlobToCommitment = kzg4844.BlobToCommitment + KZGComputeProof = kzg4844.ComputeProof + KZGVerifyProof = kzg4844.VerifyProof + KZGComputeBlobProof = kzg4844.ComputeBlobProof + KZGVerifyBlobProof = kzg4844.VerifyBlobProof + KZGComputeBlobHashV1 = kzg4844.ComputeBlobHashV1 ) - -func (s *ecSigner) SignHash(hash types.Hash) (*types.Signature, error) { - return ecSignHash(s.key, hash) -} - -func (s *ecSigner) SignMessage(data []byte) (*types.Signature, error) { - return ecSignMessage(s.key, data) -} - -func (s *ecSigner) SignTransaction(tx types.Transaction) error { - return ecSignTransaction(s.key, tx) -} - -func (r *ecRecoverer) RecoverHash(hash types.Hash, sig types.Signature) (*types.Address, error) { - return ecRecoverHash(hash, sig) -} - -func (r *ecRecoverer) RecoverMessage(data []byte, sig types.Signature) (*types.Address, error) { - return ecRecoverMessage(data, sig) -} - -func (r *ecRecoverer) RecoverTransaction(tx types.Transaction) (*types.Address, error) { - return ecRecoverTransaction(tx) -} diff --git a/crypto/ecdsa.go b/crypto/ecdsa.go deleted file mode 100644 index 9b6935e..0000000 --- a/crypto/ecdsa.go +++ /dev/null @@ -1,152 +0,0 @@ -package crypto - -import ( - "crypto/ecdsa" - "crypto/elliptic" - "errors" - "fmt" - "math/big" - - "github.com/btcsuite/btcd/btcec/v2" - btcececdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" - - "github.com/defiweb/go-eth/types" -) - -var s256 = btcec.S256() - -// ECPublicKeyToAddress returns the Ethereum address for the given ECDSA public key. -func ECPublicKeyToAddress(pub *ecdsa.PublicKey) (addr types.Address) { - b := Keccak256(elliptic.Marshal(s256, pub.X, pub.Y)[1:]) - copy(addr[:], b[12:]) - return -} - -// ecSignHash signs the given hash with the given private key. -func ecSignHash(key *ecdsa.PrivateKey, hash types.Hash) (*types.Signature, error) { - if key == nil { - return nil, fmt.Errorf("missing private key") - } - privKey, _ := btcec.PrivKeyFromBytes(key.D.Bytes()) - sig, err := btcececdsa.SignCompact(privKey, hash.Bytes(), false) - if err != nil { - return nil, err - } - v := sig[0] - switch v { - case 27, 28: - v -= 27 - } - copy(sig, sig[1:]) - sig[64] = v - return types.SignatureFromBytesPtr(sig), nil -} - -// ecSignMessage signs the given message with the given private key. -func ecSignMessage(key *ecdsa.PrivateKey, data []byte) (*types.Signature, error) { - if key == nil { - return nil, fmt.Errorf("missing private key") - } - sig, err := ecSignHash(key, Keccak256(AddMessagePrefix(data))) - if err != nil { - return nil, err - } - sig.V = new(big.Int).Add(sig.V, big.NewInt(27)) - return sig, nil -} - -// ecSignTransaction signs the given transaction with the given private key. -func ecSignTransaction(key *ecdsa.PrivateKey, tx types.Transaction) error { - if key == nil { - return fmt.Errorf("missing private key") - } - txd := tx.TransactionData() - hash, err := tx.CalculateSigningHash(Keccak256) - if err != nil { - return err - } - sig, err := ecSignHash(key, hash) - if err != nil { - return err - } - sv, sr, ss := sig.V, sig.R, sig.S - if tx.Type() == types.LegacyTxType { - if txd.ChainID != nil { - sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*txd.ChainID*2)) - sv = new(big.Int).Add(sv, big.NewInt(35)) - } else { - sv = new(big.Int).Add(sv, big.NewInt(27)) - } - } - txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) - if cd, ok := tx.(types.HasCallData); ok { - cd.CallData().SetFrom(ECPublicKeyToAddress(&key.PublicKey)) - } - return nil -} - -// ecRecoverHash recovers the Ethereum address from the given hash and signature. -func ecRecoverHash(hash types.Hash, sig types.Signature) (*types.Address, error) { - if sig.V.BitLen() > 8 { - return nil, errors.New("invalid signature: V has more than 8 bits") - } - if sig.R.BitLen() > 256 { - return nil, errors.New("invalid signature: R has more than 256 bits") - } - if sig.S.BitLen() > 256 { - return nil, errors.New("invalid signature: S has more than 256 bits") - } - v := byte(sig.V.Uint64()) - switch v { - case 0, 1: - v += 27 - } - rb := sig.R.Bytes() - sb := sig.S.Bytes() - bin := make([]byte, 65) - bin[0] = v - copy(bin[1+(32-len(rb)):], rb) - copy(bin[33+(32-len(sb)):], sb) - pub, _, err := btcececdsa.RecoverCompact(bin, hash.Bytes()) - if err != nil { - return nil, err - } - addr := ECPublicKeyToAddress(pub.ToECDSA()) - return &addr, nil -} - -// ecRecoverMessage recovers the Ethereum address from the given message and signature. -func ecRecoverMessage(data []byte, sig types.Signature) (*types.Address, error) { - sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) - return ecRecoverHash(Keccak256(AddMessagePrefix(data)), sig) -} - -// ecRecoverTransaction recovers the Ethereum address from the given transaction. -func ecRecoverTransaction(tx types.Transaction) (*types.Address, error) { - txd := tx.TransactionData() - if txd.Signature == nil { - return nil, fmt.Errorf("signature is missing") - } - sig := *txd.Signature - if tx.Type() == types.LegacyTxType { - if sig.V.Cmp(big.NewInt(35)) >= 0 { - x := new(big.Int).Sub(sig.V, big.NewInt(35)) - - // Derive the chain ID from the signature. - chainID := new(big.Int).Div(x, big.NewInt(2)) - if txd.ChainID != nil && *txd.ChainID != chainID.Uint64() { - return nil, fmt.Errorf("invalid chain ID: %d", chainID) - } - - // Derive the recovery byte from the signature. - sig.V = new(big.Int).Add(new(big.Int).Mod(x, big.NewInt(2)), big.NewInt(27)) - } else { - sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) - } - } - hash, err := tx.CalculateSigningHash(Keccak256) - if err != nil { - return nil, err - } - return ecRecoverHash(hash, sig) -} diff --git a/crypto/ecdsa/ecdsa.go b/crypto/ecdsa/ecdsa.go new file mode 100644 index 0000000..245e805 --- /dev/null +++ b/crypto/ecdsa/ecdsa.go @@ -0,0 +1,136 @@ +package ecdsa + +import ( + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "errors" + "fmt" + "math/big" + + "github.com/btcsuite/btcd/btcec/v2" + btcececdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" + + "github.com/defiweb/go-eth/crypto/keccak" +) + +// PublicKey is an ECDSA public key. +type PublicKey = ecdsa.PublicKey + +// PrivateKey is an ECDSA private key. +type PrivateKey = ecdsa.PrivateKey + +// Hash is a 32-byte hash. +// +// This type is used in ECDSA cryptographic operations. For most use cases, the +// Hash type from the types package should be used instead. +type Hash [32]byte + +// Address is a 20-byte Ethereum address. +// +// This type is used in ECDSA cryptographic operations. For most use cases, the +// Address type from the types package should be used instead. +type Address [20]byte + +// Signature is an ECDSA signature. +// +// This type is used in ECDSA cryptographic operations. For most use cases, the +// Signature type from the types package should be used instead. +type Signature struct { + V *big.Int + R *big.Int + S *big.Int +} + +var s256 = btcec.S256() + +// AddMessagePrefix adds the Ethereum message prefix to the given data as +// defined in EIP-191. +func AddMessagePrefix(data []byte) []byte { + return []byte(fmt.Sprintf("\x19Ethereum Signed Message:\n%d%s", len(data), data)) +} + +// GenerateKey generates a new ECDSA private key. +func GenerateKey() (*PrivateKey, error) { + return ecdsa.GenerateKey(s256, rand.Reader) +} + +// PublicKeyToAddress returns the Ethereum address for the given ECDSA public key. +func PublicKeyToAddress(publicKey *PublicKey) (addr Address) { + h := keccak.Hash256(elliptic.Marshal(s256, publicKey.X, publicKey.Y)[1:]) + copy(addr[:], h[12:]) + return +} + +// SignHash signs the given hash with the given private key. +func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { + if privateKey == nil { + return nil, fmt.Errorf("missing private key") + } + privKey, _ := btcec.PrivKeyFromBytes(privateKey.D.Bytes()) + sig, err := btcececdsa.SignCompact(privKey, hash[:], false) + if err != nil { + return nil, err + } + v := sig[0] + switch v { + case 27, 28: + v -= 27 + } + copy(sig, sig[1:]) + sig[64] = v + return &Signature{ + V: new(big.Int).SetBytes(sig[64:]), + R: new(big.Int).SetBytes(sig[:32]), + S: new(big.Int).SetBytes(sig[32:64]), + }, nil +} + +// RecoverHash recovers the Ethereum address from the given hash and signature. +func RecoverHash(hash Hash, signature Signature) (*Address, error) { + if signature.V.BitLen() > 8 { + return nil, errors.New("invalid signature: V has more than 8 bits") + } + if signature.R.BitLen() > 256 { + return nil, errors.New("invalid signature: R has more than 256 bits") + } + if signature.S.BitLen() > 256 { + return nil, errors.New("invalid signature: S has more than 256 bits") + } + v := byte(signature.V.Uint64()) + switch v { + case 0, 1: + v += 27 + } + rb := signature.R.Bytes() + sb := signature.S.Bytes() + bin := make([]byte, 65) + bin[0] = v + copy(bin[1+(32-len(rb)):], rb) + copy(bin[33+(32-len(sb)):], sb) + pub, _, err := btcececdsa.RecoverCompact(bin, hash[:]) + if err != nil { + return nil, err + } + addr := PublicKeyToAddress(pub.ToECDSA()) + return &addr, nil +} + +// SignMessage signs the given message with the given private key. +func SignMessage(key *PrivateKey, data []byte) (*Signature, error) { + if key == nil { + return nil, fmt.Errorf("missing private key") + } + sig, err := SignHash(key, Hash(keccak.Hash256(AddMessagePrefix(data)))) + if err != nil { + return nil, err + } + sig.V = new(big.Int).Add(sig.V, big.NewInt(27)) + return sig, nil +} + +// RecoverMessage recovers the Ethereum address from the given message and signature. +func RecoverMessage(data []byte, sig Signature) (*Address, error) { + sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) + return RecoverHash(Hash(keccak.Hash256(AddMessagePrefix(data))), sig) +} diff --git a/crypto/ecdsa_test.go b/crypto/ecdsa/ecdsa_test.go similarity index 99% rename from crypto/ecdsa_test.go rename to crypto/ecdsa/ecdsa_test.go index 1b1417f..0ab817c 100644 --- a/crypto/ecdsa_test.go +++ b/crypto/ecdsa/ecdsa_test.go @@ -1,4 +1,4 @@ -package crypto +package ecdsa import ( "bytes" diff --git a/crypto/keccak.go b/crypto/keccak.go deleted file mode 100644 index 7188f19..0000000 --- a/crypto/keccak.go +++ /dev/null @@ -1,16 +0,0 @@ -package crypto - -import ( - "golang.org/x/crypto/sha3" - - "github.com/defiweb/go-eth/types" -) - -// Keccak256 calculates the Keccak256 hash of the given data. -func Keccak256(data ...[]byte) types.Hash { - h := sha3.NewLegacyKeccak256() - for _, i := range data { - h.Write(i) - } - return types.MustHashFromBytes(h.Sum(nil), types.PadNone) -} diff --git a/crypto/keccak/keccak.go b/crypto/keccak/keccak.go new file mode 100644 index 0000000..7412787 --- /dev/null +++ b/crypto/keccak/keccak.go @@ -0,0 +1,20 @@ +package keccak + +import ( + "golang.org/x/crypto/sha3" +) + +// Hash is a 32-byte Keccak256 hash. +// +// For most use cases, the Hash type from the types package should be used instead. +type Hash [32]byte + +// Hash256 calculates the Keccak256 hash of the given data. +func Hash256(data ...[]byte) (h Hash) { + k := sha3.NewLegacyKeccak256() + for _, i := range data { + k.Write(i) + } + copy(h[:], k.Sum(nil)) + return +} diff --git a/crypto/keccak_test.go b/crypto/keccak/keccak_test.go similarity index 53% rename from crypto/keccak_test.go rename to crypto/keccak/keccak_test.go index f9db154..9b1052e 100644 --- a/crypto/keccak_test.go +++ b/crypto/keccak/keccak_test.go @@ -1,6 +1,7 @@ -package crypto +package keccak import ( + "encoding/hex" "fmt" "testing" @@ -14,20 +15,21 @@ func TestKeccak256(t *testing.T) { }{ { data: [][]byte{[]byte("")}, - want: "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + want: "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", }, { data: [][]byte{[]byte("ab")}, - want: "0x67fad3bfa1e0321bd021ca805ce14876e50acac8ca8532eda8cbf924da565160", + want: "67fad3bfa1e0321bd021ca805ce14876e50acac8ca8532eda8cbf924da565160", }, { data: [][]byte{[]byte("a"), []byte("b")}, - want: "0x67fad3bfa1e0321bd021ca805ce14876e50acac8ca8532eda8cbf924da565160", + want: "67fad3bfa1e0321bd021ca805ce14876e50acac8ca8532eda8cbf924da565160", }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - assert.Equal(t, tt.want, Keccak256(tt.data...).String()) + h := Hash256(tt.data...) + assert.Equal(t, tt.want, hex.EncodeToString(h[:])) }) } } diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go new file mode 100644 index 0000000..119337f --- /dev/null +++ b/crypto/kzg4844/kzg4844.go @@ -0,0 +1,124 @@ +package kzg4844 + +import ( + "crypto/sha256" + "embed" + "encoding/json" + "sync" + + kzg4844 "github.com/crate-crypto/go-kzg-4844" +) + +const ( + BlobLength = 131072 + CommitmentLength = 48 + ProofLength = 48 + PointLength = 32 + ClaimLength = 32 +) + +// Blob represents a 4844 data blob. +type Blob [BlobLength]byte + +// Commitment is a serialized commitment to a polynomial. +type Commitment [CommitmentLength]byte + +// Proof is a serialized commitment to the quotient polynomial. +type Proof [ProofLength]byte + +// Point is a BLS field element. +type Point [PointLength]byte + +// Claim is a claimed evaluation value in a specific point. +type Claim [ClaimLength]byte + +func BlobToCommitment(blob *Blob) (Commitment, error) { + initContext() + commitment, err := context.BlobToKZGCommitment( + (*kzg4844.Blob)(blob), + 0, + ) + if err != nil { + return Commitment{}, err + } + return (Commitment)(commitment), nil +} + +func ComputeProof(blob *Blob, point Point) (Proof, Claim, error) { + initContext() + proof, claim, err := context.ComputeKZGProof( + (*kzg4844.Blob)(blob), + (kzg4844.Scalar)(point), + 0, + ) + if err != nil { + return Proof{}, Claim{}, err + } + return (Proof)(proof), (Claim)(claim), nil +} + +func VerifyProof(commitment Commitment, point Point, claim Claim, proof Proof) error { + initContext() + return context.VerifyKZGProof( + (kzg4844.KZGCommitment)(commitment), + (kzg4844.Scalar)(point), + (kzg4844.Scalar)(claim), + (kzg4844.KZGProof)(proof), + ) +} + +func ComputeBlobProof(blob *Blob, commitment Commitment) (Proof, error) { + initContext() + proof, err := context.ComputeBlobKZGProof( + (*kzg4844.Blob)(blob), + (kzg4844.KZGCommitment)(commitment), + 0, + ) + if err != nil { + return Proof{}, err + } + return (Proof)(proof), nil +} + +func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error { + initContext() + return context.VerifyBlobKZGProof( + (*kzg4844.Blob)(blob), + (kzg4844.KZGCommitment)(commitment), + (kzg4844.KZGProof)(proof), + ) +} + +// ComputeBlobHashV1 calculates the 'versioned blob hash' of a commitment. +func ComputeBlobHashV1(commit Commitment) (h [32]byte) { + k := sha256.New() + k.Write(commit[:]) + k.Sum(h[:]) + h[0] = 0x01 + return +} + +//go:embed trusted_setup.json +var content embed.FS + +// context holds the necessary configuration needed to create and verify proofs. +var context *kzg4844.Context + +var once sync.Once + +func initContext() { + once.Do(func() { + setupFile, err := content.ReadFile("trusted_setup.json") + if err != nil { + panic(err) + } + setup := new(kzg4844.JSONTrustedSetup) + if err = json.Unmarshal(setupFile, setup); err != nil { + panic(err) + } + context, err = kzg4844.NewContext4096(setup) + if err != nil { + panic(err) + } + }) +} diff --git a/crypto/kzg4844/trusted_setup.json b/crypto/kzg4844/trusted_setup.json new file mode 100644 index 0000000..c6d724e --- /dev/null +++ b/crypto/kzg4844/trusted_setup.json @@ -0,0 +1,4167 @@ +{ + "g1_lagrange": [ + "0xa0413c0dcafec6dbc9f47d66785cf1e8c981044f7d13cfe3e4fcbb71b5408dfde6312493cb3c1d30516cb3ca88c03654", + "0x8b997fb25730d661918371bb41f2a6e899cac23f04fc5365800b75433c0a953250e15e7a98fb5ca5cc56a8cd34c20c57", + "0x83302852db89424d5699f3f157e79e91dc1380f8d5895c5a772bb4ea3a5928e7c26c07db6775203ce33e62a114adaa99", + "0xa759c48b7e4a685e735c01e5aa6ef9c248705001f470f9ad856cd87806983e917a8742a3bd5ee27db8d76080269b7c83", + "0x967f8dc45ebc3be14c8705f43249a30ff48e96205fb02ae28daeab47b72eb3f45df0625928582aa1eb4368381c33e127", + "0xa418eb1e9fb84cb32b370610f56f3cb470706a40ac5a47c411c464299c45c91f25b63ae3fcd623172aa0f273c0526c13", + "0x8f44e3f0387293bc7931e978165abbaed08f53acd72a0a23ac85f6da0091196b886233bcee5b4a194db02f3d5a9b3f78", + "0x97173434b336be73c89412a6d70d416e170ea355bf1956c32d464090b107c090ef2d4e1a467a5632fbc332eeb679bf2d", + "0xa24052ad8d55ad04bc5d951f78e14213435681594110fd18173482609d5019105b8045182d53ffce4fc29fc8810516c1", + "0xb950768136b260277590b5bec3f56bbc2f7a8bc383d44ce8600e85bf8cf19f479898bcc999d96dfbd2001ede01d94949", + "0x92ab8077871037bd3b57b95cbb9fb10eb11efde9191690dcac655356986fd02841d8fdb25396faa0feadfe3f50baf56d", + "0xa79b096dff98038ac30f91112dd14b78f8ad428268af36d20c292e2b3b6d9ed4fb28480bb04e465071cc67d05786b6d1", + "0xb9ff71461328f370ce68bf591aa7fb13027044f42a575517f3319e2be4aa4843fa281e756d0aa5645428d6dfa857cef2", + "0x8d765808c00b3543ff182e2d159c38ae174b12d1314da88ea08e13bd9d1c37184cb515e6bf6420531b5d41767987d7ce", + "0xb8c9a837d20c3b53e6f578e4a257bb7ef8fc43178614ec2a154915b267ad2be135981d01ed2ee1b5fbd9d9bb27f0800a", + "0xa9773d92cf23f65f98ef68f6cf95c72b53d0683af2f9bf886bb9036e4a38184b1131b26fd24397910b494fbef856f3aa", + "0xb41ebe38962d112da4a01bf101cb248d808fbd50aaf749fc7c151cf332032eb3e3bdbd716db899724b734d392f26c412", + "0x90fbb030167fb47dcc13d604a726c0339418567c1d287d1d87423fa0cb92eec3455fbb46bcbe2e697144a2d3972142e4", + "0xb11d298bd167464b35fb923520d14832bd9ed50ed841bf6d7618424fd6f3699190af21759e351b89142d355952149da1", + "0x8bc36066f69dc89f7c4d1e58d67497675050c6aa002244cebd9fc957ec5e364c46bab4735ea3db02b73b3ca43c96e019", + "0xab7ab92c5d4d773068e485aa5831941ebd63db7118674ca38089635f3b4186833af2455a6fb9ed2b745df53b3ce96727", + "0xaf191ca3089892cb943cd97cf11a51f38e38bd9be50844a4e8da99f27e305e876f9ed4ab0628e8ae3939066b7d34a15f", + "0xa3204c1747feabc2c11339a542195e7cb6628fd3964f846e71e2e3f2d6bb379a5e51700682ea1844eba12756adb13216", + "0x903a29883846b7c50c15968b20e30c471aeac07b872c40a4d19eb1a42da18b649d5bbfde4b4cf6225d215a461b0deb6d", + "0x8e6e9c15ffbf1e16e5865a5fef7ed751dc81957a9757b535cb38b649e1098cda25d42381dc4f776778573cdf90c3e6e0", + "0xa8f6dd26100b512a8c96c52e00715c4b2cb9ac457f17aed8ffe1cf1ea524068fe5a1ddf218149845fc1417b789ecfc98", + "0xa5b0ffc819451ea639cfd1c18cbc9365cc79368d3b2e736c0ae54eba2f0801e6eb0ee14a5f373f4a70ca463bdb696c09", + "0x879f91ccd56a1b9736fbfd20d8747354da743fb121f0e308a0d298ff0d9344431890e41da66b5009af3f442c636b4f43", + "0x81bf3a2d9755e206b515a508ac4d1109bf933c282a46a4ae4a1b4cb4a94e1d23642fad6bd452428845afa155742ade7e", + "0x8de778d4742f945df40004964e165592f9c6b1946263adcdd5a88b00244bda46c7bb49098c8eb6b3d97a0dd46148a8ca", + "0xb7a57b21d13121907ee28c5c1f80ee2e3e83a3135a8101e933cf57171209a96173ff5037f5af606e9fd6d066de6ed693", + "0xb0877d1963fd9200414a38753dffd9f23a10eb3198912790d7eddbc9f6b477019d52ddd4ebdcb9f60818db076938a5a9", + "0x88da2d7a6611bc16adc55fc1c377480c828aba4496c645e3efe0e1a67f333c05a0307f7f1d2df8ac013602c655c6e209", + "0x95719eb02e8a9dede1a888c656a778b1c69b7716fbe3d1538fe8afd4a1bc972183c7d32aa7d6073376f7701df80116d8", + "0x8e8a1ca971f2444b35af3376e85dccda3abb8e8e11d095d0a4c37628dfe5d3e043a377c3de68289ef142e4308e9941a0", + "0xb720caaff02f6d798ac84c4f527203e823ff685869e3943c979e388e1c34c3f77f5c242c6daa7e3b30e511aab917b866", + "0x86040d55809afeec10e315d1ad950d269d37cfee8c144cd8dd4126459e3b15a53b3e68df5981df3c2346d23c7b4baaf4", + "0x82d8cabf13ab853db0377504f0aec00dba3a5cd3119787e8ad378ddf2c40b022ecfc67c642b7acc8c1e3dd03ab50993e", + "0xb8d873927936719d2484cd03a6687d65697e17dcf4f0d5aed6f5e4750f52ef2133d4645894e7ebfc4ef6ce6788d404c8", + "0xb1235594dbb15b674a419ff2b2deb644ad2a93791ca05af402823f87114483d6aa1689b7a9bea0f547ad12fe270e4344", + "0xa53fda86571b0651f5affb74312551a082fffc0385cfd24c1d779985b72a5b1cf7c78b42b4f7e51e77055f8e5e915b00", + "0xb579adcfd9c6ef916a5a999e77a0cb21d378c4ea67e13b7c58709d5da23a56c2e54218691fc4ac39a4a3d74f88cc31f7", + "0xab79e584011713e8a2f583e483a91a0c2a40771b77d91475825b5acbea82db4262132901cb3e4a108c46d7c9ee217a4e", + "0xa0fe58ea9eb982d7654c8aaf9366230578fc1362f6faae0594f8b9e659bcb405dff4aac0c7888bbe07f614ecf0d800a6", + "0x867e50e74281f28ecd4925560e2e7a6f8911b135557b688254623acce0dbc41e23ac3e706a184a45d54c586edc416eb0", + "0x89f81b61adda20ea9d0b387a36d0ab073dc7c7cbff518501962038be19867042f11fcc7ff78096e5d3b68c6d8dc04d9b", + "0xa58ee91bb556d43cf01f1398c5811f76dc0f11efdd569eed9ef178b3b0715e122060ec8f945b4dbf6eebfa2b90af6fa6", + "0xac460be540f4c840def2eef19fc754a9af34608d107cbadb53334cf194cc91138d53b9538fcd0ec970b5d4aa455b224a", + "0xb09b91f929de52c09d48ca0893be6eb44e2f5210a6c394689dc1f7729d4be4e11d0474b178e80cea8c2ac0d081f0e811", + "0x8d37a442a76b06a02a4e64c2504aea72c8b9b020ab7bcc94580fe2b9603c7c50d7b1e9d70d2a7daea19c68667e8f8c31", + "0xa9838d4c4e3f3a0075a952cf7dd623307ec633fcc81a7cf9e52e66c31780de33dbb3d74c320dc7f0a4b72f7a49949515", + "0xa44766b6251af458fe4f5f9ed1e02950f35703520b8656f09fc42d9a2d38a700c11a7c8a0436ac2e5e9f053d0bb8ff91", + "0xad78d9481c840f5202546bea0d13c776826feb8b1b7c72e83d99a947622f0bf38a4208551c4c41beb1270d7792075457", + "0xb619ffa8733b470039451e224b777845021e8dc1125f247a4ff2476cc774657d0ff9c5279da841fc1236047de9d81c60", + "0xaf760b0a30a1d6af3bc5cd6686f396bd41779aeeb6e0d70a09349bd5da17ca2e7965afc5c8ec22744198fbe3f02fb331", + "0xa0cc209abdb768b589fcb7b376b6e1cac07743288c95a1cf1a0354b47f0cf91fca78a75c1fcafa6f5926d6c379116608", + "0x864add673c89c41c754eeb3cd8dcff5cdde1d739fce65c30e474a082bb5d813cba6412e61154ce88fdb6c12c5d9be35b", + "0xb091443b0ce279327dc37cb484e9a5b69b257a714ce21895d67539172f95ffa326903747b64a3649e99aea7bb10d03f7", + "0xa8c452b8c4ca8e0a61942a8e08e28f17fb0ef4c5b018b4e6d1a64038280afa2bf1169202f05f14af24a06ca72f448ccd", + "0xa23c24721d18bc48d5dcf70effcbef89a7ae24e67158d70ae1d8169ee75d9a051d34b14e9cf06488bac324fe58549f26", + "0x92a730e30eb5f3231feb85f6720489dbb1afd42c43f05a1610c6b3c67bb949ec8fde507e924498f4ffc646f7b07d9123", + "0x8dbe5abf4031ec9ba6bb06d1a47dd1121fb9e03b652804069250967fd5e9577d0039e233441b7f837a7c9d67ba18c28e", + "0xaa456bcfef6a21bb88181482b279df260297b3778e84594ebddbdf337e85d9e3d46ca1d0b516622fb0b103df8ec519b7", + "0xa3b31ae621bd210a2b767e0e6f22eb28fe3c4943498a7e91753225426168b9a26da0e02f1dc5264da53a5ad240d9f51b", + "0xaa8d66857127e6e71874ce2202923385a7d2818b84cb73a6c42d71afe70972a70c6bdd2aad1a6e8c5e4ca728382a8ea8", + "0xac7e8e7a82f439127a5e40558d90d17990f8229852d21c13d753c2e97facf077cf59582b603984c3dd3faebd80aff4f5", + "0x93a8bcf4159f455d1baa73d2ef2450dcd4100420de84169bbe28b8b7a5d1746273f870091a87a057e834f754f34204b1", + "0x89d0ebb287c3613cdcae7f5acc43f17f09c0213fc40c074660120b755d664109ffb9902ed981ede79e018ddb0c845698", + "0xa87ccbfad431406aadbee878d9cf7d91b13649d5f7e19938b7dfd32645a43b114eef64ff3a13201398bd9b0337832e5a", + "0x833c51d0d0048f70c3eefb4e70e4ff66d0809c41838e8d2c21c288dd3ae9d9dfaf26d1742bf4976dab83a2b381677011", + "0x8bcd6b1c3b02fffead432e8b1680bad0a1ac5a712d4225e220690ee18df3e7406e2769e1f309e2e803b850bc96f0e768", + "0xb61e3dbd88aaf4ff1401521781e2eea9ef8b66d1fac5387c83b1da9e65c2aa2a56c262dea9eceeb4ad86c90211672db0", + "0x866d3090db944ecf190dd0651abf67659caafd31ae861bab9992c1e3915cb0952da7c561cc7e203560a610f48fae633b", + "0xa5e8971543c14274a8dc892b0be188c1b4fbc75c692ed29f166e0ea80874bc5520c2791342b7c1d2fb5dd454b03b8a5b", + "0x8f2f9fc50471bae9ea87487ebd1bc8576ef844cc42d606af5c4c0969670fdf2189afd643e4de3145864e7773d215f37f", + "0xb1bb0f2527db6d51f42b9224383c0f96048bbc03d469bf01fe1383173ef8b1cc9455d9dd8ba04d46057f46949bfc92b5", + "0xaa7c99d906b4d7922296cfe2520473fc50137c03d68b7865c5bfb8adbc316b1034310ec4b5670c47295f4a80fb8d61e9", + "0xa5d1da4d6aba555919df44cbaa8ff79378a1c9e2cfdfbf9d39c63a4a00f284c5a5724e28ecbc2d9dba27fe4ee5018bd5", + "0xa8db53224f70af4d991b9aae4ffe92d2aa5b618ad9137784b55843e9f16cefbfd25ada355d308e9bbf55f6d2f7976fb3", + "0xb6536c4232bb20e22af1a8bb12de76d5fec2ad9a3b48af1f38fa67e0f8504ef60f305a73d19385095bb6a9603fe29889", + "0x87f7e371a1817a63d6838a8cf4ab3a8473d19ce0d4f40fd013c03d5ddd5f4985df2956531cc9f187928ef54c68f4f9a9", + "0xae13530b1dbc5e4dced9d909ea61286ec09e25c12f37a1ed2f309b0eb99863d236c3b25ed3484acc8c076ad2fa8cd430", + "0x98928d850247c6f7606190e687d5c94a627550198dbdbea0161ef9515eacdb1a0f195cae3bb293112179082daccf8b35", + "0x918528bb8e6a055ad4db6230d3a405e9e55866da15c4721f5ddd1f1f37962d4904aad7a419218fe6d906fe191a991806", + "0xb71e31a06afe065773dd3f4a6e9ef81c3292e27a3b7fdfdd452d03e05af3b6dd654c355f7516b2a93553360c6681a73a", + "0x8870b83ab78a98820866f91ac643af9f3ff792a2b7fda34185a9456a63abdce42bfe8ad4dc67f08a6392f250d4062df4", + "0x91eea1b668e52f7a7a5087fabf1cab803b0316f78d9fff469fbfde2162f660c250e4336a9eea4cb0450bd30ac067bc8b", + "0x8b74990946de7b72a92147ceac1bd9d55999a8b576e8df68639e40ed5dc2062cfcd727903133de482b6dca19d0aaed82", + "0x8ebad537fece090ebbab662bdf2618e21ca30cf6329c50935e8346d1217dcbe3c1fe1ea28efca369c6003ce0a94703c1", + "0xa8640479556fb59ebd1c40c5f368fbd960932fdbb782665e4a0e24e2bdb598fc0164ce8c0726d7759cfc59e60a62e182", + "0xa9a52a6bf98ee4d749f6d38be2c60a6d54b64d5cbe4e67266633dc096cf28c97fe998596707d31968cbe2064b72256bf", + "0x847953c48a4ce6032780e9b39d0ed4384e0be202c2bbe2dfda3910f5d87aa5cd3c2ffbfcfae4dddce16d6ab657599b95", + "0xb6f6e1485d3ec2a06abaecd23028b200b2e4a0096c16144d07403e1720ff8f9ba9d919016b5eb8dc5103880a7a77a1d3", + "0x98dfc2065b1622f596dbe27131ea60bef7a193b12922cecb27f8c571404f483014f8014572e86ae2e341ab738e4887ef", + "0xacb0d205566bacc87bbe2e25d10793f63f7a1f27fd9e58f4f653ceae3ffeba511eaf658e068fad289eeb28f9edbeb35b", + "0xae4411ed5b263673cee894c11fe4abc72a4bf642d94022a5c0f3369380fcdfc1c21e277f2902972252503f91ada3029a", + "0xac4a7a27ba390a75d0a247d93d4a8ef1f0485f8d373a4af4e1139369ec274b91b3464d9738eeaceb19cd6f509e2f8262", + "0x87379c3bf231fdafcf6472a79e9e55a938d851d4dd662ab6e0d95fd47a478ed99e2ad1e6e39be3c0fc4f6d996a7dd833", + "0x81316904b035a8bcc2041199a789a2e6879486ba9fddcba0a82c745cc8dd8374a39e523b91792170cd30be7aa3005b85", + "0xb8206809c6cd027ed019f472581b45f7e12288f89047928ba32b4856b6560ad30395830d71e5e30c556f6f182b1fe690", + "0x88d76c028f534a62e019b4a52967bb8642ede6becfa3807be68fdd36d366fc84a4ac8dc176e80a68bc59eb62caf5dff9", + "0x8c3b8be685b0f8aad131ee7544d0e12f223f08a6f8edaf464b385ac644e0ddc9eff7cc7cb5c1b50ab5d71ea0f41d2213", + "0x8d91410e004f76c50fdc05784157b4d839cb5090022c629c7c97a5e0c3536eeafee17a527b54b1165c3cd81774bb54ce", + "0xb25c2863bc28ec5281ce800ddf91a7e1a53f4c6d5da1e6c86ef4616e93bcf55ed49e297216d01379f5c6e7b3c1e46728", + "0x865f7b09ac3ca03f20be90c48f6975dd2588838c2536c7a3532a6aa5187ed0b709cd03d91ff4048061c10d0aa72b69ce", + "0xb3f7477c90c11596eb4f8bbf34adbcb832638c4ff3cdd090d4d477ee50472ac9ddaf5be9ad7eca3f148960d362bbd098", + "0x8db35fd53fca04faecd1c76a8227160b3ab46ac1af070f2492445a19d8ff7c25bbaef6c9fa0c8c088444561e9f7e4eb2", + "0xa478b6e9d058a2e01d2fc053b739092e113c23a6a2770a16afbef044a3709a9e32f425ace9ba7981325f02667c3f9609", + "0x98caa6bd38916c08cf221722a675a4f7577f33452623de801d2b3429595f988090907a7e99960fff7c076d6d8e877b31", + "0xb79aaaacefc49c3038a14d2ac468cfec8c2161e88bdae91798d63552cdbe39e0e02f9225717436b9b8a40a022c633c6e", + "0x845a31006c680ee6a0cc41d3dc6c0c95d833fcf426f2e7c573fa15b2c4c641fbd6fe5ebb0e23720cc3467d6ee1d80dc4", + "0xa1bc287e272cf8b74dbf6405b3a5190883195806aa351f1dc8e525aa342283f0a35ff687e3b434324dedee74946dd185", + "0xa4fd2dc8db75d3783a020856e2b3aa266dc6926e84f5c491ef739a3bddd46dc8e9e0fc1177937839ef1b18d062ffbb9e", + "0xacbf0d3c697f57c202bb8c5dc4f3fc341b8fc509a455d44bd86acc67cad2a04495d5537bcd3e98680185e8aa286f2587", + "0xa5caf423a917352e1b8e844f5968a6da4fdeae467d10c6f4bbd82b5eea46a660b82d2f5440d3641c717b2c3c9ed0be52", + "0x8a39d763c08b926599ab1233219c49c825368fad14d9afc7c0c039224d37c00d8743293fd21645bf0b91eaf579a99867", + "0xb2b53a496def0ba06e80b28f36530fbe0fb5d70a601a2f10722e59abee529369c1ae8fd0f2db9184dd4a2519bb832d94", + "0xa73980fcef053f1b60ebbb5d78ba6332a475e0b96a0c724741a3abf3b59dd344772527f07203cf4c9cb5155ebed81fa0", + "0xa070d20acce42518ece322c9db096f16aed620303a39d8d5735a0df6e70fbeceb940e8d9f5cc38f3314b2240394ec47b", + "0xa50cf591f522f19ca337b73089557f75929d9f645f3e57d4f241e14cdd1ea3fb48d84bcf05e4f0377afbb789fbdb5d20", + "0x82a5ffce451096aca8eeb0cd2ae9d83db3ed76da3f531a80d9a70a346359bf05d74863ce6a7c848522b526156a5e20cd", + "0x88e0e84d358cbb93755a906f329db1537c3894845f32b9b0b691c29cbb455373d9452fadd1e77e20a623f6eaf624de6f", + "0xaa07ac7b84a6d6838826e0b9e350d8ec75e398a52e9824e6b0da6ae4010e5943fec4f00239e96433f291fef9d1d1e609", + "0xac8887bf39366034bc63f6cc5db0c26fd27307cbc3d6cce47894a8a019c22dd51322fb5096edc018227edfafc053a8f6", + "0xb7d26c26c5b33f77422191dca94977588ab1d4b9ce7d0e19c4a3b4cd1c25211b78c328dbf81e755e78cd7d1d622ad23e", + "0x99a676d5af49f0ba44047009298d8474cabf2d5bca1a76ba21eff7ee3c4691a102fdefea27bc948ccad8894a658abd02", + "0xb0d09a91909ab3620c183bdf1d53d43d39eb750dc7a722c661c3de3a1a5d383ad221f71bae374f8a71867505958a3f76", + "0x84681a883de8e4b93d68ac10e91899c2bbb815ce2de74bb48a11a6113b2a3f4df8aceabda1f5f67bc5aacac8c9da7221", + "0x9470259957780fa9b43521fab3644f555f5343281c72582b56d2efd11991d897b3b481cafa48681c5aeb80c9663b68f7", + "0xab1b29f7ece686e6fa968a4815da1d64f3579fed3bc92e1f3e51cd13a3c076b6cf695ed269d373300a62463dc98a4234", + "0x8ab415bfcd5f1061f7687597024c96dd9c7cb4942b5989379a7a3b5742f7d394337886317659cbeacaf030234a24f972", + "0xb9b524aad924f9acc63d002d617488f31b0016e0f0548f050cada285ce7491b74a125621638f19e9c96eabb091d945be", + "0x8c4c373e79415061837dd0def4f28a2d5d74d21cb13a76c9049ad678ca40228405ab0c3941df49249847ecdefc1a5b78", + "0xa8edf4710b5ab2929d3db6c1c0e3e242261bbaa8bcec56908ddadd7d2dad2dca9d6eb9de630b960b122ebeea41040421", + "0x8d66bb3b50b9df8f373163629f9221b3d4b6980a05ea81dc3741bfe9519cf3ebba7ab98e98390bae475e8ede5821bd5c", + "0x8d3c21bae7f0cfb97c56952bb22084b58e7bb718890935b73103f33adf5e4d99cd262f929c6eeab96209814f0dbae50a", + "0xa5c66cfab3d9ebf733c4af24bebc97070e7989fe3c73e79ac85fb0e4d40ae44fb571e0fad4ad72560e13ed453900d14f", + "0x9362e6b50b43dbefbc3254471372297b5dcce809cd3b60bf74a1268ab68bdb50e46e462cbd78f0d6c056330e982846af", + "0x854630d08e3f0243d570cc2e856234cb4c1a158d9c1883bf028a76525aaa34be897fe918d5f6da9764a3735fa9ebd24a", + "0x8c7d246985469ff252c3f4df6c7c9196fc79f05c1c66a609d84725c78001d0837c7a7049394ba5cf7e863e2d58af8417", + "0xae050271e01b528925302e71903f785b782f7bf4e4e7a7f537140219bc352dc7540c657ed03d3a297ad36798ecdb98cd", + "0x8d2ae9179fcf2b0c69850554580b52c1f4a5bd865af5f3028f222f4acad9c1ad69a8ef6c7dc7b03715ee5c506b74325e", + "0xb8ef8de6ce6369a8851cd36db0ccf00a85077e816c14c4e601f533330af9e3acf0743a95d28962ed8bfcfc2520ef3cfe", + "0xa6ecad6fdfb851b40356a8b1060f38235407a0f2706e7b8bb4a13465ca3f81d4f5b99466ac2565c60af15f022d26732e", + "0x819ff14cdea3ab89d98e133cd2d0379361e2e2c67ad94eeddcdb9232efd509f51d12f4f03ebd4dd953bd262a886281f7", + "0x8561cd0f7a6dbcddd83fcd7f472d7dbcba95b2d4fb98276f48fccf69f76d284e626d7e41314b633352df8e6333fd52a1", + "0xb42557ccce32d9a894d538c48712cb3e212d06ac05cd5e0527ccd2db1078ee6ae399bf6a601ffdab1f5913d35fc0b20c", + "0x89b4008d767aad3c6f93c349d3b956e28307311a5b1cec237e8d74bb0dee7e972c24f347fd56afd915a2342bd7bc32f0", + "0x877487384b207e53f5492f4e36c832c2227f92d1bb60542cfeb35e025a4a7afc2b885fae2528b33b40ab09510398f83e", + "0x8c411050b63c9053dd0cd81dacb48753c3d7f162028098e024d17cd6348482703a69df31ad6256e3d25a8bbf7783de39", + "0xa8506b54a88d17ac10fb1b0d1fe4aa40eae7553a064863d7f6b52ccc4236dd4b82d01dca6ba87da9a239e3069ba879fb", + "0xb1a24caef9df64750c1350789bb8d8a0db0f39474a1c74ea9ba064b1516db6923f00af8d57c632d58844fb8786c3d47a", + "0x959d6e255f212b0708c58a2f75cb1fe932248c9d93424612c1b8d1e640149656059737e4db2139afd5556bcdacf3eda2", + "0x84525af21a8d78748680b6535bbc9dc2f0cf9a1d1740d12f382f6ecb2e73811d6c1da2ad9956070b1a617c61fcff9fe5", + "0xb74417d84597a485d0a8e1be07bf78f17ebb2e7b3521b748f73935b9afbbd82f34b710fb7749e7d4ab55b0c7f9de127d", + "0xa4a9aecb19a6bab167af96d8b9d9aa5308eab19e6bfb78f5a580f9bf89bdf250a7b52a09b75f715d651cb73febd08e84", + "0x9777b30be2c5ffe7d29cc2803a562a32fb43b59d8c3f05a707ab60ec05b28293716230a7d264d7cd9dd358fc031cc13e", + "0x95dce7a3d4f23ac0050c510999f5fbf8042f771e8f8f94192e17bcbfa213470802ebdbe33a876cb621cf42e275cbfc8b", + "0xb0b963ebcbbee847ab8ae740478544350b3ac7e86887e4dfb2299ee5096247cd2b03c1de74c774d9bde94ae2ee2dcd59", + "0xa4ab20bafa316030264e13f7ef5891a2c3b29ab62e1668fcb5881f50a9acac6adbe3d706c07e62f2539715db768f6c43", + "0x901478a297669d608e406fe4989be75264b6c8be12169aa9e0ad5234f459ca377f78484ffd2099a2fe2db5e457826427", + "0x88c76e5c250810c057004a03408b85cd918e0c8903dc55a0dd8bb9b4fc2b25c87f9b8cf5943eb19fbbe99d36490050c5", + "0x91607322bbad4a4f03fc0012d0821eff5f8c516fda45d1ec1133bface6f858bf04b25547be24159cab931a7aa08344d4", + "0x843203e07fce3c6c81f84bc6dc5fb5e9d1c50c8811ace522dc66e8658433a0ef9784c947e6a62c11bf705307ef05212e", + "0x91dd8813a5d6dddcda7b0f87f672b83198cd0959d8311b2b26fb1fae745185c01f796fbd03aad9db9b58482483fdadd8", + "0x8d15911aacf76c8bcd7136e958febd6963104addcd751ce5c06b6c37213f9c4fb0ffd4e0d12c8e40c36d658999724bfd", + "0x8a36c5732d3f1b497ebe9250610605ee62a78eaa9e1a45f329d09aaa1061131cf1d9df00f3a7d0fe8ad614a1ff9caaae", + "0xa407d06affae03660881ce20dab5e2d2d6cddc23cd09b95502a9181c465e57597841144cb34d22889902aff23a76d049", + "0xb5fd856d0578620a7e25674d9503be7d97a2222900e1b4738c1d81ff6483b144e19e46802e91161e246271f90270e6cf", + "0x91b7708869cdb5a7317f88c0312d103f8ce90be14fb4f219c2e074045a2a83636fdc3e69e862049fc7c1ef000e832541", + "0xb64719cc5480709d1dae958f1d3082b32a43376da446c8f9f64cb02a301effc9c34d9102051733315a8179aed94d53cc", + "0x94347a9542ff9d18f7d9eaa2f4d9b832d0e535fe49d52aa2de08aa8192400eddabdb6444a2a78883e27c779eed7fdf5a", + "0x840ef44a733ff1376466698cd26f82cf56bb44811e196340467f932efa3ae1ef9958a0701b3b032f50fd9c1d2aed9ab5", + "0x90ab3f6f67688888a31ffc2a882bb37adab32d1a4b278951a21646f90d03385fc976715fc639a785d015751171016f10", + "0xb56f35d164c24b557dbcbc8a4bfa681ec916f8741ffcb27fb389c164f4e3ed2be325210ef5bdaeae7a172ca9599ab442", + "0xa7921a5a80d7cf6ae81ba9ee05e0579b18c20cd2852762c89d6496aa4c8ca9d1ca2434a67b2c16d333ea8e382cdab1e3", + "0xa506bcfbd7e7e5a92f68a1bd87d07ad5fe3b97aeee40af2bf2cae4efcd77fff03f872732c5b7883aa6584bee65d6f8cb", + "0xa8c46cff58931a1ce9cbe1501e1da90b174cddd6d50f3dfdfb759d1d4ad4673c0a8feed6c1f24c7af32865a7d6c984e5", + "0xb45686265a83bff69e312c5149db7bb70ac3ec790dc92e392b54d9c85a656e2bf58596ce269f014a906eafc97461aa5f", + "0x8d4009a75ccb2f29f54a5f16684b93202c570d7a56ec1a8b20173269c5f7115894f210c26b41e8d54d4072de2d1c75d0", + "0xaef8810af4fc676bf84a0d57b189760ddc3375c64e982539107422e3de2580b89bd27aa6da44e827b56db1b5555e4ee8", + "0x888f0e1e4a34f48eb9a18ef4de334c27564d72f2cf8073e3d46d881853ac1424d79e88d8ddb251914890588937c8f711", + "0xb64b0aa7b3a8f6e0d4b3499fe54e751b8c3e946377c0d5a6dbb677be23736b86a7e8a6be022411601dd75012012c3555", + "0x8d57776f519f0dd912ea14f79fbab53a30624e102f9575c0bad08d2dc754e6be54f39b11278c290977d9b9c7c0e1e0ad", + "0xa018fc00d532ceb2e4de908a15606db9b6e0665dd77190e2338da7c87a1713e6b9b61554e7c1462f0f6d4934b960b15c", + "0x8c932be83ace46f65c78e145b384f58e41546dc0395270c1397874d88626fdeda395c8a289d602b4c312fe98c1311856", + "0x89174838e21639d6bdd91a0621f04dc056907b88e305dd66e46a08f6d65f731dea72ae87ca5e3042d609e8de8de9aa26", + "0xb7b7f508bb74f7a827ac8189daa855598ff1d96fa3a02394891fd105d8f0816224cd50ac4bf2ed1cf469ace516c48184", + "0xb31877ad682583283baadd68dc1bebd83f5748b165aadd7fe9ef61a343773b88bcd3a022f36d6c92f339b7bfd72820a9", + "0xb79d77260b25daf9126dab7a193df2d7d30542786fa1733ffaf6261734770275d3ca8bae1d9915d1181a78510b3439db", + "0x91894fb94cd4c1dd2ceaf9c53a7020c5799ba1217cf2d251ea5bc91ed26e1159dd758e98282ebe35a0395ef9f1ed15a0", + "0xab59895cdafd33934ceedfc3f0d5d89880482cba6c99a6db93245f9e41987efd76e0640e80aef31782c9a8c7a83fccec", + "0xaa22ea63654315e033e09d4d4432331904a6fc5fb1732557987846e3c564668ca67c60a324b4af01663a23af11a9ce4b", + "0xb53ba3ef342601467e1f71aa280e100fbabbd38518fa0193e0099505036ee517c1ac78e96e9baeb549bb6879bb698fb0", + "0x943fd69fd656f37487cca3605dc7e5a215fddd811caf228595ec428751fc1de484a0cb84c667fe4d7c35599bfa0e5e34", + "0x9353128b5ebe0dddc555093cf3e5942754f938173541033e8788d7331fafc56f68d9f97b4131e37963ab7f1c8946f5f1", + "0xa76cd3c566691f65cfb86453b5b31dbaf3cab8f84fe1f795dd1e570784b9b01bdd5f0b3c1e233942b1b5838290e00598", + "0x983d84b2e53ffa4ae7f3ba29ef2345247ea2377686b74a10479a0ef105ecf90427bf53b74c96dfa346d0f842b6ffb25b", + "0x92e0fe9063306894a2c6970c001781cff416c87e87cb5fbac927a3192655c3da4063e6fa93539f6ff58efac6adcc5514", + "0xb00a81f03c2b8703acd4e2e4c21e06973aba696415d0ea1a648ace2b0ea19b242fede10e4f9d7dcd61c546ab878bc8f9", + "0xb0d08d880f3b456a10bf65cff983f754f545c840c413aea90ce7101a66eb0a0b9b1549d6c4d57725315828607963f15a", + "0x90cb64d03534f913b411375cce88a9e8b1329ce67a9f89ca5df8a22b8c1c97707fec727dbcbb9737f20c4cf751359277", + "0x8327c2d42590dfcdb78477fc18dcf71608686ad66c49bce64d7ee874668be7e1c17cc1042a754bbc77c9daf50b2dae07", + "0x8532171ea13aa7e37178e51a6c775da469d2e26ec854eb16e60f3307db4acec110d2155832c202e9ba525fc99174e3b0", + "0x83ca44b15393d021de2a511fa5511c5bd4e0ac7d67259dce5a5328f38a3cce9c3a269405959a2486016bc27bb140f9ff", + "0xb1d36e8ca812be545505c8214943b36cabee48112cf0de369957afa796d37f86bf7249d9f36e8e990f26f1076f292b13", + "0x9803abf45be5271e2f3164c328d449efc4b8fc92dfc1225d38e09630909fe92e90a5c77618daa5f592d23fc3ad667094", + "0xb268ad68c7bf432a01039cd889afae815c3e120f57930d463aece10af4fd330b5bd7d8869ef1bcf6b2e78e4229922edc", + "0xa4c91a0d6f16b1553264592b4cbbbf3ca5da32ab053ffbdd3dbb1aed1afb650fb6e0dc5274f71a51d7160856477228db", + "0xad89d043c2f0f17806277ffdf3ecf007448e93968663f8a0b674254f36170447b7527d5906035e5e56f4146b89b5af56", + "0x8b6964f757a72a22a642e4d69102951897e20c21449184e44717bd0681d75f7c5bfa5ee5397f6e53febf85a1810d6ed1", + "0xb08f5cdaabec910856920cd6e836c830b863eb578423edf0b32529488f71fe8257d90aed4a127448204df498b6815d79", + "0xaf26bb3358be9d280d39b21d831bb53145c4527a642446073fee5a86215c4c89ff49a3877a7a549486262f6f57a0f476", + "0xb4010b37ec4d7c2af20800e272539200a6b623ae4636ecbd0e619484f4ab9240d02bc5541ace3a3fb955dc0a3d774212", + "0x82752ab52bdcc3cc2fc405cb05a2e694d3df4a3a68f2179ec0652536d067b43660b96f85f573f26fbd664a9ef899f650", + "0x96d392dde067473a81faf2d1fea55b6429126b88b160e39b4210d31d0a82833ffd3a80e07d24d495aea2d96be7251547", + "0xa76d8236d6671204d440c33ac5b8deb71fa389f6563d80e73be8b043ec77d4c9b06f9a586117c7f957f4af0331cbc871", + "0xb6c90961f68b5e385d85c9830ec765d22a425f506904c4d506b87d8944c2b2c09615e740ed351df0f9321a7b93979cae", + "0xa6ec5ea80c7558403485b3b1869cdc63bde239bafdf936d9b62a37031628402a36a2cfa5cfbb8e26ac922cb0a209b3ba", + "0x8c3195bbdbf9bc0fc95fa7e3d7f739353c947f7767d1e3cb24d8c8602d8ea0a1790ac30b815be2a2ba26caa5227891e2", + "0xa7f8a63d809f1155722c57f375ea00412b00147776ae4444f342550279ef4415450d6f400000a326bf11fea6c77bf941", + "0x97fa404df48433a00c85793440e89bb1af44c7267588ae937a1f5d53e01e1c4d4fc8e4a6d517f3978bfdd6c2dfde012f", + "0xa984a0a3836de3d8d909c4629a2636aacb85393f6f214a2ef68860081e9db05ad608024762db0dc35e895dc00e2d4cdd", + "0x9526cf088ab90335add1db4d3a4ac631b58cbfbe88fa0845a877d33247d1cfeb85994522e1eb8f8874651bfb1df03e2a", + "0xac83443fd0afe99ad49de9bf8230158c118e2814c9c89db5ac951c240d6c2ce45e7677221279d9e97848ec466b99aafe", + "0xaeeefdbaba612e971697798ceaf63b247949dc823a0ad771ae5b988a5e882b338a98d3d0796230f49d533ec5ba411b39", + "0xae3f248b5a7b0f92b7820a6c5ae21e5bd8f4265d4f6e21a22512079b8ee9be06393fd3133ce8ebac0faf23f4f8517e36", + "0xa64a831b908eee784b8388b45447d2885ec0551b26b0c2b15e5f417d0a12c79e867fb7bd3d008d0af98b44336f8ec1ad", + "0xb242238cd8362b6e440ba21806905714dd55172db25ec7195f3fc4937b2aba146d5cbf3cf691a1384b4752dc3b54d627", + "0x819f97f337eea1ffb2a678cc25f556f1aab751c6b048993a1d430fe1a3ddd8bb411c152e12ca60ec6e057c190cd1db9a", + "0xb9d7d187407380df54ee9fef224c54eec1bfabf17dc8abf60765b7951f538f59aa26fffd5846cfe05546c35f59b573f4", + "0xaa6e3c14efa6a5962812e3f94f8ce673a433f4a82d07a67577285ea0eaa07f8be7115853122d12d6d4e1fdf64c504be1", + "0x82268bee9c1662d3ddb5fb785abfae6fb8b774190f30267f1d47091d2cd4b3874db4372625aa36c32f27b0eee986269b", + "0xb236459565b7b966166c4a35b2fa71030b40321821b8e96879d95f0e83a0baf33fa25721f30af4a631df209e25b96061", + "0x8708d752632d2435d2d5b1db4ad1fa2558d776a013655f88e9a3556d86b71976e7dfe5b8834fdec97682cd94560d0d0d", + "0xae1424a68ae2dbfb0f01211f11773732a50510b5585c1fb005cb892b2c6a58f4a55490b5c5b4483c6fce40e9d3236a52", + "0xb3f5f722af9dddb07293c871ce97abbccba0093ca98c8d74b1318fa21396fc1b45b69c15084f63d728f9908442024506", + "0x9606f3ce5e63886853ca476dc0949e7f1051889d529365c0cb0296fdc02abd088f0f0318ecd2cf36740a3634132d36f6", + "0xb11a833a49fa138db46b25ff8cdda665295226595bc212c0931b4931d0a55c99da972c12b4ef753f7e37c6332356e350", + "0xafede34e7dab0a9e074bc19a7daddb27df65735581ca24ad70c891c98b1349fcebbcf3ba6b32c2617fe06a5818dabc2d", + "0x97993d456e459e66322d01f8eb13918979761c3e8590910453944bdff90b24091bb018ac6499792515c9923be289f99f", + "0x977e3e967eff19290a192cd11df3667d511b398fb3ac9a5114a0f3707e25a0edcb56105648b1b85a8b7519fc529fc6f6", + "0xb873a7c88bf58731fe1bf61ff6828bf114cf5228f254083304a4570e854e83748fc98683ddba62d978fff7909f2c5c47", + "0xad4b2691f6f19da1d123aaa23cca3e876247ed9a4ab23c599afdbc0d3aa49776442a7ceaa996ac550d0313d9b9a36cee", + "0xb9210713c78e19685608c6475bfa974b57ac276808a443f8b280945c5d5f9c39da43effa294bfb1a6c6f7b6b9f85bf6c", + "0xa65152f376113e61a0e468759de38d742caa260291b4753391ee408dea55927af08a4d4a9918600a3bdf1df462dffe76", + "0x8bf8c27ad5140dde7f3d2280fd4cc6b29ab76537e8d7aa7011a9d2796ee3e56e9a60c27b5c2da6c5e14fc866301dc195", + "0x92fde8effc9f61393a2771155812b863cff2a0c5423d7d40aa04d621d396b44af94ddd376c28e7d2f53c930aea947484", + "0x97a01d1dd9ee30553ce676011aea97fa93d55038ada95f0057d2362ae9437f3ed13de8290e2ff21e3167dd7ba10b9c3f", + "0x89affffaa63cb2df3490f76f0d1e1d6ca35c221dd34057176ba739fa18d492355e6d2a5a5ad93a136d3b1fed0bb8aa19", + "0x928b8e255a77e1f0495c86d3c63b83677b4561a5fcbbe5d3210f1e0fc947496e426d6bf3b49394a5df796c9f25673fc4", + "0x842a0af91799c9b533e79ee081efe2a634cac6c584c2f054fb7d1db67dde90ae36de36cbf712ec9cd1a0c7ee79e151ea", + "0xa65b946cf637e090baf2107c9a42f354b390e7316beb8913638130dbc67c918926eb87bec3b1fe92ef72bc77a170fa3b", + "0xaafc0f19bfd71ab5ae4a8510c7861458b70ad062a44107b1b1dbacbfa44ba3217028c2824bd7058e2fa32455f624040b", + "0x95269dc787653814e0be899c95dba8cfa384f575a25e671c0806fd80816ad6797dc819d30ae06e1d0ed9cb01c3950d47", + "0xa1e760f7fa5775a1b2964b719ff961a92083c5c617f637fc46e0c9c20ab233f8686f7f38c3cb27d825c54dd95e93a59b", + "0xac3b8a7c2317ea967f229eddc3e23e279427f665c4705c7532ed33443f1243d33453c1088f57088d2ab1e3df690a9cc9", + "0xb787beeddfbfe36dd51ec4efd9cf83e59e84d354c3353cc9c447be53ae53d366ed1c59b686e52a92f002142c8652bfe0", + "0xb7a64198300cb6716aa7ac6b25621f8bdec46ad5c07a27e165b3f774cdf65bcfdbf31e9bae0c16b44de4b00ada7a4244", + "0xb8ae9f1452909e0c412c7a7fe075027691ea8df1347f65a5507bc8848f1d2c833d69748076db1129e5b4fb912f65c86c", + "0x9682e41872456b9fa67def89e71f06d362d6c8ca85c9c48536615bc401442711e1c9803f10ab7f8ab5feaec0f9df20a6", + "0x88889ff4e271dc1c7e21989cc39f73cde2f0475acd98078281591ff6c944fadeb9954e72334319050205d745d4df73df", + "0x8f79b5b8159e7fd0d93b0645f3c416464f39aec353b57d99ecf24f96272df8a068ad67a6c90c78d82c63b40bb73989bb", + "0x838c01a009a3d8558a3f0bdd5e22de21af71ca1aefc8423c91dc577d50920e9516880e87dce3e6d086e11cd45c9052d9", + "0xb97f1c6eee8a78f137c840667cc288256e39294268a3009419298a04a1d0087c9c9077b33c917c65caf76637702dda8a", + "0x972284ce72f96a61c899260203dfa06fc3268981732bef74060641c1a5068ead723e3399431c247ca034b0dae861e8df", + "0x945a8d52d6d3db6663dbd3110c6587f9e9c44132045eeffba15621576d178315cb52870fa5861669f84f0bee646183fe", + "0xa0a547b5f0967b1c3e5ec6c6a9a99f0578521489180dfdfbb5561f4d166baac43a2f06f950f645ce991664e167537eed", + "0xa0592cda5cdddf1340033a745fd13a6eff2021f2e26587116c61c60edead067e0f217bc2bef4172a3c9839b0b978ab35", + "0xb9c223b65a3281587fa44ec829e609154b32f801fd1de6950e01eafb07a8324243b960d5735288d0f89f0078b2c42b5b", + "0x99ebfc3b8f9f98249f4d37a0023149ed85edd7a5abe062c8fb30c8c84555258b998bdcdd1d400bc0fa2a4aaa8b224466", + "0x955b68526e6cb3937b26843270f4e60f9c6c8ece2fa9308fe3e23afa433309c068c66a4bc16ee2cf04220f095e9afce4", + "0xb766caeafcc00378135ae53397f8a67ed586f5e30795462c4a35853de6681b1f17401a1c40958de32b197c083b7279c1", + "0x921bf87cad947c2c33fa596d819423c10337a76fe5a63813c0a9dc78a728207ae7b339407a402fc4d0f7cba3af6da6fc", + "0xa74ba1f3bc3e6c025db411308f49b347ec91da1c916bda9da61e510ec8d71d25e0ac0f124811b7860e5204f93099af27", + "0xa29b4d144e0bf17a7e8353f2824cef0ce85621396babe8a0b873ca1e8a5f8d508b87866cf86da348470649fceefd735c", + "0xa8040e12ffc3480dd83a349d06741d1572ef91932c46f5cf03aee8454254156ee95786fd013d5654725e674c920cec32", + "0x8c4cf34ca60afd33923f219ffed054f90cd3f253ffeb2204a3b61b0183417e366c16c07fae860e362b0f2bfe3e1a1d35", + "0x8195eede4ddb1c950459df6c396b2e99d83059f282b420acc34220cadeed16ab65c856f2c52568d86d3c682818ed7b37", + "0x91fff19e54c15932260aa990c7fcb3c3c3da94845cc5aa8740ef56cf9f58d19b4c3c55596f8d6c877f9f4d22921d93aa", + "0xa3e0bf7e5d02a80b75cf75f2db7e66cb625250c45436e3c136d86297d652590ec97c2311bafe407ad357c79ab29d107b", + "0x81917ff87e5ed2ae4656b481a63ced9e6e5ff653b8aa6b7986911b8bc1ee5b8ef4f4d7882c3f250f2238e141b227e510", + "0x915fdbe5e7de09c66c0416ae14a8750db9412e11dc576cf6158755fdcaf67abdbf0fa79b554cac4fe91c4ec245be073f", + "0x8df27eafb5c3996ba4dc5773c1a45ca77e626b52e454dc1c4058aa94c2067c18332280630cc3d364821ee53bf2b8c130", + "0x934f8a17c5cbb827d7868f5c8ca00cb027728a841000a16a3428ab16aa28733f16b52f58c9c4fbf75ccc45df72d9c4df", + "0xb83f4da811f9183c25de8958bc73b504cf790e0f357cbe74ef696efa7aca97ad3b7ead1faf76e9f982c65b6a4d888fc2", + "0x87188213c8b5c268dc2b6da413f0501c95749e953791b727450af3e43714149c115b596b33b63a2f006a1a271b87efd0", + "0x83e9e888ab9c3e30761de635d9aabd31248cdd92f7675fc43e4b21fd96a03ec1dc4ad2ec94fec857ffb52683ac98e360", + "0xb4b9a1823fe2d983dc4ec4e3aaea297e581c3fc5ab4b4af5fa1370caa37af2d1cc7fc6bfc5e7da60ad8fdce27dfe4b24", + "0x856388bc78aef465dbcdd1f559252e028c9e9a2225c37d645c138e78f008f764124522705822a61326a6d1c79781e189", + "0xa6431b36db93c3b47353ba22e7c9592c9cdfb9cbdd052ecf2cc3793f5b60c1e89bc96e6bae117bfd047f2308da00dd2f", + "0xb619972d48e7e4291542dcde08f7a9cdc883c892986ded2f23ccb216e245cd8d9ad1d285347b0f9d7611d63bf4cee2bc", + "0x8845cca6ff8595955f37440232f8e61d5351500bd016dfadd182b9d39544db77a62f4e0102ff74dd4173ae2c181d24ef", + "0xb2f5f7fa26dcd3b6550879520172db2d64ee6aaa213cbef1a12befbce03f0973a22eb4e5d7b977f466ac2bf8323dcedd", + "0x858b7f7e2d44bdf5235841164aa8b4f3d33934e8cb122794d90e0c1cac726417b220529e4f896d7b77902ab0ccd35b3a", + "0x80b0408a092dae2b287a5e32ea1ad52b78b10e9c12f49282976cd738f5d834e03d1ad59b09c5ccaccc39818b87d06092", + "0xb996b0a9c6a2d14d984edcd6ab56bc941674102980d65b3ad9733455f49473d3f587c8cbf661228a7e125ddbe07e3198", + "0x90224fcebb36865293bd63af786e0c5ade6b67c4938d77eb0cbae730d514fdd0fe2d6632788e858afd29d46310cf86df", + "0xb71351fdfff7168b0a5ec48397ecc27ac36657a8033d9981e97002dcca0303e3715ce6dd3f39423bc8ef286fa2e9e669", + "0xae2a3f078b89fb753ce4ed87e0c1a58bb19b4f0cfb6586dedb9fcab99d097d659a489fb40e14651741e1375cfc4b6c5f", + "0x8ef476b118e0b868caed297c161f4231bbeb863cdfa5e2eaa0fc6b6669425ce7af50dc374abceac154c287de50c22307", + "0x92e46ab472c56cfc6458955270d3c72b7bde563bb32f7d4ab4d959db6f885764a3d864e1aa19802fefaa5e16b0cb0b54", + "0x96a3f68323d1c94e73d5938a18a377af31b782f56212de3f489d22bc289cf24793a95b37f1d6776edf88114b5c1fa695", + "0x962cc068cfce6faaa27213c4e43e44eeff0dfbb6d25b814e82c7da981fb81d7d91868fa2344f05fb552362f98cfd4a72", + "0x895d4e4c4ad670abf66d43d59675b1add7afad7438ada8f42a0360c704cee2060f9ac15b4d27e9b9d0996bb801276fe3", + "0xb3ad18d7ece71f89f2ef749b853c45dc56bf1c796250024b39a1e91ed11ca32713864049c9aaaea60cde309b47486bbf", + "0x8f05404e0c0258fdbae50e97ccb9b72ee17e0bd2400d9102c0dad981dac8c4c71585f03e9b5d50086d0a2d3334cb55d1", + "0x8bd877e9d4591d02c63c6f9fc9976c109de2d0d2df2bfa5f6a3232bab5b0b8b46e255679520480c2d7a318545efa1245", + "0x8d4c16b5d98957c9da13d3f36c46f176e64e5be879f22be3179a2c0e624fe4758a82bf8c8027410002f973a3b84cd55a", + "0x86e2a8dea86427b424fa8eada881bdff896907084a495546e66556cbdf070b78ba312bf441eb1be6a80006d25d5097a3", + "0x8608b0c117fd8652fdab0495b08fadbeba95d9c37068e570de6fddfef1ba4a1773b42ac2be212836141d1bdcdef11a17", + "0xa13d6febf5fb993ae76cae08423ca28da8b818d6ef0fde32976a4db57839cd45b085026b28ee5795f10a9a8e3098c683", + "0x8e261967fa6de96f00bc94a199d7f72896a6ad8a7bbb1d6187cca8fad824e522880e20f766620f4f7e191c53321d70f9", + "0x8b8e8972ac0218d7e3d922c734302803878ad508ca19f5f012bc047babd8a5c5a53deb5fe7c15a4c00fd6d1cb9b1dbd0", + "0xb5616b233fb3574a2717d125a434a2682ff68546dccf116dd8a3b750a096982f185614b9fb6c7678107ff40a451f56fa", + "0xaa6adf9b0c3334b0d0663f583a4914523b2ac2e7adffdb026ab9109295ff6af003ef8357026dbcf789896d2afded8d73", + "0xacb72df56a0b65496cd534448ed4f62950bb1e11e50873b6ed349c088ee364441821294ce0f7c61bd7d38105bea3b442", + "0xabae12df83e01ec947249fedd0115dc501d2b03ff7232092979eda531dbbca29ace1d46923427c7dde4c17bdf3fd7708", + "0x820b4fc2b63a9fda7964acf5caf19a2fc4965007cb6d6b511fcafcb1f71c3f673a1c0791d3f86e3a9a1eb6955b191cc0", + "0xaf277259d78c6b0f4f030a10c53577555df5e83319ddbad91afbd7c30bc58e7671c56d00d66ec3ab5ef56470cd910cee", + "0xad4a861c59f1f5ca1beedd488fb3d131dea924fffd8e038741a1a7371fad7370ca5cf80dc01f177fbb9576713bb9a5b3", + "0xb67a5162982ce6a55ccfb2f177b1ec26b110043cf18abd6a6c451cf140b5af2d634591eb4f28ad92177d8c7e5cd0a5e8", + "0x96176d0a83816330187798072d449cbfccff682561e668faf6b1220c9a6535b32a6e4f852e8abb00f79abb87493df16b", + "0xb0afe6e7cb672e18f0206e4423f51f8bd0017bf464c4b186d46332c5a5847647f89ff7fa4801a41c1b0b42f6135bcc92", + "0x8fc5e7a95ef20c1278c645892811f6fe3f15c431ebc998a32ec0da44e7213ea934ed2be65239f3f49b8ec471e9914160", + "0xb7793e41adda6c82ba1f2a31f656f6205f65bf8a3d50d836ee631bc7ce77c153345a2d0fc5c60edf8b37457c3729c4ec", + "0xa504dd7e4d6b2f4379f22cc867c65535079c75ccc575955f961677fa63ecb9f74026fa2f60c9fb6323c1699259e5e9c8", + "0xab899d00ae693649cc1afdf30fb80d728973d2177c006e428bf61c7be01e183866614e05410041bc82cb14a33330e69c", + "0x8a3bd8b0b1be570b65c4432a0f6dc42f48a2000e30ab089cf781d38f4090467b54f79c0d472fcbf18ef6a00df69cc6f3", + "0xb4d7028f7f76a96a3d7803fca7f507ae11a77c5346e9cdfccb120a833a59bda1f4264e425aa588e7a16f8e7638061d84", + "0xb9c7511a76ea5fb105de905d44b02edb17008335766ee357ed386b7b3cf19640a98b38785cb14603c1192bee5886c9b6", + "0x8563afb12e53aed71ac7103ab8602bfa8371ae095207cb0d59e8fd389b6ad1aff0641147e53cb6a7ca16c7f37c9c5e6b", + "0x8e108be614604e09974a9ed90960c28c4ea330a3d9a0cb4af6dd6f193f84ab282b243ecdf549b3131036bebc8905690c", + "0xb794d127fbedb9c5b58e31822361706ffac55ce023fbfe55716c3c48c2fd2f2c7660a67346864dfe588812d369cb50b6", + "0xb797a3442fc3b44f41baefd30346f9ac7f96e770d010d53c146ce74ce424c10fb62758b7e108b8abfdc5fafd89d745cb", + "0x993bb71e031e8096442e6205625e1bfddfe6dd6a83a81f3e2f84fafa9e5082ab4cad80a099f21eff2e81c83457c725c3", + "0x8711ab833fc03e37acf2e1e74cfd9133b101ff4144fe30260654398ae48912ab46549d552eb9d15d2ea57760d35ac62e", + "0xb21321fd2a12083863a1576c5930e1aecb330391ef83326d9d92e1f6f0d066d1394519284ddab55b2cb77417d4b0292f", + "0x877d98f731ffe3ee94b0b5b72d127630fa8a96f6ca4f913d2aa581f67732df6709493693053b3e22b0181632ac6c1e3b", + "0xae391c12e0eb8c145103c62ea64f41345973311c3bf7281fa6bf9b7faafac87bcf0998e5649b9ef81e288c369c827e07", + "0xb83a2842f36998890492ab1cd5a088d9423d192681b9a3a90ec518d4c541bce63e6c5f4df0f734f31fbfdd87785a2463", + "0xa21b6a790011396e1569ec5b2a423857b9bec16f543e63af28024e116c1ea24a3b96e8e4c75c6537c3e4611fd265e896", + "0xb4251a9c4aab3a495da7a42e684ba4860dbcf940ad1da4b6d5ec46050cbe8dab0ab9ae6b63b5879de97b905723a41576", + "0x8222f70aebfe6ac037f8543a08498f4cadb3edaac00336fc00437eb09f2cba758f6c38e887cc634b4d5b7112b6334836", + "0x86f05038e060594c46b5d94621a1d9620aa8ba59a6995baf448734e21f58e23c1ea2993d3002ad5250d6edd5ba59b34f", + "0xa7c0c749baef811ab31b973c39ceb1d94750e2bc559c90dc5eeb20d8bb6b78586a2b363c599ba2107d6be65cd435f24e", + "0x861d46a5d70b38d6c1cd72817a2813803d9f34c00320c8b62f8b9deb67f5b5687bc0b37c16d28fd017367b92e05da9ca", + "0xb3365d3dab639bffbe38e35383686a435c8c88b397b717cd4aeced2772ea1053ceb670f811f883f4e02975e5f1c4ac58", + "0xa5750285f61ab8f64cd771f6466e2c0395e01b692fd878f2ef2d5c78bdd8212a73a3b1dfa5e4c8d9e1afda7c84857d3b", + "0x835a10809ccf939bc46cf950a33b36d71be418774f51861f1cd98a016ade30f289114a88225a2c11e771b8b346cbe6ef", + "0xa4f59473a037077181a0a62f1856ec271028546ca9452b45cedfcb229d0f4d1aabfc13062b07e536cc8a0d4b113156a2", + "0x95cd14802180b224d44a73cc1ed599d6c4ca62ddcaa503513ccdc80aaa8be050cc98bd4b4f3b639549beb4587ac6caf9", + "0x973b731992a3e69996253d7f36dd7a0af1982b5ed21624b77a7965d69e9a377b010d6dabf88a8a97eec2a476259859cc", + "0xaf8a1655d6f9c78c8eb9a95051aa3baaf9c811adf0ae8c944a8d3fcba87b15f61021f3baf6996fa0aa51c81b3cb69de1", + "0x835aad5c56872d2a2d6c252507b85dd742bf9b8c211ccb6b25b52d15c07245b6d89b2a40f722aeb5083a47cca159c947", + "0xabf4e970b02bef8a102df983e22e97e2541dd3650b46e26be9ee394a3ea8b577019331857241d3d12b41d4eacd29a3ac", + "0xa13c32449dbedf158721c13db9539ae076a6ce5aeaf68491e90e6ad4e20e20d1cdcc4a89ed9fd49cb8c0dd50c17633c1", + "0x8c8f78f88b7e22dd7e9150ab1c000f10c28e696e21d85d6469a6fe315254740f32e73d81ab1f3c1cf8f544c86df506e8", + "0xb4b77f2acfe945abf81f2605f906c10b88fb4d28628487fb4feb3a09f17f28e9780445dfcee4878349d4c6387a9d17d4", + "0x8d255c235f3812c6ecc646f855fa3832be5cb4dbb9c9e544989fafdf3f69f05bfd370732eaf954012f0044aa013fc9c6", + "0xb982efd3f34b47df37c910148ac56a84e8116647bea24145a49e34e0a6c0176e3284d838dae6230cb40d0be91c078b85", + "0x983f365aa09bd85df2a6a2ad8e4318996b1e27d02090755391d4486144e40d80b1fbfe1c798d626db92f52e33aa634da", + "0x95fd1981271f3ea3a41d654cf497e6696730d9ff7369f26bc4d7d15c7adb4823dd0c42e4a005a810af12d234065e5390", + "0xa9f5219bd4b913c186ef30c02f995a08f0f6f1462614ea5f236964e02bdaa33db9d9b816c4aee5829947840a9a07ba60", + "0x9210e6ceb05c09b46fd09d036287ca33c45124ab86315e5d6911ff89054f1101faaa3e83d123b7805056d388bcec6664", + "0x8ed9cbf69c6ff3a5c62dd9fe0d7264578c0f826a29e614bc2fb4d621d90c8c9992438accdd7a614b1dca5d1bb73dc315", + "0x85cf2a8cca93e00da459e3cecd22c342d697eee13c74d5851634844fc215f60053cf84b0e03c327cb395f48d1c71a8a4", + "0x8818a18e9a2ec90a271b784400c1903089ffb0e0b40bc5abbbe12fbebe0f731f91959d98c5519ef1694543e31e2016d4", + "0x8dabc130f296fa7a82870bf9a8405aaf542b222ed9276bba9bd3c3555a0f473acb97d655ee7280baff766a827a8993f0", + "0xac7952b84b0dc60c4d858f034093b4d322c35959605a3dad2b806af9813a4680cb038c6d7f4485b4d6b2ff502aaeca25", + "0xad65cb6d57b48a2602568d2ec8010baed0eb440eec7638c5ec8f02687d764e9de5b5d42ad5582934e592b48471c22d26", + "0xa02ab8bd4c3d114ea23aebdd880952f9495912817da8c0c08eabc4e6755439899d635034413d51134c72a6320f807f1c", + "0x8319567764b8295402ec1ebef4c2930a138480b37e6d7d01c8b4c9cd1f2fc3f6e9a44ae6e380a0c469b25b06db23305f", + "0xafec53b2301dc0caa8034cd9daef78c48905e6068d692ca23d589b84a6fa9ddc2ed24a39480597e19cb3e83eec213b3f", + "0xac0b4ffdb5ae08e586a9cdb98f9fe56f4712af3a97065e89e274feacfb52b53c839565aee93c4cfaaccfe51432c4fab0", + "0x8972cbf07a738549205b1094c5987818124144bf187bc0a85287c94fdb22ce038c0f11df1aa16ec5992e91b44d1af793", + "0xb7267aa6f9e3de864179b7da30319f1d4cb2a3560f2ea980254775963f1523b44c680f917095879bebfa3dc2b603efcf", + "0x80f68f4bfc337952e29504ee5149f15093824ea7ab02507efd1317a670f6cbc3611201848560312e3e52e9d9af72eccf", + "0x8897fee93ce8fc1e1122e46b6d640bba309384dbd92e46e185e6364aa8210ebf5f9ee7e5e604b6ffba99aa80a10dd7d0", + "0xb58ea6c02f2360be60595223d692e82ee64874fda41a9f75930f7d28586f89be34b1083e03bbc1575bbfdda2d30db1ea", + "0x85a523a33d903280d70ac5938770453a58293480170c84926457ac2df45c10d5ff34322ab130ef4a38c916e70d81af53", + "0xa2cbf045e1bed38937492c1f2f93a5ba41875f1f262291914bc1fc40c60bd0740fb3fea428faf6da38b7c180fe8ac109", + "0x8c09328770ed8eb17afc6ac7ddd87bb476de18ed63cab80027234a605806895959990c47bd10d259d7f3e2ecb50074c9", + "0xb4b9e19edb4a33bde8b7289956568a5b6b6557404e0a34584b5721fe6f564821091013fbb158e2858c6d398293bb4b59", + "0x8a47377df61733a2aa5a0e945fce00267f8e950f37e109d4487d92d878fb8b573317bb382d902de515b544e9e233458d", + "0xb5804c9d97efeff5ca94f3689b8088c62422d92a1506fd1d8d3b1b30e8a866ad0d6dad4abfa051dfc4471250cac4c5d9", + "0x9084a6ee8ec22d4881e9dcc8a9eb3c2513523d8bc141942370fd191ad2601bf9537a0b1e84316f3209b3d8a54368051e", + "0x85447eea2fa26656a649f8519fa67279183044791d61cf8563d0783d46d747d96af31d0a93507bbb2242666aa87d3720", + "0x97566a84481027b60116c751aec552adfff2d9038e68d48c4db9811fb0cbfdb3f1d91fc176a0b0d988a765f8a020bce1", + "0xae87e5c1b9e86c49a23dceda4ecfd1dcf08567f1db8e5b6ec752ebd45433c11e7da4988573cdaebbb6f4135814fc059e", + "0xabee05cf9abdbc52897ac1ce9ed157f5466ed6c383d6497de28616238d60409e5e92619e528af8b62cc552bf09970dc2", + "0xae6d31cd7bf9599e5ee0828bab00ceb4856d829bba967278a73706b5f388465367aa8a6c7da24b5e5f1fdd3256ef8e63", + "0xac33e7b1ee47e1ee4af472e37ab9e9175260e506a4e5ce449788075da1b53c44cb035f3792d1eea2aa24b1f688cc6ed3", + "0x80f65b205666b0e089bb62152251c48c380a831e5f277f11f3ef4f0d52533f0851c1b612267042802f019ec900dc0e8f", + "0x858520ad7aa1c9fed738e3b583c84168f2927837ad0e1d326afe9935c26e9b473d7f8c382e82ef1fe37d2b39bb40a1ee", + "0xb842dd4af8befe00a97c2d0f0c33c93974761e2cb9e5ab8331b25170318ddd5e4bdbc02d8f90cbfdd5f348f4f371c1f7", + "0x8bf2cb79bc783cb57088aae7363320cbeaabd078ffdec9d41bc74ff49e0043d0dad0086a30e5112b689fd2f5a606365d", + "0x982eb03bbe563e8850847cd37e6a3306d298ab08c4d63ab6334e6b8c1fa13fce80cf2693b09714c7621d74261a0ff306", + "0xb143edb113dec9f1e5105d4a93fbe502b859e587640d3db2f628c09a17060e6aec9e900e2c8c411cda99bc301ff96625", + "0xaf472d9befa750dcebc5428fe1a024f18ec1c07bca0f95643ce6b5f4189892a910285afb03fd7ed7068fbe614e80d33c", + "0xa97e3bc57ede73ecd1bbf02de8f51b4e7c1a067da68a3cd719f4ba26a0156cbf1cef2169fd35a18c5a4cced50d475998", + "0xa862253c937cf3d75d7183e5f5be6a4385d526aeda5171c1c60a8381fea79f88f5f52a4fab244ecc70765d5765e6dfd5", + "0x90cb776f8e5a108f1719df4a355bebb04bf023349356382cae55991b31720f0fd03206b895fa10c56c98f52453be8778", + "0xa7614e8d0769dccd520ea4b46f7646e12489951efaef5176bc889e9eb65f6e31758df136b5bf1e9107e68472fa9b46ec", + "0xac3a9b80a3254c42e5ed3a090a0dd7aee2352f480de96ad187027a3bb6c791eddfc3074b6ffd74eea825188f107cda4d", + "0x82a01d0168238ef04180d4b6e0a0e39024c02c2d75b065017c2928039e154d093e1af4503f4d1f3d8a948917abb5d09f", + "0x8fab000a2b0eef851a483aec8d2dd85fe60504794411a2f73ed82e116960547ac58766cb73df71aea71079302630258d", + "0x872451a35c6db61c63e9b8bb9f16b217f985c20be4451c14282c814adb29d7fb13f201367c664435c7f1d4d9375d7a58", + "0x887d9ff54cc96b35d562df4a537ff972d7c4b3fd91ab06354969a4cfede0b9fc68bbffb61d0dbf1a58948dc701e54f5a", + "0x8cb5c2a6bd956875d88f41ae24574434f1308514d44057b55c9c70f13a3366ed054150eed0955a38fda3f757be73d55f", + "0x89ad0163cad93e24129d63f8e38422b7674632a8d0a9016ee8636184cab177659a676c4ee7efba3abe1a68807c656d60", + "0xb9ec01c7cab6d00359b5a0b4a1573467d09476e05ca51a9227cd16b589a9943d161eef62dcc73f0de2ec504d81f4d252", + "0x8031d17635d39dfe9705c485d2c94830b6fc9bc67b91300d9d2591b51e36a782e77ab5904662effa9382d9cca201f525", + "0x8be5a5f6bc8d680e5092d6f9a6585acbaaaa2ddc671da560dcf5cfa4472f4f184b9597b5b539438accd40dda885687cc", + "0xb1fc0f052fae038a2e3de3b3a96b0a1024b009de8457b8b3adb2d315ae68a89af905720108a30038e5ab8d0d97087785", + "0x8b8bdc77bd3a6bc7ca5492b6f8c614852c39a70d6c8a74916eaca0aeb4533b11898b8820a4c2620a97bf35e275480029", + "0xaf35f4dc538d4ad5cdf710caa38fd1eb496c3fa890a047b6a659619c5ad3054158371d1e88e0894428282eed9f47f76b", + "0x8166454a7089cc07758ad78724654f4e7a1a13e305bbf88ddb86f1a4b2904c4fc8ab872d7da364cdd6a6c0365239e2ad", + "0xab287c7d3addce74ce40491871c768abe01daaa0833481276ff2e56926b38a7c6d2681ffe837d2cc323045ad1a4414f9", + "0xb90317f4505793094d89365beb35537f55a6b5618904236258dd04ca61f21476837624a2f45fef8168acf732cab65579", + "0x98ae5ea27448e236b6657ab5ef7b1cccb5372f92ab25f5fa651fbac97d08353a1dae1b280b1cd42b17d2c6a70a63ab9d", + "0xadcf54e752d32cbaa6cb98fbca48d8cd087b1db1d131d465705a0d8042c8393c8f4d26b59006eb50129b21e6240f0c06", + "0xb591a3e4db18a7345fa935a8dd7994bbac5cc270b8ebd84c8304c44484c7a74afb45471fdbe4ab22156a30fae1149b40", + "0x806b53ac049a42f1dcc1d6335505371da0bf27c614f441b03bbf2e356be7b2fb4eed7117eabcce9e427a542eaa2bf7d8", + "0x800482e7a772d49210b81c4a907f5ce97f270b959e745621ee293cf8c71e8989363d61f66a98f2d16914439544ca84c7", + "0x99de9eafdad3617445312341644f2bb888680ff01ce95ca9276b1d2e5ef83fa02dab5e948ebf66c17df0752f1bd37b70", + "0x961ee30810aa4c93ae157fbe9009b8e443c082192bd36a73a6764ff9b2ad8b0948fe9a73344556e01399dd77badb4257", + "0xae0a361067c52efbe56c8adf982c00432cd478929459fc7f74052c8ee9531cd031fe1335418fde53f7c2ef34254eb7ac", + "0xa3503d16b6b27eb20c1b177bcf90d13706169220523a6271b85b2ce35a9a2b9c5bed088540031c0a4ebfdae3a4c6ab04", + "0x909420122c3e723289ca4e7b81c2df5aff312972a2203f4c45821b176e7c862bf9cac7f7df3adf1d59278f02694d06e7", + "0x989f42380ae904b982f85d0c6186c1aef5d6bcba29bcfbb658e811b587eb2749c65c6e4a8cc6409c229a107499a4f5d7", + "0x8037a6337195c8e26a27ea4ef218c6e7d79a9720aaab43932d343192abc2320fe72955f5e431c109093bda074103330a", + "0xb312e168663842099b88445e940249cc508f080ab0c94331f672e7760258dbd86be5267e4cf25ea25facb80bff82a7e9", + "0xaaa3ff8639496864fcdbfdda1ac97edc4f08e3c9288b768f6c8073038c9fbbf7e1c4bea169b4d45c31935cdf0680d45e", + "0x97dbd3df37f0b481a311dfc5f40e59227720f367912200d71908ef6650f32cc985cb05b981e3eea38958f7e48d10a15d", + "0xa89d49d1e267bb452d6cb621b9a90826fe55e9b489c0427b94442d02a16f390eed758e209991687f73f6b5a032321f42", + "0x9530dea4e0e19d6496f536f2e75cf7d814d65fde567055eb20db48fd8d20d501cd2a22fb506db566b94c9ee10f413d43", + "0x81a7009b9e67f1965fa7da6a57591c307de91bf0cd35ab4348dc4a98a4961e096d004d7e7ad318000011dc4342c1b809", + "0x83440a9402b766045d7aca61a58bba2aa29cac1cf718199e472ba086f5d48093d9dda4d135292ba51d049a23964eceae", + "0xa06c9ce5e802df14f6b064a3d1a0735d429b452f0e2e276042800b0a4f16df988fd94cf3945921d5dd3802ab2636f867", + "0xb1359e358b89936dee9e678a187aad3e9ab14ac40e96a0a68f70ee2583cdcf467ae03bef4215e92893f4e12f902adec8", + "0x835304f8619188b4d14674d803103d5a3fa594d48e96d9699e653115dd05fdc2dda6ba3641cf7ad53994d448da155f02", + "0x8327cba5a9ff0d3f5cd0ae55e77167448926d5fcf76550c0ad978092a14122723090c51c415e88e42a2b62eb07cc3981", + "0xb373dcdaea85f85ce9978b1426a7ef4945f65f2d3467a9f1cc551a99766aac95df4a09e2251d3f89ca8c9d1a7cfd7b0e", + "0xab1422dc41af2a227b973a6fd124dfcb2367e2a11a21faa1d381d404f51b7257e5bc82e9cf20cd7fe37d7ae761a2ab37", + "0xa93774a03519d2f20fdf2ef46547b0a5b77c137d6a3434b48d56a2cbef9e77120d1b85d0092cf8842909213826699477", + "0x8eb967a495a38130ea28711580b7e61bcd1d051cd9e4f2dbf62f1380bd86e0d60e978d72f6f31e909eb97b3b9a2b867c", + "0xae8213378da1287ba1fe4242e1acaec19b877b6fe872400013c6eac1084b8d03156792fa3020201725b08228a1e80f49", + "0xb143daf6893d674d607772b3b02d8ac48f294237e2f2c87963c0d4e26d9227d94a2a13512457c3d5883544bbc259f0ef", + "0xb343bd2aca8973888e42542218924e2dda2e938fd1150d06878af76f777546213912b7c7a34a0f94186817d80ffa185c", + "0xb188ebc6a8c3007001aa347ae72cc0b15d09bc6c19a80e386ee4b334734ec0cc2fe8b493c2422f38d1e6d133cc3db6fe", + "0xb795f6a8b9b826aaeee18ccd6baf6c5adeeec85f95eb5b6d19450085ec7217e95a2d9e221d77f583b297d0872073ba0e", + "0xb1c7dbd998ad32ae57bfa95deafa147024afd57389e98992c36b6e52df915d3d5a39db585141ec2423173e85d212fed8", + "0x812bcdeb9fe5f12d0e1df9964798056e1f1c3de3b17b6bd2919b6356c4b86d8e763c01933efbe0224c86a96d5198a4be", + "0xb19ebeda61c23d255cbf472ef0b8a441f4c55b70f0d8ed47078c248b1d3c7c62e076b43b95c00a958ec8b16d5a7cb0d7", + "0xb02adc9aaa20e0368a989c2af14ff48b67233d28ebee44ff3418bb0473592e6b681af1cc45450bd4b175df9051df63d9", + "0x8d87f0714acee522eb58cec00360e762adc411901dba46adc9227124fa70ee679f9a47e91a6306d6030dd4eb8de2f3c1", + "0x8be54cec21e74bcc71de29dc621444263737db15f16d0bb13670f64e42f818154e04b484593d19ef95f2ee17e4b3fe21", + "0xab8e20546c1db38d31493b5d5f535758afb17e459645c1b70813b1cf7d242fd5d1f4354a7c929e8f7259f6a25302e351", + "0x89f035a1ed8a1e302ac893349ba8ddf967580fcb6e73d44af09e3929cde445e97ff60c87dafe489e2c0ab9c9986cfa00", + "0x8b2b0851a795c19191a692af55f7e72ad2474efdc5401bc3733cfdd910e34c918aaebe69d5ea951bdddf3c01cabbfc67", + "0xa4edb52c2b51495ccd1ee6450fc14b7b3ede8b3d106808929d02fb31475bacb403e112ba9c818d2857651e508b3a7dd1", + "0x9569341fded45d19f00bcf3cbf3f20eb2b4d82ef92aba3c8abd95866398438a2387437e580d8b646f17cf6fde8c5af23", + "0xaa4b671c6d20f72f2f18a939a6ff21cc37e0084b44b4a717f1be859a80b39fb1be026b3205adec2a66a608ec2bcd578f", + "0x94902e980de23c4de394ad8aec91b46f888d18f045753541492bfbb92c59d3daa8de37ae755a6853744af8472ba7b72b", + "0xaf651ef1b2a0d30a7884557edfad95b6b5d445a7561caebdc46a485aedd25932c62c0798465c340a76f6feaa196dd712", + "0xb7b669b8e5a763452128846dd46b530dca4893ace5cc5881c7ddcd3d45969d7e73fbebdb0e78aa81686e5f7b22ec5759", + "0x82507fd4ebe9fa656a7f2e084d64a1fa6777a2b0bc106d686e2d9d2edafc58997e58cb6bfd0453b2bf415704aa82ae62", + "0xb40bce2b42b88678400ecd52955bbdadd15f8b9e1b3751a1a3375dc0efb5ca3ee258cf201e1140b3c09ad41217d1d49e", + "0xb0210d0cbb3fbf3b8cdb39e862f036b0ff941cd838e7aaf3a8354e24246e64778d22f3de34572e6b2a580614fb6425be", + "0x876693cba4301b251523c7d034108831df3ce133d8be5a514e7a2ca494c268ca0556fa2ad8310a1d92a16b55bcd99ea9", + "0x8660281406d22a4950f5ef050bf71dd3090edb16eff27fa29ef600cdea628315e2054211ed2cc6eaf8f2a1771ef689fd", + "0xa610e7e41e41ab66955b809ba4ade0330b8e9057d8efc9144753caed81995edeb1a42a53f93ce93540feca1fae708dac", + "0xa49e2c176a350251daef1218efaccc07a1e06203386ede59c136699d25ca5cb2ac1b800c25b28dd05678f14e78e51891", + "0x83e0915aa2b09359604566080d411874af8c993beba97d4547782fdbe1a68e59324b800ff1f07b8db30c71adcbd102a8", + "0xa19e84e3541fb6498e9bb8a099c495cbfcad113330e0262a7e4c6544495bb8a754b2208d0c2d895c93463558013a5a32", + "0x87f2bd49859a364912023aca7b19a592c60214b8d6239e2be887ae80b69ebdeb59742bdebcfa73a586ab23b2c945586c", + "0xb8e8fdddae934a14b57bc274b8dcd0d45ebb95ddbaabef4454e0f6ce7d3a5a61c86181929546b3d60c447a15134d08e1", + "0x87e0c31dcb736ea4604727e92dc1d9a3cf00adcff79df3546e02108355260f3dd171531c3c0f57be78d8b28058fcc8c0", + "0x9617d74e8f808a4165a8ac2e30878c349e1c3d40972006f0787b31ea62d248c2d9f3fc3da83181c6e57e95feedfd0e8c", + "0x8949e2cee582a2f8db86e89785a6e46bc1565c2d8627d5b6bf43ba71ffadfab7e3c5710f88dcb5fb2fc6edf6f4fae216", + "0xad3fa7b0edceb83118972a2935a09f409d09a8db3869f30be3a76f67aa9fb379cabb3a3aff805ba023a331cad7d7eb64", + "0x8c95718a4112512c4efbd496be38bf3ca6cdcaad8a0d128f32a3f9aae57f3a57bdf295a3b372a8c549fda8f4707cffed", + "0x88f3261d1e28a58b2dee3fcc799777ad1c0eb68b3560f9b4410d134672d9533532a91ea7be28a041784872632d3c9d80", + "0xb47472a41d72dd2e8b72f5c4f8ad626737dde3717f63d6bc776639ab299e564cbad0a2ad5452a07f02ff49a359c437e5", + "0x9896d21dc2e8aad87b76d6df1654f10cd7bceed4884159d50a818bea391f8e473e01e14684814c7780235f28e69dca6e", + "0x82d47c332bbd31bbe83b5eb44a23da76d4a7a06c45d7f80f395035822bc27f62f59281d5174e6f8e77cc9b5c3193d6f0", + "0x95c74cd46206e7f70c9766117c34c0ec45c2b0f927a15ea167901a160e1530d8522943c29b61e03568aa0f9c55926c53", + "0xa89d7757825ae73a6e81829ff788ea7b3d7409857b378ebccd7df73fdbe62c8d9073741cf038314971b39af6c29c9030", + "0x8c1cd212d0b010905d560688cfc036ae6535bc334fa8b812519d810b7e7dcf1bb7c5f43deaa40f097158358987324a7f", + "0xb86993c383c015ed8d847c6b795164114dd3e9efd25143f509da318bfba89389ea72a420699e339423afd68b6512fafb", + "0x8d06bd379c6d87c6ed841d8c6e9d2d0de21653a073725ff74be1934301cc3a79b81ef6dd0aad4e7a9dc6eac9b73019bc", + "0x81af4d2d87219985b9b1202d724fe39ef988f14fef07dfe3c3b11714e90ffba2a97250838e8535eb63f107abfe645e96", + "0x8c5e0af6330a8becb787e4b502f34f528ef5756e298a77dc0c7467433454347f3a2e0bd2641fbc2a45b95e231c6e1c02", + "0x8e2a8f0f04562820dc8e7da681d5cad9fe2e85dd11c785fb6fba6786c57a857e0b3bd838fb849b0376c34ce1665e4837", + "0xa39be8269449bfdfc61b1f62077033649f18dae9bef7c6163b9314ca8923691fb832f42776f0160b9e8abd4d143aa4e1", + "0x8c154e665706355e1cc98e0a4cabf294ab019545ba9c4c399d666e6ec5c869ca9e1faf8fb06cd9c0a5c2f51a7d51b70a", + "0xa046a7d4de879d3ebd4284f08f24398e9e3bf006cd4e25b5c67273ade248689c69affff92ae810c07941e4904296a563", + "0xafd94c1cb48758e5917804df03fb38a6da0e48cd9b6262413ea13b26973f9e266690a1b7d9d24bbaf7e82718e0e594b0", + "0x859e21080310c8d6a38e12e2ac9f90a156578cdeb4bb2e324700e97d9a5511cd6045dc39d1d0de3f94aeed043a24119d", + "0xa219fb0303c379d0ab50893264919f598e753aac9065e1f23ef2949abc992577ab43c636a1d2c089203ec9ddb941e27d", + "0xb0fdb639d449588a2ca730afcba59334e7c387342d56defdfb7ef79c493f7fd0e5277eff18e7203e756c7bdda5803047", + "0x87f9c3b7ed01f54368aca6dbcf2f6e06bff96e183c4b2c65f8baa23b377988863a0a125d5cdd41a072da8462ced4c070", + "0x99ef7a5d5ac2f1c567160e1f8c95f2f38d41881850f30c461a205f7b1b9fb181277311333839b13fb3ae203447e17727", + "0xaeaca9b1c2afd24e443326cc68de67b4d9cedb22ad7b501a799d30d39c85bb2ea910d4672673e39e154d699e12d9b3dc", + "0xa11675a1721a4ba24dd3d0e4c3c33a6edf4cd1b9f6b471070b4386c61f77452266eae6e3f566a40cfc885eada9a29f23", + "0xb228334445e37b9b49cb4f2cc56b454575e92173ddb01370a553bba665adadd52df353ad74470d512561c2c3473c7bb9", + "0xa18177087c996572d76f81178d18ed1ceebc8362a396348ce289f1d8bd708b9e99539be6fccd4acb1112381cfc5749b4", + "0x8e7b8bf460f0d3c99abb19803b9e43422e91507a1c0c22b29ee8b2c52d1a384da4b87c292e28eff040db5be7b1f8641f", + "0xb03d038d813e29688b6e6f444eb56fec3abba64c3d6f890a6bcf2e916507091cdb2b9d2c7484617be6b26552ed1c56cb", + "0xa1c88ccd30e934adfc5494b72655f8afe1865a84196abfb376968f22ddc07761210b6a9fb7638f1413d1b4073d430290", + "0x961b714faebf172ad2dbc11902461e286e4f24a99a939152a53406117767682a571057044decbeb3d3feef81f4488497", + "0xa03dc4059b46effdd786a0a03cc17cfee8585683faa35bb07936ded3fa3f3a097f518c0b8e2db92fd700149db1937789", + "0xadf60180c99ca574191cbcc23e8d025b2f931f98ca7dfcebfc380226239b6329347100fcb8b0fcb12db108c6ad101c07", + "0x805d4f5ef24d46911cbf942f62cb84b0346e5e712284f82b0db223db26d51aabf43204755eb19519b00e665c7719fcaa", + "0x8dea7243e9c139662a7fe3526c6c601eee72fd8847c54c8e1f2ad93ef7f9e1826b170afe58817dac212427164a88e87f", + "0xa2ba42356606d651b077983de1ad643650997bb2babb188c9a3b27245bb65d2036e46667c37d4ce02cb1be5ae8547abe", + "0xaf2ae50b392bdc013db2d12ce2544883472d72424fc767d3f5cb0ca2d973fc7d1f425880101e61970e1a988d0670c81b", + "0x98e6bec0568d3939b31d00eb1040e9b8b2a35db46ddf4369bdaee41bbb63cc84423d29ee510a170fb5b0e2df434ba589", + "0x822ff3cd12fbef4f508f3ca813c04a2e0b9b799c99848e5ad3563265979e753ee61a48f6adc2984a850f1b46c1a43d35", + "0x891e8b8b92a394f36653d55725ef514bd2e2a46840a0a2975c76c2a935577f85289026aaa74384da0afe26775cbddfb9", + "0xb2a3131a5d2fe7c8967047aa66e4524babae941d90552171cc109527f345f42aa0df06dcbb2fa01b33d0043917bbed69", + "0x80c869469900431f3eeefafdbe07b8afd8cee7739e659e6d0109b397cacff85a88247698f87dc4e2fe39a592f250ac64", + "0x9091594f488b38f9d2bb5df49fd8b4f8829d9c2f11a197dd1431ed5abbc5c954bbde3387088f9ee3a5a834beb7619bce", + "0xb472e241e6956146cca57b97a8a204668d050423b4e76f857bad5b47f43b203a04c8391ba9d9c3e95093c071f9d376a1", + "0xb7dd2de0284844392f7dfb56fe7ca3ede41e27519753ffc579a0a8d2d65ceb8108d06b6b0d4c3c1a2588951297bd1a1e", + "0x902116ce70d0a079ac190321c1f48701318c05f8e69ee09694754885d33a835a849cafe56f499a2f49f6cda413ddf9a7", + "0xb18105cc736787fafaf7c3c11c448bce9466e683159dff52723b7951dff429565e466e4841d982e3aaa9ee2066838666", + "0x97ab9911f3f659691762d568ae0b7faa1047b0aed1009c319fa79d15d0db8db9f808fc385dc9a68fa388c10224985379", + "0xb2a2cba65f5b927e64d2904ba412e2bac1cf18c9c3eda9c72fb70262497ecf505b640827e2afebecf10eebbcf48ccd3e", + "0xb36a3fd677baa0d3ef0dac4f1548ff50a1730286b8c99d276a0a45d576e17b39b3cbadd2fe55e003796d370d4be43ce3", + "0xa5dfec96ca3c272566e89dc453a458909247e3895d3e44831528130bc47cc9d0a0dac78dd3cad680a4351d399d241967", + "0x8029382113909af6340959c3e61db27392531d62d90f92370a432aec3eb1e4c36ae1d4ef2ba8ec6edb4d7320c7a453f6", + "0x971d85121ea108e6769d54f9c51299b0381ece8b51d46d49c89f65bedc123bab4d5a8bc14d6f67f4f680077529cbae4c", + "0x98ff6afc01d0bec80a278f25912e1b1ebff80117adae72e31d5b9fa4d9624db4ba2065b444df49b489b0607c45e26c4c", + "0x8fa29be10fb3ab30ce25920fec0187e6e91e458947009dabb869aade7136c8ba23602682b71e390c251f3743164cbdaa", + "0xb3345c89eb1653418fe3940cf3e56a9a9c66526389b98f45ca02dd62bfb37baa69a4baaa7132d7320695f8ea6ad1fd94", + "0xb72c7f5541c9ac6b60a7ec9f5415e7fb14da03f7164ea529952a29399f3a071576608dbbcc0d45994f21f92ddbeb1e19", + "0xaa3450bb155a5f9043d0ef95f546a2e6ade167280bfb75c9f09c6f9cdb1fffb7ce8181436161a538433afa3681c7a141", + "0x92a18fecaded7854b349f441e7102b638ababa75b1b0281dd0bded6541abe7aa37d96693595be0b01fe0a2e2133d50f9", + "0x980756ddf9d2253cfe6c94960b516c94889d09e612810935150892627d2ecee9a2517e04968eea295d0106850c04ca44", + "0xae68c6ccc454318cdd92f32b11d89116a3b8350207a36d22a0f626718cad671d960090e054c0c77ac3162ae180ecfd4b", + "0x99f31f66eaaa551749ad91d48a0d4e3ff4d82ef0e8b28f3184c54e852422ba1bdafd53b1e753f3a070f3b55f3c23b6a2", + "0xa44eaeaa6589206069e9c0a45ff9fc51c68da38d4edff1d15529b7932e6f403d12b9387019c44a1488a5d5f27782a51f", + "0xb80b5d54d4b344840e45b79e621bd77a3f83fb4ce6d8796b7d6915107b3f3c34d2e7d95bdafd120f285669e5acf2437a", + "0xb36c069ec085a612b5908314d6b84c00a83031780261d1c77a0384c406867c9847d5b0845deddfa512cc04a8df2046fb", + "0xb09dbe501583220f640d201acea7ee3e39bf9eda8b91aa07b5c50b7641d86d71acb619b38d27835ce97c3759787f08e9", + "0x87403d46a2bf63170fff0b857acacf42ee801afe9ccba8e5b4aea967b68eac73a499a65ca46906c2eb4c8f27bc739faa", + "0x82b93669f42a0a2aa5e250ffe6097269da06a9c02fcd1801abbad415a7729a64f830754bafc702e64600ba47671c2208", + "0x8e3a3029be7edb8dd3ab1f8216664c8dc50d395f603736061d802cef77627db7b859ef287ed850382c13b4d22d6a2d80", + "0x968e9ec7194ff424409d182ce0259acd950c384c163c04463bc8700a40b79beba6146d22b7fa7016875a249b7b31c602", + "0x8b42c984bbe4996e0c20862059167c6bdc5164b1ffcd928f29512664459212d263e89f0f0e30eed4e672ffa5ed0b01b5", + "0x96bac54062110dada905363211133f1f15dc7e4fd80a4c6e4a83bc9a0bcbbaba11cd2c7a13debcf0985e1a954c1da66b", + "0xa16dc8a653d67a7cd7ae90b2fffac0bf1ca587005430fe5ba9403edd70ca33e38ba5661d2ed6e9d2864400d997626a62", + "0xa68ab11a570a27853c8d67e491591dcba746bfbee08a2e75ae0790399130d027ed387f41ef1d7de8df38b472df309161", + "0x92532b74886874447c0300d07eda9bbe4b41ed25349a3da2e072a93fe32c89d280f740d8ff70d5816793d7f2b97373cc", + "0x88e35711b471e89218fd5f4d0eadea8a29405af1cd81974427bc4a5fb26ed60798daaf94f726c96e779b403a2cd82820", + "0xb5c72aa4147c19f8c4f3a0a62d32315b0f4606e0a7025edc5445571eaf4daff64f4b7a585464821574dd50dbe1b49d08", + "0x9305d9b4095258e79744338683fd93f9e657367b3ab32d78080e51d54eec331edbc224fad5093ebf8ee4bd4286757eb8", + "0xb2a17abb3f6a05bcb14dc7b98321fa8b46d299626c73d7c6eb12140bf4c3f8e1795250870947af817834f033c88a59d6", + "0xb3477004837dbd8ba594e4296f960fc91ab3f13551458445e6c232eb04b326da803c4d93e2e8dcd268b4413305ff84da", + "0x924b4b2ebaafdcfdfedb2829a8bf46cd32e1407d8d725a5bd28bdc821f1bafb3614f030ea4352c671076a63494275a3f", + "0x8b81b9ef6125c82a9bece6fdcb9888a767ac16e70527753428cc87c56a1236e437da8be4f7ecfe57b9296dc3ae7ba807", + "0x906e19ec8b8edd58bdf9ae05610a86e4ea2282b1bbc1e8b00b7021d093194e0837d74cf27ac9916bdb8ec308b00da3da", + "0xb41c5185869071760ac786078a57a2ab4e2af60a890037ac0c0c28d6826f15c2cf028fddd42a9b6de632c3d550bfbc14", + "0xa646e5dec1b713ae9dfdf7bdc6cd474d5731a320403c7dfcfd666ffc9ae0cff4b5a79530e8df3f4aa9cb80568cb138e9", + "0xb0efad22827e562bd3c3e925acbd0d9425d19057868608d78c2209a531cccd0f2c43dc5673acf9822247428ffa2bb821", + "0xa94c19468d14b6f99002fc52ac06bbe59e5c472e4a0cdb225144a62f8870b3f10593749df7a2de0bd3c9476ce682e148", + "0x803864a91162f0273d49271dafaab632d93d494d1af935aefa522768af058fce52165018512e8d6774976d52bd797e22", + "0xa08711c2f7d45c68fb340ac23597332e1bcaec9198f72967b9921204b9d48a7843561ff318f87908c05a44fc35e3cc9d", + "0x91c3cad94a11a3197ae4f9461faab91a669e0dddb0371d3cab3ed9aeb1267badc797d8375181130e461eadd05099b2a2", + "0x81bdaaf48aae4f7b480fc13f1e7f4dd3023a41439ba231760409ce9292c11128ab2b0bdbbf28b98af4f97b3551f363af", + "0x8d60f9df9fd303f625af90e8272c4ecb95bb94e6efc5da17b8ab663ee3b3f673e9f6420d890ccc94acf4d2cae7a860d8", + "0xa7b75901520c06e9495ab983f70b61483504c7ff2a0980c51115d11e0744683ce022d76e3e09f4e99e698cbd21432a0d", + "0x82956072df0586562fda7e7738226f694e1c73518dd86e0799d2e820d7f79233667192c9236dcb27637e4c65ef19d493", + "0xa586beb9b6ffd06ad200957490803a7cd8c9bf76e782734e0f55e04a3dc38949de75dc607822ec405736c576cf83bca3", + "0xa179a30d00def9b34a7e85607a447eea0401e32ab5abeee1a281f2acd1cf6ec81a178020666f641d9492b1bdf66f05a3", + "0x83e129705c538787ed8e0fdc1275e6466a3f4ee21a1e6abedd239393b1df72244723b92f9d9d9339a0cab6ebf28f5a16", + "0x811bd8d1e3722b64cd2f5b431167e7f91456e8bba2cc669d3fbbce7d553e29c3c19f629fcedd2498bc26d33a24891d17", + "0xa243c030c858f1f60cccd26b45b024698cc6d9d9e6198c1ed4964a235d9f8d0baf9cde10c8e63dfaa47f8e74e51a6e85", + "0xab839eb82e23ca52663281f863b55b0a3d6d4425c33ffb4eeb1d7979488ab068bf99e2a60e82cea4dc42c56c26cbfebe", + "0x8b896f9bb21d49343e67aec6ad175b58c0c81a3ca73d44d113ae4354a0065d98eb1a5cafedaf232a2bb9cdc62152f309", + "0xaf6230340cc0b66f5bf845540ed4fc3e7d6077f361d60762e488d57834c3e7eb7eacc1b0ed73a7d134f174a01410e50c", + "0x88975e1b1af678d1b5179f72300a30900736af580dd748fd9461ef7afccc91ccd9bed33f9da55c8711a7635b800e831f", + "0xa97486bb9047391661718a54b8dd5a5e363964e495eae6c692730264478c927cf3e66dd3602413189a3699fbeae26e15", + "0xa5973c161ab38732885d1d2785fd74bf156ba34881980cba27fe239caef06b24a533ffe6dbbbeca5e6566682cc00300a", + "0xa24776e9a840afda0003fa73b415d5bd6ecd9b5c2cc842b643ee51b8c6087f4eead4d0bfbd987eb174c489a7b952ff2a", + "0xa8a6ee06e3af053b705a12b59777267c546f33ba8a0f49493af8e6df4e15cf8dd2d4fb4daf7e84c6b5d3a7363118ff03", + "0xa28e59ce6ad02c2ce725067c0123117e12ac5a52c8f5af13eec75f4a9efc4f696777db18a374fa33bcae82e0734ebd16", + "0x86dfc3b78e841c708aff677baa8ee654c808e5d257158715097c1025d46ece94993efe12c9d188252ad98a1e0e331fec", + "0xa88d0275510f242eab11fdb0410ff6e1b9d7a3cbd3658333539815f1b450a84816e6613d15aa8a8eb15d87cdad4b27a2", + "0x8440acea2931118a5b481268ff9f180ee4ede85d14a52c026adc882410825b8275caa44aff0b50c2b88d39f21b1a0696", + "0xa7c3182eab25bd6785bacf12079d0afb0a9b165d6ed327814e2177148539f249eb9b5b2554538f54f3c882d37c0a8abe", + "0x85291fbe10538d7da38efdd55a7acebf03b1848428a2f664c3ce55367aece60039f4f320b1771c9c89a35941797f717c", + "0xa2c6414eeb1234728ab0de94aa98fc06433a58efa646ca3fcbd97dbfb8d98ae59f7ce6d528f669c8149e1e13266f69c9", + "0x840c8462785591ee93aee2538d9f1ec44ba2ca61a569ab51d335ac873f5d48099ae8d7a7efa0725d9ff8f9475bfa4f56", + "0xa7065a9d02fb3673acf7702a488fbc01aa69580964932f6f40b6c2d1c386b19e50b0e104fcac24ea26c4e723611d0238", + "0xb72db6d141267438279e032c95e6106c2ccb3164b842ba857a2018f3a35f4b040da92680881eb17cd61d0920d5b8f006", + "0xa8005d6c5960e090374747307ef0be2871a7a43fa4e76a16c35d2baab808e9777b496e9f57a4218b23390887c33a0b55", + "0x8e152cea1e00a451ca47c20a1e8875873419700af15a5f38ee2268d3fbc974d4bd5f4be38008fa6f404dbdedd6e6e710", + "0xa3391aed1fcd68761f06a7d1008ec62a09b1cb3d0203cd04e300a0c91adfed1812d8bc1e4a3fd7976dc0aae0e99f52f1", + "0x967eb57bf2aa503ee0c6e67438098149eac305089c155f1762cf5e84e31f0fbf27c34a9af05621e34645c1ec96afaec8", + "0x88af97ddc4937a95ec0dcd25e4173127260f91c8db2f6eac84afb789b363705fb3196235af631c70cafd09411d233589", + "0xa32df75b3f2c921b8767638fd289bcfc61e08597170186637a7128ffedd52c798c434485ac2c7de07014f9e895c2c3d8", + "0xb0a783832153650aa0d766a3a73ec208b6ce5caeb40b87177ffc035ab03c7705ecdd1090b6456a29f5fb7e90e2fa8930", + "0xb59c8e803b4c3486777d15fc2311b97f9ded1602fa570c7b0200bada36a49ee9ef4d4c1474265af8e1c38a93eb66b18b", + "0x982f2c85f83e852022998ff91bafbb6ff093ef22cf9d5063e083a48b29175ccbd51b9c6557151409e439096300981a6c", + "0x939e3b5989fefebb9d272a954659a4eb125b98c9da6953f5e628d26266bd0525ec38304b8d56f08d65abc4d6da4a8dbb", + "0x8898212fe05bc8de7d18503cb84a1c1337cc2c09d1eeef2b475aa79185b7322bf1f8e065f1bf871c0c927dd19faf1f6d", + "0x94b0393a41cd00f724aee2d4bc72103d626a5aecb4b5486dd1ef8ac27528398edf56df9db5c3d238d8579af368afeb09", + "0x96ac564450d998e7445dd2ea8e3fc7974d575508fa19e1c60c308d83b645864c029f2f6b7396d4ff4c1b24e92e3bac37", + "0x8adf6638e18aff3eb3b47617da696eb6c4bdfbecbbc3c45d3d0ab0b12cbad00e462fdfbe0c35780d21aa973fc150285e", + "0xb53f94612f818571b5565bbb295e74bada9b5f9794b3b91125915e44d6ddcc4da25510eab718e251a09c99534d6042d9", + "0x8b96462508d77ee083c376cd90807aebad8de96bca43983c84a4a6f196d5faf6619a2351f43bfeec101864c3bf255519", + "0xaeadf34657083fc71df33bd44af73bf5281c9ca6d906b9c745536e1819ea90b56107c55e2178ebad08f3ba75b3f81c86", + "0x9784ba29b2f0057b5af1d3ab2796d439b8753f1f749c73e791037461bdfc3f7097394283105b8ab01788ea5255a96710", + "0x8756241bda159d4a33bf74faba0d4594d963c370fb6a18431f279b4a865b070b0547a6d1613cf45b8cfb5f9236bbf831", + "0xb03ebfd6b71421dfd49a30460f9f57063eebfe31b9ceaa2a05c37c61522b35bdc09d7db3ad75c76c253c00ba282d3cd2", + "0xb34e7e6341fa9d854b2d3153bdda0c4ae2b2f442ab7af6f99a0975d45725aa48e36ae5f7011edd249862e91f499687d4", + "0xb462ee09dc3963a14354244313e3444de5cc37ea5ccfbf14cd9aca8027b59c4cb2a949bc30474497cab8123e768460e6", + "0xaea753290e51e2f6a21a9a0ee67d3a2713f95c2a5c17fe41116c87d3aa77b1683761264d704df1ac34f8b873bc88ef7b", + "0x98430592afd414394f98ddfff9f280fcb1c322dbe3510f45e1e9c4bb8ee306b3e0cf0282c0ee73ebb8ba087d4d9e0858", + "0xb95d3b5aaf54ffca11f4be8d57f76e14afdb20afc859dc7c7471e0b42031e8f3d461b726ecb979bdb2f353498dfe95ea", + "0x984d17f9b11a683132e0b5a9ee5945e3ff7054c2d5c716be73b29078db1d36f54c6e652fd2f52a19da313112e97ade07", + "0xab232f756b3fff3262be418a1af61a7e0c95ceebbc775389622a8e10610508cd6784ab7960441917a83cc191c58829ea", + "0xa28f41678d6e60de76b0e36ab10e4516e53e02e9c77d2b5af3cfeee3ce94cfa30c5797bd1daab20c98e1cad83ad0f633", + "0xb55395fca84dd3ccc05dd480cb9b430bf8631ff06e24cb51d54519703d667268c2f8afcde4ba4ed16bece8cc7bc8c6e0", + "0x8a8a5392a0e2ea3c7a8c51328fab11156004e84a9c63483b64e8f8ebf18a58b6ffa8fe8b9d95af0a2f655f601d096396", + "0xab480000fe194d23f08a7a9ec1c392334e9c687e06851f083845121ce502c06b54dda8c43092bcc1035df45cc752fe9b", + "0xb265644c29f628d1c7e8e25a5e845cabb21799371814730a41a363e1bda8a7be50fee7c3996a365b7fcba4642add10db", + "0xb8a915a3c685c2d4728f6931c4d29487cad764c5ce23c25e64b1a3259ac27235e41b23bfe7ae982921b4cb84463097df", + "0x8efa7338442a4b6318145a5440fc213b97869647eeae41b9aa3c0a27ee51285b73e3ae3b4a9423df255e6add58864aa9", + "0x9106d65444f74d217f4187dfc8fcf3810b916d1e4275f94f6a86d1c4f3565b131fd6cde1fa708bc05fe183c49f14941a", + "0x948252dac8026bbbdb0a06b3c9d66ec4cf9532163bab68076fda1bd2357b69e4b514729c15aaa83b5618b1977bbc60c4", + "0xae6596ccfdf5cbbc5782efe3bb0b101bb132dbe1d568854ca24cacc0b2e0e9fabcb2ca7ab42aecec412efd15cf8cb7a2", + "0x84a0b6c198ff64fd7958dfd1b40eac9638e8e0b2c4cd8cf5d8cdf80419baee76a05184bce6c5b635f6bf2d30055476a7", + "0x8893118be4a055c2b3da593dbca51b1ae2ea2469911acfb27ee42faf3e6c3ad0693d3914c508c0b05b36a88c8b312b76", + "0xb097479e967504deb6734785db7e60d1d8034d6ca5ba9552887e937f5e17bb413fccac2c1d1082154ed76609127860ad", + "0xa0294e6b9958f244d29943debf24b00b538b3da1116269b6e452bb12dc742226712fd1a15b9c88195afeb5d2415f505c", + "0xb3cc15f635080bc038f61b615f62b5b5c6f2870586191f59476e8368a73641d6ac2f7d0c1f54621982defdb318020230", + "0x99856f49b9fe1604d917c94d09cc0ed753d13d015d30587a94e6631ffd964b214e607deb8a69a8b5e349a7edf4309206", + "0xa8571e113ea22b4b4fce41a094da8c70de37830ae32e62c65c2fa5ad06a9bc29e884b945e73d448c72b176d6ecebfb58", + "0xa9e9c6e52beb0013273c29844956b3ce291023678107cdc785f7b44eff5003462841ad8780761b86aefc6b734adde7cf", + "0x80a784b0b27edb51ef2bad3aee80e51778dcaa0f3f5d3dcb5dc5d4f4b2cf7ae35b08de6680ea9dac53f8438b92eb09ef", + "0x827b543e609ea328e97e373f70ad72d4915a2d1daae0c60d44ac637231070e164c43a2a58db80a64df1c624a042b38f9", + "0xb449c65e8195202efdcb9bdb4e869a437313b118fef8b510cbbf8b79a4e99376adb749b37e9c20b51b31ed3310169e27", + "0x8ea3028f4548a79a94c717e1ed28ad4d8725b8d6ab18b021063ce46f665c79da3c49440c6577319dab2d036b7e08f387", + "0x897798431cfb17fe39f08f5f854005dc37b1c1ec1edba6c24bc8acb3b88838d0534a75475325a5ea98b326ad47dbad75", + "0x89cf232e6303b0751561960fd4dea5754a28c594daf930326b4541274ffb03c7dd75938e411eb9a375006a70ce38097f", + "0x9727c6ae7f0840f0b6c8bfb3a1a5582ceee705e0b5c59b97def7a7a2283edd4d3f47b7971e902a3a2079e40b53ff69b8", + "0xb76ed72b122c48679d221072efc0eeea063cb205cbf5f9ef0101fd10cb1075b8628166c83577cced654e1c001c7882f7", + "0xae908c42d208759da5ee9b405df85a6532ea35c6f0f6a1288d22870f59d98edc896841b8ac890a538e6c8d1e8b02d359", + "0x809d12fe4039a0ec80dc9be6a89acaab7797e5f7f9b163378f52f9a75a1d73b2e9ae6e3dd49e32ced439783c1cabbef5", + "0xa4149530b7f85d1098ba534d69548c6c612c416e8d35992fc1f64f4deeb41e09e49c6cf7aadbed7e846b91299358fe2d", + "0xa49342eacd1ec1148b8df1e253b1c015f603c39de11fa0a364ccb86ea32d69c34fd7aa6980a1fadcd8e785a57fa46f60", + "0x87d43eff5a006dc4dddcf76cc96c656a1f3a68f19f124181feab86c6cc9a52cb9189cdbb423414defdd9bb0ca8ff1ddc", + "0x861367e87a9aa2f0f68296ba50aa5dbc5713008d260cc2c7e62d407c2063064749324c4e8156dc21b749656cfebce26b", + "0xb5303c2f72e84e170e66ae1b0fbd51b8c7a6f27476eaf5694b64e8737d5c84b51fe90100b256465a4c4156dd873cddb0", + "0xb62849a4f891415d74f434cdc1d23c4a69074487659ca96e1762466b2b7a5d8525b056b891d0feea6fe6845cba8bc7fb", + "0x923dd9e0d6590a9307e8c4c23f13bae3306b580e297a937711a8b13e8de85e41a61462f25b7d352b682e8437bf2b4ab3", + "0x9147379860cd713cd46c94b8cdf75125d36c37517fbecf81ace9680b98ce6291cd1c3e472f84249cc3b2b445e314b1b6", + "0xa808a4f17ac21e3fb5cfef404e61fae3693ca3e688d375f99b6116779696059a146c27b06de3ac36da349b0649befd56", + "0x87787e9322e1b75e66c1f0d9ea0915722a232770930c2d2a95e9478c4b950d15ab767e30cea128f9ed65893bfc2d0743", + "0x9036a6ee2577223be105defe1081c48ea7319e112fff9110eb9f61110c319da25a6cea0464ce65e858635b079691ef1f", + "0xaf5548c7c24e1088c23b57ee14d26c12a83484c9fd9296edf1012d8dcf88243f20039b43c8c548c265ef9a1ffe9c1c88", + "0xa0fff520045e14065965fb8accd17e878d3fcaf9e0af2962c8954e50be6683d31fa0bf4816ab68f08630dbac6bfce52a", + "0xb4c1b249e079f6ae1781af1d97a60b15855f49864c50496c09c91fe1946266915b799f0406084d7783f5b1039116dd8b", + "0x8b0ffa5e7c498cb3879dddca34743b41eee8e2dea3d4317a6e961b58adb699ef0c92400c068d5228881a2b08121226bf", + "0x852ae8b19a1d80aa8ae5382e7ee5c8e7670ceb16640871c56b20b96b66b3b60e00015a3dde039446972e57b49a999ddd", + "0xa49942f04234a7d8492169da232cfff8051df86e8e1ba3db46aede02422c689c87dc1d99699c25f96cb763f5ca0983e5", + "0xb04b597b7760cf5dcf411ef896d1661e6d5b0db3257ac2cf64b20b60c6cc18fa10523bb958a48d010b55bac7b02ab3b1", + "0xa494591b51ea8285daecc194b5e5bd45ae35767d0246ac94fae204d674ee180c8e97ff15f71f28b7aeb175b8aea59710", + "0x97d2624919e78406e7460730680dea8e71c8571cf988e11441aeea54512b95bd820e78562c99372d535d96f7e200d20d", + "0xac693ddb00e48f76e667243b9b6a7008424043fb779e4f2252330285232c3fccac4da25cbd6d95fe9ad959ff305a91f6", + "0x8d20ca0a71a64a3f702a0825bb46bd810d03bebfb227683680d474a52f965716ff99e19a165ebaf6567987f4f9ee3c94", + "0xa5c516a438f916d1d68ca76996404792e0a66e97b7f18fc54c917bf10cf3211b62387932756e39e67e47b0bd6e88385a", + "0xb089614d830abc0afa435034cec7f851f2f095d479cacf1a3fb57272da826c499a52e7dcbc0eb85f4166fb94778e18e9", + "0xa8dacc943765d930848288192f4c69e2461c4b9bc6e79e30eeef9a543318cf9ae9569d6986c65c5668a89d49993f8e07", + "0xab5a9361fa339eec8c621bdad0a58078983abd8942d4282b22835d7a3a47e132d42414b7c359694986f7db39386c2e19", + "0x94230517fb57bd8eb26c6f64129b8b2abd0282323bf7b94b8bac7fab27b4ecc2c4290c294275e1a759de19f2216134f3", + "0xb8f158ea5006bc3b90b285246625faaa6ac9b5f5030dc69701b12f3b79a53ec7e92eeb5a63bbd1f9509a0a3469ff3ffc", + "0x8b6944fd8cb8540957a91a142fdcda827762aa777a31e8810ca6d026e50370ee1636fc351724767e817ca38804ebe005", + "0x82d1ee40fe1569c29644f79fa6c4033b7ed45cd2c3b343881f6eb0de2e79548fded4787fae19bed6ee76ed76ff9f2f11", + "0xa8924c7035e99eaed244ca165607e7e568b6c8085510dcdbaf6ebdbed405af2e6c14ee27d94ffef10d30aa52a60bf66d", + "0x956f82a6c2ae044635e85812581e4866c5fa2f427b01942047d81f6d79a14192f66fbbe77c9ffeaef4e6147097fdd2b5", + "0xb1100255a1bcf5e05b6aff1dfeb6e1d55b5d68d43a7457ba10cc76b61885f67f4d0d5179abda786e037ae95deb8eea45", + "0x99510799025e3e5e8fbf06dedb14c060c6548ba2bda824f687d3999dc395e794b1fb6514b9013f3892b6cf65cb0d65aa", + "0x8f9091cebf5e9c809aab415942172258f894e66e625d7388a05289183f01b8d994d52e05a8e69f784fba41db9ea357f0", + "0xa13d2eeb0776bdee9820ecb6693536720232848c51936bb4ef4fe65588d3f920d08a21907e1fdb881c1ad70b3725e726", + "0xa68b8f18922d550284c5e5dc2dda771f24c21965a6a4d5e7a71678178f46df4d8a421497aad8fcb4c7e241aba26378a0", + "0x8b7601f0a3c6ad27f03f2d23e785c81c1460d60100f91ea9d1cab978aa03b523150206c6d52ce7c7769c71d2c8228e9e", + "0xa8e02926430813caa851bb2b46de7f0420f0a64eb5f6b805401c11c9091d3b6d67d841b5674fa2b1dce0867714124cd8", + "0xb7968ecba568b8193b3058400af02c183f0a6df995a744450b3f7e0af7a772454677c3857f99c140bbdb2a09e832e8e0", + "0x8f20b1e9ba87d0a3f35309b985f3c18d2e8800f1ca7f0c52cadef773f1496b6070c936eea48c4a1cae83fd2524e9d233", + "0x88aef260042db0d641a51f40639dbeeefa9e9811df30bee695f3791f88a2f84d318f04e8926b7f47bf25956cb9e3754f", + "0x9725345893b647e9ba4e6a29e12f96751f1ae25fcaec2173e9a259921a1a7edb7a47159b3c8767e44d9e2689f5aa0f72", + "0x8c281e6f72752cb11e239e4df9341c45106eb7993c160e54423c2bffe10bc39d42624b45a1f673936ef2e1a02fc92f1a", + "0x90aba2f68bddb2fcce6c51430dacdfeec43ea8dc379660c99095df11017691ccf5faa27665cf4b9f0eea7728ae53c327", + "0xb7022695c16521c5704f49b7ddbdbec9b5f57ce0ceebe537bc0ebb0906d8196cc855a9afeb8950a1710f6a654464d93f", + "0x8fe1b9dd3c6a258116415d36e08374e094b22f0afb104385a5da48be17123e86fb8327baacc4f0d9ebae923d55d99bb5", + "0x817e85d8e3d19a4cbc1dec31597142c2daa4871bda89c2177fa719c00eda3344eb08b82eb92d4aa91a9eaacb3fc09783", + "0xb59053e1081d2603f1ca0ba553804d6fa696e1fd996631db8f62087b26a40dfef02098b0326bb75f99ec83b9267ca738", + "0x990a173d857d3ba81ff3789b931bfc9f5609cde0169b7f055fa3cb56451748d593d62d46ba33f80f9cafffe02b68dd14", + "0xb0c538dbba4954b809ab26f9f94a3cf1dcb77ce289eaec1d19f556c0ae4be1fa03af4a9b7057837541c3cc0a80538736", + "0xac3ba42f5f44f9e1fc453ce49c4ab79d0e1d5c42d3b30b1e098f3ab3f414c4c262fa12fb2be249f52d4aaf3c5224beb9", + "0xaf47467eb152e59870e21f0d4da2f43e093daf40180ab01438030684b114d025326928eaab12c41b81a066d94fce8436", + "0x98d1b58ba22e7289b1c45c79a24624f19b1d89e00f778eef327ec4856a9a897278e6f1a9a7e673844b31dde949153000", + "0x97ccb15dfadc7c59dca08cfe0d22df2e52c684cf97de1d94bc00d7ba24e020025130b0a39c0f4d46e4fc872771ee7875", + "0xb699e4ed9a000ff96ca296b2f09dce278832bc8ac96851ff3cff99ed3f6f752cfc0fea8571be28cd9b5a7ec36f1a08ee", + "0xb9f49f0edb7941cc296435ff0a912e3ad16848ee8765ab5f60a050b280d6ea585e5b34051b15f6b8934ef01ceb85f648", + "0xac3893df7b4ceab23c6b9054e48e8ba40d6e5beda8fbe90b814f992f52494186969b35d8c4cdc3c99890a222c9c09008", + "0xa41293ad22fae81dea94467bc1488c3707f3d4765059173980be93995fa4fcc3c9340796e3eed0beeb0ba0d9bb4fa3aa", + "0xa0543e77acd2aeecde13d18d258aeb2c7397b77f17c35a1992e8666ea7abcd8a38ec6c2741bd929abba2f766138618cc", + "0x92e79b22bc40e69f6527c969500ca543899105837b6b1075fa1796755c723462059b3d1b028e0b3df2559fa440e09175", + "0xa1fa1eac8f41a5197a6fb4aa1eae1a031c89f9c13ff9448338b222780cf9022e0b0925d930c37501a0ef7b2b00fdaf83", + "0xb3cb29ff73229f0637335f28a08ad8c5f166066f27c6c175164d0f26766a927f843b987ee9b309ed71cbf0a65d483831", + "0x84d4ab787f0ac00f104f4a734dc693d62d48c2aeb03913153da62c2ae2c27d11b1110dcef8980368dd84682ea2c1a308", + "0xab6a8e4bbc78d4a7b291ad3e9a8fe2d65f640524ba3181123b09d2d18a9e300e2509ccf7000fe47e75b65f3e992a2e7e", + "0xb7805ebe4f1a4df414003dc10bca805f2ab86ca75820012653e8f9b79c405196b0e2cab099f2ab953d67f0d60d31a0f9", + "0xb12c582454148338ea605d22bd00a754109063e22617f1f8ac8ddf5502c22a181c50c216c3617b9852aa5f26af56b323", + "0x86333ad9f898947e31ce747728dc8c887479e18d36ff3013f69ebef807d82c6981543b5c3788af93c4d912ba084d3cba", + "0xb514efa310dc4ad1258add138891e540d8c87142a881b5f46563cc58ecd1488e6d3a2fca54c0b72a929f3364ca8c333e", + "0xaa0a30f92843cf2f484066a783a1d75a7aa6f41f00b421d4baf20a6ac7886c468d0eea7ca8b17dd22f4f74631b62b640", + "0xb3b7dc63baec9a752e8433c0cdee4d0f9bc41f66f2b8d132faf925eef9cf89aae756fc132c45910f057122462605dc10", + "0xb9b8190dac5bfdeb59fd44f4da41a57e7f1e7d2c21faba9da91fa45cbeca06dcf299c9ae22f0c89ece11ac46352d619f", + "0x89f8cf36501ad8bdfeab863752a9090e3bfda57cf8fdeca2944864dc05925f501e252c048221bcc57136ab09a64b64b2", + "0xb0cbfaf317f05f97be47fc9d69eda2dd82500e00d42612f271a1fe24626408c28881f171e855bd5bd67409f9847502b4", + "0xa7c21a8fcede581bfd9847b6835eda62ba250bea81f1bb17372c800a19c732abe03064e64a2f865d974fb636cab4b859", + "0x95f9df524ba7a4667351696c4176b505d8ea3659f5ff2701173064acc624af69a0fad4970963736383b979830cb32260", + "0x856a74fe8b37a2e3afeac858c8632200485d438422a16ae3b29f359e470e8244995c63ad79c7e007ed063f178d0306fd", + "0xb37faa4d78fdc0bb9d403674dbea0176c2014a171c7be8527b54f7d1a32a76883d3422a3e7a5f5fcc5e9b31b57822eeb", + "0x8d37234d8594ec3fe75670b5c9cc1ec3537564d4739b2682a75b18b08401869a4264c0f264354219d8d896cded715db4", + "0xb5289ee5737f0e0bde485d32096d23387d68dab8f01f47821ab4f06cc79a967afe7355e72dc0c751d96b2747b26f6255", + "0x9085e1fdf9f813e9c3b8232d3c8863cd84ab30d45e8e0d3d6a0abd9ebc6fd70cdf749ff4d04390000e14c7d8c6655fc7", + "0x93a388c83630331eca4da37ea4a97b3b453238af474817cc0a0727fd3138dcb4a22de38c04783ec829c22cb459cb4e8e", + "0xa5377116027c5d061dbe24c240b891c08cdd8cd3f0899e848d682c873aff5b8132c1e7cfe76d2e5ed97ee0eb1d42cb68", + "0xa274c84b04338ed28d74683e2a7519c2591a3ce37c294d6f6e678f7d628be2db8eff253ede21823e2df7183e6552f622", + "0x8bc201147a842453a50bec3ac97671397bc086d6dfc9377fa38c2124cdc286abda69b7324f47d64da094ae011d98d9d9", + "0x9842d0c066c524592b76fbec5132bc628e5e1d21c424bec4555efca8619cc1fd8ea3161febcb8b9e8ab54702f4e815e2", + "0xa19191b713a07efe85c266f839d14e25660ee74452e6c691cd9997d85ae4f732052d802d3deb018bdd847caa298a894b", + "0xa24f71fc0db504da4e287dd118a4a74301cbcd16033937ba2abc8417956fcb4ae19b8e63b931795544a978137eff51cb", + "0xa90eec4a6a3a4b8f9a5b93d978b5026fcf812fe65585b008d7e08c4aaf21195a1d0699f12fc16f79b6a18a369af45771", + "0x8b551cf89737d7d06d9b3b9c4c1c73b41f2ea0af4540999c70b82dabff8580797cf0a3caf34c86c59a7069eb2e38f087", + "0xb8d312e6c635e7a216a1cda075ae77ba3e1d2fd501dc31e83496e6e81ed5d9c7799f8e578869c2e0e256fb29f5de10a7", + "0x8d144bdb8cae0b2cdb5b33d44bbc96984a5925202506a8cc65eb67ac904b466f5a7fe3e1cbf04aa785bbb7348c4bb73c", + "0xa101b3d58b7a98659244b88de0b478b3fb87dc5fc6031f6e689b99edf498abd43e151fd32bd4bbd240e0b3e59c440359", + "0x907453abca7d8e7151a05cc3d506c988007692fe7401395dc93177d0d07d114ab6cca0cc658eb94c0223fe8658295cad", + "0x825329ffbe2147ddb68f63a0a67f32d7f309657b8e5d9ab5bb34b3730bfa2c77a23eaaadb05def7d9f94a9e08fdc1e96", + "0x88ee923c95c1dac99ae7ed6067906d734d793c5dc5d26339c1bb3314abe201c5dccb33b9007351885eb2754e9a8ea06c", + "0x98bc9798543f5f1adc9f2cfcfa72331989420e9c3f6598c45269f0dc9b7c8607bbeaf03faa0aea2ddde2b8f17fdceff5", + "0x8ee87877702a79aef923ab970db6fa81561b3c07d5bf1a072af0a7bad765b4cbaec910afe1a91703feacc7822fa38a94", + "0x8060b9584aa294fe8adc2b22f67e988bc6da768eae91e429dcc43ddc53cfcc5d6753fdc1b420b268c7eb2fb50736a970", + "0xb344a5524d80a2f051870c7001f74fcf348a70fcf78dbd20c6ff9ca85d81567d2318c8b8089f2c4f195d6aec9fc15fa6", + "0x8f5a5d893e1936ed062149d20eb73d98b62b7f50ab5d93a6429c03656b36688d1c80cb5010e4977491e51fa0d7dd35d5", + "0x86fa32ebbf97328c5f5f15564e1238297e289ec3219b9a741724e9f3ae8d5c15277008f555863a478b247ba5dc601d44", + "0x9557e55377e279f4b6b5e0ffe01eca037cc13aac242d67dfcd0374a1e775c5ed5cb30c25fe21143fee54e3302d34a3ea", + "0x8cb6bcbc39372d23464a416ea7039f57ba8413cf3f00d9a7a5b356ab20dcb8ed11b3561f7bce372b8534d2870c7ee270", + "0xb5d59075cb5abde5391f64b6c3b8b50adc6e1f654e2a580b6d6d6eff3f4fbdd8fffc92e06809c393f5c8eab37f774c4b", + "0xafcfb6903ef13e493a1f7308675582f15af0403b6553e8c37afb8b2808ad21b88b347dc139464367dc260df075fea1ad", + "0x810fbbe808375735dd22d5bc7fc3828dc49fdd22cc2d7661604e7ac9c4535c1df578780affb3b895a0831640a945bcad", + "0x8056b0c678803b416f924e09a6299a33cf9ad7da6fe1ad7accefe95c179e0077da36815fde3716711c394e2c5ea7127f", + "0x8b67403702d06979be19f1d6dc3ec73cc2e81254d6b7d0cc49cd4fdda8cd51ab0835c1d2d26fc0ecab5df90585c2f351", + "0x87f97f9e6d4be07e8db250e5dd2bffdf1390665bc5709f2b631a6fa69a7fca958f19bd7cc617183da1f50ee63e9352b5", + "0xae151310985940471e6803fcf37600d7fa98830613e381e00dab943aec32c14162d51c4598e8847148148000d6e5af5c", + "0x81eb537b35b7602c45441cfc61b27fa9a30d3998fad35a064e05bc9479e9f10b62eba2b234b348219eea3cadcaac64bb", + "0x8a441434934180ab6f5bc541f86ebd06eadbee01f438836d797e930fa803a51510e005c9248cecc231a775b74d12b5e9", + "0x81f3c250a27ba14d8496a5092b145629eb2c2e6a5298438670375363f57e2798207832c8027c3e9238ad94ecdadfc4df", + "0xa6217c311f2f3db02ceaa5b6096849fe92b6f4b6f1491535ef8525f6ccee6130bed2809e625073ecbaddd4a3eb3df186", + "0x82d1c396f0388b942cf22b119d7ef1ad03d3dad49a74d9d01649ee284f377c8daddd095d596871669e16160299a210db", + "0xa40ddf7043c5d72a7246bd727b07f7fff1549f0e443d611de6f9976c37448b21664c5089c57f20105102d935ab82f27b", + "0xb6c03c1c97adf0c4bf4447ec71366c6c1bff401ba46236cd4a33d39291e7a1f0bb34bd078ba3a18d15c98993b153a279", + "0x8a94f5f632068399c359c4b3a3653cb6df2b207379b3d0cdace51afdf70d6d5cce6b89a2b0fee66744eba86c98fb21c2", + "0xb2f19e78ee85073f680c3bba1f07fd31b057c00b97040357d97855b54a0b5accb0d3b05b2a294568fcd6a4be6f266950", + "0xa74632d13bbe2d64b51d7a9c3ae0a5a971c19f51cf7596a807cea053e6a0f3719700976d4e394b356c0329a2dced9aa2", + "0xafef616d341a9bc94393b8dfba68ff0581436aa3a3adb7c26a1bbf2cf19fa877066191681f71f17f3cd6f9cf6bf70b5a", + "0x8ce96d93ae217408acf7eb0f9cbb9563363e5c7002e19bbe1e80760bc9d449daee2118f3878b955163ed664516b97294", + "0x8414f79b496176bc8b8e25f8e4cfee28f4f1c2ddab099d63d2aca1b6403d26a571152fc3edb97794767a7c4686ad557c", + "0xb6c61d01fd8ce087ef9f079bf25bf10090db483dd4f88c4a786d31c1bdf52065651c1f5523f20c21e75cea17df69ab73", + "0xa5790fd629be70545093631efadddc136661f63b65ec682609c38ef7d3d7fa4e56bdf94f06e263bc055b90cb1c6bcefe", + "0xb515a767e95704fb7597bca9e46f1753abacdc0e56e867ee3c6f4cd382643c2a28e65312c05ad040eaa3a8cbe7217a65", + "0x8135806a02ead6aa92e9adb6fefb91349837ab73105aaa7be488ef966aa8dfaafdfa64bbae30fcbfa55dd135a036a863", + "0x8f22435702716d76b1369750694540742d909d5e72b54d0878245fab7c269953b1c6f2b29c66f08d5e0263ca3a731771", + "0x8e0f8a8e8753e077dac95848212aeffd51c23d9b6d611df8b102f654089401954413ecbedc6367561ca599512ae5dda7", + "0x815a9084e3e2345f24c5fa559deec21ee1352fb60f4025c0779be65057f2d528a3d91593bd30d3a185f5ec53a9950676", + "0x967e6555ccba395b2cc1605f8484c5112c7b263f41ce8439a99fd1c71c5ed14ad02684d6f636364199ca48afbbde13be", + "0x8cd0ccf17682950b34c796a41e2ea7dd5367aba5e80a907e01f4cdc611e4a411918215e5aebf4292f8b24765d73314a6", + "0xa58bf1bbb377e4b3915df6f058a0f53b8fb8130fdec8c391f6bc82065694d0be59bb67ffb540e6c42cc8b380c6e36359", + "0x92af3151d9e6bfb3383d85433e953c0160859f759b0988431ec5893542ba40288f65db43c78a904325ef8d324988f09d", + "0x8011bbb05705167afb47d4425065630f54cb86cd462095e83b81dfebf348f846e4d8fbcf1c13208f5de1931f81da40b9", + "0x81c743c104fc3cb047885c9fa0fb9705c3a83ee24f690f539f4985509c3dafd507af3f6a2128276f45d5939ef70c167f", + "0xa2c9679b151c041aaf5efeac5a737a8f70d1631d931609fca16be1905682f35e291292874cb3b03f14994f98573c6f44", + "0xa4949b86c4e5b1d5c82a337e5ce6b2718b1f7c215148c8bfb7e7c44ec86c5c9476048fc5c01f57cb0920876478c41ad6", + "0x86c2495088bd1772152e527a1da0ef473f924ea9ab0e5b8077df859c28078f73c4e22e3a906b507fdf217c3c80808b5c", + "0x892e0a910dcf162bcea379763c3e2349349e4cda9402949255ac4a78dd5a47e0bf42f5bd0913951576b1d206dc1e536a", + "0xa7009b2c6b396138afe4754b7cc10dee557c51c7f1a357a11486b3253818531f781ea8107360c8d4c3b1cd96282353c0", + "0x911763ef439c086065cc7b4e57484ed6d693ea44acee4b18c9fd998116da55fbe7dcb8d2a0f0f9b32132fca82d73dff6", + "0xa722000b95a4a2d40bed81870793f15ba2af633f9892df507f2842e52452e02b5ea8dea6a043c2b2611d82376e33742a", + "0x9387ac49477bd719c2f92240d0bdfcf9767aad247ca93dc51e56106463206bc343a8ec855eb803471629a66fffb565d6", + "0x92819a1fa48ab4902939bb72a0a4e6143c058ea42b42f9bc6cea5df45f49724e2530daf3fc4f097cceefa2a8b9db0076", + "0x98eac7b04537653bc0f4941aae732e4b1f84bd276c992c64a219b8715eb1fb829b5cbd997d57feb15c7694c468f95f70", + "0xb275e7ba848ce21bf7996e12dbeb8dadb5d0e4f1cb5a0248a4f8f9c9fe6c74e3c93f4b61edbcb0a51af5a141e1c14bc7", + "0x97243189285aba4d49c53770c242f2faf5fd3914451da4931472e3290164f7663c726cf86020f8f181e568c72fd172d1", + "0x839b0b3c25dd412bee3dc24653b873cc65454f8f16186bb707bcd58259c0b6765fa4c195403209179192a4455c95f3b8", + "0x8689d1a870514568a074a38232e2ceb4d7df30fabeb76cff0aed5b42bf7f02baea12c5fadf69f4713464dbd52aafa55f", + "0x8958ae7b290f0b00d17c3e9fdb4dbf168432b457c7676829299dd428984aba892de1966fc106cfc58a772862ecce3976", + "0xa422bc6bd68b8870cfa5bc4ce71781fd7f4368b564d7f1e0917f6013c8bbb5b240a257f89ecfdbecb40fe0f3aa31d310", + "0xaa61f78130cebe09bc9a2c0a37f0dd57ed2d702962e37d38b1df7f17dc554b1d4b7a39a44182a452ce4c5eb31fa4cfcc", + "0xb7918bd114f37869bf1a459023386825821bfadce545201929d13ac3256d92a431e34f690a55d944f77d0b652cefeffc", + "0x819bba35fb6ace1510920d4dcff30aa682a3c9af9022e287751a6a6649b00c5402f14b6309f0aeef8fce312a0402915e", + "0x8b7c9ad446c6f63c11e1c24e24014bd570862b65d53684e107ba9ad381e81a2eaa96731b4b33536efd55e0f055071274", + "0x8fe79b53f06d33386c0ec7d6d521183c13199498594a46d44a8a716932c3ec480c60be398650bbfa044fa791c4e99b65", + "0x9558e10fb81250b9844c99648cf38fa05ec1e65d0ccbb18aa17f2d1f503144baf59d802c25be8cc0879fff82ed5034ad", + "0xb538a7b97fbd702ba84645ca0a63725be1e2891c784b1d599e54e3480e4670d0025526674ef5cf2f87dddf2290ba09f0", + "0x92eafe2e869a3dd8519bbbceb630585c6eb21712b2f31e1b63067c0acb5f9bdbbcbdb612db4ea7f9cc4e7be83d31973f", + "0xb40d21390bb813ab7b70a010dff64c57178418c62685761784e37d327ba3cb9ef62df87ecb84277c325a637fe3709732", + "0xb349e6fbf778c4af35fbed33130bd8a7216ed3ba0a79163ebb556e8eb8e1a7dad3456ddd700dad9d08d202491c51b939", + "0xa8fdaedecb251f892b66c669e34137f2650509ade5d38fbe8a05d9b9184bb3b2d416186a3640429bd1f3e4b903c159dd", + "0xac6167ebfee1dbab338eff7642f5e785fc21ef0b4ddd6660333fe398068cbd6c42585f62e81e4edbb72161ce852a1a4f", + "0x874b1fbf2ebe140c683bd7e4e0ab017afa5d4ad38055aaa83ee6bbef77dbc88a6ce8eb0dcc48f0155244af6f86f34c2d", + "0x903c58e57ddd9c446afab8256a6bb6c911121e6ccfb4f9b4ed3e2ed922a0e500a5cb7fa379d5285bc16e11dac90d1fda", + "0x8dae7a0cffa2fd166859cd1bf10ff82dd1932e488af377366b7efc0d5dec85f85fe5e8150ff86a79a39cefc29631733a", + "0xaa047857a47cc4dfc08585f28640420fcf105b881fd59a6cf7890a36516af0644d143b73f3515ab48faaa621168f8c31", + "0x864508f7077c266cc0cb3f7f001cb6e27125ebfe79ab57a123a8195f2e27d3799ff98413e8483c533b46a816a3557f1f", + "0x8bcd45ab1f9cbab36937a27e724af819838f66dfeb15923f8113654ff877bd8667c54f6307aaf0c35027ca11b6229bfd", + "0xb21aa34da9ab0a48fcfdd291df224697ce0c1ebc0e9b022fdee8750a1a4b5ba421c419541ed5c98b461eecf363047471", + "0xa9a18a2ab2fae14542dc336269fe612e9c1af6cf0c9ac933679a2f2cb77d3c304114f4d219ca66fe288adde30716775b", + "0xb5205989b92c58bdda71817f9a897e84100b5c4e708de1fced5c286f7a6f01ae96b1c8d845f3a320d77c8e2703c0e8b1", + "0xa364059412bbcc17b8907d43ac8e5df90bc87fd1724b5f99832d0d24559fae6fa76a74cff1d1eac8cbac6ec80b44af20", + "0xae709f2c339886b31450834cf29a38b26eb3b0779bd77c9ac269a8a925d1d78ea3837876c654b61a8fe834b3b6940808", + "0x8802581bba66e1952ac4dab36af371f66778958f4612901d95e5cac17f59165e6064371d02de8fb6fccf89c6dc8bd118", + "0xa313252df653e29c672cbcfd2d4f775089cb77be1077381cf4dc9533790e88af6cedc8a119158e7da5bf6806ad9b91a1", + "0x992a065b4152c7ef11515cd54ba9d191fda44032a01aed954acff3443377ee16680c7248d530b746b8c6dee2d634e68c", + "0xb627b683ee2b32c1ab4ccd27b9f6cce2fe097d96386fa0e5c182ad997c4c422ab8dfc03870cd830b8c774feb66537282", + "0xb823cf8a9aee03dadd013eb9efe40a201b4b57ef67efaae9f99683005f5d1bf55e950bf4af0774f50859d743642d3fea", + "0xb8a7449ffac0a3f206677097baf7ce00ca07a4d2bd9b5356fbcb83f3649b0fda07cfebad220c1066afba89e5a52abf4b", + "0xb2dd1a2f986395bb4e3e960fbbe823dbb154f823284ebc9068502c19a7609790ec0073d08bfa63f71e30c7161b6ef966", + "0x98e5236de4281245234f5d40a25b503505af140b503a035fc25a26159a9074ec81512b28f324c56ea2c9a5aa7ce90805", + "0x89070847dc8bbf5bc4ed073aa2e2a1f699cf0c2ca226f185a0671cecc54e7d3e14cd475c7752314a7a8e7476829da4bc", + "0xa9402dc9117fdb39c4734c0688254f23aed3dce94f5f53f5b7ef2b4bf1b71a67f85ab1a38ec224a59691f3bee050aeb3", + "0x957288f9866a4bf56a4204218ccc583f717d7ce45c01ea27142a7e245ad04a07f289cc044f8cf1f21d35e67e39299e9c", + "0xb2fb31ccb4e69113763d7247d0fc8edaae69b550c5c56aecacfd780c7217dc672f9fb7496edf4aba65dacf3361268e5b", + "0xb44a4526b2f1d6eb2aa8dba23bfa385ff7634572ab2afddd0546c3beb630fbfe85a32f42dd287a7fec069041411537f7", + "0x8db5a6660c3ac7fd7a093573940f068ee79a82bc17312af900b51c8c439336bc86ca646c6b7ab13aaaa008a24ca508ab", + "0x8f9899a6d7e8eb4367beb5c060a1f8e94d8a21099033ae582118477265155ba9e72176a67f7f25d7bad75a152b56e21a", + "0xa67de0e91ade8d69a0e00c9ff33ee2909b8a609357095fa12319e6158570c232e5b6f4647522efb7345ce0052aa9d489", + "0x82eb2414898e9c3023d57907a2b17de8e7eea5269029d05a94bfd7bf5685ac4a799110fbb375eb5e0e2bd16acf6458ae", + "0x94451fc7fea3c5a89ba701004a9693bab555cb622caf0896b678faba040409fdfd14a978979038b2a81e8f0abc4994d2", + "0xac879a5bb433998e289809a4a966bd02b4bf6a9c1cc276454e39c886efcf4fc68baebed575826bde577ab5aa71d735a9", + "0x880c0f8f49c875dfd62b4ddedde0f5c8b19f5687e693717f7e5c031bc580e58e13ab497d48b4874130a18743c59fdce3", + "0xb582af8d8ff0bf76f0a3934775e0b54c0e8fed893245d7d89cae65b03c8125b7237edc29dc45b4fe1a3fe6db45d280ee", + "0x89f337882ed3ae060aaee98efa20d79b6822bde9708c1c5fcee365d0ec9297f694cae37d38fd8e3d49717c1e86f078e7", + "0x826d2c1faea54061848b484e288a5f4de0d221258178cf87f72e14baaa4acc21322f8c9eab5dde612ef497f2d2e1d60b", + "0xa5333d4f227543e9cd741ccf3b81db79f2f03ca9e649e40d6a6e8ff9073e06da83683566d3b3c8d7b258c62970fb24d1", + "0xa28f08c473db06aaf4c043a2fae82b3c8cfaa160bce793a4c208e4e168fb1c65115ff8139dea06453c5963d95e922b94", + "0x8162546135cc5e124e9683bdfaa45833c18553ff06a0861c887dc84a5b12ae8cd4697f6794c7ef6230492c32faba7014", + "0xb23f0d05b74c08d6a7df1760792be83a761b36e3f8ae360f3c363fb196e2a9dd2de2e492e49d36561366e14daa77155c", + "0xb6f70d6c546722d3907c708d630dbe289771d2c8bf059c2e32b77f224696d750b4dda9b3a014debda38e7d02c9a77585", + "0x83bf4c4a9f3ca022c631017e7a30ea205ba97f7f5927cba8fc8489a4646eac6712cb821c5668c9ffe94d69d524374a27", + "0xb0371475425a8076d0dd5f733f55aabbe42d20a7c8ea7da352e736d4d35a327b2beb370dfcb05284e22cfd69c5f6c4cc", + "0xa0031ba7522c79211416c2cca3aa5450f96f8fee711552a30889910970ba13608646538781a2c08b834b140aadd7166f", + "0x99d273c80c7f2dc6045d4ed355d9fc6f74e93549d961f4a3b73cd38683f905934d359058cd1fc4da8083c7d75070487f", + "0xb0e4b0efa3237793e9dcce86d75aafe9879c5fa23f0d628649aef2130454dcf72578f9bf227b9d2b9e05617468e82588", + "0xa5ab076fa2e1c5c51f3ae101afdd596ad9d106bba7882b359c43d8548b64f528af19afa76cd6f40da1e6c5fca4def3fa", + "0x8ce2299e570331d60f6a6eff1b271097cd5f1c0e1113fc69b89c6a0f685dabea3e5bc2ac6bd789aa492ab189f89be494", + "0x91b829068874d911a310a5f9dee001021f97471307b5a3de9ec336870ec597413e1d92010ce320b619f38bed7c4f7910", + "0xb14fe91f4b07bf33b046e9285b66cb07927f3a8da0af548ac2569b4c4fb1309d3ced76d733051a20814e90dd5b75ffd1", + "0xabaab92ea6152d40f82940277c725aa768a631ee0b37f5961667f82fb990fc11e6d3a6a2752b0c6f94563ed9bb28265c", + "0xb7fe28543eca2a716859a76ab9092f135337e28109544f6bd2727728d0a7650428af5713171ea60bfc273d1c821d992c", + "0x8a4917b2ab749fc7343fc64bdf51b6c0698ff15d740cc7baf248c030475c097097d5a473bcc00d8c25817563fe0447b4", + "0xaa96156d1379553256350a0a3250166add75948fb9cde62aa555a0a9dc0a9cb7f2f7b8428aff66097bf6bfedaf14bbe2", + "0xae4ffeb9bdc76830d3eca2b705f30c1bdede6412fa064260a21562c8850c7fb611ec62bc68479fe48f692833e6f66d8d", + "0xb96543caaba9d051600a14997765d49e4ab10b07c7a92cccf0c90b309e6da334fdd6d18c96806cbb67a7801024fbd3c7", + "0x97b2b9ad76f19f500fcc94ca8e434176249f542ac66e5881a3dccd07354bdab6a2157018b19f8459437a68d8b86ba8e0", + "0xa8d206f6c5a14c80005849474fde44b1e7bcf0b2d52068f5f97504c3c035b09e65e56d1cf4b5322791ae2c2fdbd61859", + "0x936bad397ad577a70cf99bf9056584a61bd7f02d2d5a6cf219c05d770ae30a5cd902ba38366ce636067fc1dd10108d31", + "0xa77e30195ee402b84f3882e2286bf5380c0ed374a112dbd11e16cef6b6b61ab209d4635e6f35cdaaa72c1a1981d5dabe", + "0xa46ba4d3947188590a43c180757886a453a0503f79cc435322d92490446f37419c7b999fdf868a023601078070e03346", + "0x80d8d4c5542f223d48240b445d4d8cf6a75d120b060bc08c45e99a13028b809d910b534d2ac47fb7068930c54efd8da9", + "0x803be9c68c91b42b68e1f55e58917a477a9a6265e679ca44ee30d3eb92453f8c89c64eafc04c970d6831edd33d066902", + "0xb14b2b3d0dfe2bb57cee4cd72765b60ac33c1056580950be005790176543826c1d4fbd737f6cfeada6c735543244ab57", + "0xa9e480188bba1b8fb7105ff12215706665fd35bf1117bacfb6ab6985f4dbc181229873b82e5e18323c2b8f5de03258e0", + "0xa66a0f0779436a9a3999996d1e6d3000f22c2cac8e0b29cddef9636393c7f1457fb188a293b6c875b05d68d138a7cc4a", + "0x848397366300ab40c52d0dbbdafbafef6cd3dadf1503bb14b430f52bb9724188928ac26f6292a2412bc7d7aa620763c8", + "0x95466cc1a78c9f33a9aaa3829a4c8a690af074916b56f43ae46a67a12bb537a5ac6dbe61590344a25b44e8512355a4a7", + "0x8b5f7a959f818e3baf0887f140f4575cac093d0aece27e23b823cf421f34d6e4ff4bb8384426e33e8ec7b5eed51f6b5c", + "0x8d5e1368ec7e3c65640d216bcc5d076f3d9845924c734a34f3558ac0f16e40597c1a775a25bf38b187213fbdba17c93b", + "0xb4647c1b823516880f60d20c5cc38c7f80b363c19d191e8992226799718ee26b522a12ecb66556ed3d483aa4824f3326", + "0xac3abaea9cd283eb347efda4ed9086ea3acf495043e08d0d19945876329e8675224b685612a6badf8fd72fb6274902b1", + "0x8eae1ce292d317aaa71bcf6e77e654914edd5090e2e1ebab78b18bb41b9b1bc2e697439f54a44c0c8aa0d436ebe6e1a9", + "0x94dc7d1aec2c28eb43d93b111fa59aaa0d77d5a09501220bd411768c3e52208806abf973c6a452fd8292ff6490e0c9e2", + "0x8fd8967f8e506fef27d17b435d6b86b232ec71c1036351f12e6fb8a2e12daf01d0ee04451fb944d0f1bf7fd20e714d02", + "0x824e6865be55d43032f0fec65b3480ea89b0a2bf860872237a19a54bc186a85d2f8f9989cc837fbb325b7c72d9babe2c", + "0x8bd361f5adb27fd6f4e3f5de866e2befda6a8454efeb704aacc606f528c03f0faae888f60310e49440496abd84083ce2", + "0xb098a3c49f2aaa28b6b3e85bc40ce6a9cdd02134ee522ae73771e667ad7629c8d82c393fba9f27f5416986af4c261438", + "0xb385f5ca285ff2cfe64dcaa32dcde869c28996ed091542600a0b46f65f3f5a38428cca46029ede72b6cf43e12279e3d3", + "0x8196b03d011e5be5288196ef7d47137d6f9237a635ab913acdf9c595fa521d9e2df722090ec7eb0203544ee88178fc5f", + "0x8ed1270211ef928db18e502271b7edf24d0bbd11d97f2786aee772d70c2029e28095cf8f650b0328cc8a4c38d045316d", + "0xa52ab60e28d69b333d597a445884d44fd2a7e1923dd60f763951e1e45f83e27a4dac745f3b9eff75977b3280e132c15d", + "0x91e9fe78cdac578f4a4687f71b800b35da54b824b1886dafec073a3c977ce7a25038a2f3a5b1e35c2c8c9d1a7312417c", + "0xa42832173f9d9491c7bd93b21497fbfa4121687cd4d2ab572e80753d7edcbb42cfa49f460026fbde52f420786751a138", + "0x97b947126d84dcc70c97be3c04b3de3f239b1c4914342fa643b1a4bb8c4fe45c0fcb585700d13a7ed50784790c54bef9", + "0x860e407d353eac070e2418ef6cb80b96fc5f6661d6333e634f6f306779651588037be4c2419562c89c61f9aa2c4947f5", + "0xb2c9d93c3ba4e511b0560b55d3501bf28a510745fd666b3cb532db051e6a8617841ea2f071dda6c9f15619c7bfd2737f", + "0x8596f4d239aeeac78311207904d1bd863ef68e769629cc379db60e019aaf05a9d5cd31dc8e630b31e106a3a93e47cbc5", + "0x8b26e14e2e136b65c5e9e5c2022cee8c255834ea427552f780a6ca130a6446102f2a6f334c3f9a0308c53df09e3dba7e", + "0xb54724354eb515a3c8bed0d0677ff1db94ac0a07043459b4358cb90e3e1aa38ac23f2caa3072cf9647275d7cd61d0e80", + "0xb7ce9fe0e515e7a6b2d7ddcb92bc0196416ff04199326aea57996eef8c5b1548bd8569012210da317f7c0074691d01b7", + "0xa1a13549c82c877253ddefa36a29ea6a23695ee401fdd48e65f6f61e5ebd956d5e0edeff99484e9075cb35071fec41e2", + "0x838ba0c1e5bd1a6da05611ff1822b8622457ebd019cb065ece36a2d176bd2d889511328120b8a357e44569e7f640c1e6", + "0xb916eccff2a95519400bbf76b5f576cbe53cf200410370a19d77734dc04c05b585cfe382e8864e67142d548cd3c4c2f4", + "0xa610447cb7ca6eea53a6ff1f5fe562377dcb7f4aaa7300f755a4f5e8eba61e863c51dc2aa9a29b35525b550fbc32a0fe", + "0x9620e8f0f0ee9a4719aa9685eeb1049c5c77659ba6149ec4c158f999cfd09514794b23388879931fe26fea03fa471fd3", + "0xa9dcf8b679e276583cf5b9360702a185470d09aea463dc474ee9c8aee91ef089dacb073e334e47fbc78ec5417c90465c", + "0x8c9adee8410bdd99e5b285744cee61e2593b6300ff31a8a83b0ec28da59475a5c6fb9346fe43aadea2e6c3dad2a8e30a", + "0x97d5afe9b3897d7b8bb628b7220cf02d8ee4e9d0b78f5000d500aaf4c1df9251aaaabfd1601626519f9d66f00a821d4e", + "0x8a382418157b601ce4c3501d3b8409ca98136a4ef6abcbf62885e16e215b76b035c94d149cc41ff92e42ccd7c43b9b3d", + "0xb64b8d11fb3b01abb2646ac99fdb9c02b804ce15d98f9fe0fbf1c9df8440c71417487feb6cdf51e3e81d37104b19e012", + "0x849d7d044f9d8f0aab346a9374f0b3a5d14a9d1faa83dbacccbdc629ad1ef903a990940255564770537f8567521d17f0", + "0x829dbb0c76b996c2a91b4cbbe93ba455ca0d5729755e5f0c92aaee37dff7f36fcdc06f33aca41f1b609c784127b67d88", + "0x85a7c0069047b978422d264d831ab816435f63938015d2e977222b6b5746066c0071b7f89267027f8a975206ed25c1b0", + "0x84b9fbc1cfb302df1acdcf3dc5d66fd1edfe7839f7a3b2fb3a0d5548656249dd556104d7c32b73967bccf0f5bdcf9e3b", + "0x972220ac5b807f53eac37dccfc2ad355d8b21ea6a9c9b011c09fe440ddcdf7513e0b43d7692c09ded80d7040e26aa28f", + "0x855885ed0b21350baeca890811f344c553cf9c21024649c722453138ba29193c6b02c4b4994cd414035486f923472e28", + "0x841874783ae6d9d0e59daea03e96a01cbbe4ecaced91ae4f2c8386e0d87b3128e6d893c98d17c59e4de1098e1ad519dd", + "0x827e50fc9ce56f97a4c3f2f4cbaf0b22f1c3ce6f844ff0ef93a9c57a09b8bf91ebfbd2ba9c7f83c442920bffdaf288cc", + "0xa441f9136c7aa4c08d5b3534921b730e41ee91ab506313e1ba5f7c6f19fd2d2e1594e88c219834e92e6fb95356385aa7", + "0x97d75b144471bf580099dd6842b823ec0e6c1fb86dd0da0db195e65524129ea8b6fd4a7a9bbf37146269e938a6956596", + "0xa4b6fa87f09d5a29252efb2b3aaab6b3b6ea9fab343132a651630206254a25378e3e9d6c96c3d14c150d01817d375a8e", + "0xa31a671876d5d1e95fe2b8858dc69967231190880529d57d3cab7f9f4a2b9b458ac9ee5bdaa3289158141bf18f559efb", + "0x90bee6fff4338ba825974021b3b2a84e36d617e53857321f13d2b3d4a28954e6de3b3c0e629d61823d18a9763313b3bf", + "0x96b622a63153f393bb419bfcf88272ea8b3560dbd46b0aa07ada3a6223990d0abdd6c2adb356ef4be5641688c8d83941", + "0x84c202adeaff9293698022bc0381adba2cd959f9a35a4e8472288fd68f96f6de8be9da314c526d88e291c96b1f3d6db9", + "0x8ca01a143b8d13809e5a8024d03e6bc9492e22226073ef6e327edf1328ef4aff82d0bcccee92cb8e212831fa35fe1204", + "0xb2f970dbad15bfbefb38903c9bcc043d1367055c55dc1100a850f5eb816a4252c8c194b3132c929105511e14ea10a67d", + "0xa5e36556472a95ad57eb90c3b6623671b03eafd842238f01a081997ffc6e2401f76e781d049bb4aa94d899313577a9cf", + "0x8d1057071051772f7c8bedce53a862af6fd530dd56ae6321eaf2b9fc6a68beff5ed745e1c429ad09d5a118650bfd420a", + "0x8aadc4f70ace4fcb8d93a78610779748dcffc36182d45b932c226dc90e48238ea5daa91f137c65ed532352c4c4d57416", + "0xa2ea05ae37e673b4343232ae685ee14e6b88b867aef6dfac35db3589cbcd76f99540fed5c2641d5bb5a4a9f808e9bf0d", + "0x947f1abad982d65648ae4978e094332b4ecb90f482c9be5741d5d1cf5a28acf4680f1977bf6e49dd2174c37f11e01296", + "0xa27b144f1565e4047ba0e3f4840ef19b5095d1e281eaa463c5358f932114cbd018aa6dcf97546465cf2946d014d8e6d6", + "0x8574e1fc3acade47cd4539df578ce9205e745e161b91e59e4d088711a7ab5aa3b410d517d7304b92109924d9e2af8895", + "0xa48ee6b86b88015d6f0d282c1ae01d2a5b9e8c7aa3d0c18b35943dceb1af580d08a65f54dc6903cde82fd0d73ce94722", + "0x8875650cec543a7bf02ea4f2848a61d167a66c91ffaefe31a9e38dc8511c6a25bde431007eefe27a62af3655aca208dc", + "0x999b0a6e040372e61937bf0d68374e230346b654b5a0f591a59d33a4f95bdb2f3581db7c7ccb420cd7699ed709c50713", + "0x878c9e56c7100c5e47bbe77dc8da5c5fe706cec94d37fa729633bca63cace7c40102eee780fcdabb655f5fa47a99600e", + "0x865006fb5b475ada5e935f27b96f9425fc2d5449a3c106aa366e55ebed3b4ee42adc3c3f0ac19fd129b40bc7d6bc4f63", + "0xb7a7da847f1202e7bc1672553e68904715e84fd897d529243e3ecda59faa4e17ba99c649a802d53f6b8dfdd51f01fb74", + "0x8b2fb4432c05653303d8c8436473682933a5cb604da10c118ecfcd2c8a0e3132e125afef562bdbcc3df936164e5ce4f2", + "0x808d95762d33ddfa5d0ee3d7d9f327de21a994d681a5f372e2e3632963ea974da7f1f9e5bac8ccce24293509d1f54d27", + "0x932946532e3c397990a1df0e94c90e1e45133e347a39b6714c695be21aeb2d309504cb6b1dde7228ff6f6353f73e1ca2", + "0x9705e7c93f0cdfaa3fa96821f830fe53402ad0806036cd1b48adc2f022d8e781c1fbdab60215ce85c653203d98426da3", + "0xaa180819531c3ec1feb829d789cb2092964c069974ae4faad60e04a6afcce5c3a59aec9f11291e6d110a788d22532bc6", + "0x88f755097f7e25cb7dd3c449520c89b83ae9e119778efabb54fbd5c5714b6f37c5f9e0346c58c6ab09c1aef2483f895d", + "0x99fc03ab7810e94104c494f7e40b900f475fde65bdec853e60807ffd3f531d74de43335c3b2646b5b8c26804a7448898", + "0xaf2dea9683086bed1a179110efb227c9c00e76cd00a2015b089ccbcee46d1134aa18bda5d6cab6f82ae4c5cd2461ac21", + "0xa500f87ba9744787fdbb8e750702a3fd229de6b8817594348dec9a723b3c4240ddfa066262d002844b9e38240ce55658", + "0x924d0e45c780f5bc1c1f35d15dfc3da28036bdb59e4c5440606750ecc991b85be18bc9a240b6c983bc5430baa4c68287", + "0x865b11e0157b8bf4c5f336024b016a0162fc093069d44ac494723f56648bc4ded13dfb3896e924959ea11c96321afefc", + "0x93672d8607d4143a8f7894f1dcca83fb84906dc8d6dd7dd063bb0049cfc20c1efd933e06ca7bd03ea4cb5a5037990bfe", + "0x826891efbdff0360446825a61cd1fa04326dd90dae8c33dfb1ed97b045e165766dd070bd7105560994d0b2044bdea418", + "0x93c4a4a8bcbc8b190485cc3bc04175b7c0ed002c28c98a540919effd6ed908e540e6594f6db95cd65823017258fb3b1c", + "0xaeb2a0af2d2239fda9aa6b8234b019708e8f792834ff0dd9c487fa09d29800ddceddd6d7929faa9a3edcb9e1b3aa0d6b", + "0x87f11de7236d387863ec660d2b04db9ac08143a9a2c4dfff87727c95b4b1477e3bc473a91e5797313c58754905079643", + "0x80dc1db20067a844fe8baceca77f80db171a5ca967acb24e2d480eae9ceb91a3343c31ad1c95b721f390829084f0eae6", + "0x9825c31f1c18da0de3fa84399c8b40f8002c3cae211fb6a0623c76b097b4d39f5c50058f57a16362f7a575909d0a44a2", + "0xa99fc8de0c38dbf7b9e946de83943a6b46a762167bafe2a603fb9b86f094da30d6de7ed55d639aafc91936923ee414b3", + "0xad594678b407db5d6ea2e90528121f84f2b96a4113a252a30d359a721429857c204c1c1c4ff71d8bb5768c833f82e80e", + "0xb33d985e847b54510b9b007e31053732c8a495e43be158bd2ffcea25c6765bcbc7ca815f7c60b36ad088b955dd6e9350", + "0x815f8dfc6f90b3342ca3fbd968c67f324dae8f74245cbf8bc3bef10e9440c65d3a2151f951e8d18959ba01c1b50b0ec1", + "0x94c608a362dd732a1abc56e338637c900d59013db8668e49398b3c7a0cae3f7e2f1d1bf94c0299eeafe6af7f76c88618", + "0x8ebd8446b23e5adfcc393adc5c52fe172f030a73e63cd2d515245ca0dd02782ceed5bcdd9ccd9c1b4c5953dfac9c340c", + "0x820437f3f6f9ad0f5d7502815b221b83755eb8dc56cd92c29e9535eb0b48fb8d08c9e4fcc26945f9c8cca60d89c44710", + "0x8910e4e8a56bf4be9cc3bbf0bf6b1182a2f48837a2ed3c2aaec7099bfd7f0c83e14e608876b17893a98021ff4ab2f20d", + "0x9633918fde348573eec15ce0ad53ac7e1823aac86429710a376ad661002ae6d049ded879383faaa139435122f64047c6", + "0xa1f5e3fa558a9e89318ca87978492f0fb4f6e54a9735c1b8d2ecfb1d1c57194ded6e0dd82d077b2d54251f3bee1279e1", + "0xb208e22d04896abfd515a95c429ff318e87ff81a5d534c8ac2c33c052d6ffb73ef1dccd39c0bbe0734b596c384014766", + "0x986d5d7d2b5bde6d16336f378bd13d0e671ad23a8ec8a10b3fc09036faeeb069f60662138d7a6df3dfb8e0d36180f770", + "0xa2d4e6c5f5569e9cef1cddb569515d4b6ace38c8aed594f06da7434ba6b24477392cc67ba867c2b079545ca0c625c457", + "0xb5ac32b1d231957d91c8b7fc43115ce3c5c0d8c13ca633374402fa8000b6d9fb19499f9181844f0c10b47357f3f757ce", + "0x96b8bf2504b4d28fa34a4ec378e0e0b684890c5f44b7a6bb6e19d7b3db2ab27b1e2686389d1de9fbd981962833a313ea", + "0x953bfd7f6c3a0469ad432072b9679a25486f5f4828092401eff494cfb46656c958641a4e6d0d97d400bc59d92dba0030", + "0x876ab3cea7484bbfd0db621ec085b9ac885d94ab55c4bb671168d82b92e609754b86aaf472c55df3d81421d768fd108a", + "0x885ff4e67d9ece646d02dd425aa5a087e485c3f280c3471b77532b0db6145b69b0fbefb18aa2e3fa5b64928b43a94e57", + "0xb91931d93f806d0b0e6cc62a53c718c099526140f50f45d94b8bbb57d71e78647e06ee7b42aa5714aed9a5c05ac8533f", + "0xa0313eeadd39c720c9c27b3d671215331ab8d0a794e71e7e690f06bcd87722b531d6525060c358f35f5705dbb7109ccb", + "0x874c0944b7fedc6701e53344100612ddcb495351e29305c00ec40a7276ea5455465ffb7bded898886c1853139dfb1fc7", + "0x8dc31701a01ee8137059ca1874a015130d3024823c0576aa9243e6942ec99d377e7715ed1444cd9b750a64b85dcaa3e5", + "0x836d2a757405e922ec9a2dfdcf489a58bd48b5f9683dd46bf6047688f778c8dee9bc456de806f70464df0b25f3f3d238", + "0xb30b0a1e454a503ea3e2efdec7483eaf20b0a5c3cefc42069e891952b35d4b2c955cf615f3066285ed8fafd9fcfbb8f6", + "0x8e6d4044b55ab747e83ec8762ea86845f1785cc7be0279c075dadf08aca3ccc5a096c015bb3c3f738f647a4eadea3ba5", + "0xad7735d16ab03cbe09c029610aa625133a6daecfc990b297205b6da98eda8c136a7c50db90f426d35069708510d5ae9c", + "0x8d62d858bbb59ec3c8cc9acda002e08addab4d3ad143b3812098f3d9087a1b4a1bb255dcb1635da2402487d8d0249161", + "0x805beec33238b832e8530645a3254aeef957e8f7ea24bcfc1054f8b9c69421145ebb8f9d893237e8a001c857fedfc77e", + "0xb1005644be4b085e3f5775aa9bd3e09a283e87ddada3082c04e7a62d303dcef3b8cf8f92944c200c7ae6bb6bdf63f832", + "0xb4ba0e0790dc29063e577474ffe3b61f5ea2508169f5adc1e394934ebb473e356239413a17962bc3e5d3762d72cce8c2", + "0xa157ba9169c9e3e6748d9f1dd67fbe08b9114ade4c5d8fc475f87a764fb7e6f1d21f66d7905cd730f28a1c2d8378682a", + "0x913e52b5c93989b5d15e0d91aa0f19f78d592bc28bcfdfddc885a9980c732b1f4debb8166a7c4083c42aeda93a702898", + "0x90fbfc1567e7cd4e096a38433704d3f96a2de2f6ed3371515ccc30bc4dd0721a704487d25a97f3c3d7e4344472702d8d", + "0x89646043028ffee4b69d346907586fd12c2c0730f024acb1481abea478e61031966e72072ff1d5e65cb8c64a69ad4eb1", + "0xb125a45e86117ee11d2fb42f680ab4a7894edd67ff927ae2c808920c66c3e55f6a9d4588eee906f33a05d592e5ec3c04", + "0xaad47f5b41eae9be55fb4f67674ff1e4ae2482897676f964a4d2dcb6982252ee4ff56aac49578b23f72d1fced707525e", + "0xb9ddff8986145e33851b4de54d3e81faa3352e8385895f357734085a1616ef61c692d925fe62a5ed3be8ca49f5d66306", + "0xb3cb0963387ed28c0c0adf7fe645f02606e6e1780a24d6cecef5b7c642499109974c81a7c2a198b19862eedcea2c2d8c", + "0xac9c53c885457aaf5cb36c717a6f4077af701e0098eebd7aa600f5e4b14e6c1067255b3a0bc40e4a552025231be7de60", + "0x8e1a8d823c4603f6648ec21d064101094f2a762a4ed37dd2f0a2d9aa97b2d850ce1e76f4a4b8cae58819b058180f7031", + "0xb268b73bf7a179b6d22bd37e5e8cb514e9f5f8968c78e14e4f6d5700ca0d0ca5081d0344bb73b028970eebde3cb4124e", + "0xa7f57d71940f0edbd29ed8473d0149cae71d921dd15d1ff589774003e816b54b24de2620871108cec1ab9fa956ad6ce6", + "0x8053e6416c8b120e2b999cc2fc420a6a55094c61ac7f2a6c6f0a2c108a320890e389af96cbe378936132363c0d551277", + "0xb3823f4511125e5aa0f4269e991b435a0d6ceb523ebd91c04d7add5534e3df5fc951c504b4fd412a309fd3726b7f940b", + "0xae6eb04674d04e982ca9a6add30370ab90e303c71486f43ed3efbe431af1b0e43e9d06c11c3412651f304c473e7dbf39", + "0x96ab55e641ed2e677591f7379a3cd126449614181fce403e93e89b1645d82c4af524381ff986cae7f9cebe676878646d", + "0xb52423b4a8c37d3c3e2eca8f0ddbf7abe0938855f33a0af50f117fab26415fb0a3da5405908ec5fdc22a2c1f2ca64892", + "0x82a69ce1ee92a09cc709d0e3cd22116c9f69d28ea507fe5901f5676000b5179b9abe4c1875d052b0dd42d39925e186bb", + "0xa84c8cb84b9d5cfb69a5414f0a5283a5f2e90739e9362a1e8c784b96381b59ac6c18723a4aa45988ee8ef5c1f45cc97d", + "0xafd7efce6b36813082eb98257aae22a4c1ae97d51cac7ea9c852d4a66d05ef2732116137d8432e3f117119725a817d24", + "0xa0f5fe25af3ce021b706fcff05f3d825384a272284d04735574ce5fb256bf27100fad0b1f1ba0e54ae9dcbb9570ecad3", + "0x8751786cb80e2e1ff819fc7fa31c2833d25086534eb12b373d31f826382430acfd87023d2a688c65b5e983927e146336", + "0x8cf5c4b17fa4f3d35c78ce41e1dc86988fd1135cd5e6b2bb0c108ee13538d0d09ae7102609c6070f39f937b439b31e33", + "0xa9108967a2fedd7c322711eca8159c533dd561bedcb181b646de98bf5c3079449478eab579731bee8d215ae8852c7e21", + "0xb54c5171704f42a6f0f4e70767cdb3d96ffc4888c842eece343a01557da405961d53ffdc34d2f902ea25d3e1ed867cad", + "0xae8d4b764a7a25330ba205bf77e9f46182cd60f94a336bbd96773cf8064e3d39caf04c310680943dc89ed1fbad2c6e0d", + "0xaa5150e911a8e1346868e1b71c5a01e2a4bb8632c195861fb6c3038a0e9b85f0e09b3822e9283654a4d7bb17db2fc5f4", + "0x9685d3756ce9069bf8bb716cf7d5063ebfafe37e15b137fc8c3159633c4e006ff4887ddd0ae90360767a25c3f90cba7f", + "0x82155fd70f107ab3c8e414eadf226c797e07b65911508c76c554445422325e71af8c9a8e77fd52d94412a6fc29417cd3", + "0xabfae52f53a4b6e00760468d973a267f29321997c3dbb5aee36dc1f20619551229c0c45b9d9749f410e7f531b73378e8", + "0x81a76d921f8ef88e774fd985e786a4a330d779b93fad7def718c014685ca0247379e2e2a007ad63ee7f729cd9ed6ce1b", + "0x81947c84bc5e28e26e2e533af5ae8fe10407a7b77436dbf8f1d5b0bbe86fc659eae10f974659dc7c826c6dabd03e3a4b", + "0x92b8c07050d635b8dd4fd09df9054efe4edae6b86a63c292e73cc819a12a21dd7d104ce51fa56af6539dedf6dbe6f7b6", + "0xb44c579e3881f32b32d20c82c207307eca08e44995dd2aac3b2692d2c8eb2a325626c80ac81c26eeb38c4137ff95add5", + "0x97efab8941c90c30860926dea69a841f2dcd02980bf5413b9fd78d85904588bf0c1021798dbc16c8bbb32cce66c82621", + "0x913363012528b50698e904de0588bf55c8ec5cf6f0367cfd42095c4468fcc64954fbf784508073e542fee242d0743867", + "0x8ed203cf215148296454012bd10fddaf119203db1919a7b3d2cdc9f80e66729464fdfae42f1f2fc5af1ed53a42b40024", + "0xab84312db7b87d711e9a60824f4fe50e7a6190bf92e1628688dfcb38930fe87b2d53f9e14dd4de509b2216856d8d9188", + "0x880726def069c160278b12d2258eac8fa63f729cd351a710d28b7e601c6712903c3ac1e7bbd0d21e4a15f13ca49db5aa", + "0x980699cd51bac6283959765f5174e543ed1e5f5584b5127980cbc2ef18d984ecabba45042c6773b447b8e694db066028", + "0xaeb019cb80dc4cb4207430d0f2cd24c9888998b6f21d9bf286cc638449668d2eec0018a4cf3fe6448673cd6729335e2b", + "0xb29852f6aa6c60effdffe96ae88590c88abae732561d35cc19e82d3a51e26cb35ea00986193e07f90060756240f5346e", + "0xa0fa855adc5ba469f35800c48414b8921455950a5c0a49945d1ef6e8f2a1881f2e2dfae47de6417270a6bf49deeb091d", + "0xb6c7332e3b14813641e7272d4f69ecc7e09081df0037d6dab97ce13a9e58510f5c930d300633f208181d9205c5534001", + "0x85a6c050f42fce560b5a8d54a11c3bbb8407abbadd859647a7b0c21c4b579ec65671098b74f10a16245dc779dff7838e", + "0x8f3eb34bb68759d53c6677de4de78a6c24dd32c8962a7fb355ed362572ef8253733e6b52bc21c9f92ecd875020a9b8de", + "0xa17dd44181e5dab4dbc128e1af93ec22624b57a448ca65d2d9e246797e4af7d079e09c6e0dfb62db3a9957ce92f098d5", + "0xa56a1b854c3183082543a8685bb34cae1289f86cfa8123a579049dbd059e77982886bfeb61bf6e05b4b1fe4e620932e7", + "0xaedae3033cb2fb7628cb4803435bdd7757370a86f808ae4cecb9a268ad0e875f308c048c80cbcac523de16b609683887", + "0x9344905376aa3982b1179497fac5a1d74b14b7038fd15e3b002db4c11c8bfc7c39430db492cdaf58b9c47996c9901f28", + "0xa3bfafdae011a19f030c749c3b071f83580dee97dd6f949e790366f95618ca9f828f1daaeabad6dcd664fcef81b6556d", + "0x81c03d8429129e7e04434dee2c529194ddb01b414feda3adee2271eb680f6c85ec872a55c9fa9d2096f517e13ed5abcc", + "0x98205ef3a72dff54c5a9c82d293c3e45d908946fa74bb749c3aabe1ab994ea93c269bcce1a266d2fe67a8f02133c5985", + "0x85a70aeed09fda24412fadbafbbbf5ba1e00ac92885df329e147bfafa97b57629a3582115b780d8549d07d19b7867715", + "0xb0fbe81c719f89a57d9ea3397705f898175808c5f75f8eb81c2193a0b555869ba7bd2e6bc54ee8a60cea11735e21c68c", + "0xb03a0bd160495ee626ff3a5c7d95bc79d7da7e5a96f6d10116600c8fa20bedd1132f5170f25a22371a34a2d763f2d6d0", + "0xa90ab04091fbca9f433b885e6c1d60ab45f6f1daf4b35ec22b09909d493a6aab65ce41a6f30c98239cbca27022f61a8b", + "0xb66f92aa3bf2549f9b60b86f99a0bd19cbdd97036d4ae71ca4b83d669607f275260a497208f6476cde1931d9712c2402", + "0xb08e1fdf20e6a9b0b4942f14fa339551c3175c1ffc5d0ab5b226b6e6a322e9eb0ba96adc5c8d59ca4259e2bdd04a7eb0", + "0xa2812231e92c1ce74d4f5ac3ab6698520288db6a38398bb38a914ac9326519580af17ae3e27cde26607e698294022c81", + "0xabfcbbcf1d3b9e84c02499003e490a1d5d9a2841a9e50c7babbef0b2dd20d7483371d4dc629ba07faf46db659459d296", + "0xb0fe9f98c3da70927c23f2975a9dc4789194d81932d2ad0f3b00843dd9cbd7fb60747a1da8fe5a79f136a601becf279d", + "0xb130a6dba7645165348cb90f023713bed0eefbd90a976b313521c60a36d34f02032e69a2bdcf5361e343ed46911297ec", + "0x862f0cffe3020cea7a5fd4703353aa1eb1be335e3b712b29d079ff9f7090d1d8b12013011e1bdcbaa80c44641fd37c9f", + "0x8c6f11123b26633e1abb9ed857e0bce845b2b3df91cc7b013b2fc77b477eee445da0285fc6fc793e29d5912977f40916", + "0x91381846126ea819d40f84d3005e9fb233dc80071d1f9bb07f102bf015f813f61e5884ffffb4f5cd333c1b1e38a05a58", + "0x8add7d908de6e1775adbd39c29a391f06692b936518db1f8fde74eb4f533fc510673a59afb86e3a9b52ade96e3004c57", + "0x8780e086a244a092206edcde625cafb87c9ab1f89cc3e0d378bc9ee776313836160960a82ec397bc3800c0a0ec3da283", + "0xa6cb4cd9481e22870fdd757fae0785edf4635e7aacb18072fe8dc5876d0bab53fb99ce40964a7d3e8bcfff6f0ab1332f", + "0xaf30ff47ecc5b543efba1ba4706921066ca8bb625f40e530fb668aea0551c7647a9d126e8aba282fbcce168c3e7e0130", + "0x91b0bcf408ce3c11555dcb80c4410b5bc2386d3c05caec0b653352377efdcb6bab4827f2018671fc8e4a0e90d772acc1", + "0xa9430b975ef138b6b2944c7baded8fe102d31da4cfe3bd3d8778bda79189c99d38176a19c848a19e2d1ee0bddd9a13c1", + "0xaa5a4eef849d7c9d2f4b018bd01271c1dd83f771de860c4261f385d3bdcc130218495860a1de298f14b703ec32fa235f", + "0xb0ce79e7f9ae57abe4ff366146c3b9bfb38b0dee09c28c28f5981a5d234c6810ad4d582751948affb480d6ae1c8c31c4", + "0xb75122748560f73d15c01a8907d36d06dc068e82ce22b84b322ac1f727034493572f7907dec34ebc3ddcc976f2f89ed7", + "0xb0fc7836369a3e4411d34792d6bd5617c14f61d9bba023dda64e89dc5fb0f423244e9b48ee64869258931daa9753a56f", + "0x8956d7455ae9009d70c6e4a0bcd7610e55f37494cf9897a8f9e1b904cc8febc3fd2d642ebd09025cfff4609ad7e3bc52", + "0xad741efe9e472026aa49ae3d9914cb9c1a6f37a54f1a6fe6419bebd8c7d68dca105a751c7859f4389505ede40a0de786", + "0xb52f418797d719f0d0d0ffb0846788b5cba5d0454a69a2925de4b0b80fa4dd7e8c445e5eac40afd92897ed28ca650566", + "0xa0ab65fb9d42dd966cd93b1de01d7c822694669dd2b7a0c04d99cd0f3c3de795f387b9c92da11353412f33af5c950e9a", + "0xa0052f44a31e5741a331f7cac515a08b3325666d388880162d9a7b97598fde8b61f9ff35ff220df224eb5c4e40ef0567", + "0xa0101cfdc94e42b2b976c0d89612a720e55d145a5ef6ef6f1f78cf6de084a49973d9b5d45915349c34ce712512191e3c", + "0xa0dd99fcf3f5cead5aaf08e82212df3a8bb543c407a4d6fab88dc5130c1769df3f147e934a46f291d6c1a55d92b86917", + "0xa5939153f0d1931bbda5cf6bdf20562519ea55fbfa978d6dbc6828d298260c0da7a50c37c34f386e59431301a96c2232", + "0x9568269f3f5257200f9ca44afe1174a5d3cf92950a7f553e50e279c239e156a9faaa2a67f288e3d5100b4142efe64856", + "0xb746b0832866c23288e07f24991bbf687cad794e7b794d3d3b79367566ca617d38af586cdc8d6f4a85a34835be41d54f", + "0xa871ce28e39ab467706e32fec1669fda5a4abba2f8c209c6745df9f7a0fa36bbf1919cf14cb89ea26fa214c4c907ae03", + "0xa08dacdd758e523cb8484f6bd070642c0c20e184abdf8e2a601f61507e93952d5b8b0c723c34fcbdd70a8485eec29db2", + "0x85bdb78d501382bb95f1166b8d032941005661aefd17a5ac32df9a3a18e9df2fc5dc2c1f07075f9641af10353cecc0c9", + "0x98d730c28f6fa692a389e97e368b58f4d95382fad8f0baa58e71a3d7baaea1988ead47b13742ce587456f083636fa98e", + "0xa557198c6f3d5382be9fb363feb02e2e243b0c3c61337b3f1801c4a0943f18e38ce1a1c36b5c289c8fa2aa9d58742bab", + "0x89174f79201742220ac689c403fc7b243eed4f8e3f2f8aba0bf183e6f5d4907cb55ade3e238e3623d9885f03155c4d2b", + "0xb891d600132a86709e06f3381158db300975f73ea4c1f7c100358e14e98c5fbe792a9af666b85c4e402707c3f2db321e", + "0xb9e5b2529ef1043278c939373fc0dbafe446def52ddd0a8edecd3e4b736de87e63e187df853c54c28d865de18a358bb6", + "0x8589b2e9770340c64679062c5badb7bbef68f55476289b19511a158a9a721f197da03ece3309e059fc4468b15ac33aa3", + "0xaad8c6cd01d785a881b446f06f1e9cd71bca74ba98674c2dcddc8af01c40aa7a6d469037498b5602e76e9c91a58d3dbd", + "0xabaccb1bd918a8465f1bf8dbe2c9ad4775c620b055550b949a399f30cf0d9eb909f3851f5b55e38f9e461e762f88f499", + "0xae62339d26db46e85f157c0151bd29916d5cc619bd4b832814b3fd2f00af8f38e7f0f09932ffe5bba692005dab2d9a74", + "0x93a6ff30a5c0edf8058c89aba8c3259e0f1b1be1b80e67682de651e5346f7e1b4b4ac3d87cbaebf198cf779524aff6bf", + "0x8980a2b1d8f574af45b459193c952400b10a86122b71fca2acb75ee0dbd492e7e1ef5b959baf609a5172115e371f3177", + "0x8c2f49f3666faee6940c75e8c7f6f8edc3f704cca7a858bbb7ee5e96bba3b0cf0993996f781ba6be3b0821ef4cb75039", + "0xb14b9e348215b278696018330f63c38db100b0542cfc5be11dc33046e3bca6a13034c4ae40d9cef9ea8b34fef0910c4e", + "0xb59bc3d0a30d66c16e6a411cb641f348cb1135186d5f69fda8b0a0934a5a2e7f6199095ba319ec87d3fe8f1ec4a06368", + "0x8874aca2a3767aa198e4c3fec2d9c62d496bc41ff71ce242e9e082b7f38cdf356089295f80a301a3cf1182bde5308c97", + "0xb1820ebd61376d91232423fc20bf008b2ba37e761199f4ef0648ea2bd70282766799b4de814846d2f4d516d525c8daa7", + "0xa6b202e5dedc16a4073e04a11af3a8509b23dfe5a1952f899adeb240e75c3f5bde0c424f811a81ea48d343591faffe46", + "0xa69becee9c93734805523b92150a59a62eed4934f66056b645728740d42223f2925a1ad38359ba644da24d9414f4cdda", + "0xad72f0f1305e37c7e6b48c272323ee883320994cb2e0d850905d6655fafc9f361389bcb9c66b3ff8d2051dbb58c8aa96", + "0xb563600bd56fad7c8853af21c6a02a16ed9d8a8bbeea2c31731d63b976d83cb05b9779372d898233e8fd597a75424797", + "0xb0abb78ce465bf7051f563c62e8be9c57a2cc997f47c82819300f36e301fefd908894bb2053a9d27ce2d0f8c46d88b5b", + "0xa071a85fb8274bac2202e0cb8e0e2028a5e138a82d6e0374d39ca1884a549c7c401312f00071b91f455c3a2afcfe0cda", + "0xb931c271513a0f267b9f41444a5650b1918100b8f1a64959c552aff4e2193cc1b9927906c6fa7b8a8c68ef13d79aaa52", + "0xa6a1bb9c7d32cb0ca44d8b75af7e40479fbce67d216b48a2bb680d3f3a772003a49d3cd675fc64e9e0f8fabeb86d6d61", + "0xb98d609858671543e1c3b8564162ad828808bb50ded261a9f8690ded5b665ed8368c58f947365ed6e84e5a12e27b423d", + "0xb3dca58cd69ec855e2701a1d66cad86717ff103ef862c490399c771ad28f675680f9500cb97be48de34bcdc1e4503ffd", + "0xb34867c6735d3c49865e246ddf6c3b33baf8e6f164db3406a64ebce4768cb46b0309635e11be985fee09ab7a31d81402", + "0xacb966c554188c5b266624208f31fab250b3aa197adbdd14aee5ab27d7fb886eb4350985c553b20fdf66d5d332bfd3fe", + "0x943c36a18223d6c870d54c3b051ef08d802b85e9dd6de37a51c932f90191890656c06adfa883c87b906557ae32d09da0", + "0x81bca7954d0b9b6c3d4528aadf83e4bc2ef9ea143d6209bc45ae9e7ae9787dbcd8333c41f12c0b6deee8dcb6805e826a", + "0xaba176b92256efb68f574e543479e5cf0376889fb48e3db4ebfb7cba91e4d9bcf19dcfec444c6622d9398f06de29e2b9", + "0xb9f743691448053216f6ece7cd699871fff4217a1409ceb8ab7bdf3312d11696d62c74b0664ba0a631b1e0237a8a0361", + "0xa383c2b6276fa9af346b21609326b53fb14fdf6f61676683076e80f375b603645f2051985706d0401e6fbed7eb0666b6", + "0xa9ef2f63ec6d9beb8f3d04e36807d84bda87bdd6b351a3e4a9bf7edcb5618c46c1f58cfbf89e64b40f550915c6988447", + "0xa141b2d7a82f5005eaea7ae7d112c6788b9b95121e5b70b7168d971812f3381de8b0082ac1f0a82c7d365922ebd2d26a", + "0xb1b76ef8120e66e1535c17038b75255a07849935d3128e3e99e56567b842fb1e8d56ef932d508d2fb18b82f7868fe1a9", + "0x8e2e234684c81f21099f5c54f6bbe2dd01e3b172623836c77668a0c49ce1fe218786c3827e4d9ae2ea25c50a8924fb3c", + "0xa5caf5ff948bfd3c4ca3ffbdfcd91eec83214a6c6017235f309a0bbf7061d3b0b466307c00b44a1009cf575163898b43", + "0x986415a82ca16ebb107b4c50b0c023c28714281db0bcdab589f6cb13d80e473a3034b7081b3c358e725833f6d845cb14", + "0xb94836bf406ac2cbacb10e6df5bcdfcc9d9124ae1062767ca4e322d287fd5e353fdcebd0e52407cb3cd68571258a8900", + "0x83c6d70a640b33087454a4788dfd9ef3ed00272da084a8d36be817296f71c086b23b576f98178ab8ca6a74f04524b46b", + "0xad4115182ad784cfe11bcfc5ce21fd56229cc2ce77ac82746e91a2f0aa53ca6593a22efd2dc4ed8d00f84542643d9c58", + "0xab1434c5e5065da826d10c2a2dba0facccab0e52b506ce0ce42fbe47ced5a741797151d9ecc99dc7d6373cfa1779bbf6", + "0x8a8b591d82358d55e6938f67ea87a89097ab5f5496f7260adb9f649abb289da12b498c5b2539c2f9614fb4e21b1f66b0", + "0x964f355d603264bc1f44c64d6d64debca66f37dff39c971d9fc924f2bc68e6c187b48564a6dc82660a98b035f8addb5d", + "0xb66235eaaf47456bc1dc4bde454a028e2ce494ece6b713a94cd6bf27cf18c717fd0c57a5681caaa2ad73a473593cdd7a", + "0x9103e3bb74304186fa4e3e355a02da77da4aca9b7e702982fc2082af67127ebb23a455098313c88465bc9b7d26820dd5", + "0xb6a42ff407c9dd132670cdb83cbad4b20871716e44133b59a932cd1c3f97c7ac8ff7f61acfaf8628372508d8dc8cad7c", + "0x883a9c21c16a167a4171b0f084565c13b6f28ba7c4977a0de69f0a25911f64099e7bbb4da8858f2e93068f4155d04e18", + "0x8dbb3220abc6a43220adf0331e3903d3bfd1d5213aadfbd8dfcdf4b2864ce2e96a71f35ecfb7a07c3bbabf0372b50271", + "0xb4ad08aee48e176bda390b7d9acf2f8d5eb008f30d20994707b757dc6a3974b2902d29cd9b4d85e032810ad25ac49e97", + "0x865bb0f33f7636ec501bb634e5b65751c8a230ae1fa807a961a8289bbf9c7fe8c59e01fbc4c04f8d59b7f539cf79ddd5", + "0x86a54d4c12ad1e3605b9f93d4a37082fd26e888d2329847d89afa7802e815f33f38185c5b7292293d788ad7d7da1df97", + "0xb26c8615c5e47691c9ff3deca3021714662d236c4d8401c5d27b50152ce7e566266b9d512d14eb63e65bc1d38a16f914", + "0x827639d5ce7db43ba40152c8a0eaad443af21dc92636cc8cc2b35f10647da7d475a1e408901cd220552fddad79db74df", + "0xa2b79a582191a85dbe22dc384c9ca3de345e69f6aa370aa6d3ff1e1c3de513e30b72df9555b15a46586bd27ea2854d9d", + "0xae0d74644aba9a49521d3e9553813bcb9e18f0b43515e4c74366e503c52f47236be92dfbd99c7285b3248c267b1de5a0", + "0x80fb0c116e0fd6822a04b9c25f456bdca704e2be7bdc5d141dbf5d1c5eeb0a2c4f5d80db583b03ef3e47517e4f9a1b10", + "0xac3a1fa3b4a2f30ea7e0a114cdc479eb51773573804c2a158d603ad9902ae8e39ffe95df09c0d871725a5d7f9ba71a57", + "0xb56b2b0d601cba7f817fa76102c68c2e518c6f20ff693aad3ff2e07d6c4c76203753f7f91686b1801e8c4659e4d45c48", + "0x89d50c1fc56e656fb9d3915964ebce703cb723fe411ab3c9eaa88ccc5d2b155a9b2e515363d9c600d3c0cee782c43f41", + "0xb24207e61462f6230f3cd8ccf6828357d03e725769f7d1de35099ef9ee4dca57dbce699bb49ed994462bee17059d25ce", + "0xb886f17fcbcbfcd08ac07f04bb9543ef58510189decaccea4b4158c9174a067cb67d14b6be3c934e6e2a18c77efa9c9c", + "0xb9c050ad9cafd41c6e2e192b70d080076eed59ed38ea19a12bd92fa17b5d8947d58d5546aaf5e8e27e1d3b5481a6ce51", + "0xaaf7a34d3267e3b1ddbc54c641e3922e89303f7c86ebebc7347ebca4cffad5b76117dac0cbae1a133053492799cd936f", + "0xa9ee604ada50adef82e29e893070649d2d4b7136cc24fa20e281ce1a07bd736bf0de7c420369676bcbcecff26fb6e900", + "0x9855315a12a4b4cf80ab90b8bd13003223ba25206e52fd4fe6a409232fbed938f30120a3db23eab9c53f308bd8b9db81", + "0x8cd488dd7a24f548a3cf03c54dec7ff61d0685cb0f6e5c46c2d728e3500d8c7bd6bba0156f4bf600466fda53e5b20444", + "0x890ad4942ebac8f5b16c777701ab80c68f56fa542002b0786f8fea0fb073154369920ac3dbfc07ea598b82f4985b8ced", + "0x8de0cf9ddc84c9b92c59b9b044387597799246b30b9f4d7626fc12c51f6e423e08ee4cbfe9289984983c1f9521c3e19d", + "0xb474dfb5b5f4231d7775b3c3a8744956b3f0c7a871d835d7e4fd9cc895222c7b868d6c6ce250de568a65851151fac860", + "0x86433b6135d9ed9b5ee8cb7a6c40e5c9d30a68774cec04988117302b8a02a11a71a1e03fd8e0264ef6611d219f103007", + "0x80b9ed4adbe9538fb1ef69dd44ec0ec5b57cbfea820054d8d445b4261962624b4c70ac330480594bc5168184378379c3", + "0x8b2e83562ccd23b7ad2d17f55b1ab7ef5fbef64b3a284e6725b800f3222b8bdf49937f4a873917ada9c4ddfb090938c2", + "0xabe78cebc0f5a45d754140d1f685e387489acbfa46d297a8592aaa0d676a470654f417a4f7d666fc0b2508fab37d908e", + "0xa9c5f8ff1f8568e252b06d10e1558326db9901840e6b3c26bbd0cd5e850cb5fb3af3f117dbb0f282740276f6fd84126f", + "0x975f8dc4fb55032a5df3b42b96c8c0ffecb75456f01d4aef66f973cb7270d4eff32c71520ceefc1adcf38d77b6b80c67", + "0xb043306ed2c3d8a5b9a056565afd8b5e354c8c4569fda66b0d797a50a3ce2c08cffbae9bbe292da69f39e89d5dc7911e", + "0x8d2afc36b1e44386ba350c14a6c1bb31ff6ea77128a0c5287584ac3584282d18516901ce402b4644a53db1ed8e7fa581", + "0x8c294058bed53d7290325c363fe243f6ec4f4ea2343692f4bac8f0cb86f115c069ccb8334b53d2e42c067691ad110dba", + "0xb92157b926751aaf7ef82c1aa8c654907dccab6376187ee8b3e8c0c82811eae01242832de953faa13ebaff7da8698b3e", + "0xa780c4bdd9e4ba57254b09d745075cecab87feda78c88ffee489625c5a3cf96aa6b3c9503a374a37927d9b78de9bd22b", + "0x811f548ef3a2e6a654f7dcb28ac9378de9515ed61e5a428515d9594a83e80b35c60f96a5cf743e6fab0d3cb526149f49", + "0x85a4dccf6d90ee8e094731eec53bd00b3887aec6bd81a0740efddf812fd35e3e4fe4f983afb49a8588691c202dabf942", + "0xb152c2da6f2e01c8913079ae2b40a09b1f361a80f5408a0237a8131b429677c3157295e11b365b1b1841924b9efb922e", + "0x849b9efee8742502ffd981c4517c88ed33e4dd518a330802caff168abae3cd09956a5ee5eda15900243bc2e829016b74", + "0x955a933f3c18ec0f1c0e38fa931e4427a5372c46a3906ebe95082bcf878c35246523c23f0266644ace1fa590ffa6d119", + "0x911989e9f43e580c886656377c6f856cdd4ff1bd001b6db3bbd86e590a821d34a5c6688a29b8d90f28680e9fdf03ba69", + "0xb73b8b4f1fd6049fb68d47cd96a18fcba3f716e0a1061aa5a2596302795354e0c39dea04d91d232aec86b0bf2ba10522", + "0x90f87456d9156e6a1f029a833bf3c7dbed98ca2f2f147a8564922c25ae197a55f7ea9b2ee1f81bf7383197c4bad2e20c", + "0x903cba8b1e088574cb04a05ca1899ab00d8960580c884bd3c8a4c98d680c2ad11410f2b75739d6050f91d7208cac33a5", + "0x9329987d42529c261bd15ecedd360be0ea8966e7838f32896522c965adfc4febf187db392bd441fb43bbd10c38fdf68b", + "0x8178ee93acf5353baa349285067b20e9bb41aa32d77b5aeb7384fe5220c1fe64a2461bd7a83142694fe673e8bbf61b7c", + "0xa06a8e53abcff271b1394bcc647440f81fb1c1a5f29c27a226e08f961c3353f4891620f2d59b9d1902bf2f5cc07a4553", + "0xaaf5fe493b337810889e777980e6bbea6cac39ac66bc0875c680c4208807ac866e9fda9b5952aa1d04539b9f4a4bec57", + "0xaa058abb1953eceac14ccfa7c0cc482a146e1232905dcecc86dd27f75575285f06bbae16a8c9fe8e35d8713717f5f19f", + "0x8f15dd732799c879ca46d2763453b359ff483ca33adb1d0e0a57262352e0476c235987dc3a8a243c74bc768f93d3014c", + "0xa61cc8263e9bc03cce985f1663b8a72928a607121005a301b28a278e9654727fd1b22bc8a949af73929c56d9d3d4a273", + "0x98d6dc78502d19eb9f921225475a6ebcc7b44f01a2df6f55ccf6908d65b27af1891be2a37735f0315b6e0f1576c1f8d8", + "0x8bd258b883f3b3793ec5be9472ad1ff3dc4b51bc5a58e9f944acfb927349ead8231a523cc2175c1f98e7e1e2b9f363b8", + "0xaeacc2ecb6e807ad09bedd99654b097a6f39840e932873ace02eabd64ccfbb475abdcb62939a698abf17572d2034c51e", + "0xb8ccf78c08ccd8df59fd6eda2e01de328bc6d8a65824d6f1fc0537654e9bc6bf6f89c422dd3a295cce628749da85c864", + "0x8f91fd8cb253ba2e71cc6f13da5e05f62c2c3b485c24f5d68397d04665673167fce1fc1aec6085c69e87e66ec555d3fd", + "0xa254baa10cb26d04136886073bb4c159af8a8532e3fd36b1e9c3a2e41b5b2b6a86c4ebc14dbe624ee07b7ccdaf59f9ab", + "0x94e3286fe5cd68c4c7b9a7d33ae3d714a7f265cf77cd0e9bc19fc51015b1d1c34ad7e3a5221c459e89f5a043ee84e3a9", + "0xa279da8878af8d449a9539bec4b17cea94f0242911f66fab275b5143ab040825f78c89cb32a793930609415cfa3a1078", + "0xac846ceb89c9e5d43a2991c8443079dc32298cd63e370e64149cec98cf48a6351c09c856f2632fd2f2b3d685a18bbf8b", + "0xa847b27995c8a2e2454aaeb983879fb5d3a23105c33175839f7300b7e1e8ec3efd6450e9fa3f10323609dee7b98c6fd5", + "0xa2f432d147d904d185ff4b2de8c6b82fbea278a2956bc406855b44c18041854c4f0ecccd472d1d0dff1d8aa8e281cb1d", + "0x94a48ad40326f95bd63dff4755f863a1b79e1df771a1173b17937f9baba57b39e651e7695be9f66a472f098b339364fc", + "0xa12a0ccd8f96e96e1bc6494341f7ebce959899341b3a084aa1aa87d1c0d489ac908552b7770b887bb47e7b8cbc3d8e66", + "0x81a1f1681bda923bd274bfe0fbb9181d6d164fe738e54e25e8d4849193d311e2c4253614ed673c98af2c798f19a93468", + "0xabf71106a05d501e84cc54610d349d7d5eae21a70bd0250f1bebbf412a130414d1c8dbe673ffdb80208fd72f1defa4d4", + "0x96266dc2e0df18d8136d79f5b59e489978eee0e6b04926687fe389d4293c14f36f055c550657a8e27be4118b64254901", + "0x8df5dcbefbfb4810ae3a413ca6b4bf08619ca53cd50eb1dde2a1c035efffc7b7ac7dff18d403253fd80104bd83dc029e", + "0x9610b87ff02e391a43324a7122736876d5b3af2a137d749c52f75d07b17f19900b151b7f439d564f4529e77aa057ad12", + "0xa90a5572198b40fe2fcf47c422274ff36c9624df7db7a89c0eb47eb48a73a03c985f4ac5016161c76ca317f64339bce1", + "0x98e5e61a6ab6462ba692124dba7794b6c6bde4249ab4fcc98c9edd631592d5bc2fb5e38466691a0970a38e48d87c2e43", + "0x918cefb8f292f78d4db81462c633daf73b395e772f47b3a7d2cea598025b1d8c3ec0cbff46cdb23597e74929981cde40", + "0xa98918a5dc7cf610fe55f725e4fd24ce581d594cb957bb9b4e888672e9c0137003e1041f83e3f1d7b9caab06462c87d4", + "0xb92b74ac015262ca66c33f2d950221e19d940ba3bf4cf17845f961dc1729ae227aa9e1f2017829f2135b489064565c29", + "0xa053ee339f359665feb178b4e7ee30a85df37debd17cacc5a27d6b3369d170b0114e67ad1712ed26d828f1df641bcd99", + "0x8c3c8bad510b35da5ce5bd84b35c958797fbea024ad1c97091d2ff71d9b962e9222f65a9b776e5b3cc29c36e1063d2ee", + "0xaf99dc7330fe7c37e850283eb47cc3257888e7c197cb0d102edf94439e1e02267b6a56306d246c326c4c79f9dc8c6986", + "0xafecb2dc34d57a725efbd7eb93d61eb29dbe8409b668ab9ea040791f5b796d9be6d4fc10d7f627bf693452f330cf0435", + "0x93334fedf19a3727a81a6b6f2459db859186227b96fe7a391263f69f1a0884e4235de64d29edebc7b99c44d19e7c7d7a", + "0x89579c51ac405ad7e9df13c904061670ce4b38372492764170e4d3d667ed52e5d15c7cd5c5991bbfa3a5e4e3fa16363e", + "0x9778f3e8639030f7ef1c344014f124e375acb8045bd13d8e97a92c5265c52de9d1ffebaa5bc3e1ad2719da0083222991", + "0x88f77f34ee92b3d36791bdf3326532524a67d544297dcf1a47ff00b47c1b8219ff11e34034eab7d23b507caa2fd3c6b9", + "0xa699c1e654e7c484431d81d90657892efeb4adcf72c43618e71ca7bd7c7a7ebbb1db7e06e75b75dc4c74efd306b5df3f", + "0x81d13153baebb2ef672b5bdb069d3cd669ce0be96b742c94e04038f689ff92a61376341366b286eee6bf3ae85156f694", + "0x81efb17de94400fdacc1deec2550cbe3eecb27c7af99d8207e2f9be397e26be24a40446d2a09536bb5172c28959318d9", + "0x989b21ebe9ceab02488992673dc071d4d5edec24bff0e17a4306c8cb4b3c83df53a2063d1827edd8ed16d6e837f0d222", + "0x8d6005d6536825661b13c5fdce177cb37c04e8b109b7eb2b6d82ea1cb70efecf6a0022b64f84d753d165edc2bba784a3", + "0xa32607360a71d5e34af2271211652d73d7756d393161f4cf0da000c2d66a84c6826e09e759bd787d4fd0305e2439d342", + "0xaaad8d6f6e260db45d51b2da723be6fa832e76f5fbcb77a9a31e7f090dd38446d3b631b96230d78208cae408c288ac4e", + "0xabcfe425255fd3c5cffd3a818af7650190c957b6b07b632443f9e33e970a8a4c3bf79ac9b71f4d45f238a04d1c049857", + "0xaeabf026d4c783adc4414b5923dbd0be4b039cc7201219f7260d321f55e9a5b166d7b5875af6129c034d0108fdc5d666", + "0xaf49e740c752d7b6f17048014851f437ffd17413c59797e5078eaaa36f73f0017c3e7da020310cfe7d3c85f94a99f203", + "0x8854ca600d842566e3090040cd66bb0b3c46dae6962a13946f0024c4a8aca447e2ccf6f240045f1ceee799a88cb9210c", + "0xb6c03b93b1ab1b88ded8edfa1b487a1ed8bdce8535244dddb558ffb78f89b1c74058f80f4db2320ad060d0c2a9c351cc", + "0xb5bd7d17372faff4898a7517009b61a7c8f6f0e7ed4192c555db264618e3f6e57fb30a472d169fea01bf2bf0362a19a8", + "0x96eb1d38319dc74afe7e7eb076fcd230d19983f645abd14a71e6103545c01301b31c47ae931e025f3ecc01fb3d2f31fa", + "0xb55a8d30d4403067def9b65e16f867299f8f64c9b391d0846d4780bc196569622e7e5b64ce799b5aefac8f965b2a7a7b", + "0x8356d199a991e5cbbff608752b6291731b6b6771aed292f8948b1f41c6543e4ab1bedc82dd26d10206c907c03508df06", + "0x97f4137445c2d98b0d1d478049de952610ad698c91c9d0f0e7227d2aae690e9935e914ec4a2ea1fbf3fc1dddfeeacebb", + "0xaf5621707e0938320b15ddfc87584ab325fbdfd85c30efea36f8f9bd0707d7ec12c344eff3ec21761189518d192df035", + "0x8ac7817e71ea0825b292687928e349da7140285d035e1e1abff0c3704fa8453faaae343a441b7143a74ec56539687cc4", + "0x8a5e0a9e4758449489df10f3386029ada828d1762e4fb0a8ffe6b79e5b6d5d713cb64ed95960e126398b0cdb89002bc9", + "0x81324be4a71208bbb9bca74b77177f8f1abb9d3d5d9db195d1854651f2cf333cd618d35400da0f060f3e1b025124e4b2", + "0x849971d9d095ae067525b3cbc4a7dfae81f739537ade6d6cec1b42fb692d923176197a8770907c58069754b8882822d6", + "0x89f830825416802477cc81fdf11084885865ee6607aa15aa4eb28e351c569c49b8a1b9b5e95ddc04fa0ebafe20071313", + "0x9240aeeaff37a91af55f860b9badd466e8243af9e8c96a7aa8cf348cd270685ab6301bc135b246dca9eda696f8b0e350", + "0xacf74db78cc33138273127599eba35b0fb4e7b9a69fe02dae18fc6692d748ca332bd00b22afa8e654ed587aab11833f3", + "0xb091e6d37b157b50d76bd297ad752220cd5c9390fac16dc838f8557aed6d9833fc920b61519df21265406216315e883f", + "0xa6446c429ebf1c7793c622250e23594c836b2fbcaf6c5b3d0995e1595a37f50ea643f3e549b0be8bbdadd69044d72ab9", + "0x93e675353bd60e996bf1c914d5267eeaa8a52fc3077987ccc796710ef9becc6b7a00e3d82671a6bdfb8145ee3c80245a", + "0xa2f731e43251d04ed3364aa2f072d05355f299626f2d71a8a38b6f76cf08c544133f7d72dd0ab4162814b674b9fc7fa6", + "0x97a8b791a5a8f6e1d0de192d78615d73d0c38f1e557e4e15d15adc663d649e655bc8da3bcc499ef70112eafe7fb45c7a", + "0x98cd624cbbd6c53a94469be4643c13130916b91143425bcb7d7028adbbfede38eff7a21092af43b12d4fab703c116359", + "0x995783ce38fd5f6f9433027f122d4cf1e1ff3caf2d196ce591877f4a544ce9113ead60de2de1827eaff4dd31a20d79a8", + "0x8cf251d6f5229183b7f3fe2f607a90b4e4b6f020fb4ba2459d28eb8872426e7be8761a93d5413640a661d73e34a5b81f", + "0xb9232d99620652a3aa7880cad0876f153ff881c4ed4c0c2e7b4ea81d5d42b70daf1a56b869d752c3743c6d4c947e6641", + "0x849716f938f9d37250cccb1bf77f5f9fde53096cdfc6f2a25536a6187029a8f1331cdbed08909184b201f8d9f04b792f", + "0x80c7c4de098cbf9c6d17b14eba1805e433b5bc905f6096f8f63d34b94734f2e4ebf4bce8a177efd1186842a61204a062", + "0xb790f410cf06b9b8daadceeb4fd5ff40a2deda820c8df2537e0a7554613ae3948e149504e3e79aa84889df50c8678eeb", + "0x813aab8bd000299cd37485b73cd7cba06e205f8efb87f1efc0bae8b70f6db2bc7702eb39510ad734854fb65515fe9d0f", + "0x94f0ab7388ac71cdb67f6b85dfd5945748afb2e5abb622f0b5ad104be1d4d0062b651f134ba22385c9e32c2dfdcccce1", + "0xab6223dca8bd6a4f969e21ccd9f8106fc5251d321f9e90cc42cea2424b3a9c4e5060a47eeef6b23c7976109b548498e8", + "0x859c56b71343fce4d5c5b87814c47bf55d581c50fd1871a17e77b5e1742f5af639d0e94d19d909ec7dfe27919e954e0c", + "0xaae0d632b6191b8ad71b027791735f1578e1b89890b6c22e37de0e4a6074886126988fe8319ae228ac9ef3b3bcccb730", + "0x8ca9f32a27a024c3d595ecfaf96b0461de57befa3b331ab71dc110ec3be5824fed783d9516597537683e77a11d334338", + "0xa061df379fb3f4b24816c9f6cd8a94ecb89b4c6dc6cd81e4b8096fa9784b7f97ab3540259d1de9c02eb91d9945af4823", + "0x998603102ac63001d63eb7347a4bb2bf4cf33b28079bb48a169076a65c20d511ccd3ef696d159e54cc8e772fb5d65d50", + "0x94444d96d39450872ac69e44088c252c71f46be8333a608a475147752dbb99db0e36acfc5198f158509401959c12b709", + "0xac1b51b6c09fe055c1d7c9176eea9adc33f710818c83a1fbfa073c8dc3a7eb3513cbdd3f5960b7845e31e3e83181e6ba", + "0x803d530523fc9e1e0f11040d2412d02baef3f07eeb9b177fa9bfa396af42eea898a4276d56e1db998dc96ae47b644cb2", + "0x85a3c9fc7638f5bf2c3e15ba8c2fa1ae87eb1ceb44c6598c67a2948667a9dfa41e61f66d535b4e7fda62f013a5a8b885", + "0xa961cf5654c46a1a22c29baf7a4e77837a26b7f138f410e9d1883480ed5fa42411d522aba32040b577046c11f007388e", + "0xad1154142344f494e3061ef45a34fab1aaacf5fdf7d1b26adbb5fbc3d795655fa743444e39d9a4119b4a4f82a6f30441", + "0xb1d6c30771130c77806e7ab893b73d4deb590b2ff8f2f8b5e54c2040c1f3e060e2bd99afc668cf706a2df666a508bbf6", + "0xa00361fd440f9decabd98d96c575cd251dc94c60611025095d1201ef2dedde51cb4de7c2ece47732e5ed9b3526c2012c", + "0xa85c5ab4d17d328bda5e6d839a9a6adcc92ff844ec25f84981e4f44a0e8419247c081530f8d9aa629c7eb4ca21affba6", + "0xa4ddd3eab4527a2672cf9463db38bc29f61460e2a162f426b7852b7a7645fbd62084fd39a8e4d60e1958cce436dd8f57", + "0x811648140080fe55b8618f4cf17f3c5a250adb0cd53d885f2ddba835d2b4433188e41fc0661faac88e4ff910b16278c0", + "0xb85c7f1cfb0ed29addccf7546023a79249e8f15ac2d14a20accbfef4dd9dc11355d599815fa09d2b6b4e966e6ea8cff1", + "0xa10b5d8c260b159043b020d5dd62b3467df2671afea6d480ca9087b7e60ed170c82b121819d088315902842d66c8fb45", + "0x917e191df1bcf3f5715419c1e2191da6b8680543b1ba41fe84ed07ef570376e072c081beb67b375fca3565a2565bcabb", + "0x881fd967407390bfd7badc9ab494e8a287559a01eb07861f527207c127eadea626e9bcc5aa9cca2c5112fbac3b3f0e9c", + "0x959fd71149af82cc733619e0e5bf71760ca2650448c82984b3db74030d0e10f8ab1ce1609a6de6f470fe8b5bd90df5b3", + "0xa3370898a1c5f33d15adb4238df9a6c945f18b9ada4ce2624fc32a844f9ece4c916a64e9442225b6592afa06d2e015f2", + "0x817efb8a791435e4236f7d7b278181a5fa34587578c629dbc14fbf9a5c26772290611395eecd20222a4c58649fc256d8", + "0xa04c9876acf2cfdc8ef96de4879742709270fa1d03fe4c8511fbef2d59eb0aaf0336fa2c7dfe41a651157377fa217813", + "0x81e15875d7ea7f123e418edf14099f2e109d4f3a6ce0eb65f67fe9fb10d2f809a864a29f60ad3fc949f89e2596b21783", + "0xb49f529975c09e436e6bc202fdc16e3fdcbe056db45178016ad6fdece9faad4446343e83aed096209690b21a6910724f", + "0x879e8eda589e1a279f7f49f6dd0580788c040d973748ec4942dbe51ea8fbd05983cc919b78f0c6b92ef3292ae29db875", + "0x81a2b74b2118923f34139a102f3d95e7eee11c4c2929c2576dee200a5abfd364606158535a6c9e4178a6a83dbb65f3c4", + "0x8913f281d8927f2b45fc815d0f7104631cb7f5f7278a316f1327d670d15868daadd2a64e3eb98e1f53fe7e300338cc80", + "0xa6f815fba7ef9af7fbf45f93bc952e8b351f5de6568a27c7c47a00cb39a254c6b31753794f67940fc7d2e9cc581529f4", + "0xb3722a15c66a0014ce4d082de118def8d39190c15678a472b846225585f3a83756ae1b255b2e3f86a26168878e4773b2", + "0x817ae61ab3d0dd5b6e24846b5a5364b1a7dc2e77432d9fed587727520ae2f307264ea0948c91ad29f0aea3a11ff38624", + "0xb3db467464415fcad36dc1de2d6ba7686772a577cc2619242ac040d6734881a45d3b40ed4588db124e4289cfeec4bbf6", + "0xad66a14f5a54ac69603b16e5f1529851183da77d3cc60867f10aea41339dd5e06a5257982e9e90a352cdd32750f42ee4", + "0xadafa3681ef45d685555601a25a55cf23358319a17f61e2179e704f63df83a73bdd298d12cf6cef86db89bd17119e11d", + "0xa379dc44cb6dd3b9d378c07b2ec654fec7ca2f272de6ba895e3d00d20c9e4c5550498a843c8ac67e4221db2115bedc1c", + "0xb7bf81c267a78efc6b9e5a904574445a6487678d7ef70054e3e93ea6a23f966c2b68787f9164918e3b16d2175459ed92", + "0xb41d66a13a4afafd5760062b77f79de7e6ab8ccacde9c6c5116a6d886912fb491dc027af435b1b44aacc6af7b3c887f2", + "0x9904d23a7c1c1d2e4bab85d69f283eb0a8e26d46e8b7b30224438015c936729b2f0af7c7c54c03509bb0500acb42d8a4", + "0xae30d65e9e20c3bfd603994ae2b175ff691d51f3e24b2d058b3b8556d12ca4c75087809062dddd4aaac81c94d15d8a17", + "0x9245162fab42ac01527424f6013310c3eb462982518debef6c127f46ba8a06c705d7dc9f0a41e796ba8d35d60ae6cc64", + "0x87fab853638d7a29a20f3ba2b1a7919d023e9415bfa78ebb27973d8cbc7626f584dc5665d2e7ad71f1d760eba9700d88", + "0x85aac46ecd330608e5272430970e6081ff02a571e8ea444f1e11785ea798769634a22a142d0237f67b75369d3c484a8a", + "0x938c85ab14894cc5dfce3d80456f189a2e98eddbc8828f4ff6b1df1dcb7b42b17ca2ff40226a8a1390a95d63dca698dd", + "0xa18ce1f846e3e3c4d846822f60271eecf0f5d7d9f986385ac53c5ace9589dc7c0188910448c19b91341a1ef556652fa9", + "0x8611608a9d844f0e9d7584ad6ccf62a5087a64f764caf108db648a776b5390feb51e5120f0ef0e9e11301af3987dd7dc", + "0x8106333ba4b4de8d1ae43bc9735d3fea047392e88efd6a2fa6f7b924a18a7a265ca6123c3edc0f36307dd7fb7fe89257", + "0xa91426fa500951ff1b051a248c050b7139ca30dde8768690432d597d2b3c4357b11a577be6b455a1c5d145264dcf81fc", + "0xb7f9f90e0e450f37b081297f7f651bad0496a8b9afd2a4cf4120a2671aaaa8536dce1af301258bfbfdb122afa44c5048", + "0x84126da6435699b0c09fa4032dec73d1fca21d2d19f5214e8b0bea43267e9a8dd1fc44f8132d8315e734c8e2e04d7291", + "0xaff064708103884cb4f1a3c1718b3fc40a238d35cf0a7dc24bdf9823693b407c70da50df585bf5bc4e9c07d1c2d203e8", + "0xa8b40fc6533752983a5329c31d376c7a5c13ce6879cc7faee648200075d9cd273537001fb4c86e8576350eaac6ba60c2", + "0xa02db682bdc117a84dcb9312eb28fcbde12d49f4ce915cc92c610bb6965ec3cc38290f8c5b5ec70afe153956692cda95", + "0x86decd22b25d300508472c9ce75d3e465b737e7ce13bc0fcce32835e54646fe12322ba5bc457be18bfd926a1a6ca4a38", + "0xa18666ef65b8c2904fd598791f5627207165315a85ee01d5fb0e6b2e10bdd9b00babc447da5bd63445e3337de33b9b89", + "0x89bb0c06effadefdaf34ffe4b123e1678a90d4451ee856c863df1e752eef41fd984689ded8f0f878bf8916d5dd8e8024", + "0x97cfcba08ebec05d0073992a66b1d7d6fb9d95871f2cdc36db301f78bf8069294d1c259efef5c93d20dc937eedae3a1a", + "0xac2643b14ece79dcb2e289c96776a47e2bebd40dd6dc74fd035df5bb727b5596f40e3dd2d2202141e69b0993717ede09", + "0xa5e6fd88a2f9174d9bd4c6a55d9c30974be414992f22aa852f552c7648f722ed8077acf5aba030abd47939bb451b2c60", + "0x8ad40a612824a7994487731a40b311b7349038c841145865539c6ada75c56de6ac547a1c23df190e0caaafecddd80ccc", + "0x953a7cea1d857e09202c438c6108060961f195f88c32f0e012236d7a4b39d840c61b162ec86436e8c38567328bea0246", + "0x80d8b47a46dae1868a7b8ccfe7029445bbe1009dad4a6c31f9ef081be32e8e1ac1178c3c8fb68d3e536c84990cc035b1", + "0x81ecd99f22b3766ce0aca08a0a9191793f68c754fdec78b82a4c3bdc2db122bbb9ebfd02fc2dcc6e1567a7d42d0cc16a", + "0xb1dd0446bccc25846fb95d08c1c9cc52fb51c72c4c5d169ffde56ecfe800f108dc1106d65d5c5bd1087c656de3940b63", + "0xb87547f0931e164e96de5c550ca5aa81273648fe34f6e193cd9d69cf729cb432e17aa02e25b1c27a8a0d20a3b795e94e", + "0x820a94e69a927e077082aae66f6b292cfbe4589d932edf9e68e268c9bd3d71ef76cf7d169dd445b93967c25db11f58f1", + "0xb0d07ddf2595270c39adfa0c8cf2ab1322979b0546aa4d918f641be53cd97f36c879bb75d205e457c011aca3bbd9f731", + "0x8700b876b35b4b10a8a9372c5230acecd39539c1bb87515640293ad4464a9e02929d7d6a6a11112e8a29564815ac0de4", + "0xa61a601c5bb27dcb97e37c8e2b9ce479c6b192a5e04d9ed5e065833c5a1017ee5f237b77d1a17be5d48f8e7cc0bcacf6", + "0x92fb88fe774c1ba1d4a08cae3c0e05467ad610e7a3f1d2423fd47751759235fe0a3036db4095bd6404716aa03820f484", + "0xb274f140d77a3ce0796f5e09094b516537ccaf27ae1907099bff172e6368ba85e7c3ef8ea2a07457cac48ae334da95b3", + "0xb2292d9181f16581a9a9142490b2bdcdfb218ca6315d1effc8592100d792eb89d5356996c890441f04f2b4a95763503e", + "0x8897e73f576d86bc354baa3bd96e553107c48cf5889dcc23c5ba68ab8bcd4e81f27767be2233fdfa13d39f885087e668", + "0xa29eac6f0829791c728d71abc49569df95a4446ecbfc534b39f24f56c88fe70301838dfc1c19751e7f3c5c1b8c6af6a0", + "0x9346dc3720adc5df500a8df27fd9c75ef38dc5c8f4e8ed66983304750e66d502c3c59b8e955be781b670a0afc70a2167", + "0x9566d534e0e30a5c5f1428665590617e95fd05d45f573715f58157854ad596ece3a3cfec61356aee342308d623e029d5", + "0xa464fb8bffe6bd65f71938c1715c6e296cc6d0311a83858e4e7eb5873b7f2cf0c584d2101e3407b85b64ca78b2ac93ce", + "0xb54088f7217987c87e9498a747569ac5b2f8afd5348f9c45bf3fd9fbf713a20f495f49c8572d087efe778ac7313ad6d3", + "0x91fa9f5f8000fe050f5b224d90b59fcce13c77e903cbf98ded752e5b3db16adb2bc1f8c94be48b69f65f1f1ad81d6264", + "0x92d04a5b0ac5d8c8e313709b432c9434ecd3e73231f01e9b4e7952b87df60cbfa97b5dedd2200bd033b4b9ea8ba45cc1", + "0xa94b90ad3c3d6c4bbe169f8661a790c40645b40f0a9d1c7220f01cf7fc176e04d80bab0ced9323fcafb93643f12b2760", + "0x94d86149b9c8443b46196f7e5a3738206dd6f3be7762df488bcbb9f9ee285a64c997ed875b7b16b26604fa59020a8199", + "0x82efe4ae2c50a2d7645240c173a047f238536598c04a2c0b69c96e96bd18e075a99110f1206bc213f39edca42ba00cc1", + "0xab8667685f831bc14d4610f84a5da27b4ea5b133b4d991741a9e64dceb22cb64a3ce8f1b6e101d52af6296df7127c9ad", + "0x83ba433661c05dcc5d562f4a9a261c8110dac44b8d833ae1514b1fc60d8b4ee395b18804baea04cb10adb428faf713c3", + "0xb5748f6f660cc5277f1211d2b8649493ed8a11085b871cd33a5aea630abd960a740f08c08be5f9c21574600ac9bf5737", + "0xa5c8dd12af48fb710642ad65ebb97ca489e8206741807f7acfc334f8035d3c80593b1ff2090c9bb7bd138f0c48714ca8", + "0xa2b382fd5744e3babf454b1d806cc8783efeb4761bc42b6914ea48a46a2eae835efbe0a18262b6bc034379e03cf1262b", + "0xb3145ffaf603f69f15a64936d32e3219eea5ed49fdfd2f5bf40ea0dfd974b36fb6ff12164d4c2282d892db4cf3ff3ce1", + "0x87a316fb213f4c5e30c5e3face049db66be4f28821bd96034714ec23d3e97849d7b301930f90a4323c7ccf53de23050c", + "0xb9de09a919455070fed6220fc179c8b7a4c753062bcd27acf28f5b9947a659c0b364298daf7c85c4ca6fca7f945add1f", + "0x806fbd98d411b76979464c40ad88bc07a151628a27fcc1012ba1dfbaf5b5cc9d962fb9b3386008978a12515edce934bc", + "0xa15268877fae0d21610ae6a31061ed7c20814723385955fac09fdc9693a94c33dea11db98bb89fdfe68f933490f5c381", + "0x8d633fb0c4da86b2e0b37d8fad5972d62bff2ac663c5ec815d095cd4b7e1fe66ebef2a2590995b57eaf941983c7ad7a4", + "0x8139e5dd9cf405e8ef65f11164f0440827d98389ce1b418b0c9628be983a9ddd6cf4863036ccb1483b40b8a527acd9ed", + "0x88b15fa94a08eac291d2b94a2b30eb851ff24addf2cc30b678e72e32cfcb3424cf4b33aa395d741803f3e578ddf524de", + "0xb5eaf0c8506e101f1646bcf049ee38d99ea1c60169730da893fd6020fd00a289eb2f415947e44677af49e43454a7b1be", + "0x8489822ad0647a7e06aa2aa5595960811858ddd4542acca419dd2308a8c5477648f4dd969a6740bb78aa26db9bfcc555", + "0xb1e9a7b9f3423c220330d45f69e45fa03d7671897cf077f913c252e3e99c7b1b1cf6d30caad65e4228d5d7b80eb86e5e", + "0xb28fe9629592b9e6a55a1406903be76250b1c50c65296c10c5e48c64b539fb08fe11f68cf462a6edcbba71b0cee3feb2", + "0xa41acf96a02c96cd8744ff6577c244fc923810d17ade133587e4c223beb7b4d99fa56eae311a500d7151979267d0895c", + "0x880798938fe4ba70721be90e666dfb62fcab4f3556fdb7b0dc8ec5bc34f6b4513df965eae78527136eb391889fe2caf9", + "0x98d4d89d358e0fb7e212498c73447d94a83c1b66e98fc81427ab13acddb17a20f52308983f3a5a8e0aaacec432359604", + "0x81430b6d2998fc78ba937a1639c6020199c52da499f68109da227882dc26d005b73d54c5bdcac1a04e8356a8ca0f7017", + "0xa8d906a4786455eb74613aba4ce1c963c60095ffb8658d368df9266fdd01e30269ce10bf984e7465f34b4fd83beba26a", + "0xaf54167ac1f954d10131d44a8e0045df00d581dd9e93596a28d157543fbe5fb25d213806ed7fb3cba6b8f5b5423562db", + "0x8511e373a978a12d81266b9afbd55035d7bc736835cfa921903a92969eeba3624437d1346b55382e61415726ab84a448", + "0x8cf43eea93508ae586fa9a0f1354a1e16af659782479c2040874a46317f9e8d572a23238efa318fdfb87cc63932602b7", + "0xb0bdd3bacff077173d302e3a9678d1d37936188c7ecc34950185af6b462b7c679815176f3cce5db19aac8b282f2d60ad", + "0xa355e9b87f2f2672052f5d4d65b8c1c827d24d89b0d8594641fccfb69aef1b94009105f3242058bb31c8bf51caae5a41", + "0xb8baa9e4b950b72ff6b88a6509e8ed1304bc6fd955748b2e59a523a1e0c5e99f52aec3da7fa9ff407a7adf259652466c", + "0x840bc3dbb300ea6f27d1d6dd861f15680bd098be5174f45d6b75b094d0635aced539fa03ddbccb453879de77fb5d1fe9", + "0xb4bc7e7e30686303856472bae07e581a0c0bfc815657c479f9f5931cff208d5c12930d2fd1ff413ebd8424bcd7a9b571", + "0x89b5d514155d7999408334a50822508b9d689add55d44a240ff2bdde2eee419d117031f85e924e2a2c1ca77db9b91eea", + "0xa8604b6196f87a04e1350302e8aa745bba8dc162115d22657b37a1d1a98cb14876ddf7f65840b5dbd77e80cd22b4256c", + "0x83cb7acdb9e03247515bb2ce0227486ccf803426717a14510f0d59d45e998b245797d356f10abca94f7a14e1a2f0d552", + "0xaeb3266a9f16649210ab2df0e1908ac259f34ce1f01162c22b56cf1019096ee4ea5854c36e30bb2feb06c21a71e8a45c", + "0x89e72e86edf2aa032a0fc9acf4d876a40865fbb2c8f87cb7e4d88856295c4ac14583e874142fd0c314a49aba68c0aa3c", + "0x8c3576eba0583c2a7884976b4ed11fe1fda4f6c32f6385d96c47b0e776afa287503b397fa516a455b4b8c3afeedc76db", + "0xa31e5b633bda9ffa174654fee98b5d5930a691c3c42fcf55673d927dbc8d91c58c4e42e615353145431baa646e8bbb30", + "0x89f2f3f7a8da1544f24682f41c68114a8f78c86bd36b066e27da13acb70f18d9f548773a16bd8e24789420e17183f137", + "0xada27fa4e90a086240c9164544d2528621a415a5497badb79f8019dc3dce4d12eb6b599597e47ec6ac39c81efda43520", + "0x90dc1eb21bf21c0187f359566fc4bf5386abea52799306a0e5a1151c0817c5f5bc60c86e76b1929c092c0f3ff48cedd2", + "0xb702a53ebcc17ae35d2e735a347d2c700e9cbef8eadbece33cac83df483b2054c126593e1f462cfc00a3ce9d737e2af5", + "0x9891b06455ec925a6f8eafffba05af6a38cc5e193acaaf74ffbf199df912c5197106c5e06d72942bbb032ce277b6417f", + "0x8c0ee71eb01197b019275bcf96cae94e81d2cdc3115dbf2d8e3080074260318bc9303597e8f72b18f965ad601d31ec43", + "0x8aaf580aaf75c1b7a5f99ccf60503506e62058ef43b28b02f79b8536a96be3f019c9f71caf327b4e6730134730d1bef5", + "0xae6f9fc21dd7dfa672b25a87eb0a41644f7609fab5026d5cedb6e43a06dbbfd6d6e30322a2598c8dedde88c52eaed626", + "0x8159b953ffece5693edadb2e906ebf76ff080ee1ad22698950d2d3bfc36ac5ea78f58284b2ca180664452d55bd54716c", + "0xab7647c32ca5e9856ac283a2f86768d68de75ceeba9e58b74c5324f8298319e52183739aba4340be901699d66ac9eb3f", + "0xa4d85a5701d89bcfaf1572db83258d86a1a0717603d6f24ac2963ffcf80f1265e5ab376a4529ca504f4396498791253c", + "0x816080c0cdbfe61b4d726c305747a9eb58ac26d9a35f501dd32ba43c098082d20faf3ccd41aad24600aa73bfa453dfac", + "0x84f3afac024f576b0fd9acc6f2349c2fcefc3f77dbe5a2d4964d14b861b88e9b1810334b908cf3427d9b67a8aee74b18", + "0x94b390655557b1a09110018e9b5a14490681ade275bdc83510b6465a1218465260d9a7e2a6e4ec700f58c31dc3659962", + "0xa8c66826b1c04a2dd4c682543242e7a57acae37278bd09888a3d17747c5b5fec43548101e6f46d703638337e2fd3277b", + "0x86e6f4608a00007fa533c36a5b054c5768ccafe41ad52521d772dcae4c8a4bcaff8f7609be30d8fab62c5988cbbb6830", + "0x837da4cf09ae8aa0bceb16f8b3bfcc3b3367aecac9eed6b4b56d7b65f55981ef066490764fb4c108792623ecf8cad383", + "0x941ff3011462f9b5bf97d8cbdb0b6f5d37a1b1295b622f5485b7d69f2cb2bcabc83630dae427f0259d0d9539a77d8424", + "0xb99e5d6d82aa9cf7d5970e7f710f4039ac32c2077530e4c2779250c6b9b373bc380adb0a03b892b652f649720672fc8c", + "0xa791c78464b2d65a15440b699e1e30ebd08501d6f2720adbc8255d989a82fcded2f79819b5f8f201bed84a255211b141", + "0x84af7ad4a0e31fcbb3276ab1ad6171429cf39adcf78dc03750dc5deaa46536d15591e26d53e953dfb31e1622bc0743ab", + "0xa833e62fe97e1086fae1d4917fbaf09c345feb6bf1975b5cb863d8b66e8d621c7989ab3dbecda36bc9eaffc5eaa6fa66", + "0xb4ef79a46a2126f53e2ebe62770feb57fd94600be29459d70a77c5e9cc260fa892be06cd60f886bf48459e48eb50d063", + "0xb43b8f61919ea380bf151c294e54d3a3ff98e20d1ee5efbfe38aa2b66fafbc6a49739793bd5cb1c809f8b30466277c3a", + "0xab37735af2412d2550e62df9d8b3b5e6f467f20de3890bf56faf1abf2bf3bd1d98dc3fa0ad5e7ab3fce0fa20409eb392", + "0x82416b74b1551d484250d85bb151fabb67e29cce93d516125533df585bc80779ab057ea6992801a3d7d5c6dcff87a018", + "0x8145d0787f0e3b5325190ae10c1d6bee713e6765fb6a0e9214132c6f78f4582bb2771aaeae40d3dad4bafb56bf7e36d8", + "0xb6935886349ecbdd5774e12196f4275c97ec8279fdf28ccf940f6a022ebb6de8e97d6d2173c3fe402cbe9643bed3883b", + "0x87ef9b4d3dc71ac86369f8ed17e0dd3b91d16d14ae694bc21a35b5ae37211b043d0e36d8ff07dcc513fb9e6481a1f37f", + "0xae1d0ded32f7e6f1dc8fef495879c1d9e01826f449f903c1e5034aeeabc5479a9e323b162b688317d46d35a42d570d86", + "0xa40d16497004db4104c6794e2f4428d75bdf70352685944f3fbe17526df333e46a4ca6de55a4a48c02ecf0bde8ba03c0", + "0x8d45121efba8cc308a498e8ee39ea6fa5cae9fb2e4aab1c2ff9d448aa8494ccbec9a078f978a86fcd97b5d5e7be7522a", + "0xa8173865c64634ba4ac2fa432740f5c05056a9deaf6427cb9b4b8da94ca5ddbc8c0c5d3185a89b8b28878194de9cdfcd", + "0xb6ec06a74d690f6545f0f0efba236e63d1fdfba54639ca2617408e185177ece28901c457d02b849fd00f1a53ae319d0a", + "0xb69a12df293c014a40070e3e760169b6f3c627caf9e50b35a93f11ecf8df98b2bc481b410eecb7ab210bf213bbe944de", + "0x97e7dc121795a533d4224803e591eef3e9008bab16f12472210b73aaf77890cf6e3877e0139403a0d3003c12c8f45636", + "0xacdfa6fdd4a5acb7738cc8768f7cba84dbb95c639399b291ae8e4e63df37d2d4096900a84d2f0606bf534a9ccaa4993f", + "0x86ee253f3a9446a33e4d1169719b7d513c6b50730988415382faaf751988c10a421020609f7bcdef91be136704b906e2", + "0xaac9438382a856caf84c5a8a234282f71b5fc5f65219103b147e7e6cf565522285fbfd7417b513bdad8277a00f652ca1", + "0x83f3799d8e5772527930f5dc071a2e0a65471618993ec8990a96ccdeee65270e490bda9d26bb877612475268711ffd80", + "0x93f28a81ac8c0ec9450b9d762fae9c7f8feaace87a6ee6bd141ef1d2d0697ef1bbd159fe6e1de640dbdab2b0361fca8a", + "0xa0825c95ba69999b90eac3a31a3fd830ea4f4b2b7409bde5f202b61d741d6326852ce790f41de5cb0eccec7af4db30c1", + "0x83924b0e66233edd603c3b813d698daa05751fc34367120e3cf384ea7432e256ccee4d4daf13858950549d75a377107d", + "0x956fd9fa58345277e06ba2ec72f49ed230b8d3d4ff658555c52d6cddeb84dd4e36f1a614f5242d5ca0192e8daf0543c2", + "0x944869912476baae0b114cced4ff65c0e4c90136f73ece5656460626599051b78802df67d7201c55d52725a97f5f29fe", + "0x865cb25b64b4531fb6fe4814d7c8cd26b017a6c6b72232ff53defc18a80fe3b39511b23f9e4c6c7249d06e03b2282ed2", + "0x81e09ff55214960775e1e7f2758b9a6c4e4cd39edf7ec1adfaad51c52141182b79fe2176b23ddc7df9fd153e5f82d668", + "0xb31006896f02bc90641121083f43c3172b1039334501fbaf1672f7bf5d174ddd185f945adf1a9c6cf77be34c5501483d", + "0x88b92f6f42ae45e9f05b16e52852826e933efd0c68b0f2418ac90957fd018df661bc47c8d43c2a7d7bfcf669dab98c3c", + "0x92fc68f595853ee8683930751789b799f397135d002eda244fe63ecef2754e15849edde3ba2f0cc8b865c9777230b712", + "0x99ca06a49c5cd0bb097c447793fcdd809869b216a34c66c78c7e41e8c22f05d09168d46b8b1f3390db9452d91bc96dea", + "0xb48b9490a5d65296802431852d548d81047bbefc74fa7dc1d4e2a2878faacdfcb365ae59209cb0ade01901a283cbd15d", + "0xaff0fdbef7c188b120a02bc9085d7b808e88f73973773fef54707bf2cd772cd066740b1b6f4127b5c349f657bd97e738", + "0x966fd4463b4f43dd8ccba7ad50baa42292f9f8b2e70da23bb6780e14155d9346e275ef03ddaf79e47020dcf43f3738bd", + "0x9330c3e1fadd9e08ac85f4839121ae20bbeb0a5103d84fa5aadbd1213805bdcda67bf2fb75fc301349cbc851b5559d20", + "0x993bb99867bd9041a71a55ad5d397755cfa7ab6a4618fc526179bfc10b7dc8b26e4372fe9a9b4a15d64f2b63c1052dda", + "0xa29b59bcfab51f9b3c490a3b96f0bf1934265c315349b236012adbd64a56d7f6941b2c8cc272b412044bc7731f71e1dc", + "0xa65c9cefe1fc35d089fe8580c2e7671ebefdb43014ac291528ff4deefd4883fd4df274af83711dad610dad0d615f9d65", + "0x944c78c56fb227ae632805d448ca3884cd3d2a89181cead3d2b7835e63297e6d740aa79a112edb1d4727824991636df5", + "0xa73d782da1db7e4e65d7b26717a76e16dd9fab4df65063310b8e917dc0bc24e0d6755df5546c58504d04d9e68c3b474a", + "0xaf80f0b87811ae3124f68108b4ca1937009403f87928bbc53480e7c5408d072053ace5eeaf5a5aba814dab8a45502085", + "0x88aaf1acfc6e2e19b8387c97da707cb171c69812fefdd4650468e9b2c627bd5ccfb459f4d8e56bdfd84b09ddf87e128f", + "0x92c97276ff6f72bab6e9423d02ad6dc127962dbce15a0dd1e4a393b4510c555df6aa27be0f697c0d847033a9ca8b8dfd", + "0xa0e07d43d96e2d85b6276b3c60aadb48f0aedf2de8c415756dc597249ea64d2093731d8735231dadc961e5682ac59479", + "0xadc9e6718a8f9298957d1da3842a7751c5399bbdf56f8de6c1c4bc39428f4aee6f1ba6613d37bf46b9403345e9d6fc81", + "0x951da434da4b20d949b509ceeba02e24da7ed2da964c2fcdf426ec787779c696b385822c7dbea4df3e4a35921f1e912c", + "0xa04cbce0d2b2e87bbf038c798a12ec828423ca6aca08dc8d481cf6466e3c9c73d4d4a7fa47df9a7e2e15aae9e9f67208", + "0x8f855cca2e440d248121c0469de1f94c2a71b8ee2682bbad3a78243a9e03da31d1925e6760dbc48a1957e040fae9abe8", + "0xb642e5b17c1df4a4e101772d73851180b3a92e9e8b26c918050f51e6dd3592f102d20b0a1e96f0e25752c292f4c903ff", + "0xa92454c300781f8ae1766dbbb50a96192da7d48ef4cbdd72dd8cbb44c6eb5913c112cc38e9144615fdc03684deb99420", + "0x8b74f7e6c2304f8e780df4649ef8221795dfe85fdbdaa477a1542d135b75c8be45bf89adbbb6f3ddf54ca40f02e733e9", + "0x85cf66292cbb30cec5fd835ab10c9fcb3aea95e093aebf123e9a83c26f322d76ebc89c4e914524f6c5f6ee7d74fc917d", + "0xae0bfe0cdc97c09542a7431820015f2d16067b30dca56288013876025e81daa8c519e5e347268e19aa1a85fa1dc28793", + "0x921322fc6a47dc091afa0ad6df18ed14cde38e48c6e71550aa513918b056044983aee402de21051235eecf4ce8040fbe", + "0x96c030381e97050a45a318d307dcb3c8377b79b4dd5daf6337cded114de26eb725c14171b9b8e1b3c08fe1f5ea6b49e0", + "0x90c23b86b6111818c8baaf53a13eaee1c89203b50e7f9a994bf0edf851919b48edbac7ceef14ac9414cf70c486174a77", + "0x8bf6c301240d2d1c8d84c71d33a6dfc6d9e8f1cfae66d4d0f7a256d98ae12b0bcebfa94a667735ee89f810bcd7170cff", + "0xa41a4ffbbea0e36874d65c009ee4c3feffff322f6fc0e30d26ee4dbc1f46040d05e25d9d0ecb378cef0d24a7c2c4b850", + "0xa8d4cdd423986bb392a0a92c12a8bd4da3437eec6ef6af34cf5310944899287452a2eb92eb5386086d5063381189d10e", + "0xa81dd26ec057c4032a4ed7ad54d926165273ed51d09a1267b2e477535cf6966835a257c209e4e92d165d74fa75695fa3", + "0x8d7f708c3ee8449515d94fc26b547303b53d8dd55f177bc3b25d3da2768accd9bc8e9f09546090ebb7f15c66e6c9c723", + "0x839ba65cffcd24cfffa7ab3b21faabe3c66d4c06324f07b2729c92f15cad34e474b0f0ddb16cd652870b26a756b731d3", + "0x87f1a3968afec354d92d77e2726b702847c6afcabb8438634f9c6f7766de4c1504317dc4fa9a4a735acdbf985e119564", + "0x91a8a7fd6542f3e0673f07f510d850864b34ac087eb7eef8845a1d14b2b1b651cbdc27fa4049bdbf3fea54221c5c8549", + "0xaef3cf5f5e3a2385ead115728d7059e622146c3457d266c612e778324b6e06fbfb8f98e076624d2f3ce1035d65389a07", + "0x819915d6232e95ccd7693fdd78d00492299b1983bc8f96a08dcb50f9c0a813ed93ae53c0238345d5bea0beda2855a913", + "0x8e9ba68ded0e94935131b392b28218315a185f63bf5e3c1a9a9dd470944509ca0ba8f6122265f8da851b5cc2abce68f1", + "0xb28468e9b04ee9d69003399a3cf4457c9bf9d59f36ab6ceeb8e964672433d06b58beeea198fedc7edbaa1948577e9fa2", + "0xa633005e2c9f2fd94c8bce2dd5bb708fe946b25f1ec561ae65e54e15cdd88dc339f1a083e01f0d39610c8fe24151aaf0", + "0x841d0031e22723f9328dd993805abd13e0c99b0f59435d2426246996b08d00ce73ab906f66c4eab423473b409e972ce0", + "0x85758d1b084263992070ec8943f33073a2d9b86a8606672550c17545507a5b3c88d87382b41916a87ee96ff55a7aa535", + "0x8581b06b0fc41466ef94a76a1d9fb8ae0edca6d018063acf6a8ca5f4b02d76021902feba58972415691b4bdbc33ae3b4", + "0x83539597ff5e327357ee62bc6bf8c0bcaec2f227c55c7c385a4806f0d37fb461f1690bad5066b8a5370950af32fafbef", + "0xaee3557290d2dc10827e4791d00e0259006911f3f3fce4179ed3c514b779160613eca70f720bff7804752715a1266ffa", + "0xb48d2f0c4e90fc307d5995464e3f611a9b0ef5fe426a289071f4168ed5cc4f8770c9332960c2ca5c8c427f40e6bb389f", + "0x847af8973b4e300bb06be69b71b96183fd1a0b9d51b91701bef6fcfde465068f1eb2b1503b07afda380f18d69de5c9e1", + "0xa70a6a80ce407f07804c0051ac21dc24d794b387be94eb24e1db94b58a78e1bcfb48cd0006db8fc1f9bedaece7a44fbe", + "0xb40e942b8fa5336910ff0098347df716bff9d1fa236a1950c16eeb966b3bc1a50b8f7b0980469d42e75ae13ced53cead", + "0xb208fabaa742d7db3148515330eb7a3577487845abdb7bd9ed169d0e081db0a5816595c33d375e56aeac5b51e60e49d3", + "0xb7c8194b30d3d6ef5ab66ec88ad7ebbc732a3b8a41731b153e6f63759a93f3f4a537eab9ad369705bd730184bdbbdc34", + "0x9280096445fe7394d04aa1bc4620c8f9296e991cc4d6c131bd703cb1cc317510e6e5855ac763f4d958c5edfe7eebeed7", + "0xabc2aa4616a521400af1a12440dc544e3c821313d0ab936c86af28468ef8bbe534837e364598396a81cf8d06274ed5a6", + "0xb18ca8a3325adb0c8c18a666d4859535397a1c3fe08f95eebfac916a7a99bbd40b3c37b919e8a8ae91da38bc00fa56c0", + "0x8a40c33109ecea2a8b3558565877082f79121a432c45ec2c5a5e0ec4d1c203a6788e6b69cb37f1fd5b8c9a661bc5476d", + "0x88c47301dd30998e903c84e0b0f2c9af2e1ce6b9f187dab03528d44f834dc991e4c86d0c474a2c63468cf4020a1e24a0", + "0x920c832853e6ab4c851eecfa9c11d3acc7da37c823be7aa1ab15e14dfd8beb5d0b91d62a30cec94763bd8e4594b66600", + "0x98e1addbe2a6b8edc7f12ecb9be81c3250aeeca54a1c6a7225772ca66549827c15f3950d01b8eb44aecb56fe0fff901a", + "0x8cfb0fa1068be0ec088402f5950c4679a2eb9218c729da67050b0d1b2d7079f3ddf4bf0f57d95fe2a8db04bc6bcdb20c", + "0xb70f381aafe336b024120453813aeab70baac85b9c4c0f86918797b6aee206e6ed93244a49950f3d8ec9f81f4ac15808", + "0xa4c8edf4aa33b709a91e1062939512419711c1757084e46f8f4b7ed64f8e682f4e78b7135920c12f0eb0422fe9f87a6a", + "0xb4817e85fd0752d7ebb662d3a51a03367a84bac74ebddfba0e5af5e636a979500f72b148052d333b3dedf9edd2b4031b", + "0xa87430169c6195f5d3e314ff2d1c2f050e766fd5d2de88f5207d72dba4a7745bb86d0baca6e9ae156582d0d89e5838c7", + "0x991b00f8b104566b63a12af4826b61ce7aa40f4e5b8fff3085e7a99815bdb4471b6214da1e480214fac83f86a0b93cc5", + "0xb39966e3076482079de0678477df98578377a094054960ee518ef99504d6851f8bcd3203e8da5e1d4f6f96776e1fe6eb", + "0xa448846d9dc2ab7a0995fa44b8527e27f6b3b74c6e03e95edb64e6baa4f1b866103f0addb97c84bef1d72487b2e21796", + "0x894bec21a453ae84b592286e696c35bc30e820e9c2fd3e63dd4fbe629e07df16439c891056070faa490155f255bf7187", + "0xa9ec652a491b11f6a692064e955f3f3287e7d2764527e58938571469a1e29b5225b9415bd602a45074dfbfe9c131d6ca", + "0xb39d37822e6cbe28244b5f42ce467c65a23765bd16eb6447c5b3e942278069793763483dafd8c4dd864f8917aad357fe", + "0x88dba51133f2019cb266641c56101e3e5987d3b77647a2e608b5ff9113dfc5f85e2b7c365118723131fbc0c9ca833c9c", + "0xb566579d904b54ecf798018efcb824dccbebfc6753a0fd2128ac3b4bd3b038c2284a7c782b5ca6f310eb7ea4d26a3f0a", + "0xa97a55c0a492e53c047e7d6f9d5f3e86fb96f3dddc68389c0561515343b66b4bc02a9c0d5722dff1e3445308240b27f7", + "0xa044028ab4bcb9e1a2b9b4ca4efbf04c5da9e4bf2fff0e8bd57aa1fc12a71e897999c25d9117413faf2f45395dee0f13", + "0xa78dc461decbeaeed8ebd0909369b491a5e764d6a5645a7dac61d3140d7dc0062526f777b0eb866bff27608429ebbdde", + "0xb2c2a8991f94c39ca35fea59f01a92cb3393e0eccb2476dfbf57261d406a68bd34a6cff33ed80209991688c183609ef4", + "0x84189eefb521aff730a4fd3fd5b10ddfd29f0d365664caef63bb015d07e689989e54c33c2141dd64427805d37a7e546e", + "0x85ac80bd734a52235da288ff042dea9a62e085928954e8eacd2c751013f61904ed110e5b3afe1ab770a7e6485efb7b5e", + "0x9183a560393dcb22d0d5063e71182020d0fbabb39e32493eeffeb808df084aa243eb397027f150b55a247d1ed0c8513e", + "0x81c940944df7ecc58d3c43c34996852c3c7915ed185d7654627f7af62abae7e0048dd444a6c09961756455000bd96d09", + "0xaa8c34e164019743fd8284b84f06c3b449aae7996e892f419ee55d82ad548cb300fd651de329da0384243954c0ef6a60", + "0x89a7b7bdfc7e300d06a14d463e573d6296d8e66197491900cc9ae49504c4809ff6e61b758579e9091c61085ba1237b83", + "0x878d21809ba540f50bd11f4c4d9590fb6f3ab9de5692606e6e2ef4ed9d18520119e385be5e1f4b3f2e2b09c319f0e8fc", + "0x8eb248390193189cf0355365e630b782cd15751e672dc478b39d75dc681234dcd9309df0d11f4610dbb249c1e6be7ef9", + "0xa1d7fb3aecb896df3a52d6bd0943838b13f1bd039c936d76d03de2044c371d48865694b6f532393b27fd10a4cf642061", + "0xa34bca58a24979be442238cbb5ece5bee51ae8c0794dd3efb3983d4db713bc6f28a96e976ac3bd9a551d3ed9ba6b3e22", + "0x817c608fc8cacdd178665320b5a7587ca21df8bdd761833c3018b967575d25e3951cf3d498a63619a3cd2ad4406f5f28", + "0x86c95707db0495689afd0c2e39e97f445f7ca0edffad5c8b4cacd1421f2f3cc55049dfd504f728f91534e20383955582", + "0x99c3b0bb15942c301137765d4e19502f65806f3b126dc01a5b7820c87e8979bce6a37289a8f6a4c1e4637227ad5bf3bf", + "0x8aa1518a80ea8b074505a9b3f96829f5d4afa55a30efe7b4de4e5dbf666897fdd2cf31728ca45921e21a78a80f0e0f10", + "0x8d74f46361c79e15128ac399e958a91067ef4cec8983408775a87eca1eed5b7dcbf0ddf30e66f51780457413496c7f07", + "0xa41cde4a786b55387458a1db95171aca4fd146507b81c4da1e6d6e495527c3ec83fc42fad1dfe3d92744084a664fd431", + "0x8c352852c906fae99413a84ad11701f93f292fbf7bd14738814f4c4ceab32db02feb5eb70bc73898b0bc724a39d5d017", + "0xa5993046e8f23b71ba87b7caa7ace2d9023fb48ce4c51838813174880d918e9b4d2b0dc21a2b9c6f612338c31a289df8", + "0x83576d3324bf2d8afbfb6eaecdc5d767c8e22e7d25160414924f0645491df60541948a05e1f4202e612368e78675de8a", + "0xb43749b8df4b15bc9a3697e0f1c518e6b04114171739ef1a0c9c65185d8ec18e40e6954d125cbc14ebc652cf41ad3109", + "0xb4eebd5d80a7327a040cafb9ccdb12b2dfe1aa86e6bc6d3ac8a57fadfb95a5b1a7332c66318ff72ba459f525668af056", + "0x9198be7f1d413c5029b0e1c617bcbc082d21abe2c60ec8ce9b54ca1a85d3dba637b72fda39dae0c0ae40d047eab9f55a", + "0x8d96a0232832e24d45092653e781e7a9c9520766c3989e67bbe86b3a820c4bf621ea911e7cd5270a4bfea78b618411f6", + "0x8d7160d0ea98161a2d14d46ef01dff72d566c330cd4fabd27654d300e1bc7644c68dc8eabf2a20a59bfe7ba276545f9b", + "0xabb60fce29dec7ba37e3056e412e0ec3e05538a1fc0e2c68877378c867605966108bc5742585ab6a405ce0c962b285b6", + "0x8fabffa3ed792f05e414f5839386f6449fd9f7b41a47595c5d71074bd1bb3784cc7a1a7e1ad6b041b455035957e5b2dc", + "0x90ff017b4804c2d0533b72461436b10603ab13a55f86fd4ec11b06a70ef8166f958c110519ca1b4cc7beba440729fe2d", + "0xb340cfd120f6a4623e3a74cf8c32bfd7cd61a280b59dfd17b15ca8fae4d82f64a6f15fbde4c02f424debc72b7db5fe67", + "0x871311c9c7220c932e738d59f0ecc67a34356d1429fe570ca503d340c9996cb5ee2cd188fad0e3bd16e4c468ec1dbebd", + "0xa772470262186e7b94239ba921b29f2412c148d6f97c4412e96d21e55f3be73f992f1ad53c71008f0558ec3f84e2b5a7", + "0xb2a897dcb7ffd6257f3f2947ec966f2077d57d5191a88840b1d4f67effebe8c436641be85524d0a21be734c63ab5965d", + "0xa044f6eacc48a4a061fa149500d96b48cbf14853469aa4d045faf3dca973be1bd4b4ce01646d83e2f24f7c486d03205d", + "0x981af5dc2daa73f7fa9eae35a93d81eb6edba4a7f673b55d41f6ecd87a37685d31bb40ef4f1c469b3d72f2f18b925a17", + "0x912d2597a07864de9020ac77083eff2f15ceb07600f15755aba61251e8ce3c905a758453b417f04d9c38db040954eb65", + "0x9642b7f6f09394ba5e0805734ef6702c3eddf9eea187ba98c676d5bbaec0e360e3e51dc58433aaa1e2da6060c8659cb7", + "0x8ab3836e0a8ac492d5e707d056310c4c8e0489ca85eb771bff35ba1d658360084e836a6f51bb990f9e3d2d9aeb18fbb5", + "0x879e058e72b73bb1f4642c21ffdb90544b846868139c6511f299aafe59c2d0f0b944dffc7990491b7c4edcd6a9889250", + "0xb9e60b737023f61479a4a8fd253ed0d2a944ea6ba0439bbc0a0d3abf09b0ad1f18d75555e4a50405470ae4990626f390", + "0xb9c2535d362796dcd673640a9fa2ebdaec274e6f8b850b023153b0a7a30fffc87f96e0b72696f647ebe7ab63099a6963", + "0x94aeff145386a087b0e91e68a84a5ede01f978f9dd9fe7bebca78941938469495dc30a96bba9508c0d017873aeea9610", + "0x98b179f8a3d9f0d0a983c30682dd425a2ddc7803be59bd626c623c8951a5179117d1d2a68254c95c9952989877d0ee55", + "0x889ecf5f0ee56938273f74eb3e9ecfb5617f04fb58e83fe4c0e4aef51615cf345bc56f3f61b17f6eed3249d4afd54451", + "0xa0f2b2c39bcea4b50883e2587d16559e246248a66ecb4a4b7d9ab3b51fb39fe98d83765e087eee37a0f86b0ba4144c02", + "0xb2a61e247ed595e8a3830f7973b07079cbda510f28ad8c78c220b26cb6acde4fbb5ee90c14a665f329168ee951b08cf0", + "0x95bd0fcfb42f0d6d8a8e73d7458498a85bcddd2fb132fd7989265648d82ac2707d6d203fac045504977af4f0a2aca4b7", + "0x843e5a537c298666e6cf50fcc044f13506499ef83c802e719ff2c90e85003c132024e04711be7234c04d4b0125512d5d", + "0xa46d1797c5959dcd3a5cfc857488f4d96f74277c3d13b98b133620192f79944abcb3a361d939a100187f1b0856eae875", + "0xa1c7786736d6707a48515c38660615fcec67eb8a2598f46657855215f804fd72ab122d17f94fcffad8893f3be658dca7", + "0xb23dc9e610abc7d8bd21d147e22509a0fa49db5be6ea7057b51aae38e31654b3aa044df05b94b718153361371ba2f622", + "0xb00cc8f257d659c22d30e6d641f79166b1e752ea8606f558e4cad6fc01532e8319ea4ee12265ba4140ac45aa4613c004", + "0xac7019af65221b0cc736287b32d7f1a3561405715ba9a6a122342e04e51637ba911c41573de53e4781f2230fdcb2475f", + "0x81a630bc41b3da8b3eb4bf56cba10cd9f93153c3667f009dc332287baeb707d505fb537e6233c8e53d299ec0f013290c", + "0xa6b7aea5c545bb76df0f230548539db92bc26642572cb7dd3d5a30edca2b4c386f44fc8466f056b42de2a452b81aff5b", + "0x8271624ff736b7b238e43943c81de80a1612207d32036d820c11fc830c737972ccc9c60d3c2359922b06652311e3c994", + "0x8a684106458cb6f4db478170b9ad595d4b54c18bf63b9058f095a2fa1b928c15101472c70c648873d5887880059ed402", + "0xa5cc3c35228122f410184e4326cf61a37637206e589fcd245cb5d0cec91031f8f7586b80503070840fdfd8ce75d3c88b", + "0x9443fc631aed8866a7ed220890911057a1f56b0afe0ba15f0a0e295ab97f604b134b1ed9a4245e46ee5f9a93aa74f731", + "0x984b6f7d79835dffde9558c6bb912d992ca1180a2361757bdba4a7b69dc74b056e303adc69fe67414495dd9c2dd91e64", + "0xb15a5c8cba5de080224c274d31c68ed72d2a7126d347796569aef0c4e97ed084afe3da4d4b590b9dda1a07f0c2ff3dfb", + "0x991708fe9650a1f9a4e43938b91d45dc68c230e05ee999c95dbff3bf79b1c1b2bb0e7977de454237c355a73b8438b1d9", + "0xb4f7edc7468b176a4a7c0273700c444fa95c726af6697028bed4f77eee887e3400f9c42ee15b782c0ca861c4c3b8c98a", + "0x8c60dcc16c51087eb477c13e837031d6c6a3dc2b8bf8cb43c23f48006bc7173151807e866ead2234b460c2de93b31956", + "0x83ad63e9c910d1fc44bc114accfb0d4d333b7ebe032f73f62d25d3e172c029d5e34a1c9d547273bf6c0fead5c8801007", + "0x85de73213cc236f00777560756bdbf2b16841ba4b55902cf2cad9742ecaf5d28209b012ceb41f337456dfeca93010cd7", + "0xa7561f8827ccd75b6686ba5398bb8fc3083351c55a589b18984e186820af7e275af04bcd4c28e1dc11be1e8617a0610b", + "0x88c0a4febd4068850557f497ea888035c7fc9f404f6cc7794e7cc8722f048ad2f249e7dc62743e7a339eb7473ad3b0cd", + "0x932b22b1d3e6d5a6409c34980d176feb85ada1bf94332ef5c9fc4d42b907dabea608ceef9b5595ef3feee195151f18d8", + "0xa2867bb3f5ab88fbdae3a16c9143ab8a8f4f476a2643c505bb9f37e5b1fd34d216cab2204c9a017a5a67b7ad2dda10e8", + "0xb573d5f38e4e9e8a3a6fd82f0880dc049efa492a946d00283019bf1d5e5516464cf87039e80aef667cb86fdea5075904", + "0xb948f1b5ab755f3f5f36af27d94f503b070696d793b1240c1bdfd2e8e56890d69e6904688b5f8ff5a4bdf5a6abfe195f", + "0x917eae95ebc4109a2e99ddd8fec7881d2f7aaa0e25fda44dec7ce37458c2ee832f1829db7d2dcfa4ca0f06381c7fe91d", + "0x95751d17ed00a3030bce909333799bb7f4ab641acf585807f355b51d6976dceee410798026a1a004ef4dcdff7ec0f5b8", + "0xb9b7bd266f449a79bbfe075e429613e76c5a42ac61f01c8f0bbbd34669650682efe01ff9dbbc400a1e995616af6aa278", + "0xac1722d097ce9cd7617161f8ec8c23d68f1fb1c9ca533e2a8b4f78516c2fd8fb38f23f834e2b9a03bb06a9d655693ca9", + "0xa7ad9e96ffd98db2ecdb6340c5d592614f3c159abfd832fe27ee9293519d213a578e6246aae51672ee353e3296858873", + "0x989b8814d5de7937c4acafd000eec2b4cd58ba395d7b25f98cafd021e8efa37029b29ad8303a1f6867923f5852a220eb", + "0xa5bfe6282c771bc9e453e964042d44eff4098decacb89aecd3be662ea5b74506e1357ab26f3527110ba377711f3c9f41", + "0x8900a7470b656639721d2abbb7b06af0ac4222ab85a1976386e2a62eb4b88bfb5b72cf7921ddb3cf3a395d7eeb192a2e", + "0x95a71b55cd1f35a438cf5e75f8ff11c5ec6a2ebf2e4dba172f50bfad7d6d5dca5de1b1afc541662c81c858f7604c1163", + "0x82b5d62fea8db8d85c5bc3a76d68dedd25794cf14d4a7bc368938ffca9e09f7e598fdad2a5aac614e0e52f8112ae62b9", + "0x997173f07c729202afcde3028fa7f52cefc90fda2d0c8ac2b58154a5073140683e54c49ed1f254481070d119ce0ce02a", + "0xaeffb91ccc7a72bbd6ffe0f9b99c9e66e67d59cec2e02440465e9636a613ab3017278cfa72ea8bc4aba9a8dc728cb367", + "0x952743b06e8645894aeb6440fc7a5f62dd3acf96dab70a51e20176762c9751ea5f2ba0b9497ccf0114dc4892dc606031", + "0x874c63baeddc56fbbca2ff6031f8634b745f6e34ea6791d7c439201aee8f08ef5ee75f7778700a647f3b21068513fce6", + "0x85128fec9c750c1071edfb15586435cc2f317e3e9a175bb8a9697bcda1eb9375478cf25d01e7fed113483b28f625122d", + "0x85522c9576fd9763e32af8495ae3928ed7116fb70d4378448926bc9790e8a8d08f98cf47648d7da1b6e40d6a210c7924", + "0x97d0f37a13cfb723b848099ca1c14d83e9aaf2f7aeb71829180e664b7968632a08f6a85f557d74b55afe6242f2a36e7c", + "0xabaa472d6ad61a5fccd1a57c01aa1bc081253f95abbcba7f73923f1f11c4e79b904263890eeb66926de3e2652f5d1c70", + "0xb3c04945ba727a141e5e8aec2bf9aa3772b64d8fd0e2a2b07f3a91106a95cbcb249adcd074cbe498caf76fffac20d4ef", + "0x82c46781a3d730d9931bcabd7434a9171372dde57171b6180e5516d4e68db8b23495c8ac3ab96994c17ddb1cf249b9fb", + "0xa202d8b65613c42d01738ccd68ed8c2dbc021631f602d53f751966e04182743ebc8e0747d600b8a8676b1da9ae7f11ab", + "0xae73e7256e9459db04667a899e0d3ea5255211fb486d084e6550b6dd64ca44af6c6b2d59d7aa152de9f96ce9b58d940d", + "0xb67d87b176a9722945ec7593777ee461809861c6cfd1b945dde9ee4ff009ca4f19cf88f4bbb5c80c9cbab2fe25b23ac8", + "0x8f0b7a317a076758b0dac79959ee4a06c08b07d0f10538a4b53d3da2eda16e2af26922feb32c090330dc4d969cf69bd3", + "0x90b36bf56adbd8c4b6cb32febc3a8d5f714370c2ac3305c10fa6d168dffb2a026804517215f9a2d4ec8310cdb6bb459b", + "0xaa80c19b0682ead69934bf18cf476291a0beddd8ef4ed75975d0a472e2ab5c70f119722a8574ae4973aceb733d312e57", + "0xa3fc9abb12574e5c28dcb51750b4339b794b8e558675eef7d26126edf1de920c35e992333bcbffcbf6a5f5c0d383ce62", + "0xa1573ff23ab972acdcd08818853b111fc757fdd35aa070186d3e11e56b172fb49d840bf297ac0dd222e072fc09f26a81", + "0x98306f2be4caa92c2b4392212d0cbf430b409b19ff7d5b899986613bd0e762c909fc01999aa94be3bd529d67f0113d7f", + "0x8c1fc42482a0819074241746d17dc89c0304a2acdae8ed91b5009e9e3e70ff725ba063b4a3e68fdce05b74f5180c545e", + "0xa6c6113ebf72d8cf3163b2b8d7f3fa24303b13f55752522c660a98cd834d85d8c79214d900fa649499365e2e7641f77a", + "0xab95eea424f8a2cfd9fb1c78bb724e5b1d71a0d0d1e4217c5d0f98b0d8bbd3f8400a2002abc0a0e4576d1f93f46fefad", + "0x823c5a4fd8cf4a75fdc71d5f2dd511b6c0f189b82affeacd2b7cfcad8ad1a5551227dcc9bfdb2e34b2097eaa00efbb51", + "0xb97314dfff36d80c46b53d87a61b0e124dc94018a0bb680c32765b9a2d457f833a7c42bbc90b3b1520c33a182580398d", + "0xb17566ee3dcc6bb3b004afe4c0136dfe7dd27df9045ae896dca49fb36987501ae069eb745af81ba3fc19ff037e7b1406", + "0xb0bdc0f55cfd98d331e3a0c4fbb776a131936c3c47c6bffdc3aaf7d8c9fa6803fbc122c2fefbb532e634228687d52174", + "0xaa5d9e60cc9f0598559c28bb9bdd52aa46605ab4ffe3d192ba982398e72cec9a2a44c0d0d938ce69935693cabc0887ea", + "0x802b6459d2354fa1d56c592ac1346c428dadea6b6c0a87bf7d309bab55c94e1cf31dd98a7a86bd92a840dd51f218b91b", + "0xa526914efdc190381bf1a73dd33f392ecf01350b9d3f4ae96b1b1c3d1d064721c7d6eec5788162c933245a3943f5ee51", + "0xb3b8fcf637d8d6628620a1a99dbe619eabb3e5c7ce930d6efd2197e261bf394b74d4e5c26b96c4b8009c7e523ccfd082", + "0x8f7510c732502a93e095aba744535f3928f893f188adc5b16008385fb9e80f695d0435bfc5b91cdad4537e87e9d2551c", + "0x97b90beaa56aa936c3ca45698f79273a68dd3ccd0076eab48d2a4db01782665e63f33c25751c1f2e070f4d1a8525bf96", + "0xb9fb798324b1d1283fdc3e48288e3861a5449b2ab5e884b34ebb8f740225324af86e4711da6b5cc8361c1db15466602f", + "0xb6d52b53cea98f1d1d4c9a759c25bf9d8a50b604b144e4912acbdbdc32aab8b9dbb10d64a29aa33a4f502121a6fb481c", + "0x9174ffff0f2930fc228f0e539f5cfd82c9368d26b074467f39c07a774367ff6cccb5039ac63f107677d77706cd431680", + "0xa33b6250d4ac9e66ec51c063d1a6a31f253eb29bbaed12a0d67e2eccfffb0f3a52750fbf52a1c2aaba8c7692346426e7", + "0xa97025fd5cbcebe8ef865afc39cd3ea707b89d4e765ec817fd021d6438e02fa51e3544b1fd45470c58007a08efac6edd", + "0xb32a78480edd9ff6ba2f1eec4088db5d6ceb2d62d7e59e904ecaef7bb4a2e983a4588e51692b3be76e6ffbc0b5f911a5", + "0xb5ab590ef0bb77191f00495b33d11c53c65a819f7d0c1f9dc4a2caa147a69c77a4fff7366a602d743ee1f395ce934c1e", + "0xb3fb0842f9441fb1d0ee0293b6efbc70a8f58d12d6f769b12872db726b19e16f0f65efbc891cf27a28a248b0ef9c7e75", + "0x9372ad12856fefb928ccb0d34e198df99e2f8973b07e9d417a3134d5f69e12e79ff572c4e03ccd65415d70639bc7c73e", + "0xaa8d6e83d09ce216bfe2009a6b07d0110d98cf305364d5529c170a23e693aabb768b2016befb5ada8dabdd92b4d012bb", + "0xa954a75791eeb0ce41c85200c3763a508ed8214b5945a42c79bfdcfb1ec4f86ad1dd7b2862474a368d4ac31911a2b718", + "0x8e2081cfd1d062fe3ab4dab01f68062bac802795545fede9a188f6c9f802cb5f884e60dbe866710baadbf55dc77c11a4", + "0xa2f06003b9713e7dd5929501ed485436b49d43de80ea5b15170763fd6346badf8da6de8261828913ee0dacd8ff23c0e1", + "0x98eecc34b838e6ffd1931ca65eec27bcdb2fdcb61f33e7e5673a93028c5865e0d1bf6d3bec040c5e96f9bd08089a53a4", + "0x88cc16019741b341060b95498747db4377100d2a5bf0a5f516f7dec71b62bcb6e779de2c269c946d39040e03b3ae12b7", + "0xad1135ccbc3019d5b2faf59a688eef2500697642be8cfbdf211a1ab59abcc1f24483e50d653b55ff1834675ac7b4978f", + "0xa946f05ed9972f71dfde0020bbb086020fa35b482cce8a4cc36dd94355b2d10497d7f2580541bb3e81b71ac8bba3c49f", + "0xa83aeed488f9a19d8cfd743aa9aa1982ab3723560b1cd337fc2f91ad82f07afa412b3993afb845f68d47e91ba4869840", + "0x95eebe006bfc316810cb71da919e5d62c2cebb4ac99d8e8ef67be420302320465f8b69873470982de13a7c2e23516be9", + "0xa55f8961295a11e91d1e5deadc0c06c15dacbfc67f04ccba1d069cba89d72aa3b3d64045579c3ea8991b150ac29366ae", + "0xb321991d12f6ac07a5de3c492841d1a27b0d3446082fbce93e7e1f9e8d8fe3b45d41253556261c21b70f5e189e1a7a6f", + "0xa0b0822f15f652ce7962a4f130104b97bf9529797c13d6bd8e24701c213cc37f18157bd07f3d0f3eae6b7cd1cb40401f", + "0x96e2fa4da378aa782cc2d5e6e465fc9e49b5c805ed01d560e9b98abb5c0de8b74a2e7bec3aa5e2887d25cccb12c66f0c", + "0x97e4ab610d414f9210ed6f35300285eb3ccff5b0b6a95ed33425100d7725e159708ea78704497624ca0a2dcabce3a2f9", + "0x960a375b17bdb325761e01e88a3ea57026b2393e1d887b34b8fa5d2532928079ce88dc9fd06a728b26d2bb41b12b9032", + "0x8328a1647398e832aadc05bd717487a2b6fcdaa0d4850d2c4da230c6a2ed44c3e78ec4837b6094f3813f1ee99414713f", + "0xaa283834ebd18e6c99229ce4b401eda83f01d904f250fedd4e24f1006f8fa0712a6a89a7296a9bf2ce8de30e28d1408e", + "0xb29e097f2caadae3e0f0ae3473c072b0cd0206cf6d2e9b22c1a5ad3e07d433e32bd09ed1f4e4276a2da4268633357b7f", + "0x9539c5cbba14538b2fe077ecf67694ef240da5249950baaabea0340718b882a966f66d97f08556b08a4320ceb2cc2629", + "0xb4529f25e9b42ae8cf8338d2eface6ba5cd4b4d8da73af502d081388135c654c0b3afb3aa779ffc80b8c4c8f4425dd2b", + "0x95be0739c4330619fbe7ee2249c133c91d6c07eab846c18c5d6c85fc21ac5528c5d56dcb0145af68ed0c6a79f68f2ccd", + "0xac0c83ea802227bfc23814a24655c9ff13f729619bcffdb487ccbbf029b8eaee709f8bddb98232ef33cd70e30e45ca47", + "0xb503becb90acc93b1901e939059f93e671900ca52c6f64ae701d11ac891d3a050b505d89324ce267bc43ab8275da6ffe", + "0x98e3811b55b1bacb70aa409100abb1b870f67e6d059475d9f278c751b6e1e2e2d6f2e586c81a9fb6597fda06e7923274", + "0xb0b0f61a44053fa6c715dbb0731e35d48dba257d134f851ee1b81fd49a5c51a90ebf5459ec6e489fce25da4f184fbdb1", + "0xb1d2117fe811720bb997c7c93fe9e4260dc50fca8881b245b5e34f724aaf37ed970cdad4e8fcb68e05ac8cf55a274a53", + "0xa10f502051968f14b02895393271776dee7a06db9de14effa0b3471825ba94c3f805302bdddac4d397d08456f620999d", + "0xa3dbad2ef060ae0bb7b02eaa4a13594f3f900450faa1854fc09620b01ac94ab896321dfb1157cf2374c27e5718e8026a", + "0xb550fdec503195ecb9e079dcdf0cad559d64d3c30818ef369b4907e813e689da316a74ad2422e391b4a8c2a2bef25fc0", + "0xa25ba865e2ac8f28186cea497294c8649a201732ecb4620c4e77b8e887403119910423df061117e5f03fc5ba39042db1", + "0xb3f88174e03fdb443dd6addd01303cf88a4369352520187c739fc5ae6b22fa99629c63c985b4383219dab6acc5f6f532", + "0x97a7503248e31e81b10eb621ba8f5210c537ad11b539c96dfb7cf72b846c7fe81bd7532c5136095652a9618000b7f8d3", + "0xa8bcdc1ce5aa8bfa683a2fc65c1e79de8ff5446695dcb8620f7350c26d2972a23da22889f9e2b1cacb3f688c6a2953dc", + "0x8458c111df2a37f5dd91a9bee6c6f4b79f4f161c93fe78075b24a35f9817da8dde71763218d627917a9f1f0c4709c1ed", + "0xac5f061a0541152b876cbc10640f26f1cc923c9d4ae1b6621e4bb3bf2cec59bbf87363a4eb72fb0e5b6d4e1c269b52d5", + "0xa9a25ca87006e8a9203cbb78a93f50a36694aa4aad468b8d80d3feff9194455ca559fcc63838128a0ab75ad78c07c13a", + "0xa450b85f5dfffa8b34dfd8bc985f921318efacf8857cf7948f93884ba09fb831482ee90a44224b1a41e859e19b74962f", + "0x8ed91e7f92f5c6d7a71708b6132f157ac226ecaf8662af7d7468a4fa25627302efe31e4620ad28719318923e3a59bf82", + "0xab524165fd4c71b1fd395467a14272bd2b568592deafa039d8492e9ef36c6d3f96927c95c72d410a768dc0b6d1fbbc9b", + "0xb662144505aa8432c75ffb8d10318526b6d5777ac7af9ebfad87d9b0866c364f7905a6352743bd8fd79ffd9d5dd4f3e6", + "0xa48f1677550a5cd40663bb3ba8f84caaf8454f332d0ceb1d94dbea52d0412fe69c94997f7749929712fd3995298572f7", + "0x8391cd6e2f6b0c242de1117a612be99776c3dc95cb800b187685ea5bf7e2722275eddb79fd7dfc8be8e389c4524cdf70", + "0x875d3acb9af47833b72900bc0a2448999d638f153c5e97e8a14ec02d0c76f6264353a7e275e1f1a5855daced523d243b", + "0x91f1823657d30b59b2f627880a9a9cb530f5aca28a9fd217fe6f2f5133690dfe7ad5a897872e400512db2e788b3f7628", + "0xad3564332aa56cea84123fc7ca79ea70bb4fef2009fa131cb44e4b15e8613bd11ca1d83b9d9bf456e4b7fee9f2e8b017", + "0x8c530b84001936d5ab366c84c0b105241a26d1fb163669f17c8f2e94776895c2870edf3e1bc8ccd04d5e65531471f695", + "0x932d01fa174fdb0c366f1230cffde2571cc47485f37f23ba5a1825532190cc3b722aeb1f15aed62cf83ccae9403ba713", + "0x88b28c20585aca50d10752e84b901b5c2d58efef5131479fbbe53de7bce2029e1423a494c0298e1497669bd55be97a5d", + "0xb914148ca717721144ebb3d3bf3fcea2cd44c30c5f7051b89d8001502f3856fef30ec167174d5b76265b55d70f8716b5", + "0x81d0173821c6ddd2a068d70766d9103d1ee961c475156e0cbd67d54e668a796310474ef698c7ab55abe6f2cf76c14679", + "0x8f28e8d78e2fe7fa66340c53718e0db4b84823c8cfb159c76eac032a62fb53da0a5d7e24ca656cf9d2a890cb2a216542", + "0x8a26360335c73d1ab51cec3166c3cf23b9ea51e44a0ad631b0b0329ef55aaae555420348a544e18d5760969281759b61", + "0x94f326a32ed287545b0515be9e08149eb0a565025074796d72387cc3a237e87979776410d78339e23ef3172ca43b2544", + "0xa785d2961a2fa5e70bffa137858a92c48fe749fee91b02599a252b0cd50d311991a08efd7fa5e96b78d07e6e66ffe746", + "0x94af9030b5ac792dd1ce517eaadcec1482206848bea4e09e55cc7f40fd64d4c2b3e9197027c5636b70d6122c51d2235d", + "0x9722869f7d1a3992850fe7be405ec93aa17dc4d35e9e257d2e469f46d2c5a59dbd504056c85ab83d541ad8c13e8bcd54", + "0xb13c4088b61a06e2c03ac9813a75ff1f68ffdfee9df6a8f65095179a475e29cc49119cad2ce05862c3b1ac217f3aace9", + "0x8c64d51774753623666b10ca1b0fe63ae42f82ed6aa26b81dc1d48c86937c5772eb1402624c52a154b86031854e1fb9f", + "0xb47e4df18002b7dac3fee945bf9c0503159e1b8aafcce2138818e140753011b6d09ef1b20894e08ba3006b093559061b", + "0x93cb5970076522c5a0483693f6a35ffd4ea2aa7aaf3730c4eccd6af6d1bebfc1122fc4c67d53898ae13eb6db647be7e2", + "0xa68873ef80986795ea5ed1a597d1cd99ed978ec25e0abb57fdcc96e89ef0f50aeb779ff46e3dce21dc83ada3157a8498", + "0x8cab67f50949cc8eee6710e27358aea373aae3c92849f8f0b5531c080a6300cdf2c2094fe6fecfef6148de0d28446919", + "0x993e932bcb616dbaa7ad18a4439e0565211d31071ef1b85a0627db74a05d978c60d507695eaeea5c7bd9868a21d06923", + "0xacdadff26e3132d9478a818ef770e9fa0d2b56c6f5f48bd3bd674436ccce9bdfc34db884a73a30c04c5f5e9764cb2218", + "0xa0d3e64c9c71f84c0eef9d7a9cb4fa184224b969db5514d678e93e00f98b41595588ca802643ea225512a4a272f5f534", + "0x91c9140c9e1ba6e330cb08f6b2ce4809cd0d5a0f0516f70032bf30e912b0ed684d07b413b326ab531ee7e5b4668c799b", + "0x87bc2ee7a0c21ba8334cd098e35cb703f9af57f35e091b8151b9b63c3a5b0f89bd7701dbd44f644ea475901fa6d9ef08", + "0x9325ccbf64bf5d71b303e31ee85d486298f9802c5e55b2c3d75427097bf8f60fa2ab4fcaffa9b60bf922c3e24fbd4b19", + "0x95d0506e898318f3dc8d28d16dfd9f0038b54798838b3c9be2a2ae3c2bf204eb496166353fc042220b0bd4f6673b9285", + "0x811de529416331fe9c416726d45df9434c29dcd7e949045eb15740f47e97dde8f31489242200e19922cac2a8b7c6fd1f", + "0xade632d04a4c8bbab6ca7df370b2213cb9225023e7973f0e29f4f5e52e8aeaabc65171306bbdd12a67b195dfbb96d48f", + "0x88b7f029e079b6ae956042c0ea75d53088c5d0efd750dd018adaeacf46be21bf990897c58578c491f41afd3978d08073", + "0x91f477802de507ffd2be3f4319903119225b277ad24f74eb50f28b66c14d32fae53c7edb8c7590704741af7f7f3e3654", + "0x809838b32bb4f4d0237e98108320d4b079ee16ed80c567e7548bd37e4d7915b1192880f4812ac0e00476d246aec1dbc8", + "0x84183b5fc4a7997a8ae5afedb4d21dce69c480d5966b5cbdafd6dd10d29a9a6377f3b90ce44da0eb8b176ac3af0253bb", + "0x8508abbf6d3739a16b9165caf0f95afb3b3ac1b8c38d6d374cf0c91296e2c1809a99772492b539cda184510bce8a0271", + "0x8722054e59bab2062e6419a6e45fc803af77fde912ef2cd23055ad0484963de65a816a2debe1693d93c18218d2b8e81a", + "0x8e895f80e485a7c4f56827bf53d34b956281cdc74856c21eb3b51f6288c01cc3d08565a11cc6f3e2604775885490e8c5", + "0xafc92714771b7aa6e60f3aee12efd9c2595e9659797452f0c1e99519f67c8bc3ac567119c1ddfe82a3e961ee9defea9a", + "0x818ff0fd9cefd32db87b259e5fa32967201016fc02ef44116cdca3c63ce5e637756f60477a408709928444a8ad69c471", + "0x8251e29af4c61ae806fc5d032347fb332a94d472038149225298389495139ce5678fae739d02dfe53a231598a992e728", + "0xa0ea39574b26643f6f1f48f99f276a8a64b5481989cfb2936f9432a3f8ef5075abfe5c067dc5512143ce8bf933984097", + "0xaf67a73911b372bf04e57e21f289fc6c3dfac366c6a01409b6e76fea4769bdb07a6940e52e8d7d3078f235c6d2f632c6", + "0xb5291484ef336024dd2b9b4cf4d3a6b751133a40656d0a0825bcc6d41c21b1c79cb50b0e8f4693f90c29c8f4358641f9", + "0x8bc0d9754d70f2cb9c63f991902165a87c6535a763d5eece43143b5064ae0bcdce7c7a8f398f2c1c29167b2d5a3e6867", + "0x8d7faff53579ec8f6c92f661c399614cc35276971752ce0623270f88be937c414eddcb0997e14724a783905a026c8883", + "0x9310b5f6e675fdf60796f814dbaa5a6e7e9029a61c395761e330d9348a7efab992e4e115c8be3a43d08e90d21290c892", + "0xb5eb4f3eb646038ad2a020f0a42202532d4932e766da82b2c1002bf9c9c2e5336b54c8c0ffcc0e02d19dde2e6a35b6cc", + "0x91dabfd30a66710f1f37a891136c9be1e23af4abf8cb751f512a40c022a35f8e0a4fb05b17ec36d4208de02d56f0d53a", + "0xb3ded14e82d62ac7a5a036122a62f00ff8308498f3feae57d861babaff5a6628d43f0a0c5fc903f10936bcf4e2758ceb", + "0xa88e8348fed2b26acca6784d19ef27c75963450d99651d11a950ea81d4b93acd2c43e0ecce100eaf7e78508263d5baf3", + "0xb1f5bbf7c4756877b87bb42163ac570e08c6667c4528bf68b5976680e19beeff7c5effd17009b0718797077e2955457a", + "0xad2e7b516243f915d4d1415326e98b1a7390ae88897d0b03b66c2d9bd8c3fba283d7e8fe44ed3333296a736454cef6d8", + "0x8f82eae096d5b11f995de6724a9af895f5e1c58d593845ad16ce8fcae8507e0d8e2b2348a0f50a1f66a17fd6fac51a5c", + "0x890e4404d0657c6c1ee14e1aac132ecf7a568bb3e04137b85ac0f84f1d333bd94993e8750f88eee033a33fb00f85dcc7", + "0x82ac7d3385e035115f1d39a99fc73e5919de44f5e6424579776d118d711c8120b8e5916372c6f27bed4cc64cac170b6c", + "0x85ee16d8901c272cfbbe966e724b7a891c1bd5e68efd5d863043ad8520fc409080af61fd726adc680b3f1186fe0ac8b8", + "0x86dc564c9b545567483b43a38f24c41c6551a49cabeebb58ce86404662a12dbfafd0778d30d26e1c93ce222e547e3898", + "0xa29f5b4522db26d88f5f95f18d459f8feefab02e380c2edb65aa0617a82a3c1a89474727a951cef5f15050bcf7b380fb", + "0xa1ce039c8f6cac53352899edb0e3a72c76da143564ad1a44858bd7ee88552e2fe6858d1593bbd74aeee5a6f8034b9b9d", + "0x97f10d77983f088286bd7ef3e7fdd8fa275a56bec19919adf33cf939a90c8f2967d2b1b6fc51195cb45ad561202a3ed7", + "0xa25e2772e8c911aaf8712bdac1dd40ee061c84d3d224c466cfaae8e5c99604053f940cde259bd1c3b8b69595781dbfec", + "0xb31bb95a0388595149409c48781174c340960d59032ab2b47689911d03c68f77a2273576fbe0c2bf4553e330656058c7", + "0xb8b2e9287ad803fb185a13f0d7456b397d4e3c8ad5078f57f49e8beb2e85f661356a3392dbd7bcf6a900baa5582b86a1", + "0xa3d0893923455eb6e96cc414341cac33d2dbc88fba821ac672708cce131761d85a0e08286663a32828244febfcae6451", + "0x82310cb42f647d99a136014a9f881eb0b9791efd2e01fc1841907ad3fc8a9654d3d1dab6689c3607214b4dc2aca01cee", + "0x874022d99c16f60c22de1b094532a0bc6d4de700ad01a31798fac1d5088b9a42ad02bef8a7339af7ed9c0d4f16b186ee", + "0x94981369e120265aed40910eebc37eded481e90f4596b8d57c3bec790ab7f929784bd33ddd05b7870aad6c02e869603b", + "0xa4f1f50e1e2a73f07095e0dd31cb45154f24968dae967e38962341c1241bcd473102fff1ff668b20c6547e9732d11701", + "0xae2328f3b0ad79fcda807e69a1b5278145225083f150f67511dafc97e079f860c3392675f1752ae7e864c056e592205b", + "0x875d8c971e593ca79552c43d55c8c73b17cd20c81ff2c2fed1eb19b1b91e4a3a83d32df150dbfd5db1092d0aebde1e1f", + "0xadd2e80aa46aae95da73a11f130f4bda339db028e24c9b11e5316e75ba5e63bc991d2a1da172c7c8e8fee038baae3433", + "0xb46dbe1cb3424002aa7de51e82f600852248e251465c440695d52538d3f36828ff46c90ed77fc1d11534fe3c487df8ef", + "0xa5e5045d28b4e83d0055863c30c056628c58d4657e6176fd0536f5933f723d60e851bb726d5bf3c546b8ce4ac4a57ef8", + "0x91fec01e86dd1537e498fff7536ea3ca012058b145f29d9ada49370cd7b7193ac380e116989515df1b94b74a55c45df3", + "0xa7428176d6918cd916a310bdc75483c72de660df48cac4e6e7478eef03205f1827ea55afc0df5d5fa7567d14bbea7fc9", + "0x851d89bef45d9761fe5fdb62972209335193610015e16a675149519f9911373bac0919add226ef118d9f3669cfdf4734", + "0xb74acf5c149d0042021cb2422ea022be4c4f72a77855f42393e71ffd12ebb3eec16bdf16f812159b67b79a9706e7156d", + "0x99f35dce64ec99aa595e7894b55ce7b5a435851b396e79036ffb249c28206087db4c85379df666c4d95857db02e21ff9", + "0xb6b9a384f70db9e298415b8ab394ee625dafff04be2886476e59df8d052ca832d11ac68a9b93fba7ab055b7bc36948a4", + "0x898ee4aefa923ffec9e79f2219c7389663eb11eb5b49014e04ed4a336399f6ea1691051d86991f4c46ca65bcd4fdf359", + "0xb0f948217b0d65df7599a0ba4654a5e43c84db477936276e6f11c8981efc6eaf14c90d3650107ed4c09af4cc8ec11137", + "0xaa6286e27ac54f73e63dbf6f41865dd94d24bc0cf732262fcaff67319d162bb43af909f6f8ee27b1971939cfbba08141", + "0x8bca7cdf730cf56c7b2c8a2c4879d61361a6e1dba5a3681a1a16c17a56e168ace0e99cf0d15826a1f5e67e6b8a8a049a", + "0xa746d876e8b1ce225fcafca603b099b36504846961526589af977a88c60d31ba2cc56e66a3dec8a77b3f3531bf7524c9", + "0xa11e2e1927e6704cdb8874c75e4f1842cef84d7d43d7a38e339e61dc8ba90e61bbb20dd3c12e0b11d2471d58eed245be", + "0xa36395e22bc1d1ba8b0459a235203177737397da5643ce54ded3459d0869ff6d8d89f50c73cb62394bf66a959cde9b90", + "0x8b49f12ba2fdf9aca7e5f81d45c07d47f9302a2655610e7634d1e4bd16048381a45ef2c95a8dd5b0715e4b7cf42273af", + "0x91cffa2a17e64eb7f76bccbe4e87280ee1dd244e04a3c9eac12e15d2d04845d876eb24fe2ec6d6d266cce9efb281077f", + "0xa6b8afabf65f2dee01788114e33a2f3ce25376fb47a50b74da7c3c25ff1fdc8aa9f41307534abbf48acb6f7466068f69", + "0x8d13db896ccfea403bd6441191995c1a65365cab7d0b97fbe9526da3f45a877bd1f4ef2edef160e8a56838cd1586330e", + "0x98c717de9e01bef8842c162a5e757fe8552d53269c84862f4d451e7c656ae6f2ae473767b04290b134773f63be6fdb9d", + "0x8c2036ace1920bd13cf018e82848c49eb511fad65fd0ff51f4e4b50cf3bfc294afb63cba682c16f52fb595a98fa84970", + "0xa3520fdff05dbad9e12551b0896922e375f9e5589368bcb2cc303bde252743b74460cb5caf99629325d3620f13adc796", + "0x8d4f83a5bfec05caf5910e0ce538ee9816ee18d0bd44c1d0da2a87715a23cd2733ad4d47552c6dc0eb397687d611dd19", + "0xa7b39a0a6a02823452d376533f39d35029867b3c9a6ad6bca181f18c54132d675613a700f9db2440fb1b4fa13c8bf18a", + "0x80bcb114b2544b80f404a200fc36860ed5e1ad31fe551acd4661d09730c452831751baa9b19d7d311600d267086a70bc", + "0x90dcce03c6f88fc2b08f2b42771eedde90cc5330fe0336e46c1a7d1b5a6c1641e5fcc4e7b3d5db00bd8afca9ec66ed81", + "0xaec15f40805065c98e2965b1ae12a6c9020cfdb094c2d0549acfc7ea2401a5fb48d3ea7d41133cf37c4e096e7ff53eb9", + "0x80e129b735dba49fa627a615d6c273119acec8e219b2f2c4373a332b5f98d66cbbdd688dfbe72a8f8bfefaccc02c50c1", + "0xa9b596da3bdfe23e6799ece5f7975bf7a1979a75f4f546deeaf8b34dfe3e0d623217cb4cf4ccd504cfa3625b88cd53f1", + "0xabcbbb70b16f6e517c0ab4363ab76b46e4ff58576b5f8340e5c0e8cc0e02621b6e23d742d73b015822a238b17cfd7665", + "0xa046937cc6ea6a2e1adae543353a9fe929c1ae4ad655be1cc051378482cf88b041e28b1e9a577e6ccff2d3570f55e200", + "0x831279437282f315e65a60184ef158f0a3dddc15a648dc552bdc88b3e6fe8288d3cfe9f0031846d81350f5e7874b4b33", + "0x993d7916fa213c6d66e7c4cafafc1eaec9a2a86981f91c31eb8a69c5df076c789cbf498a24c84e0ee77af95b42145026", + "0x823907a3b6719f8d49b3a4b7c181bd9bb29fcf842d7c70660c4f351852a1e197ca46cf5e879b47fa55f616fa2b87ce5e", + "0x8d228244e26132b234930ee14c75d88df0943cdb9c276a8faf167d259b7efc1beec2a87c112a6c608ad1600a239e9aae", + "0xab6e55766e5bfb0cf0764ed909a8473ab5047d3388b4f46faeba2d1425c4754c55c6daf6ad4751e634c618b53e549529", + "0xab0cab6860e55a84c5ad2948a7e0989e2b4b1fd637605634b118361497332df32d9549cb854b2327ca54f2bcb85eed8f", + "0xb086b349ae03ef34f4b25a57bcaa5d1b29bd94f9ebf87e22be475adfe475c51a1230c1ebe13506cb72c4186192451658", + "0x8a0b49d8a254ca6d91500f449cbbfbb69bb516c6948ac06808c65595e46773e346f97a5ce0ef7e5a5e0de278af22709c", + "0xac49de11edaaf04302c73c578cc0824bdd165c0d6321be1c421c1950e68e4f3589aa3995448c9699e93c6ebae8803e27", + "0x884f02d841cb5d8f4c60d1402469216b114ab4e93550b5bc1431756e365c4f870a9853449285384a6fa49e12ce6dc654", + "0xb75f3a28fa2cc8d36b49130cb7448a23d73a7311d0185ba803ad55c8219741d451c110f48b786e96c728bc525903a54f", + "0x80ae04dbd41f4a35e33f9de413b6ad518af0919e5a30cb0fa1b061b260420780bb674f828d37fd3b52b5a31673cbd803", + "0xb9a8011eb5fcea766907029bf743b45262db3e49d24f84503687e838651ed11cb64c66281e20a0ae9f6aa51acc552263", + "0x90bfdd75e2dc9cf013e22a5d55d2d2b8a754c96103a17524488e01206e67f8b6d52b1be8c4e3d5307d4fe06d0e51f54c", + "0xb4af353a19b06203a815ec43e79a88578cc678c46f5a954b85bc5c53b84059dddba731f3d463c23bfd5273885c7c56a4", + "0xaa125e96d4553b64f7140e5453ff5d2330318b69d74d37d283e84c26ad672fa00e3f71e530eb7e28be1e94afb9c4612e", + "0xa18e060aee3d49cde2389b10888696436bb7949a79ca7d728be6456a356ea5541b55492b2138da90108bd1ce0e6f5524", + "0x93e55f92bdbccc2de655d14b1526836ea2e52dba65eb3f87823dd458a4cb5079bf22ce6ef625cb6d6bfdd0995ab9a874", + "0x89f5a683526b90c1c3ceebbb8dc824b21cff851ce3531b164f6626e326d98b27d3e1d50982e507d84a99b1e04e86a915", + "0x83d1c38800361633a3f742b1cb2bfc528129496e80232611682ddbe403e92c2ac5373aea0bca93ecb5128b0b2b7a719e", + "0x8ecba560ac94905e19ce8d9c7af217bf0a145d8c8bd38e2db82f5e94cc3f2f26f55819176376b51f154b4aab22056059", + "0xa7e2a4a002b60291924850642e703232994acb4cfb90f07c94d1e0ecd2257bb583443283c20fc6017c37e6bfe85b7366", + "0x93ed7316fa50b528f1636fc6507683a672f4f4403e55e94663f91221cc198199595bd02eef43d609f451acc9d9b36a24", + "0xa1220a8ebc5c50ceed76a74bc3b7e0aa77f6884c71b64b67c4310ac29ce5526cb8992d6abc13ef6c8413ce62486a6795", + "0xb2f6eac5c869ad7f4a25161d3347093e2f70e66cd925032747e901189355022fab3038bca4d610d2f68feb7e719c110b", + "0xb703fa11a4d511ca01c7462979a94acb40b5d933759199af42670eb48f83df202fa0c943f6ab3b4e1cc54673ea3aab1e", + "0xb5422912afbfcb901f84791b04f1ddb3c3fbdc76d961ee2a00c5c320e06d3cc5b5909c3bb805df66c5f10c47a292b13d", + "0xad0934368da823302e1ac08e3ede74b05dfdbfffca203e97ffb0282c226814b65c142e6e15ec1e754518f221f01b30f7", + "0xa1dd302a02e37df15bf2f1147efe0e3c06933a5a767d2d030e1132f5c3ce6b98e216b6145eb39e1e2f74e76a83165b8d", + "0xa346aab07564432f802ae44738049a36f7ca4056df2d8f110dbe7fef4a3e047684dea609b2d03dc6bf917c9c2a47608f", + "0xb96c5f682a5f5d02123568e50f5d0d186e4b2c4c9b956ec7aabac1b3e4a766d78d19bd111adb5176b898e916e49be2aa", + "0x8a96676d56876fc85538db2e806e1cba20fd01aeb9fa3cb43ca6ca94a2c102639f65660db330e5d74a029bb72d6a0b39", + "0xab0048336bd5c3def1a4064eadd49e66480c1f2abb4df46e03afbd8a3342c2c9d74ee35d79f08f4768c1646681440984", + "0x888427bdf76caec90814c57ee1c3210a97d107dd88f7256f14f883ad0f392334b82be11e36dd8bfec2b37935177c7831", + "0xb622b282becf0094a1916fa658429a5292ba30fb48a4c8066ce1ddcefb71037948262a01c95bab6929ed3a76ba5db9fe", + "0xb5b9e005c1f456b6a368a3097634fb455723abe95433a186e8278dceb79d4ca2fbe21f8002e80027b3c531e5bf494629", + "0xa3c6707117a1e48697ed41062897f55d8119403eea6c2ee88f60180f6526f45172664bfee96bf61d6ec0b7fbae6aa058", + "0xb02a9567386a4fbbdb772d8a27057b0be210447348efe6feb935ceec81f361ed2c0c211e54787dc617cdffed6b4a6652", + "0xa9b8364e40ef15c3b5902e5534998997b8493064fa2bea99600def58279bb0f64574c09ba11e9f6f669a8354dd79dc85", + "0x9998a2e553a9aa9a206518fae2bc8b90329ee59ab23005b10972712389f2ec0ee746033c733092ffe43d73d33abbb8ef", + "0x843a4b34d9039bf79df96d79f2d15e8d755affb4d83d61872daf540b68c0a3888cf8fc00d5b8b247b38524bcb3b5a856", + "0x84f7128920c1b0bb40eee95701d30e6fc3a83b7bb3709f16d97e72acbb6057004ee7ac8e8f575936ca9dcb7866ab45f7", + "0x918d3e2222e10e05edb34728162a899ad5ada0aaa491aeb7c81572a9c0d506e31d5390e1803a91ff3bd8e2bb15d47f31", + "0x9442d18e2489613a7d47bb1cb803c8d6f3259d088cd079460976d87f7905ee07dea8f371b2537f6e1d792d36d7e42723", + "0xb491976970fe091995b2ed86d629126523ccf3e9daf8145302faca71b5a71a5da92e0e05b62d7139d3efac5c4e367584", + "0xaa628006235dc77c14cef4c04a308d66b07ac92d377df3de1a2e6ecfe3144f2219ad6d7795e671e1cb37a3641910b940", + "0x99d386adaea5d4981d7306feecac9a555b74ffdc218c907c5aa7ac04abaead0ec2a8237300d42a3fbc464673e417ceed", + "0x8f78e8b1556f9d739648ea3cab9606f8328b52877fe72f9305545a73b74d49884044ba9c1f1c6db7d9b7c7b7c661caba", + "0x8fb357ae49932d0babdf74fc7aa7464a65d3b6a2b3acf4f550b99601d3c0215900cfd67f2b6651ef94cfc323bac79fae", + "0x9906f2fa25c0290775aa001fb6198113d53804262454ae8b83ef371b5271bde189c0460a645829cb6c59f9ee3a55ce4d", + "0x8f4379b3ebb50e052325b27655ca6a82e6f00b87bf0d2b680d205dd2c7afdc9ff32a9047ae71a1cdf0d0ce6b9474d878", + "0xa85534e88c2bd43c043792eaa75e50914b21741a566635e0e107ae857aed0412035f7576cf04488ade16fd3f35fdbb87", + "0xb4ce93199966d3c23251ca7f28ec5af7efea1763d376b0385352ffb2e0a462ef95c69940950278cf0e3dafd638b7bd36", + "0xb10cb3d0317dd570aa73129f4acf63c256816f007607c19b423fb42f65133ce21f2f517e0afb41a5378cccf893ae14d0", + "0xa9b231c9f739f7f914e5d943ed9bff7eba9e2c333fbd7c34eb1648a362ee01a01af6e2f7c35c9fe962b11152cddf35de", + "0x99ff6a899e156732937fb81c0cced80ae13d2d44c40ba99ac183aa246103b31ec084594b1b7feb96da58f4be2dd5c0ed", + "0x8748d15d18b75ff2596f50d6a9c4ce82f61ecbcee123a6ceae0e43cab3012a29b6f83cf67b48c22f6f9d757c6caf76b2", + "0xb88ab05e4248b7fb634cf640a4e6a945d13e331237410f7217d3d17e3e384ddd48897e7a91e4516f1b9cbd30f35f238b", + "0x8d826deaeeb84a3b2d2c04c2300ca592501f992810582d6ae993e0d52f6283a839dba66c6c72278cff5871802b71173b", + "0xb36fed027c2f05a5ef625ca00b0364b930901e9e4420975b111858d0941f60e205546474bb25d6bfa6928d37305ae95f", + "0xaf2fcfc6b87967567e8b8a13a4ed914478185705724e56ce68fb2df6d1576a0cf34a61e880997a0d35dc2c3276ff7501", + "0xac351b919cd1fbf106feb8af2c67692bfcddc84762d18cea681cfa7470a5644839caace27efee5f38c87d3df306f4211", + "0x8d6665fb1d4d8d1fa23bd9b8a86e043b8555663519caac214d1e3e3effbc6bee7f2bcf21e645f77de0ced279d69a8a8b", + "0xa9fc1c2061756b2a1a169c1b149f212ff7f0d2488acd1c5a0197eba793cffa593fc6d1d1b40718aa75ca3ec77eff10e1", + "0xaff64f0fa009c7a6cf0b8d7a22ddb2c8170c3cb3eec082e60d5aadb00b0040443be8936d728d99581e33c22178c41c87", + "0x82e0b181adc5e3b1c87ff8598447260e839d53debfae941ebea38265575546c3a74a14b4325a030833a62ff6c52d9365", + "0xb7ad43cbb22f6f892c2a1548a41dc120ab1f4e1b8dea0cb6272dd9cb02054c542ecabc582f7e16de709d48f5166cae86", + "0x985e0c61094281532c4afb788ecb2dfcba998e974b5d4257a22040a161883908cdd068fe80f8eb49b8953cfd11acf43a", + "0xae46895c6d67ea6d469b6c9c07b9e5d295d9ae73b22e30da4ba2c973ba83a130d7eef39717ec9d0f36e81d56bf742671", + "0x8600177ea1f7e7ef90514b38b219a37dedfc39cb83297e4c7a5b479817ef56479d48cf6314820960c751183f6edf8b0e", + "0xb9208ec1c1d7a1e99b59c62d3e4e61dfb706b0e940d09d3abfc3454c19749083260614d89cfd7e822596c3cdbcc6bb95", + "0xa1e94042c796c2b48bc724352d2e9f3a22291d9a34705993357ddb6adabd76da6fc25dac200a8cb0b5bbd99ecddb7af6", + "0xb29c3adedd0bcad8a930625bc4dfdc3552a9afd5ca6dd9c0d758f978068c7982b50b711aa0eb5b97f2b84ee784637835", + "0xaf0632a238bb1f413c7ea8e9b4c3d68f2827bd2e38cd56024391fba6446ac5d19a780d0cfd4a78fe497d537b766a591a", + "0xaaf6e7f7d54f8ef5e2e45dd59774ecbeecf8683aa70483b2a75be6a6071b5981bbaf1627512a65d212817acdfab2e428", + "0x8c751496065da2e927cf492aa5ca9013b24f861d5e6c24b30bbf52ec5aaf1905f40f9a28175faef283dd4ed4f2182a09", + "0x8952377d8e80a85cf67d6b45499f3bad5fd452ea7bcd99efc1b066c4720d8e5bff1214cea90fd1f972a7f0baac3d29be", + "0xa1946ee543d1a6e21f380453be4d446e4130950c5fc3d075794eb8260f6f52d0a795c1ff91d028a648dc1ce7d9ab6b47", + "0x89f3fefe37af31e0c17533d2ca1ce0884cc1dc97c15cbfab9c331b8debd94781c9396abef4bb2f163d09277a08d6adf0", + "0xa2753f1e6e1a154fb117100a5bd9052137add85961f8158830ac20541ab12227d83887d10acf7fd36dcaf7c2596d8d23", + "0x814955b4198933ee11c3883863b06ff98c7eceb21fc3e09df5f916107827ccf3323141983e74b025f46ae00284c9513b", + "0x8cc5c6bb429073bfef47cae7b3bfccb0ffa076514d91a1862c6bda4d581e0df87db53cc6c130bf8a7826304960f5a34e", + "0x909f22c1f1cdc87f7be7439c831a73484a49acbf8f23d47087d7cf867c64ef61da3bde85dc57d705682b4c3fc710d36e", + "0x8048fee7f276fcd504aed91284f28e73693615e0eb3858fa44bcf79d7285a9001c373b3ef71d9a3054817ba293ebe28c", + "0x94400e5cf5d2700ca608c5fe35ce14623f71cc24959f2bc27ca3684092850f76b67fb1f07ca9e5b2ca3062cf8ad17bd4", + "0x81c2ae7d4d1b17f8b6de6a0430acc0d58260993980fe48dc2129c4948269cdc74f9dbfbf9c26b19360823fd913083d48", + "0x8c41fe765128e63f6889d6a979f6a4342300327c8b245a8cfe3ecfbcac1e09c3da30e2a1045b24b78efc6d6d50c8c6ac", + "0xa5dd4ae51ae48c8be4b218c312ade226cffce671cf121cb77810f6c0990768d6dd767badecb5c69921d5574d5e8433d3", + "0xb7642e325f4ba97ae2a39c1c9d97b35aafd49d53dba36aed3f3cb0ca816480b3394079f46a48252d46596559c90f4d58", + "0xae87375b40f35519e7bd4b1b2f73cd0b329b0c2cb9d616629342a71c6c304338445eda069b78ea0fbe44087f3de91e09", + "0xb08918cb6f736855e11d3daca1ddfbdd61c9589b203b5493143227bf48e2c77c2e8c94b0d1aa2fab2226e0eae83f2681", + "0xac36b84a4ac2ebd4d6591923a449c564e3be8a664c46092c09e875c2998eba16b5d32bfd0882fd3851762868e669f0b1", + "0xa44800a3bb192066fa17a3f29029a23697240467053b5aa49b9839fb9b9b8b12bcdcbfc557f024b61f4f51a9aacdefcb", + "0x9064c688fec23441a274cdf2075e5a449caf5c7363cc5e8a5dc9747183d2e00a0c69f2e6b3f6a7057079c46014c93b3b", + "0xaa367b021469af9f5b764a79bb3afbe2d87fe1e51862221672d1a66f954b165778b7c27a705e0f93841fab4c8468344d", + "0xa1a8bfc593d4ab71f91640bc824de5c1380ab2591cfdafcbc78a14b32de3c0e15f9d1b461d85c504baa3d4232c16bb53", + "0x97df48da1799430f528184d30b6baa90c2a2f88f34cdfb342d715339c5ebd6d019aa693cea7c4993daafc9849063a3aa", + "0xabd923831fbb427e06e0dd335253178a9e5791395c84d0ab1433c07c53c1209161097e9582fb8736f8a60bde62d8693e", + "0x84cd1a43f1a438b43dc60ffc775f646937c4f6871438163905a3cebf1115f814ccd38a6ccb134130bff226306e412f32", + "0x91426065996b0743c5f689eb3ca68a9f7b9e4d01f6c5a2652b57fa9a03d8dc7cd4bdbdab0ca5a891fee1e97a7f00cf02", + "0xa4bee50249db3df7fd75162b28f04e57c678ba142ce4d3def2bc17bcb29e4670284a45f218dad3969af466c62a903757", + "0x83141ebcc94d4681404e8b67a12a46374fded6df92b506aff3490d875919631408b369823a08b271d006d5b93136f317", + "0xa0ea1c8883d58d5a784da3d8c8a880061adea796d7505c1f903d07c287c5467f71e4563fc0faafbc15b5a5538b0a7559", + "0x89d9d480574f201a87269d26fb114278ed2c446328df431dc3556e3500e80e4cd01fcac196a2459d8646361ebda840df", + "0x8bf302978973632dd464bec819bdb91304712a3ec859be071e662040620422c6e75eba6f864f764cffa2799272efec39", + "0x922f666bc0fd58b6d7d815c0ae4f66d193d32fc8382c631037f59eeaeae9a8ca6c72d08e72944cf9e800b8d639094e77", + "0x81ad8714f491cdff7fe4399f2eb20e32650cff2999dd45b9b3d996d54a4aba24cc6c451212e78c9e5550368a1a38fb3f", + "0xb58fcf4659d73edb73175bd9139d18254e94c3e32031b5d4b026f2ed37aa19dca17ec2eb54c14340231615277a9d347e", + "0xb365ac9c2bfe409b710928c646ea2fb15b28557e0f089d39878e365589b9d1c34baf5566d20bb28b33bb60fa133f6eff", + "0x8fcae1d75b53ab470be805f39630d204853ca1629a14158bac2f52632277d77458dec204ff84b7b2d77e641c2045be65", + "0xa03efa6bebe84f4f958a56e2d76b5ba4f95dd9ed7eb479edc7cc5e646c8d4792e5b0dfc66cc86aa4b4afe2f7a4850760", + "0xaf1c823930a3638975fb0cc5c59651771b2719119c3cd08404fbd4ce77a74d708cefbe3c56ea08c48f5f10e6907f338f", + "0x8260c8299b17898032c761c325ac9cabb4c5b7e735de81eacf244f647a45fb385012f4f8df743128888c29aefcaaad16", + "0xab2f37a573c82e96a8d46198691cd694dfa860615625f477e41f91b879bc58a745784fccd8ffa13065834ffd150d881d", + "0x986c746c9b4249352d8e5c629e8d7d05e716b3c7aab5e529ca969dd1e984a14b5be41528baef4c85d2369a42d7209216", + "0xb25e32da1a8adddf2a6080725818b75bc67240728ad1853d90738485d8924ea1e202df0a3034a60ffae6f965ec55cf63", + "0xa266e627afcebcefea6b6b44cbc50f5c508f7187e87d047b0450871c2a030042c9e376f3ede0afcf9d1952f089582f71", + "0x86c3bbca4c0300606071c0a80dbdec21ce1dd4d8d4309648151c420854032dff1241a1677d1cd5de4e4de4385efda986", + "0xb9a21a1fe2d1f3273a8e4a9185abf2ff86448cc98bfa435e3d68306a2b8b4a6a3ea33a155be3cb62a2170a86f77679a5", + "0xb117b1ea381adce87d8b342cba3a15d492ff2d644afa28f22424cb9cbc820d4f7693dfc1a4d1b3697046c300e1c9b4c8", + "0x9004c425a2e68870d6c69b658c344e3aa3a86a8914ee08d72b2f95c2e2d8a4c7bb0c6e7e271460c0e637cec11117bf8e", + "0x86a18aa4783b9ebd9131580c8b17994825f27f4ac427b0929a1e0236907732a1c8139e98112c605488ee95f48bbefbfc", + "0x84042243b955286482ab6f0b5df4c2d73571ada00716d2f737ca05a0d2e88c6349e8ee9e67934cfee4a1775dbf7f4800", + "0x92c2153a4733a62e4e1d5b60369f3c26777c7d01cd3c8679212660d572bd3bac9b8a8a64e1f10f7dbf5eaa7579c4e423", + "0x918454b6bb8e44a2afa144695ba8d48ae08d0cdfef4ad078f67709eddf3bb31191e8b006f04e82ea45a54715ef4d5817", + "0xacf0b54f6bf34cf6ed6c2b39cf43194a40d68de6bcf1e4b82c34c15a1343e9ac3737885e1a30b78d01fa3a5125463db8", + "0xa7d60dbe4b6a7b054f7afe9ee5cbbfeca0d05dc619e6041fa2296b549322529faddb8a11e949562309aecefb842ac380", + "0x91ffb53e6d7e5f11159eaf13e783d6dbdfdb1698ed1e6dbf3413c6ea23492bbb9e0932230a9e2caac8fe899a17682795", + "0xb6e8d7be5076ee3565d5765a710c5ecf17921dd3cf555c375d01e958a365ae087d4a88da492a5fb81838b7b92bf01143", + "0xa8c6b763de2d4b2ed42102ef64eccfef31e2fb2a8a2776241c82912fa50fc9f77f175b6d109a97ede331307c016a4b1a", + "0x99839f86cb700c297c58bc33e28d46b92931961548deac29ba8df91d3e11721b10ea956c8e16984f9e4acf1298a79b37", + "0x8c2e2c338f25ea5c25756b7131cde0d9a2b35abf5d90781180a00fe4b8e64e62590dc63fe10a57fba3a31c76d784eb01", + "0x9687d7df2f41319ca5469d91978fed0565a5f11f829ebadaa83db92b221755f76c6eacd7700735e75c91e257087512e3", + "0x8795fdfb7ff8439c58b9bf58ed53873d2780d3939b902b9ddaaa4c99447224ced9206c3039a23c2c44bcc461e2bb637f", + "0xa803697b744d2d087f4e2307218d48fa88620cf25529db9ce71e2e3bbcc65bac5e8bb9be04777ef7bfb5ed1a5b8e6170", + "0x80f3d3efbbb9346ddd413f0a8e36b269eb5d7ff6809d5525ff9a47c4bcab2c01b70018b117f6fe05253775612ff70c6b", + "0x9050e0e45bcc83930d4c505af35e5e4d7ca01cd8681cba92eb55821aececcebe32bb692ebe1a4daac4e7472975671067", + "0x8d206812aac42742dbaf233e0c080b3d1b30943b54b60283515da005de05ea5caa90f91fedcfcba72e922f64d7040189", + "0xa2d44faaeb2eff7915c83f32b13ca6f31a6847b1c1ce114ea240bac3595eded89f09b2313b7915ad882292e2b586d5b4", + "0x961776c8576030c39f214ea6e0a3e8b3d32f023d2600958c098c95c8a4e374deeb2b9dc522adfbd6bda5949bdc09e2a2", + "0x993fa7d8447407af0fbcd9e6d77f815fa5233ab00674efbcf74a1f51c37481445ae291cc7b76db7c178f9cb0e570e0fc", + "0xabd5b1c78e05f9d7c8cc99bdaef8b0b6a57f2daf0f02bf492bec48ea4a27a8f1e38b5854da96efff11973326ff980f92", + "0x8f15af4764bc275e6ccb892b3a4362cacb4e175b1526a9a99944e692fe6ccb1b4fc19abf312bb2a089cb1f344d91a779", + "0xa09b27ccd71855512aba1d0c30a79ffbe7f6707a55978f3ced50e674b511a79a446dbc6d7946add421ce111135a460af", + "0x94b2f98ce86a9271fbd4153e1fc37de48421fe3490fb3840c00f2d5a4d0ba8810c6a32880b002f6374b59e0a7952518b", + "0x8650ac644f93bbcb88a6a0f49fee2663297fd4bc6fd47b6a89b9d8038d32370438ab3a4775ec9b58cb10aea8a95ef7b6", + "0x95e5c2f2e84eed88c6980bbba5a1c0bb375d5a628bff006f7516d45bb7d723da676add4fdd45956f312e7bab0f052644", + "0xb3278a3fa377ac93af7cfc9453f8cb594aae04269bbc99d2e0e45472ff4b6a2f97a26c4c57bf675b9d86f5e77a5d55d1", + "0xb4bcbe6eb666a206e2ea2f877912c1d3b5bdbd08a989fc4490eb06013e1a69ad1ba08bcdac048bf29192312be399077b", + "0xa76d70b78c99fffcbf9bb9886eab40f1ea4f99a309710b660b64cbf86057cbcb644d243f6e341711bb7ef0fedf0435a7", + "0xb2093c1ee945dca7ac76ad5aed08eae23af31dd5a77c903fd7b6f051f4ab84425d33a03c3d45bf2907bc93c02d1f3ad8", + "0x904b1f7534e053a265b22d20be859912b9c9ccb303af9a8d6f1d8f6ccdc5c53eb4a45a1762b880d8444d9be0cd55e7f9", + "0x8f664a965d65bc730c9ef1ec7467be984d4b8eb46bd9b0d64e38e48f94e6e55dda19aeac82cbcf4e1473440e64c4ca18", + "0x8bcee65c4cc7a7799353d07b114c718a2aae0cd10a3f22b7eead5185d159dafd64852cb63924bf87627d176228878bce", + "0x8c78f2e3675096fef7ebaa898d2615cd50d39ca3d8f02b9bdfb07e67da648ae4be3da64838dffc5935fd72962c4b96c7", + "0x8c40afd3701629421fec1df1aac4e849384ef2e80472c0e28d36cb1327acdf2826f99b357f3d7afdbc58a6347fc40b3c", + "0xa197813b1c65a8ea5754ef782522a57d63433ef752215ecda1e7da76b0412ee619f58d904abd2e07e0c097048b6ae1dd", + "0xa670542629e4333884ad7410f9ea3bd6f988df4a8f8a424ca74b9add2312586900cf9ae8bd50411f9146e82626b4af56", + "0xa19875cc07ab84e569d98b8b67fb1dbbdfb59093c7b748fae008c8904a6fd931a63ca8d03ab5fea9bc8d263568125a9b", + "0xb57e7f68e4eb1bd04aafa917b1db1bdab759a02aa8a9cdb1cba34ba8852b5890f655645c9b4e15d5f19bf37e9f2ffe9f", + "0x8abe4e2a4f6462b6c64b3f10e45db2a53c2b0d3c5d5443d3f00a453e193df771eda635b098b6c8604ace3557514027af", + "0x8459e4fb378189b22b870a6ef20183deb816cefbf66eca1dc7e86d36a2e011537db893729f500dc154f14ce24633ba47", + "0x930851df4bc7913c0d8c0f7bd3b071a83668987ed7c397d3d042fdc0d9765945a39a3bae83da9c88cb6b686ed8aeeb26", + "0x8078c9e5cd05e1a8c932f8a1d835f61a248b6e7133fcbb3de406bf4ffc0e584f6f9f95062740ba6008d98348886cf76b", + "0xaddff62bb29430983fe578e3709b0949cdc0d47a13a29bc3f50371a2cb5c822ce53e2448cfaa01bcb6e0aa850d5a380e", + "0x9433add687b5a1e12066721789b1db2edf9b6558c3bdc0f452ba33b1da67426abe326e9a34d207bfb1c491c18811bde1", + "0x822beda3389963428cccc4a2918fa9a8a51cf0919640350293af70821967108cded5997adae86b33cb917780b097f1ca", + "0xa7a9f52bda45e4148ed56dd176df7bd672e9b5ed18888ccdb405f47920fdb0844355f8565cefb17010b38324edd8315f", + "0xb35c3a872e18e607b2555c51f9696a17fa18da1f924d503b163b4ec9fe22ed0c110925275cb6c93ce2d013e88f173d6a", + "0xadf34b002b2b26ab84fc1bf94e05bd8616a1d06664799ab149363c56a6e0c807fdc473327d25632416e952ea327fcd95", + "0xae4a6b9d22a4a3183fac29e2551e1124a8ce4a561a9a2afa9b23032b58d444e6155bb2b48f85c7b6d70393274e230db7", + "0xa2ea3be4fc17e9b7ce3110284038d46a09e88a247b6971167a7878d9dcf36925d613c382b400cfa4f37a3ebea3699897", + "0x8e5863786b641ce3140fbfe37124d7ad3925472e924f814ebfc45959aaf3f61dc554a597610b5defaecc85b59a99b50f", + "0xaefde3193d0f700d0f515ab2aaa43e2ef1d7831c4f7859f48e52693d57f97fa9e520090f3ed700e1c966f4b76048e57f", + "0x841a50f772956622798e5cd208dc7534d4e39eddee30d8ce133383d66e5f267e389254a0cdae01b770ecd0a9ca421929", + "0x8fbc2bfd28238c7d47d4c03b1b910946c0d94274a199575e5b23242619b1de3497784e646a92aa03e3e24123ae4fcaba", + "0x926999579c8eec1cc47d7330112586bdca20b4149c8b2d066f527c8b9f609e61ce27feb69db67eea382649c6905efcf9", + "0xb09f31f305efcc65589adf5d3690a76cf339efd67cd43a4e3ced7b839507466e4be72dd91f04e89e4bbef629d46e68c0", + "0xb917361f6b95f759642638e0b1d2b3a29c3bdef0b94faa30de562e6078c7e2d25976159df3edbacbf43614635c2640b4", + "0x8e7e8a1253bbda0e134d62bfe003a2669d471b47bd2b5cde0ff60d385d8e62279d54022f5ac12053b1e2d3aaa6910b4c", + "0xb69671a3c64e0a99d90b0ed108ce1912ff8ed983e4bddd75a370e9babde25ee1f5efb59ec707edddd46793207a8b1fe7", + "0x910b2f4ebd37b7ae94108922b233d0920b4aba0bd94202c70f1314418b548d11d8e9caa91f2cd95aff51b9432d122b7f", + "0x82f645c90dfb52d195c1020346287c43a80233d3538954548604d09fbab7421241cde8593dbc4acc4986e0ea39a27dd9", + "0x8fee895f0a140d88104ce442fed3966f58ff9d275e7373483f6b4249d64a25fb5374bbdc6bce6b5ab0270c2847066f83", + "0x84f5bd7aab27b2509397aeb86510dd5ac0a53f2c8f73799bf720f2f87a52277f8d6b0f77f17bc80739c6a7119b7eb062", + "0x9903ceced81099d7e146e661bcf01cbaccab5ba54366b85e2177f07e2d8621e19d9c9c3eee14b9266de6b3f9b6ea75ae", + "0xb9c16ea2a07afa32dd6c7c06df0dec39bca2067a9339e45475c98917f47e2320f6f235da353fd5e15b477de97ddc68dd", + "0x9820a9bbf8b826bec61ebf886de2c4f404c1ebdc8bab82ee1fea816d9de29127ce1852448ff717a3fe8bbfe9e92012e5", + "0x817224d9359f5da6f2158c2c7bf9165501424f063e67ba9859a07ab72ee2ee62eb00ca6da821cfa19065c3282ca72c74", + "0x94b95c465e6cb00da400558a3c60cfec4b79b27e602ca67cbc91aead08de4b6872d8ea096b0dc06dca4525c8992b8547", + "0xa2b539a5bccd43fa347ba9c15f249b417997c6a38c63517ca38394976baa08e20be384a360969ff54e7e721db536b3e5", + "0x96caf707e34f62811ee8d32ccf28d8d6ec579bc33e424d0473529af5315c456fd026aa910c1fed70c91982d51df7d3ca", + "0x8a77b73e890b644c6a142bdbac59b22d6a676f3b63ddafb52d914bb9d395b8bf5aedcbcc90429337df431ebd758a07a6", + "0x8857830a7351025617a08bc44caec28d2fae07ebf5ffc9f01d979ce2a53839a670e61ae2783e138313929129790a51a1", + "0xaa3e420321ed6f0aa326d28d1a10f13facec6f605b6218a6eb9cbc074801f3467bf013a456d1415a5536f12599efa3d3", + "0x824aed0951957b00ea2f3d423e30328a3527bf6714cf9abbae84cf27e58e5c35452ba89ccc011de7c68c75d6e021d8f1", + "0xa2e87cc06bf202e953fb1081933d8b4445527dde20e38ed1a4f440144fd8fa464a2b73e068b140562e9045e0f4bd3144", + "0xae3b8f06ad97d7ae3a5e5ca839efff3e4824dc238c0c03fc1a8d2fc8aa546cdfd165b784a31bb4dec7c77e9305b99a4b", + "0xb30c3e12395b1fb8b776f3ec9f87c70e35763a7b2ddc68f0f60a4982a84017f27c891a98561c830038deb033698ed7fc", + "0x874e507757cd1177d0dff0b0c62ce90130324442a33da3b2c8ee09dbca5d543e3ecfe707e9f1361e7c7db641c72794bb", + "0xb53012dd10b5e7460b57c092eaa06d6502720df9edbbe3e3f61a9998a272bf5baaac4a5a732ad4efe35d6fac6feca744", + "0x85e6509d711515534d394e6cacbed6c81da710074d16ef3f4950bf2f578d662a494d835674f79c4d6315bced4defc5f0", + "0xb6132b2a34b0905dcadc6119fd215419a7971fe545e52f48b768006944b4a9d7db1a74b149e2951ea48c083b752d0804", + "0x989867da6415036d19b4bacc926ce6f4df7a556f50a1ba5f3c48eea9cefbb1c09da81481c8009331ee83f0859185e164", + "0x960a6c36542876174d3fbc1505413e29f053ed87b8d38fef3af180491c7eff25200b45dd5fe5d4d8e63c7e8c9c00f4c8", + "0x9040b59bd739d9cc2e8f6e894683429e4e876a8106238689ff4c22770ae5fdae1f32d962b30301fa0634ee163b524f35", + "0xaf3fcd0a45fe9e8fe256dc7eab242ef7f582dd832d147444483c62787ac820fafc6ca55d639a73f76bfa5e7f5462ab8f", + "0xb934c799d0736953a73d91e761767fdb78454355c4b15c680ce08accb57ccf941b13a1236980001f9e6195801cffd692", + "0x8871e8e741157c2c326b22cf09551e78da3c1ec0fc0543136f581f1550f8bab03b0a7b80525c1e99812cdbf3a9698f96", + "0xa8a977f51473a91d178ee8cfa45ffef8d6fd93ab1d6e428f96a3c79816d9c6a93cd70f94d4deda0125fd6816e30f3bea", + "0xa7688b3b0a4fc1dd16e8ba6dc758d3cfe1b7cf401c31739484c7fa253cce0967df1b290769bcefc9d23d3e0cb19e6218", + "0x8ae84322662a57c6d729e6ff9d2737698cc2da2daeb1f39e506618750ed23442a6740955f299e4a15dda6db3e534d2c6", + "0xa04a961cdccfa4b7ef83ced17ab221d6a043b2c718a0d6cc8e6f798507a31f10bf70361f70a049bc8058303fa7f96864", + "0xb463e39732a7d9daec8a456fb58e54b30a6e160aa522a18b9a9e836488cce3342bcbb2e1deab0f5e6ec0a8796d77197d", + "0xb1434a11c6750f14018a2d3bcf94390e2948f4f187e93bb22070ca3e5393d339dc328cbfc3e48815f51929465ffe7d81", + "0x84ff81d73f3828340623d7e3345553610aa22a5432217ef0ebd193cbf4a24234b190c65ca0873c22d10ea7b63bd1fbed", + "0xb6fe2723f0c47757932c2ddde7a4f8434f665612f7b87b4009c2635d56b6e16b200859a8ade49276de0ef27a2b6c970a", + "0x9742884ed7cd52b4a4a068a43d3faa02551a424136c85a9313f7cb58ea54c04aa83b0728fd741d1fe39621e931e88f8f", + "0xb7d2d65ea4d1ad07a5dee39e40d6c03a61264a56b1585b4d76fc5b2a68d80a93a42a0181d432528582bf08d144c2d6a9", + "0x88c0f66bada89f8a43e5a6ead2915088173d106c76f724f4a97b0f6758aed6ae5c37c373c6b92cdd4aea8f6261f3a374", + "0x81f9c43582cb42db3900747eb49ec94edb2284999a499d1527f03315fd330e5a509afa3bff659853570e9886aab5b28b", + "0x821f9d27d6beb416abf9aa5c79afb65a50ed276dbda6060103bc808bcd34426b82da5f23e38e88a55e172f5c294b4d40", + "0x8ba307b9e7cb63a6c4f3851b321aebfdb6af34a5a4c3bd949ff7d96603e59b27ff4dc4970715d35f7758260ff942c9e9", + "0xb142eb6c5f846de33227d0bda61d445a7c33c98f0a8365fe6ab4c1fabdc130849be597ef734305894a424ea715372d08", + "0xa732730ae4512e86a741c8e4c87fee8a05ee840fec0e23b2e037d58dba8dde8d10a9bc5191d34d00598941becbbe467f", + "0xadce6f7c30fd221f6b10a0413cc76435c4bb36c2d60bca821e5c67409fe9dbb2f4c36ef85eb3d734695e4be4827e9fd3", + "0xa74f00e0f9b23aff7b2527ce69852f8906dab9d6abe62ecd497498ab21e57542e12af9918d4fd610bb09e10b0929c510", + "0xa593b6b0ef26448ce4eb3ab07e84238fc020b3cb10d542ff4b16d4e2be1bcde3797e45c9cf753b8dc3b0ffdb63984232", + "0xaed3913afccf1aa1ac0eb4980eb8426d0baccebd836d44651fd72af00d09fac488a870223c42aca3ceb39752070405ae", + "0xb2c44c66a5ea7fde626548ba4cef8c8710191343d3dadfd3bb653ce715c0e03056a5303a581d47dde66e70ea5a2d2779", + "0x8e5029b2ccf5128a12327b5103f7532db599846e422531869560ceaff392236434d87159f597937dbf4054f810c114f4", + "0x82beed1a2c4477e5eb39fc5b0e773b30cfec77ef2b1bf17eadaf60eb35b6d0dd9d8cf06315c48d3546badb3f21cd0cca", + "0x90077bd6cc0e4be5fff08e5d07a5a158d36cebd1d1363125bc4fae0866ffe825b26f933d4ee5427ba5cd0c33c19a7b06", + "0xa7ec0d8f079970e8e34f0ef3a53d3e0e45428ddcef9cc776ead5e542ef06f3c86981644f61c5a637e4faf001fb8c6b3e", + "0xae6d4add6d1a6f90b22792bc9d40723ee6850c27d0b97eefafd5b7fd98e424aa97868b5287cc41b4fbd7023bca6a322c", + "0x831aa917533d077da07c01417feaa1408846363ba2b8d22c6116bb858a95801547dd88b7d7fa1d2e3f0a02bdeb2e103d", + "0x96511b860b07c8a5ed773f36d4aa9d02fb5e7882753bf56303595bcb57e37ccc60288887eb83bef08c657ec261a021a2", + "0x921d2a3e7e9790f74068623de327443666b634c8443aba80120a45bba450df920b2374d96df1ce3fb1b06dd06f8cf6e3", + "0xaa74451d51fe82b4581ead8e506ec6cd881010f7e7dd51fc388eb9a557db5d3c6721f81c151d08ebd9c2591689fbc13e", + "0xa972bfbcf4033d5742d08716c927c442119bdae336bf5dff914523b285ccf31953da2733759aacaa246a9af9f698342c", + "0xad1fcd0cae0e76840194ce4150cb8a56ebed728ec9272035f52a799d480dfc85840a4d52d994a18b6edb31e79be6e8ad", + "0xa2c69fe1d36f235215432dad48d75887a44c99dfa0d78149acc74087da215a44bdb5f04e6eef88ff7eff80a5a7decc77", + "0xa94ab2af2b6ee1bc6e0d4e689ca45380d9fbd3c5a65b9bd249d266a4d4c07bf5d5f7ef2ae6000623aee64027892bf8fe", + "0x881ec1fc514e926cdc66480ac59e139148ff8a2a7895a49f0dff45910c90cdda97b66441a25f357d6dd2471cddd99bb3", + "0x884e6d3b894a914c8cef946a76d5a0c8351843b2bffa2d1e56c6b5b99c84104381dd1320c451d551c0b966f4086e60f9", + "0x817c6c10ce2677b9fc5223500322e2b880583254d0bb0d247d728f8716f5e05c9ff39f135854342a1afecd9fbdcf7c46", + "0xaaf4a9cb686a14619aa1fc1ac285dd3843ac3dd99f2b2331c711ec87b03491c02f49101046f3c5c538dc9f8dba2a0ac2", + "0x97ecea5ce53ca720b5d845227ae61d70269a2f53540089305c86af35f0898bfd57356e74a8a5e083fa6e1ea70080bd31", + "0xa22d811e1a20a75feac0157c418a4bfe745ccb5d29466ffa854dca03e395b6c3504a734341746b2846d76583a780b32e", + "0x940cbaa0d2b2db94ae96b6b9cf2deefbfd059e3e5745de9aec4a25f0991b9721e5cd37ef71c631575d1a0c280b01cd5b", + "0xae33cb4951191258a11044682de861bf8d92d90ce751b354932dd9f3913f542b6a0f8a4dc228b3cd9244ac32c4582832", + "0xa580df5e58c4274fe0f52ac2da1837e32f5c9db92be16c170187db4c358f43e5cfdda7c5911dcc79d77a5764e32325f5", + "0x81798178cb9d8affa424f8d3be67576ba94d108a28ccc01d330c51d5a63ca45bb8ca63a2f569b5c5fe1303cecd2d777f", + "0x89975b91b94c25c9c3660e4af4047a8bacf964783010820dbc91ff8281509379cb3b24c25080d5a01174dd9a049118d5", + "0xa7327fcb3710ed3273b048650bde40a32732ef40a7e58cf7f2f400979c177944c8bc54117ba6c80d5d4260801dddab79", + "0x92b475dc8cb5be4b90c482f122a51bcb3b6c70593817e7e2459c28ea54a7845c50272af38119406eaadb9bcb993368d0", + "0x9645173e9ecefc4f2eae8363504f7c0b81d85f8949a9f8a6c01f2d49e0a0764f4eacecf3e94016dd407fc14494fce9f9", + "0x9215fd8983d7de6ae94d35e6698226fc1454977ae58d42d294be9aad13ac821562ad37d5e7ee5cdfe6e87031d45cd197", + "0x810360a1c9b88a9e36f520ab5a1eb8bed93f52deefbe1312a69225c0a08edb10f87cc43b794aced9c74220cefcc57e7d", + "0xad7e810efd61ed4684aeda9ed8bb02fb9ae4b4b63fda8217d37012b94ff1b91c0087043bfa4e376f961fff030c729f3b", + "0x8b07c95c6a06db8738d10bb03ec11b89375c08e77f0cab7e672ce70b2685667ca19c7e1c8b092821d31108ea18dfd4c7", + "0x968825d025ded899ff7c57245250535c732836f7565eab1ae23ee7e513201d413c16e1ba3f5166e7ac6cf74de8ceef4f", + "0x908243370c5788200703ade8164943ad5f8c458219186432e74dbc9904a701ea307fd9b94976c866e6c58595fd891c4b", + "0x959969d16680bc535cdc6339e6186355d0d6c0d53d7bbfb411641b9bf4b770fd5f575beef5deec5c4fa4d192d455c350", + "0xad177f4f826a961adeac76da40e2d930748effff731756c797eddc4e5aa23c91f070fb69b19221748130b0961e68a6bb", + "0x82f8462bcc25448ef7e0739425378e9bb8a05e283ce54aae9dbebaf7a3469f57833c9171672ad43a79778366c72a5e37", + "0xa28fb275b1845706c2814d9638573e9bc32ff552ebaed761fe96fdbce70395891ca41c400ae438369264e31a2713b15f", + "0x8a9c613996b5e51dadb587a787253d6081ea446bf5c71096980bf6bd3c4b69905062a8e8a3792de2d2ece3b177a71089", + "0x8d5aefef9f60cb27c1db2c649221204dda48bb9bf8bf48f965741da051340e8e4cab88b9d15c69f3f84f4c854709f48a", + "0x93ebf2ca6ad85ab6deace6de1a458706285b31877b1b4d7dcb9d126b63047efaf8c06d580115ec9acee30c8a7212fa55", + "0xb3ee46ce189956ca298057fa8223b7fd1128cf52f39159a58bca03c71dd25161ac13f1472301f72aef3e1993fe1ab269", + "0xa24d7a8d066504fc3f5027ccb13120e2f22896860e02c45b5eba1dbd512d6a17c28f39155ea581619f9d33db43a96f92", + "0xae9ceacbfe12137db2c1a271e1b34b8f92e4816bad1b3b9b6feecc34df0f8b3b0f7ed0133acdf59c537d43d33fc8d429", + "0x83967e69bf2b361f86361bd705dce0e1ad26df06da6c52b48176fe8dfcbeb03c462c1a4c9e649eff8c654b18c876fdef", + "0x9148e6b814a7d779c19c31e33a068e97b597de1f8100513db3c581190513edc4d544801ce3dd2cf6b19e0cd6daedd28a", + "0x94ccdafc84920d320ed22de1e754adea072935d3c5f8c2d1378ebe53d140ea29853f056fb3fb1e375846061a038cc9bc", + "0xafb43348498c38b0fa5f971b8cdd3a62c844f0eb52bc33daf2f67850af0880fce84ecfb96201b308d9e6168a0d443ae3", + "0x86d5736520a83538d4cd058cc4b4e84213ed00ebd6e7af79ae787adc17a92ba5359e28ba6c91936d967b4b28d24c3070", + "0xb5210c1ff212c5b1e9ef9126e08fe120a41e386bb12c22266f7538c6d69c7fd8774f11c02b81fd4e88f9137b020801fe", + "0xb78cfd19f94d24e529d0f52e18ce6185cb238edc6bd43086270fd51dd99f664f43dd4c7d2fe506762fbd859028e13fcf", + "0xa6e7220598c554abdcc3fdc587b988617b32c7bb0f82c06205467dbedb58276cc07cae317a190f19d19078773f4c2bbb", + "0xb88862809487ee430368dccd85a5d72fa4d163ca4aad15c78800e19c1a95be2192719801e315d86cff7795e0544a77e4", + "0x87ecb13a03921296f8c42ceb252d04716f10e09c93962239fcaa0a7fef93f19ab3f2680bc406170108bc583e9ff2e721", + "0xa810cd473832b6581c36ec4cb403f2849357ba2d0b54df98ef3004b8a530c078032922a81d40158f5fb0043d56477f6e", + "0xa247b45dd85ca7fbb718b328f30a03f03c84aef2c583fbdc9fcc9eb8b52b34529e8c8f535505c10598b1b4dac3d7c647", + "0x96ee0b91313c68bac4aa9e065ce9e1d77e51ca4cff31d6a438718c58264dee87674bd97fc5c6b8008be709521e4fd008", + "0x837567ad073e42266951a9a54750919280a2ac835a73c158407c3a2b1904cf0d17b7195a393c71a18ad029cbd9cf79ee", + "0xa6a469c44b67ebf02196213e7a63ad0423aab9a6e54acc6fcbdbb915bc043586993454dc3cd9e4be8f27d67c1050879b", + "0x8712d380a843b08b7b294f1f06e2f11f4ad6bcc655fdde86a4d8bc739c23916f6fad2b902fe47d6212f03607907e9f0e", + "0x920adfb644b534789943cdae1bdd6e42828dda1696a440af2f54e6b97f4f97470a1c6ea9fa6a2705d8f04911d055acd1", + "0xa161c73adf584a0061e963b062f59d90faac65c9b3a936b837a10d817f02fcabfa748824607be45a183dd40f991fe83f", + "0x874f4ecd408c76e625ea50bc59c53c2d930ee25baf4b4eca2440bfbffb3b8bc294db579caa7c68629f4d9ec24187c1ba", + "0x8bff18087f112be7f4aa654e85c71fef70eee8ae480f61d0383ff6f5ab1a0508f966183bb3fc4d6f29cb7ca234aa50d3", + "0xb03b46a3ca3bc743a173cbc008f92ab1aedd7466b35a6d1ca11e894b9482ea9dc75f8d6db2ddd1add99bfbe7657518b7", + "0x8b4f3691403c3a8ad9e097f02d130769628feddfa8c2b3dfe8cff64e2bed7d6e5d192c1e2ba0ac348b8585e94acd5fa1", + "0xa0d9ca4a212301f97591bf65d5ef2b2664766b427c9dd342e23cb468426e6a56be66b1cb41fea1889ac5d11a8e3c50a5", + "0x8c93ed74188ca23b3df29e5396974b9cc135c91fdefdea6c0df694c8116410e93509559af55533a3776ac11b228d69b1", + "0x82dd331fb3f9e344ebdeeb557769b86a2cc8cc38f6c298d7572a33aea87c261afa9dbd898989139b9fc16bc1e880a099", + "0xa65faedf326bcfd8ef98a51410c78b021d39206704e8291cd1f09e096a66b9b0486be65ff185ca224c45918ac337ddeb", + "0xa188b37d363ac072a766fd5d6fa27df07363feff1342217b19e3c37385e42ffde55e4be8355aceaa2f267b6d66b4ac41", + "0x810fa3ba3e96d843e3bafd3f2995727f223d3567c8ba77d684c993ba1773c66551eb5009897c51b3fe9b37196984f5ec", + "0x87631537541852da323b4353af45a164f68b304d24c01183bf271782e11687f3fcf528394e1566c2a26cb527b3148e64", + "0xb721cb2b37b3c477a48e3cc0044167d51ff568a5fd2fb606e5aec7a267000f1ddc07d3db919926ae12761a8e017c767c", + "0x904dfad4ba2cc1f6e60d1b708438a70b1743b400164cd981f13c064b8328d5973987d4fb9cf894068f29d3deaf624dfb", + "0xa70491538893552c20939fae6be2f07bfa84d97e2534a6bbcc0f1729246b831103505e9f60e97a8fa7d2e6c1c2384579", + "0x8726cf1b26b41f443ff7485adcfddc39ace2e62f4d65dd0bb927d933e262b66f1a9b367ded5fbdd6f3b0932553ac1735", + "0xae8a11cfdf7aa54c08f80cb645e3339187ab3886babe9fae5239ba507bb3dd1c0d161ca474a2df081dcd3d63e8fe445e", + "0x92328719e97ce60e56110f30a00ac5d9c7a2baaf5f8d22355d53c1c77941e3a1fec7d1405e6fbf8959665fe2ba7a8cad", + "0x8d9d6255b65798d0018a8cccb0b6343efd41dc14ff2058d3eed9451ceaad681e4a0fa6af67b0a04318aa628024e5553d", + "0xb70209090055459296006742d946a513f0cba6d83a05249ee8e7a51052b29c0ca9722dc4af5f9816a1b7938a5dac7f79", + "0xaab7b766b9bf91786dfa801fcef6d575dc6f12b77ecc662eb4498f0312e54d0de9ea820e61508fc8aeee5ab5db529349", + "0xa8104b462337748b7f086a135d0c3f87f8e51b7165ca6611264b8fb639d9a2f519926cb311fa2055b5fadf03da70c678", + "0xb0d2460747d5d8b30fc6c6bd0a87cb343ddb05d90a51b465e8f67d499cfc5e3a9e365da05ae233bbee792cdf90ec67d5", + "0xaa55f5bf3815266b4a149f85ed18e451c93de9163575e3ec75dd610381cc0805bb0a4d7c4af5b1f94d10231255436d2c", + "0x8d4c6a1944ff94426151909eb5b99cfd92167b967dabe2bf3aa66bb3c26c449c13097de881b2cfc1bf052862c1ef7b03", + "0x8862296162451b9b6b77f03bf32e6df71325e8d7485cf3335d66fd48b74c2a8334c241db8263033724f26269ad95b395", + "0x901aa96deb26cda5d9321190ae6624d357a41729d72ef1abfd71bebf6139af6d690798daba53b7bc5923462115ff748a", + "0x96c195ec4992728a1eb38cdde42d89a7bce150db43adbc9e61e279ea839e538deec71326b618dd39c50d589f78fc0614", + "0xb6ff8b8aa0837b99a1a8b46fb37f20ad4aecc6a98381b1308697829a59b8442ffc748637a88cb30c9b1f0f28a926c4f6", + "0x8d807e3dca9e7bef277db1d2cfb372408dd587364e8048b304eff00eacde2c723bfc84be9b98553f83cba5c7b3cba248", + "0x8800c96adb0195c4fc5b24511450dee503c32bf47044f5e2e25bd6651f514d79a2dd9b01cd8c09f3c9d3859338490f57", + "0x89fe366096097e38ec28dd1148887112efa5306cc0c3da09562aafa56f4eb000bf46ff79bf0bdd270cbde6bf0e1c8957", + "0xaf409a90c2776e1e7e3760b2042507b8709e943424606e31e791d42f17873a2710797f5baaab4cc4a19998ef648556b0", + "0x8d761863c9b6edbd232d35ab853d944f5c950c2b643f84a1a1327ebb947290800710ff01dcfa26dc8e9828481240e8b1", + "0x90b95e9be1e55c463ed857c4e0617d6dc3674e99b6aa62ed33c8e79d6dfcf7d122f4f4cc2ee3e7c5a49170cb617d2e2e", + "0xb3ff381efefabc4db38cc4727432e0301949ae4f16f8d1dea9b4f4de611cf5a36d84290a0bef160dac4e1955e516b3b0", + "0xa8a84564b56a9003adcadb3565dc512239fc79572762cda7b5901a255bc82656bb9c01212ad33d6bef4fbbce18dacc87", + "0x90a081890364b222eef54bf0075417f85e340d2fec8b7375995f598aeb33f26b44143ebf56fca7d8b4ebb36b5747b0eb", + "0xade6ee49e1293224ddf2d8ab7f14bb5be6bc6284f60fd5b3a1e0cf147b73cff57cf19763b8a36c5083badc79c606b103", + "0xb2fa99806dd2fa3de09320b615a2570c416c9bcdb052e592b0aead748bbe407ec9475a3d932ae48b71c2627eb81986a6", + "0x91f3b7b73c8ccc9392542711c45fe6f236057e6efad587d661ad5cb4d6e88265f86b807bb1151736b1009ab74fd7acb4", + "0x8800e2a46af96696dfbdcbf2ca2918b3dcf28ad970170d2d1783b52b8d945a9167d052beeb55f56c126da7ffa7059baa", + "0x9862267a1311c385956b977c9aa08548c28d758d7ba82d43dbc3d0a0fd1b7a221d39e8399997fea9014ac509ff510ac4", + "0xb7d24f78886fd3e2d283e18d9ad5a25c1a904e7d9b9104bf47da469d74f34162e27e531380dbbe0a9d051e6ffd51d6e7", + "0xb0f445f9d143e28b9df36b0f2c052da87ee2ca374d9d0fbe2eff66ca6fe5fe0d2c1951b428d58f7314b7e74e45d445ea", + "0xb63fc4083eabb8437dafeb6a904120691dcb53ce2938b820bb553da0e1eecd476f72495aacb72600cf9cad18698fd3db", + "0xb9ffd8108eaebd582d665f8690fe8bb207fd85185e6dd9f0b355a09bac1bbff26e0fdb172bc0498df025414e88fe2eda", + "0x967ed453e1f1a4c5b7b6834cc9f75c13f6889edc0cc91dc445727e9f408487bbf05c337103f61397a10011dfbe25d61d", + "0x98ceb673aff36e1987d5521a3984a07079c3c6155974bb8b413e8ae1ce84095fe4f7862fba7aefa14753eb26f2a5805f", + "0x85f01d28603a8fdf6ce6a50cb5c44f8a36b95b91302e3f4cd95c108ce8f4d212e73aec1b8d936520d9226802a2bd9136", + "0x88118e9703200ca07910345fbb789e7a8f92bd80bbc79f0a9e040e8767d33df39f6eded403a9b636eabf9101e588482a", + "0x90833a51eef1b10ed74e8f9bbd6197e29c5292e469c854eed10b0da663e2bceb92539710b1858bbb21887bd538d28d89", + "0xb513b905ec19191167c6193067b5cfdf5a3d3828375360df1c7e2ced5815437dfd37f0c4c8f009d7fb29ff3c8793f560", + "0xb1b6d405d2d18f9554b8a358cc7e2d78a3b34269737d561992c8de83392ac9a2857be4bf15de5a6c74e0c9d0f31f393c", + "0xb828bd3e452b797323b798186607849f85d1fb20c616833c0619360dfd6b3e3aa000fd09dafe4b62d74abc41072ff1a9", + "0x8efde67d0cca56bb2c464731879c9ac46a52e75bac702a63200a5e192b4f81c641f855ca6747752b84fe469cb7113b6c", + "0xb2762ba1c89ac3c9a983c242e4d1c2610ff0528585ed5c0dfc8a2c0253551142af9b59f43158e8915a1da7cc26b9df67", + "0x8a3f1157fb820d1497ef6b25cd70b7e16bb8b961b0063ad340d82a79ee76eb2359ca9e15e6d42987ed7f154f5eeaa2da", + "0xa75e29f29d38f09c879f971c11beb5368affa084313474a5ecafa2896180b9e47ea1995c2733ec46f421e395a1d9cffe", + "0x8e8c3dd3e7196ef0b4996b531ec79e4a1f211db5d5635e48ceb80ff7568b2ff587e845f97ee703bb23a60945ad64314a", + "0x8e7f32f4a3e3c584af5e3d406924a0aa34024c42eca74ef6cc2a358fd3c9efaf25f1c03aa1e66bb94b023a2ee2a1cace", + "0xab7dce05d59c10a84feb524fcb62478906b3fa045135b23afbede3bb32e0c678d8ebe59feabccb5c8f3550ea76cae44b", + "0xb38bb4b44d827f6fd3bd34e31f9186c59e312dbfadd4a7a88e588da10146a78b1f8716c91ad8b806beb8da65cab80c4c", + "0x9490ce9442bbbd05438c7f5c4dea789f74a7e92b1886a730544b55ba377840740a3ae4f2f146ee73f47c9278b0e233bc", + "0x83c003fab22a7178eed1a668e0f65d4fe38ef3900044e9ec63070c23f2827d36a1e73e5c2b883ec6a2afe2450171b3b3", + "0x9982f02405978ddc4fca9063ebbdb152f524c84e79398955e66fe51bc7c1660ec1afc3a86ec49f58d7b7dde03505731c", + "0xab337bd83ccdd2322088ffa8d005f450ced6b35790f37ab4534313315ee84312adc25e99cce052863a8bedee991729ed", + "0x8312ce4bec94366d88f16127a17419ef64285cd5bf9e5eda010319b48085966ed1252ed2f5a9fd3e0259b91bb65f1827", + "0xa60d5a6327c4041b0c00a1aa2f0af056520f83c9ce9d9ccd03a0bd4d9e6a1511f26a422ea86bd858a1f77438adf07e6c", + "0xb84a0a0b030bdad83cf5202aa9afe58c9820e52483ab41f835f8c582c129ee3f34aa096d11c1cd922eda02ea1196a882", + "0x8077d105317f4a8a8f1aadeb05e0722bb55f11abcb490c36c0904401107eb3372875b0ac233144829e734f0c538d8c1d", + "0x9202503bd29a6ec198823a1e4e098f9cfe359ed51eb5174d1ca41368821bfeebcbd49debfd02952c41359d1c7c06d2b1", + "0xabc28c155e09365cb77ffead8dc8f602335ef93b2f44e4ef767ce8fc8ef9dd707400f3a722e92776c2e0b40192c06354", + "0xb0f6d1442533ca45c9399e0a63a11f85ff288d242cea6cb3b68c02e77bd7d158047cae2d25b3bcd9606f8f66d9b32855", + "0xb01c3d56a0db84dc94575f4b6ee2de4beca3230e86bed63e2066beb22768b0a8efb08ebaf8ac3dedb5fe46708b084807", + "0x8c8634b0432159f66feaabb165842d1c8ac378f79565b1b90c381aa8450eb4231c3dad11ec9317b9fc2b155c3a771e32", + "0x8e67f623d69ecd430c9ee0888520b6038f13a2b6140525b056dc0951f0cfed2822e62cf11d952a483107c5c5acac4826", + "0x9590bb1cba816dd6acd5ac5fba5142c0a19d53573e422c74005e0bcf34993a8138c83124cad35a3df65879dba6134edd", + "0x801cd96cde0749021a253027118d3ea135f3fcdbe895db08a6c145641f95ebd368dd6a1568d995e1d0084146aebe224a", + "0x848b5d196427f6fc1f762ee3d36e832b64a76ec1033cfedc8b985dea93932a7892b8ef1035c653fb9dcd9ab2d9a44ac8", + "0xa1017eb83d5c4e2477e7bd2241b2b98c4951a3b391081cae7d75965cadc1acaec755cf350f1f3d29741b0828e36fedea", + "0x8d6d2785e30f3c29aad17bd677914a752f831e96d46caf54446d967cb2432be2c849e26f0d193a60bee161ea5c6fe90a", + "0x935c0ba4290d4595428e034b5c8001cbd400040d89ab00861108e8f8f4af4258e41f34a7e6b93b04bc253d3b9ffc13bf", + "0xaac02257146246998477921cef2e9892228590d323b839f3e64ea893b991b463bc2f47e1e5092ddb47e70b2f5bce7622", + "0xb921fde9412970a5d4c9a908ae8ce65861d06c7679af577cf0ad0d5344c421166986bee471fd6a6cecb7d591f06ec985", + "0x8ef4c37487b139d6756003060600bb6ebac7ea810b9c4364fc978e842f13ac196d1264fbe5af60d76ff6d9203d8e7d3f", + "0x94b65e14022b5cf6a9b95f94be5ace2711957c96f4211c3f7bb36206bd39cfbd0ea82186cab5ad0577a23214a5c86e9e", + "0xa31c166d2a2ca1d5a75a5920fef7532681f62191a50d8555fdaa63ba4581c3391cc94a536fc09aac89f64eafceec3f90", + "0x919a8cc128de01e9e10f5d83b08b52293fdd41bde2b5ae070f3d95842d4a16e5331cf2f3d61c765570c8022403610fa4", + "0xb23d6f8331eef100152d60483cfa14232a85ee712c8538c9b6417a5a7c5b353c2ac401390c6c215cb101f5cee6b5f43e", + "0xab357160c08a18319510a571eafff154298ce1020de8e1dc6138a09fcb0fcbcdd8359f7e9386bda00b7b9cdea745ffdc", + "0xab55079aea34afa5c0bd1124b9cdfe01f325b402fdfa017301bf87812eaa811ea5798c3aaf818074d420d1c782b10ada", + "0xade616010dc5009e7fc4f8d8b00dc716686a5fa0a7816ad9e503e15839d3b909b69d9dd929b7575376434ffec0d2bea8", + "0x863997b97ed46898a8a014599508fa3079f414b1f4a0c4fdc6d74ae8b444afa350f327f8bfc2a85d27f9e2d049c50135", + "0x8d602ff596334efd4925549ed95f2aa762b0629189f0df6dbb162581657cf3ea6863cd2287b4d9c8ad52813d87fcd235", + "0xb70f68c596dcdeed92ad5c6c348578b26862a51eb5364237b1221e840c47a8702f0fbc56eb520a22c0eed99795d3903e", + "0x9628088f8e0853cefadee305a8bf47fa990c50fa96a82511bbe6e5dc81ef4b794e7918a109070f92fc8384d77ace226f", + "0x97e26a46e068b605ce96007197ecd943c9a23881862f4797a12a3e96ba2b8d07806ad9e2a0646796b1889c6b7d75188c", + "0xb1edf467c068cc163e2d6413cc22b16751e78b3312fe47b7ea82b08a1206d64415b2c8f2a677fa89171e82cc49797150", + "0xa44d15ef18745b251429703e3cab188420e2d974de07251501799b016617f9630643fcd06f895634d8ecdd579e1bf000", + "0xabd126df3917ba48c618ee4dbdf87df506193462f792874439043fa1b844466f6f4e0ff2e42516e63b5b23c0892b2695", + "0xa2a67f57c4aa3c2aa1eeddbfd5009a89c26c2ce8fa3c96a64626aba19514beb125f27df8559506f737de3eae0f1fc18f", + "0xa633e0132197e6038197304b296ab171f1d8e0d0f34dcf66fe9146ac385b0239232a8470b9205a4802ab432389f4836d", + "0xa914b3a28509a906c3821463b936455d58ff45dcbe158922f9efb2037f2eb0ce8e92532d29b5d5a3fcd0d23fa773f272", + "0xa0e1412ce4505daf1a2e59ce4f0fc0e0023e335b50d2b204422f57cd65744cc7a8ed35d5ef131a42c70b27111d3115b7", + "0xa2339e2f2b6072e88816224fdd612c04d64e7967a492b9f8829db15367f565745325d361fd0607b0def1be384d010d9e", + "0xa7309fc41203cb99382e8193a1dcf03ac190a7ce04835304eb7e341d78634e83ea47cb15b885601956736d04cdfcaa01", + "0x81f3ccd6c7f5b39e4e873365f8c37b214e8ab122d04a606fbb7339dc3298c427e922ec7418002561d4106505b5c399ee", + "0x92c121cf914ca549130e352eb297872a63200e99b148d88fbc9506ad882bec9d0203d65f280fb5b0ba92e336b7f932e8", + "0xa4b330cf3f064f5b131578626ad7043ce2a433b6f175feb0b52d36134a454ca219373fd30d5e5796410e005b69082e47", + "0x86fe5774112403ad83f9c55d58317eeb17ad8e1176d9f2f69c2afb7ed83bc718ed4e0245ceab4b377f5f062dcd4c00e7", + "0x809d152a7e2654c7fd175b57f7928365a521be92e1ed06c05188a95864ddb25f7cab4c71db7d61bbf4cae46f3a1d96ce", + "0xb82d663e55c2a5ada7e169e9b1a87bc1c0177baf1ec1c96559b4cb1c5214ce1ddf2ab8d345014cab6402f3774235cf5a", + "0x86580af86df1bd2c385adb8f9a079e925981b7184db66fc5fe5b14cddb82e7d836b06eaeef14924ac529487b23dae111", + "0xb5f5f4c5c94944ecc804df6ab8687d64e27d988cbfeae1ba7394e0f6adbf778c5881ead7cd8082dd7d68542b9bb4ecd5", + "0xa6016916146c2685c46e8fdd24186394e2d5496e77e08c0c6a709d4cd7dfa97f1efcef94922b89196819076a91ad37b5", + "0xb778e7367ded3b6eab53d5fc257f7a87e8faf74a593900f2f517220add2125be3f6142022660d8181df8d164ad9441ce", + "0x8581b2d36abe6f553add4d24be761bec1b8efaa2929519114346615380b3c55b59e6ad86990e312f7e234d0203bdf59b", + "0x9917e74fd45c3f71a829ff5498a7f6b5599b48c098dda2339bf04352bfc7f368ccf1a407f5835901240e76452ae807d7", + "0xafd196ce6f9335069138fd2e3d133134da253978b4ce373152c0f26affe77a336505787594022e610f8feb722f7cc1fb", + "0xa477491a1562e329764645e8f24d8e228e5ef28c9f74c6b5b3abc4b6a562c15ffb0f680d372aed04d9e1bf944dece7be", + "0x9767440d58c57d3077319d3a330e5322b9ba16981ec74a5a14d53462eab59ae7fd2b14025bfc63b268862094acb444e6", + "0x80986d921be3513ef69264423f351a61cb48390c1be8673aee0f089076086aaebea7ebe268fd0aa7182695606116f679", + "0xa9554c5c921c07b450ee04e34ec58e054ac1541b26ce2ce5a393367a97348ba0089f53db6660ad76b60278b66fd12e3e", + "0x95097e7d2999b3e84bf052c775581cf361325325f4a50192521d8f4693c830bed667d88f482dc1e3f833aa2bd22d2cbf", + "0x9014c91d0f85aefd28436b5228c12f6353c055a9326c7efbf5e071e089e2ee7c070fcbc84c5fafc336cbb8fa6fec1ca1", + "0x90f57ba36ee1066b55d37384942d8b57ae00f3cf9a3c1d6a3dfee1d1af42d4b5fa9baeb0cd7e46687d1d6d090ddb931d", + "0x8e4b1db12fd760a17214c9e47f1fce6e43c0dbb4589a827a13ac61aaae93759345697bb438a00edab92e0b7b62414683", + "0x8022a959a513cdc0e9c705e0fc04eafd05ff37c867ae0f31f6d01cddd5df86138a426cab2ff0ac8ff03a62e20f7e8f51", + "0x914e9a38829834c7360443b8ed86137e6f936389488eccf05b4b4db7c9425611705076ecb3f27105d24b85c852be7511", + "0x957fb10783e2bd0db1ba66b18e794df710bc3b2b05776be146fa5863c15b1ebdd39747b1a95d9564e1772cdfc4f37b8a", + "0xb6307028444daed8ed785ac9d0de76bc3fe23ff2cc7e48102553613bbfb5afe0ebe45e4212a27021c8eb870721e62a1f", + "0x8f76143597777d940b15a01b39c5e1b045464d146d9a30a6abe8b5d3907250e6c7f858ff2308f8591e8b0a7b3f3c568a", + "0x96163138ac0ce5fd00ae9a289648fd9300a0ca0f63a88481d703ecd281c06a52a3b5178e849e331f9c85ca4ba398f4cc", + "0xa63ef47c3e18245b0482596a09f488a716df3cbd0f9e5cfabed0d742843e65db8961c556f45f49762f3a6ac8b627b3ef", + "0x8cb595466552e7c4d42909f232d4063e0a663a8ef6f6c9b7ce3a0542b2459cde04e0e54c7623d404acb5b82775ac04f6", + "0xb47fe69960eb45f399368807cff16d941a5a4ebad1f5ec46e3dc8a2e4d598a7e6114d8f0ca791e9720fd786070524e2b", + "0x89eb5ff83eea9df490e5beca1a1fbbbbcf7184a37e2c8c91ede7a1e654c81e8cd41eceece4042ea7918a4f4646b67fd6", + "0xa84f5d155ed08b9054eecb15f689ba81e44589e6e7207a99790c598962837ca99ec12344105b16641ca91165672f7153", + "0xa6cc8f25c2d5b2d2f220ec359e6a37a52b95fa6af6e173c65e7cd55299eff4aa9e6d9e6f2769e6459313f1f2aecb0fab", + "0xafcde944411f017a9f7979755294981e941cc41f03df5e10522ef7c7505e5f1babdd67b3bf5258e8623150062eb41d9b", + "0x8fab39f39c0f40182fcd996ade2012643fe7731808afbc53f9b26900b4d4d1f0f5312d9d40b3df8baa4739970a49c732", + "0xae193af9726da0ebe7df1f9ee1c4846a5b2a7621403baf8e66c66b60f523e719c30c6b4f897bb14b27d3ff3da8392eeb", + "0x8ac5adb82d852eba255764029f42e6da92dcdd0e224d387d1ef94174038db9709ac558d90d7e7c57ad4ce7f89bbfc38c", + "0xa2066b3458fdf678ee487a55dd5bfb74fde03b54620cb0e25412a89ee28ad0d685e309a51e3e4694be2fa6f1593a344c", + "0x88d031745dd0ae07d61a15b594be5d4b2e2a29e715d081649ad63605e3404b0c3a5353f0fd9fad9c05c18e93ce674fa1", + "0x8283cfb0ef743a043f2b77ecaeba3005e2ca50435585b5dd24777ee6bce12332f85e21b446b536da38508807f0f07563", + "0xb376de22d5f6b0af0b59f7d9764561f4244cf8ffe22890ecd3dcf2ff1832130c9b821e068c9d8773136f4796721e5963", + "0xae3afc50c764f406353965363840bf28ee85e7064eb9d5f0bb3c31c64ab10f48c853e942ee2c9b51bae59651eaa08c2f", + "0x948b204d103917461a01a6c57a88f2d66b476eae5b00be20ec8c747650e864bc8a83aee0aff59cb7584b7a3387e0ee48", + "0x81ab098a082b07f896c5ffd1e4446cb7fb44804cbbf38d125208b233fc82f8ec9a6a8d8dd1c9a1162dc28ffeec0dde50", + "0xa149c6f1312821ced2969268789a3151bdda213451760b397139a028da609c4134ac083169feb0ee423a0acafd10eceb", + "0xb0ac9e27a5dadaf523010f730b28f0ebac01f460d3bbbe277dc9d44218abb5686f4fac89ae462682fef9edbba663520a", + "0x8d0e0073cca273daaaa61b6fc54bfe5a009bc3e20ae820f6c93ba77b19eca517d457e948a2de5e77678e4241807157cb", + "0xad61d3a2edf7c7533a04964b97499503fd8374ca64286dba80465e68fe932e96749b476f458c6fc57cb1a7ca85764d11", + "0x90eb5e121ae46bc01a30881eaa556f46bd8457a4e80787cf634aab355082de34ac57d7f497446468225f7721e68e2a47", + "0x8cdac557de7c42d1f3780e33dec1b81889f6352279be81c65566cdd4952d4c15d79e656cbd46035ab090b385e90245ef", + "0x82b67e61b88b84f4f4d4f65df37b3e3dcf8ec91ea1b5c008fdccd52da643adbe6468a1cfdb999e87d195afe2883a3b46", + "0x8503b467e8f5d6048a4a9b78496c58493a462852cab54a70594ae3fd064cfd0deb4b8f336a262155d9fedcaa67d2f6fd", + "0x8db56c5ac763a57b6ce6832930c57117058e3e5a81532b7d19346346205e2ec614eb1a2ee836ef621de50a7bc9b7f040", + "0xad344699198f3c6e8c0a3470f92aaffc805b76266734414c298e10b5b3797ca53578de7ccb2f458f5e0448203f55282b", + "0x80602032c43c9e2a09154cc88b83238343b7a139f566d64cb482d87436b288a98f1ea244fd3bff8da3c398686a900c14", + "0xa6385bd50ecd548cfb37174cdbb89e10025b5cadaf3cff164c95d7aef5a33e3d6a9bf0c681b9e11db9ef54ebeee2a0c1", + "0xabf2d95f4aa34b0581eb9257a0cc8462b2213941a5deb8ba014283293e8b36613951b61261cc67bbd09526a54cbbff76", + "0xa3d5de52f48df72c289ff713e445991f142390798cd42bd9d9dbefaee4af4f5faf09042d126b975cf6b98711c3072553", + "0x8e627302ff3d686cff8872a1b7c2a57b35f45bf2fc9aa42b049d8b4d6996a662b8e7cbac6597f0cb79b0cc4e29fbf133", + "0x8510702e101b39a1efbf4e504e6123540c34b5689645e70d0bac1ecc1baf47d86c05cef6c4317a4e99b4edaeb53f2d00", + "0xaa173f0ecbcc6088f878f8726d317748c81ebf501bba461f163b55d66099b191ec7c55f7702f351a9c8eb42cfa3280e2", + "0xb560a697eafab695bcef1416648a0a664a71e311ecbe5823ae903bd0ed2057b9d7574b9a86d3fe22aa3e6ddce38ea513", + "0x8df6304a3d9cf40100f3f687575419c998cd77e5cc27d579cf4f8e98642de3609af384a0337d145dd7c5635172d26a71", + "0x8105c7f3e4d30a29151849673853b457c1885c186c132d0a98e63096c3774bc9deb956cf957367e633d0913680bda307", + "0x95373fc22c0917c3c2044ac688c4f29a63ed858a45c0d6d2d0fe97afd6f532dcb648670594290c1c89010ecc69259bef", + "0x8c2fae9bcadab341f49b55230310df93cac46be42d4caa0d42e45104148a91e527af1b4209c0d972448162aed28fab64", + "0xb05a77baab70683f76209626eaefdda2d36a0b66c780a20142d23c55bd479ddd4ad95b24579384b6cf62c8eb4c92d021", + "0x8e6bc6a7ea2755b4aaa19c1c1dee93811fcde514f03485fdc3252f0ab7f032c315614f6336e57cea25dcfb8fb6084eeb", + "0xb656a27d06aade55eadae2ad2a1059198918ea6cc3fd22c0ed881294d34d5ac7b5e4700cc24350e27d76646263b223aa", + "0xa296469f24f6f56da92d713afcd4dd606e7da1f79dc4e434593c53695847eefc81c7c446486c4b3b8c8d00c90c166f14", + "0x87a326f57713ac2c9dffeb3af44b9f3c613a8f952676fc46343299122b47ee0f8d792abaa4b5db6451ced5dd153aabd0", + "0xb689e554ba9293b9c1f6344a3c8fcb6951d9f9eac4a2e2df13de021aade7c186be27500e81388e5b8bcab4c80f220a31", + "0x87ae0aa0aa48eac53d1ca5a7b93917de12db9e40ceabf8fdb40884ae771cfdf095411deef7c9f821af0b7070454a2608", + "0xa71ffa7eae8ace94e6c3581d4cb2ad25d48cbd27edc9ec45baa2c8eb932a4773c3272b2ffaf077b40f76942a1f3af7f2", + "0x94c218c91a9b73da6b7a495b3728f3028df8ad9133312fc0c03e8c5253b7ccb83ed14688fd4602e2fd41f29a0bc698bd", + "0xae1e77b90ca33728af07a4c03fb2ef71cd92e2618e7bf8ed4d785ce90097fc4866c29999eb84a6cf1819d75285a03af2", + "0xb7a5945b277dab9993cf761e838b0ac6eaa903d7111fca79f9fde3d4285af7a89bf6634a71909d095d7619d913972c9c", + "0x8c43b37be02f39b22029b20aca31bff661abce4471dca88aa3bddefd9c92304a088b2dfc8c4795acc301ca3160656af2", + "0xb32e5d0fba024554bd5fe8a793ebe8003335ddd7f585876df2048dcf759a01285fecb53daae4950ba57f3a282a4d8495", + "0x85ea7fd5e10c7b659df5289b2978b2c89e244f269e061b9a15fcab7983fc1962b63546e82d5731c97ec74b6804be63ef", + "0x96b89f39181141a7e32986ac02d7586088c5a9662cec39843f397f3178714d02f929af70630c12cbaba0268f8ba2d4fa", + "0x929ab1a2a009b1eb37a2817c89696a06426529ebe3f306c586ab717bd34c35a53eca2d7ddcdef36117872db660024af9", + "0xa696dccf439e9ca41511e16bf3042d7ec0e2f86c099e4fc8879d778a5ea79e33aa7ce96b23dc4332b7ba26859d8e674d", + "0xa8fe69a678f9a194b8670a41e941f0460f6e2dbc60470ab4d6ae2679cc9c6ce2c3a39df2303bee486dbfde6844e6b31a", + "0x95f58f5c82de2f2a927ca99bf63c9fc02e9030c7e46d0bf6b67fe83a448d0ae1c99541b59caf0e1ccab8326231af09a5", + "0xa57badb2c56ca2c45953bd569caf22968f76ed46b9bac389163d6fe22a715c83d5e94ae8759b0e6e8c2f27bff7748f3f", + "0x868726fd49963b24acb5333364dffea147e98f33aa19c7919dc9aca0fd26661cfaded74ede7418a5fadbe7f5ae67b67b", + "0xa8d8550dcc64d9f1dd7bcdab236c4122f2b65ea404bb483256d712c7518f08bb028ff8801f1da6aed6cbfc5c7062e33b", + "0x97e25a87dae23155809476232178538d4bc05d4ff0882916eb29ae515f2a62bfce73083466cc0010ca956aca200aeacc", + "0xb4ea26be3f4bd04aa82d7c4b0913b97bcdf5e88b76c57eb1a336cbd0a3eb29de751e1bc47c0e8258adec3f17426d0c71", + "0x99ee555a4d9b3cf2eb420b2af8e3bc99046880536116d0ce7193464ac40685ef14e0e3c442f604e32f8338cb0ef92558", + "0x8c64efa1da63cd08f319103c5c7a761221080e74227bbc58b8fb35d08aa42078810d7af3e60446cbaff160c319535648", + "0x8d9fd88040076c28420e3395cbdfea402e4077a3808a97b7939d49ecbcf1418fe50a0460e1c1b22ac3f6e7771d65169a", + "0xae3c19882d7a9875d439265a0c7003c8d410367627d21575a864b9cb4918de7dbdb58a364af40c5e045f3df40f95d337", + "0xb4f7bfacab7b2cafe393f1322d6dcc6f21ffe69cd31edc8db18c06f1a2b512c27bd0618091fd207ba8df1808e9d45914", + "0x94f134acd0007c623fb7934bcb65ef853313eb283a889a3ffa79a37a5c8f3665f3d5b4876bc66223610c21dc9b919d37", + "0xaa15f74051171daacdc1f1093d3f8e2d13da2833624b80a934afec86fc02208b8f55d24b7d66076444e7633f46375c6a", + "0xa32d6bb47ef9c836d9d2371807bafbbbbb1ae719530c19d6013f1d1f813c49a60e4fa51d83693586cba3a840b23c0404", + "0xb61b3599145ea8680011aa2366dc511a358b7d67672d5b0c5be6db03b0efb8ca5a8294cf220ea7409621f1664e00e631", + "0x859cafc3ee90b7ececa1ed8ef2b2fc17567126ff10ca712d5ffdd16aa411a5a7d8d32c9cab1fbf63e87dce1c6e2f5f53", + "0xa2fef1b0b2874387010e9ae425f3a9676d01a095d017493648bcdf3b31304b087ccddb5cf76abc4e1548b88919663b6b", + "0x939e18c73befc1ba2932a65ede34c70e4b91e74cc2129d57ace43ed2b3af2a9cc22a40fbf50d79a63681b6d98852866d", + "0xb3b4259d37b1b14aee5b676c9a0dd2d7f679ab95c120cb5f09f9fbf10b0a920cb613655ddb7b9e2ba5af4a221f31303c", + "0x997255fe51aaca6e5a9cb3359bcbf25b2bb9e30649bbd53a8a7c556df07e441c4e27328b38934f09c09d9500b5fabf66", + "0xabb91be2a2d860fd662ed4f1c6edeefd4da8dc10e79251cf87f06029906e7f0be9b486462718f0525d5e049472692cb7", + "0xb2398e593bf340a15f7801e1d1fbda69d93f2a32a889ec7c6ae5e8a37567ac3e5227213c1392ee86cfb3b56ec2787839", + "0x8ddf10ccdd72922bed36829a36073a460c2118fc7a56ff9c1ac72581c799b15c762cb56cb78e3d118bb9f6a7e56cb25e", + "0x93e6bc0a4708d16387cacd44cf59363b994dc67d7ada7b6d6dbd831c606d975247541b42b2a309f814c1bfe205681fc6", + "0xb93fc35c05998cffda2978e12e75812122831523041f10d52f810d34ff71944979054b04de0117e81ddf5b0b4b3e13c0", + "0x92221631c44d60d68c6bc7b287509f37ee44cbe5fdb6935cee36b58b17c7325098f98f7910d2c3ca5dc885ad1d6dabc7", + "0xa230124424a57fad3b1671f404a94d7c05f4c67b7a8fbacfccea28887b78d7c1ed40b92a58348e4d61328891cd2f6cee", + "0xa6a230edb8518a0f49d7231bc3e0bceb5c2ac427f045819f8584ba6f3ae3d63ed107a9a62aad543d7e1fcf1f20605706", + "0x845be1fe94223c7f1f97d74c49d682472585d8f772762baad8a9d341d9c3015534cc83d102113c51a9dea2ab10d8d27b", + "0xb44262515e34f2db597c8128c7614d33858740310a49cdbdf9c8677c5343884b42c1292759f55b8b4abc4c86e4728033", + "0x805592e4a3cd07c1844bc23783408310accfdb769cca882ad4d07d608e590a288b7370c2cb327f5336e72b7083a0e30f", + "0x95153e8b1140df34ee864f4ca601cb873cdd3efa634af0c4093fbaede36f51b55571ab271e6a133020cd34db8411241f", + "0x82878c1285cfa5ea1d32175c9401f3cc99f6bb224d622d3fd98cc7b0a27372f13f7ab463ce3a33ec96f9be38dbe2dfe3", + "0xb7588748f55783077c27fc47d33e20c5c0f5a53fc0ac10194c003aa09b9f055d08ec971effa4b7f760553997a56967b3", + "0xb36b4de6d1883b6951f59cfae381581f9c6352fcfcf1524fccdab1571a20f80441d9152dc6b48bcbbf00371337ca0bd5", + "0x89c5523f2574e1c340a955cbed9c2f7b5fbceb260cb1133160dabb7d41c2f613ec3f6e74bbfab3c4a0a6f0626dbe068f", + "0xa52f58cc39f968a9813b1a8ddc4e83f4219e4dd82c7aa1dd083bea7edf967151d635aa9597457f879771759b876774e4", + "0x8300a67c2e2e123f89704abfde095463045dbd97e20d4c1157bab35e9e1d3d18f1f4aaba9cbe6aa2d544e92578eaa1b6", + "0xac6a7f2918768eb6a43df9d3a8a04f8f72ee52f2e91c064c1c7d75cad1a3e83e5aba9fe55bb94f818099ac91ccf2e961", + "0x8d64a2b0991cf164e29835c8ddef6069993a71ec2a7de8157bbfa2e00f6367be646ed74cbaf524f0e9fe13fb09fa15fd", + "0x8b2ffe5a545f9f680b49d0a9797a4a11700a2e2e348c34a7a985fc278f0f12def6e06710f40f9d48e4b7fbb71e072229", + "0x8ab8f71cd337fa19178924e961958653abf7a598e3f022138b55c228440a2bac4176cea3aea393549c03cd38a13eb3fc", + "0x8419d28318c19ea4a179b7abb43669fe96347426ef3ac06b158d79c0acf777a09e8e770c2fb10e14b3a0421705990b23", + "0x8bacdac310e1e49660359d0a7a17fe3d334eb820e61ae25e84cb52f863a2f74cbe89c2e9fc3283745d93a99b79132354", + "0xb57ace3fa2b9f6b2db60c0d861ace7d7e657c5d35d992588aeed588c6ce3a80b6f0d49f8a26607f0b17167ab21b675e4", + "0x83e265cde477f2ecc164f49ddc7fb255bb05ff6adc347408353b7336dc3a14fdedc86d5a7fb23f36b8423248a7a67ed1", + "0xa60ada971f9f2d79d436de5d3d045f5ab05308cae3098acaf5521115134b2a40d664828bb89895840db7f7fb499edbc5", + "0xa63eea12efd89b62d3952bf0542a73890b104dd1d7ff360d4755ebfa148fd62de668edac9eeb20507967ea37fb220202", + "0xa0275767a270289adc991cc4571eff205b58ad6d3e93778ddbf95b75146d82517e8921bd0d0564e5b75fa0ccdab8e624", + "0xb9b03fd3bf07201ba3a039176a965d736b4ef7912dd9e9bf69fe1b57c330a6aa170e5521fe8be62505f3af81b41d7806", + "0xa95f640e26fb1106ced1729d6053e41a16e4896acac54992279ff873e5a969aad1dcfa10311e28b8f409ac1dab7f03bb", + "0xb144778921742418053cb3c70516c63162c187f00db2062193bb2c14031075dbe055d020cde761b26e8c58d0ea6df2c1", + "0x8432fbb799e0435ef428d4fefc309a05dd589bce74d7a87faf659823e8c9ed51d3e42603d878e80f439a38be4321c2fa", + "0xb08ddef14e42d4fd5d8bf39feb7485848f0060d43b51ed5bdda39c05fe154fb111d29719ee61a23c392141358c0cfcff", + "0x8ae3c5329a5e025b86b5370e06f5e61177df4bda075856fade20a17bfef79c92f54ed495f310130021ba94fb7c33632b", + "0x92b6d3c9444100b4d7391febfc1dddaa224651677c3695c47a289a40d7a96d200b83b64e6d9df51f534564f272a2c6c6", + "0xb432bc2a3f93d28b5e506d68527f1efeb2e2570f6be0794576e2a6ef9138926fdad8dd2eabfa979b79ab7266370e86bc", + "0x8bc315eacedbcfc462ece66a29662ca3dcd451f83de5c7626ef8712c196208fb3d8a0faf80b2e80384f0dd9772f61a23", + "0xa72375b797283f0f4266dec188678e2b2c060dfed5880fc6bb0c996b06e91a5343ea2b695adaab0a6fd183b040b46b56", + "0xa43445036fbaa414621918d6a897d3692fdae7b2961d87e2a03741360e45ebb19fcb1703d23f1e15bb1e2babcafc56ac", + "0xb9636b2ffe305e63a1a84bd44fb402442b1799bd5272638287aa87ca548649b23ce8ce7f67be077caed6aa2dbc454b78", + "0x99a30bf0921d854c282b83d438a79f615424f28c2f99d26a05201c93d10378ab2cd94a792b571ddae5d4e0c0013f4006", + "0x8648e3c2f93d70b392443be116b48a863e4b75991bab5db656a4ef3c1e7f645e8d536771dfe4e8d1ceda3be8d32978b0", + "0xab50dc9e6924c1d2e9d2e335b2d679fc7d1a7632e84964d3bac0c9fe57e85aa5906ec2e7b0399d98ddd022e9b19b5904", + "0xab729328d98d295f8f3272afaf5d8345ff54d58ff9884da14f17ecbdb7371857fdf2f3ef58080054e9874cc919b46224", + "0x83fa5da7592bd451cad3ad7702b4006332b3aae23beab4c4cb887fa6348317d234bf62a359e665b28818e5410c278a09", + "0x8bdbff566ae9d368f114858ef1f009439b3e9f4649f73efa946e678d6c781d52c69af195df0a68170f5f191b2eac286b", + "0x91245e59b4425fd4edb2a61d0d47c1ccc83d3ced8180de34887b9655b5dcda033d48cde0bdc3b7de846d246c053a02e8", + "0xa2cb00721e68f1cad8933947456f07144dc69653f96ceed845bd577d599521ba99cdc02421118971d56d7603ed118cbf", + "0xaf8cd66d303e808b22ec57860dd909ca64c27ec2c60e26ffecfdc1179d8762ffd2739d87b43959496e9fee4108df71df", + "0x9954136812dffcd5d3f167a500e7ab339c15cfc9b3398d83f64b0daa3dd5b9a851204f424a3493b4e326d3de81e50a62", + "0x93252254d12511955f1aa464883ad0da793f84d900fea83e1df8bca0f2f4cf5b5f9acbaec06a24160d33f908ab5fea38", + "0x997cb55c26996586ba436a95566bd535e9c22452ca5d2a0ded2bd175376557fa895f9f4def4519241ff386a063f2e526", + "0xa12c78ad451e0ac911260ade2927a768b50cb4125343025d43474e7f465cdc446e9f52a84609c5e7e87ae6c9b3f56cda", + "0xa789d4ca55cbba327086563831b34487d63d0980ba8cf55197c016702ed6da9b102b1f0709ce3da3c53ff925793a3d73", + "0xa5d76acbb76741ce85be0e655b99baa04f7f587347947c0a30d27f8a49ae78cce06e1cde770a8b618d3db402be1c0c4b", + "0x873c0366668c8faddb0eb7c86f485718d65f8c4734020f1a18efd5fa123d3ea8a990977fe13592cd01d17e60809cb5ff", + "0xb659b71fe70f37573ff7c5970cc095a1dc0da3973979778f80a71a347ef25ad5746b2b9608bad4ab9a4a53a4d7df42d7", + "0xa34cbe05888e5e5f024a2db14cb6dcdc401a9cbd13d73d3c37b348f68688f87c24ca790030b8f84fef9e74b4eab5e412", + "0x94ce8010f85875c045b0f014db93ef5ab9f1f6842e9a5743dce9e4cb872c94affd9e77c1f1d1ab8b8660b52345d9acb9", + "0xadefa9b27a62edc0c5b019ddd3ebf45e4de846165256cf6329331def2e088c5232456d3de470fdce3fa758bfdd387512", + "0xa6b83821ba7c1f83cc9e4529cf4903adb93b26108e3d1f20a753070db072ad5a3689643144bdd9c5ea06bb9a7a515cd0", + "0xa3a9ddedc2a1b183eb1d52de26718151744db6050f86f3580790c51d09226bf05f15111691926151ecdbef683baa992c", + "0xa64bac89e7686932cdc5670d07f0b50830e69bfb8c93791c87c7ffa4913f8da881a9d8a8ce8c1a9ce5b6079358c54136", + "0xa77b5a63452cb1320b61ab6c7c2ef9cfbcade5fd4727583751fb2bf3ea330b5ca67757ec1f517bf4d503ec924fe32fbd", + "0x8746fd8d8eb99639d8cd0ca34c0d9c3230ed5a312aab1d3d925953a17973ee5aeb66e68667e93caf9cb817c868ea8f3d", + "0x88a2462a26558fc1fbd6e31aa8abdc706190a17c27fdc4217ffd2297d1b1f3321016e5c4b2384c5454d5717dc732ed03", + "0xb78893a97e93d730c8201af2e0d3b31cb923d38dc594ffa98a714e627c473d42ea82e0c4d2eeb06862ee22a9b2c54588", + "0x920cc8b5f1297cf215a43f6fc843e379146b4229411c44c0231f6749793d40f07b9af7699fd5d21fd69400b97febe027", + "0xa0f0eafce1e098a6b58c7ad8945e297cd93aaf10bc55e32e2e32503f02e59fc1d5776936577d77c0b1162cb93b88518b", + "0x98480ba0064e97a2e7a6c4769b4d8c2a322cfc9a3b2ca2e67e9317e2ce04c6e1108169a20bd97692e1cb1f1423b14908", + "0x83dbbb2fda7e287288011764a00b8357753a6a44794cc8245a2275237f11affdc38977214e463ad67aec032f3dfa37e9", + "0x86442fff37598ce2b12015ff19b01bb8a780b40ad353d143a0f30a06f6d23afd5c2b0a1253716c855dbf445cc5dd6865", + "0xb8a4c60c5171189414887847b9ed9501bff4e4c107240f063e2d254820d2906b69ef70406c585918c4d24f1dd052142b", + "0x919f33a98e84015b2034b57b5ffe9340220926b2c6e45f86fd79ec879dbe06a148ae68b77b73bf7d01bd638a81165617", + "0x95c13e78d89474a47fbc0664f6f806744b75dede95a479bbf844db4a7f4c3ae410ec721cb6ffcd9fa9c323da5740d5ae", + "0xab7151acc41fffd8ec6e90387700bcd7e1cde291ea669567295bea1b9dd3f1df2e0f31f3588cd1a1c08af8120aca4921", + "0x80e74c5c47414bd6eeef24b6793fb1fa2d8fb397467045fcff887c52476741d5bc4ff8b6d3387cb53ad285485630537f", + "0xa296ad23995268276aa351a7764d36df3a5a3cffd7dbeddbcea6b1f77adc112629fdeffa0918b3242b3ccd5e7587e946", + "0x813d2506a28a2b01cb60f49d6bd5e63c9b056aa56946faf2f33bd4f28a8d947569cfead3ae53166fc65285740b210f86", + "0x924b265385e1646287d8c09f6c855b094daaee74b9e64a0dddcf9ad88c6979f8280ba30c8597b911ef58ddb6c67e9fe3", + "0x8d531513c70c2d3566039f7ca47cd2352fd2d55b25675a65250bdb8b06c3843db7b2d29c626eed6391c238fc651cf350", + "0x82b338181b62fdc81ceb558a6843df767b6a6e3ceedc5485664b4ea2f555904b1a45fbb35f6cf5d96f27da10df82a325", + "0x92e62faaedea83a37f314e1d3cb4faaa200178371d917938e59ac35090be1db4b4f4e0edb78b9c991de202efe4f313d8", + "0x99d645e1b642c2dc065bac9aaa0621bc648c9a8351efb6891559c3a41ba737bd155fb32d7731950514e3ecf4d75980e4", + "0xb34a13968b9e414172fb5d5ece9a39cf2eb656128c3f2f6cc7a9f0c69c6bae34f555ecc8f8837dc34b5e470e29055c78", + "0xa2a0bb7f3a0b23a2cbc6585d59f87cd7e56b2bbcb0ae48f828685edd9f7af0f5edb4c8e9718a0aaf6ef04553ba71f3b7", + "0x8e1a94bec053ed378e524b6685152d2b52d428266f2b6eadd4bcb7c4e162ed21ab3e1364879673442ee2162635b7a4d8", + "0x9944adaff14a85eab81c73f38f386701713b52513c4d4b838d58d4ffa1d17260a6d056b02334850ea9a31677c4b078bd", + "0xa450067c7eceb0854b3eca3db6cf38669d72cb7143c3a68787833cbca44f02c0be9bfbe082896f8a57debb13deb2afb1", + "0x8be4ad3ac9ef02f7df09254d569939757101ee2eda8586fefcd8c847adc1efe5bdcb963a0cafa17651befaafb376a531", + "0x90f6de91ea50255f148ac435e08cf2ac00c772a466e38155bd7e8acf9197af55662c7b5227f88589b71abe9dcf7ba343", + "0x86e5a24f0748b106dee2d4d54e14a3b0af45a96cbee69cac811a4196403ebbee17fd24946d7e7e1b962ac7f66dbaf610", + "0xafdd96fbcda7aa73bf9eeb2292e036c25753d249caee3b9c013009cc22e10d3ec29e2aa6ddbb21c4e949b0c0bccaa7f4", + "0xb5a4e7436d5473647c002120a2cb436b9b28e27ad4ebdd7c5f122b91597c507d256d0cbd889d65b3a908531936e53053", + "0xb632414c3da704d80ac2f3e5e0e9f18a3637cdc2ebeb613c29300745582427138819c4e7b0bec3099c1b8739dac1807b", + "0xa28df1464d3372ce9f37ef1db33cc010f752156afae6f76949d98cd799c0cf225c20228ae86a4da592d65f0cffe3951b", + "0x898b93d0a31f7d3f11f253cb7a102db54b669fd150da302d8354d8e02b1739a47cb9bd88015f3baf12b00b879442464e", + "0x96fb88d89a12049091070cb0048a381902965e67a8493e3991eaabe5d3b7ff7eecd5c94493a93b174df3d9b2c9511755", + "0xb899cb2176f59a5cfba3e3d346813da7a82b03417cad6342f19cc8f12f28985b03bf031e856a4743fd7ebe16324805b0", + "0xa60e2d31bc48e0c0579db15516718a03b73f5138f15037491f4dae336c904e312eda82d50862f4debd1622bb0e56d866", + "0x979fc8b987b5cef7d4f4b58b53a2c278bd25a5c0ea6f41c715142ea5ff224c707de38451b0ad3aa5e749aa219256650a", + "0xb2a75bff18e1a6b9cf2a4079572e41205741979f57e7631654a3c0fcec57c876c6df44733c9da3d863db8dff392b44a3", + "0xb7a0f0e811222c91e3df98ff7f286b750bc3b20d2083966d713a84a2281744199e664879401e77470d44e5a90f3e5181", + "0x82b74ba21c9d147fbc338730e8f1f8a6e7fc847c3110944eb17a48bea5e06eecded84595d485506d15a3e675fd0e5e62", + "0xa7f44eef817d5556f0d1abcf420301217d23c69dd2988f44d91ea1f1a16c322263cbacd0f190b9ba22b0f141b9267b4f", + "0xaadb68164ede84fc1cb3334b3194d84ba868d5a88e4c9a27519eef4923bc4abf81aab8114449496c073c2a6a0eb24114", + "0xb5378605fabe9a8c12a5dc55ef2b1de7f51aedb61960735c08767a565793cea1922a603a6983dc25f7cea738d0f7c40d", + "0xa97a4a5cd8d51302e5e670aee78fe6b5723f6cc892902bbb4f131e82ca1dfd5de820731e7e3367fb0c4c1922a02196e3", + "0x8bdfeb15c29244d4a28896f2b2cb211243cd6a1984a3f5e3b0ebe5341c419beeab3304b390a009ffb47588018034b0ea", + "0xa9af3022727f2aa2fca3b096968e97edad3f08edcbd0dbca107b892ae8f746a9c0485e0d6eb5f267999b23a845923ed0", + "0x8e7594034feef412f055590fbb15b6322dc4c6ab7a4baef4685bd13d71a83f7d682b5781bdfa0d1c659489ce9c2b8000", + "0x84977ca6c865ebee021c58106c1a4ad0c745949ecc5332948002fd09bd9b890524878d0c29da96fd11207621136421fe", + "0x8687551a79158e56b2375a271136756313122132a6670fa51f99a1b5c229ed8eea1655a734abae13228b3ebfd2a825dd", + "0xa0227d6708979d99edfc10f7d9d3719fd3fc68b0d815a7185b60307e4c9146ad2f9be2b8b4f242e320d4288ceeb9504c", + "0x89f75583a16735f9dd8b7782a130437805b34280ccea8dac6ecaee4b83fe96947e7b53598b06fecfffdf57ffc12cc445", + "0xa0056c3353227f6dd9cfc8e3399aa5a8f1d71edf25d3d64c982910f50786b1e395c508d3e3727ac360e3e040c64b5298", + "0xb070e61a6d813626144b312ded1788a6d0c7cec650a762b2f8df6e4743941dd82a2511cd956a3f141fc81e15f4e092da", + "0xb4e6db232e028a1f989bb5fc13416711f42d389f63564d60851f009dcffac01acfd54efa307aa6d4c0f932892d4e62b0", + "0x89b5991a67db90024ddd844e5e1a03ef9b943ad54194ae0a97df775dde1addf31561874f4e40fbc37a896630f3bbda58", + "0xad0e8442cb8c77d891df49cdb9efcf2b0d15ac93ec9be1ad5c3b3cca1f4647b675e79c075335c1f681d56f14dc250d76", + "0xb5d55a6ae65bb34dd8306806cb49b5ccb1c83a282ee47085cf26c4e648e19a52d9c422f65c1cd7e03ca63e926c5e92ea", + "0xb749501347e5ec07e13a79f0cb112f1b6534393458b3678a77f02ca89dca973fa7b30e55f0b25d8b92b97f6cb0120056", + "0x94144b4a3ffc5eec6ba35ce9c245c148b39372d19a928e236a60e27d7bc227d18a8cac9983851071935d8ffb64b3a34f", + "0x92bb4f9f85bc8c028a3391306603151c6896673135f8a7aefedd27acb322c04ef5dac982fc47b455d6740023e0dd3ea3", + "0xb9633a4a101461a782fc2aa092e9dbe4e2ad00987578f18cd7cf0021a909951d60fe79654eb7897806795f93c8ff4d1c", + "0x809f0196753024821b48a016eca5dbb449a7c55750f25981bb7a4b4c0e0846c09b8f6128137905055fc43a3f0deb4a74", + "0xa27dc9cdd1e78737a443570194a03d89285576d3d7f3a3cf15cc55b3013e42635d4723e2e8fe1d0b274428604b630db9", + "0x861f60f0462e04cd84924c36a28163def63e777318d00884ab8cb64c8df1df0bce5900342163edb60449296484a6c5bf", + "0xb7bc23fb4e14af4c4704a944253e760adefeca8caee0882b6bbd572c84434042236f39ae07a8f21a560f486b15d82819", + "0xb9a6eb492d6dd448654214bd01d6dc5ff12067a11537ab82023fc16167507ee25eed2c91693912f4155d1c07ed9650b3", + "0x97678af29c68f9a5e213bf0fb85c265303714482cfc4c2c00b4a1e8a76ed08834ee6af52357b143a1ca590fb0265ea5a", + "0x8a15b499e9eca5b6cac3070b5409e8296778222018ad8b53a5d1f6b70ad9bb10c68a015d105c941ed657bf3499299e33", + "0xb487fefede2e8091f2c7bfe85770db2edff1db83d4effe7f7d87bff5ab1ace35e9b823a71adfec6737fede8d67b3c467", + "0x8b51b916402aa2c437fce3bcad6dad3be8301a1a7eab9d163085b322ffb6c62abf28637636fe6114573950117fc92898", + "0xb06a2106d031a45a494adec0881cb2f82275dff9dcdd2bc16807e76f3bec28a6734edd3d54f0be8199799a78cd6228ad", + "0xaf0a185391bbe2315eb97feac98ad6dd2e5d931d012c621abd6e404a31cc188b286fef14871762190acf086482b2b5e2", + "0x8e78ee8206506dd06eb7729e32fceda3bebd8924a64e4d8621c72e36758fda3d0001af42443851d6c0aea58562870b43", + "0xa1ba52a569f0461aaf90b49b92be976c0e73ec4a2c884752ee52ffb62dd137770c985123d405dfb5de70692db454b54a", + "0x8d51b692fa1543c51f6b62b9acb8625ed94b746ef96c944ca02859a4133a5629da2e2ce84e111a7af8d9a5b836401c64", + "0xa7a20d45044cf6492e0531d0b8b26ffbae6232fa05a96ed7f06bdb64c2b0f5ca7ec59d5477038096a02579e633c7a3ff", + "0x84df867b98c53c1fcd4620fef133ee18849c78d3809d6aca0fb6f50ff993a053a455993f216c42ab6090fa5356b8d564", + "0xa7227c439f14c48e2577d5713c97a5205feb69acb0b449152842e278fa71e8046adfab468089c8b2288af1fc51fa945b", + "0x855189b3a105670779997690876dfaa512b4a25a24931a912c2f0f1936971d2882fb4d9f0b3d9daba77eaf660e9d05d5", + "0xb5696bd6706de51c502f40385f87f43040a5abf99df705d6aac74d88c913b8ecf7a99a63d7a37d9bdf3a941b9e432ff5", + "0xab997beb0d6df9c98d5b49864ef0b41a2a2f407e1687dfd6089959757ba30ed02228940b0e841afe6911990c74d536c4", + "0xb36b65f85546ebfdbe98823d5555144f96b4ab39279facd19c0de3b8919f105ba0315a0784dce4344b1bc62d8bb4a5a3", + "0xb8371f0e4450788720ac5e0f6cd3ecc5413d33895083b2c168d961ec2b5c3de411a4cc0712481cbe8df8c2fa1a7af006", + "0x98325d8026b810a8b7a114171ae59a57e8bbc9848e7c3df992efc523621729fd8c9f52114ce01d7730541a1ada6f1df1", + "0x8d0e76dbd37806259486cd9a31bc8b2306c2b95452dc395546a1042d1d17863ef7a74c636b782e214d3aa0e8d717f94a", + "0xa4e15ead76da0214d702c859fb4a8accdcdad75ed08b865842bd203391ec4cba2dcc916455e685f662923b96ee0c023f", + "0x8618190972086ebb0c4c1b4a6c94421a13f378bc961cc8267a301de7390c5e73c3333864b3b7696d81148f9d4843fd02", + "0x85369d6cc7342e1aa15b59141517d8db8baaaeb7ab9670f3ba3905353948d575923d283b7e5a05b13a30e7baf1208a86", + "0x87c51ef42233c24a6da901f28c9a075d9ba3c625687c387ad6757b72ca6b5a8885e6902a3082da7281611728b1e45f26", + "0xaa6348a4f71927a3106ad0ea8b02fc8d8c65531e4ab0bd0a17243e66f35afe252e40ab8eef9f13ae55a72566ffdaff5c", + "0x96a3bc976e9d03765cc3fee275fa05b4a84c94fed6b767e23ca689394501e96f56f7a97cffddc579a6abff632bf153be", + "0x97dbf96c6176379fdb2b888be4e757b2bca54e74124bd068d3fa1dbd82a011bbeb75079da38e0cd22a761fe208ecad9b", + "0xb70cf0a1d14089a4129ec4e295313863a59da8c7e26bf74cc0e704ed7f0ee4d7760090d0ddf7728180f1bf2c5ac64955", + "0x882d664714cc0ffe53cbc9bef21f23f3649824f423c4dbad1f893d22c4687ab29583688699efc4d5101aa08b0c3e267a", + "0x80ecb7cc963e677ccaddbe3320831dd6ee41209acf4ed41b16dc4817121a3d86a1aac9c4db3d8c08a55d28257088af32", + "0xa25ba667d832b145f9ce18c3f9b1bd00737aa36db020e1b99752c8ef7d27c6c448982bd8d352e1b6df266b8d8358a8d5", + "0x83734841c13dee12759d40bdd209b277e743b0d08cc0dd1e0b7afd2d65bfa640400eefcf6be4a52e463e5b3d885eeac6", + "0x848d16505b04804afc773aebabb51b36fd8aacfbb0e09b36c0d5d57df3c0a3b92f33e7d5ad0a7006ec46ebb91df42b8c", + "0x909a8d793f599e33bb9f1dc4792a507a97169c87cd5c087310bc05f30afcd247470b4b56dec59894c0fb1d48d39bb54e", + "0x8e558a8559df84a1ba8b244ece667f858095c50bb33a5381e60fcc6ba586b69693566d8819b4246a27287f16846c1dfa", + "0x84d6b69729f5aaa000cd710c2352087592cfbdf20d5e1166977e195818e593fa1a50d1e04566be23163a2523dc1612f1", + "0x9536d262b7a42125d89f4f32b407d737ba8d9242acfc99d965913ab3e043dcac9f7072a43708553562cac4cba841df30", + "0x9598548923ca119d6a15fd10861596601dd1dedbcccca97bb208cdc1153cf82991ea8cc17686fbaa867921065265970c", + "0xb87f2d4af6d026e4d2836bc3d390a4a18e98a6e386282ce96744603bab74974272e97ac2da281afa21885e2cbb3a8001", + "0x991ece62bf07d1a348dd22191868372904b9f8cf065ae7aa4e44fd24a53faf6d851842e35fb472895963aa1992894918", + "0xa8c53dea4c665b30e51d22ca6bc1bc78aaf172b0a48e64a1d4b93439b053877ec26cb5221c55efd64fa841bbf7d5aff4", + "0x93487ec939ed8e740f15335b58617c3f917f72d07b7a369befd479ae2554d04deb240d4a14394b26192efae4d2f4f35d", + "0xa44793ab4035443f8f2968a40e043b4555960193ffa3358d22112093aadfe2c136587e4139ffd46d91ed4107f61ea5e0", + "0xb13fe033da5f0d227c75927d3dacb06dbaf3e1322f9d5c7c009de75cdcba5e308232838785ab69a70f0bedea755e003f", + "0x970a29b075faccd0700fe60d1f726bdebf82d2cc8252f4a84543ebd3b16f91be42a75c9719a39c4096139f0f31393d58", + "0xa4c3eb1f7160f8216fc176fb244df53008ff32f2892363d85254002e66e2de21ccfe1f3b1047589abee50f29b9d507e3", + "0x8c552885eab04ba40922a8f0c3c38c96089c95ff1405258d3f1efe8d179e39e1295cbf67677894c607ae986e4e6b1fb0", + "0xb3671746fa7f848c4e2ae6946894defadd815230b906b419143523cc0597bc1d6c0a4c1e09d49b66b4a2c11cde3a4de3", + "0x937a249a95813a5e2ef428e355efd202e15a37d73e56cfb7e57ea9f943f2ce5ca8026f2f1fd25bf164ba89d07077d858", + "0x83646bdf6053a04aa9e2f112499769e5bd5d0d10f2e13db3ca89bd45c0b3b7a2d752b7d137fb3909f9c62b78166c9339", + "0xb4eac4b91e763666696811b7ed45e97fd78310377ebea1674b58a2250973f80492ac35110ed1240cd9bb2d17493d708c", + "0x82db43a99bc6573e9d92a3fd6635dbbb249ac66ba53099c3c0c8c8080b121dd8243cd5c6e36ba0a4d2525bae57f5c89c", + "0xa64d6a264a681b49d134c655d5fc7756127f1ee7c93d328820f32bca68869f53115c0d27fef35fe71f7bc4fdaed97348", + "0x8739b7a9e2b4bc1831e7f04517771bc7cde683a5e74e052542517f8375a2f64e53e0d5ac925ef722327e7bb195b4d1d9", + "0x8f337cdd29918a2493515ebb5cf702bbe8ecb23b53c6d18920cc22f519e276ca9b991d3313e2d38ae17ae8bdfa4f8b7e", + "0xb0edeab9850e193a61f138ef2739fc42ceec98f25e7e8403bfd5fa34a7bc956b9d0898250d18a69fa4625a9b3d6129da", + "0xa9920f26fe0a6d51044e623665d998745c9eca5bce12051198b88a77d728c8238f97d4196f26e43b24f8841500b998d0", + "0x86e655d61502b979eeeeb6f9a7e1d0074f936451d0a1b0d2fa4fb3225b439a3770767b649256fe481361f481a8dbc276", + "0x84d3b32fa62096831cc3bf013488a9f3f481dfe293ae209ed19585a03f7db8d961a7a9dd0db82bd7f62d612707575d9c", + "0x81c827826ec9346995ffccf62a241e3b2d32f7357acd1b1f8f7a7dbc97022d3eb51b8a1230e23ce0b401d2e535e8cd78", + "0x94a1e40c151191c5b055b21e86f32e69cbc751dcbdf759a48580951834b96a1eed75914c0d19a38aefd21fb6c8d43d0c", + "0xab890222b44bc21b71f7c75e15b6c6e16bb03371acce4f8d4353ff3b8fcd42a14026589c5ed19555a3e15e4d18bfc3a3", + "0xaccb0be851e93c6c8cc64724cdb86887eea284194b10e7a43c90528ed97e9ec71ca69c6fac13899530593756dd49eab2", + "0xb630220aa9e1829c233331413ee28c5efe94ea8ea08d0c6bfd781955078b43a4f92915257187d8526873e6c919c6a1de", + "0xadd389a4d358c585f1274b73f6c3c45b58ef8df11f9d11221f620e241bf3579fba07427b288c0c682885a700cc1fa28d", + "0xa9fe6ca8bf2961a3386e8b8dcecc29c0567b5c0b3bcf3b0f9169f88e372b80151af883871fc5229815f94f43a6f5b2b0", + "0xad839ae003b92b37ea431fa35998b46a0afc3f9c0dd54c3b3bf7a262467b13ff3c323ada1c1ae02ac7716528bdf39e3e", + "0x9356d3fd0edcbbb65713c0f2a214394f831b26f792124b08c5f26e7f734b8711a87b7c4623408da6a091c9aef1f6af3c", + "0x896b25b083c35ac67f0af3784a6a82435b0e27433d4d74cd6d1eafe11e6827827799490fb1c77c11de25f0d75f14e047", + "0x8bfa019391c9627e8e5f05c213db625f0f1e51ec68816455f876c7e55b8f17a4f13e5aae9e3fb9e1cf920b1402ee2b40", + "0x8ba3a6faa6a860a8f3ce1e884aa8769ceded86380a86520ab177ab83043d380a4f535fe13884346c5e51bee68da6ab41", + "0xa8292d0844084e4e3bb7af92b1989f841a46640288c5b220fecfad063ee94e86e13d3d08038ec2ac82f41c96a3bfe14d", + "0x8229bb030b2fc566e11fd33c7eab7a1bb7b49fed872ea1f815004f7398cb03b85ea14e310ec19e1f23e0bdaf60f8f76c", + "0x8cfbf869ade3ec551562ff7f63c2745cc3a1f4d4dc853a0cd42dd5f6fe54228f86195ea8fe217643b32e9f513f34a545", + "0xac52a3c8d3270ddfe1b5630159da9290a5ccf9ccbdef43b58fc0a191a6c03b8a5974cf6e2bbc7bd98d4a40a3581482d7", + "0xab13decb9e2669e33a7049b8eca3ca327c40dea15ad6e0e7fa63ed506db1d258bc36ac88b35f65cae0984e937eb6575d", + "0xb5e748eb1a7a1e274ff0cc56311c198f2c076fe4b7e73e5f80396fe85358549df906584e6bb2c8195b3e2be7736850a5", + "0xb5cb911325d8f963c41f691a60c37831c7d3bbd92736efa33d1f77a22b3fde7f283127256c2f47e197571e6fe0b46149", + "0x8a01dc6ed1b55f26427a014faa347130738b191a06b800e32042a46c13f60b49534520214359d68eb2e170c31e2b8672", + "0xa72fa874866e19b2efb8e069328362bf7921ec375e3bcd6b1619384c3f7ee980f6cf686f3544e9374ff54b4d17a1629c", + "0x8db21092f7c5f110fba63650b119e82f4b42a997095d65f08f8237b02dd66fdf959f788df2c35124db1dbd330a235671", + "0x8c65d50433d9954fe28a09fa7ba91a70a590fe7ba6b3060f5e4be0f6cef860b9897fa935fb4ebc42133524eb071dd169", + "0xb4614058e8fa21138fc5e4592623e78b8982ed72aa35ee4391b164f00c68d277fa9f9eba2eeefc890b4e86eba5124591", + "0xab2ad3a1bce2fbd55ca6b7c23786171fe1440a97d99d6df4d80d07dd56ac2d7203c294b32fc9e10a6c259381a73f24a1", + "0x812ae3315fdc18774a8da3713a4679e8ed10b9405edc548c00cacbe25a587d32040566676f135e4723c5dc25df5a22e9", + "0xa464b75f95d01e5655b54730334f443c8ff27c3cb79ec7af4b2f9da3c2039c609908cd128572e1fd0552eb597e8cef8d", + "0xa0db3172e93ca5138fe419e1c49a1925140999f6eff7c593e5681951ee0ec1c7e454c851782cbd2b8c9bc90d466e90e0", + "0x806db23ba7d00b87d544eed926b3443f5f9c60da6b41b1c489fba8f73593b6e3b46ebfcab671ee009396cd77d5e68aa1", + "0x8bfdf2c0044cc80260994e1c0374588b6653947b178e8b312be5c2a05e05767e98ea15077278506aee7df4fee1aaf89e", + "0x827f6558c16841b5592ff089c9c31e31eb03097623524394813a2e4093ad2d3f8f845504e2af92195aaa8a1679d8d692", + "0x925c4f8eab2531135cd71a4ec88e7035b5eea34ba9d799c5898856080256b4a15ed1a746e002552e2a86c9c157e22e83", + "0xa9f9a368f0e0b24d00a35b325964c85b69533013f9c2cfad9708be5fb87ff455210f8cb8d2ce3ba58ca3f27495552899", + "0x8ac0d3bebc1cae534024187e7c71f8927ba8fcc6a1926cb61c2b6c8f26bb7831019e635a376146c29872a506784a4aaa", + "0x97c577be2cbbfdb37ad754fae9df2ada5fc5889869efc7e18a13f8e502fbf3f4067a509efbd46fd990ab47ce9a70f5a8", + "0x935e7d82bca19f16614aa43b4a3474e4d20d064e4bfdf1cea2909e5c9ab72cfe3e54dc50030e41ee84f3588cebc524e9", + "0x941aafc08f7c0d94cebfbb1f0aad5202c02e6e37f2c12614f57e727efa275f3926348f567107ee6d8914dd71e6060271", + "0xaf0fbc1ba05b4b5b63399686df3619968be5d40073de0313cbf5f913d3d4b518d4c249cdd2176468ccaa36040a484f58", + "0xa0c414f23f46ca6d69ce74c6f8a00c036cb0edd098af0c1a7d39c802b52cfb2d5dbdf93fb0295453d4646e2af7954d45", + "0x909cf39e11b3875bb63b39687ae1b5d1f5a15445e39bf164a0b14691b4ddb39a8e4363f584ef42213616abc4785b5d66", + "0xa92bac085d1194fbd1c88299f07a061d0bdd3f980b663e81e6254dbb288bf11478c0ee880e28e01560f12c5ccb3c0103", + "0x841705cd5cd76b943e2b7c5e845b9dd3c8defe8ef67e93078d6d5e67ade33ad4b0fd413bc196f93b0a4073c855cd97d4", + "0x8e7eb8364f384a9161e81d3f1d52ceca9b65536ae49cc35b48c3e2236322ba4ae9973e0840802d9fa4f4d82ea833544f", + "0xaed3ab927548bc8bec31467ba80689c71a168e34f50dcb6892f19a33a099f5aa6b3f9cb79f5c0699e837b9a8c7f27efe", + "0xb8fbf7696210a36e20edabd77839f4dfdf50d6d015cdf81d587f90284a9bcef7d2a1ff520728d7cc69a4843d6c20dedd", + "0xa9d533769ce6830211c884ae50a82a7bf259b44ac71f9fb11f0296fdb3981e6b4c1753fe744647b247ebc433a5a61436", + "0x8b4bdf90d33360b7f428c71cde0a49fb733badba8c726876945f58c620ce7768ae0e98fc8c31fa59d8955a4823336bb1", + "0x808d42238e440e6571c59e52a35ae32547d502dc24fd1759d8ea70a7231a95859baf30b490a4ba55fa2f3aaa11204597", + "0x85594701f1d2fee6dc1956bc44c7b31db93bdeec2f3a7d622c1a08b26994760773e3d57521a44cfd7e407ac3fd430429", + "0xa66de045ce7173043a6825e9dc440ac957e2efb6df0a337f4f8003eb0c719d873a52e6eba3cb0d69d977ca37d9187674", + "0x87a1c6a1fdff993fa51efa5c3ba034c079c0928a7d599b906336af7c2dcab9721ceaf3108c646490af9dff9a754f54b3", + "0x926424223e462ceb75aed7c22ade8a7911a903b7e5dd4bc49746ddce8657f4616325cd12667d4393ac52cdd866396d0e", + "0xb5dc96106593b42b30f06f0b0a1e0c1aafc70432e31807252d3674f0b1ea5e58eac8424879d655c9488d85a879a3e572", + "0x997ca0987735cc716507cb0124b1d266d218b40c9d8e0ecbf26a1d65719c82a637ce7e8be4b4815d307df717bde7c72a", + "0x92994d3f57a569b7760324bb5ae4e8e14e1633d175dab06aa57b8e391540e05f662fdc08b8830f489a063f59b689a688", + "0xa8087fcc6aa4642cb998bea11facfe87eb33b90a9aa428ab86a4124ad032fc7d2e57795311a54ec9f55cc120ebe42df1", + "0xa9bd7d1de6c0706052ca0b362e2e70e8c8f70f1f026ea189b4f87a08ce810297ebfe781cc8004430776c54c1a05ae90c", + "0x856d33282e8a8e33a3d237fb0a0cbabaf77ba9edf2fa35a831fdafcadf620561846aa6cbb6bdc5e681118e1245834165", + "0x9524a7aa8e97a31a6958439c5f3339b19370f03e86b89b1d02d87e4887309dbbe9a3a8d2befd3b7ed5143c8da7e0a8ad", + "0x824fdf433e090f8acbd258ac7429b21f36f9f3b337c6d0b71d1416a5c88a767883e255b2888b7c906dd2e9560c4af24c", + "0x88c7fee662ca7844f42ed5527996b35723abffd0d22d4ca203b9452c639a5066031207a5ae763dbc0865b3299d19b1ec", + "0x919dca5c5595082c221d5ab3a5bc230f45da7f6dec4eb389371e142c1b9c6a2c919074842479c2844b72c0d806170c0c", + "0xb939be8175715e55a684578d8be3ceff3087f60fa875fff48e52a6e6e9979c955efef8ff67cfa2b79499ea23778e33b0", + "0x873b6db725e7397d11bc9bed9ac4468e36619135be686790a79bc6ed4249058f1387c9a802ea86499f692cf635851066", + "0xaeae06db3ec47e9e5647323fa02fac44e06e59b885ad8506bf71b184ab3895510c82f78b6b22a5d978e8218e7f761e9f", + "0xb99c0a8359c72ab88448bae45d4bf98797a26bca48b0d4460cd6cf65a4e8c3dd823970ac3eb774ae5d0cea4e7fadf33e", + "0x8f10c8ec41cdfb986a1647463076a533e6b0eec08520c1562401b36bb063ac972aa6b28a0b6ce717254e35940b900e3c", + "0xa106d9be199636d7add43b942290269351578500d8245d4aae4c083954e4f27f64740a3138a66230391f2d0e6043a8de", + "0xa469997908244578e8909ff57cffc070f1dbd86f0098df3cfeb46b7a085cfecc93dc69ee7cad90ff1dc5a34d50fe580c", + "0xa4ef087bea9c20eb0afc0ee4caba7a9d29dfa872137828c721391273e402fb6714afc80c40e98bbd8276d3836bffa080", + "0xb07a013f73cd5b98dae0d0f9c1c0f35bff8a9f019975c4e1499e9bee736ca6fcd504f9bc32df1655ff333062382cff04", + "0xb0a77188673e87cc83348c4cc5db1eecf6b5184e236220c8eeed7585e4b928db849944a76ec60ef7708ef6dac02d5592", + "0xb1284b37e59b529f0084c0dacf0af6c0b91fc0f387bf649a8c74819debf606f7b07fc3e572500016fb145ec2b24e9f17", + "0x97b20b5b4d6b9129da185adfbf0d3d0b0faeba5b9715f10299e48ea0521709a8296a9264ce77c275a59c012b50b6519a", + "0xb9d37e946fae5e4d65c1fbfacc8a62e445a1c9d0f882e60cca649125af303b3b23af53c81d7bac544fb7fcfc7a314665", + "0x8e5acaac379f4bb0127efbef26180f91ff60e4c525bc9b798fc50dfaf4fe8a5aa84f18f3d3cfb8baead7d1e0499af753", + "0xb0c0b8ab1235bf1cda43d4152e71efc1a06c548edb964eb4afceb201c8af24240bf8ab5cae30a08604e77432b0a5faf0", + "0x8cc28d75d5c8d062d649cbc218e31c4d327e067e6dbd737ec0a35c91db44fbbd0d40ec424f5ed79814add16947417572", + "0x95ae6219e9fd47efaa9cb088753df06bc101405ba50a179d7c9f7c85679e182d3033f35b00dbba71fdcd186cd775c52e", + "0xb5d28fa09f186ebc5aa37453c9b4d9474a7997b8ae92748ecb940c14868792292ac7d10ade01e2f8069242b308cf97e5", + "0x8c922a0faa14cc6b7221f302df3342f38fc8521ec6c653f2587890192732c6da289777a6cd310747ea7b7d104af95995", + "0xb9ad5f660b65230de54de535d4c0fcae5bc6b59db21dea5500fdc12eea4470fb8ea003690fdd16d052523418d5e01e8c", + "0xa39a9dd41a0ff78c82979483731f1cd68d3921c3e9965869662c22e02dde3877802e180ba93f06e7346f96d9fa9261d2", + "0x8b32875977ec372c583b24234c27ed73aef00cdff61eb3c3776e073afbdeade548de9497c32ec6d703ff8ad0a5cb7fe4", + "0x9644cbe755a5642fe9d26cfecf170d3164f1848c2c2e271d5b6574a01755f3980b3fc870b98cf8528fef6ecef4210c16", + "0x81ea9d1fdd9dd66d60f40ce0712764b99da9448ae0b300f8324e1c52f154e472a086dda840cb2e0b9813dc8ce8afd4b5", + "0x906aaa4a7a7cdf01909c5cfbc7ded2abc4b869213cbf7c922d4171a4f2e637e56f17020b852ad339d83b8ac92f111666", + "0x939b5f11acbdeff998f2a080393033c9b9d8d5c70912ea651c53815c572d36ee822a98d6dfffb2e339f29201264f2cf4", + "0xaba4898bf1ccea9b9e2df1ff19001e05891581659c1cbbde7ee76c349c7fc7857261d9785823c9463a8aea3f40e86b38", + "0x83ca1a56b8a0be4820bdb5a9346357c68f9772e43f0b887729a50d2eb2a326bbcede676c8bf2e51d7c89bbd8fdb778a6", + "0x94e86e9fe6addfe2c3ee3a547267ed921f4230d877a85bb4442c2d9350c2fa9a9c54e6fe662de82d1a2407e4ab1691c2", + "0xa0cc3bdef671a59d77c6984338b023fa2b431b32e9ed2abe80484d73edc6540979d6f10812ecc06d4d0c5d4eaca7183c", + "0xb5343413c1b5776b55ea3c7cdd1f3af1f6bd802ea95effe3f2b91a523817719d2ecc3f8d5f3cc2623ace7e35f99ca967", + "0x92085d1ed0ed28d8cabe3e7ff1905ed52c7ceb1eac5503760c52fb5ee3a726aba7c90b483c032acc3f166b083d7ec370", + "0x8ec679520455275cd957fca8122724d287db5df7d29f1702a322879b127bff215e5b71d9c191901465d19c86c8d8d404", + "0xb65eb2c63d8a30332eb24ee8a0c70156fc89325ebbb38bacac7cf3f8636ad8a472d81ccca80423772abc00192d886d8a", + "0xa9fe1c060b974bee4d590f2873b28635b61bfcf614e61ff88b1be3eee4320f4874e21e8d666d8ac8c9aba672efc6ecae", + "0xb3fe2a9a389c006a831dea7e777062df84b5c2803f9574d7fbe10b7e1c125817986af8b6454d6be9d931a5ac94cfe963", + "0x95418ad13b734b6f0d33822d9912c4c49b558f68d08c1b34a0127fcfa666bcae8e6fda8832d2c75bb9170794a20e4d7c", + "0xa9a7df761e7f18b79494bf429572140c8c6e9d456c4d4e336184f3f51525a65eb9582bea1e601bdb6ef8150b7ca736a5", + "0xa0de03b1e75edf7998c8c1ac69b4a1544a6fa675a1941950297917366682e5644a4bda9cdeedfaf9473d7fccd9080b0c", + "0xa61838af8d95c95edf32663a68f007d95167bf6e41b0c784a30b22d8300cfdd5703bd6d16e86396638f6db6ae7e42a85", + "0x8866d62084d905c145ff2d41025299d8b702ac1814a7dec4e277412c161bc9a62fed735536789cb43c88693c6b423882", + "0x91da22c378c81497fe363e7f695c0268443abee50f8a6625b8a41e865638a643f07b157ee566de09ba09846934b4e2d7", + "0x941d21dd57c9496aa68f0c0c05507405fdd413acb59bc668ce7e92e1936c68ec4b065c3c30123319884149e88228f0b2", + "0xa77af9b094bc26966ddf2bf9e1520c898194a5ccb694915950dadc204facbe3066d3d89f50972642d76b14884cfbaa21", + "0x8e76162932346869f4618bde744647f7ab52ab498ad654bdf2a4feeb986ac6e51370841e5acbb589e38b6e7142bb3049", + "0xb60979ace17d6937ece72e4f015da4657a443dd01cebc7143ef11c09e42d4aa8855999a65a79e2ea0067f31c9fc2ab0f", + "0xb3e2ffdd5ee6fd110b982fd4fad4b93d0fca65478f986d086eeccb0804960bfaa1919afa743c2239973ea65091fe57d2", + "0x8ce0ce05e7d7160d44574011da687454dbd3c8b8290aa671731b066e2c82f8cf2d63cb8e932d78c6122ec610e44660e6", + "0xab005dd8d297045c39e2f72fb1c48edb501ccf3575d3d04b9817b3afee3f0bb0f3f53f64bda37d1d9cde545aae999bae", + "0x95bd7edb4c4cd60e3cb8a72558845a3cce6bb7032ccdf33d5a49ebb6ddf203bc3c79e7b7e550735d2d75b04c8b2441e8", + "0x889953ee256206284094e4735dbbb17975bafc7c3cb94c9fbfee4c3e653857bfd49e818f64a47567f721b98411a3b454", + "0xb188423e707640ab0e75a061e0b62830cde8afab8e1ad3dae30db69ffae4e2fc005bababbdcbd7213b918ed4f70e0c14", + "0xa97e0fafe011abd70d4f99a0b36638b3d6e7354284588f17a88970ed48f348f88392779e9a038c6cbc9208d998485072", + "0x87db11014a91cb9b63e8dfaa82cdebca98272d89eb445ee1e3ff9dbaf2b3fad1a03b888cffc128e4fe208ed0dddece0f", + "0xaad2e40364edd905d66ea4ac9d51f9640d6fda9a54957d26ba233809851529b32c85660fa401dbee3679ec54fa6dd966", + "0x863e99336ca6edf03a5a259e59a2d0f308206e8a2fb320cfc0be06057366df8e0f94b33a28f574092736b3c5ada84270", + "0xb34bcc56a057589f34939a1adc51de4ff6a9f4fee9c7fa9aa131e28d0cf0759a0c871b640162acdfbf91f3f1b59a3703", + "0x935dd28f2896092995c5eff1618e5b6efe7a40178888d7826da9b0503c2d6e68a28e7fac1a334e166d0205f0695ef614", + "0xb842cd5f8f5de5ca6c68cb4a5c1d7b451984930eb4cc18fd0934d52fdc9c3d2d451b1c395594d73bc3451432bfba653f", + "0x9014537885ce2debad736bc1926b25fdab9f69b216bf024f589c49dc7e6478c71d595c3647c9f65ff980b14f4bb2283b", + "0x8e827ccca1dd4cd21707140d10703177d722be0bbe5cac578db26f1ef8ad2909103af3c601a53795435b27bf95d0c9ed", + "0x8a0b8ad4d466c09d4f1e9167410dbe2edc6e0e6229d4b3036d30f85eb6a333a18b1c968f6ca6d6889bb08fecde017ef4", + "0x9241ee66c0191b06266332dc9161dede384c4bb4e116dbd0890f3c3790ec5566da4568243665c4725b718ac0f6b5c179", + "0xaeb4d5fad81d2b505d47958a08262b6f1b1de9373c2c9ba6362594194dea3e002ab03b8cbb43f867be83065d3d370f19", + "0x8781bc83bb73f7760628629fe19e4714b494dbed444c4e4e4729b7f6a8d12ee347841a199888794c2234f51fa26fc2b9", + "0xb58864f0acd1c2afa29367e637cbde1968d18589245d9936c9a489c6c495f54f0113ecdcbe4680ac085dd3c397c4d0c3", + "0x94a24284afaeead61e70f3e30f87248d76e9726759445ca18cdb9360586c60cc9f0ec1c397f9675083e0b56459784e2e", + "0xaed358853f2b54dcbddf865e1816c2e89be12e940e1abfa661e2ee63ffc24a8c8096be2072fa83556482c0d89e975124", + "0xb95374e6b4fc0765708e370bc881e271abf2e35c08b056a03b847e089831ef4fe3124b9c5849d9c276eb2e35b3daf264", + "0xb834cdbcfb24c8f84bfa4c552e7fadc0028a140952fd69ed13a516e1314a4cd35d4b954a77d51a1b93e1f5d657d0315d", + "0x8fb6d09d23bfa90e7443753d45a918d91d75d8e12ec7d016c0dfe94e5c592ba6aaf483d2f16108d190822d955ad9cdc3", + "0xaa315cd3c60247a6ad4b04f26c5404c2713b95972843e4b87b5a36a89f201667d70f0adf20757ebe1de1b29ae27dda50", + "0xa116862dca409db8beff5b1ccd6301cdd0c92ca29a3d6d20eb8b87f25965f42699ca66974dd1a355200157476b998f3b", + "0xb4c2f5fe173c4dc8311b60d04a65ce1be87f070ac42e13cd19c6559a2931c6ee104859cc2520edebbc66a13dc7d30693", + "0x8d4a02bf99b2260c334e7d81775c5cf582b00b0c982ce7745e5a90624919028278f5e9b098573bad5515ce7fa92a80c8", + "0x8543493bf564ce6d97bd23be9bff1aba08bd5821ca834f311a26c9139c92a48f0c2d9dfe645afa95fec07d675d1fd53b", + "0x9344239d13fde08f98cb48f1f87d34cf6abe8faecd0b682955382a975e6eed64e863fa19043290c0736261622e00045c", + "0xaa49d0518f343005ca72b9e6c7dcaa97225ce6bb8b908ebbe7b1a22884ff8bfb090890364e325a0d414ad180b8f161d1", + "0x907d7fd3e009355ab326847c4a2431f688627faa698c13c03ffdd476ecf988678407f029b8543a475dcb3dafdf2e7a9c", + "0x845f1f10c6c5dad2adc7935f5cd2e2b32f169a99091d4f1b05babe7317b9b1cdce29b5e62f947dc621b9acbfe517a258", + "0x8f3be8e3b380ea6cdf9e9c237f5e88fd5a357e5ded80ea1fc2019810814de82501273b4da38916881125b6fa0cfd4459", + "0xb9c7f487c089bf1d20c822e579628db91ed9c82d6ca652983aa16d98b4270c4da19757f216a71b9c13ddee3e6e43705f", + "0x8ba2d8c88ad2b872db104ea8ddbb006ec2f3749fd0e19298a804bb3a5d94de19285cc7fb19fee58a66f7851d1a66c39f", + "0x9375ecd3ed16786fe161af5d5c908f56eeb467a144d3bbddfc767e90065b7c94fc53431adebecba2b6c9b5821184d36e", + "0xa49e069bfadb1e2e8bff6a4286872e2a9765d62f0eaa4fcb0e5af4bbbed8be3510fb19849125a40a8a81d1e33e81c3eb", + "0x9522cc66757b386aa6b88619525c8ce47a5c346d590bb3647d12f991e6c65c3ab3c0cfc28f0726b6756c892eae1672be", + "0xa9a0f1f51ff877406fa83a807aeb17b92a283879f447b8a2159653db577848cc451cbadd01f70441e351e9ed433c18bc", + "0x8ff7533dcff6be8714df573e33f82cf8e9f2bcaaa43e939c4759d52b754e502717950de4b4252fb904560fc31dce94a4", + "0x959724671e265a28d67c29d95210e97b894b360da55e4cf16e6682e7912491ed8ca14bfaa4dce9c25a25b16af580494f", + "0x92566730c3002f4046c737032487d0833c971e775de59fe02d9835c9858e2e3bc37f157424a69764596c625c482a2219", + "0xa84b47ceff13ed9c3e5e9cdf6739a66d3e7c2bd8a6ba318fefb1a9aecf653bb2981da6733ddb33c4b0a4523acc429d23", + "0xb4ddf571317e44f859386d6140828a42cf94994e2f1dcbcc9777f4eebbfc64fc1e160b49379acc27c4672b8e41835c5d", + "0x8ab95c94072b853d1603fdd0a43b30db617d13c1d1255b99075198e1947bfa5f59aed2b1147548a1b5e986cd9173d15c", + "0x89511f2eab33894fd4b3753d24249f410ff7263052c1fef6166fc63a79816656b0d24c529e45ccce6be28de6e375d916", + "0xa0866160ca63d4f2be1b4ea050dac6b59db554e2ebb4e5b592859d8df339b46fd7cb89aaed0951c3ee540aee982c238a", + "0x8fcc5cbba1b94970f5ff2eb1922322f5b0aa7d918d4b380c9e7abfd57afd8b247c346bff7b87af82efbce3052511cd1b", + "0x99aeb2a5e846b0a2874cca02c66ed40d5569eb65ab2495bc3f964a092e91e1517941f2688e79f8cca49cd3674c4e06dc", + "0xb7a096dc3bad5ca49bee94efd884aa3ff5615cf3825cf95fbe0ce132e35f46581d6482fa82666c7ef5f1643eaee8f1ca", + "0x94393b1da6eaac2ffd186b7725eca582f1ddc8cdd916004657f8a564a7c588175cb443fc6943b39029f5bbe0add3fad8", + "0x884b85fe012ccbcd849cb68c3ad832d83b3ef1c40c3954ffdc97f103b1ed582c801e1a41d9950f6bddc1d11f19d5ec76", + "0xb00061c00131eded8305a7ce76362163deb33596569afb46fe499a7c9d7a0734c084d336b38d168024c2bb42b58e7660", + "0xa439153ac8e6ca037381e3240e7ba08d056c83d7090f16ed538df25901835e09e27de2073646e7d7f3c65056af6e4ce7", + "0x830fc9ca099097d1f38b90e6843dc86f702be9d20bdacc3e52cae659dc41df5b8d2c970effa6f83a5229b0244a86fe22", + "0xb81ea2ffaaff2bb00dd59a9ab825ba5eed4db0d8ac9c8ed1a632ce8f086328a1cddd045fbe1ace289083c1325881b7e7", + "0xb51ea03c58daf2db32c99b9c4789b183365168cb5019c72c4cc91ac30b5fb7311d3db76e6fa41b7cd4a8c81e2f6cdc94", + "0xa4170b2c6d09ca5beb08318730419b6f19215ce6c631c854116f904be3bc30dd85a80c946a8ab054d3e307afaa3f8fbc", + "0x897cc42ff28971ff54d2a55dd6b35cfb8610ac902f3c06e3a5cea0e0a257e870c471236a8e84709211c742a09c5601a6", + "0xa18f2e98d389dace36641621488664ecbb422088ab03b74e67009b8b8acacaaa24fdcf42093935f355207d934adc52a8", + "0x92adcfb678cc2ba19c866f3f2b988fdcb4610567f3ab436cc0cb9acaf5a88414848d71133ebdbec1983e38e6190f1b5f", + "0xa86d43c2ce01b366330d3b36b3ca85f000c3548b8297e48478da1ee7d70d8576d4650cba7852ed125c0d7cb6109aa7f3", + "0x8ed31ceed9445437d7732dce78a762d72ff32a7636bfb3fd7974b7ae15db414d8184a1766915244355deb354fbc5803b", + "0x9268f70032584f416e92225d65af9ea18c466ebc7ae30952d56a4e36fd9ea811dde0a126da9220ba3c596ec54d8a335e", + "0x9433b99ee94f2d3fbdd63b163a2bdf440379334c52308bd24537f7defd807145a062ff255a50d119a7f29f4b85d250e3", + "0x90ce664f5e4628a02278f5cf5060d1a34f123854634b1870906e5723ac9afd044d48289be283b267d45fcbf3f4656aaf", + "0xaaf21c4d59378bb835d42ae5c5e5ab7a3c8c36a59e75997989313197752b79a472d866a23683b329ea69b048b87fa13e", + "0xb83c0589b304cec9ede549fde54f8a7c2a468c6657da8c02169a6351605261202610b2055c639b9ed2d5b8c401fb8f56", + "0x9370f326ea0f170c2c05fe2c5a49189f20aec93b6b18a5572a818cd4c2a6adb359e68975557b349fb54f065d572f4c92", + "0xac3232fa5ce6f03fca238bef1ce902432a90b8afce1c85457a6bee5571c033d4bceefafc863af04d4e85ac72a4d94d51", + "0x80d9ea168ff821b22c30e93e4c7960ce3ad3c1e6deeebedd342a36d01bd942419b187e2f382dbfd8caa34cca08d06a48", + "0xa387a3c61676fb3381eefa2a45d82625635a666e999aba30e3b037ec9e040f414f9e1ad9652abd3bcad63f95d85038db", + "0xa1b229fe32121e0b391b0f6e0180670b9dc89d79f7337de4c77ea7ad0073e9593846f06797c20e923092a08263204416", + "0x92164a9d841a2b828cedf2511213268b698520f8d1285852186644e9a0c97512cafa4bfbe29af892c929ebccd102e998", + "0x82ee2fa56308a67c7db4fd7ef539b5a9f26a1c2cc36da8c3206ba4b08258fbb3cec6fe5cdbd111433fb1ba2a1e275927", + "0x8c77bfe9e191f190a49d46f05600603fa42345592539b82923388d72392404e0b29a493a15e75e8b068dddcd444c2928", + "0x80b927f93ccf79dcf5c5b20bcf5a7d91d7a17bc0401bb7cc9b53a6797feac31026eb114257621f5a64a52876e4474cc1", + "0xb6b68b6501c37804d4833d5a063dd108a46310b1400549074e3cac84acc6d88f73948b7ad48d686de89c1ec043ae8c1a", + "0xab3da00f9bdc13e3f77624f58a3a18fc3728956f84b5b549d62f1033ae4b300538e53896e2d943f160618e05af265117", + "0xb6830e87233b8eace65327fdc764159645b75d2fd4024bf8f313b2dd5f45617d7ecfb4a0b53ccafb5429815a9a1adde6", + "0xb9251cfe32a6dc0440615aadcd98b6b1b46e3f4e44324e8f5142912b597ee3526bea2431e2b0282bb58f71be5b63f65e", + "0xaf8d70711e81cdddfb39e67a1b76643292652584c1ce7ce4feb1641431ad596e75c9120e85f1a341e7a4da920a9cdd94", + "0x98cd4e996594e89495c078bfd52a4586b932c50a449a7c8dfdd16043ca4cda94dafbaa8ad1b44249c99bbcc52152506e", + "0xb9fc6d1c24f48404a4a64fbe3e43342738797905db46e4132aee5f086aaa4c704918ad508aaefa455cfe1b36572e6242", + "0xa365e871d30ba9291cedaba1be7b04e968905d003e9e1af7e3b55c5eb048818ae5b913514fb08b24fb4fbdccbb35d0b8", + "0x93bf99510971ea9af9f1e364f1234c898380677c8e8de9b0dd24432760164e46c787bc9ec42a7ad450500706cf247b2d", + "0xb872f825a5b6e7b9c7a9ddfeded3516f0b1449acc9b4fd29fc6eba162051c17416a31e5be6d3563f424d28e65bab8b8f", + "0xb06b780e5a5e8eb4f4c9dc040f749cf9709c8a4c9ef15e925f442b696e41e5095db0778a6c73bcd329b265f2c6955c8b", + "0x848f1a981f5fc6cd9180cdddb8d032ad32cdfa614fc750d690dbae36cc0cd355cbf1574af9b3ffc8b878f1b2fafb9544", + "0xa03f48cbff3e9e8a3a655578051a5ae37567433093ac500ed0021c6250a51b767afac9bdb194ee1e3eac38a08c0eaf45", + "0xb5be78ce638ff8c4aa84352b536628231d3f7558c5be3bf010b28feac3022e64691fa672f358c8b663904aebe24a54ed", + "0xa9d4da70ff676fa55d1728ba6ab03b471fa38b08854d99e985d88c2d050102d8ccffbe1c90249a5607fa7520b15fe791", + "0x8fe9f7092ffb0b69862c8e972fb1ecf54308c96d41354ed0569638bb0364f1749838d6d32051fff1599112978c6e229c", + "0xae6083e95f37770ecae0df1e010456f165d96cfe9a7278c85c15cffd61034081ce5723e25e2bede719dc9341ec8ed481", + "0xa260891891103089a7afbd9081ea116cfd596fd1015f5b65e10b0961eb37fab7d09c69b7ce4be8bf35e4131848fb3fe4", + "0x8d729fa32f6eb9fd2f6a140bef34e8299a2f3111bffd0fe463aa8622c9d98bfd31a1df3f3e87cd5abc52a595f96b970e", + "0xa30ec6047ae4bc7da4daa7f4c28c93aedb1112cfe240e681d07e1a183782c9ff6783ac077c155af23c69643b712a533f", + "0xac830726544bfe7b5467339e5114c1a75f2a2a8d89453ce86115e6a789387e23551cd64620ead6283dfa4538eb313d86", + "0x8445c135b7a48068d8ed3e011c6d818cfe462b445095e2fbf940301e50ded23f272d799eea47683fc027430ce14613ef", + "0x95785411715c9ae9d8293ce16a693a2aa83e3cb1b4aa9f76333d0da2bf00c55f65e21e42e50e6c5772ce213dd7b4f7a0", + "0xb273b024fa18b7568c0d1c4d2f0c4e79ec509dafac8c5951f14192d63ddbcf2d8a7512c1c1b615cc38fa3e336618e0c5", + "0xa78b9d3ea4b6a90572eb27956f411f1d105fdb577ee2ffeec9f221da9b45db84bfe866af1f29597220c75e0c37a628d8", + "0xa4be2bf058c36699c41513c4d667681ce161a437c09d81383244fc55e1c44e8b1363439d0cce90a3e44581fb31d49493", + "0xb6eef13040f17dd4eba22aaf284d2f988a4a0c4605db44b8d2f4bf9567ac794550b543cc513c5f3e2820242dd704152e", + "0x87eb00489071fa95d008c5244b88e317a3454652dcb1c441213aa16b28cd3ecaa9b22fec0bdd483c1df71c37119100b1", + "0x92d388acdcb49793afca329cd06e645544d2269234e8b0b27d2818c809c21726bc9cf725651b951e358a63c83dedee24", + "0xae27e219277a73030da27ab5603c72c8bd81b6224b7e488d7193806a41343dff2456132274991a4722fdb0ef265d04cd", + "0x97583e08ecb82bbc27c0c8476d710389fa9ffbead5c43001bd36c1b018f29faa98de778644883e51870b69c5ffb558b5", + "0x90a799a8ce73387599babf6b7da12767c0591cadd36c20a7990e7c05ea1aa2b9645654ec65308ee008816623a2757a6a", + "0xa1b47841a0a2b06efd9ab8c111309cc5fc9e1d5896b3e42ed531f6057e5ade8977c29831ce08dbda40348386b1dcc06d", + "0xb92b8ef59bbddb50c9457691bc023d63dfcc54e0fd88bd5d27a09e0d98ac290fc90e6a8f6b88492043bf7c87fac8f3e4", + "0xa9d6240b07d62e22ec8ab9b1f6007c975a77b7320f02504fc7c468b4ee9cfcfd945456ff0128bc0ef2174d9e09333f8d", + "0x8e96534c94693226dc32bca79a595ca6de503af635f802e86442c67e77564829756961d9b701187fe91318da515bf0e6", + "0xb6ba290623cd8dd5c2f50931c0045d1cfb0c30877bc8fe58cbc3ff61ee8da100045a39153916efa1936f4aee0892b473", + "0xb43baa7717fac02d4294f5b3bb5e58a65b3557747e3188b482410388daac7a9c177f762d943fd5dcf871273921213da8", + "0xb9cf00f8fb5e2ef2b836659fece15e735060b2ea39b8e901d3dcbdcf612be8bf82d013833718c04cd46ffaa70b85f42e", + "0x8017d0c57419e414cbba504368723e751ef990cc6f05dad7b3c2de6360adc774ad95512875ab8337d110bf39a42026fa", + "0xae7401048b838c0dcd4b26bb6c56d79d51964a0daba780970b6c97daee4ea45854ea0ac0e4139b3fe60dac189f84df65", + "0x887b237b0cd0f816b749b21db0b40072f9145f7896c36916296973f9e6990ede110f14e5976c906d08987c9836cca57f", + "0xa88c3d5770148aee59930561ca1223aceb2c832fb5417e188dca935905301fc4c6c2c9270bc1dff7add490a125eb81c6", + "0xb6cf9b02c0cd91895ad209e38c54039523f137b5848b9d3ad33ae43af6c20c98434952db375fe378de7866f2d0e8b18a", + "0x84ef3d322ff580c8ad584b1fe4fe346c60866eb6a56e982ba2cf3b021ecb1fdb75ecc6c29747adda86d9264430b3f816", + "0xa0561c27224baf0927ad144cb71e31e54a064c598373fcf0d66aebf98ab7af1d8e2f343f77baefff69a6da750a219e11", + "0xaa5cc43f5b8162b016f5e1b61214c0c9d15b1078911c650b75e6cdfb49b85ee04c6739f5b1687d15908444f691f732de", + "0xad4ac099b935589c7b8fdfdf3db332b7b82bb948e13a5beb121ebd7db81a87d278024a1434bcf0115c54ca5109585c3d", + "0x8a00466abf3f109a1dcd19e643b603d3af23d42794ef8ca2514dd507ecea44a031ac6dbc18bd02f99701168b25c1791e", + "0xb00b5900dfad79645f8bee4e5adc7b84eb22e5b1e67df77ccb505b7fc044a6c08a8ea5faca662414eb945f874f884cea", + "0x950e204e5f17112250b22ea6bb8423baf522fc0af494366f18fe0f949f51d6e6812074a80875cf1ed9c8e7420058d541", + "0x91e5cbf8bb1a1d50c81608c9727b414d0dd2fb467ebc92f100882a3772e54f94979cfdf8e373fdef7c7fcdd60fec9e00", + "0xa093f6a857b8caaff80599c2e89c962b415ecbaa70d8fd973155fa976a284c6b29a855f5f7a3521134d00d2972755188", + "0xb4d55a3551b00da54cc010f80d99ddd2544bde9219a3173dfaadf3848edc7e4056ab532fb75ac26f5f7141e724267663", + "0xa03ea050fc9b011d1b04041b5765d6f6453a93a1819cd9bd6328637d0b428f08526466912895dcc2e3008ee58822e9a7", + "0x99b12b3665e473d01bc6985844f8994fb65cb15745024fb7af518398c4a37ff215da8f054e8fdf3286984ae36a73ca5e", + "0x9972c7e7a7fb12e15f78d55abcaf322c11249cd44a08f62c95288f34f66b51f146302bce750ff4d591707075d9123bd2", + "0xa64b4a6d72354e596d87cda213c4fc2814009461570ccb27d455bbe131f8d948421a71925425b546d8cf63d5458cd64b", + "0x91c215c73b195795ede2228b7ed1f6e37892e0c6b0f4a0b5a16c57aa1100c84df9239054a173b6110d6c2b7f4bf1ce52", + "0x88807198910ec1303480f76a3683870246a995e36adaeadc29c22f0bdba8152fe705bd070b75de657b04934f7d0ccf80", + "0xb37c0026c7b32eb02cacac5b55cb5fe784b8e48b2945c64d3037af83ece556a117f0ff053a5968c2f5fa230e291c1238", + "0x94c768384ce212bc2387e91ce8b45e4ff120987e42472888a317abc9dcdf3563b62e7a61c8e98d7cdcbe272167d91fc6", + "0xa10c2564936e967a390cb14ef6e8f8b04ea9ece5214a38837eda09e79e0c7970b1f83adf017c10efd6faa8b7ffa2c567", + "0xa5085eed3a95f9d4b1269182ea1e0d719b7809bf5009096557a0674bde4201b0ddc1f0f16a908fc468846b3721748ce3", + "0x87468eb620b79a0a455a259a6b4dfbc297d0d53336537b771254dd956b145dc816b195b7002647ea218552e345818a3f", + "0xace2b77ffb87366af0a9cb5d27d6fc4a14323dbbf1643f5f3c4559306330d86461bb008894054394cbfaefeaa0bc2745", + "0xb27f56e840a54fbd793f0b7a7631aa4cee64b5947e4382b2dfb5eb1790270288884c2a19afebe5dc0c6ef335d4531c1c", + "0x876e438633931f7f895062ee16c4b9d10428875f7bc79a8e156a64d379a77a2c45bf5430c5ab94330f03da352f1e9006", + "0xa2512a252587d200d2092b44c914df54e04ff8bcef36bf631f84bde0cf5a732e3dc7f00f662842cfd74b0b0f7f24180e", + "0x827f1bc8f54a35b7a4bd8154f79bcc055e45faed2e74adf7cf21cca95df44d96899e847bd70ead6bb27b9c0ed97bbd8b", + "0xa0c92cf5a9ed843714f3aea9fe7b880f622d0b4a3bf66de291d1b745279accf6ba35097849691370f41732ba64b5966b", + "0xa63f5c1e222775658421c487b1256b52626c6f79cb55a9b7deb2352622cedffb08502042d622eb3b02c97f9c09f9c957", + "0x8cc093d52651e65fb390e186db6cc4de559176af4624d1c44cb9b0e836832419dacac7b8db0627b96288977b738d785d", + "0xaa7b6a17dfcec146134562d32a12f7bd7fe9522e300859202a02939e69dbd345ed7ff164a184296268f9984f9312e8fc", + "0x8ac76721f0d2b679f023d06cbd28c85ae5f4b43c614867ccee88651d4101d4fd352dbdb65bf36bfc3ebc0109e4b0c6f9", + "0x8d350f7c05fc0dcd9a1170748846fb1f5d39453e4cb31e6d1457bed287d96fc393b2ecc53793ca729906a33e59c6834a", + "0xb9913510dfc5056d7ec5309f0b631d1ec53e3a776412ada9aefdaf033c90da9a49fdde6719e7c76340e86599b1f0eec2", + "0x94955626bf4ce87612c5cfffcf73bf1c46a4c11a736602b9ba066328dc52ad6d51e6d4f53453d4ed55a51e0aad810271", + "0xb0fcab384fd4016b2f1e53f1aafd160ae3b1a8865cd6c155d7073ecc1664e05b1d8bca1def39c158c7086c4e1103345e", + "0x827de3f03edfbde08570b72de6662c8bfa499b066a0a27ebad9b481c273097d17a5a0a67f01553da5392ec3f149b2a78", + "0xab7940384c25e9027c55c40df20bd2a0d479a165ced9b1046958353cd69015eeb1e44ed2fd64e407805ba42df10fc7bf", + "0x8ad456f6ff8cd58bd57567d931f923d0c99141978511b17e03cab7390a72b9f62498b2893e1b05c7c22dd274e9a31919", + "0xac75399e999effe564672db426faa17a839e57c5ef735985c70cd559a377adec23928382767b55ed5a52f7b11b54b756", + "0xb17f975a00b817299ac7af5f2024ea820351805df58b43724393bfb3920a8cd747a3bbd4b8286e795521489db3657168", + "0xa2bed800a6d95501674d9ee866e7314063407231491d794f8cf57d5be020452729c1c7cefd8c50dc1540181f5caab248", + "0x9743f5473171271ffdd3cc59a3ae50545901a7b45cd4bc3570db487865f3b73c0595bebabbfe79268809ee1862e86e4a", + "0xb7eab77c2d4687b60d9d7b04e842b3880c7940140012583898d39fcc22d9b9b0a9be2c2e3788b3e6f30319b39c338f09", + "0x8e2b8f797a436a1b661140e9569dcf3e1eea0a77c7ff2bc4ff0f3e49af04ed2de95e255df8765f1d0927fb456a9926b1", + "0x8aefea201d4a1f4ff98ffce94e540bb313f2d4dfe7e9db484a41f13fc316ed02b282e1acc9bc6f56cad2dc2e393a44c9", + "0xb950c17c0e5ca6607d182144aa7556bb0efe24c68f06d79d6413a973b493bfdf04fd147a4f1ab03033a32004cc3ea66f", + "0xb7b8dcbb179a07165f2dc6aa829fad09f582a71b05c3e3ea0396bf9e6fe73076f47035c031c2101e8e38e0d597eadd30", + "0xa9d77ed89c77ec1bf8335d08d41c3c94dcca9fd1c54f22837b4e54506b212aa38d7440126c80648ab7723ff18e65ed72", + "0xa819d6dfd4aef70e52b8402fe5d135f8082d40eb7d3bb5c4d7997395b621e2bb10682a1bad2c9caa33dd818550fc3ec6", + "0x8f6ee34128fac8bbf13ce2d68b2bb363eb4fd65b297075f88e1446ddeac242500eeb4ef0735e105882ff5ba8c44c139b", + "0xb4440e48255c1644bcecf3a1e9958f1ec4901cb5b1122ee5b56ffd02cad1c29c4266999dbb85aa2605c1b125490074d4", + "0xa43304a067bede5f347775d5811cf65a6380a8d552a652a0063580b5c5ef12a0867a39c7912fa219e184f4538eba1251", + "0xa891ad67a790089ffc9f6d53e6a3d63d3556f5f693e0cd8a7d0131db06fd4520e719cfcc3934f0a8f62a95f90840f1d4", + "0xaea6df8e9bb871081aa0fc5a9bafb00be7d54012c5baf653791907d5042a326aeee966fd9012a582cc16695f5baf7042", + "0x8ffa2660dc52ed1cd4eff67d6a84a8404f358a5f713d04328922269bee1e75e9d49afeec0c8ad751620f22352a438e25", + "0x87ec6108e2d63b06abed350f8b363b7489d642486f879a6c3aa90e5b0f335efc2ff2834eef9353951a42136f8e6a1b32", + "0x865619436076c2760d9e87ddc905023c6de0a8d56eef12c98a98c87837f2ca3f27fd26a2ad752252dbcbe2b9f1d5a032", + "0x980437dce55964293cb315c650c5586ffd97e7a944a83f6618af31c9d92c37b53ca7a21bb5bc557c151b9a9e217e7098", + "0x95d128fc369df4ad8316b72aea0ca363cbc7b0620d6d7bb18f7076a8717a6a46956ff140948b0cc4f6d2ce33b5c10054", + "0x8c7212d4a67b9ec70ebbca04358ad2d36494618d2859609163526d7b3acc2fc935ca98519380f55e6550f70a9bc76862", + "0x893a2968819401bf355e85eee0f0ed0406a6d4a7d7f172d0017420f71e00bb0ba984f6020999a3cdf874d3cd8ebcd371", + "0x9103c1af82dece25d87274e89ea0acd7e68c2921c4af3d8d7c82ab0ed9990a5811231b5b06113e7fa43a6bd492b4564f", + "0x99cfd87a94eab7d35466caa4ed7d7bb45e5c932b2ec094258fb14bf205659f83c209b83b2f2c9ccb175974b2a33e7746", + "0x874b6b93e4ee61be3f00c32dd84c897ccd6855c4b6251eb0953b4023634490ed17753cd3223472873cbc6095b2945075", + "0x84a32c0dc4ea60d33aac3e03e70d6d639cc9c4cc435c539eff915017be3b7bdaba33349562a87746291ebe9bc5671f24", + "0xa7057b24208928ad67914e653f5ac1792c417f413d9176ba635502c3f9c688f7e2ee81800d7e3dc0a340c464da2fd9c5", + "0xa03fb9ed8286aacfa69fbd5d953bec591c2ae4153400983d5dbb6cd9ea37fff46ca9e5cceb9d117f73e9992a6c055ad2", + "0x863b2de04e89936c9a4a2b40380f42f20aefbae18d03750fd816c658aee9c4a03df7b12121f795c85d01f415baaeaa59", + "0x8526eb9bd31790fe8292360d7a4c3eed23be23dd6b8b8f01d2309dbfdc0cfd33ad1568ddd7f8a610f3f85a9dfafc6a92", + "0xb46ab8c5091a493d6d4d60490c40aa27950574a338ea5bbc045be3a114af87bdcb160a8c80435a9b7ad815f3cb56a3f3", + "0xaeadc47b41a8d8b4176629557646202f868b1d728b2dda58a347d937e7ffc8303f20d26d6c00b34c851b8aeec547885d", + "0xaebb19fc424d72c1f1822aa7adc744cd0ef7e55727186f8df8771c784925058c248406ebeeaf3c1a9ee005a26e9a10c6", + "0x8ff96e81c1a4a2ab1b4476c21018fae0a67e92129ee36120cae8699f2d7e57e891f5c624902cb1b845b944926a605cc3", + "0x8251b8d2c43fadcaa049a9e7aff838dae4fb32884018d58d46403ac5f3beb5c518bfd45f03b8abb710369186075eb71c", + "0xa8b2a64f865f51a5e5e86a66455c093407933d9d255d6b61e1fd81ffafc9538d73caaf342338a66ba8ee166372a3d105", + "0xaad915f31c6ba7fdc04e2aaac62e84ef434b7ee76a325f07dc430d12c84081999720181067b87d792efd0117d7ee1eab", + "0xa13db3bb60389883fd41d565c54fb5180d9c47ce2fe7a169ae96e01d17495f7f4fa928d7e556e7c74319c4c25d653eb2", + "0xa4491b0198459b3f552855d680a59214eb74e6a4d6c5fa3b309887dc50ebea2ecf6d26c040550f7dc478b452481466fb", + "0x8f017f13d4b1e3f0c087843582b52d5f8d13240912254d826dd11f8703a99a2f3166dfbdfdffd9a3492979d77524276b", + "0x96c3d5dcd032660d50d7cd9db2914f117240a63439966162b10c8f1f3cf74bc83b0f15451a43b31dbd85e4a7ce0e4bb1", + "0xb479ec4bb79573d32e0ec93b92bdd7ec8c26ddb5a2d3865e7d4209d119fd3499eaac527615ffac78c440e60ef3867ae0", + "0xb2c49c4a33aa94b52b6410b599e81ff15490aafa7e43c8031c865a84e4676354a9c81eb4e7b8be6825fdcefd1e317d44", + "0x906dc51d6a90c089b6704b47592805578a6eed106608eeb276832f127e1b8e858b72e448edcbefb497d152447e0e68ff", + "0xb0e81c63b764d7dfbe3f3fddc9905aef50f3633e5d6a4af6b340495124abedcff5700dfd1577bbbed7b6bf97d02719cb", + "0x9304c64701e3b4ed6d146e48a881f7d83a17f58357cca0c073b2bb593afd2d94f6e2a7a1ec511d0a67ad6ff4c3be5937", + "0xb6fdbd12ba05aa598d80b83f70a15ef90e5cba7e6e75fa038540ee741b644cd1f408a6cecfd2a891ef8d902de586c6b5", + "0xb80557871a6521b1b3c74a1ba083ae055b575df607f1f7b04c867ba8c8c181ea68f8d90be6031f4d25002cca27c44da2", + "0xaa7285b8e9712e06b091f64163f1266926a36607f9d624af9996856ed2aaf03a580cb22ce407d1ade436c28b44ca173f", + "0x8148d72b975238b51e6ea389e5486940d22641b48637d7dfadfa603a605bfc6d74a016480023945d0b85935e396aea5d", + "0x8a014933a6aea2684b5762af43dcf4bdbb633cd0428d42d71167a2b6fc563ece5e618bff22f1db2ddb69b845b9a2db19", + "0x990d91740041db770d0e0eb9d9d97d826f09fd354b91c41e0716c29f8420e0e8aac0d575231efba12fe831091ec38d5a", + "0x9454d0d32e7e308ddec57cf2522fb1b67a2706e33fb3895e9e1f18284129ab4f4c0b7e51af25681d248d7832c05eb698", + "0xa5bd434e75bac105cb3e329665a35bce6a12f71dd90c15165777d64d4c13a82bceedb9b48e762bd24034e0fc9fbe45f4", + "0xb09e3b95e41800d4dc29c6ffdaab2cd611a0050347f6414f154a47ee20ee59bf8cf7181454169d479ebce1eb5c777c46", + "0xb193e341d6a047d15eea33766d656d807b89393665a783a316e9ba10518e5515c8e0ade3d6e15641d917a8a172a5a635", + "0xade435ec0671b3621dde69e07ead596014f6e1daa1152707a8c18877a8b067bde2895dd47444ffa69db2bbef1f1d8816", + "0xa7fd3d6d87522dfc56fb47aef9ce781a1597c56a8bbfd796baba907afdc872f753d732bfda1d3402aee6c4e0c189f52d", + "0xa298cb4f4218d0464b2fab393e512bbc477c3225aa449743299b2c3572f065bc3a42d07e29546167ed9e1b6b3b3a3af3", + "0xa9ee57540e1fd9c27f4f0430d194b91401d0c642456c18527127d1f95e2dba41c2c86d1990432eb38a692fda058fafde", + "0x81d6c1a5f93c04e6d8e5a7e0678c1fc89a1c47a5c920bcd36180125c49fcf7c114866b90e90a165823560b19898a7c16", + "0xa4b7a1ec9e93c899b9fd9aaf264c50e42c36c0788d68296a471f7a3447af4dbc81e4fa96070139941564083ec5b5b5a1", + "0xb3364e327d381f46940c0e11e29f9d994efc6978bf37a32586636c0070b03e4e23d00650c1440f448809e1018ef9f6d8", + "0x8056e0913a60155348300e3a62e28b5e30629a90f7dd4fe11289097076708110a1d70f7855601782a3cdc5bdb1ca9626", + "0xb4980fd3ea17bac0ba9ee1c470b17e575bb52e83ebdd7d40c93f4f87bebeaff1c8a679f9d3d09d635f068d37d5bd28bd", + "0x905a9299e7e1853648e398901dfcd437aa575c826551f83520df62984f5679cb5f0ea86aa45ed3e18b67ddc0dfafe809", + "0xab99553bf31a84f2e0264eb34a08e13d8d15e2484aa9352354becf9a15999c76cc568d68274b70a65e49703fc23540d0", + "0xa43681597bc574d2dae8964c9a8dc1a07613d7a1272bdcb818d98c85d44e16d744250c33f3b5e4d552d97396b55e601f", + "0xa54e5a31716fccb50245898c99865644405b8dc920ded7a11f3d19bdc255996054b268e16f2e40273f11480e7145f41e", + "0x8134f3ad5ef2ad4ba12a8a4e4d8508d91394d2bcdc38b7c8c8c0b0a820357ac9f79d286c65220f471eb1adca1d98fc68", + "0x94e2f755e60471578ab2c1adb9e9cea28d4eec9b0e92e0140770bca7002c365fcabfe1e5fb4fe6cfe79a0413712aa3ef", + "0xad48f8d0ce7eb3cc6e2a3086ad96f562e5bed98a360721492ae2e74dc158586e77ec8c35d5fd5927376301b7741bad2b", + "0x8614f0630bdd7fbad3a31f55afd9789f1c605dc85e7dc67e2edfd77f5105f878bb79beded6e9f0b109e38ea7da67e8d5", + "0x9804c284c4c5e77dabb73f655b12181534ca877c3e1e134aa3f47c23b7ec92277db34d2b0a5d38d2b69e5d1c3008a3e3", + "0xa51b99c3088e473afdaa9e0a9f7e75a373530d3b04e44e1148da0726b95e9f5f0c7e571b2da000310817c36f84b19f7f", + "0xac4ff909933b3b76c726b0a382157cdc74ab851a1ac6cef76953c6444441804cc43abb883363f416592e8f6cfbc4550b", + "0xae7d915eb9fc928b65a29d6edbc75682d08584d0014f7bcf17d59118421ae07d26a02137d1e4de6938bcd1ab8ef48fad", + "0x852f7e453b1af89b754df6d11a40d5d41ea057376e8ecacd705aacd2f917457f4a093d6b9a8801837fa0f62986ad7149", + "0x92c6bf5ada5d0c3d4dd8058483de36c215fa98edab9d75242f3eff9db07c734ad67337da6f0eefe23a487bf75a600dee", + "0xa2b42c09d0db615853763552a48d2e704542bbd786aae016eb58acbf6c0226c844f5fb31e428cb6450b9db855f8f2a6f", + "0x880cc07968266dbfdcfbc21815cd69e0eddfee239167ac693fb0413912d816f2578a74f7716eecd6deefa68c6eccd394", + "0xb885b3ace736cd373e8098bf75ba66fa1c6943ca1bc4408cd98ac7074775c4478594f91154b8a743d9c697e1b29f5840", + "0xa51ce78de512bd87bfa0835de819941dffbf18bec23221b61d8096fc9436af64e0693c335b54e7bfc763f287bdca2db6", + "0xa3c76166a3bdb9b06ef696e57603b58871bc72883ee9d45171a30fe6e1d50e30bc9c51b4a0f5a7270e19a77b89733850", + "0xacefc5c6f8a1e7c24d7b41e0fc7f6f3dc0ede6cf3115ffb9a6e54b1d954cbca9bda8ad7a084be9be245a1b8e9770d141", + "0xb420ed079941842510e31cfad117fa11fb6b4f97dfbc6298cb840f27ebaceba23eeaf3f513bcffbf5e4aae946310182d", + "0x95c3bb5ef26c5ed2f035aa5d389c6b3c15a6705b9818a3fefaed28922158b35642b2e8e5a1a620fdad07e75ad4b43af4", + "0x825149f9081ecf07a2a4e3e8b5d21bade86c1a882475d51c55ee909330b70c5a2ac63771c8600c6f38df716af61a3ea1", + "0x873b935aae16d9f08adbc25353cee18af2f1b8d5f26dec6538d6bbddc515f2217ed7d235dcfea59ae61b428798b28637", + "0x9294150843a2bedcedb3bb74c43eb28e759cf9499582c5430bccefb574a8ddd4f11f9929257ff4c153990f9970a2558f", + "0xb619563a811cc531da07f4f04e5c4c6423010ff9f8ed7e6ec9449162e3d501b269fb1c564c09c0429431879b0f45df02", + "0x91b509b87eb09f007d839627514658c7341bc76d468920fe8a740a8cb96a7e7e631e0ea584a7e3dc1172266f641d0f5c", + "0x8b8aceace9a7b9b4317f1f01308c3904d7663856946afbcea141a1c615e21ccad06b71217413e832166e9dd915fbe098", + "0x87b3b36e725833ea0b0f54753c3728c0dbc87c52d44d705ffc709f2d2394414c652d3283bab28dcce09799504996cee0", + "0xb2670aad5691cbf308e4a6a77a075c4422e6cbe86fdba24e9f84a313e90b0696afb6a067eebb42ba2d10340d6a2f6e51", + "0x876784a9aff3d54faa89b2bacd3ff5862f70195d0b2edc58e8d1068b3c9074c0da1cfa23671fe12f35e33b8a329c0ccd", + "0x8b48b9e758e8a8eae182f5cbec96f67d20cca6d3eee80a2d09208eb1d5d872e09ef23d0df8ebbb9b01c7449d0e3e3650", + "0xb79303453100654c04a487bdcadc9e3578bc80930c489a7069a52e8ca1dba36c492c8c899ce025f8364599899baa287d", + "0x961b35a6111da54ece6494f24dacd5ea46181f55775b5f03df0e370c34a5046ac2b4082925855325bb42bc2a2c98381d", + "0xa31feb1be3f5a0247a1f7d487987eb622e34fca817832904c6ee3ee60277e5847945a6f6ea1ac24542c72e47bdf647df", + "0xa12a2aa3e7327e457e1aae30e9612715dd2cfed32892c1cd6dcda4e9a18203af8a44afb46d03b2eed89f6b9c5a2c0c23", + "0xa08265a838e69a2ca2f80fead6ccf16f6366415b920c0b22ee359bcd8d4464ecf156f400a16a7918d52e6d733dd64211", + "0xb723d6344e938d801cca1a00032af200e541d4471fd6cbd38fb9130daa83f6a1dffbbe7e67fc20f9577f884acd7594b2", + "0xa6733d83ec78ba98e72ddd1e7ff79b7adb0e559e256760d0c590a986e742445e8cdf560d44b29439c26d87edd0b07c8c", + "0xa61c2c27d3f7b9ff4695a17afedf63818d4bfba390507e1f4d0d806ce8778d9418784430ce3d4199fd3bdbc2504d2af3", + "0x8332f3b63a6dc985376e8b1b25eeae68be6160fbe40053ba7bcf6f073204f682da72321786e422d3482fd60c9e5aa034", + "0xa280f44877583fbb6b860d500b1a3f572e3ee833ec8f06476b3d8002058e25964062feaa1e5bec1536d734a5cfa09145", + "0xa4026a52d277fcea512440d2204f53047718ebfcae7b48ac57ea7f6bfbc5de9d7304db9a9a6cbb273612281049ddaec5", + "0x95cdf69c831ab2fad6c2535ede9c07e663d2ddccc936b64e0843d2df2a7b1c31f1759c3c20f1e7a57b1c8f0dbb21b540", + "0x95c96cec88806469c277ab567863c5209027cecc06c7012358e5f555689c0d9a5ffb219a464f086b45817e8536b86d2f", + "0xafe38d4684132a0f03d806a4c8df556bf589b25271fbc6fe2e1ed16de7962b341c5003755da758d0959d2e6499b06c68", + "0xa9b77784fda64987f97c3a23c5e8f61b918be0f7c59ba285084116d60465c4a2aaafc8857eb16823282cc83143eb9126", + "0xa830f05881ad3ce532a55685877f529d32a5dbe56cea57ffad52c4128ee0fad0eeaf0da4362b55075e77eda7babe70e5", + "0x992b3ad190d6578033c13ed5abfee4ef49cbc492babb90061e3c51ee4b5790cdd4c8fc1abff1fa2c00183b6b64f0bbbe", + "0xb1015424d9364aeff75de191652dc66484fdbec3e98199a9eb9671ec57bec6a13ff4b38446e28e4d8aedb58dd619cd90", + "0xa745304604075d60c9db36cada4063ac7558e7ec2835d7da8485e58d8422e817457b8da069f56511b02601289fbb8981", + "0xa5ba4330bc5cb3dbe0486ddf995632a7260a46180a08f42ae51a2e47778142132463cc9f10021a9ad36986108fefa1a9", + "0xb419e9fd4babcaf8180d5479db188bb3da232ae77a1c4ed65687c306e6262f8083070a9ac32220cddb3af2ec73114092", + "0xa49e23dc5f3468f3bf3a0bb7e4a114a788b951ff6f23a3396ae9e12cbff0abd1240878a3d1892105413dbc38818e807c", + "0xb7ecc7b4831f650202987e85b86bc0053f40d983f252e9832ef503aea81c51221ce93279da4aa7466c026b2d2070e55d", + "0x96a8c35cb87f84fa84dcd6399cc2a0fd79cc9158ef4bdde4bae31a129616c8a9f2576cd19baa3f497ca34060979aed7d", + "0x8681b2c00aa62c2b519f664a95dcb8faef601a3b961bb4ce5d85a75030f40965e2983871d41ea394aee934e859581548", + "0x85c229a07efa54a713d0790963a392400f55fbb1a43995a535dc6c929f20d6a65cf4efb434e0ad1cb61f689b8011a3bc", + "0x90856f7f3444e5ad44651c28e24cc085a5db4d2ffe79aa53228c26718cf53a6e44615f3c5cda5aa752d5f762c4623c66", + "0x978999b7d8aa3f28a04076f74d11c41ef9c89fdfe514936c4238e0f13c38ec97e51a5c078ebc6409e517bfe7ccb42630", + "0xa099914dd7ed934d8e0d363a648e9038eb7c1ec03fa04dbcaa40f7721c618c3ef947afef7a16b4d7ac8c12aa46637f03", + "0xab2a104fed3c83d16f2cda06878fa5f30c8c9411de71bfb67fd2fc9aa454dcbcf3d299d72f8cc12e919466a50fcf7426", + "0xa4471d111db4418f56915689482f6144efc4664cfb0311727f36c864648d35734351becc48875df96f4abd3cfcf820f9", + "0x83be11727cd30ea94ccc8fa31b09b81c9d6a9a5d3a4686af9da99587332fe78c1f94282f9755854bafd6033549afec91", + "0x88020ff971dc1a01a9e993cd50a5d2131ffdcbb990c1a6aaa54b20d8f23f9546a70918ea57a21530dcc440c1509c24ad", + "0xae24547623465e87905eaffa1fa5d52bb7c453a8dbd89614fa8819a2abcedaf455c2345099b7324ae36eb0ad7c8ef977", + "0xb59b0c60997de1ee00b7c388bc7101d136c9803bf5437b1d589ba57c213f4f835a3e4125b54738e78abbc21b000f2016", + "0xa584c434dfe194546526691b68fa968c831c31da42303a1d735d960901c74011d522246f37f299555416b8cf25c5a548", + "0x80408ce3724f4837d4d52376d255e10f69eb8558399ae5ca6c11b78b98fe67d4b93157d2b9b639f1b5b64198bfe87713", + "0xabb941e8d406c2606e0ddc35c113604fdd9d249eacc51cb64e2991e551b8639ce44d288cc92afa7a1e7fc599cfc84b22", + "0xb223173f560cacb1c21dba0f1713839e348ad02cbfdef0626748604c86f89e0f4c919ed40b583343795bdd519ba952c8", + "0xaf1c70512ec3a19d98b8a1fc3ff7f7f5048a27d17d438d43f561974bbdd116fcd5d5c21040f3447af3f0266848d47a15", + "0x8a44809568ebe50405bede19b4d2607199159b26a1b33e03d180e6840c5cf59d991a4fb150d111443235d75ecad085b7", + "0xb06207cdca46b125a27b3221b5b50cf27af4c527dd7c80e2dbcebbb09778a96df3af67e50f07725239ce3583dad60660", + "0x993352d9278814ec89b26a11c4a7c4941bf8f0e6781ae79559d14749ee5def672259792db4587f85f0100c7bb812f933", + "0x9180b8a718b971fd27bc82c8582d19c4b4f012453e8c0ffeeeffe745581fc6c07875ab28be3af3fa3896d19f0c89ac5b", + "0x8b8e1263eb48d0fe304032dd5ea1f30e73f0121265f7458ba9054d3626894e8a5fef665340abd2ede9653045c2665938", + "0x99a2beee4a10b7941c24b2092192faf52b819afd033e4a2de050fd6c7f56d364d0cf5f99764c3357cf32399e60fc5d74", + "0x946a4aad7f8647ea60bee2c5fcdeb6f9a58fb2cfca70c4d10e458027a04846e13798c66506151be3df9454b1e417893f", + "0xa672a88847652d260b5472d6908d1d57e200f1e492d30dd1cecc441cdfc9b76e016d9bab560efd4d7f3c30801de884a9", + "0x9414e1959c156cde1eb24e628395744db75fc24b9df4595350aaad0bc38e0246c9b4148f6443ef68b8e253a4a6bcf11c", + "0x9316e9e4ec5fab4f80d6540df0e3a4774db52f1d759d2e5b5bcd3d7b53597bb007eb1887cb7dc61f62497d51ffc8d996", + "0x902d6d77bb49492c7a00bc4b70277bc28c8bf9888f4307bb017ac75a962decdedf3a4e2cf6c1ea9f9ba551f4610cbbd7", + "0xb07025a18b0e32dd5e12ec6a85781aa3554329ea12c4cd0d3b2c22e43d777ef6f89876dd90a9c8fb097ddf61cf18adc5", + "0xb355a849ad3227caa4476759137e813505ec523cbc2d4105bc7148a4630f9e81918d110479a2d5f5e4cd9ccec9d9d3e3", + "0xb49532cfdf02ee760109881ad030b89c48ee3bb7f219ccafc13c93aead754d29bdafe345be54c482e9d5672bd4505080", + "0x9477802410e263e4f938d57fa8f2a6cac7754c5d38505b73ee35ea3f057aad958cb9722ba6b7b3cfc4524e9ca93f9cdc", + "0x9148ea83b4436339580f3dbc9ba51509e9ab13c03063587a57e125432dd0915f5d2a8f456a68f8fff57d5f08c8f34d6e", + "0xb00b6b5392b1930b54352c02b1b3b4f6186d20bf21698689bbfc7d13e86538a4397b90e9d5c93fd2054640c4dbe52a4f", + "0x926a9702500441243cd446e7cbf15dde16400259726794694b1d9a40263a9fc9e12f7bcbf12a27cb9aaba9e2d5848ddc", + "0xa0c6155f42686cbe7684a1dc327100962e13bafcf3db97971fc116d9f5c0c8355377e3d70979cdbd58fd3ea52440901c", + "0xa277f899f99edb8791889d0817ea6a96c24a61acfda3ad8c3379e7c62b9d4facc4b965020b588651672fd261a77f1bfc", + "0x8f528cebb866b501f91afa50e995234bef5bf20bff13005de99cb51eaac7b4f0bf38580cfd0470de40f577ead5d9ba0f", + "0x963fc03a44e9d502cc1d23250efef44d299befd03b898d07ce63ca607bb474b5cf7c965a7b9b0f32198b04a8393821f7", + "0xab087438d0a51078c378bf4a93bd48ef933ff0f1fa68d02d4460820df564e6642a663b5e50a5fe509527d55cb510ae04", + "0xb0592e1f2c54746bb076be0fa480e1c4bebc4225e1236bcda3b299aa3853e3afb401233bdbcfc4a007b0523a720fbf62", + "0x851613517966de76c1c55a94dc4595f299398a9808f2d2f0a84330ba657ab1f357701d0895f658c18a44cb00547f6f57", + "0xa2fe9a1dd251e72b0fe4db27be508bb55208f8f1616b13d8be288363ec722826b1a1fd729fc561c3369bf13950bf1fd6", + "0xb896cb2bc2d0c77739853bc59b0f89b2e008ba1f701c9cbe3bef035f499e1baee8f0ff1e794854a48c320586a2dfc81a", + "0xa1b60f98e5e5106785a9b81a85423452ee9ef980fa7fa8464f4366e73f89c50435a0c37b2906052b8e58e212ebd366cf", + "0xa853b0ebd9609656636df2e6acd5d8839c0fda56f7bf9288a943b06f0b67901a32b95e016ca8bc99bd7b5eab31347e72", + "0xb290fa4c1346963bd5225235e6bdf7c542174dab4c908ab483d1745b9b3a6015525e398e1761c90e4b49968d05e30eea", + "0xb0f65a33ad18f154f1351f07879a183ad62e5144ad9f3241c2d06533dad09cbb2253949daff1bb02d24d16a3569f7ef0", + "0xa00db59b8d4218faf5aeafcd39231027324408f208ec1f54d55a1c41228b463b88304d909d16b718cfc784213917b71e", + "0xb8d695dd33dc2c3bc73d98248c535b2770ad7fa31aa726f0aa4b3299efb0295ba9b4a51c71d314a4a1bd5872307534d1", + "0xb848057cca2ca837ee49c42b88422303e58ea7d2fc76535260eb5bd609255e430514e927cc188324faa8e657396d63ec", + "0x92677836061364685c2aaf0313fa32322746074ed5666fd5f142a7e8f87135f45cd10e78a17557a4067a51dfde890371", + "0xa854b22c9056a3a24ab164a53e5c5cf388616c33e67d8ebb4590cb16b2e7d88b54b1393c93760d154208b5ca822dc68f", + "0x86fff174920388bfab841118fb076b2b0cdec3fdb6c3d9a476262f82689fb0ed3f1897f7be9dbf0932bb14d346815c63", + "0x99661cf4c94a74e182752bcc4b98a8c2218a8f2765642025048e12e88ba776f14f7be73a2d79bd21a61def757f47f904", + "0x8a8893144d771dca28760cba0f950a5d634195fd401ec8cf1145146286caffb0b1a6ba0c4c1828d0a5480ce49073c64c", + "0x938a59ae761359ee2688571e7b7d54692848eb5dde57ffc572b473001ea199786886f8c6346a226209484afb61d2e526", + "0x923f68a6aa6616714cf077cf548aeb845bfdd78f2f6851d8148cba9e33a374017f2f3da186c39b82d14785a093313222", + "0xac923a93d7da7013e73ce8b4a2b14b8fd0cc93dc29d5de941a70285bdd19be4740fedfe0c56b046689252a3696e9c5bc", + "0xb49b32c76d4ec1a2c68d4989285a920a805993bc6fcce6dacd3d2ddae73373050a5c44ba8422a3781050682fa0ef6ba2", + "0x8a367941c07c3bdca5712524a1411bad7945c7c48ffc7103b1d4dff2c25751b0624219d1ccde8c3f70c465f954be5445", + "0xb838f029df455efb6c530d0e370bbbf7d87d61a9aea3d2fe5474c5fe0a39cf235ceecf9693c5c6c5820b1ba8f820bd31", + "0xa8983b7c715eaac7f13a001d2abc462dfc1559dab4a6b554119c271aa8fe00ffcf6b6949a1121f324d6d26cb877bcbae", + "0xa2afb24ad95a6f14a6796315fbe0d8d7700d08f0cfaf7a2abe841f5f18d4fecf094406cbd54da7232a159f9c5b6e805e", + "0x87e8e95ad2d62f947b2766ff405a23f7a8afba14e7f718a691d95369c79955cdebe24c54662553c60a3f55e6322c0f6f", + "0x87c2cbcecb754e0cc96128e707e5c5005c9de07ffd899efa3437cadc23362f5a1d3fcdd30a1f5bdc72af3fb594398c2a", + "0x91afd6ee04f0496dc633db88b9370d41c428b04fd991002502da2e9a0ef051bcd7b760e860829a44fbe5539fa65f8525", + "0x8c50e5d1a24515a9dd624fe08b12223a75ca55196f769f24748686315329b337efadca1c63f88bee0ac292dd0a587440", + "0x8a07e8f912a38d94309f317c32068e87f68f51bdfa082d96026f5f5f8a2211621f8a3856dda8069386bf15fb2d28c18f", + "0x94ad1dbe341c44eeaf4dc133eed47d8dbfe752575e836c075745770a6679ff1f0e7883b6aa917462993a7f469d74cab5", + "0x8745f8bd86c2bb30efa7efb7725489f2654f3e1ac4ea95bd7ad0f3cfa223055d06c187a16192d9d7bdaea7b050c6a324", + "0x900d149c8d79418cda5955974c450a70845e02e5a4ecbcc584a3ca64d237df73987c303e3eeb79da1af83bf62d9e579f", + "0x8f652ab565f677fb1a7ba03b08004e3cda06b86c6f1b0b9ab932e0834acf1370abb2914c15b0d08327b5504e5990681c", + "0x9103097d088be1f75ab9d3da879106c2f597e2cc91ec31e73430647bdd5c33bcfd771530d5521e7e14df6acda44f38a6", + "0xb0fec7791cfb0f96e60601e1aeced9a92446b61fedab832539d1d1037558612d78419efa87ff5f6b7aab8fd697d4d9de", + "0xb9d2945bdb188b98958854ba287eb0480ef614199c4235ce5f15fc670b8c5ffe8eeb120c09c53ea8a543a022e6a321ac", + "0xa9461bb7d5490973ebaa51afc0bb4a5e42acdccb80e2f939e88b77ac28a98870e103e1042899750f8667a8cc9123bae9", + "0xa37fdf11d4bcb2aed74b9f460a30aa34afea93386fa4cdb690f0a71bc58f0b8df60bec56e7a24f225978b862626fa00e", + "0xa214420e183e03d531cf91661466ea2187d84b6e814b8b20b3730a9400a7d25cf23181bb85589ebc982cec414f5c2923", + "0xad09a45a698a6beb3e0915f540ef16e9af7087f53328972532d6b5dfe98ce4020555ece65c6cbad8bd6be8a4dfefe6fd", + "0xab6742800b02728c92d806976764cb027413d6f86edd08ad8bb5922a2969ee9836878cd39db70db0bd9a2646862acc4f", + "0x974ca9305bd5ea1dc1755dff3b63e8bfe9f744321046c1395659bcea2a987b528e64d5aa96ac7b015650b2253b37888d", + "0x84eee9d6bce039c52c2ebc4fccc0ad70e20c82f47c558098da4be2f386a493cbc76adc795b5488c8d11b6518c2c4fab8", + "0x875d7bda46efcb63944e1ccf760a20144df3b00d53282b781e95f12bfc8f8316dfe6492c2efbf796f1150e36e436e9df", + "0xb68a2208e0c587b5c31b5f6cb32d3e6058a9642e2d9855da4f85566e1412db528475892060bb932c55b3a80877ad7b4a", + "0xba006368ecab5febb6ab348644d9b63de202293085ed468df8bc24d992ae8ce468470aa37f36a73630c789fb9c819b30", + "0x90a196035150846cd2b482c7b17027471372a8ce7d914c4d82b6ea7fa705d8ed5817bd42d63886242585baf7d1397a1c", + "0xa223b4c85e0daa8434b015fd9170b5561fe676664b67064974a1e9325066ecf88fc81f97ab5011c59fad28cedd04b240", + "0x82e8ec43139cf15c6bbeed484b62e06cded8a39b5ce0389e4cbe9c9e9c02f2f0275d8d8d4e8dfec8f69a191bef220408", + "0x81a3fc07a7b68d92c6ee4b6d28f5653ee9ec85f7e2ee1c51c075c1b130a8c5097dc661cf10c5aff1c7114b1a6a19f11a", + "0x8ed2ef8331546d98819a5dd0e6c9f8cb2630d0847671314a28f277faf68da080b53891dd75c82cbcf7788b255490785d", + "0xacecabf84a6f9bbed6b2fc2e7e4b48f02ef2f15e597538a73aea8f98addc6badda15e4695a67ecdb505c1554e8f345ec", + "0xb8f51019b2aa575f8476e03dcadf86cc8391f007e5f922c2a36b2daa63f5a503646a468990cd5c65148d323942193051", + "0xaaa595a84b403ec65729bc1c8055a94f874bf9adddc6c507b3e1f24f79d3ad359595a672b93aab3394db4e2d4a7d8970", + "0x895144c55fcbd0f64d7dd69e6855cfb956e02b5658eadf0f026a70703f3643037268fdd673b0d21b288578a83c6338dd", + "0xa2e92ae6d0d237d1274259a8f99d4ea4912a299816350b876fba5ebc60b714490e198a916e1c38c6e020a792496fa23c", + "0xa45795fda3b5bb0ad1d3c628f6add5b2a4473a1414c1a232e80e70d1cfffd7f8a8d9861f8df2946999d7dbb56bf60113", + "0xb6659bf7f6f2fef61c39923e8c23b8c70e9c903028d8f62516d16755cd3fba2fe41c285aa9432dc75ab08f8a1d8a81fc", + "0xa735609a6bc5bfd85e58234fc439ff1f58f1ff1dd966c5921d8b649e21f006bf2b8642ad8a75063c159aaf6935789293", + "0xa3c622eb387c9d15e7bda2e3e84d007cb13a6d50d655c3f2f289758e49d3b37b9a35e4535d3cc53d8efd51f407281f19", + "0x8afe147b53ad99220f5ef9d763bfc91f9c20caecbcf823564236fb0e6ede49414c57d71eec4772c8715cc65a81af0047", + "0xb5f0203233cf71913951e9c9c4e10d9243e3e4a1f2cb235bf3f42009120ba96e04aa414c9938ea8873b63148478927e8", + "0x93c52493361b458d196172d7ba982a90a4f79f03aa8008edc322950de3ce6acf4c3977807a2ffa9e924047e02072b229", + "0xb9e72b805c8ac56503f4a86c82720afbd5c73654408a22a2ac0b2e5caccdfb0e20b59807433a6233bc97ae58cf14c70a", + "0xaf0475779b5cee278cca14c82da2a9f9c8ef222eb885e8c50cca2315fea420de6e04146590ed0dd5a29c0e0812964df5", + "0xb430ccab85690db02c2d0eb610f3197884ca12bc5f23c51e282bf3a6aa7e4a79222c3d8761454caf55d6c01a327595f9", + "0x830032937418b26ee6da9b5206f3e24dc76acd98589e37937e963a8333e5430abd6ce3dd93ef4b8997bd41440eed75d6", + "0x8820a6d73180f3fe255199f3f175c5eb770461ad5cfdde2fb11508041ed19b8c4ce66ad6ecebf7d7e836cc2318df47ca", + "0xaef1393e7d97278e77bbf52ef6e1c1d5db721ccf75fe753cf47a881fa034ca61eaa5098ee5a344c156d2b14ff9e284ad", + "0x8a4a26c07218948c1196c45d927ef4d2c42ade5e29fe7a91eaebe34a29900072ce5194cf28d51f746f4c4c649daf4396", + "0x84011dc150b7177abdcb715efbd8c201f9cb39c36e6069af5c50a096021768ba40cef45b659c70915af209f904ede3b6", + "0xb1bd90675411389bb66910b21a4bbb50edce5330850c5ab0b682393950124252766fc81f5ecfc72fb7184387238c402e", + "0x8dfdcd30583b696d2c7744655f79809f451a60c9ad5bf1226dc078b19f4585d7b3ef7fa9d54e1ac09520d95cbfd20928", + "0xb351b4dc6d98f75b8e5a48eb7c6f6e4b78451991c9ba630e5a1b9874c15ac450cd409c1a024713bf2cf82dc400e025ef", + "0xa462b8bc97ac668b97b28b3ae24b9f5de60e098d7b23ecb600d2194cd35827fb79f77c3e50d358f5bd72ee83fef18fa0", + "0xa183753265c5f7890270821880cce5f9b2965b115ba783c6dba9769536f57a04465d7da5049c7cf8b3fcf48146173c18", + "0xa8a771b81ed0d09e0da4d79f990e58eabcd2be3a2680419502dd592783fe52f657fe55125b385c41d0ba3b9b9cf54a83", + "0xa71ec577db46011689d073245e3b1c3222a9b1fe6aa5b83629adec5733dd48617ebea91346f0dd0e6cdaa86e4931b168", + "0xa334b8b244f0d598a02da6ae0f918a7857a54dce928376c4c85df15f3b0f2ba3ac321296b8b7c9dd47d770daf16c8f8c", + "0xa29037f8ef925c417c90c4df4f9fb27fb977d04e2b3dd5e8547d33e92ab72e7a00f5461de21e28835319eae5db145eb7", + "0xb91054108ae78b00e3298d667b913ebc44d8f26e531eae78a8fe26fdfb60271c97efb2dee5f47ef5a3c15c8228138927", + "0x926c13efbe90604f6244be9315a34f72a1f8d1aab7572df431998949c378cddbf2fe393502c930fff614ff06ae98a0ce", + "0x995c758fd5600e6537089b1baa4fbe0376ab274ff3e82a17768b40df6f91c2e443411de9cafa1e65ea88fb8b87d504f4", + "0x9245ba307a7a90847da75fca8d77ec03fdfc812c871e7a2529c56a0a79a6de16084258e7a9ac4ae8a3756f394336e21c", + "0x99e0cfa2bb57a7e624231317044c15e52196ecce020db567c8e8cb960354a0be9862ee0c128c60b44777e65ac315e59f", + "0xad4f6b3d27bbbb744126601053c3dc98c07ff0eb0b38a898bd80dce778372846d67e5ab8fb34fb3ad0ef3f235d77ba7f", + "0xa0f12cae3722bbbca2e539eb9cc7614632a2aefe51410430070a12b5bc5314ecec5857b7ff8f41e9980cac23064f7c56", + "0xb487f1bc59485848c98222fd3bc36c8c9bb3d2912e2911f4ceca32c840a7921477f9b1fe00877e05c96c75d3eecae061", + "0xa6033db53925654e18ecb3ce715715c36165d7035db9397087ac3a0585e587998a53973d011ac6d48af439493029cee6", + "0xa6b4d09cd01c70a3311fd131d3710ccf97bde3e7b80efd5a8c0eaeffeb48cca0f951ced905290267b115b06d46f2693b", + "0xa9dff1df0a8f4f218a98b6f818a693fb0d611fed0fc3143537cbd6578d479af13a653a8155e535548a2a0628ae24fa58", + "0xa58e469f65d366b519f9a394cacb7edaddac214463b7b6d62c2dbc1316e11c6c5184ce45c16de2d77f990dcdd8b55430", + "0x989e71734f8119103586dc9a3c5f5033ddc815a21018b34c1f876cdfc112efa868d5751bf6419323e4e59fa6a03ece1c", + "0xa2da00e05036c884369e04cf55f3de7d659cd5fa3f849092b2519dd263694efe0f051953d9d94b7e121f0aee8b6174d7", + "0x968f3c029f57ee31c4e1adea89a7f92e28483af9a74f30fbdb995dc2d40e8e657dff8f8d340d4a92bf65f54440f2859f", + "0x932778df6f60ac1639c1453ef0cbd2bf67592759dcccb3e96dcc743ff01679e4c7dd0ef2b0833dda548d32cb4eba49e2", + "0xa805a31139f8e0d6dae1ac87d454b23a3dc9fc653d4ca18d4f8ebab30fc189c16e73981c2cb7dd6f8c30454a5208109d", + "0xa9ba0991296caa2aaa4a1ceacfb205544c2a2ec97088eace1d84ee5e2767656a172f75d2f0c4e16a3640a0e0dec316e0", + "0xb1e49055c968dced47ec95ae934cf45023836d180702e20e2df57e0f62fb85d7ac60d657ba3ae13b8560b67210449459", + "0xa94e1da570a38809c71e37571066acabff7bf5632737c9ab6e4a32856924bf6211139ab3cedbf083850ff2d0e0c0fcfc", + "0x88ef1bb322000c5a5515b310c838c9af4c1cdbb32eab1c83ac3b2283191cd40e9573747d663763a28dad0d64adc13840", + "0xa987ce205f923100df0fbd5a85f22c9b99b9b9cbe6ddfa8dfda1b8fe95b4f71ff01d6c5b64ca02eb24edb2b255a14ef0", + "0x84fe8221a9e95d9178359918a108de4763ebfa7a6487facb9c963406882a08a9a93f492f8e77cf9e7ea41ae079c45993", + "0xaa1cf3dc7c5dcfa15bbbc811a4bb6dbac4fba4f97fb1ed344ab60264d7051f6eef19ea9773441d89929ee942ed089319", + "0x8f6a7d610d59d9f54689bbe6a41f92d9f6096cde919c1ab94c3c7fcecf0851423bc191e5612349e10f855121c0570f56", + "0xb5af1fa7894428a53ea520f260f3dc3726da245026b6d5d240625380bfb9c7c186df0204bb604efac5e613a70af5106e", + "0xa5bce6055ff812e72ce105f147147c7d48d7a2313884dd1f488b1240ee320f13e8a33f5441953a8e7a3209f65b673ce1", + "0xb9b55b4a1422677d95821e1d042ab81bbf0bf087496504021ec2e17e238c2ca6b44fb3b635a5c9eac0871a724b8d47c3", + "0x941c38e533ce4a673a3830845b56786585e5fe49c427f2e5c279fc6db08530c8f91db3e6c7822ec6bb4f956940052d18", + "0xa38e191d66c625f975313c7007bbe7431b5a06ed2da1290a7d5d0f2ec73770d476efd07b8e632de64597d47df175cbb0", + "0x94ba76b667abf055621db4c4145d18743a368d951565632ed4e743dd50dd3333507c0c34f286a5c5fdbf38191a2255cd", + "0xa5ca38c60be5602f2bfa6e00c687ac96ac36d517145018ddbee6f12eb0faa63dd57909b9eeed26085fe5ac44e55d10ab", + "0xb00fea3b825e60c1ed1c5deb4b551aa65a340e5af36b17d5262c9cd2c508711e4dc50dc2521a2c16c7c901902266e64a", + "0x971b86fc4033485e235ccb0997a236206ba25c6859075edbcdf3c943116a5030b7f75ebca9753d863a522ba21a215a90", + "0xb3b31f52370de246ee215400975b674f6da39b2f32514fe6bd54e747752eedca22bb840493b44a67df42a3639c5f901f", + "0xaffbbfac9c1ba7cbfa1839d2ae271dd6149869b75790bf103230637da41857fc326ef3552ff31c15bda0694080198143", + "0xa95d42aa7ef1962520845aa3688f2752d291926f7b0d73ea2ee24f0612c03b43f2b0fe3c9a9a99620ffc8d487b981bc2", + "0x914a266065caf64985e8c5b1cb2e3f4e3fe94d7d085a1881b1fefa435afef4e1b39a98551d096a62e4f5cc1a7f0fdc2e", + "0x81a0b4a96e2b75bc1bf2dbd165d58d55cfd259000a35504d1ffb18bc346a3e6f07602c683723864ffb980f840836fd8d", + "0x91c1556631cddd4c00b65b67962b39e4a33429029d311c8acf73a18600e362304fb68bccb56fde40f49e95b7829e0b87", + "0x8befbacc19e57f7c885d1b7a6028359eb3d80792fe13b92a8400df21ce48deb0bb60f2ddb50e3d74f39f85d7eab23adc", + "0x92f9458d674df6e990789690ec9ca73dacb67fc9255b58c417c555a8cc1208ace56e8e538f86ba0f3615573a0fbac00d", + "0xb4b1b3062512d6ae7417850c08c13f707d5838e43d48eb98dd4621baf62eee9e82348f80fe9b888a12874bfa538771f8", + "0xa13c4a3ac642ede37d9c883f5319e748d2b938f708c9d779714108a449b343f7b71a6e3ef4080fee125b416762920273", + "0xaf44983d5fc8cceee0551ef934e6e653f2d3efa385e5c8a27a272463a6f333e290378cc307c2b664eb923c78994e706e", + "0xa389fd6c59fe2b4031cc244e22d3991e541bd203dd5b5e73a6159e72df1ab41d49994961500dcde7989e945213184778", + "0x8d2141e4a17836c548de9598d7b298b03f0e6c73b7364979a411c464e0628e21cff6ac3d6decdba5d1c4909eff479761", + "0x980b22ef53b7bdf188a3f14bc51b0dbfdf9c758826daa3cbc1e3986022406a8aa9a6a79e400567120b88c67faa35ce5f", + "0xa28882f0a055f96df3711de5d0aa69473e71245f4f3e9aa944e9d1fb166e02caa50832e46da6d3a03b4801735fd01b29", + "0x8db106a37d7b88f5d995c126abb563934dd8de516af48e85695d02b1aea07f79217e3cdd03c6f5ca57421830186c772b", + "0xb5a7e50da0559a675c472f7dfaee456caab6695ab7870541b2be8c2b118c63752427184aad81f0e1afc61aef1f28c46f", + "0x9962118780e20fe291d10b64f28d09442a8e1b5cffd0f3dd68d980d0614050a626c616b44e9807fbee7accecae00686a", + "0xb38ddf33745e8d2ad6a991aefaf656a33c5f8cbe5d5b6b6fd03bd962153d8fd0e01b5f8f96d80ae53ab28d593ab1d4e7", + "0x857dc12c0544ff2c0c703761d901aba636415dee45618aba2e3454ff9cbc634a85c8b05565e88520ff9be2d097c8b2b1", + "0xa80d465c3f8cc63af6d74a6a5086b626c1cb4a8c0fee425964c3bd203d9d7094e299f81ce96d58afc20c8c9a029d9dae", + "0x89e1c8fbde8563763be483123a3ed702efac189c6d8ab4d16c85e74bbaf856048cc42d5d6e138633a38572ba5ec3f594", + "0x893a594cf495535f6d216508f8d03c317dcf03446668cba688da90f52d0111ac83d76ad09bf5ea47056846585ee5c791", + "0xaadbd8be0ae452f7f9450c7d2957598a20cbf10139a4023a78b4438172d62b18b0de39754dd2f8862dbd50a3a0815e53", + "0xae7d39670ecca3eb6db2095da2517a581b0e8853bdfef619b1fad9aacd443e7e6a40f18209fadd44038a55085c5fe8b2", + "0x866ef241520eacb6331593cfcb206f7409d2f33d04542e6e52cba5447934e02d44c471f6c9a45963f9307e9809ab91d9", + "0xb1a09911ad3864678f7be79a9c3c3eb5c84a0a45f8dcb52c67148f43439aeaaa9fd3ed3471276b7e588b49d6ebe3033a", + "0xadd07b7f0dbb34049cd8feeb3c18da5944bf706871cfd9f14ff72f6c59ad217ebb1f0258b13b167851929387e4e34cfe", + "0xae048892d5c328eefbdd4fba67d95901e3c14d974bfc0a1fc68155ca9f0d59e61d7ba17c6c9948b120cf35fd26e6fee9", + "0x9185b4f3b7da0ddb4e0d0f09b8a9e0d6943a4611e43f13c3e2a767ed8592d31e0ba3ebe1914026a3627680274291f6e5", + "0xa9c022d4e37b0802284ce3b7ee9258628ab4044f0db4de53d1c3efba9de19d15d65cc5e608dbe149c21c2af47d0b07b5", + "0xb24dbd5852f8f24921a4e27013b6c3fa8885b973266cb839b9c388efad95821d5d746348179dcc07542bd0d0aefad1ce", + "0xb5fb4f279300876a539a27a441348764908bc0051ebd66dc51739807305e73db3d2f6f0f294ffb91b508ab150eaf8527", + "0xace50841e718265b290c3483ed4b0fdd1175338c5f1f7530ae9a0e75d5f80216f4de37536adcbc8d8c95982e88808cd0", + "0xb19cadcde0f63bd1a9c24bd9c2806f53c14c0b9735bf351601498408ba503ddbd2037c891041cbba47f58b8c483f3b21", + "0xb6061e63558d312eb891b97b39aa552fa218568d79ee26fe6dd5b864aea9e3216d8f2e2f3b093503be274766dac41426", + "0x89730fdb2876ab6f0fe780d695f6e12090259027e789b819956d786e977518057e5d1d7f5ab24a3ae3d5d4c97773bd2b", + "0xb6fa841e81f9f2cad0163a02a63ae96dc341f7ae803b616efc6e1da2fbea551c1b96b11ad02c4afbdf6d0cc9f23da172", + "0x8fb66187182629c861ddb6896d7ed3caf2ad050c3dba8ab8eb0d7a2c924c3d44c48d1a148f9e33fb1f061b86972f8d21", + "0x86022ac339c1f84a7fa9e05358c1a5b316b4fc0b83dbe9c8c7225dc514f709d66490b539359b084ce776e301024345fa", + "0xb50b9c321468da950f01480bb62b6edafd42f83c0001d6e97f2bd523a1c49a0e8574fb66380ea28d23a7c4d54784f9f0", + "0xa31c05f7032f30d1dac06678be64d0250a071fd655e557400e4a7f4c152be4d5c7aa32529baf3e5be7c4bd49820054f6", + "0xb95ac0848cd322684772119f5b682d90a66bbf9dac411d9d86d2c34844bbd944dbaf8e47aa41380455abd51687931a78", + "0xae4a6a5ce9553b65a05f7935e61e496a4a0f6fd8203367a2c627394c9ce1e280750297b74cdc48fd1d9a31e93f97bef4", + "0xa22daf35f6e9b05e52e0b07f7bd1dbbebd2c263033fb0e1b2c804e2d964e2f11bc0ece6aca6af079dd3a9939c9c80674", + "0x902150e0cb1f16b9b59690db35281e28998ce275acb313900da8b2d8dfd29fa1795f8ca3ff820c31d0697de29df347c1", + "0xb17b5104a5dc665cdd7d47e476153d715eb78c6e5199303e4b5445c21a7fa7cf85fe7cfd08d7570f4e84e579b005428c", + "0xa03f49b81c15433f121680aa02d734bb9e363af2156654a62bcb5b2ba2218398ccb0ff61104ea5d7df5b16ea18623b1e", + "0x802101abd5d3c88876e75a27ffc2f9ddcce75e6b24f23dba03e5201281a7bd5cc7530b6a003be92d225093ca17d3c3bb", + "0xa4d183f63c1b4521a6b52226fc19106158fc8ea402461a5cccdaa35fee93669df6a8661f45c1750cd01308149b7bf08e", + "0x8d17c22e0c8403b69736364d460b3014775c591032604413d20a5096a94d4030d7c50b9fe3240e31d0311efcf9816a47", + "0x947225acfcce5992eab96276f668c3cbe5f298b90a59f2bb213be9997d8850919e8f496f182689b5cbd54084a7332482", + "0x8df6f4ed216fc8d1905e06163ba1c90d336ab991a18564b0169623eb39b84e627fa267397da15d3ed754d1f3423bff07", + "0x83480007a88f1a36dea464c32b849a3a999316044f12281e2e1c25f07d495f9b1710b4ba0d88e9560e72433addd50bc2", + "0xb3019d6e591cf5b33eb972e49e06c6d0a82a73a75d78d383dd6f6a4269838289e6e07c245f54fed67f5c9bb0fd5e1c5f", + "0x92e8ce05e94927a9fb02debadb99cf30a26172b2705003a2c0c47b3d8002bf1060edb0f6a5750aad827c98a656b19199", + "0xac2aff801448dbbfc13cca7d603fd9c69e82100d997faf11f465323b97255504f10c0c77401e4d1890339d8b224f5803", + "0xb0453d9903d08f508ee27e577445dc098baed6cde0ac984b42e0f0efed62760bd58d5816cf1e109d204607b7b175e30c", + "0xae68dc4ba5067e825d46d2c7c67f1009ceb49d68e8d3e4c57f4bcd299eb2de3575d42ea45e8722f8f28497a6e14a1cfe", + "0xb22486c2f5b51d72335ce819bbafb7fa25eb1c28a378a658f13f9fc79cd20083a7e573248d911231b45a5cf23b561ca7", + "0x89d1201d1dbd6921867341471488b4d2fd0fc773ae1d4d074c78ae2eb779a59b64c00452c2a0255826fca6b3d03be2b1", + "0xa2998977c91c7a53dc6104f5bc0a5b675e5350f835e2f0af69825db8af4aeb68435bdbcc795f3dd1f55e1dd50bc0507f", + "0xb0be4937a925b3c05056ed621910d535ccabf5ab99fd3b9335080b0e51d9607d0fd36cb5781ff340018f6acfca4a9736", + "0xaea145a0f6e0ba9df8e52e84bb9c9de2c2dc822f70d2724029b153eb68ee9c17de7d35063dcd6a39c37c59fdd12138f7", + "0x91cb4545d7165ee8ffbc74c874baceca11fdebbc7387908d1a25877ca3c57f2c5def424dab24148826832f1e880bede0", + "0xb3b579cb77573f19c571ad5eeeb21f65548d7dff9d298b8d7418c11f3e8cd3727c5b467f013cb87d6861cfaceee0d2e3", + "0xb98a1eeec2b19fecc8378c876d73645aa52fb99e4819903735b2c7a885b242787a30d1269a04bfb8573d72d9bbc5f0f0", + "0x940c1f01ed362bd588b950c27f8cc1d52276c71bb153d47f07ec85b038c11d9a8424b7904f424423e714454d5e80d1cd", + "0xaa343a8ecf09ce11599b8cf22f7279cf80f06dbf9f6d62cb05308dbbb39c46fd0a4a1240b032665fbb488a767379b91b", + "0x87c3ac72084aca5974599d3232e11d416348719e08443acaba2b328923af945031f86432e170dcdd103774ec92e988c9", + "0x91d6486eb5e61d2b9a9e742c20ec974a47627c6096b3da56209c2b4e4757f007e793ebb63b2b246857c9839b64dc0233", + "0xaebcd3257d295747dd6fc4ff910d839dd80c51c173ae59b8b2ec937747c2072fa85e3017f9060aa509af88dfc7529481", + "0xb3075ba6668ca04eff19efbfa3356b92f0ab12632dcda99cf8c655f35b7928c304218e0f9799d68ef9f809a1492ff7db", + "0x93ba7468bb325639ec2abd4d55179c69fd04eaaf39fc5340709227bbaa4ad0a54ea8b480a1a3c8d44684e3be0f8d1980", + "0xa6aef86c8c0d92839f38544d91b767c582568b391071228ff5a5a6b859c87bf4f81a7d926094a4ada1993ddbd677a920", + "0x91dcd6d14207aa569194aa224d1e5037b999b69ade52843315ca61ba26abe9a76412c9e88259bc5cf5d7b95b97d9c3bc", + "0xb3b483d31c88f78d49bd065893bc1e3d2aa637e27dedb46d9a7d60be7660ce7a10aaaa7deead362284a52e6d14021178", + "0x8e5730070acf8371461ef301cc4523e8e672aa0e3d945d438a0e0aa6bdf8cb9c685dcf38df429037b0c8aff3955c6f5b", + "0xb8c6d769890a8ee18dc4f9e917993315877c97549549b34785a92543cbeec96a08ae3a28d6e809c4aacd69de356c0012", + "0x95ca86cd384eaceaa7c077c5615736ca31f36824bd6451a16142a1edc129fa42b50724aeed7c738f08d7b157f78b569e", + "0x94df609c6d71e8eee7ab74226e371ccc77e01738fe0ef1a6424435b4570fe1e5d15797b66ed0f64eb88d4a3a37631f0e", + "0x89057b9783212add6a0690d6bb99097b182738deff2bd9e147d7fd7d6c8eacb4c219923633e6309ad993c24572289901", + "0x83a0f9f5f265c5a0e54defa87128240235e24498f20965009fef664f505a360b6fb4020f2742565dfc7746eb185bcec0", + "0x91170da5306128931349bc3ed50d7df0e48a68b8cc8420975170723ac79d8773e4fa13c5f14dc6e3fafcad78379050b1", + "0xb7178484d1b55f7e56a4cc250b6b2ec6040437d96bdfddfa7b35ed27435860f3855c2eb86c636f2911b012eb83b00db8", + "0xac0b00c4322d1e4208e09cd977b4e54d221133ff09551f75b32b0b55d0e2be80941dda26257b0e288c162e63c7e9cf68", + "0x9690ed9e7e53ed37ff362930e4096b878b12234c332fd19d5d064824084245952eda9f979e0098110d6963e468cf513e", + "0xb6fa547bb0bb83e5c5be0ed462a8783fba119041c136a250045c09d0d2af330c604331e7de960df976ff76d67f8000cd", + "0x814603907c21463bcf4e59cfb43066dfe1a50344ae04ef03c87c0f61b30836c3f4dea0851d6fa358c620045b7f9214c8", + "0x9495639e3939fad2a3df00a88603a5a180f3c3a0fe4d424c35060e2043e0921788003689887b1ed5be424d9a89bb18bb", + "0xaba4c02d8d57f2c92d5bc765885849e9ff8393d6554f5e5f3e907e5bfac041193a0d8716d7861104a4295d5a03c36b03", + "0x8ead0b56c1ca49723f94a998ba113b9058059321da72d9e395a667e6a63d5a9dac0f5717cec343f021695e8ced1f72af", + "0xb43037f7e3852c34ed918c5854cd74e9d5799eeddfe457d4f93bb494801a064735e326a76e1f5e50a339844a2f4a8ec9", + "0x99db8422bb7302199eb0ff3c3d08821f8c32f53a600c5b6fb43e41205d96adae72be5b460773d1280ad1acb806af9be8", + "0x8a9be08eae0086c0f020838925984df345c5512ff32e37120b644512b1d9d4fecf0fd30639ca90fc6cf334a86770d536", + "0x81b43614f1c28aa3713a309a88a782fb2bdfc4261dd52ddc204687791a40cf5fd6a263a8179388596582cccf0162efc2", + "0xa9f3a8b76912deb61d966c75daf5ddb868702ebec91bd4033471c8e533183df548742a81a2671de5be63a502d827437d", + "0x902e2415077f063e638207dc7e14109652e42ab47caccd6204e2870115791c9defac5425fd360b37ac0f7bd8fe7011f8", + "0xaa18e4fdc1381b59c18503ae6f6f2d6943445bd00dd7d4a2ad7e5adad7027f2263832690be30d456e6d772ad76f22350", + "0xa348b40ba3ba7d81c5d4631f038186ebd5e5f314f1ea737259151b07c3cc8cf0c6ed4201e71bcc1c22fefda81a20cde6", + "0xaa1306f7ac1acbfc47dc6f7a0cb6d03786cec8c8dc8060388ccda777bca24bdc634d03e53512c23dba79709ff64f8620", + "0x818ccfe46e700567b7f3eb400e5a35f6a5e39b3db3aa8bc07f58ace35d9ae5a242faf8dbccd08d9a9175bbce15612155", + "0xb7e3da2282b65dc8333592bb345a473f03bd6df69170055fec60222de9897184536bf22b9388b08160321144d0940279", + "0xa4d976be0f0568f4e57de1460a1729129252b44c552a69fceec44e5b97c96c711763360d11f9e5bf6d86b4976bf40d69", + "0x85d185f0397c24c2b875b09b6328a23b87982b84ee880f2677a22ff4c9a1ba9f0fea000bb3f7f66375a00d98ebafce17", + "0xb4ccbb8c3a2606bd9b87ce022704663af71d418351575f3b350d294f4efc68c26f9a2ce49ff81e6ff29c3b63d746294e", + "0x93ffd3265fddb63724dfde261d1f9e22f15ecf39df28e4d89e9fea03221e8e88b5dd9b77628bacaa783c6f91802d47cc", + "0xb1fd0f8d7a01378e693da98d03a2d2fda6b099d03454b6f2b1fa6472ff6bb092751ce6290059826b74ac0361eab00e1e", + "0xa89f440c71c561641589796994dd2769616b9088766e983c873fae0716b95c386c8483ab8a4f367b6a68b72b7456dd32", + "0xaf4fe92b01d42d03dd5d1e7fa55e96d4bbcb7bf7d4c8c197acd16b3e0f3455807199f683dcd263d74547ef9c244b35cc", + "0xa8227f6e0a344dfe76bfbe7a1861be32c4f4bed587ccce09f9ce2cf481b2dda8ae4f566154bc663d15f962f2d41761bd", + "0xa7b361663f7495939ed7f518ba45ea9ff576c4e628995b7aea026480c17a71d63fc2c922319f0502eb7ef8f14a406882", + "0x8ddcf382a9f39f75777160967c07012cfa89e67b19714a7191f0c68eaf263935e5504e1104aaabd0899348c972a8d3c6", + "0x98c95b9f6f5c91f805fb185eedd06c6fc4457d37dd248d0be45a6a168a70031715165ea20606245cbdf8815dc0ac697f", + "0x805b44f96e001e5909834f70c09be3efcd3b43632bcac5b6b66b6d227a03a758e4b1768ce2a723045681a1d34562aaeb", + "0xb0e81b07cdc45b3dca60882676d9badb99f25c461b7efe56e3043b80100bb62d29e1873ae25eb83087273160ece72a55", + "0xb0c53f0abe78ee86c7b78c82ae1f7c070bb0b9c45c563a8b3baa2c515d482d7507bb80771e60b38ac13f78b8af92b4a9", + "0xa7838ef6696a9e4d2e5dfd581f6c8d6a700467e8fd4e85adabb5f7a56f514785dd4ab64f6f1b48366f7d94728359441b", + "0x88c76f7700a1d23c30366a1d8612a796da57b2500f97f88fdf2d76b045a9d24e7426a8ffa2f4e86d3046937a841dad58", + "0xad8964baf98c1f02e088d1d9fcb3af6b1dfa44cdfe0ed2eae684e7187c33d3a3c28c38e8f4e015f9c04d451ed6f85ff6", + "0x90e9d00a098317ececaa9574da91fc149eda5b772dedb3e5a39636da6603aa007804fa86358550cfeff9be5a2cb7845e", + "0xa56ff4ddd73d9a6f5ab23bb77efa25977917df63571b269f6a999e1ad6681a88387fcc4ca3b26d57badf91b236503a29", + "0x97ad839a6302c410a47e245df84c01fb9c4dfef86751af3f9340e86ff8fc3cd52fa5ff0b9a0bd1d9f453e02ca80658a6", + "0xa4c8c44cbffa804129e123474854645107d1f0f463c45c30fd168848ebea94880f7c0c5a45183e9eb837f346270bdb35", + "0xa72e53d0a1586d736e86427a93569f52edd2f42b01e78aee7e1961c2b63522423877ae3ac1227a2cf1e69f8e1ff15bc3", + "0x8559f88a7ef13b4f09ac82ae458bbae6ab25671cfbf52dae7eac7280d6565dd3f0c3286aec1a56a8a16dc3b61d78ce47", + "0x8221503f4cdbed550876c5dc118a3f2f17800c04e8be000266633c83777b039a432d576f3a36c8a01e8fd18289ebc10b", + "0x99bfbe5f3e46d4d898a578ba86ed26de7ed23914bd3bcdf3c791c0bcd49398a52419077354a5ab75cea63b6c871c6e96", + "0xaa134416d8ff46f2acd866c1074af67566cfcf4e8be8d97329dfa0f603e1ff208488831ce5948ac8d75bfcba058ddcaa", + "0xb02609d65ebfe1fe8e52f21224a022ea4b5ea8c1bd6e7b9792eed8975fc387cdf9e3b419b8dd5bcce80703ab3a12a45f", + "0xa4f14798508698fa3852e5cac42a9db9797ecee7672a54988aa74037d334819aa7b2ac7b14efea6b81c509134a6b7ad2", + "0x884f01afecbcb987cb3e7c489c43155c416ed41340f61ecb651d8cba884fb9274f6d9e7e4a46dd220253ae561614e44c", + "0xa05523c9e71dce1fe5307cc71bd721feb3e1a0f57a7d17c7d1c9fb080d44527b7dbaa1f817b1af1c0b4322e37bc4bb1e", + "0x8560aec176a4242b39f39433dd5a02d554248c9e49d3179530815f5031fee78ba9c71a35ceeb2b9d1f04c3617c13d8f0", + "0x996aefd402748d8472477cae76d5a2b92e3f092fc834d5222ae50194dd884c9fb8b6ed8e5ccf8f6ed483ddbb4e80c747", + "0x8fd09900320000cbabc40e16893e2fcf08815d288ec19345ad7b6bb22f7d78a52b6575a3ca1ca2f8bc252d2eafc928ec", + "0x939e51f73022bc5dc6862a0adf8fb8a3246b7bfb9943cbb4b27c73743926cc20f615a036c7e5b90c80840e7f1bfee0e7", + "0xa0a6258700cadbb9e241f50766573bf9bdb7ad380b1079dc3afb4054363d838e177b869cad000314186936e40359b1f2", + "0x972699a4131c8ed27a2d0e2104d54a65a7ff1c450ad9da3a325c662ab26869c21b0a84d0700b98c8b5f6ce3b746873d7", + "0xa454c7fe870cb8aa6491eafbfb5f7872d6e696033f92e4991d057b59d70671f2acdabef533e229878b60c7fff8f748b1", + "0xa167969477214201f09c79027b10221e4707662e0c0fde81a0f628249f2f8a859ce3d30a7dcc03b8ecca8f7828ad85c7", + "0x8ff6b7265175beb8a63e1dbf18c9153fb2578c207c781282374f51b40d57a84fd2ef2ea2b9c6df4a54646788a62fd17f", + "0xa3d7ebeccde69d73d8b3e76af0da1a30884bb59729503ff0fb0c3bccf9221651b974a6e72ea33b7956fc3ae758226495", + "0xb71ef144c9a98ce5935620cb86c1590bd4f48e5a2815d25c0cdb008fde628cf628c31450d3d4f67abbfeb16178a74cfd", + "0xb5e0a16d115134f4e2503990e3f2035ed66b9ccf767063fe6747870d97d73b10bc76ed668550cb82eedc9a2ca6f75524", + "0xb30ffaaf94ee8cbc42aa2c413175b68afdb207dbf351fb20be3852cb7961b635c22838da97eaf43b103aff37e9e725cc", + "0x98aa7d52284f6c1f22e272fbddd8c8698cf8f5fbb702d5de96452141fafb559622815981e50b87a72c2b1190f59a7deb", + "0x81fbacda3905cfaf7780bb4850730c44166ed26a7c8d07197a5d4dcd969c09e94a0461638431476c16397dd7bdc449f9", + "0x95e47021c1726eac2e5853f570d6225332c6e48e04c9738690d53e07c6b979283ebae31e2af1fc9c9b3e59f87e5195b1", + "0xac024a661ba568426bb8fce21780406537f518075c066276197300841e811860696f7588188bc01d90bace7bc73d56e3", + "0xa4ebcaf668a888dd404988ab978594dee193dad2d0aec5cdc0ccaf4ec9a7a8228aa663db1da8ddc52ec8472178e40c32", + "0xa20421b8eaf2199d93b083f2aff37fb662670bd18689d046ae976d1db1fedd2c2ff897985ecc6277b396db7da68bcb27", + "0x8bc33d4b40197fd4d49d1de47489d10b90d9b346828f53a82256f3e9212b0cbc6930b895e879da9cec9fedf026aadb3e", + "0xaaafdd1bec8b757f55a0433eddc0a39f818591954fd4e982003437fcceb317423ad7ee74dbf17a2960380e7067a6b4e2", + "0xaad34277ebaed81a6ec154d16736866f95832803af28aa5625bf0461a71d02b1faba02d9d9e002be51c8356425a56867", + "0x976e9c8b150d08706079945bd0e84ab09a648ecc6f64ded9eb5329e57213149ae409ae93e8fbd8eda5b5c69f5212b883", + "0x8097fae1653247d2aed4111533bc378171d6b2c6d09cbc7baa9b52f188d150d645941f46d19f7f5e27b7f073c1ebd079", + "0x83905f93b250d3184eaba8ea7d727c4464b6bdb027e5cbe4f597d8b9dc741dcbea709630bd4fd59ce24023bec32fc0f3", + "0x8095030b7045cff28f34271386e4752f9a9a0312f8df75de4f424366d78534be2b8e1720a19cb1f9a2d21105d790a225", + "0xa7b7b73a6ae2ed1009c49960374b0790f93c74ee03b917642f33420498c188a169724945a975e5adec0a1e83e07fb1b2", + "0x856a41c54df393b6660b7f6354572a4e71c8bfca9cabaffb3d4ef2632c015e7ee2bc10056f3eccb3dbed1ad17d939178", + "0xa8f7a55cf04b38cd4e330394ee6589da3a07dc9673f74804fdf67b364e0b233f14aec42e783200a2e4666f7c5ff62490", + "0x82c529f4e543c6bca60016dc93232c115b359eaee2798a9cf669a654b800aafe6ab4ba58ea8b9cdda2b371c8d62fa845", + "0x8caab020c1baddce77a6794113ef1dfeafc5f5000f48e97f4351b588bf02f1f208101745463c480d37f588d5887e6d8c", + "0x8fa91b3cc400f48b77b6fd77f3b3fbfb3f10cdff408e1fd22d38f77e087b7683adad258804409ba099f1235b4b4d6fea", + "0x8aa02787663d6be9a35677d9d8188b725d5fcd770e61b11b64e3def8808ea5c71c0a9afd7f6630c48634546088fcd8e2", + "0xb5635b7b972e195cab878b97dea62237c7f77eb57298538582a330b1082f6207a359f2923864630136d8b1f27c41b9aa", + "0x8257bb14583551a65975946980c714ecd6e5b629672bb950b9caacd886fbd22704bc9e3ba7d30778adab65dc74f0203a", + "0xab5fe1cd12634bfa4e5c60d946e2005cbd38f1063ec9a5668994a2463c02449a0a185ef331bd86b68b6e23a8780cb3ba", + "0xa7d3487da56cda93570cc70215d438204f6a2709bfb5fda6c5df1e77e2efc80f4235c787e57fbf2c74aaff8cbb510a14", + "0xb61cff7b4c49d010e133319fb828eb900f8a7e55114fc86b39c261a339c74f630e1a7d7e1350244ada566a0ff3d46c4b", + "0x8d4d1d55d321d278db7a85522ccceca09510374ca81d4d73e3bb5249ace7674b73900c35a531ec4fa6448fabf7ad00dc", + "0x966492248aee24f0f56c8cfca3c8ec6ba3b19abb69ae642041d4c3be8523d22c65c4dafcab4c58989ccc4e0bd2f77919", + "0xb20c320a90cb220b86e1af651cdc1e21315cd215da69f6787e28157172f93fc8285dcd59b039c626ed8ca4633cba1a47", + "0xaae9e6b22f018ceb5c0950210bb8182cb8cb61014b7e14581a09d36ebd1bbfebdb2b82afb7fdb0cf75e58a293d9c456d", + "0x875547fb67951ad37b02466b79f0c9b985ccbc500cfb431b17823457dc79fb9597ec42cd9f198e15523fcd88652e63a4", + "0x92afce49773cb2e20fb21e4f86f18e0959ebb9c33361547ddb30454ee8e36b1e234019cbdca0e964cb292f7f77df6b90", + "0x8af85343dfe1821464c76ba11c216cbef697b5afc69c4d821342e55afdac047081ec2e3f7b09fc14b518d9a23b78c003", + "0xb7de4a1648fd63f3a918096ea669502af5357438e69dac77cb8102b6e6c15c76e033cfaa80dafc806e535ede5c1a20aa", + "0xac80e9b545e8bd762951d96c9ce87f629d01ffcde07efc2ef7879ca011f1d0d8a745abf26c9d452541008871304fac00", + "0xa4cf0f7ed724e481368016c38ea5816698a5f68eb21af4d3c422d2ba55f96a33e427c2aa40de1b56a7cfac7f7cf43ab0", + "0x899b0a678bb2db2cae1b44e75a661284844ebcdd87abf308fedeb2e4dbe5c5920c07db4db7284a7af806a2382e8b111a", + "0xaf0588a2a4afce2b1b13c1230816f59e8264177e774e4a341b289a101dcf6af813638fed14fb4d09cb45f35d5d032609", + "0xa4b8df79e2be76e9f5fc5845f06fe745a724cf37c82fcdb72719b77bdebea3c0e763f37909373e3a94480cc5e875cba0", + "0x83e42c46d88930c8f386b19fd999288f142d325e2ebc86a74907d6d77112cb0d449bc511c95422cc810574031a8cbba9", + "0xb5e39534070de1e5f6e27efbdd3dc917d966c2a9b8cf2d893f964256e95e954330f2442027dc148c776d63a95bcde955", + "0x958607569dc28c075e658cd4ae3927055c6bc456eef6212a6fea8205e48ed8777a8064f584cda38fe5639c371e2e7fba", + "0x812adf409fa63575113662966f5078a903212ffb65c9b0bbe62da0f13a133443a7062cb8fd70f5e5dd5559a32c26d2c8", + "0xa679f673e5ce6a3cce7fa31f22ee3785e96bcb55e5a776e2dd3467bef7440e3555d1a9b87cb215e86ee9ed13a090344b", + "0xafedbb34508b159eb25eb2248d7fe328f86ef8c7d84c62d5b5607d74aae27cc2cc45ee148eb22153b09898a835c58df4", + "0xb75505d4f6b67d31e665cfaf5e4acdb5838ae069166b7fbcd48937c0608a59e40a25302fcc1873d2e81c1782808c70f0", + "0xb62515d539ec21a155d94fc00ea3c6b7e5f6636937bce18ed5b618c12257fb82571886287fd5d1da495296c663ebc512", + "0xab8e1a9446bbdd588d1690243b1549d230e6149c28f59662b66a8391a138d37ab594df38e7720fae53217e5c3573b5be", + "0xb31e8abf4212e03c3287bb2c0a153065a7290a16764a0bac8f112a72e632185a654bb4e88fdd6053e6c7515d9719fadb", + "0xb55165477fe15b6abd2d0f4fddaa9c411710dcc4dd712daba3d30e303c9a3ee5415c256f9dc917ecf18c725b4dbab059", + "0xa0939d4f57cacaae549b78e87cc234de4ff6a35dc0d9cd5d7410abc30ebcd34c135e008651c756e5a9d2ca79c40ef42b", + "0x8cf10e50769f3443340844aad4d56ec790850fed5a41fcbd739abac4c3015f0a085a038fbe7fae9f5ad899cce5069f6b", + "0x924055e804d82a99ea4bb160041ea4dc14b568abf379010bc1922fde5d664718c31d103b8b807e3a1ae809390e708c73", + "0x8ec0f9d26f71b0f2e60a179e4fd1778452e2ffb129d50815e5d7c7cb9415fa69ae5890578086e8ef6bfde35ad2a74661", + "0x98c7f12b15ec4426b59f737f73bf5faea4572340f4550b7590dfb7f7ffedb2372e3e555977c63946d579544c53210ad0", + "0x8a935f7a955c78f69d66f18eee0092e5e833fa621781c9581058e219af4d7ceee48b84e472e159dda6199715fb2f9acf", + "0xb78d4219f95a2dbfaa7d0c8a610c57c358754f4f43c2af312ab0fe8f10a5f0177e475332fb8fd23604e474fc2abeb051", + "0x8d086a14803392b7318c28f1039a17e3cfdcece8abcaca3657ec3d0ac330842098a85c0212f889fabb296dfb133ce9aa", + "0xa53249f417aac82f2c2a50c244ce21d3e08a5e5a8bd33bec2a5ab0d6cd17793e34a17edfa3690899244ce201e2fb9986", + "0x8619b0264f9182867a1425be514dc4f1ababc1093138a728a28bd7e4ecc99b9faaff68c23792264bc6e4dce5f52a5c52", + "0x8c171edbbbde551ec19e31b2091eb6956107dd9b1f853e1df23bff3c10a3469ac77a58335eee2b79112502e8e163f3de", + "0xa9d19ec40f0ca07c238e9337c6d6a319190bdba2db76fb63902f3fb459aeeb50a1ac30db5b25ee1b4201f3ca7164a7f4", + "0xb9c6ec14b1581a03520b8d2c1fbbc31fb8ceaef2c0f1a0d0080b6b96e18442f1734bea7ef7b635d787c691de4765d469", + "0x8cb437beb4cfa013096f40ccc169a713dc17afee6daa229a398e45fd5c0645a9ad2795c3f0cd439531a7151945d7064d", + "0xa6e8740cc509126e146775157c2eb278003e5bb6c48465c160ed27888ca803fa12eee1f6a8dd7f444f571664ed87fdc1", + "0xb75c1fecc85b2732e96b3f23aefb491dbd0206a21d682aee0225838dc057d7ed3b576176353e8e90ae55663f79e986e4", + "0xad8d249b0aea9597b08358bce6c77c1fd552ef3fbc197d6a1cfe44e5e6f89b628b12a6fb04d5dcfcbacc51f46e4ae7bb", + "0xb998b2269932cbd58d04b8e898d373ac4bb1a62e8567484f4f83e224061bc0f212459f1daae95abdbc63816ae6486a55", + "0x827988ef6c1101cddc96b98f4a30365ff08eea2471dd949d2c0a9b35c3bbfa8c07054ad1f4c88c8fbf829b20bb5a9a4f", + "0x8692e638dd60babf7d9f2f2d2ce58e0ac689e1326d88311416357298c6a2bffbfebf55d5253563e7b3fbbf5072264146", + "0xa685d75b91aea04dbc14ab3c1b1588e6de96dae414c8e37b8388766029631b28dd860688079b12d09cd27f2c5af11adf", + "0xb57eced93eec3371c56679c259b34ac0992286be4f4ff9489d81cf9712403509932e47404ddd86f89d7c1c3b6391b28c", + "0xa1c8b4e42ebcbd8927669a97f1b72e236fb19249325659e72be7ddaaa1d9e81ca2abb643295d41a8c04a2c01f9c0efd7", + "0x877c33de20d4ed31674a671ba3e8f01a316581e32503136a70c9c15bf0b7cb7b1cba6cd4eb641fad165fb3c3c6c235fd", + "0xa2a469d84ec478da40838f775d11ad38f6596eb41caa139cc190d6a10b5108c09febae34ffdafac92271d2e73c143693", + "0x972f817caedb254055d52e963ed28c206848b6c4cfdb69dbc961c891f8458eaf582a6d4403ce1177d87bc2ea410ef60a", + "0xaccbd739e138007422f28536381decc54bb6bd71d93edf3890e54f9ef339f83d2821697d1a4ac1f5a98175f9a9ecb9b5", + "0x8940f8772e05389f823b62b3adc3ed541f91647f0318d7a0d3f293aeeb421013de0d0a3664ea53dd24e5fbe02d7efef6", + "0x8ecce20f3ef6212edef07ec4d6183fda8e0e8cad2c6ccd0b325e75c425ee1faba00b5c26b4d95204238931598d78f49d", + "0x97cc72c36335bd008afbed34a3b0c7225933faba87f7916d0a6d2161e6f82e0cdcda7959573a366f638ca75d30e9dab1", + "0x9105f5de8699b5bdb6bd3bb6cc1992d1eac23929c29837985f83b22efdda92af64d9c574aa9640475087201bbbe5fd73", + "0x8ffb33c4f6d05c413b9647eb6933526a350ed2e4278ca2ecc06b0e8026d8dbe829c476a40e45a6df63a633090a3f82ef", + "0x8bfc6421fdc9c2d2aaa68d2a69b1a2728c25b84944cc3e6a57ff0c94bfd210d1cbf4ff3f06702d2a8257024d8be7de63", + "0xa80e1dc1dddfb41a70220939b96dc6935e00b32fb8be5dff4eed1f1c650002ff95e4af481c43292e3827363b7ec4768a", + "0x96f714ebd54617198bd636ba7f7a7f8995a61db20962f2165078d9ed8ee764d5946ef3cbdc7ebf8435bb8d5dd4c1deac", + "0x8cdb0890e33144d66391d2ae73f5c71f5a861f72bc93bff6cc399fc25dd1f9e17d8772592b44593429718784802ac377", + "0x8ccf9a7f80800ee770b92add734ed45a73ecc31e2af0e04364eefc6056a8223834c7c0dc9dfc52495bdec6e74ce69994", + "0xaa0875f423bd68b5f10ba978ddb79d3b96ec093bfbac9ff366323193e339ed7c4578760fb60f60e93598bdf1e5cc4995", + "0xa9214f523957b59c7a4cb61a40251ad72aba0b57573163b0dc0f33e41d2df483fb9a1b85a5e7c080e9376c866790f8cb", + "0xb6224b605028c6673a536cc8ff9aeb94e7a22e686fda82cf16068d326469172f511219b68b2b3affb7933af0c1f80d07", + "0xb6d58968d8a017c6a34e24c2c09852f736515a2c50f37232ac6b43a38f8faa7572cc31dade543b594b61b5761c4781d0", + "0x8a97cefe5120020c38deeb861d394404e6c993c6cbd5989b6c9ebffe24f46ad11b4ba6348e2991cbf3949c28cfc3c99d", + "0x95bf046f8c3a9c0ce2634be4de3713024daec3fc4083e808903b25ce3ac971145af90686b451efcc72f6b22df0216667", + "0xa6a4e2f71b8fa28801f553231eff2794c0f10d12e7e414276995e21195abc9c2983a8997e41af41e78d19ff6fbb2680b", + "0x8e5e62a7ca9c2f58ebaab63db2ff1fb1ff0877ae94b7f5e2897f273f684ae639dff44cc65718f78a9c894787602ab26a", + "0x8542784383eec4f565fcb8b9fc2ad8d7a644267d8d7612a0f476fc8df3aff458897a38003d506d24142ad18f93554f2b", + "0xb7db68ba4616ea072b37925ec4fb39096358c2832cc6d35169e032326b2d6614479f765ae98913c267105b84afcb9bf2", + "0x8b31dbb9457d23d416c47542c786e07a489af35c4a87dadb8ee91bea5ac4a5315e65625d78dad2cf8f9561af31b45390", + "0xa8545a1d91ac17257732033d89e6b7111db8242e9c6ebb0213a88906d5ef407a2c6fdb444e29504b06368b6efb4f4839", + "0xb1bd85d29ebb28ccfb05779aad8674906b267c2bf8cdb1f9a0591dd621b53a4ee9f2942687ee3476740c0b4a7621a3ae", + "0xa2b54534e152e46c50d91fff03ae9cd019ff7cd9f4168b2fe7ac08ef8c3bbc134cadd3f9d6bd33d20ae476c2a8596c8a", + "0xb19b571ff4ae3e9f5d95acda133c455e72c9ea9973cae360732859836c0341c4c29ab039224dc5bc3deb824e031675d8", + "0x940b5f80478648bac025a30f3efeb47023ce20ee98be833948a248bca6979f206bb28fc0f17b90acf3bb4abd3d14d731", + "0x8f106b40588586ac11629b96d57808ad2808915d89539409c97414aded90b4ff23286a692608230a52bff696055ba5d6", + "0xae6bda03aa10da3d2abbc66d764ca6c8d0993e7304a1bdd413eb9622f3ca1913baa6da1e9f4f9e6cf847f14f44d6924d", + "0xa18e7796054a340ef826c4d6b5a117b80927afaf2ebd547794c400204ae2caf277692e2eabb55bc2f620763c9e9da66d", + "0x8d2d25180dc2c65a4844d3e66819ccfcf48858f0cc89e1c77553b463ec0f7feb9a4002ce26bc618d1142549b9850f232", + "0x863f413a394de42cc8166c1c75d513b91d545fff1de6b359037a742c70b008d34bf8e587afa2d62c844d0c6f0ea753e7", + "0x83cd0cf62d63475e7fcad18a2e74108499cdbf28af2113cfe005e3b5887794422da450b1944d0a986eb7e1f4c3b18f25", + "0xb4f8b350a6d88fea5ab2e44715a292efb12eb52df738c9b2393da3f1ddee68d0a75b476733ccf93642154bceb208f2b8", + "0xb3f52aaa4cd4221cb9fc45936cc67fd3864bf6d26bf3dd86aa85aa55ecfc05f5e392ecce5e7cf9406b4b1c4fce0398c8", + "0xb33137084422fb643123f40a6df2b498065e65230fc65dc31791c330e898c51c3a65ff738930f32c63d78f3c9315f85b", + "0x91452bfa75019363976bb7337fe3a73f1c10f01637428c135536b0cdc7da5ce558dae3dfc792aa55022292600814a8ef", + "0xad6ba94c787cd4361ca642c20793ea44f1f127d4de0bb4a77c7fbfebae0fcadbf28e2cb6f0c12c12a07324ec8c19761d", + "0x890aa6248b17f1501b0f869c556be7bf2b1d31a176f9978bb97ab7a6bd4138eed32467951c5ef1871944b7f620542f43", + "0x82111db2052194ee7dd22ff1eafffac0443cf969d3762cceae046c9a11561c0fdce9c0711f88ac01d1bed165f8a7cee3", + "0xb1527b71df2b42b55832f72e772a466e0fa05743aacc7814f4414e4bcc8d42a4010c9e0fd940e6f254cafedff3cd6543", + "0x922370fa49903679fc565f09c16a5917f8125e72acfeb060fcdbadbd1644eb9f4016229756019c93c6d609cda5d5d174", + "0xaa4c7d98a96cab138d2a53d4aee8ebff6ef903e3b629a92519608d88b3bbd94de5522291a1097e6acf830270e64c8ee1", + "0xb3dc21608a389a72d3a752883a382baaafc61ecc44083b832610a237f6a2363f24195acce529eb4aed4ef0e27a12b66e", + "0x94619f5de05e07b32291e1d7ab1d8b7337a2235e49d4fb5f3055f090a65e932e829efa95db886b32b153bdd05a53ec8c", + "0xade1e92722c2ffa85865d2426fb3d1654a16477d3abf580cfc45ea4b92d5668afc9d09275d3b79283e13e6b39e47424d", + "0xb7201589de7bed094911dd62fcd25c459a8e327ac447b69f541cdba30233063e5ddffad0b67e9c3e34adcffedfd0e13d", + "0x809d325310f862d6549e7cb40f7e5fc9b7544bd751dd28c4f363c724a0378c0e2adcb5e42ec8f912f5f49f18f3365c07", + "0xa79c20aa533de7a5d671c99eb9eb454803ba54dd4f2efa3c8fec1a38f8308e9905c71e9282955225f686146388506ff6", + "0xa85eeacb5e8fc9f3ed06a3fe2dc3108ab9f8c5877b148c73cf26e4e979bf5795edbe2e63a8d452565fd1176ed40402b2", + "0x97ef55662f8a1ec0842b22ee21391227540adf7708f491436044f3a2eb18c471525e78e1e14fa292507c99d74d7437c6", + "0x93110d64ed5886f3d16ce83b11425576a3a7a9bb831cd0de3f9a0b0f2270a730d68136b4ef7ff035ede004358f419b5c", + "0xac9ed0a071517f0ae4f61ce95916a90ba9a77a3f84b0ec50ef7298acdcd44d1b94525d191c39d6bd1bb68f4471428760", + "0x98abd6a02c7690f5a339adf292b8c9368dfc12e0f8069cf26a5e0ce54b4441638f5c66ea735142f3c28e00a0024267e6", + "0xb51efb73ba6d44146f047d69b19c0722227a7748b0e8f644d0fc9551324cf034c041a2378c56ce8b58d06038fb8a78de", + "0x8f115af274ef75c1662b588b0896b97d71f8d67986ae846792702c4742ab855952865ce236b27e2321967ce36ff93357", + "0xb3c4548f14d58b3ab03c222da09e4381a0afe47a72d18d50a94e0008797f78e39e99990e5b4757be62310d400746e35a", + "0xa9b1883bd5f31f909b8b1b6dcb48c1c60ed20aa7374b3ffa7f5b2ed036599b5bef33289d23c80a5e6420d191723b92f7", + "0x85d38dffd99487ae5bb41ab4a44d80a46157bbbe8ef9497e68f061721f74e4da513ccc3422936b059575975f6787c936", + "0xadf870fcb96e972c033ab7a35d28ae79ee795f82bc49c3bd69138f0e338103118d5529c53f2d72a9c0d947bf7d312af2", + "0xab4c7a44e2d9446c6ff303eb49aef0e367a58b22cc3bb27b4e69b55d1d9ee639c9234148d2ee95f9ca8079b1457d5a75", + "0xa386420b738aba2d7145eb4cba6d643d96bda3f2ca55bb11980b318d43b289d55a108f4bc23a9606fb0bccdeb3b3bb30", + "0x847020e0a440d9c4109773ecca5d8268b44d523389993b1f5e60e541187f7c597d79ebd6e318871815e26c96b4a4dbb1", + "0xa530aa7e5ca86fcd1bec4b072b55cc793781f38a666c2033b510a69e110eeabb54c7d8cbcb9c61fee531a6f635ffa972", + "0x87364a5ea1d270632a44269d686b2402da737948dac27f51b7a97af80b66728b0256547a5103d2227005541ca4b7ed04", + "0x8816fc6e16ea277de93a6d793d0eb5c15e9e93eb958c5ef30adaf8241805adeb4da8ce19c3c2167f971f61e0b361077d", + "0x8836a72d301c42510367181bb091e4be377777aed57b73c29ef2ce1d475feedd7e0f31676284d9a94f6db01cc4de81a2", + "0xb0d9d8b7116156d9dde138d28aa05a33e61f8a85839c1e9071ccd517b46a5b4b53acb32c2edd7150c15bc1b4bd8db9e3", + "0xae931b6eaeda790ba7f1cd674e53dc87f6306ff44951fa0df88d506316a5da240df9794ccbd7215a6470e6b31c5ea193", + "0x8c6d5bdf87bd7f645419d7c6444e244fe054d437ed1ba0c122fde7800603a5fadc061e5b836cb22a6cfb2b466f20f013", + "0x90d530c6d0cb654999fa771b8d11d723f54b8a8233d1052dc1e839ea6e314fbed3697084601f3e9bbb71d2b4eaa596df", + "0xb0d341a1422588c983f767b1ed36c18b141774f67ef6a43cff8e18b73a009da10fc12120938b8bba27f225bdfd3138f9", + "0xa131b56f9537f460d304e9a1dd75702ace8abd68cb45419695cb8dee76998139058336c87b7afd6239dc20d7f8f940cc", + "0xaa6c51fa28975f709329adee1bbd35d49c6b878041841a94465e8218338e4371f5cb6c17f44a63ac93644bf28f15d20f", + "0x88440fb584a99ebd7f9ea04aaf622f6e44e2b43bbb49fb5de548d24a238dc8f26c8da2ccf03dd43102bda9f16623f609", + "0x9777b8695b790e702159a4a750d5e7ff865425b95fa0a3c15495af385b91c90c00a6bd01d1b77bffe8c47d01baae846f", + "0x8b9d764ece7799079e63c7f01690c8eff00896a26a0d095773dea7a35967a8c40db7a6a74692f0118bf0460c26739af4", + "0x85808c65c485520609c9e61fa1bb67b28f4611d3608a9f7a5030ee61c3aa3c7e7dc17fff48af76b4aecee2cb0dbd22ac", + "0xad2783a76f5b3db008ef5f7e67391fda4e7e36abde6b3b089fc4835b5c339370287935af6bd53998bed4e399eda1136d", + "0x96f18ec03ae47c205cc4242ca58e2eff185c9dca86d5158817e2e5dc2207ab84aadda78725f8dc080a231efdc093b940", + "0x97de1ab6c6cc646ae60cf7b86df73b9cf56cc0cd1f31b966951ebf79fc153531af55ca643b20b773daa7cab784b832f7", + "0x870ba266a9bfa86ef644b1ef025a0f1b7609a60de170fe9508de8fd53170c0b48adb37f19397ee8019b041ce29a16576", + "0xad990e888d279ac4e8db90619d663d5ae027f994a3992c2fbc7d262b5990ae8a243e19157f3565671d1cb0de17fe6e55", + "0x8d9d5adcdd94c5ba3be4d9a7428133b42e485f040a28d16ee2384758e87d35528f7f9868de9bd23d1a42a594ce50a567", + "0x85a33ed75d514ece6ad78440e42f7fcdb59b6f4cff821188236d20edae9050b3a042ce9bc7d2054296e133d033e45022", + "0x92afd2f49a124aaba90de59be85ff269457f982b54c91b06650c1b8055f9b4b0640fd378df02a00e4fc91f7d226ab980", + "0x8c0ee09ec64bd831e544785e3d65418fe83ed9c920d9bb4d0bf6dd162c1264eb9d6652d2def0722e223915615931581c", + "0x8369bedfa17b24e9ad48ebd9c5afea4b66b3296d5770e09b00446c5b0a8a373d39d300780c01dcc1c6752792bccf5fd0", + "0x8b9e960782576a59b2eb2250d346030daa50bbbec114e95cdb9e4b1ba18c3d34525ae388f859708131984976ca439d94", + "0xb682bface862008fea2b5a07812ca6a28a58fd151a1d54c708fc2f8572916e0d678a9cb8dc1c10c0470025c8a605249e", + "0xa38d5e189bea540a824b36815fc41e3750760a52be0862c4cac68214febdc1a754fb194a7415a8fb7f96f6836196d82a", + "0xb9e7fbda650f18c7eb8b40e42cc42273a7298e65e8be524292369581861075c55299ce69309710e5b843cb884de171bd", + "0xb6657e5e31b3193874a1bace08f42faccbd3c502fb73ad87d15d18a1b6c2a146f1baa929e6f517db390a5a47b66c0acf", + "0xae15487312f84ed6265e4c28327d24a8a0f4d2d17d4a5b7c29b974139cf93223435aaebe3af918f5b4bb20911799715f", + "0x8bb4608beb06bc394e1a70739b872ce5a2a3ffc98c7547bf2698c893ca399d6c13686f6663f483894bccaabc3b9c56ad", + "0xb58ac36bc6847077584308d952c5f3663e3001af5ecf2e19cb162e1c58bd6c49510205d453cffc876ca1dc6b8e04a578", + "0x924f65ced61266a79a671ffb49b300f0ea44c50a0b4e3b02064faa99fcc3e4f6061ea8f38168ab118c5d47bd7804590e", + "0x8d67d43b8a06b0ff4fafd7f0483fa9ed1a9e3e658a03fb49d9d9b74e2e24858dc1bed065c12392037b467f255d4e5643", + "0xb4d4f87813125a6b355e4519a81657fa97c43a6115817b819a6caf4823f1d6a1169683fd68f8d025cdfa40ebf3069acb", + "0xa7fd4d2c8e7b59b8eed3d4332ae94b77a89a2616347402f880bc81bde072220131e6dbec8a605be3a1c760b775375879", + "0x8d4a7d8fa6f55a30df37bcf74952e2fa4fd6676a2e4606185cf154bdd84643fd01619f8fb8813a564f72e3f574f8ce30", + "0x8086fb88e6260e9a9c42e9560fde76315ff5e5680ec7140f2a18438f15bc2cc7d7d43bfb5880b180b738c20a834e6134", + "0x916c4c54721de03934fee6f43de50bb04c81f6f8dd4f6781e159e71c40c60408aa54251d457369d133d4ba3ed7c12cb4", + "0x902e5bf468f11ed9954e2a4a595c27e34abe512f1d6dc08bbca1c2441063f9af3dc5a8075ab910a10ff6c05c1c644a35", + "0xa1302953015e164bf4c15f7d4d35e3633425a78294406b861675667eec77765ff88472306531e5d3a4ec0a2ff0dd6a9e", + "0x87874461df3c9aa6c0fa91325576c0590f367075f2f0ecfeb34afe162c04c14f8ce9d608c37ac1adc8b9985bc036e366", + "0x84b50a8a61d3cc609bfb0417348133e698fe09a6d37357ce3358de189efcf35773d78c57635c2d26c3542b13cc371752", + "0xacaed2cff8633d12c1d12bb7270c54d65b0b0733ab084fd47f81d0a6e1e9b6f300e615e79538239e6160c566d8bb8d29", + "0x889e6a0e136372ca4bac90d1ab220d4e1cad425a710e8cdd48b400b73bb8137291ceb36a39440fa84305783b1d42c72f", + "0x90952e5becec45b2b73719c228429a2c364991cf1d5a9d6845ae5b38018c2626f4308daa322cab1c72e0f6c621bb2b35", + "0x8f5a97a801b6e9dcd66ccb80d337562c96f7914e7169e8ff0fda71534054c64bf2a9493bb830623d612cfe998789be65", + "0x84f3df8b9847dcf1d63ca470dc623154898f83c25a6983e9b78c6d2d90a97bf5e622445be835f32c1e55e6a0a562ea78", + "0x91d12095cd7a88e7f57f254f02fdb1a1ab18984871dead2f107404bcf8069fe68258c4e6f6ebd2477bddf738135400bb", + "0xb771a28bc04baef68604d4723791d3712f82b5e4fe316d7adc2fc01b935d8e644c06d59b83bcb542afc40ebafbee0683", + "0x872f6341476e387604a7e93ae6d6117e72d164e38ebc2b825bc6df4fcce815004d7516423c190c1575946b5de438c08d", + "0x90d6b4aa7d40a020cdcd04e8b016d041795961a8e532a0e1f4041252131089114a251791bf57794cadb7d636342f5d1c", + "0x899023ba6096a181448d927fed7a0fe858be4eac4082a42e30b3050ee065278d72fa9b9d5ce3bc1372d4cbd30a2f2976", + "0xa28f176571e1a9124f95973f414d5bdbf5794d41c3839d8b917100902ac4e2171eb940431236cec93928a60a77ede793", + "0x838dbe5bcd29c4e465d02350270fa0036cd46f8730b13d91e77afb7f5ed16525d0021d3b2ae173a76c378516a903e0cb", + "0x8e105d012dd3f5d20f0f1c4a7e7f09f0fdd74ce554c3032e48da8cce0a77260d7d47a454851387770f5c256fa29bcb88", + "0x8f4df0f9feeb7a487e1d138d13ea961459a6402fd8f8cabb226a92249a0d04ded5971f3242b9f90d08da5ff66da28af6", + "0xad1cfda4f2122a20935aa32fb17c536a3653a18617a65c6836700b5537122af5a8206befe9eaea781c1244c43778e7f1", + "0x832c6f01d6571964ea383292efc8c8fa11e61c0634a25fa180737cc7ab57bc77f25e614aac9a2a03d98f27b3c1c29de2", + "0x903f89cc13ec6685ac7728521898781fecb300e9094ef913d530bf875c18bcc3ceed7ed51e7b482d45619ab4b025c2e9", + "0xa03c474bb915aad94f171e8d96f46abb2a19c9470601f4c915512ec8b9e743c3938450a2a5b077b4618b9df8809e1dc1", + "0x83536c8456f306045a5f38ae4be2e350878fa7e164ea408d467f8c3bc4c2ee396bd5868008c089183868e4dfad7aa50b", + "0x88f26b4ea1b236cb326cd7ad7e2517ec8c4919598691474fe15d09cabcfc37a8d8b1b818f4d112432ee3a716b0f37871", + "0xa44324e3fe96e9c12b40ded4f0f3397c8c7ee8ff5e96441118d8a6bfad712d3ac990b2a6a23231a8f691491ac1fd480f", + "0xb0de4693b4b9f932191a21ee88629964878680152a82996c0019ffc39f8d9369bbe2fe5844b68d6d9589ace54af947e4", + "0x8e5d8ba948aea5fd26035351a960e87f0d23efddd8e13236cc8e4545a3dda2e9a85e6521efb8577e03772d3637d213d9", + "0x93efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556", + "0x8731176363ad7658a2862426ee47a5dce9434216cef60e6045fa57c40bb3ce1e78dac4510ae40f1f31db5967022ced32", + "0xb10c9a96745722c85bdb1a693100104d560433d45b9ac4add54c7646a7310d8e9b3ca9abd1039d473ae768a18e489845", + "0xa2ac374dfbb464bf850b4a2caf15b112634a6428e8395f9c9243baefd2452b4b4c61b0cb2836d8eae2d57d4900bf407e", + "0xb69fe3ded0c4f5d44a09a0e0f398221b6d1bf5dbb8bc4e338b93c64f1a3cac1e4b5f73c2b8117158030ec03787f4b452", + "0x8852cdbaf7d0447a8c6f211b4830711b3b5c105c0f316e3a6a18dcfbb9be08bd6f4e5c8ae0c3692da08a2dfa532f9d5c", + "0x93bbf6d7432a7d98ade3f94b57bf9f4da9bc221a180a370b113066dd42601bb9e09edd79e2e6e04e00423399339eebda", + "0xa80941c391f1eeafc1451c59e4775d6a383946ff22997aeaadf806542ba451d3b0f0c6864eeba954174a296efe2c1550", + "0xa045fe2bb011c2a2f71a0181a8f457a3078470fb74c628eab8b59aef69ffd0d649723bf74d6885af3f028bc5a104fb39", + "0xb9d8c35911009c4c8cad64692139bf3fc16b78f5a19980790cb6a7aea650a25df4231a4437ae0c351676a7e42c16134f", + "0x94c79501ded0cfcbab99e1841abe4a00a0252b3870e20774c3da16c982d74c501916ec28304e71194845be6e3113c7ab", + "0x900a66418b082a24c6348d8644ddb1817df5b25cb33044a519ef47cc8e1f7f1e38d2465b7b96d32ed472d2d17f8414c6", + "0xb26f45d393b8b2fcb29bdbb16323dc7f4b81c09618519ab3a39f8ee5bd148d0d9f3c0b5dfab55b5ce14a1cb9206d777b", + "0xaa1a87735fc493a80a96a9a57ca40a6d9c32702bfcaa9869ce1a116ae65d69cefe2f3e79a12454b4590353e96f8912b4", + "0xa922b188d3d0b69b4e4ea2a2aa076566962844637da12c0832105d7b31dea4a309eee15d12b7a336be3ea36fcbd3e3b7", + "0x8f3841fcf4105131d8c4d9885e6e11a46c448226401cf99356c291fadb864da9fa9d30f3a73c327f23f9fd99a11d633e", + "0x9791d1183fae270e226379af6c497e7da803ea854bb20afa74b253239b744c15f670ee808f708ede873e78d79a626c9a", + "0xa4cad52e3369491ada61bf28ada9e85de4516d21c882e5f1cd845bea9c06e0b2887b0c5527fcff6fc28acd3c04f0a796", + "0xb9ac86a900899603452bd11a7892a9bfed8054970bfcbeaa8c9d1930db891169e38d6977f5258c25734f96c8462eee3b", + "0xa3a154c28e5580656a859f4efc2f5ebfa7eaa84ca40e3f134fa7865e8581586db74992dbfa4036aa252fba103773ddde", + "0x95cc2a0c1885a029e094f5d737e3ecf4d26b99036453a8773c77e360101f9f98676ee246f6f732a377a996702d55691f", + "0x842651bbe99720438d8d4b0218feb60481280c05beb17750e9ca0d8c0599a60f873b7fbdcc7d8835ba9a6d57b16eec03", + "0x81ee54699da98f5620307893dcea8f64670609fa20e5622265d66283adeac122d458b3308c5898e6c57c298db2c8b24f", + "0xb97868b0b2bc98032d68352a535a1b341b9ff3c7af4e3a7f3ebc82d3419daa1b5859d6aedc39994939623c7cd878bd9b", + "0xb60325cd5d36461d07ef253d826f37f9ee6474a760f2fff80f9873d01fd2b57711543cdc8d7afa1c350aa753c2e33dea", + "0x8c205326c11d25a46717b780c639d89714c7736c974ae71287e3f4b02e6605ac2d9b4928967b1684f12be040b7bf2dd3", + "0x95a392d82db51e26ade6c2ccd3396d7e40aff68fa570b5951466580d6e56dda51775dce5cf3a74a7f28c3cb2eb551c4d", + "0x8f2cc8071eb56dffb70bda6dd433b556221dc8bba21c53353c865f00e7d4d86c9e39f119ea9a8a12ef583e9a55d9a6b6", + "0x9449a71af9672aaf8856896d7e3d788b22991a7103f75b08c0abbcc2bfe60fda4ed8ce502cea4511ff0ea52a93e81222", + "0x857090ab9fdb7d59632d068f3cc8cf27e61f0d8322d30e6b38e780a1f05227199b4cd746aac1311c36c659ef20931f28", + "0x98a891f4973e7d9aaf9ac70854608d4f7493dffc7e0987d7be9dd6029f6ea5636d24ef3a83205615ca1ff403750058e1", + "0xa486e1365bbc278dd66a2a25d258dc82f46b911103cb16aab3945b9c95ae87b386313a12b566df5b22322ede0afe25ad", + "0xa9a1eb399ed95d396dccd8d1ac718043446f8b979ec62bdce51c617c97a312f01376ab7fb87d27034e5f5570797b3c33", + "0xb7abc3858d7a74bb446218d2f5a037e0fae11871ed9caf44b29b69c500c1fa1dcfad64c9cdccc9d80d5e584f06213deb", + "0x8cfb09fe2e202faa4cebad932b1d35f5ca204e1c2a0c740a57812ac9a6792130d1312aabd9e9d4c58ca168bfebd4c177", + "0xa90a305c2cd0f184787c6be596fa67f436afd1f9b93f30e875f817ac2aae8bdd2e6e656f6be809467e6b3ad84adb86b1", + "0x80a9ef993c2b009ae172cc8f7ec036f5734cf4f4dfa06a7db4d54725e7fbfae5e3bc6f22687bdbb6961939d6f0c87537", + "0x848ade1901931e72b955d7db1893f07003e1708ff5d93174bac5930b9a732640f0578839203e9b77eb27965c700032d3", + "0x93fdf4697609c5ae9c33b9ca2f5f1af44abeb2b98dc4fdf732cf7388de086f410730dc384d9b7a7f447bb009653c8381", + "0x89ce3fb805aea618b5715c0d22a9f46da696b6fa86794f56fdf1d44155a33d42daf1920bcbe36cbacf3cf4c92df9cbc7", + "0x829ce2c342cf82aa469c65f724f308f7a750bd1494adc264609cd790c8718b8b25b5cab5858cf4ee2f8f651d569eea67", + "0xaf2f0cee7bf413204be8b9df59b9e4991bc9009e0d6dbe6815181df0ec2ca93ab8f4f3135b1c14d8f53d74bff0bd6f27", + "0xb87998cecf7b88cde93d1779f10a521edd5574a2fbd240102978639ec57433ba08cdb53849038a329cebbe74657268d2", + "0xa64542a1261a6ed3d720c2c3a802303aad8c4c110c95d0f12e05c1065e66f42da494792b6bfc5b9272363f3b1d457f58", + "0x86a6fd042e4f282fadf07a4bfee03fc96a3aea49f7a00f52bf249a20f1ec892326855410e61f37fbb27d9305eb2fc713", + "0x967ea5bc403b6db269682f7fd0df90659350d7e1aa66bc4fab4c9dfcd75ed0bba4b52f1cebc5f34dc8ba810793727629", + "0xa52990f9f3b8616ce3cdc2c74cd195029e6a969753dcf2d1630438700e7d6ebde36538532b3525ac516f5f2ce9dd27a3", + "0xa64f7ff870bab4a8bf0d4ef6f5c744e9bf1021ed08b4c80903c7ad318e80ba1817c3180cc45cb5a1cae1170f0241655f", + "0xb00f706fa4de1f663f021e8ad3d155e84ce6084a409374b6e6cd0f924a0a0b51bebaaaf1d228c77233a73b0a5a0df0e9", + "0x8b882cc3bff3e42babdb96df95fb780faded84887a0a9bab896bef371cdcf169d909f5658649e93006aa3c6e1146d62e", + "0x9332663ef1d1dcf805c3d0e4ce7a07d9863fb1731172e766b3cde030bf81682cc011e26b773fb9c68e0477b4ae2cfb79", + "0xa8aa8151348dbd4ef40aaeb699b71b4c4bfd3218560c120d85036d14f678f6736f0ec68e80ce1459d3d35feccc575164", + "0xa16cd8b729768f51881c213434aa28301fa78fcb554ddd5f9012ee1e4eae7b5cb3dd88d269d53146dea92d10790faf0b", + "0x86844f0ef9d37142faf3b1e196e44fbe280a3ba4189aa05c356778cb9e3b388a2bff95eed305ada8769935c9974e4c57", + "0xae2eec6b328fccf3b47bcdac32901ac2744a51beb410b04c81dea34dee4912b619466a4f5e2780d87ecefaebbe77b46d", + "0x915df4c38d301c8a4eb2dc5b1ba0ffaad67cbb177e0a80095614e9c711f4ef24a4cef133f9d982a63d2a943ba6c8669d", + "0xae6a2a4dedfc2d1811711a8946991fede972fdf2a389b282471280737536ffc0ac3a6d885b1f8bda0366eb0b229b9979", + "0xa9b628c63d08b8aba6b1317f6e91c34b2382a6c85376e8ef2410a463c6796740ae936fc4e9e0737cb9455d1daa287bd8", + "0x848e30bf7edf2546670b390d5cf9ab71f98fcb6add3c0b582cb34996c26a446dee5d1bde4fdcde4fc80c10936e117b29", + "0x907d6096c7c8c087d1808dd995d5d2b9169b3768c3f433475b50c2e2bd4b082f4d543afd8b0b0ddffa9c66222a72d51d", + "0xa59970a2493b07339124d763ac9d793c60a03354539ecbcf6035bc43d1ea6e35718202ae6d7060b7d388f483d971573c", + "0xb9cfef2af9681b2318f119d8611ff6d9485a68d8044581b1959ab1840cbca576dbb53eec17863d2149966e9feb21122f", + "0xad47271806161f61d3afa45cdfe2babceef5e90031a21779f83dc8562e6076680525b4970b2f11fe9b2b23c382768323", + "0x8e425a99b71677b04fe044625d338811fbb8ee32368a424f6ab2381c52e86ee7a6cecedf777dc97181519d41c351bc22", + "0x86b55b54d7adefc12954a9252ee23ae83efe8b5b4b9a7dc307904413e5d69868c7087a818b2833f9b004213d629be8ad", + "0xa14fda6b93923dd11e564ae4457a66f397741527166e0b16a8eb91c6701c244fd1c4b63f9dd3515193ec88fa6c266b35", + "0xa9b17c36ae6cd85a0ed7f6cabc5b47dc8f80ced605db327c47826476dc1fb8f8669aa7a7dc679fbd4ee3d8e8b4bd6a6f", + "0x82a0829469c1458d959c821148f15dacae9ea94bf56c59a6ab2d4dd8b3d16d73e313b5a3912a6c1f131d73a8f06730c4", + "0xb22d56d549a53eaef549595924bdb621ff807aa4513feedf3fdcbf7ba8b6b9cfa4481c2f67fc642db397a6b794a8b63a", + "0x974c59c24392e2cb9294006cbe3c52163e255f3bd0c2b457bdc68a6338e6d5b6f87f716854492f8d880a6b896ccf757c", + "0xb70d247ba7cad97c50b57f526c2ba915786e926a94e8f8c3eebc2e1be6f4255411b9670e382060049c8f4184302c40b2", + "0xad80201fe75ef21c3ddbd98cf23591e0d7a3ba1036dfe77785c32f44755a212c31f0ceb0a0b6f5ee9b6dc81f358d30c3", + "0x8c656e841f9bb90b9a42d425251f3fdbc022a604d75f5845f479ed4be23e02aaf9e6e56cde351dd7449c50574818a199", + "0x8b88dd3fa209d3063b7c5b058f7249ee9900fbc2287d16da61a0704a0a1d71e45d9c96e1cda7fdf9654534ec44558b22", + "0x961da00cc8750bd84d253c08f011970ae1b1158ad6778e8ed943d547bceaf52d6d5a212a7de3bf2706688c4389b827d2", + "0xa5dd379922549a956033e3d51a986a4b1508e575042b8eaa1df007aa77cf0b8c2ab23212f9c075702788fa9c53696133", + "0xac8fcfde3a349d1e93fc8cf450814e842005c545c4844c0401bc80e6b96cdb77f29285a14455e167c191d4f312e866cd", + "0xac63d79c799783a8466617030c59dd5a8f92ee6c5204676fd8d881ce5f7f8663bdbeb0379e480ea9b6340ab0dc88e574", + "0x805874fde19ce359041ae2bd52a39e2841acabfd31f965792f2737d7137f36d4e4722ede8340d8c95afa6af278af8acb", + "0x8d2f323a228aa8ba7b7dc1399138f9e6b41df1a16a7069003ab8104b8b68506a45141bc5fe66acf430e23e13a545190b", + "0xa1610c721a2d9af882bb6b39bea97cff1527a3aea041d25934de080214ae77c959e79957164440686d15ab301e897d4d", + "0xaba16d29a47fc36f12b654fde513896723e2c700c4190f11b26aa4011da57737ad717daa02794aa3246e4ae5f0b0cc3a", + "0xa406db2f15fdd135f346cc4846623c47edd195e80ba8c7cb447332095314d565e4040694ca924696bb5ee7f8996ea0ba", + "0x8b30e2cd9b47d75ba57b83630e40f832249af6c058d4f490416562af451993eec46f3e1f90bc4d389e4c06abd1b32a46", + "0xaacf9eb7036e248e209adbfc3dd7ce386569ea9b312caa4b240726549db3c68c4f1c8cbf8ed5ea9ea60c7e57c9df3b8e", + "0xb20fcac63bf6f5ee638a42d7f89be847f348c085ddcbec3fa318f4323592d136c230495f188ef2022aa355cc2b0da6f9", + "0x811eff750456a79ec1b1249d76d7c1547065b839d8d4aaad860f6d4528eb5b669473dcceeeea676cddbc3980b68461b7", + "0xb52d14ae33f4ab422f953392ae76a19c618cc31afc96290bd3fe2fb44c954b5c92c4789f3f16e8793f2c0c1691ade444", + "0xa7826dafeeba0db5b66c4dfcf2b17fd7b40507a5a53ac2e42942633a2cb30b95ba1739a6e9f3b7a0e0f1ec729bf274e2", + "0x8acfd83ddf7c60dd7c8b20c706a3b972c65d336b8f9b3d907bdd8926ced271430479448100050b1ef17578a49c8fa616", + "0xaf0c69f65184bb06868029ad46f8465d75c36814c621ac20a5c0b06a900d59305584f5a6709683d9c0e4b6cd08d650a6", + "0xb6cc8588191e00680ee6c3339bd0f0a17ad8fd7f4be57d5d7075bede0ea593a19e67f3d7c1a20114894ee5bfcab71063", + "0xa82fd4f58635129dbb6cc3eb9391cf2d28400018b105fc41500fbbd12bd890b918f97d3d359c29dd3b4c4e34391dfab0", + "0x92fc544ed65b4a3625cf03c41ddff7c039bc22d22c0d59dcc00efd5438401f2606adb125a1d5de294cca216ec8ac35a3", + "0x906f67e4a32582b71f15940523c0c7ce370336935e2646bdaea16a06995256d25e99df57297e39d6c39535e180456407", + "0x97510337ea5bbd5977287339197db55c60533b2ec35c94d0a460a416ae9f60e85cee39be82abeeacd5813cf54df05862", + "0x87e6894643815c0ea48cb96c607266c5ee4f1f82ba5fe352fb77f9b6ed14bfc2b8e09e80a99ac9047dfcf62b2ae26795", + "0xb6fd55dd156622ad7d5d51b7dde75e47bd052d4e542dd6449e72411f68275775c846dde301e84613312be8c7bce58b07", + "0xb98461ac71f554b2f03a94e429b255af89eec917e208a8e60edf5fc43b65f1d17a20de3f31d2ce9f0cb573c25f2f4d98", + "0x96f0dea40ca61cefbee41c4e1fe9a7d81fbe1f49bb153d083ab70f5d0488a1f717fd28cedcf6aa18d07cce2c62801898", + "0x8d7c3ab310184f7dc34b6ce4684e4d29a31e77b09940448ea4daac730b7eb308063125d4dd229046cf11bfd521b771e0", + "0x96f0564898fe96687918bbf0a6adead99cf72e3a35ea3347e124af9d006221f8e82e5a9d2fe80094d5e8d48e610f415e", + "0xad50fcb92c2675a398cf07d4c40a579e44bf8d35f27cc330b57e54d5ea59f7d898af0f75dccfe3726e5471133d70f92b", + "0x828beed62020361689ae7481dd8f116902b522fb0c6c122678e7f949fdef70ead011e0e6bffd25678e388744e17cdb69", + "0x8349decac1ca16599eee2efc95bcaabf67631107da1d34a2f917884bd70dfec9b4b08ab7bc4379d6c73b19c0b6e54fb8", + "0xb2a6a2e50230c05613ace9e58bb2e98d94127f196f02d9dddc53c43fc68c184549ca12d713cb1b025d8260a41e947155", + "0x94ff52181aadae832aed52fc3b7794536e2a31a21fc8be3ea312ca5c695750d37f08002f286b33f4023dba1e3253ecfa", + "0xa21d56153c7e5972ee9a319501be4faff199fdf09bb821ea9ce64aa815289676c00f105e6f00311b3a5b627091b0d0fc", + "0xa27a60d219f1f0c971db73a7f563b371b5c9fc3ed1f72883b2eac8a0df6698400c9954f4ca17d7e94e44bd4f95532afb", + "0xa2fc56fae99b1f18ba5e4fe838402164ce82f8a7f3193d0bbd360c2bac07c46f9330c4c7681ffb47074c6f81ee6e7ac6", + "0xb748e530cd3afb96d879b83e89c9f1a444f54e55372ab1dcd46a0872f95ce8f49cf2363fc61be82259e04f555937ed16", + "0x8bf8993e81080c7cbba1e14a798504af1e4950b2f186ab3335b771d6acaee4ffe92131ae9c53d74379d957cb6344d9cd", + "0x96774d0ef730d22d7ab6d9fb7f90b9ead44285219d076584a901960542756700a2a1603cdf72be4708b267200f6c36a9", + "0xb47703c2ab17be1e823cc7bf3460db1d6760c0e33862c90ca058845b2ff234b0f9834ddba2efb2ee1770eb261e7d8ffd", + "0x84319e67c37a9581f8b09b5e4d4ae88d0a7fb4cbb6908971ab5be28070c3830f040b1de83ee663c573e0f2f6198640e4", + "0x96811875fa83133e0b3c0e0290f9e0e28bca6178b77fdf5350eb19344d453dbd0d71e55a0ef749025a5a2ca0ad251e81", + "0x81a423423e9438343879f2bfd7ee9f1c74ebebe7ce3cfffc8a11da6f040cc4145c3b527bd3cf63f9137e714dbcb474ef", + "0xb8c3535701ddbeec2db08e17a4fa99ba6752d32ece5331a0b8743676f421fcb14798afc7c783815484f14693d2f70db8", + "0x81aee980c876949bf40782835eec8817d535f6f3f7e00bf402ddd61101fdcd60173961ae90a1cf7c5d060339a18c959d", + "0x87e67b928d97b62c49dac321ce6cb680233f3a394d4c9a899ac2e8db8ccd8e00418e66cdfd68691aa3cb8559723b580c", + "0x8eac204208d99a2b738648df96353bbb1b1065e33ee4f6bba174b540bbbd37d205855e1f1e69a6b7ff043ca377651126", + "0x848e6e7a54ad64d18009300b93ea6f459ce855971dddb419b101f5ac4c159215626fadc20cc3b9ab1701d8f6dfaddd8b", + "0x88aa123d9e0cf309d46dddb6acf634b1ade3b090a2826d6e5e78669fa1220d6df9a6697d7778cd9b627db17eea846126", + "0x9200c2a629b9144d88a61151b661b6c4256cc5dadfd1e59a8ce17a013c2d8f7e754aabe61663c3b30f1bc47784c1f8cf", + "0xb6e1a2827c3bdda91715b0e1b1f10dd363cef337e7c80cac1f34165fc0dea7c8b69747e310563db5818390146ce3e231", + "0x92c333e694f89f0d306d54105b2a5dcc912dbe7654d9e733edab12e8537350815be472b063e56cfde5286df8922fdecb", + "0xa6fac04b6d86091158ebb286586ccfec2a95c9786e14d91a9c743f5f05546073e5e3cc717635a0c602cad8334e922346", + "0xa581b4af77feebc1fb897d49b5b507c6ad513d8f09b273328efbb24ef0d91eb740d01b4d398f2738125dacfe550330cd", + "0x81c4860cccf76a34f8a2bc3f464b7bfd3e909e975cce0d28979f457738a56e60a4af8e68a3992cf273b5946e8d7f76e2", + "0x8d1eaa09a3180d8af1cbaee673db5223363cc7229a69565f592fa38ba0f9d582cedf91e15dabd06ebbf2862fc0feba54", + "0x9832f49b0147f4552402e54593cfa51f99540bffada12759b71fcb86734be8e500eea2d8b3d036710bdf04c901432de9", + "0x8bdb0e8ec93b11e5718e8c13cb4f5de545d24829fd76161216340108098dfe5148ed25e3b57a89a516f09fa79043734d", + "0xab96f06c4b9b0b2c0571740b24fca758e6976315053a7ecb20119150a9fa416db2d3a2e0f8168b390bb063f0c1caf785", + "0xab777f5c52acd62ecf4d1f168b9cc8e1a9b45d4ec6a8ff52c583e867c2239aba98d7d3af977289b367edce03d9c2dfb1", + "0xa09d3ce5e748da84802436951acc3d3ea5d8ec1d6933505ed724d6b4b0d69973ab0930daec9c6606960f6e541e4a3ce2", + "0x8ef94f7be4d85d5ad3d779a5cf4d7b2fc3e65c52fb8e1c3c112509a4af77a0b5be994f251e5e40fabeeb1f7d5615c22b", + "0xa7406a5bf5708d9e10922d3c5c45c03ef891b8d0d74ec9f28328a72be4cdc05b4f2703fa99366426659dfca25d007535", + "0xb7f52709669bf92a2e070bfe740f422f0b7127392c5589c7f0af71bb5a8428697c762d3c0d74532899da24ea7d8695c2", + "0xb9dfb0c8df84104dbf9239ccefa4672ef95ddabb8801b74997935d1b81a78a6a5669a3c553767ec19a1281f6e570f4ff", + "0xae4d5c872156061ce9195ac640190d8d71dd406055ee43ffa6f9893eb24b870075b74c94d65bc1d5a07a6573282b5520", + "0xafe6bd3eb72266d333f1807164900dcfa02a7eb5b1744bb3c86b34b3ee91e3f05e38fa52a50dc64eeb4bdb1dd62874b8", + "0x948043cf1bc2ef3c01105f6a78dc06487f57548a3e6ef30e6ebc51c94b71e4bf3ff6d0058c72b6f3ecc37efd7c7fa8c0", + "0xa22fd17c2f7ffe552bb0f23fa135584e8d2d8d75e3f742d94d04aded2a79e22a00dfe7acbb57d44e1cdb962fb22ae170", + "0x8cd0f4e9e4fb4a37c02c1bde0f69359c43ab012eb662d346487be0c3758293f1ca560122b059b091fddce626383c3a8f", + "0x90499e45f5b9c81426f3d735a52a564cafbed72711d9279fdd88de8038e953bc48c57b58cba85c3b2e4ce56f1ddb0e11", + "0x8c30e4c034c02958384564cac4f85022ef36ab5697a3d2feaf6bf105049675bbf23d01b4b6814711d3d9271abff04cac", + "0x81f7999e7eeea30f3e1075e6780bbf054f2fb6f27628a2afa4d41872a385b4216dd5f549da7ce6cf39049b2251f27fb7", + "0xb36a7191f82fc39c283ffe53fc1f5a9a00b4c64eee7792a8443475da9a4d226cf257f226ea9d66e329af15d8f04984ec", + "0xaad4da528fdbb4db504f3041c747455baff5fcd459a2efd78f15bdf3aea0bdb808343e49df88fe7a7c8620009b7964a3", + "0x99ebd8c6dd5dd299517fb6381cfc2a7f443e6e04a351440260dd7c2aee3f1d8ef06eb6c18820b394366ecdfd2a3ce264", + "0x8873725b81871db72e4ec3643084b1cdce3cbf80b40b834b092767728605825c19b6847ad3dcf328438607e8f88b4410", + "0xb008ee2f895daa6abd35bd39b6f7901ae4611a11a3271194e19da1cdcc7f1e1ea008fe5c5440e50d2c273784541ad9c5", + "0x9036feafb4218d1f576ef89d0e99124e45dacaa6d816988e34d80f454d10e96809791d5b78f7fd65f569e90d4d7238c5", + "0x92073c1d11b168e4fa50988b0288638b4868e48bbc668c5a6dddf5499875d53be23a285acb5e4bad60114f6cf6c556e9", + "0x88c87dfcb8ba6cbfe7e1be081ccfadbd589301db2cb7c99f9ee5d7db90aa297ed1538d5a867678a763f2deede5fd219a", + "0xb42a562805c661a50f5dea63108002c0f27c0da113da6a9864c9feb5552225417c0356c4209e8e012d9bcc9d182c7611", + "0x8e6317d00a504e3b79cd47feb4c60f9df186467fe9ca0f35b55c0364db30528f5ff071109dabb2fc80bb9cd4949f0c24", + "0xb7b1ea6a88694f8d2f539e52a47466695e39e43a5eb9c6f23bca15305fe52939d8755cc3ac9d6725e60f82f994a3772f", + "0xa3cd55161befe795af93a38d33290fb642b8d80da8b786c6e6fb02d393ea308fbe87f486994039cbd7c7b390414594b6", + "0xb416d2d45b44ead3b1424e92c73c2cf510801897b05d1724ff31cbd741920cd858282fb5d6040fe1f0aa97a65bc49424", + "0x950ee01291754feace97c2e933e4681e7ddfbc4fcd079eb6ff830b0e481d929c93d0c7fb479c9939c28ca1945c40da09", + "0x869bd916aee8d86efe362a49010382674825d49195b413b4b4018e88ce43fe091b475d0b863ff0ba2259400f280c2b23", + "0x9782f38cd9c9d3385ec286ebbc7cba5b718d2e65a5890b0a5906b10a89dc8ed80d417d71d7c213bf52f2af1a1f513ea7", + "0x91cd33bc2628d096269b23faf47ee15e14cb7fdc6a8e3a98b55e1031ea0b68d10ba30d97e660f7e967d24436d40fad73", + "0x8becc978129cc96737034c577ae7225372dd855da8811ae4e46328e020c803833b5bdbc4a20a93270e2b8bd1a2feae52", + "0xa36b1d8076783a9522476ce17f799d78008967728ce920531fdaf88303321bcaf97ecaa08e0c01f77bc32e53c5f09525", + "0xb4720e744943f70467983aa34499e76de6d59aa6fadf86f6b787fdce32a2f5b535b55db38fe2da95825c51002cfe142d", + "0x91ad21fc502eda3945f6de874d1b6bf9a9a7711f4d61354f9e5634fc73f9c06ada848de15ab0a75811d3250be862827d", + "0x84f78e2ebf5fc077d78635f981712daf17e2475e14c2a96d187913006ad69e234746184a51a06ef510c9455b38acb0d7", + "0x960aa7906e9a2f11db64a26b5892ac45f20d2ccb5480f4888d89973beb6fa0dfdc06d68d241ff5ffc7f1b82b1aac242d", + "0xa99365dcd1a00c66c9db6924b97c920f5c723380e823b250db85c07631b320ec4e92e586f7319e67a522a0578f7b6d6c", + "0xa25d92d7f70cf6a88ff317cfec071e13774516da664f5fac0d4ecaa65b8bf4eb87a64a4d5ef2bd97dfae98d388dbf5cc", + "0xa7af47cd0041295798f9779020a44653007444e8b4ef0712982b06d0dcdd434ec4e1f7c5f7a049326602cb605c9105b7", + "0xaefe172eac5568369a05980931cc476bebd9dea573ba276d59b9d8c4420784299df5a910033b7e324a6c2dfc62e3ef05", + "0xb69bc9d22ffa645baa55e3e02522e9892bb2daa7fff7c15846f13517d0799766883ee09ae0869df4139150c5b843ca8a", + "0x95a10856140e493354fdd12722c7fdded21b6a2ffbc78aa2697104af8ad0c8e2206f44b0bfee077ef3949d46bbf7c16b", + "0x891f2fcd2c47cbea36b7fa715968540c233313f05333f09d29aba23c193f462ed490dd4d00969656e89c53155fdfe710", + "0xa6c33e18115e64e385c843dde34e8a228222795c7ca90bc2cc085705d609025f3351d9be61822c69035a49fb3e48f2d5", + "0xb87fb12f12c0533b005adad0487f03393ff682e13575e3cb57280c3873b2c38ba96a63c49eef7a442753d26b7005230b", + "0xb905c02ba451bfd411c135036d92c27af3b0b1c9c2f1309d6948544a264b125f39dd41afeff4666b12146c545adc168a", + "0x8b29c513f43a78951cf742231cf5457a6d9d55edf45df5481a0f299a418d94effef561b15d2c1a01d1b8067e7153fda9", + "0xb9941cccd51dc645920d2781c81a317e5a33cb7cf76427b60396735912cb6d2ca9292bb4d36b6392467d390d2c58d9f3", + "0xa8546b627c76b6ef5c93c6a98538d8593dbe21cb7673fd383d5401b0c935eea0bdeeefeb1af6ad41bad8464fb87bbc48", + "0xaa286b27de2812de63108a1aec29d171775b69538dc6198640ac1e96767c2b83a50391f49259195957d457b493b667c9", + "0xa932fb229f641e9abbd8eb2bd874015d97b6658ab6d29769fc23b7db9e41dd4f850382d4c1f08af8f156c5937d524473", + "0xa1412840fcc86e2aeec175526f2fb36e8b3b8d21a78412b7266daf81e51b3f68584ed8bd42a66a43afdd8c297b320520", + "0x89c78be9efb624c97ebca4fe04c7704fa52311d183ffd87737f76b7dadc187c12c982bd8e9ed7cd8beb48cdaafd2fd01", + "0xa3f5ddec412a5bec0ce15e3bcb41c6214c2b05d4e9135a0d33c8e50a78eaba71e0a5a6ea8b45854dec5c2ed300971fc2", + "0x9721f9cec7a68b7758e3887548790de49fa6a442d0396739efa20c2f50352a7f91d300867556d11a703866def2d5f7b5", + "0xa23764e140a87e5991573521af039630dd28128bf56eed2edbed130fd4278e090b60cf5a1dca9de2910603d44b9f6d45", + "0xa1a6494a994215e48ab55c70efa8ffdddce6e92403c38ae7e8dd2f8288cad460c6c7db526bbdf578e96ca04d9fe12797", + "0xb1705ea4cb7e074efe0405fc7b8ee2ec789af0426142f3ec81241cacd4f7edcd88e39435e4e4d8e7b1df64f3880d6613", + "0x85595d061d677116089a6064418b93eb44ff79e68d12bd9625078d3bbc440a60d0b02944eff6054433ee34710ae6fbb4", + "0x9978d5e30bedb7526734f9a1febd973a70bfa20890490e7cc6f2f9328feab1e24f991285dbc3711d892514e2d7d005ad", + "0xaf30243c66ea43b9f87a061f947f7bce745f09194f6e95f379c7582b9fead920e5d6957eaf05c12ae1282ada4670652f", + "0xa1930efb473f88001e47aa0b2b2a7566848cccf295792e4544096ecd14ee5d7927c173a8576b405bfa2eec551cd67eb5", + "0xb0446d1c590ee5a45f7e22d269c044f3848c97aec1d226b44bfd0e94d9729c28a38bccddc3a1006cc5fe4e3c24f001f2", + "0xb8a8380172df3d84b06176df916cf557966d4f2f716d3e9437e415d75b646810f79f2b2b71d857181b7fc944018883a3", + "0xa563afec25b7817bfa26e19dc9908bc00aa8fc3d19be7d6de23648701659009d10e3e4486c28e9c6b13d48231ae29ac5", + "0xa5a8e80579de886fb7d6408f542791876885947b27ad6fa99a8a26e381f052598d7b4e647b0115d4b5c64297e00ce28e", + "0x8f87afcc7ad33c51ac719bade3cd92da671a37a82c14446b0a2073f4a0a23085e2c8d31913ed2d0be928f053297de8f6", + "0xa43c455ce377e0bc434386c53c752880687e017b2f5ae7f8a15c044895b242dffde4c92fb8f8bb50b18470b17351b156", + "0x8368f8b12a5bceb1dba25adb3a2e9c7dc9b1a77a1f328e5a693f5aec195cd1e06b0fe9476b554c1c25dac6c4a5b640a3", + "0x919878b27f3671fc78396f11531c032f3e2bd132d04cc234fa4858676b15fb1db3051c0b1db9b4fc49038216f11321ce", + "0xb48cd67fb7f1242696c1f877da4bdf188eac676cd0e561fbac1a537f7b8229aff5a043922441d603a26aae56a15faee4", + "0xa3e0fdfd4d29ea996517a16f0370b54787fefe543c2fe73bfc6f9e560c1fd30dad8409859e2d7fa2d44316f24746c712", + "0x8bb156ade8faf149df7bea02c140c7e392a4742ae6d0394d880a849127943e6f26312033336d3b9fdc0092d71b5efe87", + "0x8845e5d5cc555ca3e0523244300f2c8d7e4d02aaebcb5bd749d791208856c209a6f84dd99fd55968c9f0ab5f82916707", + "0xa3e90bb5c97b07789c2f32dff1aec61d0a2220928202f5ad5355ae71f8249237799d6c8a22602e32e572cb12eabe0c17", + "0xb150bcc391884c996149dc3779ce71f15dda63a759ee9cc05871f5a8379dcb62b047098922c0f26c7bd04deb394c33f9", + "0x95cd4ad88d51f0f2efcfd0c2df802fe252bb9704d1afbf9c26a248df22d55da87bdfaf41d7bc6e5df38bd848f0b13f42", + "0xa05a49a31e91dff6a52ac8b9c2cfdd646a43f0d488253f9e3cfbce52f26667166bbb9b608fc358763a65cbf066cd6d05", + "0xa59c3c1227fdd7c2e81f5e11ef5c406da44662987bac33caed72314081e2eed66055d38137e01b2268e58ec85dd986c0", + "0xb7020ec3bd73a99861f0f1d88cf5a19abab1cbe14b7de77c9868398c84bb8e18dbbe9831838a96b6d6ca06e82451c67b", + "0x98d1ff2525e9718ee59a21d8900621636fcd873d9a564b8dceb4be80a194a0148daf1232742730b3341514b2e5a5436c", + "0x886d97b635975fc638c1b6afc493e5998ca139edba131b75b65cfe5a8e814f11bb678e0eeee5e6e5cd913ad3f2fefdfc", + "0x8fb9fd928d38d5d813b671c924edd56601dd7163b686c13f158645c2f869d9250f3859aa5463a39258c90fef0f41190a", + "0xaac35e1cd655c94dec3580bb3800bd9c2946c4a9856f7d725af15fbea6a2d8ca51c8ad2772abed60ee0e3fb9cb24046b", + "0xb8d71fa0fa05ac9e443c9b4929df9e7f09a919be679692682e614d24227e04894bfc14a5c73a62fb927fedff4a0e4aa7", + "0xa45a19f11fbbb531a704badbb813ed8088ab827c884ee4e4ebf363fa1132ff7cfa9d28be9c85b143e4f7cdbc94e7cf1a", + "0x82b54703a4f295f5471b255ab59dce00f0fe90c9fb6e06b9ee48b15c91d43f4e2ef4a96c3118aeb03b08767be58181bb", + "0x8283264c8e6d2a36558f0d145c18576b6600ff45ff99cc93eca54b6c6422993cf392668633e5df396b9331e873d457e5", + "0x8c549c03131ead601bc30eb6b9537b5d3beb7472f5bb1bcbbfd1e9f3704477f7840ab3ab7f7dc13bbbbcdff886a462d4", + "0xafbb0c520ac1b5486513587700ad53e314cb74bfbc12e0b5fbdcfdaac36d342e8b59856196a0d84a25cff6e6e1d17e76", + "0x89e4c22ffb51f2829061b3c7c1983c5c750cad158e3a825d46f7cf875677da5d63f653d8a297022b5db5845c9271b32b", + "0xafb27a86c4c2373088c96b9adf4433f2ebfc78ac5c526e9f0510670b6e4e5e0057c0a4f75b185e1a30331b9e805c1c15", + "0xa18e16b57445f88730fc5d3567bf5a176861dc14c7a08ed2996fe80eed27a0e7628501bcb78a1727c5e9ac55f29c12c4", + "0x93d61bf88b192d6825cf4e1120af1c17aa0f994d158b405e25437eaeefae049f7b721a206e7cc8a04fdc29d3c42580a1", + "0xa99f2995a2e3ed2fd1228d64166112038de2f516410aa439f4c507044e2017ea388604e2d0f7121256fadf7fbe7023d1", + "0x914fd91cffc23c32f1c6d0e98bf660925090d873367d543034654389916f65f552e445b0300b71b61b721a72e9a5983c", + "0xb42a578a7787b71f924e7def425d849c1c777156b1d4170a8ee7709a4a914e816935131afd9a0412c4cb952957b20828", + "0x82fb30590e84b9e45db1ec475a39971cf554dc01bcc7050bc89265740725c02e2be5a972168c5170c86ae83e5b0ad2c0", + "0xb14f8d8e1e93a84976289e0cf0dfa6f3a1809e98da16ee5c4932d0e1ed6bf8a07697fdd4dd86a3df84fb0003353cdcc0", + "0x85d7a2f4bda31aa2cb208b771fe03291a4ebdaf6f1dc944c27775af5caec412584c1f45bc741fca2a6a85acb3f26ad7d", + "0xaf02e56ce886ff2253bc0a68faad76f25ead84b2144e5364f3fb9b648f03a50ee9dc0b2c33ebacf7c61e9e43201ef9ef", + "0x87e025558c8a0b0abd06dfc350016847ea5ced7af2d135a5c9eec9324a4858c4b21510fb0992ec52a73447f24945058e", + "0x80fff0bafcd058118f5e7a4d4f1ae0912efeb281d2cbe4d34ba8945cc3dbe5d8baf47fb077343b90b8d895c90b297aca", + "0xb6edcf3a40e7b1c3c0148f47a263cd819e585a51ef31c2e35a29ce6f04c53e413f743034c0d998d9c00a08ba00166f31", + "0xabb87ed86098c0c70a76e557262a494ff51a30fb193f1c1a32f8e35eafa34a43fcc07aa93a3b7a077d9e35afa07b1a3d", + "0xa280214cd3bb0fb7ecd2d8bcf518cbd9078417f2b91d2533ec2717563f090fb84f2a5fcfdbbeb2a2a1f8a71cc5aa5941", + "0xa63083ca7238ea2b57d15a475963cf1d4f550d8cd76db290014a0461b90351f1f26a67d674c837b0b773b330c7c3d534", + "0xa8fa39064cb585ece5263e2f42f430206476bf261bd50f18d2b694889bd79d04d56410664cecad62690e5c5a20b3f6ff", + "0x85ba52ce9d700a5dcf6c5b00559acbe599d671ce5512467ff4b6179d7fad550567ce2a9c126a50964e3096458ea87920", + "0xb913501e1008f076e5eac6d883105174f88b248e1c9801e568fefaffa1558e4909364fc6d9512aa4d125cbd7cc895f05", + "0x8eb33b5266c8f2ed4725a6ad147a322e44c9264cf261c933cbbe230a43d47fca0f29ec39756b20561dabafadd5796494", + "0x850ebc8b661a04318c9db5a0515066e6454fa73865aa4908767a837857ecd717387f614acb614a88e075d4edc53a2f5a", + "0xa08d6b92d866270f29f4ce23a3f5d99b36b1e241a01271ede02817c8ec3f552a5c562db400766c07b104a331835c0c64", + "0x8131804c89bb3e74e9718bfc4afa547c1005ff676bd4db9604335032b203390cfa54478d45c6c78d1fe31a436ed4be9f", + "0x9106d94f23cc1eacec8316f16d6f0a1cc160967c886f51981fdb9f3f12ee1182407d2bb24e5b873de58cb1a3ee915a6b", + "0xa13806bfc3eae7a7000c9d9f1bd25e10218d4e67f59ae798b145b098bca3edad2b1040e3fc1e6310e612fb8818f459ac", + "0x8c69fbca502046cb5f6db99900a47b34117aef3f4b241690cdb3b84ca2a2fc7833e149361995dc41fa78892525bce746", + "0x852c473150c91912d58ecb05769222fa18312800c3f56605ad29eec9e2d8667b0b81c379048d3d29100ed2773bb1f3c5", + "0xb1767f6074426a00e01095dbb1795beb4e4050c6411792cbad6537bc444c3165d1058bafd1487451f9c5ddd209e0ae7e", + "0x80c600a5fe99354ce59ff0f84c760923dc8ff66a30bf47dc0a086181785ceb01f9b951c4e66df800ea6d705e8bc47055", + "0xb5cf19002fbc88a0764865b82afcb4d64a50196ea361e5c71dff7de084f4dcbbc34ec94a45cc9e0247bd51da565981aa", + "0x93e67a254ea8ce25e112d93cc927fadaa814152a2c4ec7d9a56eaa1ed47aec99b7e9916b02e64452cc724a6641729bbb", + "0xace70b32491bda18eee4a4d041c3bc9effae9340fe7e6c2f5ad975ee0874c17f1a7da7c96bd85fccff9312c518fac6e9", + "0xab4cfa02065017dd7f1aadc66f2c92f78f0f11b8597c03a5d69d82cb2eaf95a4476a836ac102908f137662472c8d914b", + "0xa40b8cd8deb8ae503d20364d64cab7c2801b7728a9646ed19c65edea6a842756a2f636283494299584ad57f4bb12cd0b", + "0x8594e11d5fc2396bcd9dbf5509ce4816dbb2b7305168021c426171fb444d111da5a152d6835ad8034542277011c26c0e", + "0x8024de98c26b4c994a66628dc304bb737f4b6859c86ded552c5abb81fd4c6c2e19d5a30beed398a694b9b2fdea1dd06a", + "0x8843f5872f33f54df8d0e06166c1857d733995f67bc54abb8dfa94ad92407cf0179bc91b0a50bbb56cdc2b350d950329", + "0xb8bab44c7dd53ef9edf497dcb228e2a41282c90f00ba052fc52d57e87b5c8ab132d227af1fcdff9a12713d1f980bcaae", + "0x982b4d7b29aff22d527fd82d2a52601d95549bfb000429bb20789ed45e5abf1f4b7416c7b7c4b79431eb3574b29be658", + "0x8eb1f571b6a1878e11e8c1c757e0bc084bab5e82e897ca9be9b7f4b47b91679a8190bf0fc8f799d9b487da5442415857", + "0xa6e74b588e5af935c8b243e888582ef7718f8714569dd4992920740227518305eb35fab674d21a5551cca44b3e511ef2", + "0xa30fc2f3a4cb4f50566e82307de73cd7bd8fe2c1184e9293c136a9b9e926a018d57c6e4f308c95b9eb8299e94d90a2a1", + "0xa50c5869ca5d2b40722c056a32f918d47e0b65ca9d7863ca7d2fb4a7b64fe523fe9365cf0573733ceaadebf20b48fff8", + "0x83bbdd32c04d17581418cf360749c7a169b55d54f2427390defd9f751f100897b2d800ce6636c5bbc046c47508d60c8c", + "0xa82904bdf614de5d8deaff688c8a5e7ac5b3431687acbcda8fa53960b7c417a39c8b2e462d7af91ce6d79260f412db8e", + "0xa4362e31ff4b05d278b033cf5eebea20de01714ae16d4115d04c1da4754269873afc8171a6f56c5104bfd7b0db93c3e7", + "0xb5b8daa63a3735581e74a021b684a1038cea77168fdb7fdf83c670c2cfabcfc3ab2fc7359069b5f9048188351aef26b5", + "0xb48d723894b7782d96ac8433c48faca1bdfa5238019c451a7f47d958097cce3ae599b876cf274269236b9d6ff8b6d7ca", + "0x98ffff6a61a3a6205c7820a91ca2e7176fab5dba02bc194c4d14942ac421cb254183c705506ab279e4f8db066f941c6c", + "0xae7db24731da2eaa6efc4f7fcba2ecc26940ddd68038dce43acf2cee15b72dc4ef42a7bfdd32946d1ed78786dd7696b3", + "0xa656db14f1de9a7eb84f6301b4acb2fbf78bfe867f48a270e416c974ab92821eb4df1cb881b2d600cfed0034ac784641", + "0xaa315f8ecba85a5535e9a49e558b15f39520fce5d4bf43131bfbf2e2c9dfccc829074f9083e8d49f405fb221d0bc4c3c", + "0x90bffba5d9ff40a62f6c8e9fc402d5b95f6077ed58d030c93e321b8081b77d6b8dac3f63a92a7ddc01585cf2c127d66c", + "0xabdd733a36e0e0f05a570d0504e73801bf9b5a25ff2c78786f8b805704997acb2e6069af342538c581144d53149fa6d3", + "0xb4a723bb19e8c18a01bd449b1bb3440ddb2017f10bb153da27deb7a6a60e9bb37619d6d5435fbb1ba617687838e01dd0", + "0x870016b4678bab3375516db0187a2108b2e840bae4d264b9f4f27dbbc7cc9cac1d7dc582d7a04d6fd1ed588238e5e513", + "0x80d33d2e20e8fc170aa3cb4f69fffb72aeafb3b5bb4ea0bc79ab55da14142ca19b2d8b617a6b24d537366e3b49cb67c3", + "0xa7ee76aec273aaae03b3b87015789289551969fb175c11557da3ab77e39ab49d24634726f92affae9f4d24003050d974", + "0x8415ea4ab69d779ebd42d0fe0c6aef531d6a465a5739e429b1fcf433ec45aa8296c527e965a20f0ec9f340c9273ea3cf", + "0x8c7662520794e8b4405d0b33b5cac839784bc86a5868766c06cbc1fa306dbe334978177417b31baf90ce7b0052a29c56", + "0x902b2abecc053a3dbdea9897ee21e74821f3a1b98b2d560a514a35799f4680322550fd3a728d4f6d64e1de98033c32b8", + "0xa05e84ed9ecab8d508d670c39f2db61ad6e08d2795ec32a3c9d0d3737ef3801618f4fc2a95f90ec2f068606131e076c5", + "0x8b9208ff4d5af0c2e3f53c9375da666773ac57197dfabb0d25b1c8d0588ba7f3c15ee9661bb001297f322ea2fbf6928b", + "0xa3c827741b34a03254d4451b5ab74a96f2b9f7fb069e2f5adaf54fd97cc7a4d516d378db5ca07da87d8566d6eef13726", + "0x8509d8a3f4a0ed378e0a1e28ea02f6bf1d7f6c819c6c2f5297c7df54c895b848f841653e32ba2a2c22c2ff739571acb8", + "0xa0ce988b7d3c40b4e496aa83a09e4b5472a2d98679622f32bea23e6d607bc7de1a5374fb162bce0549a67dad948519be", + "0xaa8a3dd12bd60e3d2e05f9c683cdcb8eab17fc59134815f8d197681b1bcf65108cba63ac5c58ee632b1e5ed6bba5d474", + "0x8b955f1d894b3aefd883fb4b65f14cd37fc2b9db77db79273f1700bef9973bf3fd123897ea2b7989f50003733f8f7f21", + "0xac79c00ddac47f5daf8d9418d798d8af89fc6f1682e7e451f71ea3a405b0d36af35388dd2a332af790bc83ca7b819328", + "0xa0d44dd2a4438b809522b130d0938c3fe7c5c46379365dbd1810a170a9aa5818e1c783470dd5d0b6d4ac7edbb7330910", + "0xa30b69e39ad43dd540a43c521f05b51b5f1b9c4eed54b8162374ae11eac25da4f5756e7b70ce9f3c92c2eeceee7431ed", + "0xac43220b762c299c7951222ea19761ab938bf38e4972deef58ed84f4f9c68c230647cf7506d7cbfc08562fcca55f0485", + "0xb28233b46a8fb424cfa386a845a3b5399d8489ceb83c8f3e05c22c934798d639c93718b7b68ab3ce24c5358339e41cbb", + "0xac30d50ee8ce59a10d4b37a3a35e62cdb2273e5e52232e202ca7d7b8d09d28958ee667fae41a7bb6cdc6fe8f6e6c9c85", + "0xb199842d9141ad169f35cc7ff782b274cbaa645fdb727761e0a89edbf0d781a15f8218b4bf4eead326f2903dd88a9cc1", + "0x85e018c7ddcad34bb8285a737c578bf741ccd547e68c734bdb3808380e12c5d4ef60fc896b497a87d443ff9abd063b38", + "0x8c856e6ba4a815bdb891e1276f93545b7072f6cb1a9aa6aa5cf240976f29f4dee01878638500a6bf1daf677b96b54343", + "0xb8a47555fa8710534150e1a3f13eab33666017be6b41005397afa647ea49708565f2b86b77ad4964d140d9ced6b4d585", + "0x8cd1f1db1b2f4c85a3f46211599caf512d5439e2d8e184663d7d50166fd3008f0e9253272f898d81007988435f715881", + "0xb1f34b14612c973a3eceb716dc102b82ab18afef9de7630172c2780776679a7706a4874e1df3eaadf541fb009731807f", + "0xb25464af9cff883b55be2ff8daf610052c02df9a5e147a2cf4df6ce63edcdee6dc535c533590084cc177da85c5dc0baa", + "0x91c3c4b658b42d8d3448ae1415d4541d02379a40dc51e36a59bd6e7b9ba3ea51533f480c7c6e8405250ee9b96a466c29", + "0x86dc027b95deb74c36a58a1333a03e63cb5ae22d3b29d114cfd2271badb05268c9d0c819a977f5e0c6014b00c1512e3a", + "0xae0e6ff58eb5fa35da5107ebeacf222ab8f52a22bb1e13504247c1dfa65320f40d97b0e6b201cb6613476687cb2f0681", + "0x8f13415d960b9d7a1d93ef28afc2223e926639b63bdefce0f85e945dfc81670a55df288893a0d8b3abe13c5708f82f91", + "0x956f67ca49ad27c1e3a68c1faad5e7baf0160c459094bf6b7baf36b112de935fdfd79fa4a9ea87ea8de0ac07272969f4", + "0x835e45e4a67df9fb51b645d37840b3a15c171d571a10b03a406dd69d3c2f22df3aa9c5cbe1e73f8d767ce01c4914ea9a", + "0x919b938e56d4b32e2667469d0bdccb95d9dda3341aa907683ee70a14bbbe623035014511c261f4f59b318b610ac90aa3", + "0x96b48182121ccd9d689bf1dfdc228175564cd68dc904a99c808a7f0053a6f636c9d953e12198bdf2ea49ea92772f2e18", + "0xac5e5a941d567fa38fdbcfa8cf7f85bb304e3401c52d88752bcd516d1fa9bac4572534ea2205e38423c1df065990790f", + "0xac0bd594fb85a8d4fc26d6df0fa81f11919401f1ecf9168b891ec7f061a2d9368af99f7fd8d9b43b2ce361e7b8482159", + "0x83d92c69ca540d298fe80d8162a1c7af3fa9b49dfb69e85c1d136a3ec39fe419c9fa78e0bb6d96878771fbd37fe92e40", + "0xb35443ae8aa66c763c2db9273f908552fe458e96696b90e41dd509c17a5c04ee178e3490d9c6ba2dc0b8f793c433c134", + "0x923b2d25aa45b2e580ffd94cbb37dc8110f340f0f011217ee1bd81afb0714c0b1d5fb4db86006cdd2457563276f59c59", + "0x96c9125d38fca1a61ac21257b696f8ac3dae78def50285e44d90ea293d591d1c58f703540a7e4e99e070afe4646bbe15", + "0xb57946b2332077fbcdcb406b811779aefd54473b5559a163cd65cb8310679b7e2028aa55c12a1401fdcfcac0e6fae29a", + "0x845daedc5cf972883835d7e13c937b63753c2200324a3b8082a6c4abb4be06c5f7c629d4abe4bfaf1d80a1f073eb6ce6", + "0x91a55dfd0efefcd03dc6dacc64ec93b8d296cb83c0ee72400a36f27246e7f2a60e73b7b70ba65819e9cfb73edb7bd297", + "0x8874606b93266455fe8fdd25df9f8d2994e927460af06f2e97dd4d2d90db1e6b06d441b72c2e76504d753badca87fb37", + "0x8ee99e6d231274ff9252c0f4e84549da173041299ad1230929c3e3d32399731c4f20a502b4a307642cac9306ccd49d3c", + "0x8836497714a525118e20849d6933bb8535fb6f72b96337d49e3133d936999c90a398a740f42e772353b5f1c63581df6d", + "0xa6916945e10628f7497a6cdc5e2de113d25f7ade3e41e74d3de48ccd4fce9f2fa9ab69645275002e6f49399b798c40af", + "0x9597706983107eb23883e0812e1a2c58af7f3499d50c6e29b455946cb9812fde1aa323d9ed30d1c0ffd455abe32303cd", + "0xa24ee89f7f515cc33bdbdb822e7d5c1877d337f3b2162303cfc2dae028011c3a267c5cb4194afa63a4856a6e1c213448", + "0x8cd25315e4318801c2776824ae6e7d543cb85ed3bc2498ba5752df2e8142b37653cf9e60104d674be3aeb0a66912e97a", + "0xb5085ecbe793180b40dbeb879f4c976eaaccaca3a5246807dced5890e0ed24d35f3f86955e2460e14fb44ff5081c07ba", + "0x960188cc0b4f908633a6840963a6fa2205fc42c511c6c309685234911c5304ef4c304e3ae9c9c69daa2fb6a73560c256", + "0xa32d0a70bf15d569b4cda5aebe3e41e03c28bf99cdd34ffa6c5d58a097f322772acca904b3a47addb6c7492a7126ebac", + "0x977f72d06ad72d4aa4765e0f1f9f4a3231d9f030501f320fe7714cc5d329d08112789fa918c60dd7fdb5837d56bb7fc6", + "0x99fa038bb0470d45852bb871620d8d88520adb701712fcb1f278fed2882722b9e729e6cdce44c82caafad95e37d0e6f7", + "0xb855e8f4fc7634ada07e83b6c719a1e37acb06394bc8c7dcab7747a8c54e5df3943915f021364bd019fdea103864e55f", + "0x88bc2cd7458532e98c596ef59ea2cf640d7cc31b4c33cef9ed065c078d1d4eb49677a67de8e6229cc17ea48bace8ee5a", + "0xaaa78a3feaa836d944d987d813f9b9741afb076e6aca1ffa42682ab06d46d66e0c07b8f40b9dbd63e75e81efa1ef7b08", + "0xb7b080420cc4d808723b98b2a5b7b59c81e624ab568ecdfdeb8bf3aa151a581b6f56e983ef1b6f909661e25db40b0c69", + "0xabee85c462ac9a2c58e54f06c91b3e5cd8c5f9ab5b5deb602b53763c54826ed6deb0d6db315a8d7ad88733407e8d35e2", + "0x994d075c1527407547590df53e9d72dd31f037c763848d1662eebd4cefec93a24328c986802efa80e038cb760a5300f5", + "0xab8777640116dfb6678e8c7d5b36d01265dfb16321abbfc277da71556a34bb3be04bc4ae90124ed9c55386d2bfb3bda0", + "0x967e3a828bc59409144463bcf883a3a276b5f24bf3cbfdd7a42343348cba91e00b46ac285835a9b91eef171202974204", + "0x875a9f0c4ffe5bb1d8da5e3c8e41d0397aa6248422a628bd60bfae536a651417d4e8a7d2fb98e13f2dad3680f7bd86d3", + "0xacaa330c3e8f95d46b1880126572b238dbb6d04484d2cd4f257ab9642d8c9fc7b212188b9c7ac9e0fd135c520d46b1bf", + "0xaceb762edbb0f0c43dfcdb01ea7a1ac5918ca3882b1e7ebc4373521742f1ed5250d8966b498c00b2b0f4d13212e6dd0b", + "0x81d072b4ad258b3646f52f399bced97c613b22e7ad76373453d80b1650c0ca87edb291a041f8253b649b6e5429bb4cff", + "0x980a47d27416ac39c7c3a0ebe50c492f8c776ea1de44d5159ac7d889b6d554357f0a77f0e5d9d0ff41aae4369eba1fc2", + "0x8b4dfd5ef5573db1476d5e43aacfb5941e45d6297794508f29c454fe50ea622e6f068b28b3debe8635cf6036007de2e3", + "0xa60831559d6305839515b68f8c3bc7abbd8212cc4083502e19dd682d56ca37c9780fc3ce4ec2eae81ab23b221452dc57", + "0x951f6b2c1848ced9e8a2339c65918e00d3d22d3e59a0a660b1eca667d18f8430d737884e9805865ef3ed0fe1638a22d9", + "0xb02e38fe790b492aa5e89257c4986c9033a8b67010fa2add9787de857d53759170fdd67715ca658220b4e14b0ca48124", + "0xa51007e4346060746e6b0e4797fc08ef17f04a34fe24f307f6b6817edbb8ce2b176f40771d4ae8a60d6152cbebe62653", + "0xa510005b05c0b305075b27b243c9d64bcdce85146b6ed0e75a3178b5ff9608213f08c8c9246f2ca6035a0c3e31619860", + "0xaaff4ef27a7a23be3419d22197e13676d6e3810ceb06a9e920d38125745dc68a930f1741c9c2d9d5c875968e30f34ab5", + "0x864522a9af9857de9814e61383bebad1ba9a881696925a0ea6bfc6eff520d42c506bbe5685a9946ed710e889765be4a0", + "0xb63258c080d13f3b7d5b9f3ca9929f8982a6960bdb1b0f8676f4dca823971601672f15e653917bf5d3746bb220504913", + "0xb51ce0cb10869121ae310c7159ee1f3e3a9f8ad498827f72c3d56864808c1f21fa2881788f19ece884d3f705cd7bd0c5", + "0x95d9cecfc018c6ed510e441cf84c712d9909c778c16734706c93222257f64dcd2a9f1bd0b400ca271e22c9c487014274", + "0x8beff4d7d0140b86380ff4842a9bda94c2d2be638e20ac68a4912cb47dbe01a261857536375208040c0554929ced1ddc", + "0x891ff49258749e2b57c1e9b8e04b12c77d79c3308b1fb615a081f2aacdfb4b39e32d53e069ed136fdbd43c53b87418fa", + "0x9625cad224e163d387738825982d1e40eeff35fe816d10d7541d15fdc4d3eee48009090f3faef4024b249205b0b28f72", + "0x8f3947433d9bd01aa335895484b540a9025a19481a1c40b4f72dd676bfcf332713714fd4010bde936eaf9470fd239ed0", + "0xa00ec2d67789a7054b53f0e858a8a232706ccc29a9f3e389df7455f1a51a2e75801fd78469a13dbc25d28399ae4c6182", + "0xa3f65884506d4a62b8775a0ea0e3d78f5f46bc07910a93cd604022154eabdf1d73591e304d61edc869e91462951975e1", + "0xa14eef4fd5dfac311713f0faa9a60415e3d30b95a4590cbf95f2033dffb4d16c02e7ceff3dcd42148a4e3bc49cce2dd4", + "0x8afa11c0eef3c540e1e3460bc759bb2b6ea90743623f88e62950c94e370fe4fd01c22b6729beba4dcd4d581198d9358f", + "0xafb05548a69f0845ffcc5f5dc63e3cdb93cd270f5655173b9a950394b0583663f2b7164ba6df8d60c2e775c1d9f120af", + "0x97f179e01a947a906e1cbeafa083960bc9f1bade45742a3afee488dfb6011c1c6e2db09a355d77f5228a42ccaa7bdf8e", + "0x8447fca4d35f74b3efcbd96774f41874ca376bf85b79b6e66c92fa3f14bdd6e743a051f12a7fbfd87f319d1c6a5ce217", + "0xa57ca39c23617cd2cf32ff93b02161bd7baf52c4effb4679d9d5166406e103bc8f3c6b5209e17c37dbb02deb8bc72ddd", + "0x9667c7300ff80f0140be002b0e36caab07aaee7cce72679197c64d355e20d96196acaf54e06e1382167d081fe6f739c1", + "0x828126bb0559ce748809b622677267ca896fa2ee76360fd2c02990e6477e06a667241379ca7e65d61a5b64b96d7867de", + "0x8b8835dea6ba8cf61c91f01a4b3d2f8150b687a4ee09b45f2e5fc8f80f208ae5d142d8e3a18153f0722b90214e60c5a7", + "0xa98e8ff02049b4da386e3ee93db23bbb13dfeb72f1cfde72587c7e6d962780b7671c63e8ac3fbaeb1a6605e8d79e2f29", + "0x87a4892a0026d7e39ef3af632172b88337cb03669dea564bcdb70653b52d744730ebb5d642e20cb627acc9dbb547a26b", + "0x877352a22fc8052878a57effc159dac4d75fe08c84d3d5324c0bab6d564cdf868f33ceee515eee747e5856b62cfa0cc7", + "0x8b801ba8e2ff019ee62f64b8cb8a5f601fc35423eb0f9494b401050103e1307dc584e4e4b21249cd2c686e32475e96c3", + "0xa9e7338d6d4d9bfec91b2af28a8ed13b09415f57a3a00e5e777c93d768fdb3f8e4456ae48a2c6626b264226e911a0e28", + "0x99c05fedf40ac4726ed585d7c1544c6e79619a0d3fb6bda75a08c7f3c0008e8d5e19ed4da48de3216135f34a15eba17c", + "0xa61cce8a1a8b13a4a650fdbec0eeea8297c352a8238fb7cac95a0df18ed16ee02a3daa2de108fa122aca733bd8ad7855", + "0xb97f37da9005b440b4cb05870dd881bf8491fe735844f2d5c8281818583b38e02286e653d9f2e7fa5e74c3c3eb616540", + "0xa72164a8554da8e103f692ac5ebb4aece55d5194302b9f74b6f2a05335b6e39beede0bf7bf8c5bfd4d324a784c5fb08c", + "0xb87e8221c5341cd9cc8bb99c10fe730bc105550f25ed4b96c0d45e6142193a1b2e72f1b3857373a659b8c09be17b3d91", + "0xa41fb1f327ef91dcb7ac0787918376584890dd9a9675c297c45796e32d6e5985b12f9b80be47fc3a8596c245f419d395", + "0x90dafa3592bdbb3465c92e2a54c2531822ba0459d45d3e7a7092fa6b823f55af28357cb51896d4ec2d66029c82f08e26", + "0xa0a9adc872ebc396557f484f1dd21954d4f4a21c4aa5eec543f5fa386fe590839735c01f236574f7ff95407cd12de103", + "0xb8c5c940d58be7538acf8672852b5da3af34f82405ef2ce8e4c923f1362f97fc50921568d0fd2fe846edfb0823e62979", + "0x85aaf06a8b2d0dac89dafd00c28533f35dbd074978c2aaa5bef75db44a7b12aeb222e724f395513b9a535809a275e30b", + "0x81f3cbe82fbc7028c26a6c1808c604c63ba023a30c9f78a4c581340008dbda5ec07497ee849a2183fcd9124f7936af32", + "0xa11ac738de75fd60f15a34209d3825d5e23385796a4c7fc5931822f3f380af977dd0f7b59fbd58eed7777a071e21b680", + "0x85a279c493de03db6fa6c3e3c1b1b29adc9a8c4effc12400ae1128da8421954fa8b75ad19e5388fe4543b76fb0812813", + "0x83a217b395d59ab20db6c4adb1e9713fc9267f5f31a6c936042fe051ce8b541f579442f3dcf0fa16b9e6de9fd3518191", + "0x83a0b86e7d4ed8f9ccdc6dfc8ff1484509a6378fa6f09ed908e6ab9d1073f03011dc497e14304e4e3d181b57de06a5ab", + "0xa63ad69c9d25704ce1cc8e74f67818e5ed985f8f851afa8412248b2df5f833f83b95b27180e9e7273833ed0d07113d3b", + "0x99b1bc2021e63b561fe44ddd0af81fcc8627a91bfeecbbc989b642bc859abc0c8d636399701aad7bbaf6a385d5f27d61", + "0xb53434adb66f4a807a6ad917c6e856321753e559b1add70824e5c1e88191bf6993fccb9b8b911fc0f473fb11743acacd", + "0x97ed3b9e6fb99bf5f945d4a41f198161294866aa23f2327818cdd55cb5dc4c1a8eff29dd8b8d04902d6cd43a71835c82", + "0xb1e808260e368a18d9d10bdea5d60223ba1713b948c782285a27a99ae50cc5fc2c53d407de07155ecc16fb8a36d744a0", + "0xa3eb4665f18f71833fec43802730e56b3ee5a357ea30a888ad482725b169d6f1f6ade6e208ee081b2e2633079b82ba7d", + "0xab8beb2c8353fc9f571c18fdd02bdb977fc883313469e1277b0372fbbb33b80dcff354ca41de436d98d2ed710faa467e", + "0xaa9071cfa971e4a335a91ad634c98f2be51544cb21f040f2471d01bb97e1df2277ae1646e1ea8f55b7ba9f5c8c599b39", + "0x80b7dbfdcaf40f0678012acc634eba44ea51181475180d9deb2050dc4f2de395289edd0223018c81057ec79b04b04c49", + "0x89623d7f6cb17aa877af14de842c2d4ab7fd576d61ddd7518b5878620a01ded40b6010de0da3cdf31d837eecf30e9847", + "0xa773bb024ae74dd24761f266d4fb27d6fd366a8634febe8235376b1ae9065c2fe12c769f1d0407867dfbe9f5272c352f", + "0x8455a561c3aaa6ba64c881a5e13921c592b3a02e968f4fb24a2243c36202795d0366d9cc1a24e916f84d6e158b7aeac7", + "0x81d8bfc4b283cf702a40b87a2b96b275bdbf0def17e67d04842598610b67ea08c804d400c3e69fa09ea001eaf345b276", + "0xb8f8f82cb11fea1c99467013d7e167ff03deb0c65a677fab76ded58826d1ba29aa7cf9fcd7763615735ea3ad38e28719", + "0x89a6a04baf9cccc1db55179e1650b1a195dd91fb0aebc197a25143f0f393524d2589975e3fbfc2547126f0bced7fd6f2", + "0xb81b2162df045390f04df07cbd0962e6b6ca94275a63edded58001a2f28b2ae2af2c7a6cba4ecd753869684e77e7e799", + "0xa3757f722776e50de45c62d9c4a2ee0f5655a512344c4cbec542d8045332806568dd626a719ef21a4eb06792ca70f204", + "0x8c5590df96ec22179a4e8786de41beb44f987a1dcc508eb341eecbc0b39236fdfad47f108f852e87179ccf4e10091e59", + "0x87502f026ed4e10167419130b88c3737635c5b9074c364e1dd247cef5ef0fc064b4ae99b187e33301e438bbd2fe7d032", + "0xaf925a2165e980ced620ff12289129fe17670a90ae0f4db9d4b39bd887ccb1f5d2514ac9ecf910f6390a8fc66bd5be17", + "0x857fca899828cf5c65d26e3e8a6e658542782fc72762b3b9c73514919f83259e0f849a9d4838b40dc905fe43024d0d23", + "0x87ffebdbfb69a9e1007ebac4ffcb4090ff13705967b73937063719aa97908986effcb7262fdadc1ae0f95c3690e3245d", + "0xa9ff6c347ac6f4c6ab993b748802e96982eaf489dc69032269568412fc9a79e7c2850dfc991b28211b3522ee4454344b", + "0xa65b3159df4ec48bebb67cb3663cd744027ad98d970d620e05bf6c48f230fa45bf17527fe726fdf705419bb7a1bb913e", + "0x84b97b1e6408b6791831997b03cd91f027e7660fd492a93d95daafe61f02427371c0e237c75706412f442991dfdff989", + "0xab761c26527439b209af0ae6afccd9340bbed5fbe098734c3145b76c5d2cd7115d9227b2eb523882b7317fbb09180498", + "0xa0479a8da06d7a69c0b0fee60df4e691c19c551f5e7da286dab430bfbcabf31726508e20d26ea48c53365a7f00a3ad34", + "0xa732dfc9baa0f4f40b5756d2e8d8937742999623477458e0bc81431a7b633eefc6f53b3b7939fe0a020018549c954054", + "0x901502436a1169ba51dc479a5abe7c8d84e0943b16bc3c6a627b49b92cd46263c0005bc324c67509edd693f28e612af1", + "0xb627aee83474e7f84d1bab9b7f6b605e33b26297ac6bbf52d110d38ba10749032bd551641e73a383a303882367af429b", + "0x95108866745760baef4a46ef56f82da6de7e81c58b10126ebd2ba2cd13d339f91303bf2fb4dd104a6956aa3b13739503", + "0x899ed2ade37236cec90056f3569bc50f984f2247792defafcceb49ad0ca5f6f8a2f06573705300e07f0de0c759289ff5", + "0xa9f5eee196d608efe4bcef9bf71c646d27feb615e21252cf839a44a49fd89da8d26a758419e0085a05b1d59600e2dc42", + "0xb36c6f68fed6e6c85f1f4a162485f24817f2843ec5cbee45a1ebfa367d44892e464949c6669f7972dc7167af08d55d25", + "0xaaaede243a9a1b6162afbc8f571a52671a5a4519b4062e3f26777664e245ba873ed13b0492c5dbf0258c788c397a0e9e", + "0x972b4fb39c31cbe127bf9a32a5cc10d621ebdd9411df5e5da3d457f03b2ab2cd1f6372d8284a4a9400f0b06ecdbfd38e", + "0x8f6ca1e110e959a4b1d9a5ce5f212893cec21db40d64d5ac4d524f352d72198f923416a850bf845bc5a22a79c0ea2619", + "0xa0f3c93b22134f66f04b2553a53b738644d1665ceb196b8494b315a4c28236fb492017e4a0de4224827c78e42f9908b7", + "0x807fb5ee74f6c8735b0b5ca07e28506214fe4047dbeb00045d7c24f7849e98706aea79771241224939cb749cf1366c7d", + "0x915eb1ff034224c0b645442cdb7d669303fdc00ca464f91aaf0b6fde0b220a3a74ff0cb043c26c9f3a5667b3fdaa9420", + "0x8fda6cef56ed33fefffa9e6ac8e6f76b1af379f89761945c63dd448801f7bb8ca970504a7105fac2f74f652ccff32327", + "0x87380cffdcffb1d0820fa36b63cc081e72187f86d487315177d4d04da4533eb19a0e2ff6115ceab528887819c44a5164", + "0x8cd89e03411a18e7f16f968b89fb500c36d47d229f6487b99e62403a980058db5925ce249206743333538adfad168330", + "0x974451b1df33522ce7056de9f03e10c70bf302c44b0741a59df3d6877d53d61a7394dcee1dd46e013d7cb9d73419c092", + "0x98c35ddf645940260c490f384a49496a7352bb8e3f686feed815b1d38f59ded17b1ad6e84a209e773ed08f7b8ff1e4c2", + "0x963f386cf944bb9b2ddebb97171b64253ea0a2894ac40049bdd86cda392292315f3a3d490ca5d9628c890cfb669f0acb", + "0x8d507712152babd6d142ee682638da8495a6f3838136088df9424ef50d5ec28d815a198c9a4963610b22e49b4cdf95e9", + "0x83d4bc6b0be87c8a4f1e9c53f257719de0c73d85b490a41f7420e777311640937320557ff2f1d9bafd1daaa54f932356", + "0x82f5381c965b7a0718441131c4d13999f4cdce637698989a17ed97c8ea2e5bdb5d07719c5f7be8688edb081b23ede0f4", + "0xa6ebecab0b72a49dfd01d69fa37a7f74d34fb1d4fef0aa10e3d6fceb9eccd671225c230af89f6eb514250e41a5f91f52", + "0x846d185bdad6e11e604df7f753b7a08a28b643674221f0e750ebdb6b86ec584a29c869e131bca868972a507e61403f6a", + "0x85a98332292acb744bd1c0fd6fdcf1f889a78a2c9624d79413ffa194cc8dfa7821a4b60cde8081d4b5f71f51168dd67f", + "0x8f7d97c3b4597880d73200d074eb813d95432306e82dafc70b580b8e08cb8098b70f2d07b4b3ac6a4d77e92d57035031", + "0x8185439c8751e595825d7053518cbe121f191846a38d4dbcb558c3f9d7a3104f3153401adaaaf27843bbe2edb504bfe3", + "0xb3c00d8ece1518fca6b1215a139b0a0e26d9cba1b3a424f7ee59f30ce800a5db967279ed60958dd1f3ee69cf4dd1b204", + "0xa2e6cb6978e883f9719c3c0d44cfe8de0cc6f644b98f98858433bea8bbe7b612c8aca5952fccce4f195f9d54f9722dc2", + "0x99663087e3d5000abbec0fbda4e7342ec38846cc6a1505191fb3f1a337cb369455b7f8531a6eb8b0f7b2c4baf83cbe2b", + "0xab0836c6377a4dbc7ca6a4d6cf021d4cd60013877314dd05f351706b128d4af6337711ed3443cb6ca976f40d74070a9a", + "0x87abfd5126152fd3bac3c56230579b489436755ea89e0566aa349490b36a5d7b85028e9fb0710907042bcde6a6f5d7e3", + "0x974ba1033f75f60e0cf7c718a57ae1da3721cf9d0fb925714c46f027632bdd84cd9e6de4cf4d00bc55465b1c5ebb7384", + "0xa607b49d73689ac64f25cec71221d30d53e781e1100d19a2114a21da6507a60166166369d860bd314acb226596525670", + "0xa7c2b0b915d7beba94954f2aa7dd08ec075813661e2a3ecca5d28a0733e59583247fed9528eb28aba55b972cdbaf06eb", + "0xb8b3123e44128cc8efbe3270f2f94e50ca214a4294c71c3b851f8cbb70cb67fe9536cf07d04bf7fe380e5e3a29dd3c15", + "0xa59a07e343b62ad6445a0859a32b58c21a593f9ddbfe52049650f59628c93715aa1f4e1f45b109321756d0eeec8a5429", + "0x94f51f8a4ed18a6030d0aaa8899056744bd0e9dc9ac68f62b00355cddab11da5da16798db75f0bfbce0e5bdfe750c0b6", + "0x97460a97ca1e1fa5ce243b81425edc0ec19b7448e93f0b55bc9785eedeeafe194a3c8b33a61a5c72990edf375f122777", + "0x8fa859a089bc17d698a7ee381f37ce9beadf4e5b44fce5f6f29762bc04f96faff5d58c48c73631290325f05e9a1ecf49", + "0xabdf38f3b20fc95eff31de5aa9ef1031abfa48f1305ee57e4d507594570401503476d3bcc493838fc24d6967a3082c7f", + "0xb8914bfb82815abb86da35c64d39ab838581bc0bf08967192697d9663877825f2b9d6fbdcf9b410463482b3731361aef", + "0xa8187f9d22b193a5f578999954d6ec9aa9b32338ccadb8a3e1ce5bad5ea361d69016e1cdfac44e9d6c54e49dd88561b9", + "0xaac262cb7cba7fd62c14daa7b39677cabc1ef0947dd06dd89cac8570006a200f90d5f0353e84f5ff03179e3bebe14231", + "0xa630ef5ece9733b8c46c0a2df14a0f37647a85e69c63148e79ffdcc145707053f9f9d305c3f1cf3c7915cb46d33abd07", + "0xb102c237cb2e254588b6d53350dfda6901bd99493a3fbddb4121d45e0b475cf2663a40d7b9a75325eda83e4ba1e68cb3", + "0x86a930dd1ddcc16d1dfa00aa292cb6c2607d42c367e470aa920964b7c17ab6232a7108d1c2c11fc40fb7496547d0bbf8", + "0xa832fdc4500683e72a96cce61e62ac9ee812c37fe03527ad4cf893915ca1962cee80e72d4f82b20c8fc0b764376635a1", + "0x88ad985f448dabb04f8808efd90f273f11f5e6d0468b5489a1a6a3d77de342992a73eb842d419034968d733f101ff683", + "0x98a8538145f0d86f7fbf9a81c9140f6095c5bdd8960b1c6f3a1716428cd9cca1bf8322e6d0af24e6169abcf7df2b0ff6", + "0x9048c6eba5e062519011e177e955a200b2c00b3a0b8615bdecdebc217559d41058d3315f6d05617be531ef0f6aef0e51", + "0x833bf225ab6fc68cdcacf1ec1b50f9d05f5410e6cdcd8d56a3081dc2be8a8d07b81534d1ec93a25c2e270313dfb99e3b", + "0xa84bcd24c3da5e537e64a811b93c91bfc84d7729b9ead7f79078989a6eb76717d620c1fad17466a0519208651e92f5ff", + "0xb7cdd0a3fbd79aed93e1b5a44ca44a94e7af5ed911e4492f332e3a5ed146c7286bde01b52276a2fcc02780d2109874dd", + "0x8a19a09854e627cb95750d83c20c67442b66b35896a476358f993ba9ac114d32c59c1b3d0b8787ee3224cf3888b56c64", + "0xa9abd5afb8659ee52ada8fa5d57e7dd355f0a7350276f6160bec5fbf70d5f99234dd179eb221c913e22a49ec6d267846", + "0x8c13c4274c0d30d184e73eaf812200094bbbd57293780bdadbceb262e34dee5b453991e7f37c7333a654fc71c69d6445", + "0xa4320d73296ff8176ce0127ca1921c450e2a9c06eff936681ebaffb5a0b05b17fded24e548454de89aca2dcf6d7a9de4", + "0xb2b8b3e15c1f645f07783e5628aba614e60157889db41d8161d977606788842b67f83f361eae91815dc0abd84e09abd5", + "0xad26c3aa35ddfddc15719b8bb6c264aaec7065e88ac29ba820eb61f220fef451609a7bb037f3722d022e6c86e4f1dc88", + "0xb8615bf43e13ae5d7b8dd903ce37190800cd490f441c09b22aa29d7a29ed2c0417b7a08ead417868f1de2589deaadd80", + "0x8d3425e1482cd1e76750a76239d33c06b3554c3c3c87c15cb7ab58b1cee86a4c5c4178b44e23f36928365a1b484bde02", + "0x806893a62e38c941a7dd6f249c83af16596f69877cc737d8f73f6b8cd93cbc01177a7a276b2b8c6b0e5f2ad864db5994", + "0x86618f17fa4b0d65496b661bbb5ba3bc3a87129d30a4b7d4f515b904f4206ca5253a41f49fd52095861e5e065ec54f21", + "0x9551915da1304051e55717f4c31db761dcdcf3a1366c89a4af800a9e99aca93a357bf928307f098e62b44a02cb689a46", + "0x8f79c4ec0ec1146cb2a523b52fe33def90d7b5652a0cb9c2d1c8808a32293e00aec6969f5b1538e3a94cd1efa3937f86", + "0xa0c03e329a707300081780f1e310671315b4c6a4cedcb29697aedfabb07a9d5df83f27b20e9c44cf6b16e39d9ded5b98", + "0x86a7cfa7c8e7ce2c01dd0baec2139e97e8e090ad4e7b5f51518f83d564765003c65968f85481bbb97cb18f005ccc7d9f", + "0xa33811770c6dfda3f7f74e6ad0107a187fe622d61b444bbd84fd7ef6e03302e693b093df76f6ab39bb4e02afd84a575a", + "0x85480f5c10d4162a8e6702b5e04f801874d572a62a130be94b0c02b58c3c59bdcd48cd05f0a1c2839f88f06b6e3cd337", + "0x8e181011564b17f7d787fe0e7f3c87f6b62da9083c54c74fd6c357a1f464c123c1d3d8ade3cf72475000b464b14e2be3", + "0x8ee178937294b8c991337e0621ab37e9ffa4ca2bdb3284065c5e9c08aad6785d50cf156270ff9daf9a9127289710f55b", + "0x8bd1e8e2d37379d4b172f1aec96f2e41a6e1393158d7a3dbd9a95c8dd4f8e0b05336a42efc11a732e5f22b47fc5c271d", + "0x8f3da353cd487c13136a85677de8cedf306faae0edec733cf4f0046f82fa4639db4745b0095ff33a9766aba50de0cbcf", + "0x8d187c1e97638df0e4792b78e8c23967dac43d98ea268ca4aabea4e0fa06cb93183fd92d4c9df74118d7cc27bf54415e", + "0xa4c992f08c2f8bac0b74b3702fb0c75c9838d2ce90b28812019553d47613c14d8ce514d15443159d700b218c5a312c49", + "0xa6fd1874034a34c3ea962a316c018d9493d2b3719bb0ec4edbc7c56b240802b2228ab49bee6f04c8a3e9f6f24a48c1c2", + "0xb2efed8e799f8a15999020900dc2c58ece5a3641c90811b86a5198e593d7318b9d53b167818ccdfbe7df2414c9c34011", + "0x995ff7de6181ddf95e3ead746089c6148da3508e4e7a2323c81785718b754d356789b902e7e78e2edc6b0cbd4ff22c78", + "0x944073d24750a9068cbd020b834afc72d2dde87efac04482b3287b40678ad07588519a4176b10f2172a2c463d063a5cd", + "0x99db4b1bb76475a6fd75289986ef40367960279524378cc917525fb6ba02a145a218c1e9caeb99332332ab486a125ac0", + "0x89fce4ecd420f8e477af4353b16faabb39e063f3f3c98fde2858b1f2d1ef6eed46f0975a7c08f233b97899bf60ccd60a", + "0x8c09a4f07a02b80654798bc63aada39fd638d3e3c4236ccd8a5ca280350c31e4a89e5f4c9aafb34116e71da18c1226b8", + "0x85325cfa7ded346cc51a2894257eab56e7488dbff504f10f99f4cd2b630d913003761a50f175ed167e8073f1b6b63fb0", + "0xb678b4fbec09a8cc794dcbca185f133578f29e354e99c05f6d07ac323be20aecb11f781d12898168e86f2e0f09aca15e", + "0xa249cfcbca4d9ba0a13b5f6aac72bf9b899adf582f9746bb2ad043742b28915607467eb794fca3704278f9136f7642be", + "0x9438e036c836a990c5e17af3d78367a75b23c37f807228362b4d13e3ddcb9e431348a7b552d09d11a2e9680704a4514f", + "0x925ab70450af28c21a488bfb5d38ac994f784cf249d7fd9ad251bb7fd897a23e23d2528308c03415074d43330dc37ef4", + "0xa290563904d5a8c0058fc8330120365bdd2ba1fdbaef7a14bc65d4961bb4217acfaed11ab82669e359531f8bf589b8db", + "0xa7e07a7801b871fc9b981a71e195a3b4ba6b6313bc132b04796a125157e78fe5c11a3a46cf731a255ac2d78a4ae78cd0", + "0xb26cd2501ee72718b0eebab6fb24d955a71f363f36e0f6dff0ab1d2d7836dab88474c0cef43a2cc32701fca7e82f7df3", + "0xa1dc3b6c968f3de00f11275092290afab65b2200afbcfa8ddc70e751fa19dbbc300445d6d479a81bda3880729007e496", + "0xa9bc213e28b630889476a095947d323b9ac6461dea726f2dc9084473ae8e196d66fb792a21905ad4ec52a6d757863e7d", + "0xb25d178df8c2df8051e7c888e9fa677fde5922e602a95e966db9e4a3d6b23ce043d7dc48a5b375c6b7c78e966893e8c3", + "0xa1c8d88d72303692eaa7adf68ea41de4febec40cc14ae551bb4012afd786d7b6444a3196b5d9d5040655a3366d96b7cd", + "0xb22bd44f9235a47118a9bbe2ba5a2ba9ec62476061be2e8e57806c1a17a02f9a51403e849e2e589520b759abd0117683", + "0xb8add766050c0d69fe81d8d9ea73e1ed05f0135d093ff01debd7247e42dbb86ad950aceb3b50b9af6cdc14ab443b238f", + "0xaf2cf95f30ef478f018cf81d70d47d742120b09193d8bb77f0d41a5d2e1a80bfb467793d9e2471b4e0ad0cb2c3b42271", + "0x8af5ef2107ad284e246bb56e20fef2a255954f72de791cbdfd3be09f825298d8466064f3c98a50496c7277af32b5c0bc", + "0x85dc19558572844c2849e729395a0c125096476388bd1b14fa7f54a7c38008fc93e578da3aac6a52ff1504d6ca82db05", + "0xae8c9b43c49572e2e166d704caf5b4b621a3b47827bb2a3bcd71cdc599bba90396fd9a405261b13e831bb5d44c0827d7", + "0xa7ba7efede25f02e88f6f4cbf70643e76784a03d97e0fbd5d9437c2485283ad7ca3abb638a5f826cd9f6193e5dec0b6c", + "0x94a9d122f2f06ef709fd8016fd4b712d88052245a65a301f5f177ce22992f74ad05552b1f1af4e70d1eac62cef309752", + "0x82d999b3e7cf563833b8bc028ff63a6b26eb357dfdb3fd5f10e33a1f80a9b2cfa7814d871b32a7ebfbaa09e753e37c02", + "0xaec6edcde234df502a3268dd2c26f4a36a2e0db730afa83173f9c78fcb2b2f75510a02b80194327b792811caefda2725", + "0x94c0bfa66c9f91d462e9194144fdd12d96f9bbe745737e73bab8130607ee6ea9d740e2cfcbbd00a195746edb6369ee61", + "0xab7573dab8c9d46d339e3f491cb2826cabe8b49f85f1ede78d845fc3995537d1b4ab85140b7d0238d9c24daf0e5e2a7e", + "0x87e8b16832843251fe952dadfd01d41890ed4bb4b8fa0254550d92c8cced44368225eca83a6c3ad47a7f81ff8a80c984", + "0x9189d2d9a7c64791b19c0773ad4f0564ce6bea94aa275a917f78ad987f150fdb3e5e26e7fef9982ac184897ecc04683f", + "0xb3661bf19e2da41415396ae4dd051a9272e8a2580b06f1a1118f57b901fa237616a9f8075af1129af4eabfefedbe2f1c", + "0xaf43c86661fb15daf5d910a4e06837225e100fb5680bd3e4b10f79a2144c6ec48b1f8d6e6b98e067d36609a5d038889a", + "0x82ac0c7acaa83ddc86c5b4249aae12f28155989c7c6b91e5137a4ce05113c6cbc16f6c44948b0efd8665362d3162f16a", + "0x8f268d1195ab465beeeb112cd7ffd5d5548559a8bc01261106d3555533fc1971081b25558d884d552df0db1cddda89d8", + "0x8ef7caa5521f3e037586ce8ac872a4182ee20c7921c0065ed9986c047e3dda08294da1165f385d008b40d500f07d895f", + "0x8c2f98f6880550573fad46075d3eba26634b5b025ce25a0b4d6e0193352c8a1f0661064027a70fe8190b522405f9f4e3", + "0xb7653f353564feb164f0f89ec7949da475b8dad4a4d396d252fc2a884f6932d027b7eb2dc4d280702c74569319ed701a", + "0xa026904f4066333befd9b87a8fad791d014096af60cdd668ef919c24dbe295ff31f7a790e1e721ba40cf5105abca67f4", + "0x988f982004ada07a22dd345f2412a228d7a96b9cae2c487de42e392afe1e35c2655f829ce07a14629148ce7079a1f142", + "0x9616add009067ed135295fb74d5b223b006b312bf14663e547a0d306694ff3a8a7bb9cfc466986707192a26c0bce599f", + "0xad4c425de9855f6968a17ee9ae5b15e0a5b596411388cf976df62ecc6c847a6e2ddb2cea792a5f6e9113c2445dba3e5c", + "0xb698ac9d86afa3dc69ff8375061f88e3b0cff92ff6dfe747cebaf142e813c011851e7a2830c10993b715e7fd594604a9", + "0xa386fa189847bb3b798efca917461e38ead61a08b101948def0f82cd258b945ed4d45b53774b400af500670149e601b7", + "0x905c95abda2c68a6559d8a39b6db081c68cef1e1b4be63498004e1b2f408409be9350b5b5d86a30fd443e2b3e445640a", + "0x9116dade969e7ce8954afcdd43e5cab64dc15f6c1b8da9d2d69de3f02ba79e6c4f6c7f54d6bf586d30256ae405cd1e41", + "0xa3084d173eacd08c9b5084a196719b57e47a0179826fda73466758235d7ecdb87cbcf097bd6b510517d163a85a7c7edd", + "0x85bb00415ad3c9be99ff9ba83672cc59fdd24356b661ab93713a3c8eab34e125d8867f628a3c3891b8dc056e69cd0e83", + "0x8d58541f9f39ed2ee4478acce5d58d124031338ec11b0d55551f00a5a9a6351faa903a5d7c132dc5e4bb026e9cbd18e4", + "0xa622adf72dc250e54f672e14e128c700166168dbe0474cecb340da175346e89917c400677b1bc1c11fcc4cc26591d9db", + "0xb3f865014754b688ca8372e8448114fff87bf3ca99856ab9168894d0c4679782c1ced703f5b74e851b370630f5e6ee86", + "0xa7e490b2c40c2446fcd91861c020da9742c326a81180e38110558bb5d9f2341f1c1885e79b364e6419023d1cbdc47380", + "0xb3748d472b1062e54572badbb8e87ac36534407f74932e7fc5b8392d008e8e89758f1671d1e4d30ab0fa40551b13bb5e", + "0x89898a5c5ec4313aabc607b0049fd1ebad0e0c074920cf503c9275b564d91916c2c446d3096491c950b7af3ac5e4b0ed", + "0x8eb8c83fef2c9dd30ea44e286e9599ec5c20aba983f702e5438afe2e5b921884327ad8d1566c72395587efac79ca7d56", + "0xb92479599e806516ce21fb0bd422a1d1d925335ebe2b4a0a7e044dd275f30985a72b97292477053ac5f00e081430da80", + "0xa34ae450a324fe8a3c25a4d653a654f9580ed56bbea213b8096987bbad0f5701d809a17076435e18017fea4d69f414bc", + "0x81381afe6433d62faf62ea488f39675e0091835892ecc238e02acf1662669c6d3962a71a3db652f6fe3bc5f42a0e5dc5", + "0xa430d475bf8580c59111103316fe1aa79c523ea12f1d47a976bbfae76894717c20220e31cf259f08e84a693da6688d70", + "0xb842814c359754ece614deb7d184d679d05d16f18a14b288a401cef5dad2cf0d5ee90bad487b80923fc5573779d4e4e8", + "0x971d9a2627ff2a6d0dcf2af3d895dfbafca28b1c09610c466e4e2bff2746f8369de7f40d65b70aed135fe1d72564aa88", + "0x8f4ce1c59e22b1ce7a0664caaa7e53735b154cfba8d2c5cc4159f2385843de82ab58ed901be876c6f7fce69cb4130950", + "0x86cc9dc321b6264297987000d344fa297ef45bcc2a4df04e458fe2d907ad304c0ea2318e32c3179af639a9a56f3263cf", + "0x8229e0876dfe8f665c3fb19b250bd89d40f039bbf1b331468b403655be7be2e104c2fd07b9983580c742d5462ca39a43", + "0x99299d73066e8eb128f698e56a9f8506dfe4bd014931e86b6b487d6195d2198c6c5bf15cccb40ccf1f8ddb57e9da44a2", + "0xa3a3be37ac554c574b393b2f33d0a32a116c1a7cfeaf88c54299a4da2267149a5ecca71f94e6c0ef6e2f472b802f5189", + "0xa91700d1a00387502cdba98c90f75fbc4066fefe7cc221c8f0e660994c936badd7d2695893fde2260c8c11d5bdcdd951", + "0x8e03cae725b7f9562c5c5ab6361644b976a68bada3d7ca508abca8dfc80a469975689af1fba1abcf21bc2a190dab397d", + "0xb01461ad23b2a8fa8a6d241e1675855d23bc977dbf4714add8c4b4b7469ccf2375cec20e80cedfe49361d1a30414ac5b", + "0xa2673bf9bc621e3892c3d7dd4f1a9497f369add8cbaa3472409f4f86bd21ac67cfac357604828adfee6ada1835365029", + "0xa042dff4bf0dfc33c178ba1b335e798e6308915128de91b12e5dbbab7c4ac8d60a01f6aea028c3a6d87b9b01e4e74c01", + "0x86339e8a75293e4b3ae66b5630d375736b6e6b6b05c5cda5e73fbf7b2f2bd34c18a1d6cefede08625ce3046e77905cb8", + "0xaf2ebe1b7d073d03e3d98bc61af83bf26f7a8c130fd607aa92b75db22d14d016481b8aa231e2c9757695f55b7224a27f", + "0xa00ee882c9685e978041fd74a2c465f06e2a42ffd3db659053519925be5b454d6f401e3c12c746e49d910e4c5c9c5e8c", + "0x978a781c0e4e264e0dad57e438f1097d447d891a1e2aa0d5928f79a9d5c3faae6f258bc94fdc530b7b2fa6a9932bb193", + "0xaa4b7ce2e0c2c9e9655bf21e3e5651c8503bce27483017b0bf476be743ba06db10228b3a4c721219c0779747f11ca282", + "0xb003d1c459dacbcf1a715551311e45d7dbca83a185a65748ac74d1800bbeaba37765d9f5a1a221805c571910b34ebca8", + "0x95b6e531b38648049f0d19de09b881baa1f7ea3b2130816b006ad5703901a05da57467d1a3d9d2e7c73fb3f2e409363c", + "0xa6cf9c06593432d8eba23a4f131bb7f72b9bd51ab6b4b772a749fe03ed72b5ced835a349c6d9920dba2a39669cb7c684", + "0xaa3d59f6e2e96fbb66195bc58c8704e139fa76cd15e4d61035470bd6e305db9f98bcbf61ac1b95e95b69ba330454c1b3", + "0xb57f97959c208361de6d7e86dff2b873068adb0f158066e646f42ae90e650079798f165b5cd713141cd3a2a90a961d9a", + "0xa76ee8ed9052f6a7a8c69774bb2597be182942f08115baba03bf8faaeaee526feba86120039fe8ca7b9354c3b6e0a8e6", + "0x95689d78c867724823f564627d22d25010f278674c6d2d0cdb10329169a47580818995d1d727ce46c38a1e47943ebb89", + "0xab676d2256c6288a88e044b3d9ffd43eb9d5aaee00e8fc60ac921395fb835044c71a26ca948e557fed770f52d711e057", + "0x96351c72785c32e5d004b6f4a1259fb8153d631f0c93fed172f18e8ba438fbc5585c1618deeabd0d6d0b82173c2e6170", + "0x93dd8d3db576418e22536eba45ab7f56967c6c97c64260d6cddf38fb19c88f2ec5cd0e0156f50e70855eee8a2b879ffd", + "0xad6ff16f40f6de3d7a737f8e6cebd8416920c4ff89dbdcd75eabab414af9a6087f83ceb9aff7680aa86bff98bd09c8cc", + "0x84de53b11671abc9c38710e19540c5c403817562aeb22a88404cdaff792c1180f717dbdfe8f54940c062c4d032897429", + "0x872231b9efa1cdd447b312099a5c164c560440a9441d904e70f5abfc3b2a0d16be9a01aca5e0a2599a61e19407587e3d", + "0x88f44ac27094a2aa14e9dc40b099ee6d68f97385950f303969d889ee93d4635e34dff9239103bdf66a4b7cbba3e7eb7a", + "0xa59afebadf0260e832f6f44468443562f53fbaf7bcb5e46e1462d3f328ac437ce56edbca617659ac9883f9e13261fad7", + "0xb1990e42743a88de4deeacfd55fafeab3bc380cb95de43ed623d021a4f2353530bcab9594389c1844b1c5ea6634c4555", + "0x85051e841149a10e83f56764e042182208591396d0ce78c762c4a413e6836906df67f38c69793e158d64fef111407ba3", + "0x9778172bbd9b1f2ec6bbdd61829d7b39a7df494a818e31c654bf7f6a30139899c4822c1bf418dd4f923243067759ce63", + "0x9355005b4878c87804fc966e7d24f3e4b02bed35b4a77369d01f25a3dcbff7621b08306b1ac85b76fe7b4a3eb5f839b1", + "0x8f9dc6a54fac052e236f8f0e1f571ac4b5308a43acbe4cc8183bce26262ddaf7994e41cf3034a4cbeca2c505a151e3b1", + "0x8cc59c17307111723fe313046a09e0e32ea0cce62c13814ab7c6408c142d6a0311d801be4af53fc9240523f12045f9ef", + "0x8e6057975ed40a1932e47dd3ac778f72ee2a868d8540271301b1aa6858de1a5450f596466494a3e0488be4fbeb41c840", + "0x812145efbd6559ae13325d56a15940ca4253b17e72a9728986b563bb5acc13ec86453796506ac1a8f12bd6f9e4a288c3", + "0x911da0a6d6489eb3dab2ec4a16e36127e8a291ae68a6c2c9de33e97f3a9b1f00da57a94e270a0de79ecc5ecb45d19e83", + "0xb72ea85973f4b2a7e6e71962b0502024e979a73c18a9111130e158541fa47bbaaf53940c8f846913a517dc69982ba9e1", + "0xa7a56ad1dbdc55f177a7ad1d0af78447dc2673291e34e8ab74b26e2e2e7d8c5fe5dc89e7ef60f04a9508847b5b3a8188", + "0xb52503f6e5411db5d1e70f5fb72ccd6463fa0f197b3e51ca79c7b5a8ab2e894f0030476ada72534fa4eb4e06c3880f90", + "0xb51c7957a3d18c4e38f6358f2237b3904618d58b1de5dec53387d25a63772e675a5b714ad35a38185409931157d4b529", + "0xb86b4266e719d29c043d7ec091547aa6f65bbf2d8d831d1515957c5c06513b72aa82113e9645ad38a7bc3f5383504fa6", + "0xb95b547357e6601667b0f5f61f261800a44c2879cf94e879def6a105b1ad2bbf1795c3b98a90d588388e81789bd02681", + "0xa58fd4c5ae4673fa350da6777e13313d5d37ed1dafeeb8f4f171549765b84c895875d9d3ae6a9741f3d51006ef81d962", + "0x9398dc348d078a604aadc154e6eef2c0be1a93bb93ba7fe8976edc2840a3a318941338cc4d5f743310e539d9b46613d2", + "0x902c9f0095014c4a2f0dccaaab543debba6f4cc82c345a10aaf4e72511725dbed7a34cd393a5f4e48a3e5142b7be84ed", + "0xa7c0447849bb44d04a0393a680f6cd390093484a79a147dd238f5d878030d1c26646d88211108e59fe08b58ad20c6fbd", + "0x80db045535d6e67a422519f5c89699e37098449d249698a7cc173a26ccd06f60238ae6cc7242eb780a340705c906790c", + "0x8e52b451a299f30124505de2e74d5341e1b5597bdd13301cc39b05536c96e4380e7f1b5c7ef076f5b3005a868657f17c", + "0x824499e89701036037571761e977654d2760b8ce21f184f2879fda55d3cda1e7a95306b8abacf1caa79d3cc075b9d27f", + "0x9049b956b77f8453d2070607610b79db795588c0cec12943a0f5fe76f358dea81e4f57a4692112afda0e2c05c142b26f", + "0x81911647d818a4b5f4990bfd4bc13bf7be7b0059afcf1b6839333e8569cdb0172fd2945410d88879349f677abaed5eb3", + "0xad4048f19b8194ed45b6317d9492b71a89a66928353072659f5ce6c816d8f21e69b9d1817d793effe49ca1874daa1096", + "0x8d22f7b2ddb31458661abd34b65819a374a1f68c01fc6c9887edeba8b80c65bceadb8f57a3eb686374004b836261ef67", + "0x92637280c259bc6842884db3d6e32602a62252811ae9b019b3c1df664e8809ffe86db88cfdeb8af9f46435c9ee790267", + "0xa2f416379e52e3f5edc21641ea73dc76c99f7e29ea75b487e18bd233856f4c0183429f378d2bfc6cd736d29d6cadfa49", + "0x882cb6b76dbdc188615dcf1a8439eba05ffca637dd25197508156e03c930b17b9fed2938506fdd7b77567cb488f96222", + "0xb68b621bb198a763fb0634eddb93ed4b5156e59b96c88ca2246fd1aea3e6b77ed651e112ac41b30cd361fadc011d385e", + "0xa3cb22f6b675a29b2d1f827cacd30df14d463c93c3502ef965166f20d046af7f9ab7b2586a9c64f4eae4fad2d808a164", + "0x8302d9ce4403f48ca217079762ce42cee8bc30168686bb8d3a945fbd5acd53b39f028dce757b825eb63af2d5ae41169d", + "0xb2eef1fbd1a176f1f4cd10f2988c7329abe4eb16c7405099fb92baa724ab397bc98734ef7d4b24c0f53dd90f57520d04", + "0xa1bbef0bd684a3f0364a66bde9b29326bac7aa3dde4caed67f14fb84fed3de45c55e406702f1495a3e2864d4ee975030", + "0x976acdb0efb73e3a3b65633197692dedc2adaed674291ae3df76b827fc866d214e9cac9ca46baefc4405ff13f953d936", + "0xb9fbf71cc7b6690f601f0b1c74a19b7d14254183a2daaafec7dc3830cba5ae173d854bbfebeca985d1d908abe5ef0cda", + "0x90591d7b483598c94e38969c4dbb92710a1a894bcf147807f1bcbd8aa3ac210b9f2be65519aa829f8e1ccdc83ad9b8cf", + "0xa30568577c91866b9c40f0719d46b7b3b2e0b4a95e56196ac80898a2d89cc67880e1229933f2cd28ee3286f8d03414d7", + "0x97589a88c3850556b359ec5e891f0937f922a751ac7c95949d3bbc7058c172c387611c0f4cb06351ef02e5178b3dd9e4", + "0x98e7bbe27a1711f4545df742f17e3233fbcc63659d7419e1ca633f104cb02a32c84f2fac23ca2b84145c2672f68077ab", + "0xa7ddb91636e4506d8b7e92aa9f4720491bb71a72dadc47c7f4410e15f93e43d07d2b371951a0e6a18d1bd087aa96a5c4", + "0xa7c006692227a06db40bceac3d5b1daae60b5692dd9b54772bedb5fea0bcc91cbcdb530cac31900ffc70c5b3ffadc969", + "0x8d3ec6032778420dfa8be52066ba0e623467df33e4e1901dbadd586c5d750f4ccde499b5197e26b9ea43931214060f69", + "0x8d9a8410518ea64f89df319bfd1fc97a0971cdb9ad9b11d1f8fe834042ea7f8dce4db56eeaf179ff8dda93b6db93e5ce", + "0xa3c533e9b3aa04df20b9ff635cb1154ce303e045278fcf3f10f609064a5445552a1f93989c52ce852fd0bbd6e2b6c22e", + "0x81934f3a7f8c1ae60ec6e4f212986bcc316118c760a74155d06ce0a8c00a9b9669ec4e143ca214e1b995e41271774fd9", + "0xab8e2d01a71192093ef8fafa7485e795567cc9db95a93fb7cc4cf63a391ef89af5e2bfad4b827fffe02b89271300407f", + "0x83064a1eaa937a84e392226f1a60b7cfad4efaa802f66de5df7498962f7b2649924f63cd9962d47906380b97b9fe80e1", + "0xb4f5e64a15c6672e4b55417ee5dc292dcf93d7ea99965a888b1cc4f5474a11e5b6520eacbcf066840b343f4ceeb6bf33", + "0xa63d278b842456ef15c278b37a6ea0f27c7b3ffffefca77c7a66d2ea06c33c4631eb242bbb064d730e70a8262a7b848a", + "0x83a41a83dbcdf0d22dc049de082296204e848c453c5ab1ba75aa4067984e053acf6f8b6909a2e1f0009ed051a828a73b", + "0x819485b036b7958508f15f3c19436da069cbe635b0318ebe8c014cf1ef9ab2df038c81161b7027475bcfa6fff8dd9faf", + "0xaa40e38172806e1e045e167f3d1677ef12d5dcdc89b43639a170f68054bd196c4fae34c675c1644d198907a03f76ba57", + "0x969bae484883a9ed1fbed53b26b3d4ee4b0e39a6c93ece5b3a49daa01444a1c25727dabe62518546f36b047b311b177c", + "0x80a9e73a65da99664988b238096a090d313a0ee8e4235bc102fa79bb337b51bb08c4507814eb5baec22103ec512eaab0", + "0x86604379aec5bddda6cbe3ef99c0ac3a3c285b0b1a15b50451c7242cd42ae6b6c8acb717dcca7917838432df93a28502", + "0xa23407ee02a495bed06aa7e15f94cfb05c83e6d6fba64456a9bbabfa76b2b68c5c47de00ba169e710681f6a29bb41a22", + "0x98cff5ecc73b366c6a01b34ac9066cb34f7eeaf4f38a5429bad2d07e84a237047e2a065c7e8a0a6581017dadb4695deb", + "0x8de9f68a938f441f3b7ab84bb1f473c5f9e5c9e139e42b7ccee1d254bd57d0e99c2ccda0f3198f1fc5737f6023dd204e", + "0xb0ce48d815c2768fb472a315cad86aa033d0e9ca506f146656e2941829e0acb735590b4fbc713c2d18d3676db0a954ac", + "0x82f485cdefd5642a6af58ac6817991c49fac9c10ace60f90b27f1788cc026c2fe8afc83cf499b3444118f9f0103598a8", + "0x82c24550ed512a0d53fc56f64cc36b553823ae8766d75d772dacf038c460f16f108f87a39ceef7c66389790f799dbab3", + "0x859ffcf1fe9166388316149b9acc35694c0ea534d43f09dae9b86f4aa00a23b27144dda6a352e74b9516e8c8d6fc809c", + "0xb8f7f353eec45da77fb27742405e5ad08d95ec0f5b6842025be9def3d9892f85eb5dd0921b41e6eff373618dba215bca", + "0x8ccca4436f9017e426229290f5cd05eac3f16571a4713141a7461acfe8ae99cd5a95bf5b6df129148693c533966145da", + "0xa2c67ecc19c0178b2994846fea4c34c327a5d786ac4b09d1d13549d5be5996d8a89021d63d65cb814923388f47cc3a03", + "0xaa0ff87d676b418ec08f5cbf577ac7e744d1d0e9ebd14615b550eb86931eafd2a36d4732cc5d6fab1713fd7ab2f6f7c0", + "0x8aef4730bb65e44efd6bb9441c0ae897363a2f3054867590a2c2ecf4f0224e578c7a67f10b40f8453d9f492ac15a9b2d", + "0x86a187e13d8fba5addcfdd5b0410cedd352016c930f913addd769ee09faa6be5ca3e4b1bdb417a965c643a99bd92be42", + "0xa0a4e9632a7a094b14b29b78cd9c894218cdf6783e61671e0203865dc2a835350f465fbaf86168f28af7c478ca17bc89", + "0xa8c7b02d8deff2cd657d8447689a9c5e2cd74ef57c1314ac4d69084ac24a7471954d9ff43fe0907d875dcb65fd0d3ce5", + "0x97ded38760aa7be6b6960b5b50e83b618fe413cbf2bcc1da64c05140bcc32f5e0e709cd05bf8007949953fac5716bad9", + "0xb0d293835a24d64c2ae48ce26e550b71a8c94a0883103757fb6b07e30747f1a871707d23389ba2b2065fa6bafe220095", + "0x8f9e291bf849feaa575592e28e3c8d4b7283f733d41827262367ea1c40f298c7bcc16505255a906b62bf15d9f1ba85fb", + "0x998f4e2d12708b4fd85a61597ca2eddd750f73c9e0c9b3cf0825d8f8e01f1628fd19797dcaed3b16dc50331fc6b8b821", + "0xb30d1f8c115d0e63bf48f595dd10908416774c78b3bbb3194192995154d80ea042d2e94d858de5f8aa0261b093c401fd", + "0xb5d9c75bb41f964cbff3f00e96d9f1480c91df8913f139f0d385d27a19f57a820f838eb728e46823cbff00e21c660996", + "0xa6edec90b5d25350e2f5f0518777634f9e661ec9d30674cf5b156c4801746d62517751d90074830ac0f4b09911c262f1", + "0x82f98da1264b6b75b8fbeb6a4d96d6a05b25c24db0d57ba3a38efe3a82d0d4e331b9fc4237d6494ccfe4727206457519", + "0xb89511843453cf4ecd24669572d6371b1e529c8e284300c43e0d5bb6b3aaf35aeb634b3cb5c0a2868f0d5e959c1d0772", + "0xa82bf065676583e5c1d3b81987aaae5542f522ba39538263a944bb33ea5b514c649344a96c0205a3b197a3f930fcda6c", + "0xa37b47ea527b7e06c460776aa662d9a49ff4149d3993f1a974b0dd165f7171770d189b0e2ea54fd5fccb6a14b116e68a", + "0xa1017677f97dda818274d47556d09d0e4ccacb23a252f82a6cfe78c630ad46fb9806307445a59fb61262182de3a2b29c", + "0xb01e9fcac239ba270e6877b79273ddd768bf8a51d2ed8a051b1c11e18eff3de5920e2fcbfbd26f06d381eddd3b1f1e1b", + "0x82fcd53d803b1c8e4ed76adc339b7f3a5962d37042b9683aabac7513ac68775d4a566a9460183926a6a95dbe7d551a1f", + "0xa763e78995d55cd21cdb7ef75d9642d6e1c72453945e346ab6690c20a4e1eeec61bb848ef830ae4b56182535e3c71d8f", + "0xb769f4db602251d4b0a1186782799bdcef66de33c110999a5775c50b349666ffd83d4c89714c4e376f2efe021a5cfdb2", + "0xa59cbd1b785efcfa6e83fc3b1d8cf638820bc0c119726b5368f3fba9dce8e3414204fb1f1a88f6c1ff52e87961252f97", + "0x95c8c458fd01aa23ecf120481a9c6332ebec2e8bb70a308d0576926a858457021c277958cf79017ddd86a56cacc2d7db", + "0x82eb41390800287ae56e77f2e87709de5b871c8bdb67c10a80fc65f3acb9f7c29e8fa43047436e8933f27449ea61d94d", + "0xb3ec25e3545eb83aed2a1f3558d1a31c7edde4be145ecc13b33802654b77dc049b4f0065069dd9047b051e52ab11dcdd", + "0xb78a0c715738f56f0dc459ab99e252e3b579b208142836b3c416b704ca1de640ca082f29ebbcee648c8c127df06f6b1e", + "0xa4083149432eaaf9520188ebf4607d09cf664acd1f471d4fb654476e77a9eaae2251424ffda78d09b6cb880df35c1219", + "0x8c52857d68d6e9672df3db2df2dbf46b516a21a0e8a18eec09a6ae13c1ef8f369d03233320dd1c2c0bbe00abfc1ea18b", + "0x8c856089488803066bff3f8d8e09afb9baf20cecc33c8823c1c0836c3d45498c3de37e87c016b705207f60d2b00f8609", + "0x831a3df39be959047b2aead06b4dcd3012d7b29417f642b83c9e8ce8de24a3dbbd29c6fdf55e2db3f7ea04636c94e403", + "0xaed84d009f66544addabe404bf6d65af7779ce140dc561ff0c86a4078557b96b2053b7b8a43432ffb18cd814f143b9da", + "0x93282e4d72b0aa85212a77b336007d8ba071eea17492da19860f1ad16c1ea8867ccc27ef5c37c74b052465cc11ea4f52", + "0xa7b78b8c8d057194e8d68767f1488363f77c77bddd56c3da2bc70b6354c7aa76247c86d51f7371aa38a4aa7f7e3c0bb7", + "0xb1c77283d01dcd1bde649b5b044eac26befc98ff57cbee379fb5b8e420134a88f2fc7f0bf04d15e1fbd45d29e7590fe6", + "0xa4aa8de70330a73b2c6458f20a1067eed4b3474829b36970a8df125d53bbdda4f4a2c60063b7cccb0c80fc155527652f", + "0x948a6c79ba1b8ad7e0bed2fae2f0481c4e41b4d9bbdd9b58164e28e9065700e83f210c8d5351d0212e0b0b68b345b3a5", + "0x86a48c31dcbbf7b082c92d28e1f613a2378a910677d7db3a349dc089e4a1e24b12eee8e8206777a3a8c64748840b7387", + "0x976adb1af21e0fc34148917cf43d933d7bfd3fd12ed6c37039dcd5a4520e3c6cf5868539ba5bf082326430deb8a4458d", + "0xb93e1a4476f2c51864bb4037e7145f0635eb2827ab91732b98d49b6c07f6ac443111aa1f1da76d1888665cb897c3834e", + "0x8afd46fb23bf869999fa19784b18a432a1f252d09506b8dbb756af900518d3f5f244989b3d7c823d9029218c655d3dc6", + "0x83f1e59e3abeed18cdc632921672673f1cb6e330326e11c4e600e13e0d5bc11bdc970ae12952e15103a706fe720bf4d6", + "0x90ce4cc660714b0b673d48010641c09c00fc92a2c596208f65c46073d7f349dd8e6e077ba7dcef9403084971c3295b76", + "0x8b09b0f431a7c796561ecf1549b85048564de428dac0474522e9558b6065fede231886bc108539c104ce88ebd9b5d1b0", + "0x85d6e742e2fb16a7b0ba0df64bc2c0dbff9549be691f46a6669bca05e89c884af16822b85faefefb604ec48c8705a309", + "0xa87989ee231e468a712c66513746fcf03c14f103aadca0eac28e9732487deb56d7532e407953ab87a4bf8961588ef7b0", + "0xb00da10efe1c29ee03c9d37d5918e391ae30e48304e294696b81b434f65cf8c8b95b9d1758c64c25e534d045ba28696f", + "0x91c0e1fb49afe46c7056400baa06dbb5f6e479db78ee37e2d76c1f4e88994357e257b83b78624c4ef6091a6c0eb8254d", + "0x883fb797c498297ccbf9411a3e727c3614af4eccde41619b773dc7f3259950835ee79453debf178e11dec4d3ada687a0", + "0xa14703347e44eb5059070b2759297fcfcfc60e6893c0373eea069388eba3950aa06f1c57cd2c30984a2d6f9e9c92c79e", + "0xafebc7585b304ceba9a769634adff35940e89cd32682c78002822aab25eec3edc29342b7f5a42a56a1fec67821172ad5", + "0xaea3ff3822d09dba1425084ca95fd359718d856f6c133c5fabe2b2eed8303b6e0ba0d8698b48b93136a673baac174fd9", + "0xaf2456a09aa777d9e67aa6c7c49a1845ea5cdda2e39f4c935c34a5f8280d69d4eec570446998cbbe31ede69a91e90b06", + "0x82cada19fed16b891ef3442bafd49e1f07c00c2f57b2492dd4ee36af2bd6fd877d6cb41188a4d6ce9ec8d48e8133d697", + "0x82a21034c832287f616619a37c122cee265cc34ae75e881fcaea4ea7f689f3c2bc8150bbf7dbcfd123522bfb7f7b1d68", + "0x86877217105f5d0ec3eeff0289fc2a70d505c9fdf7862e8159553ef60908fb1a27bdaf899381356a4ef4649072a9796c", + "0x82b196e49c6e861089a427c0b4671d464e9d15555ffb90954cd0d630d7ae02eb3d98ceb529d00719c2526cd96481355a", + "0xa29b41d0d43d26ce76d4358e0db2b77df11f56e389f3b084d8af70a636218bd3ac86b36a9fe46ec9058c26a490f887f7", + "0xa4311c4c20c4d7dd943765099c50f2fd423e203ccfe98ff00087d205467a7873762510cac5fdce7a308913ed07991ed7", + "0xb1f040fc5cc51550cb2c25cf1fd418ecdd961635a11f365515f0cb4ffb31da71f48128c233e9cc7c0cf3978d757ec84e", + "0xa9ebae46f86d3bd543c5f207ed0d1aed94b8375dc991161d7a271f01592912072e083e2daf30c146430894e37325a1b9", + "0x826418c8e17ad902b5fe88736323a47e0ca7a44bce4cbe27846ec8fe81de1e8942455dda6d30e192cdcc73e11df31256", + "0x85199db563427c5edcbac21f3d39fec2357be91fb571982ddcdc4646b446ad5ced84410de008cb47b3477ee0d532daf8", + "0xb7eed9cd400b2ca12bf1d9ae008214b8561fb09c8ad9ff959e626ffde00fee5ff2f5b6612e231f2a1a9b1646fcc575e3", + "0x8b40bf12501dcbac78f5a314941326bfcddf7907c83d8d887d0bb149207f85d80cd4dfbd7935439ea7b14ea39a3fded7", + "0x83e3041af302485399ba6cd5120e17af61043977083887e8d26b15feec4a6b11171ac5c06e6ad0971d4b58a81ff12af3", + "0x8f5b9a0eecc589dbf8c35a65d5e996a659277ef6ea509739c0cb7b3e2da9895e8c8012de662e5b23c5fa85d4a8f48904", + "0x835d71ed5e919d89d8e6455f234f3ff215462c4e3720c371ac8c75e83b19dfe3ae15a81547e4dc1138e5f5997f413cc9", + "0x8b7d2e4614716b1db18e9370176ea483e6abe8acdcc3dcdf5fb1f4d22ca55d652feebdccc171c6de38398d9f7bfdec7a", + "0x93eace72036fe57d019676a02acf3d224cf376f166658c1bf705db4f24295881d477d6fdd7916efcfceff8c7a063deda", + "0xb1ac460b3d516879a84bc886c54f020a9d799e7c49af3e4d7de5bf0d2793c852254c5d8fe5616147e6659512e5ccb012", + "0xacd0947a35cb167a48bcd9667620464b54ac0e78f9316b4aa92dcaab5422d7a732087e52e1c827faa847c6b2fe6e7766", + "0x94ac33d21c3d12ff762d32557860e911cd94d666609ddcc42161b9c16f28d24a526e8b10bb03137257a92cec25ae637d", + "0x832e02058b6b994eadd8702921486241f9a19e68ed1406dad545e000a491ae510f525ccf9d10a4bba91c68f2c53a0f58", + "0x9471035d14f78ff8f463b9901dd476b587bb07225c351161915c2e9c6114c3c78a501379ab6fb4eb03194c457cbd22bf", + "0xab64593e034c6241d357fcbc32d8ea5593445a5e7c24cac81ad12bd2ef01843d477a36dc1ba21dbe63b440750d72096a", + "0x9850f3b30045e927ad3ec4123a32ed2eb4c911f572b6abb79121873f91016f0d80268de8b12e2093a4904f6e6cab7642", + "0x987212c36b4722fe2e54fa30c52b1e54474439f9f35ca6ad33c5130cd305b8b54b532dd80ffd2c274105f20ce6d79f6e", + "0x8b4d0c6abcb239b5ed47bef63bc17efe558a27462c8208fa652b056e9eae9665787cd1aee34fbb55beb045c8bfdb882b", + "0xa9f3483c6fee2fe41312d89dd4355d5b2193ac413258993805c5cbbf0a59221f879386d3e7a28e73014f10e65dd503d9", + "0xa2225da3119b9b7c83d514b9f3aeb9a6d9e32d9cbf9309cbb971fd53c4b2c001d10d880a8ad8a7c281b21d85ceca0b7c", + "0xa050be52e54e676c151f7a54453bbb707232f849beab4f3bf504b4d620f59ed214409d7c2bd3000f3ff13184ccda1c35", + "0xadbccf681e15b3edb6455a68d292b0a1d0f5a4cb135613f5e6db9943f02181341d5755875db6ee474e19ace1c0634a28", + "0x8b6eff675632a6fad0111ec72aacc61c7387380eb87933fd1d098856387d418bd38e77d897e65d6fe35951d0627c550b", + "0xaabe2328ddf90989b15e409b91ef055cb02757d34987849ae6d60bef2c902bf8251ed21ab30acf39e500d1d511e90845", + "0x92ba4eb1f796bc3d8b03515f65c045b66e2734c2da3fc507fdd9d6b5d1e19ab3893726816a32141db7a31099ca817d96", + "0x8a98b3cf353138a1810beb60e946183803ef1d39ac4ea92f5a1e03060d35a4774a6e52b14ead54f6794d5f4022b8685c", + "0x909f8a5c13ec4a59b649ed3bee9f5d13b21d7f3e2636fd2bb3413c0646573fdf9243d63083356f12f5147545339fcd55", + "0x9359d914d1267633141328ed0790d81c695fea3ddd2d406c0df3d81d0c64931cf316fe4d92f4353c99ff63e2aefc4e34", + "0xb88302031681b54415fe8fbfa161c032ea345c6af63d2fb8ad97615103fd4d4281c5a9cae5b0794c4657b97571a81d3b", + "0x992c80192a519038082446b1fb947323005b275e25f2c14c33cc7269e0ec038581cc43705894f94bad62ae33a8b7f965", + "0xa78253e3e3eece124bef84a0a8807ce76573509f6861d0b6f70d0aa35a30a123a9da5e01e84969708c40b0669eb70aa6", + "0x8d5724de45270ca91c94792e8584e676547d7ac1ac816a6bb9982ee854eb5df071d20545cdfd3771cd40f90e5ba04c8e", + "0x825a6f586726c68d45f00ad0f5a4436523317939a47713f78fd4fe81cd74236fdac1b04ecd97c2d0267d6f4981d7beb1" + ], + "g2_monomial": [ + "0x93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8", + "0xb5bfd7dd8cdeb128843bc287230af38926187075cbfbefa81009a2ce615ac53d2914e5870cb452d2afaaab24f3499f72185cbfee53492714734429b7b38608e23926c911cceceac9a36851477ba4c60b087041de621000edc98edada20c1def2", + "0xb5337ba0ce5d37224290916e268e2060e5c14f3f9fc9e1ec3af5a958e7a0303122500ce18f1a4640bf66525bd10e763501fe986d86649d8d45143c08c3209db3411802c226e9fe9a55716ac4a0c14f9dcef9e70b2bb309553880dc5025eab3cc", + "0xb3c1dcdc1f62046c786f0b82242ef283e7ed8f5626f72542aa2c7a40f14d9094dd1ebdbd7457ffdcdac45fd7da7e16c51200b06d791e5e43e257e45efdf0bd5b06cd2333beca2a3a84354eb48662d83aef5ecf4e67658c851c10b13d8d87c874", + "0x954d91c7688983382609fca9e211e461f488a5971fd4e40d7e2892037268eacdfd495cfa0a7ed6eb0eb11ac3ae6f651716757e7526abe1e06c64649d80996fd3105c20c4c94bc2b22d97045356fe9d791f21ea6428ac48db6f9e68e30d875280", + "0x88a6b6bb26c51cf9812260795523973bb90ce80f6820b6c9048ab366f0fb96e48437a7f7cb62aedf64b11eb4dfefebb0147608793133d32003cb1f2dc47b13b5ff45f1bb1b2408ea45770a08dbfaec60961acb8119c47b139a13b8641e2c9487", + "0x85cd7be9728bd925d12f47fb04b32d9fad7cab88788b559f053e69ca18e463113ecc8bbb6dbfb024835f901b3a957d3108d6770fb26d4c8be0a9a619f6e3a4bf15cbfd48e61593490885f6cee30e4300c5f9cf5e1c08e60a2d5b023ee94fcad0", + "0x80477dba360f04399821a48ca388c0fa81102dd15687fea792ee8c1114e00d1bc4839ad37ac58900a118d863723acfbe08126ea883be87f50e4eabe3b5e72f5d9e041db8d9b186409fd4df4a7dde38c0e0a3b1ae29b098e5697e7f110b6b27e4", + "0xb7a6aec08715a9f8672a2b8c367e407be37e59514ac19dd4f0942a68007bba3923df22da48702c63c0d6b3efd3c2d04e0fe042d8b5a54d562f9f33afc4865dcbcc16e99029e25925580e87920c399e710d438ac1ce3a6dc9b0d76c064a01f6f7", + "0xac1b001edcea02c8258aeffbf9203114c1c874ad88dae1184fadd7d94cd09053649efd0ca413400e6e9b5fa4eac33261000af88b6bd0d2abf877a4f0355d2fb4d6007adb181695201c5432e50b850b51b3969f893bddf82126c5a71b042b7686", + "0x90043fda4de53fb364fab2c04be5296c215599105ecff0c12e4917c549257125775c29f2507124d15f56e30447f367db0596c33237242c02d83dfd058735f1e3c1ff99069af55773b6d51d32a68bf75763f59ec4ee7267932ae426522b8aaab6", + "0xa8660ce853e9dc08271bf882e29cd53397d63b739584dda5263da4c7cc1878d0cf6f3e403557885f557e184700575fee016ee8542dec22c97befe1d10f414d22e84560741cdb3e74c30dda9b42eeaaf53e27822de2ee06e24e912bf764a9a533", + "0x8fe3921a96d0d065e8aa8fce9aa42c8e1461ca0470688c137be89396dd05103606dab6cdd2a4591efd6addf72026c12e065da7be276dee27a7e30afa2bd81c18f1516e7f068f324d0bad9570b95f6bd02c727cd2343e26db0887c3e4e26dceda", + "0x8ae1ad97dcb9c192c9a3933541b40447d1dc4eebf380151440bbaae1e120cc5cdf1bcea55180b128d8e180e3af623815191d063cc0d7a47d55fb7687b9d87040bf7bc1a7546b07c61db5ccf1841372d7c2fe4a5431ffff829f3c2eb590b0b710", + "0x8c2fa96870a88150f7876c931e2d3cc2adeaaaf5c73ef5fa1cf9dfa0991ae4819f9321af7e916e5057d87338e630a2f21242c29d76963cf26035b548d2a63d8ad7bd6efefa01c1df502cbdfdfe0334fb21ceb9f686887440f713bf17a89b8081", + "0xb9aa98e2f02bb616e22ee5dd74c7d1049321ac9214d093a738159850a1dbcc7138cb8d26ce09d8296368fd5b291d74fa17ac7cc1b80840fdd4ee35e111501e3fa8485b508baecda7c1ab7bd703872b7d64a2a40b3210b6a70e8a6ffe0e5127e3", + "0x9292db67f8771cdc86854a3f614a73805bf3012b48f1541e704ea4015d2b6b9c9aaed36419769c87c49f9e3165f03edb159c23b3a49c4390951f78e1d9b0ad997129b17cdb57ea1a6638794c0cca7d239f229e589c5ae4f9fe6979f7f8cba1d7", + "0x91cd9e86550f230d128664f7312591fee6a84c34f5fc7aed557bcf986a409a6de722c4330453a305f06911d2728626e611acfdf81284f77f60a3a1595053a9479964fd713117e27c0222cc679674b03bc8001501aaf9b506196c56de29429b46", + "0xa9516b73f605cc31b89c68b7675dc451e6364595243d235339437f556cf22d745d4250c1376182273be2d99e02c10eee047410a43eff634d051aeb784e76cb3605d8e079b9eb6ad1957dfdf77e1cd32ce4a573c9dfcc207ca65af6eb187f6c3d", + "0xa9667271f7d191935cc8ad59ef3ec50229945faea85bfdfb0d582090f524436b348aaa0183b16a6231c00332fdac2826125b8c857a2ed9ec66821cfe02b3a2279be2412441bc2e369b255eb98614e4be8490799c4df22f18d47d24ec70bba5f7", + "0xa4371144d2aa44d70d3cb9789096d3aa411149a6f800cb46f506461ee8363c8724667974252f28aea61b6030c05930ac039c1ee64bb4bd56532a685cae182bf2ab935eee34718cffcb46cae214c77aaca11dbb1320faf23c47247db1da04d8dc", + "0x89a7eb441892260b7e81168c386899cd84ffc4a2c5cad2eae0d1ab9e8b5524662e6f660fe3f8bfe4c92f60b060811bc605b14c5631d16709266886d7885a5eb5930097127ec6fb2ebbaf2df65909cf48f253b3d5e22ae48d3e9a2fd2b01f447e", + "0x9648c42ca97665b5eccb49580d8532df05eb5a68db07f391a2340769b55119eaf4c52fe4f650c09250fa78a76c3a1e271799b8333cc2628e3d4b4a6a3e03da1f771ecf6516dd63236574a7864ff07e319a6f11f153406280d63af9e2b5713283", + "0x9663bf6dd446ea7a90658ee458578d4196dc0b175ef7fcfa75f44d41670850774c2e46c5a6be132a2c072a3c0180a24f0305d1acac49d2d79878e5cda80c57feda3d01a6af12e78b5874e2a4b3717f11c97503b41a4474e2e95b179113726199", + "0xb212aeb4814e0915b432711b317923ed2b09e076aaf558c3ae8ef83f9e15a83f9ea3f47805b2750ab9e8106cb4dc6ad003522c84b03dc02829978a097899c773f6fb31f7fe6b8f2d836d96580f216fec20158f1590c3e0d7850622e15194db05", + "0x925f005059bf07e9ceccbe66c711b048e236ade775720d0fe479aebe6e23e8af281225ad18e62458dc1b03b42ad4ca290d4aa176260604a7aad0d9791337006fbdebe23746f8060d42876f45e4c83c3643931392fde1cd13ff8bddf8111ef974", + "0x9553edb22b4330c568e156a59ef03b26f5c326424f830fe3e8c0b602f08c124730ffc40bc745bec1a22417adb22a1a960243a10565c2be3066bfdb841d1cd14c624cd06e0008f4beb83f972ce6182a303bee3fcbcabc6cfe48ec5ae4b7941bfc", + "0x935f5a404f0a78bdcce709899eda0631169b366a669e9b58eacbbd86d7b5016d044b8dfc59ce7ed8de743ae16c2343b50e2f925e88ba6319e33c3fc76b314043abad7813677b4615c8a97eb83cc79de4fedf6ccbcfa4d4cbf759a5a84e4d9742", + "0xa5b014ab936eb4be113204490e8b61cd38d71da0dec7215125bcd131bf3ab22d0a32ce645bca93e7b3637cf0c2db3d6601a0ddd330dc46f9fae82abe864ffc12d656c88eb50c20782e5bb6f75d18760666f43943abb644b881639083e122f557", + "0x935b7298ae52862fa22bf03bfc1795b34c70b181679ae27de08a9f5b4b884f824ef1b276b7600efa0d2f1d79e4a470d51692fd565c5cf8343dd80e5d3336968fc21c09ba9348590f6206d4424eb229e767547daefa98bc3aa9f421158dee3f2a", + "0x9830f92446e708a8f6b091cc3c38b653505414f8b6507504010a96ffda3bcf763d5331eb749301e2a1437f00e2415efb01b799ad4c03f4b02de077569626255ac1165f96ea408915d4cf7955047620da573e5c439671d1fa5c833fb11de7afe6", + "0x840dcc44f673fff3e387af2bb41e89640f2a70bcd2b92544876daa92143f67c7512faf5f90a04b7191de01f3e2b1bde00622a20dc62ca23bbbfaa6ad220613deff43908382642d4d6a86999f662efd64b1df448b68c847cfa87630a3ffd2ec76", + "0x92950c895ed54f7f876b2fda17ecc9c41b7accfbdd42c210cc5b475e0737a7279f558148531b5c916e310604a1de25a80940c94fe5389ae5d6a5e9c371be67bceea1877f5401725a6595bcf77ece60905151b6dfcb68b75ed2e708c73632f4fd", + "0x8010246bf8e94c25fd029b346b5fbadb404ef6f44a58fd9dd75acf62433d8cc6db66974f139a76e0c26dddc1f329a88214dbb63276516cf325c7869e855d07e0852d622c332ac55609ba1ec9258c45746a2aeb1af0800141ee011da80af175d4", + "0xb0f1bad257ebd187bdc3f37b23f33c6a5d6a8e1f2de586080d6ada19087b0e2bf23b79c1b6da1ee82271323f5bdf3e1b018586b54a5b92ab6a1a16bb3315190a3584a05e6c37d5ca1e05d702b9869e27f513472bcdd00f4d0502a107773097da", + "0x9636d24f1ede773ce919f309448dd7ce023f424afd6b4b69cb98c2a988d849a283646dc3e469879daa1b1edae91ae41f009887518e7eb5578f88469321117303cd3ac2d7aee4d9cb5f82ab9ae3458e796dfe7c24284b05815acfcaa270ff22e2", + "0xb373feb5d7012fd60578d7d00834c5c81df2a23d42794fed91aa9535a4771fde0341c4da882261785e0caca40bf83405143085e7f17e55b64f6c5c809680c20b050409bf3702c574769127c854d27388b144b05624a0e24a1cbcc4d08467005b", + "0xb15680648949ce69f82526e9b67d9b55ce5c537dc6ab7f3089091a9a19a6b90df7656794f6edc87fb387d21573ffc847062623685931c2790a508cbc8c6b231dd2c34f4d37d4706237b1407673605a604bcf6a50cc0b1a2db20485e22b02c17e", + "0x8817e46672d40c8f748081567b038a3165f87994788ec77ee8daea8587f5540df3422f9e120e94339be67f186f50952504cb44f61e30a5241f1827e501b2de53c4c64473bcc79ab887dd277f282fbfe47997a930dd140ac08b03efac88d81075", + "0xa6e4ef6c1d1098f95aae119905f87eb49b909d17f9c41bcfe51127aa25fee20782ea884a7fdf7d5e9c245b5a5b32230b07e0dbf7c6743bf52ee20e2acc0b269422bd6cf3c07115df4aa85b11b2c16630a07c974492d9cdd0ec325a3fabd95044", + "0x8634aa7c3d00e7f17150009698ce440d8e1b0f13042b624a722ace68ead870c3d2212fbee549a2c190e384d7d6ac37ce14ab962c299ea1218ef1b1489c98906c91323b94c587f1d205a6edd5e9d05b42d591c26494a6f6a029a2aadb5f8b6f67", + "0x821a58092900bdb73decf48e13e7a5012a3f88b06288a97b855ef51306406e7d867d613d9ec738ebacfa6db344b677d21509d93f3b55c2ebf3a2f2a6356f875150554c6fff52e62e3e46f7859be971bf7dd9d5b3e1d799749c8a97c2e04325df", + "0x8dba356577a3a388f782e90edb1a7f3619759f4de314ad5d95c7cc6e197211446819c4955f99c5fc67f79450d2934e3c09adefc91b724887e005c5190362245eec48ce117d0a94d6fa6db12eda4ba8dde608fbbd0051f54dcf3bb057adfb2493", + "0xa32a690dc95c23ed9fb46443d9b7d4c2e27053a7fcc216d2b0020a8cf279729c46114d2cda5772fd60a97016a07d6c5a0a7eb085a18307d34194596f5b541cdf01b2ceb31d62d6b55515acfd2b9eec92b27d082fbc4dc59fc63b551eccdb8468", + "0xa040f7f4be67eaf0a1d658a3175d65df21a7dbde99bfa893469b9b43b9d150fc2e333148b1cb88cfd0447d88fa1a501d126987e9fdccb2852ecf1ba907c2ca3d6f97b055e354a9789854a64ecc8c2e928382cf09dda9abde42bbdf92280cdd96", + "0x864baff97fa60164f91f334e0c9be00a152a416556b462f96d7c43b59fe1ebaff42f0471d0bf264976f8aa6431176eb905bd875024cf4f76c13a70bede51dc3e47e10b9d5652d30d2663b3af3f08d5d11b9709a0321aba371d2ef13174dcfcaf", + "0x95a46f32c994133ecc22db49bad2c36a281d6b574c83cfee6680b8c8100466ca034b815cfaedfbf54f4e75188e661df901abd089524e1e0eb0bf48d48caa9dd97482d2e8c1253e7e8ac250a32fd066d5b5cb08a8641bdd64ecfa48289dca83a3", + "0xa2cce2be4d12144138cb91066e0cd0542c80b478bf467867ebef9ddaf3bd64e918294043500bf5a9f45ee089a8d6ace917108d9ce9e4f41e7e860cbce19ac52e791db3b6dde1c4b0367377b581f999f340e1d6814d724edc94cb07f9c4730774", + "0xb145f203eee1ac0a1a1731113ffa7a8b0b694ef2312dabc4d431660f5e0645ef5838e3e624cfe1228cfa248d48b5760501f93e6ab13d3159fc241427116c4b90359599a4cb0a86d0bb9190aa7fabff482c812db966fd2ce0a1b48cb8ac8b3bca", + "0xadabe5d215c608696e03861cbd5f7401869c756b3a5aadc55f41745ad9478145d44393fec8bb6dfc4ad9236dc62b9ada0f7ca57fe2bae1b71565dbf9536d33a68b8e2090b233422313cc96afc7f1f7e0907dc7787806671541d6de8ce47c4cd0", + "0xae7845fa6b06db53201c1080e01e629781817f421f28956589c6df3091ec33754f8a4bd4647a6bb1c141ac22731e3c1014865d13f3ed538dcb0f7b7576435133d9d03be655f8fbb4c9f7d83e06d1210aedd45128c2b0c9bab45a9ddde1c862a5", + "0x9159eaa826a24adfa7adf6e8d2832120ebb6eccbeb3d0459ffdc338548813a2d239d22b26451fda98cc0c204d8e1ac69150b5498e0be3045300e789bcb4e210d5cd431da4bdd915a21f407ea296c20c96608ded0b70d07188e96e6c1a7b9b86b", + "0xa9fc6281e2d54b46458ef564ffaed6944bff71e389d0acc11fa35d3fcd8e10c1066e0dde5b9b6516f691bb478e81c6b20865281104dcb640e29dc116daae2e884f1fe6730d639dbe0e19a532be4fb337bf52ae8408446deb393d224eee7cfa50", + "0x84291a42f991bfb36358eedead3699d9176a38f6f63757742fdbb7f631f2c70178b1aedef4912fed7b6cf27e88ddc7eb0e2a6aa4b999f3eb4b662b93f386c8d78e9ac9929e21f4c5e63b12991fcde93aa64a735b75b535e730ff8dd2abb16e04", + "0xa1b7fcacae181495d91765dfddf26581e8e39421579c9cbd0dd27a40ea4c54af3444a36bf85a11dda2114246eaddbdd619397424bb1eb41b5a15004b902a590ede5742cd850cf312555be24d2df8becf48f5afba5a8cd087cb7be0a521728386", + "0x92feaaf540dbd84719a4889a87cdd125b7e995a6782911931fef26da9afcfbe6f86aaf5328fe1f77631491ce6239c5470f44c7791506c6ef1626803a5794e76d2be0af92f7052c29ac6264b7b9b51f267ad820afc6f881460521428496c6a5f1", + "0xa525c925bfae1b89320a5054acc1fa11820f73d0cf28d273092b305467b2831fab53b6daf75fb926f332782d50e2522a19edcd85be5eb72f1497193c952d8cd0bcc5d43b39363b206eae4cb1e61668bde28a3fb2fc1e0d3d113f6dfadb799717", + "0x98752bb6f5a44213f40eda6aa4ff124057c1b13b6529ab42fe575b9afa66e59b9c0ed563fb20dff62130c436c3e905ee17dd8433ba02c445b1d67182ab6504a90bbe12c26a754bbf734665c622f76c62fe2e11dd43ce04fd2b91a8463679058b", + "0xa9aa9a84729f7c44219ff9e00e651e50ddea3735ef2a73fdf8ed8cd271961d8ed7af5cd724b713a89a097a3fe65a3c0202f69458a8b4c157c62a85668b12fc0d3957774bc9b35f86c184dd03bfefd5c325da717d74192cc9751c2073fe9d170e", + "0xb221c1fd335a4362eff504cd95145f122bf93ea02ae162a3fb39c75583fc13a932d26050e164da97cff3e91f9a7f6ff80302c19dd1916f24acf6b93b62f36e9665a8785413b0c7d930c7f1668549910f849bca319b00e59dd01e5dec8d2edacc", + "0xa71e2b1e0b16d754b848f05eda90f67bedab37709550171551050c94efba0bfc282f72aeaaa1f0330041461f5e6aa4d11537237e955e1609a469d38ed17f5c2a35a1752f546db89bfeff9eab78ec944266f1cb94c1db3334ab48df716ce408ef", + "0xb990ae72768779ba0b2e66df4dd29b3dbd00f901c23b2b4a53419226ef9232acedeb498b0d0687c463e3f1eead58b20b09efcefa566fbfdfe1c6e48d32367936142d0a734143e5e63cdf86be7457723535b787a9cfcfa32fe1d61ad5a2617220", + "0x8d27e7fbff77d5b9b9bbc864d5231fecf817238a6433db668d5a62a2c1ee1e5694fdd90c3293c06cc0cb15f7cbeab44d0d42be632cb9ff41fc3f6628b4b62897797d7b56126d65b694dcf3e298e3561ac8813fbd7296593ced33850426df42db", + "0xa92039a08b5502d5b211a7744099c9f93fa8c90cedcb1d05e92f01886219dd464eb5fb0337496ad96ed09c987da4e5f019035c5b01cc09b2a18b8a8dd419bc5895388a07e26958f6bd26751929c25f89b8eb4a299d822e2d26fec9ef350e0d3c", + "0x92dcc5a1c8c3e1b28b1524e3dd6dbecd63017c9201da9dbe077f1b82adc08c50169f56fc7b5a3b28ec6b89254de3e2fd12838a761053437883c3e01ba616670cea843754548ef84bcc397de2369adcca2ab54cd73c55dc68d87aec3fc2fe4f10" + ] +} \ No newline at end of file diff --git a/crypto/txsign/txsign.go b/crypto/txsign/txsign.go new file mode 100644 index 0000000..5d235b6 --- /dev/null +++ b/crypto/txsign/txsign.go @@ -0,0 +1,73 @@ +package txsign + +import ( + "fmt" + "math/big" + + "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/types" +) + +// Sign signs the given transaction with the given private key. +func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { + if key == nil { + return fmt.Errorf("missing private key") + } + txd := tx.TransactionData() + hash, err := tx.CalculateSigningHash() + if err != nil { + return err + } + sig, err := ecdsa.SignHash(key, ecdsa.Hash(hash)) + if err != nil { + return err + } + sv, sr, ss := sig.V, sig.R, sig.S + if tx.Type() == types.LegacyTxType { + if txd.ChainID != nil { + sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*txd.ChainID*2)) + sv = new(big.Int).Add(sv, big.NewInt(35)) + } else { + sv = new(big.Int).Add(sv, big.NewInt(27)) + } + } + txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) + if cd, ok := tx.(types.HasCallData); ok { + cd.CallData().SetFrom(types.Address(ecdsa.PublicKeyToAddress(&key.PublicKey))) + } + return nil +} + +// Recover recovers the Ethereum address from the given transaction. +func Recover(tx types.Transaction) (*types.Address, error) { + txd := tx.TransactionData() + if txd.Signature == nil { + return nil, fmt.Errorf("signature is missing") + } + sig := *txd.Signature + if tx.Type() == types.LegacyTxType { + if sig.V.Cmp(big.NewInt(35)) >= 0 { + x := new(big.Int).Sub(sig.V, big.NewInt(35)) + + // Derive the chain ID from the signature. + chainID := new(big.Int).Div(x, big.NewInt(2)) + if txd.ChainID != nil && *txd.ChainID != chainID.Uint64() { + return nil, fmt.Errorf("invalid chain ID: %d", chainID) + } + + // Derive the recovery byte from the signature. + sig.V = new(big.Int).Add(new(big.Int).Mod(x, big.NewInt(2)), big.NewInt(27)) + } else { + sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) + } + } + hash, err := tx.CalculateSigningHash() + if err != nil { + return nil, err + } + addr, err := ecdsa.RecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) + if err != nil { + return nil, err + } + return (*types.Address)(addr), nil +} diff --git a/go.mod b/go.mod index 637cc59..a8f6b66 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/btcsuite/btcd v0.24.0 github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/btcsuite/btcd/btcutil v1.1.5 + github.com/crate-crypto/go-kzg-4844 v1.1.0 github.com/defiweb/go-anymapper v0.3.0 github.com/defiweb/go-rlp v0.3.0 github.com/defiweb/go-sigparser v0.6.0 @@ -18,14 +19,16 @@ require ( ) require ( + github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.13.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/stretchr/objx v0.5.1 // indirect + golang.org/x/sync v0.1.0 // indirect golang.org/x/sys v0.16.0 // indirect - gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect + rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 53b1036..8102493 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= +github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= @@ -25,7 +27,12 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.13.0 h1:VPULb/v6bbYELAPTDFINEVaMTTybV5GLxDdcjnS+4oc= +github.com/consensys/gnark-crypto v0.13.0/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= +github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4= +github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -55,19 +62,19 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -77,21 +84,11 @@ github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= -github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.1 h1:4VhoImhV/Bm0ToFkXFi8hXNXwpDRZ/ynw3amt82mzq0= -github.com/stretchr/objx v0.5.1/go.mod h1:/iHQpkQwBD6DLUmQ4pE+s1TXdob1mORJ4/UFdrifcy0= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= @@ -108,6 +105,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -133,14 +132,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/rpc/base.go b/rpc/base.go deleted file mode 100644 index 1fd6dd8..0000000 --- a/rpc/base.go +++ /dev/null @@ -1,484 +0,0 @@ -package rpc - -import ( - "context" - "encoding/json" - "errors" - "fmt" - "math/big" - - "github.com/defiweb/go-eth/rpc/transport" - "github.com/defiweb/go-eth/types" -) - -// baseClient is a base implementation of the RPC interface. It implements -// RPC methods supported by Ethereum nodes. -type baseClient struct { - transport transport.Transport -} - -// ClientVersion implements the RPC interface. -func (c *baseClient) ClientVersion(ctx context.Context) (string, error) { - var res string - if err := c.transport.Call(ctx, &res, "web3_clientVersion"); err != nil { - return "", err - } - return res, nil -} - -// Listening implements the RPC interface. -func (c *baseClient) Listening(ctx context.Context) (bool, error) { - var res bool - if err := c.transport.Call(ctx, &res, "net_listening"); err != nil { - return false, err - } - return res, nil -} - -// PeerCount implements the RPC interface. -func (c *baseClient) PeerCount(ctx context.Context) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "net_peerCount"); err != nil { - return 0, err - } - return res.Big().Uint64(), nil -} - -// ProtocolVersion implements the RPC interface. -func (c *baseClient) ProtocolVersion(ctx context.Context) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_protocolVersion"); err != nil { - return 0, err - } - return res.Big().Uint64(), nil -} - -// Syncing implements the RPC interface. -func (c *baseClient) Syncing(ctx context.Context) (*types.SyncStatus, error) { - var res types.SyncStatus - if err := c.transport.Call(ctx, &res, "eth_syncing"); err != nil { - return nil, err - } - return &res, nil -} - -// NetworkID implements the RPC interface. -func (c *baseClient) NetworkID(ctx context.Context) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "net_version"); err != nil { - return 0, err - } - return res.Big().Uint64(), nil -} - -// ChainID implements the RPC interface. -func (c *baseClient) ChainID(ctx context.Context) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_chainId"); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, fmt.Errorf("chain id is too big") - } - return res.Big().Uint64(), nil -} - -// GasPrice implements the RPC interface. -func (c *baseClient) GasPrice(ctx context.Context) (*big.Int, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_gasPrice"); err != nil { - return nil, err - } - return res.Big(), nil -} - -// Accounts implements the RPC interface. -func (c *baseClient) Accounts(ctx context.Context) ([]types.Address, error) { - var res []types.Address - if err := c.transport.Call(ctx, &res, "eth_accounts"); err != nil { - return nil, err - } - return res, nil -} - -// BlockNumber implements the RPC interface. -func (c *baseClient) BlockNumber(ctx context.Context) (*big.Int, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_blockNumber"); err != nil { - return nil, err - } - return res.Big(), nil -} - -// GetBalance implements the RPC interface. -func (c *baseClient) GetBalance(ctx context.Context, address types.Address, block types.BlockNumber) (*big.Int, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getBalance", address, block); err != nil { - return nil, err - } - return res.Big(), nil -} - -// GetStorageAt implements the RPC interface. -func (c *baseClient) GetStorageAt(ctx context.Context, account types.Address, key types.Hash, block types.BlockNumber) (*types.Hash, error) { - var res types.Hash - if err := c.transport.Call(ctx, &res, "eth_getStorageAt", account, key, block); err != nil { - return nil, err - } - return &res, nil -} - -// GetTransactionCount implements the RPC interface. -func (c *baseClient) GetTransactionCount(ctx context.Context, account types.Address, block types.BlockNumber) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getTransactionCount", account, block); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, errors.New("transaction count is too big") - } - return res.Big().Uint64(), nil -} - -// GetBlockTransactionCountByHash implements the RPC interface. -func (c *baseClient) GetBlockTransactionCountByHash(ctx context.Context, hash types.Hash) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getBlockTransactionCountByHash", hash); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, errors.New("transaction count is too big") - } - return res.Big().Uint64(), nil -} - -// GetBlockTransactionCountByNumber implements the RPC interface. -func (c *baseClient) GetBlockTransactionCountByNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getBlockTransactionCountByNumber", number); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, errors.New("transaction count is too big") - } - return res.Big().Uint64(), nil -} - -// GetUncleCountByBlockHash implements the RPC interface. -func (c *baseClient) GetUncleCountByBlockHash(ctx context.Context, hash types.Hash) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getUncleCountByBlockHash", hash); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, errors.New("uncle count is too big") - } - return res.Big().Uint64(), nil -} - -// GetUncleCountByBlockNumber implements the RPC interface. -func (c *baseClient) GetUncleCountByBlockNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_getUncleCountByBlockNumber", number); err != nil { - return 0, err - } - if !res.Big().IsUint64() { - return 0, errors.New("uncle count is too big") - } - return res.Big().Uint64(), nil -} - -// GetCode implements the RPC interface. -func (c *baseClient) GetCode(ctx context.Context, account types.Address, block types.BlockNumber) ([]byte, error) { - var res types.Bytes - if err := c.transport.Call(ctx, &res, "eth_getCode", account, block); err != nil { - return nil, err - } - return res.Bytes(), nil -} - -// Sign implements the RPC interface. -func (c *baseClient) Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) { - var res types.Signature - if err := c.transport.Call(ctx, &res, "eth_sign", account, types.Bytes(data)); err != nil { - return nil, err - } - return &res, nil -} - -// SignTransaction implements the RPC interface. -func (c *baseClient) SignTransaction(ctx context.Context, tx *types.Transaction) ([]byte, *types.Transaction, error) { - if tx == nil { - return nil, nil, errors.New("rpc client: transaction is nil") - } - var res signTransactionResult - if err := c.transport.Call(ctx, &res, "eth_signTransaction", tx); err != nil { - return nil, nil, err - } - return res.Raw, res.Tx, nil -} - -// SendTransaction implements the RPC interface. -func (c *baseClient) SendTransaction(ctx context.Context, tx *types.Transaction) (*types.Hash, *types.Transaction, error) { - if tx == nil { - return nil, nil, errors.New("rpc client: transaction is nil") - } - var res types.Hash - if err := c.transport.Call(ctx, &res, "eth_sendTransaction", tx); err != nil { - return nil, nil, err - } - return &res, tx, nil -} - -// SendRawTransaction implements the RPC interface. -func (c *baseClient) SendRawTransaction(ctx context.Context, data []byte) (*types.Hash, error) { - var res types.Hash - if err := c.transport.Call(ctx, &res, "eth_sendRawTransaction", types.Bytes(data)); err != nil { - return nil, err - } - return &res, nil -} - -// Call implements the RPC interface. -func (c *baseClient) Call(ctx context.Context, call *types.Call, block types.BlockNumber) ([]byte, *types.Call, error) { - if call == nil { - return nil, nil, errors.New("rpc client: call is nil") - } - var res types.Bytes - if err := c.transport.Call(ctx, &res, "eth_call", call, block); err != nil { - return nil, nil, err - } - return res, call, nil -} - -// EstimateGas implements the RPC interface. -func (c *baseClient) EstimateGas(ctx context.Context, call *types.Call, block types.BlockNumber) (uint64, *types.Call, error) { - if call == nil { - return 0, nil, errors.New("rpc client: call is nil") - } - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_estimateGas", call, block); err != nil { - return 0, nil, err - } - if !res.Big().IsUint64() { - return 0, nil, errors.New("gas estimate is too big") - } - return res.Big().Uint64(), call, nil -} - -// BlockByHash implements the RPC interface. -func (c *baseClient) BlockByHash(ctx context.Context, hash types.Hash, full bool) (*types.Block, error) { - var res types.Block - if err := c.transport.Call(ctx, &res, "eth_getBlockByHash", hash, full); err != nil { - return nil, err - } - return &res, nil -} - -// BlockByNumber implements the RPC interface. -func (c *baseClient) BlockByNumber(ctx context.Context, number types.BlockNumber, full bool) (*types.Block, error) { - var res types.Block - if err := c.transport.Call(ctx, &res, "eth_getBlockByNumber", number, full); err != nil { - return nil, err - } - return &res, nil -} - -// GetTransactionByHash implements the RPC interface. -func (c *baseClient) GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.OnChainTransaction, error) { - var res types.OnChainTransaction - if err := c.transport.Call(ctx, &res, "eth_getTransactionByHash", hash); err != nil { - return nil, err - } - return &res, nil -} - -// GetTransactionByBlockHashAndIndex implements the RPC interface. -func (c *baseClient) GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.OnChainTransaction, error) { - var res types.OnChainTransaction - if err := c.transport.Call(ctx, &res, "eth_getTransactionByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { - return nil, err - } - return &res, nil -} - -// GetTransactionByBlockNumberAndIndex implements the RPC interface. -func (c *baseClient) GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.OnChainTransaction, error) { - var res types.OnChainTransaction - if err := c.transport.Call(ctx, &res, "eth_getTransactionByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { - return nil, err - } - return &res, nil -} - -// GetTransactionReceipt implements the RPC interface. -func (c *baseClient) GetTransactionReceipt(ctx context.Context, hash types.Hash) (*types.TransactionReceipt, error) { - var res types.TransactionReceipt - if err := c.transport.Call(ctx, &res, "eth_getTransactionReceipt", hash); err != nil { - return nil, err - } - return &res, nil -} - -// GetBlockReceipts implements the RPC interface. -func (c *baseClient) GetBlockReceipts(ctx context.Context, block types.BlockNumber) ([]*types.TransactionReceipt, error) { - var res []*types.TransactionReceipt - if err := c.transport.Call(ctx, &res, "eth_getBlockReceipts", block); err != nil { - return nil, err - } - return res, nil -} - -// GetUncleByBlockHashAndIndex implements the RPC interface. -func (c *baseClient) GetUncleByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.Block, error) { - var res types.Block - if err := c.transport.Call(ctx, &res, "eth_getUncleByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { - return nil, err - } - return &res, nil -} - -// GetUncleByBlockNumberAndIndex implements the RPC interface. -func (c *baseClient) GetUncleByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.Block, error) { - var res types.Block - if err := c.transport.Call(ctx, &res, "eth_getUncleByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { - return nil, err - } - return &res, nil -} - -// NewFilter implements the RPC interface. -func (c *baseClient) NewFilter(ctx context.Context, query *types.FilterLogsQuery) (*big.Int, error) { - var res *types.Number - if err := c.transport.Call(ctx, &res, "eth_newFilter", query); err != nil { - return nil, err - } - return res.Big(), nil -} - -// NewBlockFilter implements the RPC interface. -func (c *baseClient) NewBlockFilter(ctx context.Context) (*big.Int, error) { - var res *types.Number - if err := c.transport.Call(ctx, &res, "eth_newBlockFilter"); err != nil { - return nil, err - } - return res.Big(), nil - -} - -// NewPendingTransactionFilter implements the RPC interface. -func (c *baseClient) NewPendingTransactionFilter(ctx context.Context) (*big.Int, error) { - var res *types.Number - if err := c.transport.Call(ctx, &res, "eth_newPendingTransactionFilter"); err != nil { - return nil, err - } - return res.Big(), nil -} - -// UninstallFilter implements the RPC interface. -func (c *baseClient) UninstallFilter(ctx context.Context, id *big.Int) (bool, error) { - var res bool - if err := c.transport.Call(ctx, &res, "eth_uninstallFilter", types.NumberFromBigInt(id)); err != nil { - return false, err - } - return res, nil -} - -// GetFilterChanges implements the RPC interface. -func (c *baseClient) GetFilterChanges(ctx context.Context, id *big.Int) ([]types.Log, error) { - var res []types.Log - if err := c.transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { - return nil, err - } - return res, nil -} - -// GetFilterLogs implements the RPC interface. -func (c *baseClient) GetFilterLogs(ctx context.Context, id *big.Int) ([]types.Log, error) { - var res []types.Log - if err := c.transport.Call(ctx, &res, "eth_getFilterLogs", types.NumberFromBigInt(id)); err != nil { - return nil, err - } - return res, nil -} - -// GetBlockFilterChanges implements the RPC interface. -func (c *baseClient) GetBlockFilterChanges(ctx context.Context, id *big.Int) ([]types.Hash, error) { - var res []types.Hash - if err := c.transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { - return nil, err - } - return res, nil -} - -// GetLogs implements the RPC interface. -func (c *baseClient) GetLogs(ctx context.Context, query *types.FilterLogsQuery) ([]types.Log, error) { - var res []types.Log - if err := c.transport.Call(ctx, &res, "eth_getLogs", query); err != nil { - return nil, err - } - return res, nil -} - -// MaxPriorityFeePerGas implements the RPC interface. -func (c *baseClient) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, error) { - var res types.Number - if err := c.transport.Call(ctx, &res, "eth_maxPriorityFeePerGas"); err != nil { - return nil, err - } - return res.Big(), nil -} - -// SubscribeLogs implements the RPC interface. -func (c *baseClient) SubscribeLogs(ctx context.Context, query *types.FilterLogsQuery) (<-chan types.Log, error) { - return subscribe[types.Log](ctx, c.transport, "logs", query) -} - -// SubscribeNewHeads implements the RPC interface. -func (c *baseClient) SubscribeNewHeads(ctx context.Context) (<-chan types.Block, error) { - return subscribe[types.Block](ctx, c.transport, "newHeads") -} - -// SubscribeNewPendingTransactions implements the RPC interface. -func (c *baseClient) SubscribeNewPendingTransactions(ctx context.Context) (<-chan types.Hash, error) { - return subscribe[types.Hash](ctx, c.transport, "newPendingTransactions") -} - -// subscribe creates a subscription to the given method and returns a channel -// that will receive the subscription messages. The messages are unmarshalled -// to the T type. The subscription is unsubscribed and channel closed when the -// context is cancelled. -func subscribe[T any](ctx context.Context, t transport.Transport, method string, params ...any) (chan T, error) { - st, ok := t.(transport.SubscriptionTransport) - if !ok { - return nil, errors.New("transport does not support subscriptions") - } - rawCh, subID, err := st.Subscribe(ctx, method, params...) - if err != nil { - return nil, err - } - msgCh := make(chan T) - go subscriptionRoutine(ctx, st, subID, rawCh, msgCh) - return msgCh, nil -} - -//nolint:errcheck -func subscriptionRoutine[T any](ctx context.Context, t transport.SubscriptionTransport, subID string, rawCh chan json.RawMessage, msgCh chan T) { - defer close(msgCh) - defer t.Unsubscribe(ctx, subID) - for { - select { - case <-ctx.Done(): - return - case raw, ok := <-rawCh: - if !ok { - return - } - var msg T - if err := json.Unmarshal(raw, &msg); err != nil { - continue - } - msgCh <- msg - } - } -} diff --git a/rpc/base_test.go b/rpc/base_test.go deleted file mode 100644 index 130a168..0000000 --- a/rpc/base_test.go +++ /dev/null @@ -1,2087 +0,0 @@ -package rpc - -import ( - "bytes" - "context" - "encoding/json" - "io" - "math/big" - "net/http" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/defiweb/go-eth/hexutil" - "github.com/defiweb/go-eth/types" -) - -const mockClientVersionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "web3_clientVersion", - "params": [] - } -` - -const mockClientVersionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2" - } -` - -func TestBaseClient_ClientVersion(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockClientVersionResponse)), - } - - clientVersion, err := client.ClientVersion(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockClientVersionRequest, readBody(httpMock.Request)) - assert.Equal(t, "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2", clientVersion) -} - -const mockListeningRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "net_listening", - "params": [] - } -` - -const mockListeningResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": true - } -` - -func TestBaseClient_Listening(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockListeningResponse)), - } - - listening, err := client.Listening(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockListeningRequest, readBody(httpMock.Request)) - assert.True(t, listening) -} - -const mockPeerCountRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "net_peerCount", - "params": [] - } -` - -const mockPeerCountResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_PeerCount(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockPeerCountResponse)), - } - - peerCount, err := client.PeerCount(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockPeerCountRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), peerCount) -} - -const mockProtocolVersionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_protocolVersion", - "params": [] - } -` - -const mockProtocolVersionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_ProtocolVersion(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockProtocolVersionResponse)), - } - - protocolVersion, err := client.ProtocolVersion(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockProtocolVersionRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), protocolVersion) -} - -const mockSyncingRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_syncing", - "params": [] - } -` - -const mockSyncingResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": { - "startingBlock": "0x384", - "currentBlock": "0x386", - "highestBlock": "0x454" - } - } -` - -func TestBaseClient_Syncing(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSyncingResponse)), - } - - syncing, err := client.Syncing(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockSyncingRequest, readBody(httpMock.Request)) - assert.Equal(t, &types.SyncStatus{ - StartingBlock: types.MustBlockNumberFromHex("0x384"), - CurrentBlock: types.MustBlockNumberFromHex("0x386"), - HighestBlock: types.MustBlockNumberFromHex("0x454"), - }, syncing) -} - -const mockNetworkIDRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "net_version", - "params": [] - } -` - -const mockNetworkIDResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_NetworkID(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockNetworkIDResponse)), - } - - networkID, err := client.NetworkID(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockNetworkIDRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), networkID) -} - -const mockChanIDRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_chainId", - "params": [] - } -` - -const mockChanIDResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_ChainID(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockChanIDResponse)), - } - - chainID, err := client.ChainID(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockChanIDRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), chainID) -} - -const mockGasPriceRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_gasPrice", - "params": [] - } -` - -const mockGasPriceResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x09184e72a000" - } -` - -func TestBaseClient_GasPrice(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGasPriceResponse)), - } - - gasPrice, err := client.GasPrice(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockGasPriceRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(10000000000000), gasPrice) -} - -const mockBlockNumberRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_blockNumber", - "params": [] - } -` - -const mockBlockNumberResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_BlockNumber(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockBlockNumberResponse)), - } - - blockNumber, err := client.BlockNumber(context.Background()) - - require.NoError(t, err) - assert.JSONEq(t, mockBlockNumberRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(1), blockNumber) -} - -const mockGetBalanceRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBalance", - "params": [ - "0x1111111111111111111111111111111111111111", - "latest" - ] - } -` - -const mockGetBalanceResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x0234c8a3397aab58" - } -` - -func TestBaseClient_GetBalance(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetBalanceResponse)), - } - - balance, err := client.GetBalance( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - types.LatestBlockNumber, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetBalanceRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(158972490234375000), balance) -} - -const mockGetStorageAtRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getStorageAt", - "params": [ - "0x1111111111111111111111111111111111111111", - "0x2222222222222222222222222222222222222222222222222222222222222222", - "0x1" - ] - } -` - -const mockGetStorageAtResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x3333333333333333333333333333333333333333333333333333333333333333" - } -` - -func TestBaseClient_GetStorageAt(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetStorageAtResponse)), - } - - storage, err := client.GetStorageAt( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), - types.MustBlockNumberFromHex("0x1"), - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetStorageAtRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", types.PadNone), *storage) -} - -const mockGetTransactionCountRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionCount", - "params": [ - "0x1111111111111111111111111111111111111111", - "0x1" - ] - } -` - -const mockGetTransactionCountResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_GetTransactionCount(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionCountResponse)), - } - - transactionCount, err := client.GetTransactionCount( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - types.MustBlockNumberFromHex("0x1"), - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetTransactionCountRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), transactionCount) -} - -const mockGetBlockTransactionCountByHashRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBlockTransactionCountByHash", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" - ] - } -` - -const mockGetBlockTransactionCountByHashResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_GetBlockTransactionCountByHash(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetBlockTransactionCountByHashResponse)), - } - - transactionCount, err := client.GetBlockTransactionCountByHash( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - ) - require.NoError(t, err) - assert.JSONEq(t, mockGetBlockTransactionCountByHashRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), transactionCount) -} - -const mockGetBlockTransactionCountByNumberRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBlockTransactionCountByNumber", - "params": [ - "0x1" - ] - } -` - -const mockGetBlockTransactionCountByNumberResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x2" - } -` - -func TestBaseClient_GetBlockTransactionCountByNumber(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetBlockTransactionCountByNumberResponse)), - } - - transactionCount, err := client.GetBlockTransactionCountByNumber( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockGetBlockTransactionCountByNumberRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(2), transactionCount) -} - -const mockGetUncleCountByBlockHashRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getUncleCountByBlockHash", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" - ] - } -` - -const mockGetUncleCountByBlockHashResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_GetUncleCountByBlockHash(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetUncleCountByBlockHashResponse)), - } - - uncleCount, err := client.GetUncleCountByBlockHash( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - ) - require.NoError(t, err) - assert.JSONEq(t, mockGetUncleCountByBlockHashRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(1), uncleCount) -} - -const mockGetUncleCountByBlockNumberRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getUncleCountByBlockNumber", - "params": [ - "0x1" - ] - } -` - -const mockGetUncleCountByBlockNumberResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x2" - } -` - -func TestBaseClient_GetUncleCountByBlockNumber(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetUncleCountByBlockNumberResponse)), - } - - uncleCount, err := client.GetUncleCountByBlockNumber( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockGetUncleCountByBlockNumberRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(2), uncleCount) -} - -const mockGetCodeRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getCode", - "params": [ - "0x1111111111111111111111111111111111111111", - "0x2" - ] - } -` - -const mockGetCodeResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x3333333333333333333333333333333333333333333333333333333333333333" - } -` - -func TestBaseClient_GetCode(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetCodeResponse)), - } - - code, err := client.GetCode( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - types.MustBlockNumberFromHex("0x2"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockGetCodeRequest, readBody(httpMock.Request)) - assert.Equal(t, hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), code) -} - -const mockSignRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_sign", - "params": [ - "0x1111111111111111111111111111111111111111", - "0x416c6c20796f75722062617365206172652062656c6f6e6720746f207573" - ] - } -` - -const mockSignResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f" - } -` - -func TestBaseClient_Sign(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSignResponse)), - } - - signature, err := client.Sign( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - []byte("All your base are belong to us"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockSignRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), *signature) -} - -const mockSignTransactionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_signTransaction", - "params": [ - { - "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", - "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x2540be400", - "input": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" - } - ] - } -` - -const mockSignTransactionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": { - "raw": "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333", - "tx": { - "nonce": "0x0", - "gasPrice": "0x09184e72a000", - "gas": "0x76c0", - "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", - "value": "0x2540be400", - "input": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675", - "v": "0x11", - "r": "0x2222222222222222222222222222222222222222222222222222222222222222", - "s": "0x3333333333333333333333333333333333333333333333333333333333333333" - } - } - } -` - -func TestBaseClient_SignTransaction(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSignTransactionResponse)), - } - - from := types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - to := types.MustAddressFromHex("0xd46e8dd67c5d32be8058bb8eb970870f07244567") - gasLimit := uint64(30400) - chainID := uint64(1) - raw, tx, err := client.SignTransaction( - context.Background(), - &types.Transaction{ - ChainID: &chainID, - Call: types.Call{ - From: &from, - To: &to, - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"), - }, - }, - ) - require.NoError(t, err) - assert.JSONEq(t, mockSignTransactionRequest, readBody(httpMock.Request)) - assert.Equal(t, hexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), raw) - assert.Equal(t, &to, tx.To) - assert.Equal(t, uint64(30400), *tx.GasLimit) - assert.Equal(t, big.NewInt(10000000000000), tx.GasPrice) - assert.Equal(t, big.NewInt(10000000000), tx.Value) - assert.Equal(t, hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"), tx.Input) - assert.Equal(t, uint8(0x11), tx.Signature.Bytes()[64]) - assert.Equal(t, hexToBytes("0x2222222222222222222222222222222222222222222222222222222222222222"), tx.Signature.Bytes()[:32]) - assert.Equal(t, hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), tx.Signature.Bytes()[32:64]) -} - -const mockSendTransactionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_sendTransaction", - "params": [ - { - "from": "0xb60e8dd61c5d32be8058bb8eb970870f07233155", - "to": "0xd46e8dd67c5d32be8058bb8eb970870f07244567", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x2540be400", - "input": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" - } - ] - } -` - -const mockSendTransactionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1111111111111111111111111111111111111111111111111111111111111111" - } -` - -func TestBaseClient_SendTransaction(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSendTransactionResponse)), - } - - from := types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - to := types.MustAddressFromHex("0xd46e8dd67c5d32be8058bb8eb970870f07244567") - gasLimit := uint64(30400) - gasPrice := big.NewInt(10000000000000) - value := big.NewInt(10000000000) - input := hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675") - chainID := uint64(1) - txHash, tx, err := client.SendTransaction( - context.Background(), - &types.Transaction{ - ChainID: &chainID, - Call: types.Call{ - From: &from, - To: &to, - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"), - }, - }, - ) - require.NoError(t, err) - assert.JSONEq(t, mockSendTransactionRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) - assert.Equal(t, &from, tx.From) - assert.Equal(t, &to, tx.To) - assert.Equal(t, gasLimit, *tx.GasLimit) - assert.Equal(t, gasPrice, tx.GasPrice) - assert.Equal(t, value, tx.Value) - assert.Equal(t, input, tx.Input) -} - -const mockSendRawTransactionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_sendRawTransaction", - "params": [ - "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" - ] - } -` - -const mockSendRawTransactionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1111111111111111111111111111111111111111111111111111111111111111" - } -` - -func TestBaseClient_SendRawTransaction(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSendRawTransactionResponse)), - } - - txHash, err := client.SendRawTransaction( - context.Background(), - hexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockSendRawTransactionRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) -} - -const mockCallRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_call", - "params": [ - { - "from": "0x1111111111111111111111111111111111111111", - "to": "0x2222222222222222222222222222222222222222", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x2540be400", - "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" - }, - "0x1" - ] - } -` - -const mockCallResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f300000000000000000000000078d1ad571a1a09d60d9bbf25894b44e4c8859595000000000000000000000000286834935f4a8cfb4ff4c77d5770c2775ae2b0e7000000000000000000000000b86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e" - } -` - -func TestBaseClient_Call(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockCallResponse)), - } - - from := types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111") - to := types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222") - gasLimit := uint64(30400) - gasPrice := big.NewInt(10000000000000) - value := big.NewInt(10000000000) - input := hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333") - calldata, call, err := client.Call( - context.Background(), - &types.Call{ - From: from, - To: to, - GasLimit: &gasLimit, - GasPrice: gasPrice, - Value: value, - Input: input, - }, - types.MustBlockNumberFromHex("0x1"), - ) - require.NoError(t, err) - assert.JSONEq(t, mockCallRequest, readBody(httpMock.Request)) - assert.Equal(t, hexToBytes("0x00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004000000000000000000000000d9c9cd5f6779558b6e0ed4e6acf6b1947e7fa1f300000000000000000000000078d1ad571a1a09d60d9bbf25894b44e4c8859595000000000000000000000000286834935f4a8cfb4ff4c77d5770c2775ae2b0e7000000000000000000000000b86e2b0ab5a4b1373e40c51a7c712c70ba2f9f8e"), calldata) - assert.Equal(t, from, call.From) - assert.Equal(t, to, call.To) - assert.Equal(t, gasLimit, *call.GasLimit) - assert.Equal(t, gasPrice, call.GasPrice) - assert.Equal(t, value, call.Value) - assert.Equal(t, input, call.Input) -} - -const mockEstimateGasRequest = ` - { - "id": 1, - "jsonrpc": "2.0", - "method": "eth_estimateGas", - "params": [ - { - "from": "0x1111111111111111111111111111111111111111", - "to": "0x2222222222222222222222222222222222222222", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x2540be400", - "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" - }, - "latest" - ] - } -` - -const mockEstimateGasResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x5208" - } -` - -func TestBaseClient_EstimateGas(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockEstimateGasResponse)), - } - - gasLimit := uint64(30400) - gas, _, err := client.EstimateGas( - context.Background(), - &types.Call{ - From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), - }, - types.LatestBlockNumber, - ) - require.NoError(t, err) - assert.JSONEq(t, mockEstimateGasRequest, readBody(httpMock.Request)) - assert.Equal(t, uint64(21000), gas) -} - -const mockBlockByNumberRequest = ` - { - "method": "eth_getBlockByNumber", - "params": [ - "0x1", - true - ], - "id": 1, - "jsonrpc": "2.0" - } -` - -const mockBlockByNumberResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": { - "number": "0x11", - "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", - "parentHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "nonce": "0x4444444444444444", - "sha3Uncles": "0x5555555555555555555555555555555555555555555555555555555555555555", - "logsBloom": "0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", - "transactionsRoot": "0x7777777777777777777777777777777777777777777777777777777777777777", - "stateRoot": "0x8888888888888888888888888888888888888888888888888888888888888888", - "receiptsRoot": "0x9999999999999999999999999999999999999999999999999999999999999999", - "miner": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "difficulty": "0xbbbbbb", - "totalDifficulty": "0xcccccc", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "size": "0xdddddd", - "gasLimit": "0xeeeeee", - "gasUsed": "0xffffff", - "timestamp": "0x54e34e8e", - "transactions": [ - { - "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "nonce": "0x22", - "blockHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "blockNumber": "0x4444", - "transactionIndex": "0x01", - "from": "0x5555555555555555555555555555555555555555", - "to": "0x6666666666666666666666666666666666666666", - "value": "0x2540be400", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "input": "0x777777777777" - } - ], - "uncles": [ - "0x8888888888888888888888888888888888888888888888888888888888888888" - ] - } - } -` - -func TestBaseClient_BlockByNumber(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockBlockByNumberResponse)), - } - - block, err := client.BlockByNumber( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - true, - ) - require.NoError(t, err) - assert.JSONEq(t, mockBlockByNumberRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(0x11), block.Number) - assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) - assert.Equal(t, types.MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", types.PadNone), block.ParentHash) - assert.Equal(t, hexToBigInt("0x4444444444444444"), block.Nonce) - assert.Equal(t, types.MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), block.Sha3Uncles) - assert.Equal(t, hexToBytes("0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666"), block.LogsBloom) - assert.Equal(t, types.MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", types.PadNone), block.TransactionsRoot) - assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.StateRoot) - assert.Equal(t, types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone), block.ReceiptsRoot) - assert.Equal(t, types.MustAddressFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), block.Miner) - assert.Equal(t, hexToBigInt("0xbbbbbb"), block.Difficulty) - assert.Equal(t, hexToBigInt("0xcccccc"), block.TotalDifficulty) - assert.Equal(t, hexToBytes("0x0000000000000000000000000000000000000000000000000000000000000000"), block.ExtraData) - assert.Equal(t, hexToBigInt("0xdddddd").Uint64(), block.Size) - assert.Equal(t, hexToBigInt("0xeeeeee").Uint64(), block.GasLimit) - assert.Equal(t, hexToBigInt("0xffffff").Uint64(), block.GasUsed) - assert.Equal(t, int64(1424182926), block.Timestamp.Unix()) - require.Len(t, block.Transactions, 1) - require.Len(t, block.Uncles, 1) - assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), block.Transactions[0].Hash) - assert.Equal(t, uint64(0x22), *block.Transactions[0].Nonce) - assert.Equal(t, types.MustAddressFromHexPtr("0x5555555555555555555555555555555555555555"), block.Transactions[0].From) - assert.Equal(t, types.MustAddressFromHexPtr("0x6666666666666666666666666666666666666666"), block.Transactions[0].To) - assert.Equal(t, big.NewInt(10000000000), block.Transactions[0].Value) - assert.Equal(t, uint64(30400), *block.Transactions[0].GasLimit) - assert.Equal(t, big.NewInt(10000000000000), block.Transactions[0].GasPrice) - assert.Equal(t, hexToBytes("0x777777777777"), block.Transactions[0].Input) - assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.Uncles[0]) -} - -const mockBlockByHashRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBlockByHash", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", - true - ] - } -` - -func TestBaseClient_BlockByHash(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockBlockByNumberResponse)), - } - - block, err := client.BlockByHash( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - true, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockBlockByHashRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) -} - -const mockGetTransactionByHashRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getTransactionByHash", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" - ] - } -` - -const mockGetTransactionByHashResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x22", - "from": "0x3333333333333333333333333333333333333333", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "hash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "input": "0x555555555555", - "nonce": "0x66", - "to": "0x7777777777777777777777777777777777777777", - "transactionIndex": "0x0", - "value": "0x2540be400", - "v": "0x88", - "r": "0x9999999999999999999999999999999999999999999999999999999999999999", - "s": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - } -` - -func TestBaseClient_GetTransactionByHash(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionByHashResponse)), - } - - tx, err := client.GetTransactionByHash( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetTransactionByHashRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), tx.BlockHash) - assert.Equal(t, big.NewInt(0x22), tx.BlockNumber) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), tx.Hash) - assert.Equal(t, types.MustAddressFromHexPtr("0x3333333333333333333333333333333333333333"), tx.From) - assert.Equal(t, types.MustAddressFromHexPtr("0x7777777777777777777777777777777777777777"), tx.To) - assert.Equal(t, big.NewInt(10000000000), tx.Value) - assert.Equal(t, uint64(30400), *tx.GasLimit) - assert.Equal(t, big.NewInt(10000000000000), tx.GasPrice) - assert.Equal(t, hexToBytes("0x555555555555"), tx.Input) - assert.Equal(t, uint64(0x66), *tx.Nonce) - assert.Equal(t, hexToBigInt("0x0").Uint64(), *tx.TransactionIndex) - assert.Equal(t, uint8(0x88), tx.Signature.Bytes()[64]) - assert.Equal(t, hexToBytes("0x9999999999999999999999999999999999999999999999999999999999999999"), tx.Signature.Bytes()[:32]) - assert.Equal(t, hexToBytes("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), tx.Signature.Bytes()[32:64]) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), tx.Hash) -} - -const mockGetTransactionByBlockHashAndIndexRequest = ` - { - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getTransactionByBlockHashAndIndex", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", - "0x0" - ] - } -` - -func TestBaseClient_GetTransactionByBlockHashAndIndex(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionByHashResponse)), - } - - tx, err := client.GetTransactionByBlockHashAndIndex( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - 0, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetTransactionByBlockHashAndIndexRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), tx.Hash) -} - -const mockGetTransactionByBlockNumberAndIndexRequest = ` - { - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getTransactionByBlockNumberAndIndex", - "params": [ - "0x1", - "0x2" - ] - } -` - -func TestBaseClient_GetTransactionByBlockNumberAndIndex(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionByHashResponse)), - } - - tx, err := client.GetTransactionByBlockNumberAndIndex( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - 2, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetTransactionByBlockNumberAndIndexRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), tx.Hash) -} - -const mockGetTransactionReceiptRequest = ` - { - "id": 1, - "jsonrpc": "2.0", - "method": "eth_getTransactionReceipt", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" - ] - } -` - -const mockGetTransactionReceiptResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "contractAddress": null, - "cumulativeGasUsed": "0x33333", - "effectiveGasPrice":"0x4444444444", - "from": "0x5555555555555555555555555555555555555555", - "gasUsed": "0x66666", - "logs": [ - { - "address": "0x7777777777777777777777777777777777777777", - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", - "logIndex": "0x8", - "removed": false, - "topics": [ - "0x9999999999999999999999999999999999999999999999999999999999999999" - ], - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11" - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", - "status": "0x1", - "to": "0x7777777777777777777777777777777777777777", - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11", - "type": "0x0" - } - } -` - -func TestBaseClient_GetTransactionReceipt(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetTransactionReceiptResponse)), - } - - receipt, err := client.GetTransactionReceipt( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - ) - - status := uint64(1) - require.NoError(t, err) - assert.JSONEq(t, mockGetTransactionReceiptRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipt.TransactionHash) - assert.Equal(t, uint64(17), receipt.TransactionIndex) - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipt.BlockHash) - assert.Equal(t, big.NewInt(0x2222), receipt.BlockNumber) - assert.Equal(t, (*types.Address)(nil), receipt.ContractAddress) - assert.Equal(t, hexToBigInt("0x33333").Uint64(), receipt.CumulativeGasUsed) - assert.Equal(t, hexToBigInt("0x4444444444"), receipt.EffectiveGasPrice) - assert.Equal(t, hexToBigInt("0x66666").Uint64(), receipt.GasUsed) - assert.Equal(t, types.MustAddressFromHex("0x5555555555555555555555555555555555555555"), receipt.From) - assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipt.To) - assert.Equal(t, hexToBytes("0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000"), receipt.LogsBloom) - assert.Equal(t, &status, receipt.Status) - require.Len(t, receipt.Logs, 1) - assert.Equal(t, types.MustHashFromHexPtr("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipt.Logs[0].TransactionHash) - assert.Equal(t, uint64(17), *receipt.Logs[0].TransactionIndex) - assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), receipt.Logs[0].BlockHash) - assert.Equal(t, big.NewInt(0x2222), receipt.Logs[0].BlockNumber) - assert.Equal(t, uint64(8), *receipt.Logs[0].LogIndex) - assert.Equal(t, hexToBytes("0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35"), receipt.Logs[0].Data) - assert.Equal(t, types.MustAddressFromHex("0x7777777777777777777777777777777777777777"), receipt.Logs[0].Address) - assert.Equal(t, []types.Hash{types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone)}, receipt.Logs[0].Topics) - assert.Equal(t, false, receipt.Logs[0].Removed) -} - -const mockGetBlockReceiptsRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getBlockReceipts", - "params": [ - "0x1" - ] - } -` - -const mockGetBlockReceiptsResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "contractAddress": null, - "cumulativeGasUsed": "0x33333", - "effectiveGasPrice": "0x4444444444", - "from": "0x5555555555555555555555555555555555555555", - "gasUsed": "0x66666", - "logs": [ - { - "address": "0x7777777777777777777777777777777777777777", - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", - "logIndex": "0x8", - "removed": false, - "topics": [ - "0x9999999999999999999999999999999999999999999999999999999999999999" - ], - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11" - } - ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", - "status": "0x1", - "to": "0x7777777777777777777777777777777777777777", - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11", - "type": "0x0" - } - ] - } -` - -func TestBaseClient_GetBlockReceipts(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetBlockReceiptsResponse)), - } - - receipts, err := client.GetBlockReceipts( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetBlockReceiptsRequest, readBody(httpMock.Request)) - require.Len(t, receipts, 1) - assert.Equal(t, types.MustHashFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", types.PadNone), receipts[0].TransactionHash) -} - -const mockGetUncleByBlockHashAndIndexRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getUncleByBlockHashAndIndex", - "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", - "0x0" - ] - } -` - -func TestBaseClient_GetUncleByBlockHashAndIndex(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockBlockByNumberResponse)), - } - - block, err := client.GetUncleByBlockHashAndIndex( - context.Background(), - types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), - 0, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetUncleByBlockHashAndIndexRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) -} - -const mockGetUncleByBlockNumberAndIndexRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getUncleByBlockNumberAndIndex", - "params": [ - "0x1", - "0x2" - ] - } -` - -func TestBaseClient_GetUncleByBlockNumberAndIndex(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockBlockByNumberResponse)), - } - - block, err := client.GetUncleByBlockNumberAndIndex( - context.Background(), - types.MustBlockNumberFromHex("0x1"), - 2, - ) - - require.NoError(t, err) - assert.JSONEq(t, mockGetUncleByBlockNumberAndIndexRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) -} - -const mockNewFilterRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_newFilter", - "params": [ - { - "fromBlock": "0x1", - "toBlock": "0x2", - "address": "0x3333333333333333333333333333333333333333", - "topics": ["0x4444444444444444444444444444444444444444444444444444444444444444"] - } - ] - } -` - -const mockNewFilterResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_NewFilter(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockNewFilterResponse)), - } - - from := types.MustBlockNumberFromHex("0x1") - to := types.MustBlockNumberFromHex("0x2") - filterID, err := client.NewFilter(context.Background(), &types.FilterLogsQuery{ - FromBlock: &from, - ToBlock: &to, - Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, - Topics: [][]types.Hash{ - {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, - }, - }) - - require.NoError(t, err) - assert.JSONEq(t, mockNewFilterRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(1), filterID) -} - -const mockNewBlockFilterRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_newBlockFilter", - "params": [] - } -` - -const mockNewBlockFilterResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_NewBlockFilter(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockNewBlockFilterResponse)), - } - - filterID, err := client.NewBlockFilter(context.Background()) - - require.NoError(t, err) - assert.JSONEq(t, mockNewBlockFilterRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(1), filterID) -} - -const mockNewPendingTransactionFilterRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_newPendingTransactionFilter", - "params": [] - } -` - -const mockNewPendingTransactionFilterResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_NewPendingTransactionFilter(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockNewPendingTransactionFilterResponse)), - } - - filterID, err := client.NewPendingTransactionFilter(context.Background()) - - require.NoError(t, err) - assert.JSONEq(t, mockNewPendingTransactionFilterRequest, readBody(httpMock.Request)) - assert.Equal(t, big.NewInt(1), filterID) -} - -const mockUninstallFilterRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_uninstallFilter", - "params": ["0x1"] - } -` - -const mockUninstallFilterResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": true - } -` - -func TestBaseClient_UninstallFilter(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockUninstallFilterResponse)), - } - - filterID := big.NewInt(1) - success, err := client.UninstallFilter(context.Background(), filterID) - - require.NoError(t, err) - assert.JSONEq(t, mockUninstallFilterRequest, readBody(httpMock.Request)) - assert.True(t, success) -} - -const mockGetFilterChangesRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getFilterChanges", - "params": ["0x1"] - } -` - -const mockGetFilterChangesResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "address": "0x1111111111111111111111111111111111111111", - "topics": ["0x2222222222222222222222222222222222222222222222222222222222222222"], - "data": "0x3333333333333333333333333333333333333333333333333333333333333333", - "blockNumber": "0x44444", - "transactionHash": "0x5555555555555555555555555555555555555555555555555555555555555555", - "transactionIndex": "0x66", - "blockHash": "0x7777777777777777777777777777777777777777777777777777777777777777", - "logIndex": "0x88", - "removed": false - } - ] - } -` - -func TestBaseClient_GetFilterChanges(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetFilterChangesResponse)), - } - - filterID := big.NewInt(1) - logs, err := client.GetFilterChanges(context.Background(), filterID) - - require.NoError(t, err) - assert.JSONEq(t, mockGetFilterChangesRequest, readBody(httpMock.Request)) - assert.Len(t, logs, 1) - assert.Equal(t, types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), logs[0].Address) - assert.Equal(t, []types.Hash{types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone)}, logs[0].Topics) - assert.Equal(t, hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), logs[0].Data) - assert.Equal(t, types.MustBlockNumberFromHexPtr("0x44444").Big(), logs[0].BlockNumber) - assert.Equal(t, types.MustHashFromHexPtr("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), logs[0].TransactionHash) - assert.Equal(t, uint64(0x66), *logs[0].TransactionIndex) - assert.Equal(t, types.MustHashFromHexPtr("0x7777777777777777777777777777777777777777777777777777777777777777", types.PadNone), logs[0].BlockHash) - assert.Equal(t, uint64(0x88), *logs[0].LogIndex) - assert.False(t, logs[0].Removed) -} - -const mockGetBlockFilterChangesRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getFilterChanges", - "params": ["0x1"] - } -` - -const mockGetBlockFilterChangesResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": ["0x1111111111111111111111111111111111111111111111111111111111111111"] - } -` - -func TestBaseClient_GetBlockFilterChanges(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetBlockFilterChangesResponse)), - } - - filterID := big.NewInt(1) - blockHashes, err := client.GetBlockFilterChanges(context.Background(), filterID) - - require.NoError(t, err) - assert.JSONEq(t, mockGetBlockFilterChangesRequest, readBody(httpMock.Request)) - assert.Len(t, blockHashes, 1) - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), blockHashes[0]) -} - -const mockGetFilterLogsRequest = ` -{ - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getFilterLogs", - "params": ["0x1"] -} -` - -const mockGetFilterLogsResponse = ` -{ - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "address": "0x1111111111111111111111111111111111111111", - "topics": ["0x2222222222222222222222222222222222222222222222222222222222222222"], - "data": "0x3333333333333333333333333333333333333333333333333333333333333333", - "blockNumber": "0x1", - "transactionHash": "0x5555555555555555555555555555555555555555555555555555555555555555", - "transactionIndex": "0x0", - "blockHash": "0x7777777777777777777777777777777777777777777777777777777777777777", - "logIndex": "0x1", - "removed": false - } - ] -} -` - -func TestBaseClient_GetFilterLogs(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetFilterLogsResponse)), - } - - filterID := big.NewInt(1) - logs, err := client.GetFilterLogs(context.Background(), filterID) - - require.NoError(t, err) - assert.JSONEq(t, mockGetFilterLogsRequest, readBody(httpMock.Request)) - assert.Len(t, logs, 1) - assert.Equal(t, types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), logs[0].Address) - assert.Equal(t, []types.Hash{types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone)}, logs[0].Topics) - assert.Equal(t, hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), logs[0].Data) - assert.Equal(t, big.NewInt(1), logs[0].BlockNumber) - assert.Equal(t, types.MustHashFromHexPtr("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), logs[0].TransactionHash) - assert.Equal(t, uint64(0), *logs[0].TransactionIndex) - assert.Equal(t, types.MustHashFromHexPtr("0x7777777777777777777777777777777777777777777777777777777777777777", types.PadNone), logs[0].BlockHash) - assert.Equal(t, uint64(1), *logs[0].LogIndex) - assert.False(t, logs[0].Removed) -} - -const mockGetLogsRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_getLogs", - "params": [ - { - "fromBlock": "0x1", - "toBlock": "0x2", - "address": "0x3333333333333333333333333333333333333333", - "topics": [ - "0x4444444444444444444444444444444444444444444444444444444444444444" - ] - } - ] - } -` - -const mockGetLogsResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": [ - { - "address": "0x3333333333333333333333333333333333333333", - "topics": [ - "0x4444444444444444444444444444444444444444444444444444444444444444" - ], - "data": "0x68656c6c6f21", - "blockNumber": "0x1", - "transactionHash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "transactionIndex": "0x0", - "blockHash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "logIndex": "0x0", - "removed": false - } - ] - } -` - -func TestBaseClient_GetLogs(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockGetLogsResponse)), - } - - from := types.MustBlockNumberFromHex("0x1") - to := types.MustBlockNumberFromHex("0x2") - logs, err := client.GetLogs(context.Background(), &types.FilterLogsQuery{ - FromBlock: &from, - ToBlock: &to, - Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, - Topics: [][]types.Hash{ - {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, - }, - }) - require.NoError(t, err) - assert.JSONEq(t, mockGetLogsRequest, readBody(httpMock.Request)) - require.Len(t, logs, 1) - assert.Equal(t, types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), logs[0].Address) - assert.Equal(t, types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].Topics[0]) - assert.Equal(t, hexToBytes("0x68656c6c6f21"), logs[0].Data) - assert.Equal(t, big.NewInt(1), logs[0].BlockNumber) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].TransactionHash) - assert.Equal(t, uint64(0), *logs[0].TransactionIndex) - assert.Equal(t, types.MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].BlockHash) - assert.Equal(t, uint64(0), *logs[0].LogIndex) - assert.Equal(t, false, logs[0].Removed) -} - -const mockMaxPriorityFeePerGasRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_maxPriorityFeePerGas", - "params": [] - } -` - -const mockMaxPriorityFeePerGasResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1" - } -` - -func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { - httpMock := newHTTPMock() - client := &baseClient{transport: httpMock} - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockMaxPriorityFeePerGasResponse)), - } - - gasPrice, err := client.MaxPriorityFeePerGas(context.Background()) - require.NoError(t, err) - assert.JSONEq(t, mockMaxPriorityFeePerGasRequest, readBody(httpMock.Request)) - assert.Equal(t, hexToBigInt("0x1"), gasPrice) -} - -const mockSubscribeLogsResponse = ` - { - "address": "0x3333333333333333333333333333333333333333", - "topics": [ - "0x4444444444444444444444444444444444444444444444444444444444444444" - ], - "data": "0x68656c6c6f21", - "blockNumber": "0x1", - "transactionHash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "transactionIndex": "0x0", - "blockHash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "logIndex": "0x0", - "removed": false - } -` - -func TestBaseClient_SubscribeLogs(t *testing.T) { - streamMock := newStreamMock(t) - client := &baseClient{transport: streamMock} - - // Mock subscribe response - rawCh := make(chan json.RawMessage) - query := &types.FilterLogsQuery{ - FromBlock: types.BlockNumberFromUint64Ptr(1), - ToBlock: types.BlockNumberFromUint64Ptr(2), - Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, - Topics: [][]types.Hash{ - {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, - }, - } - streamMock.SubscribeMocks = append(streamMock.SubscribeMocks, subscribeMock{ - ArgMethod: "logs", - ArgParams: []any{query}, - RetCh: rawCh, - RetID: "1", - RetErr: nil, - }) - streamMock.UnsubscribeMocks = append(streamMock.UnsubscribeMocks, unsubscribeMock{ - ArgID: "1", - }) - - // Subscribe - ctx, ctxCancel := context.WithCancel(context.Background()) - defer ctxCancel() - logsCh, err := client.SubscribeLogs(ctx, query) - - // Assert subscribe response - require.NotNil(t, logsCh) - require.NoError(t, err) - - // Mock response - rawCh <- json.RawMessage(mockSubscribeLogsResponse) - - // Assert received log - logs := <-logsCh - require.NotNil(t, logs) - assert.Equal(t, "0x3333333333333333333333333333333333333333", logs.Address.String()) - assert.Equal(t, "0x4444444444444444444444444444444444444444444444444444444444444444", logs.Topics[0].String()) - assert.Equal(t, "0x68656c6c6f21", hexutil.BytesToHex(logs.Data)) - assert.Equal(t, "1", logs.BlockNumber.String()) - assert.Equal(t, "0x4444444444444444444444444444444444444444444444444444444444444444", logs.TransactionHash.String()) - assert.Equal(t, uint64(0), *logs.TransactionIndex) - assert.Equal(t, "0x4444444444444444444444444444444444444444444444444444444444444444", logs.BlockHash.String()) - assert.Equal(t, uint64(0), *logs.LogIndex) - assert.Equal(t, false, logs.Removed) - - ctxCancel() - assert.Eventually(t, func() bool { - return len(streamMock.UnsubscribeMocks) == 0 - }, time.Second, 10*time.Millisecond) -} - -const mockSubscribeNewHeadsResponse = ` - { - "number": "0x11", - "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", - "parentHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "nonce": "0x4444444444444444", - "sha3Uncles": "0x5555555555555555555555555555555555555555555555555555555555555555", - "logsBloom": "0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", - "transactionsRoot": "0x7777777777777777777777777777777777777777777777777777777777777777", - "stateRoot": "0x8888888888888888888888888888888888888888888888888888888888888888", - "receiptsRoot": "0x9999999999999999999999999999999999999999999999999999999999999999", - "miner": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "difficulty": "0xbbbbbb", - "totalDifficulty": "0xcccccc", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "size": "0xdddddd", - "gasLimit": "0xeeeeee", - "gasUsed": "0xffffff", - "timestamp": "0x54e34e8e", - "transactions": [ - { - "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "nonce": "0x22", - "blockHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "blockNumber": "0x4444", - "transactionIndex": "0x01", - "from": "0x5555555555555555555555555555555555555555", - "to": "0x6666666666666666666666666666666666666666", - "value": "0x2540be400", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "input": "0x777777777777" - } - ], - "uncles": [ - "0x8888888888888888888888888888888888888888888888888888888888888888" - ] - } -` - -func TestBaseClient_SubscribeNewHeads(t *testing.T) { - streamMock := newStreamMock(t) - client := &baseClient{transport: streamMock} - - // Mock subscribe response - rawCh := make(chan json.RawMessage) - streamMock.SubscribeMocks = append(streamMock.SubscribeMocks, subscribeMock{ - ArgMethod: "newHeads", - ArgParams: []any{}, - RetCh: rawCh, - RetID: "1", - RetErr: nil, - }) - streamMock.UnsubscribeMocks = append(streamMock.UnsubscribeMocks, unsubscribeMock{ - ArgID: "1", - }) - - // Subscribe - ctx, ctxCancel := context.WithCancel(context.Background()) - defer ctxCancel() - headsCh, err := client.SubscribeNewHeads(ctx) - - // Assert subscribe response - require.NotNil(t, headsCh) - require.NoError(t, err) - - // Mock response - rawCh <- json.RawMessage(mockSubscribeNewHeadsResponse) - - // Assert received block - block := <-headsCh - require.NotNil(t, block) - assert.Equal(t, big.NewInt(0x11), block.Number) - assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), block.Hash) - assert.Equal(t, types.MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", types.PadNone), block.ParentHash) - assert.Equal(t, hexToBigInt("0x4444444444444444"), block.Nonce) - assert.Equal(t, types.MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", types.PadNone), block.Sha3Uncles) - assert.Equal(t, hexToBytes("0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666"), block.LogsBloom) - assert.Equal(t, types.MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", types.PadNone), block.TransactionsRoot) - assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.StateRoot) - assert.Equal(t, types.MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", types.PadNone), block.ReceiptsRoot) - assert.Equal(t, types.MustAddressFromHex("0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"), block.Miner) - assert.Equal(t, hexToBigInt("0xbbbbbb"), block.Difficulty) - assert.Equal(t, hexToBigInt("0xcccccc"), block.TotalDifficulty) - assert.Equal(t, hexToBytes("0x0000000000000000000000000000000000000000000000000000000000000000"), block.ExtraData) - assert.Equal(t, hexToBigInt("0xdddddd").Uint64(), block.Size) - assert.Equal(t, hexToBigInt("0xeeeeee").Uint64(), block.GasLimit) - assert.Equal(t, hexToBigInt("0xffffff").Uint64(), block.GasUsed) - assert.Equal(t, int64(1424182926), block.Timestamp.Unix()) - require.Len(t, block.Transactions, 1) - require.Len(t, block.Uncles, 1) - assert.Equal(t, types.MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), block.Transactions[0].Hash) - assert.Equal(t, uint64(0x22), *block.Transactions[0].Nonce) - assert.Equal(t, types.MustAddressFromHexPtr("0x5555555555555555555555555555555555555555"), block.Transactions[0].From) - assert.Equal(t, types.MustAddressFromHexPtr("0x6666666666666666666666666666666666666666"), block.Transactions[0].To) - assert.Equal(t, big.NewInt(10000000000), block.Transactions[0].Value) - assert.Equal(t, uint64(30400), *block.Transactions[0].GasLimit) - assert.Equal(t, big.NewInt(10000000000000), block.Transactions[0].GasPrice) - assert.Equal(t, hexToBytes("0x777777777777"), block.Transactions[0].Input) - assert.Equal(t, types.MustHashFromHex("0x8888888888888888888888888888888888888888888888888888888888888888", types.PadNone), block.Uncles[0]) - - ctxCancel() - assert.Eventually(t, func() bool { - return len(streamMock.UnsubscribeMocks) == 0 - }, time.Second, 10*time.Millisecond) -} - -const mockSubscribeNewPendingTransactions = `"0x1111111111111111111111111111111111111111111111111111111111111111"` - -func TestClient_SubscribeNewPendingTransactions(t *testing.T) { - streamMock := newStreamMock(t) - client := &baseClient{transport: streamMock} - - // Mock subscribe response - rawCh := make(chan json.RawMessage) - streamMock.SubscribeMocks = append(streamMock.SubscribeMocks, subscribeMock{ - ArgMethod: "newPendingTransactions", - ArgParams: []any{}, - RetCh: rawCh, - RetID: "1", - RetErr: nil, - }) - streamMock.UnsubscribeMocks = append(streamMock.UnsubscribeMocks, unsubscribeMock{ - ArgID: "1", - }) - - // Subscribe to logs - ctx, ctxCancel := context.WithCancel(context.Background()) - defer ctxCancel() - txCh, err := client.SubscribeNewPendingTransactions(ctx) - - // Assert subscribe request - require.NotNil(t, txCh) - require.NoError(t, err) - - // Mock response - rawCh <- json.RawMessage(mockSubscribeNewPendingTransactions) - - // Assert response - tx := <-txCh - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), tx) - - ctxCancel() - assert.Eventually(t, func() bool { - return len(streamMock.UnsubscribeMocks) == 0 - }, time.Second, 10*time.Millisecond) -} - -func readBody(r *http.Request) string { - body, _ := io.ReadAll(r.Body) - return string(body) -} - -func hexToBytes(s string) []byte { - b, _ := hexutil.HexToBytes(s) - return b -} - -func hexToBigInt(s string) *big.Int { - b, _ := hexutil.HexToBigInt(s) - return b -} diff --git a/rpc/client.go b/rpc/client.go index 5e569fe..a23808a 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -6,7 +6,6 @@ import ( "reflect" "sort" - "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" "github.com/defiweb/go-eth/wallet" @@ -61,7 +60,7 @@ func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ apply: func(ctx *ClientOptionsContext, _ any) error { - ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{}) + ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, order: 100, @@ -272,7 +271,7 @@ func WithChainID(opts ChainIDOptions) ClientOption { func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ apply: func(ctx *ClientOptionsContext, _ any) error { - ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{recoverer: crypto.ECRecoverer}) + ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, order: 1000, diff --git a/rpc/client_test.go b/rpc/client_test.go deleted file mode 100644 index 302a5ab..0000000 --- a/rpc/client_test.go +++ /dev/null @@ -1,189 +0,0 @@ -package rpc - -import ( - "bytes" - "context" - "io" - "math/big" - "net/http" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - - "github.com/defiweb/go-eth/types" -) - -func TestClient_Sign(t *testing.T) { - httpMock := newHTTPMock() - keyMock := &keyMock{} - keyMock.addressCallback = func() types.Address { - return types.MustAddressFromHex("0x1111111111111111111111111111111111111111") - } - keyMock.signMessageCallback = func(message []byte) (*types.Signature, error) { - return types.MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), nil - } - - client, _ := NewClient(WithTransport(httpMock), WithKeys(keyMock)) - - signature, err := client.Sign( - context.Background(), - types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), - []byte("All your base are belong to us"), - ) - require.NoError(t, err) - assert.Equal(t, types.MustSignatureFromHex("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), *signature) -} - -func TestClient_SignTransaction(t *testing.T) { - httpMock := newHTTPMock() - keyMock := &keyMock{} - keyMock.addressCallback = func() types.Address { - return types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - } - keyMock.signTransactionCallback = func(tx *types.Transaction) error { - tx.Signature = types.MustSignatureFromHexPtr("0x2222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333333311") - return nil - } - - client, _ := NewClient(WithTransport(httpMock), WithKeys(keyMock)) - - from := types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - to := types.MustAddressFromHex("0xd46e8dd67c5d32be8058bb8eb970870f07244567") - gasLimit := uint64(30400) - chainID := uint64(1) - raw, tx, err := client.SignTransaction( - context.Background(), - &types.Transaction{ - ChainID: &chainID, - Call: types.Call{ - From: &from, - To: &to, - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"), - }, - }, - ) - - require.NoError(t, err) - assert.Equal(t, hexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), raw) - assert.Equal(t, &to, tx.To) - assert.Equal(t, uint64(30400), *tx.GasLimit) - assert.Equal(t, big.NewInt(10000000000000), tx.GasPrice) - assert.Equal(t, big.NewInt(10000000000), tx.Value) - assert.Equal(t, hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"), tx.Input) - assert.Equal(t, uint8(0x11), tx.Signature.Bytes()[64]) - assert.Equal(t, hexToBytes("0x2222222222222222222222222222222222222222222222222222222222222222"), tx.Signature.Bytes()[:32]) - assert.Equal(t, hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), tx.Signature.Bytes()[32:64]) -} - -func TestClient_SendTransaction(t *testing.T) { - httpMock := newHTTPMock() - keyMock := &keyMock{} - keyMock.addressCallback = func() types.Address { - return types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - } - keyMock.signTransactionCallback = func(tx *types.Transaction) error { - tx.Signature = types.MustSignatureFromHexPtr("0x2222222222222222222222222222222222222222222222222222222222222222333333333333333333333333333333333333333333333333333333333333333311") - return nil - } - - client, _ := NewClient(WithTransport(httpMock), WithKeys(keyMock)) - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockSendRawTransactionResponse)), - } - - from := types.MustAddressFromHex("0xb60e8dd61c5d32be8058bb8eb970870f07233155") - to := types.MustAddressFromHex("0xd46e8dd67c5d32be8058bb8eb970870f07244567") - gasLimit := uint64(30400) - gasPrice := big.NewInt(10000000000000) - value := big.NewInt(10000000000) - input := hexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675") - chainID := uint64(1) - txHash, tx, err := client.SendTransaction( - context.Background(), - &types.Transaction{ - ChainID: &chainID, - Call: types.Call{ - From: &from, - To: &to, - GasLimit: &gasLimit, - GasPrice: gasPrice, - Value: value, - Input: input, - }, - }, - ) - require.NoError(t, err) - assert.JSONEq(t, mockSendRawTransactionRequest, readBody(httpMock.Request)) - assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) - assert.Equal(t, &to, tx.To) - assert.Equal(t, gasLimit, *tx.GasLimit) - assert.Equal(t, gasPrice, tx.GasPrice) - assert.Equal(t, value, tx.Value) - assert.Equal(t, input, tx.Input) -} - -func TestClient_Call(t *testing.T) { - httpMock := newHTTPMock() - client, _ := NewClient( - WithTransport(httpMock), - WithDefaultAddress(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")), - ) - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockCallResponse)), - } - - to := types.MustAddressFromHex("0x2222222222222222222222222222222222222222") - gasLimit := uint64(30400) - _, _, err := client.Call( - context.Background(), - &types.Call{ - From: nil, - To: &to, - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), - }, - types.BlockNumberFromUint64(1), - ) - require.NoError(t, err) - assert.JSONEq(t, mockCallRequest, readBody(httpMock.Request)) -} - -func TestClient_EstimateGas(t *testing.T) { - httpMock := newHTTPMock() - client, _ := NewClient( - WithTransport(httpMock), - WithDefaultAddress(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")), - ) - - httpMock.ResponseMock = &http.Response{ - StatusCode: 200, - Body: io.NopCloser(bytes.NewBufferString(mockEstimateGasResponse)), - } - - to := types.MustAddressFromHex("0x2222222222222222222222222222222222222222") - gasLimit := uint64(30400) - _, _, err := client.EstimateGas( - context.Background(), - &types.Call{ - From: nil, - To: &to, - GasLimit: &gasLimit, - GasPrice: big.NewInt(10000000000000), - Value: big.NewInt(10000000000), - Input: hexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), - }, - types.LatestBlockNumber, - ) - require.NoError(t, err) - assert.JSONEq(t, mockEstimateGasRequest, readBody(httpMock.Request)) -} diff --git a/rpc/hijack_simulate.go b/rpc/hijack_simulate.go index d4268fc..8f28b9b 100644 --- a/rpc/hijack_simulate.go +++ b/rpc/hijack_simulate.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/txsign" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) @@ -13,8 +13,7 @@ import ( // hijackSimulate hijacks "eth_send*Transaction" methods and simulates the // transaction execution before sending it. type hijackSimulate struct { - decoder types.RPCTransactionDecoder - recoverer crypto.Recoverer + decoder types.RPCTransactionDecoder } // Call implements the transport.Hijacker interface. @@ -76,7 +75,7 @@ func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx // Recover transaction sender if not present: txd := tx.TransactionData() if txc, ok := tx.(types.HasCallData); ok && txd.Signature != nil && txc.CallData().From == nil { - from, err := h.recoverer.RecoverTransaction(tx) + from, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("unable to recover transaction sender: %w", err) } diff --git a/rpc/hijack_simulate_test.go b/rpc/hijack_simulate_test.go index 36a470b..0a66c33 100644 --- a/rpc/hijack_simulate_test.go +++ b/rpc/hijack_simulate_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/hexutil" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" @@ -117,8 +116,7 @@ func TestHijackSimulate(t *testing.T) { }, nil } hijacker := transport.NewHijacker(httpMock, &hijackSimulate{ - decoder: types.DefaultTransactionDecoder, - recoverer: crypto.ECRecoverer, + decoder: types.DefaultTransactionDecoder, }) var result any diff --git a/rpc/hijack_util.go b/rpc/hijack_util.go index eb3ad32..b71fde2 100644 --- a/rpc/hijack_util.go +++ b/rpc/hijack_util.go @@ -86,6 +86,22 @@ func convertTX(tx types.Transaction, typ types.TransactionType) types.Transactio dftx.SetDynamicFeeData(tx.DynamicFeeData()) } return dftx + case types.BlobTxType: + btx := types.NewTransactionBlob() + btx.SetTransactionData(tx.TransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + btx.SetCallData(tx.CallData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + btx.SetAccessListData(tx.AccessListData()) + } + if tx, ok := tx.(types.HasDynamicFeeData); ok { + btx.SetDynamicFeeData(tx.DynamicFeeData()) + } + if tx, ok := tx.(types.HasBlobData); ok { + btx.SetBlobData(tx.BlobData()) + } + return btx default: return nil } diff --git a/rpc/methods_common.go b/rpc/methods_common.go index aea62e5..0246787 100644 --- a/rpc/methods_common.go +++ b/rpc/methods_common.go @@ -378,3 +378,14 @@ func (c *MethodsCommon) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, err } return res.Big(), nil } + +// BlobBaseFee performs eth_blobBaseFee RPC call. +// +// It returns the expected base fee for blobs in the next block. +func (c *MethodsCommon) BlobBaseFee(ctx context.Context) (*big.Int, error) { + var res types.Number + if err := c.Transport.Call(ctx, &res, "eth_blobBaseFee"); err != nil { + return nil, err + } + return res.Big(), nil +} diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index c5711ee..3cb7cbd 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -1267,3 +1267,37 @@ func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { require.NoError(t, err) assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) } + +const mockBlobBaseFeeRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_blobBaseFee", + "params": [] + } +` + +const mockBlobBaseFeeResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1" + } +` + +func TestBaseClient_BlobBaseFee(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockBlobBaseFeeRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockBlobBaseFeeResponse)), + }, nil + } + + gasPrice, err := client.BlobBaseFee(context.Background()) + require.NoError(t, err) + assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) +} diff --git a/types/call_blob.go b/types/call_blob.go new file mode 100644 index 0000000..30edbcb --- /dev/null +++ b/types/call_blob.go @@ -0,0 +1,126 @@ +package types + +import ( + "encoding/json" + + "github.com/defiweb/go-eth/crypto/kzg4844" +) + +type CallBlob struct { + EmbedCallData + EmbedAccessListData + EmbedDynamicFeeData + EmbedBlobData +} + +func NewCallBlob() *CallBlob { + return &CallBlob{} +} + +func (c *CallBlob) Copy() *CallBlob { + if c == nil { + return nil + } + return &CallBlob{ + EmbedCallData: *c.EmbedCallData.Copy(), + EmbedAccessListData: *c.EmbedAccessListData.Copy(), + EmbedDynamicFeeData: *c.EmbedDynamicFeeData.Copy(), + EmbedBlobData: *c.EmbedBlobData.Copy(), + } +} + +func (c *CallBlob) MarshalJSON() ([]byte, error) { + call := &jsonCallBlob{ + From: c.From, + To: c.To, + Data: c.Input, + AccessList: c.AccessList, + } + if c.GasLimit != nil { + call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) + } + if c.MaxFeePerGas != nil { + call.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) + } + if c.MaxFeePerBlobGas != nil { + call.MaxFeePerBlobGas = NumberFromBigIntPtr(c.MaxFeePerBlobGas) + } + if c.MaxPriorityFeePerGas != nil { + call.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) + } + if c.Value != nil { + value := NumberFromBigInt(c.Value) + call.Value = &value + } + for _, blob := range c.Blobs { + hash := blob.Hash + if hash.IsZero() && blob.Sidecar != nil { + hash = blob.Sidecar.ComputeHash() + } + call.BlobHashes = append(call.BlobHashes, hash) + if blob.Sidecar != nil { + call.Blobs = append(call.Blobs, kzgBlob(blob.Sidecar.Blob)) + call.Commitments = append(call.Commitments, kzgCommitment(blob.Sidecar.Commitment)) + call.Proofs = append(call.Proofs, kzgProof(blob.Sidecar.Proof)) + } + } + return json.Marshal(call) +} + +func (c *CallBlob) UnmarshalJSON(data []byte) error { + call := &jsonCallBlob{} + if err := json.Unmarshal(data, call); err != nil { + return err + } + c.From = call.From + c.To = call.To + if call.GasLimit != nil { + gas := call.GasLimit.Big().Uint64() + c.GasLimit = &gas + } + if call.MaxFeePerGas != nil { + c.MaxFeePerGas = call.MaxFeePerGas.Big() + } + if call.MaxFeePerBlobGas != nil { + c.MaxFeePerBlobGas = call.MaxFeePerBlobGas.Big() + } + if call.MaxPriorityFeePerGas != nil { + c.MaxPriorityFeePerGas = call.MaxPriorityFeePerGas.Big() + } + if call.Value != nil { + c.Value = call.Value.Big() + } + c.Input = call.Data + c.AccessList = call.AccessList + if len(call.BlobHashes) > 0 { + c.Blobs = make([]Blob, len(call.BlobHashes)) + for i, hash := range call.BlobHashes { + blob := Blob{Hash: hash} + if i < len(call.Blobs) && i < len(call.Commitments) && i < len(call.Proofs) { + blob.Sidecar = &BlobSidecar{ + Blob: kzg4844.Blob(call.Blobs[i]), + Commitment: kzg4844.Commitment(call.Commitments[i]), + Proof: kzg4844.Proof(call.Proofs[i]), + } + } + c.Blobs[i] = blob + } + } + return nil +} + +type jsonCallBlob struct { + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` + MaxFeePerBlobGas *Number `json:"maxFeePerBlobGas,omitempty"` + MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` + Value *Number `json:"value,omitempty"` + Data Bytes `json:"data,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` + BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` + Blobs []kzgBlob `json:"blobs,omitempty"` + Commitments []kzgCommitment `json:"commitments,omitempty"` + Proofs []kzgProof `json:"proofs,omitempty"` +} diff --git a/types/embed.go b/types/embed.go index e1a2551..26ed2d1 100644 --- a/types/embed.go +++ b/types/embed.go @@ -30,6 +30,11 @@ type HasDynamicFeeData interface { SetDynamicFeeData(data *EmbedDynamicFeeData) } +type HasBlobData interface { + BlobData() *EmbedBlobData + SetBlobData(data *EmbedBlobData) +} + // EmbedCallData is set of common fields for calls and transactions. type EmbedCallData struct { From *Address // From is the sender address. @@ -195,3 +200,43 @@ func (c *EmbedDynamicFeeData) Copy() *EmbedDynamicFeeData { MaxPriorityFeePerGas: copyBigInt(c.MaxPriorityFeePerGas), } } + +type EmbedBlobData struct { + MaxFeePerBlobGas *big.Int + Blobs []Blob +} + +func (c *EmbedBlobData) BlobData() *EmbedBlobData { + return c +} + +func (c *EmbedBlobData) SetBlobData(data *EmbedBlobData) { + *c = *data +} + +func (c *EmbedBlobData) SetMaxFeePerBlobGas(maxFeePerBlobGas *big.Int) { + c.MaxFeePerBlobGas = maxFeePerBlobGas +} + +func (c *EmbedBlobData) SetBlobs(blobs []Blob) { + c.Blobs = blobs +} + +func (c *EmbedBlobData) AddBlob(blob Blob) { + c.Blobs = append(c.Blobs, blob) +} + +func (c *EmbedBlobData) Copy() *EmbedBlobData { + if c == nil { + return nil + } + blobs := make([]Blob, len(c.Blobs)) + for i, blob := range c.Blobs { + blobs[i].Hash = blob.Hash + blobs[i].Sidecar = copyPtr(blob.Sidecar) + } + return &EmbedBlobData{ + MaxFeePerBlobGas: copyBigInt(c.MaxFeePerBlobGas), + Blobs: blobs, + } +} diff --git a/types/structs.go b/types/structs.go index 27c6943..0b083f6 100644 --- a/types/structs.go +++ b/types/structs.go @@ -8,6 +8,9 @@ import ( "time" "github.com/defiweb/go-rlp" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/kzg4844" ) // AccessList is an EIP-2930 access list. @@ -105,6 +108,49 @@ func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { return n, nil } +// Blob is an EIP-4844 blob for blob-carrying transactions. +type Blob struct { + Hash Hash // Hash is the hash of the blob. + Sidecar *BlobSidecar // Sidecar is an optional sidecar for the blob. +} + +// BlobSidecar is part of the blob that is stored by the consensus layer. +type BlobSidecar struct { + Blob kzg4844.Blob // Blob needed by the blob pool + Commitment kzg4844.Commitment // Commitment needed by the blob pool + Proof kzg4844.Proof // Proof needed by the blob pool +} + +func NewBlob(data []byte) (Blob, error) { + if len(data) > kzg4844.BlobLength { + return Blob{}, fmt.Errorf("blob length exceeds maximum length of %d", kzg4844.BlobLength) + } + b := &kzg4844.Blob{} + copy(b[:], data) + c, err := crypto.KZGBlobToCommitment(b) + if err != nil { + return Blob{}, err + } + p, err := crypto.KZGComputeBlobProof(b, c) + if err != nil { + return Blob{}, err + } + s := &BlobSidecar{ + Blob: *b, + Commitment: c, + Proof: p, + } + return Blob{ + Hash: s.ComputeHash(), + Sidecar: s, + }, nil +} + +// ComputeHash computes the blob hash of the given blob sidecar. +func (sc *BlobSidecar) ComputeHash() Hash { + return crypto.KZGComputeBlobHashV1(sc.Commitment) +} + type TransactionOnChain struct { Decoder JSONTransactionDecoder // Decoder is an optional transaction decoder, if nil, the default decoder is used. Transaction Transaction // Transaction is the transaction data. @@ -591,3 +637,10 @@ type jsonFilterLogsQuery struct { Topics []hashList `json:"topics"` BlockHash *Hash `json:"blockhash,omitempty"` } + +// SyncStatus represents the sync status of a node. +type SyncStatus struct { + StartingBlock BlockNumber `json:"startingBlock"` + CurrentBlock BlockNumber `json:"currentBlock"` + HighestBlock BlockNumber `json:"highestBlock"` +} diff --git a/types/tx.go b/types/tx.go index 867fbe0..b14dcc7 100644 --- a/types/tx.go +++ b/types/tx.go @@ -33,10 +33,10 @@ type Transaction interface { Call() Call // CalculateHash calculates the hash of the transaction. - CalculateHash(h HashFunc) (Hash, error) + CalculateHash() (Hash, error) // CalculateSigningHash calculates the signing hash of the transaction. - CalculateSigningHash(h HashFunc) (Hash, error) + CalculateSigningHash() (Hash, error) } // TransactionDecoder is an interface that is used to decode transactions of diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index c9c33f9..2dbaabf 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -6,6 +6,8 @@ import ( "math/big" "github.com/defiweb/go-rlp" + + "github.com/defiweb/go-eth/crypto" ) type TransactionAccessList struct { @@ -31,15 +33,15 @@ func (t *TransactionAccessList) Call() Call { } } -func (t *TransactionAccessList) CalculateHash(h HashFunc) (Hash, error) { +func (t *TransactionAccessList) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err } - return h(raw), nil + return Hash(crypto.Keccak256(raw)), nil } -func (t *TransactionAccessList) CalculateSigningHash(h HashFunc) (Hash, error) { +func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { var ( chainID = uint64(0) nonce = uint64(0) @@ -84,7 +86,7 @@ func (t *TransactionAccessList) CalculateSigningHash(h HashFunc) (Hash, error) { return ZeroHash, err } bin = append([]byte{byte(AccessListTxType)}, bin...) - return h(bin), nil + return Hash(crypto.Keccak256(bin)), nil } //nolint:funlen diff --git a/types/tx_accesslist_test.go b/types/tx_accesslist_test.go index 5f025f0..6d7ee31 100644 --- a/types/tx_accesslist_test.go +++ b/types/tx_accesslist_test.go @@ -126,7 +126,7 @@ func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - sh, err := tt.tx.CalculateSigningHash(keccak256) + sh, err := tt.tx.CalculateSigningHash() require.NoError(t1, err) require.Equal(t1, tt.want, sh) }) diff --git a/types/tx_blob.go b/types/tx_blob.go new file mode 100644 index 0000000..6322f7c --- /dev/null +++ b/types/tx_blob.go @@ -0,0 +1,411 @@ +package types + +import ( + "encoding/json" + "fmt" + "math/big" + + "github.com/defiweb/go-rlp" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/kzg4844" +) + +type TransactionBlob struct { + EmbedCallData + EmbedTransactionData + EmbedAccessListData + EmbedDynamicFeeData + EmbedBlobData +} + +func NewTransactionBlob() *TransactionBlob { + return &TransactionBlob{} +} + +func (t *TransactionBlob) Type() TransactionType { + return BlobTxType +} + +func (t *TransactionBlob) Call() Call { + return &CallBlob{ + EmbedCallData: *t.EmbedCallData.Copy(), + EmbedAccessListData: *t.EmbedAccessListData.Copy(), + EmbedDynamicFeeData: *t.EmbedDynamicFeeData.Copy(), + EmbedBlobData: *t.EmbedBlobData.Copy(), + } +} + +func (t *TransactionBlob) CalculateHash() (Hash, error) { + raw, err := t.EncodeRLP() + if err != nil { + return ZeroHash, err + } + return Hash(crypto.Keccak256(raw)), nil +} + +func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasLimit = uint64(0) + maxPriorityFeePerGas = big.NewInt(0) + maxFeePerGas = big.NewInt(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + maxFeePerBlobGas = big.NewInt(0) + blobHashes = (hashList)(nil) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.MaxPriorityFeePerGas != nil { + maxPriorityFeePerGas = t.MaxPriorityFeePerGas + } + if t.MaxFeePerGas != nil { + maxFeePerGas = t.MaxFeePerGas + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + if t.MaxFeePerBlobGas != nil { + maxFeePerBlobGas = t.MaxFeePerBlobGas + } + if len(t.Blobs) > 0 { + blobHashes = make(hashList, len(t.Blobs)) + for i, blob := range t.Blobs { + if blob.Hash.IsZero() && blob.Sidecar != nil { + blobHashes[i] = blob.Sidecar.ComputeHash() + continue + } + blobHashes[i] = blob.Hash + } + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(maxPriorityFeePerGas), + rlp.NewBigInt(maxFeePerGas), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + rlp.NewBigInt(maxFeePerBlobGas), + &blobHashes, + ).EncodeRLP() + if err != nil { + return ZeroHash, err + } + bin = append([]byte{byte(BlobTxType)}, bin...) + return Hash(crypto.Keccak256(bin)), nil +} + +//nolint:funlen +func (t TransactionBlob) EncodeRLP() ([]byte, error) { + var ( + chainID = uint64(0) + nonce = uint64(0) + gasLimit = uint64(0) + maxPriorityFeePerGas = big.NewInt(0) + maxFeePerGas = big.NewInt(0) + to = ([]byte)(nil) + value = big.NewInt(0) + accessList = (AccessList)(nil) + maxFeePerBlobGas = big.NewInt(0) + blobHashes = (hashList)(nil) + v = big.NewInt(0) + r = big.NewInt(0) + s = big.NewInt(0) + ) + if t.ChainID != nil { + chainID = *t.ChainID + } + if t.Nonce != nil { + nonce = *t.Nonce + } + if t.GasLimit != nil { + gasLimit = *t.GasLimit + } + if t.MaxPriorityFeePerGas != nil { + maxPriorityFeePerGas = t.MaxPriorityFeePerGas + } + if t.MaxFeePerGas != nil { + maxFeePerGas = t.MaxFeePerGas + } + if t.To != nil { + to = t.To[:] + } + if t.Value != nil { + value = t.Value + } + if t.AccessList != nil { + accessList = t.AccessList + } + if t.MaxFeePerBlobGas != nil { + maxFeePerBlobGas = t.MaxFeePerBlobGas + } + if len(t.Blobs) > 0 { + blobHashes = make(hashList, len(t.Blobs)) + for i, blob := range t.Blobs { + if blob.Hash.IsZero() && blob.Sidecar != nil { + blobHashes[i] = blob.Sidecar.ComputeHash() + continue + } + blobHashes[i] = blob.Hash + } + } + if t.Signature != nil { + v = t.Signature.V + r = t.Signature.R + s = t.Signature.S + } + bin, err := rlp.NewList( + rlp.NewUint(chainID), + rlp.NewUint(nonce), + rlp.NewBigInt(maxPriorityFeePerGas), + rlp.NewBigInt(maxFeePerGas), + rlp.NewUint(gasLimit), + rlp.NewBytes(to), + rlp.NewBigInt(value), + rlp.NewBytes(t.Input), + &accessList, + rlp.NewBigInt(maxFeePerBlobGas), + &blobHashes, + rlp.NewBigInt(v), + rlp.NewBigInt(r), + rlp.NewBigInt(s), + ).EncodeRLP() + if err != nil { + return nil, err + } + return append([]byte{byte(BlobTxType)}, bin...), nil +} + +//nolint:funlen +func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { + *t = TransactionBlob{} + if len(data) == 0 { + return 0, fmt.Errorf("empty data") + } + if data[0] != byte(BlobTxType) { + return 0, fmt.Errorf("invalid transaction type: %d", data[0]) + } + data = data[1:] + var ( + list *rlp.ListItem + chainID = &rlp.UintItem{} + nonce = &rlp.UintItem{} + gasLimit = &rlp.UintItem{} + maxPriorityFeePerGas = &rlp.BigIntItem{} + maxFeePerGas = &rlp.BigIntItem{} + to = &rlp.StringItem{} + value = &rlp.BigIntItem{} + input = &rlp.StringItem{} + accessList = &AccessList{} + maxFeePerBlobGas = &rlp.BigIntItem{} + blobHashes = &hashList{} + v = &rlp.BigIntItem{} + r = &rlp.BigIntItem{} + s = &rlp.BigIntItem{} + ) + list = rlp.NewList( + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, + accessList, + maxFeePerBlobGas, + blobHashes, + v, + r, + s, + ) + if _, err := rlp.DecodeTo(data, list); err != nil { + return 0, err + } + if chainID.X != 0 { + t.ChainID = &chainID.X + } + if nonce.X != 0 { + t.Nonce = &nonce.X + } + if maxPriorityFeePerGas.X.Sign() != 0 { + t.MaxPriorityFeePerGas = maxPriorityFeePerGas.X + } + if maxFeePerGas.X.Sign() != 0 { + t.MaxFeePerGas = maxFeePerGas.X + } + if gasLimit.X != 0 { + t.GasLimit = &gasLimit.X + } + if len(to.Bytes()) > 0 { + t.To = AddressFromBytesPtr(to.Bytes()) + } + if value.X.Sign() != 0 { + t.Value = value.X + } + if len(input.Bytes()) > 0 { + t.Input = input.Bytes() + } + if len(*accessList) > 0 { + t.AccessList = *accessList + } + if maxFeePerBlobGas.X.Sign() != 0 { + t.MaxFeePerBlobGas = maxFeePerBlobGas.X + } + if len(*blobHashes) > 0 { + t.Blobs = make([]Blob, len(*blobHashes)) + for i, hash := range *blobHashes { + t.Blobs[i] = Blob{Hash: hash} + } + } + if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + t.Signature = &Signature{ + V: v.X, + R: r.X, + S: s.X, + } + } + return len(data), nil +} + +func (t *TransactionBlob) MarshalJSON() ([]byte, error) { + transaction := &jsonTransactionBlob{} + if t.ChainID != nil { + transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) + } + transaction.To = t.To + transaction.From = t.From + if t.GasLimit != nil { + transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) + } + if t.MaxFeePerGas != nil { + transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) + } + if t.MaxFeePerBlobGas != nil { + transaction.MaxFeePerBlobGas = NumberFromBigIntPtr(t.MaxFeePerBlobGas) + } + if t.MaxPriorityFeePerGas != nil { + transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) + } + transaction.Input = t.Input + if t.Nonce != nil { + transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) + } + if t.Value != nil { + transaction.Value = NumberFromBigIntPtr(t.Value) + } + transaction.AccessList = t.AccessList + if t.Signature != nil { + transaction.V = NumberFromBigIntPtr(t.Signature.V) + transaction.R = NumberFromBigIntPtr(t.Signature.R) + transaction.S = NumberFromBigIntPtr(t.Signature.S) + } + for _, blob := range t.Blobs { + hash := blob.Hash + if hash.IsZero() && blob.Sidecar != nil { + hash = blob.Sidecar.ComputeHash() + } + transaction.BlobHashes = append(transaction.BlobHashes, hash) + if blob.Sidecar != nil { + transaction.Blobs = append(transaction.Blobs, kzgBlob(blob.Sidecar.Blob)) + transaction.Commitments = append(transaction.Commitments, kzgCommitment(blob.Sidecar.Commitment)) + transaction.Proofs = append(transaction.Proofs, kzgProof(blob.Sidecar.Proof)) + } + } + return json.Marshal(transaction) +} + +func (t *TransactionBlob) UnmarshalJSON(data []byte) error { + transaction := &jsonTransactionBlob{} + if err := json.Unmarshal(data, transaction); err != nil { + return err + } + if transaction.ChainID != nil { + chainID := transaction.ChainID.Big().Uint64() + t.ChainID = &chainID + } + t.To = transaction.To + t.From = transaction.From + if transaction.GasLimit != nil { + gas := transaction.GasLimit.Big().Uint64() + t.GasLimit = &gas + } + if transaction.MaxFeePerGas != nil { + t.MaxFeePerGas = transaction.MaxFeePerGas.Big() + } + if transaction.MaxFeePerBlobGas != nil { + t.MaxFeePerBlobGas = transaction.MaxFeePerBlobGas.Big() + } + if transaction.MaxPriorityFeePerGas != nil { + t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() + } + t.Input = transaction.Input + if transaction.Nonce != nil { + Nonce := transaction.Nonce.Big().Uint64() + t.Nonce = &Nonce + } + if transaction.Value != nil { + t.Value = transaction.Value.Big() + } + t.AccessList = transaction.AccessList + if transaction.V != nil && transaction.R != nil && transaction.S != nil { + t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) + } + if len(transaction.BlobHashes) > 0 { + t.Blobs = make([]Blob, len(transaction.BlobHashes)) + for i, hash := range transaction.BlobHashes { + blob := Blob{Hash: hash} + if i < len(transaction.Blobs) && i < len(transaction.Commitments) && i < len(transaction.Proofs) { + blob.Sidecar = &BlobSidecar{ + Blob: kzg4844.Blob(transaction.Blobs[i]), + Commitment: kzg4844.Commitment(transaction.Commitments[i]), + Proof: kzg4844.Proof(transaction.Proofs[i]), + } + } + t.Blobs[i] = blob + } + } + return nil +} + +type jsonTransactionBlob struct { + ChainID *Number `json:"chainId,omitempty"` + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` + MaxFeePerBlobGas *Number `json:"maxFeePerBlobGas,omitempty"` + MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` + Input Bytes `json:"input,omitempty"` + Nonce *Number `json:"nonce,omitempty"` + Value *Number `json:"value,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` + BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` + Blobs []kzgBlob `json:"blobs,omitempty"` + Commitments []kzgCommitment `json:"commitments,omitempty"` + Proofs []kzgProof `json:"proofs,omitempty"` + V *Number `json:"v,omitempty"` + R *Number `json:"r,omitempty"` + S *Number `json:"s,omitempty"` +} + +var _ Transaction = (*TransactionBlob)(nil) diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go new file mode 100644 index 0000000..ebef6b8 --- /dev/null +++ b/types/tx_blob_test.go @@ -0,0 +1,153 @@ +package types + +import ( + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" +) + +func TestTransactionBlob_RLP(t *testing.T) { + tests := []struct { + tx *TransactionBlob + want []byte + }{ + { + tx: &TransactionBlob{}, + want: hexutil.MustHexToBytes("03ce8080808080808080c080c0808080"), + }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + }, + }, + }, + want: hexutil.MustHexToBytes("03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + // Encode: + rlp, err := tt.tx.EncodeRLP() + require.NoError(t1, err) + assert.Equal(t1, tt.want, rlp) + + // Decode: + tx := NewTransactionBlob() + _, err = tx.DecodeRLP(rlp) + tx.From = tt.tx.From + require.NoError(t1, err) + equalTX(t1, tx, tt.tx) + }) + } +} + +func TestTransactionBlob_CalculateSigningHash(t *testing.T) { + tests := []struct { + tx *TransactionBlob + want Hash + }{ + { + tx: &TransactionBlob{}, + want: MustHashFromHex("0x846c9b47f161837f5068b0ffb0c1a98785302f89d613338ccfa9a1c72c9f951d", PadNone), + }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + }, + want: MustHashFromHex("0x0604b49731147cf745c666f1a67bf1b5e9fbee127085b3d4c4958191590e8bce", PadNone), + }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(1)), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: AccessList{ + AccessTuple{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + }, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + }, + }, + }, + want: MustHashFromHex("0x3faa63efab3e460606c31cd9a2e8791d87e91954137571eddb3b4b0abc69e2cd", PadNone), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + sh, err := tt.tx.CalculateSigningHash() + require.NoError(t1, err) + assert.Equal(t1, tt.want, sh) + }) + } +} diff --git a/types/tx_decoder.go b/types/tx_decoder.go index 6835c51..b9b9b63 100644 --- a/types/tx_decoder.go +++ b/types/tx_decoder.go @@ -13,6 +13,7 @@ var DefaultTransactionDecoder = &TypedTransactionDecoder{ LegacyTxType: func() Transaction { return NewTransactionLegacy() }, AccessListTxType: func() Transaction { return NewTransactionAccessList() }, DynamicFeeTxType: func() Transaction { return NewTransactionDynamicFee() }, + BlobTxType: func() Transaction { return NewTransactionBlob() }, }, IgnoreUnknownTypes: true, } @@ -107,11 +108,11 @@ func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } func (t *TransactionUnknown) Call() Call { return nil } -func (t *TransactionUnknown) CalculateHash(_ HashFunc) (Hash, error) { +func (t *TransactionUnknown) CalculateHash() (Hash, error) { return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) } -func (t *TransactionUnknown) CalculateSigningHash(_ HashFunc) (Hash, error) { +func (t *TransactionUnknown) CalculateSigningHash() (Hash, error) { return ZeroHash, fmt.Errorf("unable to calculate signing hash of unknown transaction type: %d", t.UnknownType) } @@ -125,6 +126,7 @@ func jsonTXType(data []byte) (TransactionType, error) { Type *Number `json:"type"` AccessList *nilUnmarshaler `json:"accessList"` MaxFeePerGas *nilUnmarshaler `json:"maxFeePerGas"` + BlobHashes *nilUnmarshaler `json:"blobVersionedHashes"` } if err := json.Unmarshal(data, &tx); err != nil { return 0, fmt.Errorf("failed to unmarshal transaction: %w", err) @@ -132,6 +134,9 @@ func jsonTXType(data []byte) (TransactionType, error) { if tx.Type != nil { return TransactionType((*tx.Type).Big().Uint64()), nil } + if tx.BlobHashes != nil { + return BlobTxType, nil + } if tx.MaxFeePerGas != nil { return DynamicFeeTxType, nil } diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go index f54e3a8..c6e3056 100644 --- a/types/tx_decoder_test.go +++ b/types/tx_decoder_test.go @@ -135,6 +135,47 @@ func TestTransaction_RLP(t *testing.T) { }, rlp: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), }, + { + tx: &TransactionBlob{}, + rlp: hexutil.MustHexToBytes("03ce8080808080808080c080c0808080"), + }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + }, + }, + }, + rlp: hexutil.MustHexToBytes("03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { @@ -328,7 +369,76 @@ func TestTransaction_JSON(t *testing.T) { "input": "0x01020304", "Nonce": "0x1", "value": "0xde0b6b3a7640000", - "AccessList": [ + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + } + `, + }, + { + tx: &TransactionBlob{}, + json: ` + { + "type": "0x3" + } + `, + }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + }, + }, + }, + json: ` + { + "chainId": "0x1", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxFeePerBlobGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "Nonce": "0x1", + "value": "0xde0b6b3a7640000", + "accessList": [ { "address": "0x3333333333333333333333333333333333333333", "storageKeys": [ @@ -337,6 +447,9 @@ func TestTransaction_JSON(t *testing.T) { ] } ], + "blobVersionedHashes": [ + "0x6666666666666666666666666666666666666666666666666666666666666666" + ], "v": "0x6f", "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index 3ff8081..7f45760 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -6,6 +6,8 @@ import ( "math/big" "github.com/defiweb/go-rlp" + + "github.com/defiweb/go-eth/crypto" ) type TransactionDynamicFee struct { @@ -31,15 +33,15 @@ func (t *TransactionDynamicFee) Call() Call { } } -func (t *TransactionDynamicFee) CalculateHash(h HashFunc) (Hash, error) { +func (t *TransactionDynamicFee) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err } - return h(raw), nil + return Hash(crypto.Keccak256(raw)), nil } -func (t *TransactionDynamicFee) CalculateSigningHash(h HashFunc) (Hash, error) { +func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { var ( chainID = uint64(0) nonce = uint64(0) @@ -89,7 +91,7 @@ func (t *TransactionDynamicFee) CalculateSigningHash(h HashFunc) (Hash, error) { return ZeroHash, err } bin = append([]byte{byte(DynamicFeeTxType)}, bin...) - return h(bin), nil + return Hash(crypto.Keccak256(bin)), nil } //nolint:funlen diff --git a/types/tx_dynamicfee_test.go b/types/tx_dynamicfee_test.go index 35e4756..381428c 100644 --- a/types/tx_dynamicfee_test.go +++ b/types/tx_dynamicfee_test.go @@ -129,9 +129,9 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - sh, err := tt.tx.CalculateSigningHash(keccak256) + sh, err := tt.tx.CalculateSigningHash() require.NoError(t1, err) - require.Equal(t1, tt.want, sh) + assert.Equal(t1, tt.want, sh) }) } } diff --git a/types/tx_legacy.go b/types/tx_legacy.go index eebb163..9f1fa4f 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -6,6 +6,8 @@ import ( "math/big" "github.com/defiweb/go-rlp" + + "github.com/defiweb/go-eth/crypto" ) type TransactionLegacy struct { @@ -29,15 +31,15 @@ func (t *TransactionLegacy) Call() Call { } } -func (t *TransactionLegacy) CalculateHash(h HashFunc) (Hash, error) { +func (t *TransactionLegacy) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err } - return h(raw), nil + return Hash(crypto.Keccak256(raw)), nil } -func (t *TransactionLegacy) CalculateSigningHash(h HashFunc) (Hash, error) { +func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { var ( chainID = uint64(0) nonce = uint64(0) @@ -83,7 +85,7 @@ func (t *TransactionLegacy) CalculateSigningHash(h HashFunc) (Hash, error) { if err != nil { return ZeroHash, err } - return h(bin), nil + return Hash(crypto.Keccak256(bin)), nil } //nolint:funlen diff --git a/types/tx_legacy_test.go b/types/tx_legacy_test.go index 61677a7..46c6a39 100644 --- a/types/tx_legacy_test.go +++ b/types/tx_legacy_test.go @@ -139,9 +139,9 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - sh, err := tt.tx.CalculateSigningHash(keccak256) + sh, err := tt.tx.CalculateSigningHash() require.NoError(t1, err) - require.Equal(t1, tt.want, sh) + assert.Equal(t1, tt.want, sh) }) } } diff --git a/types/tx_test.go b/types/tx_test.go index bce5837..21db2ed 100644 --- a/types/tx_test.go +++ b/types/tx_test.go @@ -22,6 +22,9 @@ func equalTX(t *testing.T, actual, expected Transaction) { if _, ok := actual.(HasDynamicFeeData); ok { assert.Equal(t, expected.(HasDynamicFeeData).DynamicFeeData(), actual.(HasDynamicFeeData).DynamicFeeData()) } + if _, ok := actual.(HasBlobData); ok { + assert.Equal(t, expected.(HasBlobData).BlobData(), actual.(HasBlobData).BlobData()) + } } func derefType(t reflect.Type) reflect.Type { diff --git a/types/types.go b/types/types.go index f498036..de4cf27 100644 --- a/types/types.go +++ b/types/types.go @@ -9,12 +9,11 @@ import ( "github.com/defiweb/go-rlp" + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/kzg4844" "github.com/defiweb/go-eth/hexutil" ) -// HashFunc returns the hash for the given input. -type HashFunc func(data ...[]byte) Hash - // Pad is a padding type. type Pad uint8 @@ -119,12 +118,9 @@ func (t Address) String() string { // Checksum returns the address with the checksum calculated according to // EIP-55. -// -// HashFunc is the hash function used to calculate the checksum, most likely -// crypto.Keccak256. -func (t Address) Checksum(h HashFunc) string { +func (t Address) Checksum() string { hex := []byte(hexutil.BytesToHex(t[:])[2:]) - hash := h(hex) + hash := crypto.Keccak256(hex) for i, c := range hex { if c >= '0' && c <= '9' { continue @@ -1038,17 +1034,6 @@ func (b *Bytes) UnmarshalText(input []byte) error { return bytesUnmarshalText(input, (*[]byte)(b)) } -// -// SyncStatus type: -// - -// SyncStatus represents the sync status of a node. -type SyncStatus struct { - StartingBlock BlockNumber `json:"startingBlock"` - CurrentBlock BlockNumber `json:"currentBlock"` - HighestBlock BlockNumber `json:"highestBlock"` -} - // // Internal types: // @@ -1117,13 +1102,6 @@ func (t *hexNonce) Big() *big.Int { return new(big.Int).SetBytes(t[:]) } -func (t *hexNonce) String() string { - if t == nil { - return "" - } - return hexutil.BytesToHex(t[:]) -} - func (t hexNonce) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } @@ -1132,12 +1110,34 @@ func (t *hexNonce) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } -func (t hexNonce) MarshalText() ([]byte, error) { - return bytesMarshalText(t[:]), nil +type kzgBlob [kzg4844.BlobLength]byte + +func (t kzgBlob) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil } -func (t *hexNonce) UnmarshalText(input []byte) error { - return fixedBytesUnmarshalText(input, t[:]) +func (t *kzgBlob) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) +} + +type kzgCommitment [kzg4844.CommitmentLength]byte + +func (t kzgCommitment) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil +} + +func (t *kzgCommitment) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) +} + +type kzgProof [kzg4844.ProofLength]byte + +func (t kzgProof) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil +} + +func (t *kzgProof) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) } type hashList []Hash @@ -1157,6 +1157,34 @@ func (b *hashList) UnmarshalJSON(input []byte) error { return json.Unmarshal(input, (*[]Hash)(b)) } +func (b *hashList) EncodeRLP() ([]byte, error) { + l := rlp.NewList() + for _, hash := range *b { + hash := hash + l.Append(&hash) + } + return rlp.Encode(l) +} + +func (b *hashList) DecodeRLP(data []byte) (int, error) { + d, n, err := rlp.Decode(data) + if err != nil { + return 0, err + } + l, err := d.GetList() + if err != nil { + return 0, err + } + for _, hash := range l { + var h Hash + if err := hash.DecodeTo(&h); err != nil { + return 0, err + } + *b = append(*b, h) + } + return n, nil +} + type addressList []Address func (t addressList) MarshalJSON() ([]byte, error) { diff --git a/types/types_test.go b/types/types_test.go index b3beddb..99a802e 100644 --- a/types/types_test.go +++ b/types/types_test.go @@ -85,7 +85,7 @@ func Test_AddressType_Checksum(t *testing.T) { } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - assert.Equal(t, tt.addr, MustAddressFromHex(tt.addr).Checksum(keccak256)) + assert.Equal(t, tt.addr, MustAddressFromHex(tt.addr).Checksum()) }) } } diff --git a/types/util.go b/types/util.go index d63dfaa..323dc24 100644 --- a/types/util.go +++ b/types/util.go @@ -167,6 +167,15 @@ func copyBytes(p []byte) []byte { return c } +func copySlice[T any](p []T) []T { + if p == nil { + return nil + } + c := make([]T, len(p)) + copy(c, p) + return c +} + func copyBigInt(p *big.Int) *big.Int { if p == nil { return nil @@ -174,3 +183,12 @@ func copyBigInt(p *big.Int) *big.Int { c := new(big.Int).Set(p) return c } + +func copyHashes(p []Hash) []Hash { + if p == nil { + return nil + } + c := make([]Hash, len(p)) + copy(c, p) + return c +} diff --git a/types/util_test.go b/types/util_test.go index 57bb092..580d1c8 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -1,17 +1,5 @@ package types -import ( - "golang.org/x/crypto/sha3" -) - -func keccak256(data ...[]byte) Hash { - h := sha3.NewLegacyKeccak256() - for _, i := range data { - h.Write(i) - } - return MustHashFromBytes(h.Sum(nil), PadNone) -} - func ptr[T any](x T) *T { return &x } diff --git a/wallet/key_json_v3.go b/wallet/key_json_v3.go index ddc5c5d..f6bf11d 100644 --- a/wallet/key_json_v3.go +++ b/wallet/key_json_v3.go @@ -15,6 +15,7 @@ import ( "golang.org/x/crypto/scrypt" "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/types" ) // The code below is based on: @@ -70,7 +71,7 @@ func encryptV3Key(key *ecdsa.PrivateKey, passphrase string, scryptN, scryptP int return &jsonKey{ Version: 3, ID: id, - Address: crypto.ECPublicKeyToAddress(&key.PublicKey), + Address: types.Address(crypto.ECPublicKeyToAddress(&key.PublicKey)), Crypto: jsonKeyCrypto{ Cipher: "aes-128-ctr", CipherParams: jsonKeyCipherParams{ @@ -85,7 +86,7 @@ func encryptV3Key(key *ecdsa.PrivateKey, passphrase string, scryptN, scryptP int R: scryptR, Salt: salt, }, - MAC: mac.Bytes(), + MAC: mac[:], }, }, nil } @@ -105,7 +106,7 @@ func decryptV3Key(cryptoJson jsonKeyCrypto, passphrase []byte) ([]byte, error) { // VerifyHash the derived key matches the key in the JSON. If not, the // passphrase is incorrect. calculatedMAC := crypto.Keccak256(derivedKey[16:32], cryptoJson.CipherText) - if !bytes.Equal(calculatedMAC.Bytes(), cryptoJson.MAC) { + if !bytes.Equal(calculatedMAC[:], cryptoJson.MAC) { return nil, fmt.Errorf("invalid passphrase or keyfile") } diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 30f7a3a..1d8e332 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -2,24 +2,20 @@ package wallet import ( "context" - "crypto/ecdsa" - "crypto/rand" "encoding/json" "github.com/btcsuite/btcd/btcec/v2" "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/crypto/txsign" "github.com/defiweb/go-eth/types" ) -var s256 = btcec.S256() - type PrivateKey struct { private *ecdsa.PrivateKey public *ecdsa.PublicKey address types.Address - sign crypto.Signer - recover crypto.Recoverer } // NewKeyFromECDSA creates a new private key from an ecdsa.PrivateKey. @@ -27,9 +23,7 @@ func NewKeyFromECDSA(prv *ecdsa.PrivateKey) *PrivateKey { return &PrivateKey{ private: prv, public: &prv.PublicKey, - address: crypto.ECPublicKeyToAddress(&prv.PublicKey), - sign: crypto.ECSigner(prv), - recover: crypto.ECRecoverer, + address: types.Address(crypto.ECPublicKeyToAddress(&prv.PublicKey)), } } @@ -41,7 +35,7 @@ func NewKeyFromBytes(prv []byte) *PrivateKey { // NewRandomKey creates a random private key. func NewRandomKey() *PrivateKey { - key, err := ecdsa.GenerateKey(s256, rand.Reader) + key, err := ecdsa.GenerateKey() if err != nil { panic(err) } @@ -74,33 +68,41 @@ func (k *PrivateKey) Address() types.Address { // SignHash implements the KeyWithHashSigner interface. func (k *PrivateKey) SignHash(_ context.Context, hash types.Hash) (*types.Signature, error) { - return k.sign.SignHash(hash) + s, err := crypto.ECSignHash(k.private, ecdsa.Hash(hash)) + if err != nil { + return nil, err + } + return (*types.Signature)(s), nil } // SignMessage implements the Key interface. func (k *PrivateKey) SignMessage(_ context.Context, data []byte) (*types.Signature, error) { - return k.sign.SignMessage(data) + s, err := crypto.ECSignMessage(k.private, data) + if err != nil { + return nil, err + } + return (*types.Signature)(s), nil } // SignTransaction implements the Key interface. func (k *PrivateKey) SignTransaction(_ context.Context, tx types.Transaction) error { - return k.sign.SignTransaction(tx) + return txsign.Sign(k.private, tx) } // VerifyHash implements the KeyWithHashSigner interface. func (k *PrivateKey) VerifyHash(_ context.Context, hash types.Hash, sig types.Signature) bool { - addr, err := k.recover.RecoverHash(hash, sig) + addr, err := crypto.ECRecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) if err != nil { return false } - return *addr == k.address + return types.Address(*addr) == k.address } // VerifyMessage implements the Key interface. func (k *PrivateKey) VerifyMessage(_ context.Context, data []byte, sig types.Signature) bool { - addr, err := k.recover.RecoverMessage(data, sig) + addr, err := crypto.ECRecoverMessage(data, ecdsa.Signature(sig)) if err != nil { return false } - return *addr == k.address + return types.Address(*addr) == k.address } diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index e7be053..708d24c 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -5,6 +5,8 @@ import ( "fmt" "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/crypto/txsign" "github.com/defiweb/go-eth/types" ) @@ -19,7 +21,6 @@ type RPCSigningClient interface { type KeyRPC struct { client RPCSigningClient address types.Address - recover crypto.Recoverer decoder types.RPCTransactionDecoder } @@ -28,7 +29,6 @@ func NewKeyRPC(client RPCSigningClient, address types.Address) *KeyRPC { return &KeyRPC{ client: client, address: address, - recover: crypto.ECRecoverer, decoder: types.DefaultTransactionDecoder, } } @@ -54,7 +54,7 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro return fmt.Errorf("failed to decode signed transaction: %w", err) } tx.SetTransactionData(stx.TransactionData()) - addr, err := k.recover.RecoverTransaction(tx) + addr, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("failed to verify signed transaction: %w", err) } @@ -66,9 +66,9 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro // VerifyMessage implements the Key interface. func (k *KeyRPC) VerifyMessage(_ context.Context, data []byte, sig types.Signature) bool { - addr, err := k.recover.RecoverMessage(data, sig) + addr, err := crypto.ECRecoverMessage(data, ecdsa.Signature(sig)) if err != nil { return false } - return *addr == k.address + return types.Address(*addr) == k.address } From 5ab6fe319a6eeb37ee3c107ff51af17864f393e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 30 Sep 2024 23:14:42 +0200 Subject: [PATCH 07/44] Update blob transactions --- crypto/kzg4844/kzg4844.go | 4 +- go.mod | 2 +- go.sum | 2 + types/structs.go | 32 ++--- types/tx.go | 3 +- types/tx_accesslist.go | 116 ++++++++++--------- types/tx_blob.go | 238 ++++++++++++++++++++++++-------------- types/tx_blob_test.go | 97 +++++++++++++++- types/tx_dynamicfee.go | 125 ++++++++++---------- types/tx_legacy.go | 115 +++++++++--------- types/types.go | 161 +++++++++++++------------- types/util.go | 40 ++++--- 12 files changed, 561 insertions(+), 374 deletions(-) diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index 119337f..0dff9f5 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -10,7 +10,7 @@ import ( ) const ( - BlobLength = 131072 + BlobLength = 131072 // 128 KiB CommitmentLength = 48 ProofLength = 48 PointLength = 32 @@ -93,7 +93,7 @@ func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error { func ComputeBlobHashV1(commit Commitment) (h [32]byte) { k := sha256.New() k.Write(commit[:]) - k.Sum(h[:]) + k.Sum(h[:0]) h[0] = 0x01 return } diff --git a/go.mod b/go.mod index a8f6b66..893407c 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/btcsuite/btcd/btcutil v1.1.5 github.com/crate-crypto/go-kzg-4844 v1.1.0 github.com/defiweb/go-anymapper v0.3.0 - github.com/defiweb/go-rlp v0.3.0 + github.com/defiweb/go-rlp v0.4.0 github.com/defiweb/go-sigparser v0.6.0 github.com/stretchr/testify v1.8.4 github.com/tyler-smith/go-bip39 v1.1.0 diff --git a/go.sum b/go.sum index 8102493..c33e353 100644 --- a/go.sum +++ b/go.sum @@ -47,6 +47,8 @@ github.com/defiweb/go-anymapper v0.3.0 h1:sWbTvhpdBaCHQGn+kuKYDnb+mPmeDNzzEXnC+C github.com/defiweb/go-anymapper v0.3.0/go.mod h1:EeQDyOsFd63Pt2uu9Yb8NFrChuZ9JBChjGKbDhRPHAQ= github.com/defiweb/go-rlp v0.3.0 h1:0q+EuR5SdSDu7XLx5Cu68EwVSaNA+CkRCFcE+17HNxA= github.com/defiweb/go-rlp v0.3.0/go.mod h1:nLGzk10jAgynPvN2hL+tLnnyZ5Fcshv0wmpWDRtV0PA= +github.com/defiweb/go-rlp v0.4.0 h1:IheGseUX+kDlykSiADAWYo4J5kSaJPlBraLOfzAsSlI= +github.com/defiweb/go-rlp v0.4.0/go.mod h1:nLGzk10jAgynPvN2hL+tLnnyZ5Fcshv0wmpWDRtV0PA= github.com/defiweb/go-sigparser v0.6.0 h1:HSNAZSUl8xyV+nKfWNKYVAPWLwTuASas6ohtarBbOT4= github.com/defiweb/go-sigparser v0.6.0/go.mod h1:R1wkfsnASR2M38ZupKHoqqIfv+8HgRbZaFQI9Inr4k8= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= diff --git a/types/structs.go b/types/structs.go index 0b083f6..801ebe6 100644 --- a/types/structs.go +++ b/types/structs.go @@ -34,26 +34,26 @@ func (a *AccessList) Copy() AccessList { } func (a AccessList) EncodeRLP() ([]byte, error) { - l := rlp.NewList() + l := rlp.List{} for _, tuple := range a { - tuple := tuple // Copy value because of loop variable reuse. - l.Append(&tuple) + tuple := tuple + l.Add(&tuple) } return rlp.Encode(l) } func (a *AccessList) DecodeRLP(data []byte) (int, error) { - d, n, err := rlp.Decode(data) + d, n, err := rlp.DecodeLazy(data) if err != nil { return 0, err } - l, err := d.GetList() + l, err := d.List() if err != nil { return 0, err } for _, tuple := range l { var t AccessTuple - if err := tuple.DecodeTo(&t); err != nil { + if err := tuple.Decode(&t); err != nil { return 0, err } *a = append(*a, t) @@ -71,36 +71,36 @@ func (a *AccessTuple) Copy() AccessTuple { } func (a AccessTuple) EncodeRLP() ([]byte, error) { - h := rlp.NewList() + h := rlp.List{} for _, hash := range a.StorageKeys { hash := hash - h.Append(&hash) + h.Add(&hash) } - return rlp.Encode(rlp.NewList(&a.Address, h)) + return rlp.Encode(rlp.List{a.Address, h}) } func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { - d, n, err := rlp.Decode(data) + d, n, err := rlp.DecodeLazy(data) if err != nil { return n, err } - l, err := d.GetList() + l, err := d.List() if err != nil { return n, err } if len(l) != 2 { return n, fmt.Errorf("invalid access list tuple") } - if err := l[0].DecodeTo(&a.Address); err != nil { + if err := l[0].Decode(&a.Address); err != nil { return n, err } - h, err := l[1].GetList() + h, err := l[1].List() if err != nil { return n, err } for _, item := range h { var hash Hash - if err := item.DecodeTo(&hash); err != nil { + if err := item.Decode(&hash); err != nil { return n, err } a.StorageKeys = append(a.StorageKeys, hash) @@ -381,9 +381,9 @@ type jsonBlock struct { TransactionsRoot Hash `json:"transactionsRoot"` MixHash Hash `json:"mixHash"` Sha3Uncles Hash `json:"sha3Uncles"` - Nonce hexNonce `json:"nonce"` + Nonce nonce `json:"nonce"` Miner Address `json:"miner"` - LogsBloom hexBloom `json:"logsBloom"` + LogsBloom bloom `json:"logsBloom"` Difficulty Number `json:"difficulty"` TotalDifficulty Number `json:"totalDifficulty"` Size Number `json:"size"` diff --git a/types/tx.go b/types/tx.go index b14dcc7..4056c09 100644 --- a/types/tx.go +++ b/types/tx.go @@ -20,7 +20,8 @@ const ( type Transaction interface { json.Marshaler json.Unmarshaler - rlp.Item + rlp.Encoder + rlp.Decoder HasTransactionData diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index 2dbaabf..2e5c08a 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -49,6 +49,7 @@ func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { gasLimit = uint64(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) ) if t.ChainID != nil { @@ -69,19 +70,22 @@ func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + bin, err := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(gasPrice), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - ).EncodeRLP() + }.EncodeRLP() if err != nil { return ZeroHash, err } @@ -98,6 +102,7 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { gasLimit = uint64(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) v = big.NewInt(0) r = big.NewInt(0) @@ -121,6 +126,9 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } @@ -129,19 +137,19 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { r = t.Signature.R s = t.Signature.S } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + bin, err := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(gasPrice), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() + (*rlp.BigInt)(v), + (*rlp.BigInt)(r), + (*rlp.BigInt)(s), + }.EncodeRLP() if err != nil { return nil, err } @@ -159,20 +167,19 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { } data = data[1:] var ( - list *rlp.ListItem - chainID = &rlp.UintItem{} - nonce = &rlp.UintItem{} - gasPrice = &rlp.BigIntItem{} - gasLimit = &rlp.UintItem{} - to = &rlp.StringItem{} - value = &rlp.BigIntItem{} - input = &rlp.StringItem{} - accessList = &AccessList{} - v = &rlp.BigIntItem{} - r = &rlp.BigIntItem{} - s = &rlp.BigIntItem{} + chainID = new(rlp.Uint) + nonce = new(rlp.Uint) + gasPrice = new(rlp.BigInt) + gasLimit = new(rlp.Uint) + to = new(rlp.Bytes) + value = new(rlp.BigInt) + input = new(rlp.Bytes) + accessList = new(AccessList) + v = new(rlp.BigInt) + r = new(rlp.BigInt) + s = new(rlp.BigInt) ) - list = rlp.NewList( + list := rlp.List{ chainID, nonce, gasPrice, @@ -184,40 +191,41 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { v, r, s, - ) - if _, err := rlp.DecodeTo(data, list); err != nil { + } + if _, err := rlp.Decode(data, &list); err != nil { return 0, err } - if chainID.X != 0 { - t.ChainID = &chainID.X + if chainID.Get() != 0 { + t.ChainID = chainID.Ptr() } - if nonce.X != 0 { - t.Nonce = &nonce.X + if nonce.Get() != 0 { + t.Nonce = nonce.Ptr() } - if gasPrice.X.Sign() != 0 { - t.GasPrice = gasPrice.X + if gasPrice.Get().Sign() != 0 { + t.GasPrice = gasPrice.Ptr() } - if gasLimit.X != 0 { - t.GasLimit = &gasLimit.X + if gasLimit.Get() != 0 { + t.GasLimit = gasLimit.Ptr() } - if len(to.Bytes()) > 0 { - t.To = AddressFromBytesPtr(to.Bytes()) + if len(to.Get()) > 0 { + t.To = AddressFromBytesPtr(to.Get()) } - if value.X.Sign() != 0 { - t.Value = value.X + if value.Ptr().Sign() != 0 { + t.Value = value.Ptr() } - if len(input.Bytes()) > 0 { - t.Input = input.Bytes() + if len(input.Get()) > 0 { + t.Input = input.Get() } if len(*accessList) > 0 { t.AccessList = *accessList } - if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + if v.Ptr().Sign() != 0 || r.Ptr().Sign() != 0 || s.Ptr().Sign() != 0 { t.Signature = &Signature{ - V: v.X, - R: r.X, - S: s.X, + V: v.Ptr(), + R: r.Ptr(), + S: s.Ptr(), } + return len(data), nil } return len(data), nil } diff --git a/types/tx_blob.go b/types/tx_blob.go index 6322f7c..d93f68a 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -53,6 +53,7 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { maxFeePerGas = big.NewInt(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) maxFeePerBlobGas = big.NewInt(0) blobHashes = (hashList)(nil) @@ -78,6 +79,9 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } @@ -94,19 +98,19 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { blobHashes[i] = blob.Hash } } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + bin, err := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(maxPriorityFeePerGas), + (*rlp.BigInt)(maxFeePerGas), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - rlp.NewBigInt(maxFeePerBlobGas), + (*rlp.BigInt)(maxFeePerBlobGas), &blobHashes, - ).EncodeRLP() + }.EncodeRLP() if err != nil { return ZeroHash, err } @@ -124,9 +128,13 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { maxFeePerGas = big.NewInt(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) maxFeePerBlobGas = big.NewInt(0) blobHashes = (hashList)(nil) + blobs = rlp.TypedList[kzgBlob]{} + commitments = rlp.TypedList[kzgCommitment]{} + proofs = rlp.TypedList[kzgProof]{} v = big.NewInt(0) r = big.NewInt(0) s = big.NewInt(0) @@ -152,6 +160,9 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } @@ -159,13 +170,18 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { maxFeePerBlobGas = t.MaxFeePerBlobGas } if len(t.Blobs) > 0 { - blobHashes = make(hashList, len(t.Blobs)) - for i, blob := range t.Blobs { - if blob.Hash.IsZero() && blob.Sidecar != nil { - blobHashes[i] = blob.Sidecar.ComputeHash() - continue + blobHashes = make(hashList, 0, len(t.Blobs)) + for _, blob := range t.Blobs { + hash := blob.Hash + if hash.IsZero() && blob.Sidecar != nil { + hash = blob.Sidecar.ComputeHash() + } + blobHashes = append(blobHashes, hash) + if blob.Sidecar != nil { + blobs.Add((*kzgBlob)(&blob.Sidecar.Blob)) + commitments.Add((*kzgCommitment)(&blob.Sidecar.Commitment)) + proofs.Add((*kzgProof)(&blob.Sidecar.Proof)) } - blobHashes[i] = blob.Hash } } if t.Signature != nil { @@ -173,22 +189,31 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { r = t.Signature.R s = t.Signature.S } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + tx := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(maxPriorityFeePerGas), + (*rlp.BigInt)(maxFeePerGas), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - rlp.NewBigInt(maxFeePerBlobGas), + (*rlp.BigInt)(maxFeePerBlobGas), &blobHashes, - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() + (*rlp.BigInt)(v), + (*rlp.BigInt)(r), + (*rlp.BigInt)(s), + } + if len(blobHashes) > 0 && len(blobHashes) == len(blobs) { + tx = rlp.List{ + tx, + blobs, + commitments, + proofs, + } + } + bin, err := tx.EncodeRLP() if err != nil { return nil, err } @@ -206,82 +231,125 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { } data = data[1:] var ( - list *rlp.ListItem - chainID = &rlp.UintItem{} - nonce = &rlp.UintItem{} - gasLimit = &rlp.UintItem{} - maxPriorityFeePerGas = &rlp.BigIntItem{} - maxFeePerGas = &rlp.BigIntItem{} - to = &rlp.StringItem{} - value = &rlp.BigIntItem{} - input = &rlp.StringItem{} - accessList = &AccessList{} - maxFeePerBlobGas = &rlp.BigIntItem{} + chainID = new(rlp.Uint) + nonce = new(rlp.Uint) + gasLimit = new(rlp.Uint) + maxPriorityFeePerGas = new(rlp.BigInt) + maxFeePerGas = new(rlp.BigInt) + to = new(rlp.Bytes) + value = new(rlp.BigInt) + input = new(rlp.Bytes) + accessList = new(AccessList) + maxFeePerBlobGas = new(rlp.BigInt) blobHashes = &hashList{} - v = &rlp.BigIntItem{} - r = &rlp.BigIntItem{} - s = &rlp.BigIntItem{} - ) - list = rlp.NewList( - chainID, - nonce, - maxPriorityFeePerGas, - maxFeePerGas, - gasLimit, - to, - value, - input, - accessList, - maxFeePerBlobGas, - blobHashes, - v, - r, - s, + blobs = new(rlp.TypedList[kzgBlob]) + commitments = new(rlp.TypedList[kzgCommitment]) + proofs = new(rlp.TypedList[kzgProof]) + v = new(rlp.BigInt) + r = new(rlp.BigInt) + s = new(rlp.BigInt) ) - if _, err := rlp.DecodeTo(data, list); err != nil { + dec, _, err := rlp.DecodeLazy(data) + if err != nil { + return 0, err + } + if !dec.IsList() { + return 0, fmt.Errorf("unable to decode transaction") + } + var list rlp.List + switch dec.Length() { + case 4: + list = rlp.List{ + &rlp.List{ + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, + accessList, + maxFeePerBlobGas, + blobHashes, + v, + r, + s, + }, + blobs, + commitments, + proofs, + } + default: + list = rlp.List{ + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, + accessList, + maxFeePerBlobGas, + blobHashes, + v, + r, + s, + } + } + if err := dec.Decode(&list); err != nil { return 0, err } - if chainID.X != 0 { - t.ChainID = &chainID.X + if chainID.Get() != 0 { + t.ChainID = chainID.Ptr() } - if nonce.X != 0 { - t.Nonce = &nonce.X + if nonce.Get() != 0 { + t.Nonce = nonce.Ptr() } - if maxPriorityFeePerGas.X.Sign() != 0 { - t.MaxPriorityFeePerGas = maxPriorityFeePerGas.X + if maxPriorityFeePerGas.Ptr().Sign() != 0 { + t.MaxPriorityFeePerGas = maxPriorityFeePerGas.Ptr() } - if maxFeePerGas.X.Sign() != 0 { - t.MaxFeePerGas = maxFeePerGas.X + if maxFeePerGas.Ptr().Sign() != 0 { + t.MaxFeePerGas = maxFeePerGas.Ptr() } - if gasLimit.X != 0 { - t.GasLimit = &gasLimit.X + if gasLimit.Get() != 0 { + t.GasLimit = gasLimit.Ptr() } - if len(to.Bytes()) > 0 { - t.To = AddressFromBytesPtr(to.Bytes()) + if len(to.Get()) > 0 { + t.To = AddressFromBytesPtr(to.Get()) } - if value.X.Sign() != 0 { - t.Value = value.X + if value.Ptr().Sign() != 0 { + t.Value = value.Ptr() } - if len(input.Bytes()) > 0 { - t.Input = input.Bytes() + if len(input.Get()) > 0 { + t.Input = input.Get() } if len(*accessList) > 0 { t.AccessList = *accessList } - if maxFeePerBlobGas.X.Sign() != 0 { - t.MaxFeePerBlobGas = maxFeePerBlobGas.X + if maxFeePerBlobGas.Ptr().Sign() != 0 { + t.MaxFeePerBlobGas = maxFeePerBlobGas.Ptr() } if len(*blobHashes) > 0 { t.Blobs = make([]Blob, len(*blobHashes)) for i, hash := range *blobHashes { - t.Blobs[i] = Blob{Hash: hash} + blob := Blob{Hash: hash} + if i < len(*blobs) && i < len(*commitments) && i < len(*proofs) { + blob.Sidecar = &BlobSidecar{ + Blob: kzg4844.Blob(*(*blobs)[i]), + Commitment: kzg4844.Commitment(*(*commitments)[i]), + Proof: kzg4844.Proof(*(*proofs)[i]), + } + } + t.Blobs[i] = blob } } - if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + if v.Ptr().Sign() != 0 || r.Ptr().Sign() != 0 || s.Ptr().Sign() != 0 { t.Signature = &Signature{ - V: v.X, - R: r.X, - S: s.X, + V: v.Ptr(), + R: r.Ptr(), + S: s.Ptr(), } } return len(data), nil diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index ebef6b8..255b9f1 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -8,13 +8,15 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/hexutil" ) func TestTransactionBlob_RLP(t *testing.T) { tests := []struct { - tx *TransactionBlob - want []byte + tx *TransactionBlob + want []byte + wantHash bool }{ { tx: &TransactionBlob{}, @@ -58,13 +60,57 @@ func TestTransactionBlob_RLP(t *testing.T) { }, want: hexutil.MustHexToBytes("03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + newBlob("blob1"), + newBlob("blob2"), + }, + }, + }, + want: hexutil.MustHexToBytes("0x848eb4e644a60e42df3b639eb40c0f3763d13ebc2a33aa06e9b2acc22c51f59e"), + wantHash: true, + }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { // Encode: rlp, err := tt.tx.EncodeRLP() require.NoError(t1, err) - assert.Equal(t1, tt.want, rlp) + + if tt.wantHash { + hash := crypto.Keccak256(rlp) + assert.Equal(t1, tt.want, hash[:]) + } else { + assert.Equal(t1, tt.want, rlp) + } // Decode: tx := NewTransactionBlob() @@ -142,6 +188,43 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { }, want: MustHashFromHex("0x3faa63efab3e460606c31cd9a2e8791d87e91954137571eddb3b4b0abc69e2cd", PadNone), }, + { + tx: &TransactionBlob{ + EmbedTransactionData: EmbedTransactionData{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + EmbedCallData: EmbedCallData{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + EmbedDynamicFeeData: EmbedDynamicFeeData{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + EmbedAccessListData: EmbedAccessListData{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + EmbedBlobData: EmbedBlobData{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []Blob{ + newBlob("blob1"), + newBlob("blob2"), + }, + }, + }, + want: MustHashFromHex("0x09f9204d83af238e1c0044bf22b4dd52ea5c25390b27bdbd38024212e238934d", PadNone), + }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { @@ -151,3 +234,11 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { }) } } + +func newBlob(data string) Blob { + b, err := NewBlob([]byte(data)) + if err != nil { + panic(err) + } + return b +} diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index 7f45760..aed882f 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -50,6 +50,7 @@ func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { maxFeePerGas = big.NewInt(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) ) if t.ChainID != nil { @@ -73,20 +74,23 @@ func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + bin, err := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(maxPriorityFeePerGas), + (*rlp.BigInt)(maxFeePerGas), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - ).EncodeRLP() + }.EncodeRLP() if err != nil { return ZeroHash, err } @@ -104,6 +108,7 @@ func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { maxFeePerGas = big.NewInt(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) accessList = (AccessList)(nil) v = big.NewInt(0) r = big.NewInt(0) @@ -130,6 +135,9 @@ func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.AccessList != nil { accessList = t.AccessList } @@ -138,20 +146,20 @@ func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { r = t.Signature.R s = t.Signature.S } - bin, err := rlp.NewList( - rlp.NewUint(chainID), - rlp.NewUint(nonce), - rlp.NewBigInt(maxPriorityFeePerGas), - rlp.NewBigInt(maxFeePerGas), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), + bin, err := rlp.List{ + rlp.Uint(chainID), + rlp.Uint(nonce), + (*rlp.BigInt)(maxPriorityFeePerGas), + (*rlp.BigInt)(maxFeePerGas), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), &accessList, - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() + (*rlp.BigInt)(v), + (*rlp.BigInt)(r), + (*rlp.BigInt)(s), + }.EncodeRLP() if err != nil { return nil, err } @@ -169,21 +177,20 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { } data = data[1:] var ( - list *rlp.ListItem - chainID = &rlp.UintItem{} - nonce = &rlp.UintItem{} - gasLimit = &rlp.UintItem{} - maxPriorityFeePerGas = &rlp.BigIntItem{} - maxFeePerGas = &rlp.BigIntItem{} - to = &rlp.StringItem{} - value = &rlp.BigIntItem{} - input = &rlp.StringItem{} - accessList = &AccessList{} - v = &rlp.BigIntItem{} - r = &rlp.BigIntItem{} - s = &rlp.BigIntItem{} + chainID = new(rlp.Uint) + nonce = new(rlp.Uint) + gasLimit = new(rlp.Uint) + maxPriorityFeePerGas = new(rlp.BigInt) + maxFeePerGas = new(rlp.BigInt) + to = new(rlp.Bytes) + value = new(rlp.BigInt) + input = new(rlp.Bytes) + accessList = new(AccessList) + v = new(rlp.BigInt) + r = new(rlp.BigInt) + s = new(rlp.BigInt) ) - list = rlp.NewList( + list := rlp.List{ chainID, nonce, maxPriorityFeePerGas, @@ -196,42 +203,42 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { v, r, s, - ) - if _, err := rlp.DecodeTo(data, list); err != nil { + } + if _, err := rlp.Decode(data, &list); err != nil { return 0, err } - if chainID.X != 0 { - t.ChainID = &chainID.X + if chainID.Get() != 0 { + t.ChainID = chainID.Ptr() } - if nonce.X != 0 { - t.Nonce = &nonce.X + if nonce.Get() != 0 { + t.Nonce = nonce.Ptr() } - if maxPriorityFeePerGas.X.Sign() != 0 { - t.MaxPriorityFeePerGas = maxPriorityFeePerGas.X + if maxPriorityFeePerGas.Ptr().Sign() != 0 { + t.MaxPriorityFeePerGas = maxPriorityFeePerGas.Ptr() } - if maxFeePerGas.X.Sign() != 0 { - t.MaxFeePerGas = maxFeePerGas.X + if maxFeePerGas.Ptr().Sign() != 0 { + t.MaxFeePerGas = maxFeePerGas.Ptr() } - if gasLimit.X != 0 { - t.GasLimit = &gasLimit.X + if gasLimit.Get() != 0 { + t.GasLimit = gasLimit.Ptr() } - if len(to.Bytes()) > 0 { - t.To = AddressFromBytesPtr(to.Bytes()) + if len(to.Get()) > 0 { + t.To = AddressFromBytesPtr(to.Get()) } - if value.X.Sign() != 0 { - t.Value = value.X + if value.Ptr().Sign() != 0 { + t.Value = value.Ptr() } - if len(input.Bytes()) > 0 { - t.Input = input.Bytes() + if len(input.Get()) > 0 { + t.Input = input.Get() } if len(*accessList) > 0 { t.AccessList = *accessList } - if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + if v.Ptr().Sign() != 0 || r.Ptr().Sign() != 0 || s.Ptr().Sign() != 0 { t.Signature = &Signature{ - V: v.X, - R: r.X, - S: s.X, + V: v.Ptr(), + R: r.Ptr(), + S: s.Ptr(), } } return len(data), nil diff --git a/types/tx_legacy.go b/types/tx_legacy.go index 9f1fa4f..9efd99d 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -47,6 +47,7 @@ func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { gasLimit = uint64(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) ) if t.ChainID != nil { chainID = *t.ChainID @@ -66,19 +67,22 @@ func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { if t.Value != nil { value = t.Value } - list := rlp.NewList( - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - ) + if t.Input != nil { + input = t.Input + } + list := rlp.List{ + rlp.Uint(nonce), + (*rlp.BigInt)(gasPrice), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), + } if t.ChainID != nil && *t.ChainID != 0 { - list.Append( - rlp.NewUint(chainID), - rlp.NewUint(0), - rlp.NewUint(0), + list.Add( + rlp.Uint(chainID), + rlp.Uint(0), + rlp.Uint(0), ) } bin, err := list.EncodeRLP() @@ -96,6 +100,7 @@ func (t TransactionLegacy) EncodeRLP() ([]byte, error) { gasLimit = uint64(0) to = ([]byte)(nil) value = big.NewInt(0) + input = ([]byte)(nil) v = big.NewInt(0) r = big.NewInt(0) s = big.NewInt(0) @@ -115,22 +120,25 @@ func (t TransactionLegacy) EncodeRLP() ([]byte, error) { if t.Value != nil { value = t.Value } + if t.Input != nil { + input = t.Input + } if t.Signature != nil { v = t.Signature.V r = t.Signature.R s = t.Signature.S } - return rlp.NewList( - rlp.NewUint(nonce), - rlp.NewBigInt(gasPrice), - rlp.NewUint(gasLimit), - rlp.NewBytes(to), - rlp.NewBigInt(value), - rlp.NewBytes(t.Input), - rlp.NewBigInt(v), - rlp.NewBigInt(r), - rlp.NewBigInt(s), - ).EncodeRLP() + return rlp.List{ + rlp.Uint(nonce), + (*rlp.BigInt)(gasPrice), + rlp.Uint(gasLimit), + rlp.Bytes(to), + (*rlp.BigInt)(value), + rlp.Bytes(input), + (*rlp.BigInt)(v), + (*rlp.BigInt)(r), + (*rlp.BigInt)(s), + }.EncodeRLP() } //nolint:funlen @@ -140,18 +148,17 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { return 0, fmt.Errorf("empty data") } var ( - list *rlp.ListItem - nonce = &rlp.UintItem{} - gasPrice = &rlp.BigIntItem{} - gasLimit = &rlp.UintItem{} - to = &rlp.StringItem{} - value = &rlp.BigIntItem{} - input = &rlp.StringItem{} - v = &rlp.BigIntItem{} - r = &rlp.BigIntItem{} - s = &rlp.BigIntItem{} + nonce = new(rlp.Uint) + gasPrice = new(rlp.BigInt) + gasLimit = new(rlp.Uint) + to = new(rlp.Bytes) + value = new(rlp.BigInt) + input = new(rlp.Bytes) + v = new(rlp.BigInt) + r = new(rlp.BigInt) + s = new(rlp.BigInt) ) - list = rlp.NewList( + list := rlp.List{ nonce, gasPrice, gasLimit, @@ -161,37 +168,37 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { v, r, s, - ) - if _, err := rlp.DecodeTo(data, list); err != nil { + } + if _, err := rlp.Decode(data, &list); err != nil { return 0, err } - if nonce.X != 0 { - t.Nonce = &nonce.X + if nonce.Get() != 0 { + t.Nonce = nonce.Ptr() } - if gasPrice.X.Sign() != 0 { - t.GasPrice = gasPrice.X + if gasPrice.Get().Sign() != 0 { + t.GasPrice = gasPrice.Ptr() } - if gasLimit.X != 0 { - t.GasLimit = &gasLimit.X + if gasLimit.Get() != 0 { + t.GasLimit = gasLimit.Ptr() } - if len(to.Bytes()) > 0 { - t.To = AddressFromBytesPtr(to.Bytes()) + if len(to.Get()) > 0 { + t.To = AddressFromBytesPtr(*to) } - if value.X.Sign() != 0 { - t.Value = value.X + if value.Get().Sign() != 0 { + t.Value = value.Ptr() } - if len(input.Bytes()) > 0 { - t.Input = input.Bytes() + if len(input.Get()) > 0 { + t.Input = input.Get() } - if v.X.Sign() != 0 || r.X.Sign() != 0 || s.X.Sign() != 0 { + if v.Get().Sign() != 0 || r.Get().Sign() != 0 || s.Get().Sign() != 0 { t.Signature = &Signature{ - V: v.X, - R: r.X, - S: s.X, + V: (*big.Int)(v), + R: (*big.Int)(r), + S: (*big.Int)(s), } // Derive chain ID from the V value. - if v.X.Cmp(big.NewInt(35)) >= 0 { - x := new(big.Int).Sub(v.X, big.NewInt(35)) + if v.Get().Cmp(big.NewInt(35)) >= 0 { + x := new(big.Int).Sub((*big.Int)(v), big.NewInt(35)) x = x.Div(x, big.NewInt(2)) chainID := x.Uint64() t.ChainID = &chainID diff --git a/types/types.go b/types/types.go index de4cf27..8f27a90 100644 --- a/types/types.go +++ b/types/types.go @@ -154,15 +154,15 @@ func (t *Address) UnmarshalText(input []byte) error { } func (t Address) EncodeRLP() ([]byte, error) { - return rlp.Encode(rlp.NewBytes(t[:])) + return rlp.Encode(rlp.Bytes(t[:])) } func (t *Address) DecodeRLP(data []byte) (int, error) { - r, n, err := rlp.Decode(data) + r, n, err := rlp.DecodeLazy(data) if err != nil { return 0, err } - a, err := r.GetBytes() + a, err := r.Bytes() if err != nil { return 0, err } @@ -362,15 +362,15 @@ func (t *Hash) UnmarshalText(input []byte) error { } func (t Hash) EncodeRLP() ([]byte, error) { - return rlp.Encode(rlp.NewBytes(t[:])) + return rlp.Encode(rlp.Bytes(t[:])) } func (t *Hash) DecodeRLP(data []byte) (int, error) { - r, n, err := rlp.Decode(data) + r, n, err := rlp.DecodeLazy(data) if err != nil { return 0, err } - b, err := r.GetBytes() + b, err := r.Bytes() if err != nil { return 0, err } @@ -1038,110 +1038,118 @@ func (b *Bytes) UnmarshalText(input []byte) error { // Internal types: // -const bloomLength = 256 +const ( + bloomLength = 256 + nonceLength = 8 +) -type hexBloom [bloomLength]byte +type ( + kzgBlob [kzg4844.BlobLength]byte + kzgCommitment [kzg4844.CommitmentLength]byte + kzgProof [kzg4844.ProofLength]byte + bloom [bloomLength]byte + nonce [nonceLength]byte + hashList []Hash + addressList []Address +) -func bloomFromBytes(x []byte) hexBloom { - var b [bloomLength]byte - if len(x) > len(b) { - return b - } - copy(b[bloomLength-len(x):], x) - return b +func (t kzgBlob) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil } -func (t *hexBloom) Bytes() []byte { - return t[:] +func (t *kzgBlob) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) } -func (t *hexBloom) String() string { - if t == nil { - return "" - } - return hexutil.BytesToHex(t[:]) +func (t kzgBlob) EncodeRLP() ([]byte, error) { + return fixedBytesEncodeRLP(t[:]) +} + +func (t *kzgBlob) DecodeRLP(data []byte) (int, error) { + return fixedBytesDecodeRLP(data, t[:]) } -func (t hexBloom) MarshalJSON() ([]byte, error) { +func (t kzgCommitment) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } -func (t *hexBloom) UnmarshalJSON(input []byte) error { +func (t *kzgCommitment) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } -func (t hexBloom) MarshalText() ([]byte, error) { - return bytesMarshalText(t[:]), nil +func (t kzgCommitment) EncodeRLP() ([]byte, error) { + return fixedBytesEncodeRLP(t[:]) } -func (t *hexBloom) UnmarshalText(input []byte) error { - return fixedBytesUnmarshalText(input, t[:]) +func (t *kzgCommitment) DecodeRLP(data []byte) (int, error) { + return fixedBytesDecodeRLP(data, t[:]) } -const nonceLength = 8 - -type hexNonce [nonceLength]byte - -func nonceFromBigInt(x *big.Int) hexNonce { - if x == nil { - return hexNonce{} - } - return nonceFromBytes(x.Bytes()) +func (t kzgProof) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil } -func nonceFromBytes(x []byte) hexNonce { - var n hexNonce - if len(x) > len(n) { - return n - } - copy(n[nonceLength-len(x):], x) - return n +func (t *kzgProof) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) } -func (t *hexNonce) Big() *big.Int { - return new(big.Int).SetBytes(t[:]) +func (t kzgProof) EncodeRLP() ([]byte, error) { + return fixedBytesEncodeRLP(t[:]) } -func (t hexNonce) MarshalJSON() ([]byte, error) { - return bytesMarshalJSON(t[:]), nil +func (t *kzgProof) DecodeRLP(data []byte) (int, error) { + return fixedBytesDecodeRLP(data, t[:]) } -func (t *hexNonce) UnmarshalJSON(input []byte) error { - return fixedBytesUnmarshalJSON(input, t[:]) +func bloomFromBytes(x []byte) bloom { + var b [bloomLength]byte + if len(x) > len(b) { + return b + } + copy(b[bloomLength-len(x):], x) + return b } -type kzgBlob [kzg4844.BlobLength]byte +func (t *bloom) Bytes() []byte { + return t[:] +} -func (t kzgBlob) MarshalJSON() ([]byte, error) { +func (t bloom) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } -func (t *kzgBlob) UnmarshalJSON(input []byte) error { +func (t *bloom) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } -type kzgCommitment [kzg4844.CommitmentLength]byte - -func (t kzgCommitment) MarshalJSON() ([]byte, error) { - return bytesMarshalJSON(t[:]), nil +func nonceFromBigInt(x *big.Int) nonce { + if x == nil { + return nonce{} + } + return nonceFromBytes(x.Bytes()) } -func (t *kzgCommitment) UnmarshalJSON(input []byte) error { - return fixedBytesUnmarshalJSON(input, t[:]) +func nonceFromBytes(x []byte) nonce { + var n nonce + if len(x) > len(n) { + return n + } + copy(n[nonceLength-len(x):], x) + return n } -type kzgProof [kzg4844.ProofLength]byte +func (t *nonce) Big() *big.Int { + return new(big.Int).SetBytes(t[:]) +} -func (t kzgProof) MarshalJSON() ([]byte, error) { +func (t nonce) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } -func (t *kzgProof) UnmarshalJSON(input []byte) error { +func (t *nonce) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } -type hashList []Hash - func (b hashList) MarshalJSON() ([]byte, error) { if len(b) == 1 { return json.Marshal(b[0]) @@ -1158,35 +1166,26 @@ func (b *hashList) UnmarshalJSON(input []byte) error { } func (b *hashList) EncodeRLP() ([]byte, error) { - l := rlp.NewList() - for _, hash := range *b { - hash := hash - l.Append(&hash) + l := make(rlp.TypedList[Hash], len(*b)) + for n, _ := range *b { + l[n] = &(*b)[n] } return rlp.Encode(l) } func (b *hashList) DecodeRLP(data []byte) (int, error) { - d, n, err := rlp.Decode(data) + l := make(rlp.TypedList[Hash], 0) + n, err := rlp.Decode(data, &l) if err != nil { return 0, err } - l, err := d.GetList() - if err != nil { - return 0, err - } - for _, hash := range l { - var h Hash - if err := hash.DecodeTo(&h); err != nil { - return 0, err - } - *b = append(*b, h) + *b = make(hashList, len(l)) + for n, hash := range l { + (*b)[n] = *hash } return n, nil } -type addressList []Address - func (t addressList) MarshalJSON() ([]byte, error) { if len(t) == 1 { return json.Marshal(t[0]) diff --git a/types/util.go b/types/util.go index 323dc24..be4bc76 100644 --- a/types/util.go +++ b/types/util.go @@ -6,6 +6,8 @@ import ( "fmt" "math/big" + "github.com/defiweb/go-rlp" + "github.com/defiweb/go-eth/hexutil" ) @@ -150,6 +152,26 @@ func naiveUnquote(i []byte) []byte { return i } +func fixedBytesEncodeRLP(input []byte) ([]byte, error) { + return rlp.Encode(rlp.Bytes(input)) +} + +func fixedBytesDecodeRLP(input []byte, output []byte) (int, error) { + r, n, err := rlp.DecodeLazy(input) + if err != nil { + return n, err + } + b, err := r.Bytes() + if err != nil { + return n, err + } + if len(b) != len(output) { + return n, fmt.Errorf("invalid length %d", len(b)) + } + copy(output, b) + return n, nil +} + func copyPtr[T any](p *T) *T { if p == nil { return nil @@ -167,15 +189,6 @@ func copyBytes(p []byte) []byte { return c } -func copySlice[T any](p []T) []T { - if p == nil { - return nil - } - c := make([]T, len(p)) - copy(c, p) - return c -} - func copyBigInt(p *big.Int) *big.Int { if p == nil { return nil @@ -183,12 +196,3 @@ func copyBigInt(p *big.Int) *big.Int { c := new(big.Int).Set(p) return c } - -func copyHashes(p []Hash) []Hash { - if p == nil { - return nil - } - c := make([]Hash, len(p)) - copy(c, p) - return c -} From 28958f2cd1f4f2f23ebd900e9ebb47a53f2814d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 18 May 2025 03:30:24 +0200 Subject: [PATCH 08/44] Remove embeded kzg4844 context --- crypto/kzg4844/kzg4844.go | 16 +- crypto/kzg4844/trusted_setup.json | 4167 ----------------------------- 2 files changed, 2 insertions(+), 4181 deletions(-) delete mode 100644 crypto/kzg4844/trusted_setup.json diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index 0dff9f5..d3652ba 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -2,8 +2,6 @@ package kzg4844 import ( "crypto/sha256" - "embed" - "encoding/json" "sync" kzg4844 "github.com/crate-crypto/go-kzg-4844" @@ -98,9 +96,6 @@ func ComputeBlobHashV1(commit Commitment) (h [32]byte) { return } -//go:embed trusted_setup.json -var content embed.FS - // context holds the necessary configuration needed to create and verify proofs. var context *kzg4844.Context @@ -108,15 +103,8 @@ var once sync.Once func initContext() { once.Do(func() { - setupFile, err := content.ReadFile("trusted_setup.json") - if err != nil { - panic(err) - } - setup := new(kzg4844.JSONTrustedSetup) - if err = json.Unmarshal(setupFile, setup); err != nil { - panic(err) - } - context, err = kzg4844.NewContext4096(setup) + var err error + context, err = kzg4844.NewContext4096Secure() if err != nil { panic(err) } diff --git a/crypto/kzg4844/trusted_setup.json b/crypto/kzg4844/trusted_setup.json deleted file mode 100644 index c6d724e..0000000 --- a/crypto/kzg4844/trusted_setup.json +++ /dev/null @@ -1,4167 +0,0 @@ -{ - "g1_lagrange": [ - "0xa0413c0dcafec6dbc9f47d66785cf1e8c981044f7d13cfe3e4fcbb71b5408dfde6312493cb3c1d30516cb3ca88c03654", - "0x8b997fb25730d661918371bb41f2a6e899cac23f04fc5365800b75433c0a953250e15e7a98fb5ca5cc56a8cd34c20c57", - "0x83302852db89424d5699f3f157e79e91dc1380f8d5895c5a772bb4ea3a5928e7c26c07db6775203ce33e62a114adaa99", - "0xa759c48b7e4a685e735c01e5aa6ef9c248705001f470f9ad856cd87806983e917a8742a3bd5ee27db8d76080269b7c83", - "0x967f8dc45ebc3be14c8705f43249a30ff48e96205fb02ae28daeab47b72eb3f45df0625928582aa1eb4368381c33e127", - "0xa418eb1e9fb84cb32b370610f56f3cb470706a40ac5a47c411c464299c45c91f25b63ae3fcd623172aa0f273c0526c13", - "0x8f44e3f0387293bc7931e978165abbaed08f53acd72a0a23ac85f6da0091196b886233bcee5b4a194db02f3d5a9b3f78", - "0x97173434b336be73c89412a6d70d416e170ea355bf1956c32d464090b107c090ef2d4e1a467a5632fbc332eeb679bf2d", - "0xa24052ad8d55ad04bc5d951f78e14213435681594110fd18173482609d5019105b8045182d53ffce4fc29fc8810516c1", - "0xb950768136b260277590b5bec3f56bbc2f7a8bc383d44ce8600e85bf8cf19f479898bcc999d96dfbd2001ede01d94949", - "0x92ab8077871037bd3b57b95cbb9fb10eb11efde9191690dcac655356986fd02841d8fdb25396faa0feadfe3f50baf56d", - "0xa79b096dff98038ac30f91112dd14b78f8ad428268af36d20c292e2b3b6d9ed4fb28480bb04e465071cc67d05786b6d1", - "0xb9ff71461328f370ce68bf591aa7fb13027044f42a575517f3319e2be4aa4843fa281e756d0aa5645428d6dfa857cef2", - "0x8d765808c00b3543ff182e2d159c38ae174b12d1314da88ea08e13bd9d1c37184cb515e6bf6420531b5d41767987d7ce", - "0xb8c9a837d20c3b53e6f578e4a257bb7ef8fc43178614ec2a154915b267ad2be135981d01ed2ee1b5fbd9d9bb27f0800a", - "0xa9773d92cf23f65f98ef68f6cf95c72b53d0683af2f9bf886bb9036e4a38184b1131b26fd24397910b494fbef856f3aa", - "0xb41ebe38962d112da4a01bf101cb248d808fbd50aaf749fc7c151cf332032eb3e3bdbd716db899724b734d392f26c412", - "0x90fbb030167fb47dcc13d604a726c0339418567c1d287d1d87423fa0cb92eec3455fbb46bcbe2e697144a2d3972142e4", - "0xb11d298bd167464b35fb923520d14832bd9ed50ed841bf6d7618424fd6f3699190af21759e351b89142d355952149da1", - "0x8bc36066f69dc89f7c4d1e58d67497675050c6aa002244cebd9fc957ec5e364c46bab4735ea3db02b73b3ca43c96e019", - "0xab7ab92c5d4d773068e485aa5831941ebd63db7118674ca38089635f3b4186833af2455a6fb9ed2b745df53b3ce96727", - "0xaf191ca3089892cb943cd97cf11a51f38e38bd9be50844a4e8da99f27e305e876f9ed4ab0628e8ae3939066b7d34a15f", - "0xa3204c1747feabc2c11339a542195e7cb6628fd3964f846e71e2e3f2d6bb379a5e51700682ea1844eba12756adb13216", - "0x903a29883846b7c50c15968b20e30c471aeac07b872c40a4d19eb1a42da18b649d5bbfde4b4cf6225d215a461b0deb6d", - "0x8e6e9c15ffbf1e16e5865a5fef7ed751dc81957a9757b535cb38b649e1098cda25d42381dc4f776778573cdf90c3e6e0", - "0xa8f6dd26100b512a8c96c52e00715c4b2cb9ac457f17aed8ffe1cf1ea524068fe5a1ddf218149845fc1417b789ecfc98", - "0xa5b0ffc819451ea639cfd1c18cbc9365cc79368d3b2e736c0ae54eba2f0801e6eb0ee14a5f373f4a70ca463bdb696c09", - "0x879f91ccd56a1b9736fbfd20d8747354da743fb121f0e308a0d298ff0d9344431890e41da66b5009af3f442c636b4f43", - "0x81bf3a2d9755e206b515a508ac4d1109bf933c282a46a4ae4a1b4cb4a94e1d23642fad6bd452428845afa155742ade7e", - "0x8de778d4742f945df40004964e165592f9c6b1946263adcdd5a88b00244bda46c7bb49098c8eb6b3d97a0dd46148a8ca", - "0xb7a57b21d13121907ee28c5c1f80ee2e3e83a3135a8101e933cf57171209a96173ff5037f5af606e9fd6d066de6ed693", - "0xb0877d1963fd9200414a38753dffd9f23a10eb3198912790d7eddbc9f6b477019d52ddd4ebdcb9f60818db076938a5a9", - "0x88da2d7a6611bc16adc55fc1c377480c828aba4496c645e3efe0e1a67f333c05a0307f7f1d2df8ac013602c655c6e209", - "0x95719eb02e8a9dede1a888c656a778b1c69b7716fbe3d1538fe8afd4a1bc972183c7d32aa7d6073376f7701df80116d8", - "0x8e8a1ca971f2444b35af3376e85dccda3abb8e8e11d095d0a4c37628dfe5d3e043a377c3de68289ef142e4308e9941a0", - "0xb720caaff02f6d798ac84c4f527203e823ff685869e3943c979e388e1c34c3f77f5c242c6daa7e3b30e511aab917b866", - "0x86040d55809afeec10e315d1ad950d269d37cfee8c144cd8dd4126459e3b15a53b3e68df5981df3c2346d23c7b4baaf4", - "0x82d8cabf13ab853db0377504f0aec00dba3a5cd3119787e8ad378ddf2c40b022ecfc67c642b7acc8c1e3dd03ab50993e", - "0xb8d873927936719d2484cd03a6687d65697e17dcf4f0d5aed6f5e4750f52ef2133d4645894e7ebfc4ef6ce6788d404c8", - "0xb1235594dbb15b674a419ff2b2deb644ad2a93791ca05af402823f87114483d6aa1689b7a9bea0f547ad12fe270e4344", - "0xa53fda86571b0651f5affb74312551a082fffc0385cfd24c1d779985b72a5b1cf7c78b42b4f7e51e77055f8e5e915b00", - "0xb579adcfd9c6ef916a5a999e77a0cb21d378c4ea67e13b7c58709d5da23a56c2e54218691fc4ac39a4a3d74f88cc31f7", - "0xab79e584011713e8a2f583e483a91a0c2a40771b77d91475825b5acbea82db4262132901cb3e4a108c46d7c9ee217a4e", - "0xa0fe58ea9eb982d7654c8aaf9366230578fc1362f6faae0594f8b9e659bcb405dff4aac0c7888bbe07f614ecf0d800a6", - "0x867e50e74281f28ecd4925560e2e7a6f8911b135557b688254623acce0dbc41e23ac3e706a184a45d54c586edc416eb0", - "0x89f81b61adda20ea9d0b387a36d0ab073dc7c7cbff518501962038be19867042f11fcc7ff78096e5d3b68c6d8dc04d9b", - "0xa58ee91bb556d43cf01f1398c5811f76dc0f11efdd569eed9ef178b3b0715e122060ec8f945b4dbf6eebfa2b90af6fa6", - "0xac460be540f4c840def2eef19fc754a9af34608d107cbadb53334cf194cc91138d53b9538fcd0ec970b5d4aa455b224a", - "0xb09b91f929de52c09d48ca0893be6eb44e2f5210a6c394689dc1f7729d4be4e11d0474b178e80cea8c2ac0d081f0e811", - "0x8d37a442a76b06a02a4e64c2504aea72c8b9b020ab7bcc94580fe2b9603c7c50d7b1e9d70d2a7daea19c68667e8f8c31", - "0xa9838d4c4e3f3a0075a952cf7dd623307ec633fcc81a7cf9e52e66c31780de33dbb3d74c320dc7f0a4b72f7a49949515", - "0xa44766b6251af458fe4f5f9ed1e02950f35703520b8656f09fc42d9a2d38a700c11a7c8a0436ac2e5e9f053d0bb8ff91", - "0xad78d9481c840f5202546bea0d13c776826feb8b1b7c72e83d99a947622f0bf38a4208551c4c41beb1270d7792075457", - "0xb619ffa8733b470039451e224b777845021e8dc1125f247a4ff2476cc774657d0ff9c5279da841fc1236047de9d81c60", - "0xaf760b0a30a1d6af3bc5cd6686f396bd41779aeeb6e0d70a09349bd5da17ca2e7965afc5c8ec22744198fbe3f02fb331", - "0xa0cc209abdb768b589fcb7b376b6e1cac07743288c95a1cf1a0354b47f0cf91fca78a75c1fcafa6f5926d6c379116608", - "0x864add673c89c41c754eeb3cd8dcff5cdde1d739fce65c30e474a082bb5d813cba6412e61154ce88fdb6c12c5d9be35b", - "0xb091443b0ce279327dc37cb484e9a5b69b257a714ce21895d67539172f95ffa326903747b64a3649e99aea7bb10d03f7", - "0xa8c452b8c4ca8e0a61942a8e08e28f17fb0ef4c5b018b4e6d1a64038280afa2bf1169202f05f14af24a06ca72f448ccd", - "0xa23c24721d18bc48d5dcf70effcbef89a7ae24e67158d70ae1d8169ee75d9a051d34b14e9cf06488bac324fe58549f26", - "0x92a730e30eb5f3231feb85f6720489dbb1afd42c43f05a1610c6b3c67bb949ec8fde507e924498f4ffc646f7b07d9123", - "0x8dbe5abf4031ec9ba6bb06d1a47dd1121fb9e03b652804069250967fd5e9577d0039e233441b7f837a7c9d67ba18c28e", - "0xaa456bcfef6a21bb88181482b279df260297b3778e84594ebddbdf337e85d9e3d46ca1d0b516622fb0b103df8ec519b7", - "0xa3b31ae621bd210a2b767e0e6f22eb28fe3c4943498a7e91753225426168b9a26da0e02f1dc5264da53a5ad240d9f51b", - "0xaa8d66857127e6e71874ce2202923385a7d2818b84cb73a6c42d71afe70972a70c6bdd2aad1a6e8c5e4ca728382a8ea8", - "0xac7e8e7a82f439127a5e40558d90d17990f8229852d21c13d753c2e97facf077cf59582b603984c3dd3faebd80aff4f5", - "0x93a8bcf4159f455d1baa73d2ef2450dcd4100420de84169bbe28b8b7a5d1746273f870091a87a057e834f754f34204b1", - "0x89d0ebb287c3613cdcae7f5acc43f17f09c0213fc40c074660120b755d664109ffb9902ed981ede79e018ddb0c845698", - "0xa87ccbfad431406aadbee878d9cf7d91b13649d5f7e19938b7dfd32645a43b114eef64ff3a13201398bd9b0337832e5a", - "0x833c51d0d0048f70c3eefb4e70e4ff66d0809c41838e8d2c21c288dd3ae9d9dfaf26d1742bf4976dab83a2b381677011", - "0x8bcd6b1c3b02fffead432e8b1680bad0a1ac5a712d4225e220690ee18df3e7406e2769e1f309e2e803b850bc96f0e768", - "0xb61e3dbd88aaf4ff1401521781e2eea9ef8b66d1fac5387c83b1da9e65c2aa2a56c262dea9eceeb4ad86c90211672db0", - "0x866d3090db944ecf190dd0651abf67659caafd31ae861bab9992c1e3915cb0952da7c561cc7e203560a610f48fae633b", - "0xa5e8971543c14274a8dc892b0be188c1b4fbc75c692ed29f166e0ea80874bc5520c2791342b7c1d2fb5dd454b03b8a5b", - "0x8f2f9fc50471bae9ea87487ebd1bc8576ef844cc42d606af5c4c0969670fdf2189afd643e4de3145864e7773d215f37f", - "0xb1bb0f2527db6d51f42b9224383c0f96048bbc03d469bf01fe1383173ef8b1cc9455d9dd8ba04d46057f46949bfc92b5", - "0xaa7c99d906b4d7922296cfe2520473fc50137c03d68b7865c5bfb8adbc316b1034310ec4b5670c47295f4a80fb8d61e9", - "0xa5d1da4d6aba555919df44cbaa8ff79378a1c9e2cfdfbf9d39c63a4a00f284c5a5724e28ecbc2d9dba27fe4ee5018bd5", - "0xa8db53224f70af4d991b9aae4ffe92d2aa5b618ad9137784b55843e9f16cefbfd25ada355d308e9bbf55f6d2f7976fb3", - "0xb6536c4232bb20e22af1a8bb12de76d5fec2ad9a3b48af1f38fa67e0f8504ef60f305a73d19385095bb6a9603fe29889", - "0x87f7e371a1817a63d6838a8cf4ab3a8473d19ce0d4f40fd013c03d5ddd5f4985df2956531cc9f187928ef54c68f4f9a9", - "0xae13530b1dbc5e4dced9d909ea61286ec09e25c12f37a1ed2f309b0eb99863d236c3b25ed3484acc8c076ad2fa8cd430", - "0x98928d850247c6f7606190e687d5c94a627550198dbdbea0161ef9515eacdb1a0f195cae3bb293112179082daccf8b35", - "0x918528bb8e6a055ad4db6230d3a405e9e55866da15c4721f5ddd1f1f37962d4904aad7a419218fe6d906fe191a991806", - "0xb71e31a06afe065773dd3f4a6e9ef81c3292e27a3b7fdfdd452d03e05af3b6dd654c355f7516b2a93553360c6681a73a", - "0x8870b83ab78a98820866f91ac643af9f3ff792a2b7fda34185a9456a63abdce42bfe8ad4dc67f08a6392f250d4062df4", - "0x91eea1b668e52f7a7a5087fabf1cab803b0316f78d9fff469fbfde2162f660c250e4336a9eea4cb0450bd30ac067bc8b", - "0x8b74990946de7b72a92147ceac1bd9d55999a8b576e8df68639e40ed5dc2062cfcd727903133de482b6dca19d0aaed82", - "0x8ebad537fece090ebbab662bdf2618e21ca30cf6329c50935e8346d1217dcbe3c1fe1ea28efca369c6003ce0a94703c1", - "0xa8640479556fb59ebd1c40c5f368fbd960932fdbb782665e4a0e24e2bdb598fc0164ce8c0726d7759cfc59e60a62e182", - "0xa9a52a6bf98ee4d749f6d38be2c60a6d54b64d5cbe4e67266633dc096cf28c97fe998596707d31968cbe2064b72256bf", - "0x847953c48a4ce6032780e9b39d0ed4384e0be202c2bbe2dfda3910f5d87aa5cd3c2ffbfcfae4dddce16d6ab657599b95", - "0xb6f6e1485d3ec2a06abaecd23028b200b2e4a0096c16144d07403e1720ff8f9ba9d919016b5eb8dc5103880a7a77a1d3", - "0x98dfc2065b1622f596dbe27131ea60bef7a193b12922cecb27f8c571404f483014f8014572e86ae2e341ab738e4887ef", - "0xacb0d205566bacc87bbe2e25d10793f63f7a1f27fd9e58f4f653ceae3ffeba511eaf658e068fad289eeb28f9edbeb35b", - "0xae4411ed5b263673cee894c11fe4abc72a4bf642d94022a5c0f3369380fcdfc1c21e277f2902972252503f91ada3029a", - "0xac4a7a27ba390a75d0a247d93d4a8ef1f0485f8d373a4af4e1139369ec274b91b3464d9738eeaceb19cd6f509e2f8262", - "0x87379c3bf231fdafcf6472a79e9e55a938d851d4dd662ab6e0d95fd47a478ed99e2ad1e6e39be3c0fc4f6d996a7dd833", - "0x81316904b035a8bcc2041199a789a2e6879486ba9fddcba0a82c745cc8dd8374a39e523b91792170cd30be7aa3005b85", - "0xb8206809c6cd027ed019f472581b45f7e12288f89047928ba32b4856b6560ad30395830d71e5e30c556f6f182b1fe690", - "0x88d76c028f534a62e019b4a52967bb8642ede6becfa3807be68fdd36d366fc84a4ac8dc176e80a68bc59eb62caf5dff9", - "0x8c3b8be685b0f8aad131ee7544d0e12f223f08a6f8edaf464b385ac644e0ddc9eff7cc7cb5c1b50ab5d71ea0f41d2213", - "0x8d91410e004f76c50fdc05784157b4d839cb5090022c629c7c97a5e0c3536eeafee17a527b54b1165c3cd81774bb54ce", - "0xb25c2863bc28ec5281ce800ddf91a7e1a53f4c6d5da1e6c86ef4616e93bcf55ed49e297216d01379f5c6e7b3c1e46728", - "0x865f7b09ac3ca03f20be90c48f6975dd2588838c2536c7a3532a6aa5187ed0b709cd03d91ff4048061c10d0aa72b69ce", - "0xb3f7477c90c11596eb4f8bbf34adbcb832638c4ff3cdd090d4d477ee50472ac9ddaf5be9ad7eca3f148960d362bbd098", - "0x8db35fd53fca04faecd1c76a8227160b3ab46ac1af070f2492445a19d8ff7c25bbaef6c9fa0c8c088444561e9f7e4eb2", - "0xa478b6e9d058a2e01d2fc053b739092e113c23a6a2770a16afbef044a3709a9e32f425ace9ba7981325f02667c3f9609", - "0x98caa6bd38916c08cf221722a675a4f7577f33452623de801d2b3429595f988090907a7e99960fff7c076d6d8e877b31", - "0xb79aaaacefc49c3038a14d2ac468cfec8c2161e88bdae91798d63552cdbe39e0e02f9225717436b9b8a40a022c633c6e", - "0x845a31006c680ee6a0cc41d3dc6c0c95d833fcf426f2e7c573fa15b2c4c641fbd6fe5ebb0e23720cc3467d6ee1d80dc4", - "0xa1bc287e272cf8b74dbf6405b3a5190883195806aa351f1dc8e525aa342283f0a35ff687e3b434324dedee74946dd185", - "0xa4fd2dc8db75d3783a020856e2b3aa266dc6926e84f5c491ef739a3bddd46dc8e9e0fc1177937839ef1b18d062ffbb9e", - "0xacbf0d3c697f57c202bb8c5dc4f3fc341b8fc509a455d44bd86acc67cad2a04495d5537bcd3e98680185e8aa286f2587", - "0xa5caf423a917352e1b8e844f5968a6da4fdeae467d10c6f4bbd82b5eea46a660b82d2f5440d3641c717b2c3c9ed0be52", - "0x8a39d763c08b926599ab1233219c49c825368fad14d9afc7c0c039224d37c00d8743293fd21645bf0b91eaf579a99867", - "0xb2b53a496def0ba06e80b28f36530fbe0fb5d70a601a2f10722e59abee529369c1ae8fd0f2db9184dd4a2519bb832d94", - "0xa73980fcef053f1b60ebbb5d78ba6332a475e0b96a0c724741a3abf3b59dd344772527f07203cf4c9cb5155ebed81fa0", - "0xa070d20acce42518ece322c9db096f16aed620303a39d8d5735a0df6e70fbeceb940e8d9f5cc38f3314b2240394ec47b", - "0xa50cf591f522f19ca337b73089557f75929d9f645f3e57d4f241e14cdd1ea3fb48d84bcf05e4f0377afbb789fbdb5d20", - "0x82a5ffce451096aca8eeb0cd2ae9d83db3ed76da3f531a80d9a70a346359bf05d74863ce6a7c848522b526156a5e20cd", - "0x88e0e84d358cbb93755a906f329db1537c3894845f32b9b0b691c29cbb455373d9452fadd1e77e20a623f6eaf624de6f", - "0xaa07ac7b84a6d6838826e0b9e350d8ec75e398a52e9824e6b0da6ae4010e5943fec4f00239e96433f291fef9d1d1e609", - "0xac8887bf39366034bc63f6cc5db0c26fd27307cbc3d6cce47894a8a019c22dd51322fb5096edc018227edfafc053a8f6", - "0xb7d26c26c5b33f77422191dca94977588ab1d4b9ce7d0e19c4a3b4cd1c25211b78c328dbf81e755e78cd7d1d622ad23e", - "0x99a676d5af49f0ba44047009298d8474cabf2d5bca1a76ba21eff7ee3c4691a102fdefea27bc948ccad8894a658abd02", - "0xb0d09a91909ab3620c183bdf1d53d43d39eb750dc7a722c661c3de3a1a5d383ad221f71bae374f8a71867505958a3f76", - "0x84681a883de8e4b93d68ac10e91899c2bbb815ce2de74bb48a11a6113b2a3f4df8aceabda1f5f67bc5aacac8c9da7221", - "0x9470259957780fa9b43521fab3644f555f5343281c72582b56d2efd11991d897b3b481cafa48681c5aeb80c9663b68f7", - "0xab1b29f7ece686e6fa968a4815da1d64f3579fed3bc92e1f3e51cd13a3c076b6cf695ed269d373300a62463dc98a4234", - "0x8ab415bfcd5f1061f7687597024c96dd9c7cb4942b5989379a7a3b5742f7d394337886317659cbeacaf030234a24f972", - "0xb9b524aad924f9acc63d002d617488f31b0016e0f0548f050cada285ce7491b74a125621638f19e9c96eabb091d945be", - "0x8c4c373e79415061837dd0def4f28a2d5d74d21cb13a76c9049ad678ca40228405ab0c3941df49249847ecdefc1a5b78", - "0xa8edf4710b5ab2929d3db6c1c0e3e242261bbaa8bcec56908ddadd7d2dad2dca9d6eb9de630b960b122ebeea41040421", - "0x8d66bb3b50b9df8f373163629f9221b3d4b6980a05ea81dc3741bfe9519cf3ebba7ab98e98390bae475e8ede5821bd5c", - "0x8d3c21bae7f0cfb97c56952bb22084b58e7bb718890935b73103f33adf5e4d99cd262f929c6eeab96209814f0dbae50a", - "0xa5c66cfab3d9ebf733c4af24bebc97070e7989fe3c73e79ac85fb0e4d40ae44fb571e0fad4ad72560e13ed453900d14f", - "0x9362e6b50b43dbefbc3254471372297b5dcce809cd3b60bf74a1268ab68bdb50e46e462cbd78f0d6c056330e982846af", - "0x854630d08e3f0243d570cc2e856234cb4c1a158d9c1883bf028a76525aaa34be897fe918d5f6da9764a3735fa9ebd24a", - "0x8c7d246985469ff252c3f4df6c7c9196fc79f05c1c66a609d84725c78001d0837c7a7049394ba5cf7e863e2d58af8417", - "0xae050271e01b528925302e71903f785b782f7bf4e4e7a7f537140219bc352dc7540c657ed03d3a297ad36798ecdb98cd", - "0x8d2ae9179fcf2b0c69850554580b52c1f4a5bd865af5f3028f222f4acad9c1ad69a8ef6c7dc7b03715ee5c506b74325e", - "0xb8ef8de6ce6369a8851cd36db0ccf00a85077e816c14c4e601f533330af9e3acf0743a95d28962ed8bfcfc2520ef3cfe", - "0xa6ecad6fdfb851b40356a8b1060f38235407a0f2706e7b8bb4a13465ca3f81d4f5b99466ac2565c60af15f022d26732e", - "0x819ff14cdea3ab89d98e133cd2d0379361e2e2c67ad94eeddcdb9232efd509f51d12f4f03ebd4dd953bd262a886281f7", - "0x8561cd0f7a6dbcddd83fcd7f472d7dbcba95b2d4fb98276f48fccf69f76d284e626d7e41314b633352df8e6333fd52a1", - "0xb42557ccce32d9a894d538c48712cb3e212d06ac05cd5e0527ccd2db1078ee6ae399bf6a601ffdab1f5913d35fc0b20c", - "0x89b4008d767aad3c6f93c349d3b956e28307311a5b1cec237e8d74bb0dee7e972c24f347fd56afd915a2342bd7bc32f0", - "0x877487384b207e53f5492f4e36c832c2227f92d1bb60542cfeb35e025a4a7afc2b885fae2528b33b40ab09510398f83e", - "0x8c411050b63c9053dd0cd81dacb48753c3d7f162028098e024d17cd6348482703a69df31ad6256e3d25a8bbf7783de39", - "0xa8506b54a88d17ac10fb1b0d1fe4aa40eae7553a064863d7f6b52ccc4236dd4b82d01dca6ba87da9a239e3069ba879fb", - "0xb1a24caef9df64750c1350789bb8d8a0db0f39474a1c74ea9ba064b1516db6923f00af8d57c632d58844fb8786c3d47a", - "0x959d6e255f212b0708c58a2f75cb1fe932248c9d93424612c1b8d1e640149656059737e4db2139afd5556bcdacf3eda2", - "0x84525af21a8d78748680b6535bbc9dc2f0cf9a1d1740d12f382f6ecb2e73811d6c1da2ad9956070b1a617c61fcff9fe5", - "0xb74417d84597a485d0a8e1be07bf78f17ebb2e7b3521b748f73935b9afbbd82f34b710fb7749e7d4ab55b0c7f9de127d", - "0xa4a9aecb19a6bab167af96d8b9d9aa5308eab19e6bfb78f5a580f9bf89bdf250a7b52a09b75f715d651cb73febd08e84", - "0x9777b30be2c5ffe7d29cc2803a562a32fb43b59d8c3f05a707ab60ec05b28293716230a7d264d7cd9dd358fc031cc13e", - "0x95dce7a3d4f23ac0050c510999f5fbf8042f771e8f8f94192e17bcbfa213470802ebdbe33a876cb621cf42e275cbfc8b", - "0xb0b963ebcbbee847ab8ae740478544350b3ac7e86887e4dfb2299ee5096247cd2b03c1de74c774d9bde94ae2ee2dcd59", - "0xa4ab20bafa316030264e13f7ef5891a2c3b29ab62e1668fcb5881f50a9acac6adbe3d706c07e62f2539715db768f6c43", - "0x901478a297669d608e406fe4989be75264b6c8be12169aa9e0ad5234f459ca377f78484ffd2099a2fe2db5e457826427", - "0x88c76e5c250810c057004a03408b85cd918e0c8903dc55a0dd8bb9b4fc2b25c87f9b8cf5943eb19fbbe99d36490050c5", - "0x91607322bbad4a4f03fc0012d0821eff5f8c516fda45d1ec1133bface6f858bf04b25547be24159cab931a7aa08344d4", - "0x843203e07fce3c6c81f84bc6dc5fb5e9d1c50c8811ace522dc66e8658433a0ef9784c947e6a62c11bf705307ef05212e", - "0x91dd8813a5d6dddcda7b0f87f672b83198cd0959d8311b2b26fb1fae745185c01f796fbd03aad9db9b58482483fdadd8", - "0x8d15911aacf76c8bcd7136e958febd6963104addcd751ce5c06b6c37213f9c4fb0ffd4e0d12c8e40c36d658999724bfd", - "0x8a36c5732d3f1b497ebe9250610605ee62a78eaa9e1a45f329d09aaa1061131cf1d9df00f3a7d0fe8ad614a1ff9caaae", - "0xa407d06affae03660881ce20dab5e2d2d6cddc23cd09b95502a9181c465e57597841144cb34d22889902aff23a76d049", - "0xb5fd856d0578620a7e25674d9503be7d97a2222900e1b4738c1d81ff6483b144e19e46802e91161e246271f90270e6cf", - "0x91b7708869cdb5a7317f88c0312d103f8ce90be14fb4f219c2e074045a2a83636fdc3e69e862049fc7c1ef000e832541", - "0xb64719cc5480709d1dae958f1d3082b32a43376da446c8f9f64cb02a301effc9c34d9102051733315a8179aed94d53cc", - "0x94347a9542ff9d18f7d9eaa2f4d9b832d0e535fe49d52aa2de08aa8192400eddabdb6444a2a78883e27c779eed7fdf5a", - "0x840ef44a733ff1376466698cd26f82cf56bb44811e196340467f932efa3ae1ef9958a0701b3b032f50fd9c1d2aed9ab5", - "0x90ab3f6f67688888a31ffc2a882bb37adab32d1a4b278951a21646f90d03385fc976715fc639a785d015751171016f10", - "0xb56f35d164c24b557dbcbc8a4bfa681ec916f8741ffcb27fb389c164f4e3ed2be325210ef5bdaeae7a172ca9599ab442", - "0xa7921a5a80d7cf6ae81ba9ee05e0579b18c20cd2852762c89d6496aa4c8ca9d1ca2434a67b2c16d333ea8e382cdab1e3", - "0xa506bcfbd7e7e5a92f68a1bd87d07ad5fe3b97aeee40af2bf2cae4efcd77fff03f872732c5b7883aa6584bee65d6f8cb", - "0xa8c46cff58931a1ce9cbe1501e1da90b174cddd6d50f3dfdfb759d1d4ad4673c0a8feed6c1f24c7af32865a7d6c984e5", - "0xb45686265a83bff69e312c5149db7bb70ac3ec790dc92e392b54d9c85a656e2bf58596ce269f014a906eafc97461aa5f", - "0x8d4009a75ccb2f29f54a5f16684b93202c570d7a56ec1a8b20173269c5f7115894f210c26b41e8d54d4072de2d1c75d0", - "0xaef8810af4fc676bf84a0d57b189760ddc3375c64e982539107422e3de2580b89bd27aa6da44e827b56db1b5555e4ee8", - "0x888f0e1e4a34f48eb9a18ef4de334c27564d72f2cf8073e3d46d881853ac1424d79e88d8ddb251914890588937c8f711", - "0xb64b0aa7b3a8f6e0d4b3499fe54e751b8c3e946377c0d5a6dbb677be23736b86a7e8a6be022411601dd75012012c3555", - "0x8d57776f519f0dd912ea14f79fbab53a30624e102f9575c0bad08d2dc754e6be54f39b11278c290977d9b9c7c0e1e0ad", - "0xa018fc00d532ceb2e4de908a15606db9b6e0665dd77190e2338da7c87a1713e6b9b61554e7c1462f0f6d4934b960b15c", - "0x8c932be83ace46f65c78e145b384f58e41546dc0395270c1397874d88626fdeda395c8a289d602b4c312fe98c1311856", - "0x89174838e21639d6bdd91a0621f04dc056907b88e305dd66e46a08f6d65f731dea72ae87ca5e3042d609e8de8de9aa26", - "0xb7b7f508bb74f7a827ac8189daa855598ff1d96fa3a02394891fd105d8f0816224cd50ac4bf2ed1cf469ace516c48184", - "0xb31877ad682583283baadd68dc1bebd83f5748b165aadd7fe9ef61a343773b88bcd3a022f36d6c92f339b7bfd72820a9", - "0xb79d77260b25daf9126dab7a193df2d7d30542786fa1733ffaf6261734770275d3ca8bae1d9915d1181a78510b3439db", - "0x91894fb94cd4c1dd2ceaf9c53a7020c5799ba1217cf2d251ea5bc91ed26e1159dd758e98282ebe35a0395ef9f1ed15a0", - "0xab59895cdafd33934ceedfc3f0d5d89880482cba6c99a6db93245f9e41987efd76e0640e80aef31782c9a8c7a83fccec", - "0xaa22ea63654315e033e09d4d4432331904a6fc5fb1732557987846e3c564668ca67c60a324b4af01663a23af11a9ce4b", - "0xb53ba3ef342601467e1f71aa280e100fbabbd38518fa0193e0099505036ee517c1ac78e96e9baeb549bb6879bb698fb0", - "0x943fd69fd656f37487cca3605dc7e5a215fddd811caf228595ec428751fc1de484a0cb84c667fe4d7c35599bfa0e5e34", - "0x9353128b5ebe0dddc555093cf3e5942754f938173541033e8788d7331fafc56f68d9f97b4131e37963ab7f1c8946f5f1", - "0xa76cd3c566691f65cfb86453b5b31dbaf3cab8f84fe1f795dd1e570784b9b01bdd5f0b3c1e233942b1b5838290e00598", - "0x983d84b2e53ffa4ae7f3ba29ef2345247ea2377686b74a10479a0ef105ecf90427bf53b74c96dfa346d0f842b6ffb25b", - "0x92e0fe9063306894a2c6970c001781cff416c87e87cb5fbac927a3192655c3da4063e6fa93539f6ff58efac6adcc5514", - "0xb00a81f03c2b8703acd4e2e4c21e06973aba696415d0ea1a648ace2b0ea19b242fede10e4f9d7dcd61c546ab878bc8f9", - "0xb0d08d880f3b456a10bf65cff983f754f545c840c413aea90ce7101a66eb0a0b9b1549d6c4d57725315828607963f15a", - "0x90cb64d03534f913b411375cce88a9e8b1329ce67a9f89ca5df8a22b8c1c97707fec727dbcbb9737f20c4cf751359277", - "0x8327c2d42590dfcdb78477fc18dcf71608686ad66c49bce64d7ee874668be7e1c17cc1042a754bbc77c9daf50b2dae07", - "0x8532171ea13aa7e37178e51a6c775da469d2e26ec854eb16e60f3307db4acec110d2155832c202e9ba525fc99174e3b0", - "0x83ca44b15393d021de2a511fa5511c5bd4e0ac7d67259dce5a5328f38a3cce9c3a269405959a2486016bc27bb140f9ff", - "0xb1d36e8ca812be545505c8214943b36cabee48112cf0de369957afa796d37f86bf7249d9f36e8e990f26f1076f292b13", - "0x9803abf45be5271e2f3164c328d449efc4b8fc92dfc1225d38e09630909fe92e90a5c77618daa5f592d23fc3ad667094", - "0xb268ad68c7bf432a01039cd889afae815c3e120f57930d463aece10af4fd330b5bd7d8869ef1bcf6b2e78e4229922edc", - "0xa4c91a0d6f16b1553264592b4cbbbf3ca5da32ab053ffbdd3dbb1aed1afb650fb6e0dc5274f71a51d7160856477228db", - "0xad89d043c2f0f17806277ffdf3ecf007448e93968663f8a0b674254f36170447b7527d5906035e5e56f4146b89b5af56", - "0x8b6964f757a72a22a642e4d69102951897e20c21449184e44717bd0681d75f7c5bfa5ee5397f6e53febf85a1810d6ed1", - "0xb08f5cdaabec910856920cd6e836c830b863eb578423edf0b32529488f71fe8257d90aed4a127448204df498b6815d79", - "0xaf26bb3358be9d280d39b21d831bb53145c4527a642446073fee5a86215c4c89ff49a3877a7a549486262f6f57a0f476", - "0xb4010b37ec4d7c2af20800e272539200a6b623ae4636ecbd0e619484f4ab9240d02bc5541ace3a3fb955dc0a3d774212", - "0x82752ab52bdcc3cc2fc405cb05a2e694d3df4a3a68f2179ec0652536d067b43660b96f85f573f26fbd664a9ef899f650", - "0x96d392dde067473a81faf2d1fea55b6429126b88b160e39b4210d31d0a82833ffd3a80e07d24d495aea2d96be7251547", - "0xa76d8236d6671204d440c33ac5b8deb71fa389f6563d80e73be8b043ec77d4c9b06f9a586117c7f957f4af0331cbc871", - "0xb6c90961f68b5e385d85c9830ec765d22a425f506904c4d506b87d8944c2b2c09615e740ed351df0f9321a7b93979cae", - "0xa6ec5ea80c7558403485b3b1869cdc63bde239bafdf936d9b62a37031628402a36a2cfa5cfbb8e26ac922cb0a209b3ba", - "0x8c3195bbdbf9bc0fc95fa7e3d7f739353c947f7767d1e3cb24d8c8602d8ea0a1790ac30b815be2a2ba26caa5227891e2", - "0xa7f8a63d809f1155722c57f375ea00412b00147776ae4444f342550279ef4415450d6f400000a326bf11fea6c77bf941", - "0x97fa404df48433a00c85793440e89bb1af44c7267588ae937a1f5d53e01e1c4d4fc8e4a6d517f3978bfdd6c2dfde012f", - "0xa984a0a3836de3d8d909c4629a2636aacb85393f6f214a2ef68860081e9db05ad608024762db0dc35e895dc00e2d4cdd", - "0x9526cf088ab90335add1db4d3a4ac631b58cbfbe88fa0845a877d33247d1cfeb85994522e1eb8f8874651bfb1df03e2a", - "0xac83443fd0afe99ad49de9bf8230158c118e2814c9c89db5ac951c240d6c2ce45e7677221279d9e97848ec466b99aafe", - "0xaeeefdbaba612e971697798ceaf63b247949dc823a0ad771ae5b988a5e882b338a98d3d0796230f49d533ec5ba411b39", - "0xae3f248b5a7b0f92b7820a6c5ae21e5bd8f4265d4f6e21a22512079b8ee9be06393fd3133ce8ebac0faf23f4f8517e36", - "0xa64a831b908eee784b8388b45447d2885ec0551b26b0c2b15e5f417d0a12c79e867fb7bd3d008d0af98b44336f8ec1ad", - "0xb242238cd8362b6e440ba21806905714dd55172db25ec7195f3fc4937b2aba146d5cbf3cf691a1384b4752dc3b54d627", - "0x819f97f337eea1ffb2a678cc25f556f1aab751c6b048993a1d430fe1a3ddd8bb411c152e12ca60ec6e057c190cd1db9a", - "0xb9d7d187407380df54ee9fef224c54eec1bfabf17dc8abf60765b7951f538f59aa26fffd5846cfe05546c35f59b573f4", - "0xaa6e3c14efa6a5962812e3f94f8ce673a433f4a82d07a67577285ea0eaa07f8be7115853122d12d6d4e1fdf64c504be1", - "0x82268bee9c1662d3ddb5fb785abfae6fb8b774190f30267f1d47091d2cd4b3874db4372625aa36c32f27b0eee986269b", - "0xb236459565b7b966166c4a35b2fa71030b40321821b8e96879d95f0e83a0baf33fa25721f30af4a631df209e25b96061", - "0x8708d752632d2435d2d5b1db4ad1fa2558d776a013655f88e9a3556d86b71976e7dfe5b8834fdec97682cd94560d0d0d", - "0xae1424a68ae2dbfb0f01211f11773732a50510b5585c1fb005cb892b2c6a58f4a55490b5c5b4483c6fce40e9d3236a52", - "0xb3f5f722af9dddb07293c871ce97abbccba0093ca98c8d74b1318fa21396fc1b45b69c15084f63d728f9908442024506", - "0x9606f3ce5e63886853ca476dc0949e7f1051889d529365c0cb0296fdc02abd088f0f0318ecd2cf36740a3634132d36f6", - "0xb11a833a49fa138db46b25ff8cdda665295226595bc212c0931b4931d0a55c99da972c12b4ef753f7e37c6332356e350", - "0xafede34e7dab0a9e074bc19a7daddb27df65735581ca24ad70c891c98b1349fcebbcf3ba6b32c2617fe06a5818dabc2d", - "0x97993d456e459e66322d01f8eb13918979761c3e8590910453944bdff90b24091bb018ac6499792515c9923be289f99f", - "0x977e3e967eff19290a192cd11df3667d511b398fb3ac9a5114a0f3707e25a0edcb56105648b1b85a8b7519fc529fc6f6", - "0xb873a7c88bf58731fe1bf61ff6828bf114cf5228f254083304a4570e854e83748fc98683ddba62d978fff7909f2c5c47", - "0xad4b2691f6f19da1d123aaa23cca3e876247ed9a4ab23c599afdbc0d3aa49776442a7ceaa996ac550d0313d9b9a36cee", - "0xb9210713c78e19685608c6475bfa974b57ac276808a443f8b280945c5d5f9c39da43effa294bfb1a6c6f7b6b9f85bf6c", - "0xa65152f376113e61a0e468759de38d742caa260291b4753391ee408dea55927af08a4d4a9918600a3bdf1df462dffe76", - "0x8bf8c27ad5140dde7f3d2280fd4cc6b29ab76537e8d7aa7011a9d2796ee3e56e9a60c27b5c2da6c5e14fc866301dc195", - "0x92fde8effc9f61393a2771155812b863cff2a0c5423d7d40aa04d621d396b44af94ddd376c28e7d2f53c930aea947484", - "0x97a01d1dd9ee30553ce676011aea97fa93d55038ada95f0057d2362ae9437f3ed13de8290e2ff21e3167dd7ba10b9c3f", - "0x89affffaa63cb2df3490f76f0d1e1d6ca35c221dd34057176ba739fa18d492355e6d2a5a5ad93a136d3b1fed0bb8aa19", - "0x928b8e255a77e1f0495c86d3c63b83677b4561a5fcbbe5d3210f1e0fc947496e426d6bf3b49394a5df796c9f25673fc4", - "0x842a0af91799c9b533e79ee081efe2a634cac6c584c2f054fb7d1db67dde90ae36de36cbf712ec9cd1a0c7ee79e151ea", - "0xa65b946cf637e090baf2107c9a42f354b390e7316beb8913638130dbc67c918926eb87bec3b1fe92ef72bc77a170fa3b", - "0xaafc0f19bfd71ab5ae4a8510c7861458b70ad062a44107b1b1dbacbfa44ba3217028c2824bd7058e2fa32455f624040b", - "0x95269dc787653814e0be899c95dba8cfa384f575a25e671c0806fd80816ad6797dc819d30ae06e1d0ed9cb01c3950d47", - "0xa1e760f7fa5775a1b2964b719ff961a92083c5c617f637fc46e0c9c20ab233f8686f7f38c3cb27d825c54dd95e93a59b", - "0xac3b8a7c2317ea967f229eddc3e23e279427f665c4705c7532ed33443f1243d33453c1088f57088d2ab1e3df690a9cc9", - "0xb787beeddfbfe36dd51ec4efd9cf83e59e84d354c3353cc9c447be53ae53d366ed1c59b686e52a92f002142c8652bfe0", - "0xb7a64198300cb6716aa7ac6b25621f8bdec46ad5c07a27e165b3f774cdf65bcfdbf31e9bae0c16b44de4b00ada7a4244", - "0xb8ae9f1452909e0c412c7a7fe075027691ea8df1347f65a5507bc8848f1d2c833d69748076db1129e5b4fb912f65c86c", - "0x9682e41872456b9fa67def89e71f06d362d6c8ca85c9c48536615bc401442711e1c9803f10ab7f8ab5feaec0f9df20a6", - "0x88889ff4e271dc1c7e21989cc39f73cde2f0475acd98078281591ff6c944fadeb9954e72334319050205d745d4df73df", - "0x8f79b5b8159e7fd0d93b0645f3c416464f39aec353b57d99ecf24f96272df8a068ad67a6c90c78d82c63b40bb73989bb", - "0x838c01a009a3d8558a3f0bdd5e22de21af71ca1aefc8423c91dc577d50920e9516880e87dce3e6d086e11cd45c9052d9", - "0xb97f1c6eee8a78f137c840667cc288256e39294268a3009419298a04a1d0087c9c9077b33c917c65caf76637702dda8a", - "0x972284ce72f96a61c899260203dfa06fc3268981732bef74060641c1a5068ead723e3399431c247ca034b0dae861e8df", - "0x945a8d52d6d3db6663dbd3110c6587f9e9c44132045eeffba15621576d178315cb52870fa5861669f84f0bee646183fe", - "0xa0a547b5f0967b1c3e5ec6c6a9a99f0578521489180dfdfbb5561f4d166baac43a2f06f950f645ce991664e167537eed", - "0xa0592cda5cdddf1340033a745fd13a6eff2021f2e26587116c61c60edead067e0f217bc2bef4172a3c9839b0b978ab35", - "0xb9c223b65a3281587fa44ec829e609154b32f801fd1de6950e01eafb07a8324243b960d5735288d0f89f0078b2c42b5b", - "0x99ebfc3b8f9f98249f4d37a0023149ed85edd7a5abe062c8fb30c8c84555258b998bdcdd1d400bc0fa2a4aaa8b224466", - "0x955b68526e6cb3937b26843270f4e60f9c6c8ece2fa9308fe3e23afa433309c068c66a4bc16ee2cf04220f095e9afce4", - "0xb766caeafcc00378135ae53397f8a67ed586f5e30795462c4a35853de6681b1f17401a1c40958de32b197c083b7279c1", - "0x921bf87cad947c2c33fa596d819423c10337a76fe5a63813c0a9dc78a728207ae7b339407a402fc4d0f7cba3af6da6fc", - "0xa74ba1f3bc3e6c025db411308f49b347ec91da1c916bda9da61e510ec8d71d25e0ac0f124811b7860e5204f93099af27", - "0xa29b4d144e0bf17a7e8353f2824cef0ce85621396babe8a0b873ca1e8a5f8d508b87866cf86da348470649fceefd735c", - "0xa8040e12ffc3480dd83a349d06741d1572ef91932c46f5cf03aee8454254156ee95786fd013d5654725e674c920cec32", - "0x8c4cf34ca60afd33923f219ffed054f90cd3f253ffeb2204a3b61b0183417e366c16c07fae860e362b0f2bfe3e1a1d35", - "0x8195eede4ddb1c950459df6c396b2e99d83059f282b420acc34220cadeed16ab65c856f2c52568d86d3c682818ed7b37", - "0x91fff19e54c15932260aa990c7fcb3c3c3da94845cc5aa8740ef56cf9f58d19b4c3c55596f8d6c877f9f4d22921d93aa", - "0xa3e0bf7e5d02a80b75cf75f2db7e66cb625250c45436e3c136d86297d652590ec97c2311bafe407ad357c79ab29d107b", - "0x81917ff87e5ed2ae4656b481a63ced9e6e5ff653b8aa6b7986911b8bc1ee5b8ef4f4d7882c3f250f2238e141b227e510", - "0x915fdbe5e7de09c66c0416ae14a8750db9412e11dc576cf6158755fdcaf67abdbf0fa79b554cac4fe91c4ec245be073f", - "0x8df27eafb5c3996ba4dc5773c1a45ca77e626b52e454dc1c4058aa94c2067c18332280630cc3d364821ee53bf2b8c130", - "0x934f8a17c5cbb827d7868f5c8ca00cb027728a841000a16a3428ab16aa28733f16b52f58c9c4fbf75ccc45df72d9c4df", - "0xb83f4da811f9183c25de8958bc73b504cf790e0f357cbe74ef696efa7aca97ad3b7ead1faf76e9f982c65b6a4d888fc2", - "0x87188213c8b5c268dc2b6da413f0501c95749e953791b727450af3e43714149c115b596b33b63a2f006a1a271b87efd0", - "0x83e9e888ab9c3e30761de635d9aabd31248cdd92f7675fc43e4b21fd96a03ec1dc4ad2ec94fec857ffb52683ac98e360", - "0xb4b9a1823fe2d983dc4ec4e3aaea297e581c3fc5ab4b4af5fa1370caa37af2d1cc7fc6bfc5e7da60ad8fdce27dfe4b24", - "0x856388bc78aef465dbcdd1f559252e028c9e9a2225c37d645c138e78f008f764124522705822a61326a6d1c79781e189", - "0xa6431b36db93c3b47353ba22e7c9592c9cdfb9cbdd052ecf2cc3793f5b60c1e89bc96e6bae117bfd047f2308da00dd2f", - "0xb619972d48e7e4291542dcde08f7a9cdc883c892986ded2f23ccb216e245cd8d9ad1d285347b0f9d7611d63bf4cee2bc", - "0x8845cca6ff8595955f37440232f8e61d5351500bd016dfadd182b9d39544db77a62f4e0102ff74dd4173ae2c181d24ef", - "0xb2f5f7fa26dcd3b6550879520172db2d64ee6aaa213cbef1a12befbce03f0973a22eb4e5d7b977f466ac2bf8323dcedd", - "0x858b7f7e2d44bdf5235841164aa8b4f3d33934e8cb122794d90e0c1cac726417b220529e4f896d7b77902ab0ccd35b3a", - "0x80b0408a092dae2b287a5e32ea1ad52b78b10e9c12f49282976cd738f5d834e03d1ad59b09c5ccaccc39818b87d06092", - "0xb996b0a9c6a2d14d984edcd6ab56bc941674102980d65b3ad9733455f49473d3f587c8cbf661228a7e125ddbe07e3198", - "0x90224fcebb36865293bd63af786e0c5ade6b67c4938d77eb0cbae730d514fdd0fe2d6632788e858afd29d46310cf86df", - "0xb71351fdfff7168b0a5ec48397ecc27ac36657a8033d9981e97002dcca0303e3715ce6dd3f39423bc8ef286fa2e9e669", - "0xae2a3f078b89fb753ce4ed87e0c1a58bb19b4f0cfb6586dedb9fcab99d097d659a489fb40e14651741e1375cfc4b6c5f", - "0x8ef476b118e0b868caed297c161f4231bbeb863cdfa5e2eaa0fc6b6669425ce7af50dc374abceac154c287de50c22307", - "0x92e46ab472c56cfc6458955270d3c72b7bde563bb32f7d4ab4d959db6f885764a3d864e1aa19802fefaa5e16b0cb0b54", - "0x96a3f68323d1c94e73d5938a18a377af31b782f56212de3f489d22bc289cf24793a95b37f1d6776edf88114b5c1fa695", - "0x962cc068cfce6faaa27213c4e43e44eeff0dfbb6d25b814e82c7da981fb81d7d91868fa2344f05fb552362f98cfd4a72", - "0x895d4e4c4ad670abf66d43d59675b1add7afad7438ada8f42a0360c704cee2060f9ac15b4d27e9b9d0996bb801276fe3", - "0xb3ad18d7ece71f89f2ef749b853c45dc56bf1c796250024b39a1e91ed11ca32713864049c9aaaea60cde309b47486bbf", - "0x8f05404e0c0258fdbae50e97ccb9b72ee17e0bd2400d9102c0dad981dac8c4c71585f03e9b5d50086d0a2d3334cb55d1", - "0x8bd877e9d4591d02c63c6f9fc9976c109de2d0d2df2bfa5f6a3232bab5b0b8b46e255679520480c2d7a318545efa1245", - "0x8d4c16b5d98957c9da13d3f36c46f176e64e5be879f22be3179a2c0e624fe4758a82bf8c8027410002f973a3b84cd55a", - "0x86e2a8dea86427b424fa8eada881bdff896907084a495546e66556cbdf070b78ba312bf441eb1be6a80006d25d5097a3", - "0x8608b0c117fd8652fdab0495b08fadbeba95d9c37068e570de6fddfef1ba4a1773b42ac2be212836141d1bdcdef11a17", - "0xa13d6febf5fb993ae76cae08423ca28da8b818d6ef0fde32976a4db57839cd45b085026b28ee5795f10a9a8e3098c683", - "0x8e261967fa6de96f00bc94a199d7f72896a6ad8a7bbb1d6187cca8fad824e522880e20f766620f4f7e191c53321d70f9", - "0x8b8e8972ac0218d7e3d922c734302803878ad508ca19f5f012bc047babd8a5c5a53deb5fe7c15a4c00fd6d1cb9b1dbd0", - "0xb5616b233fb3574a2717d125a434a2682ff68546dccf116dd8a3b750a096982f185614b9fb6c7678107ff40a451f56fa", - "0xaa6adf9b0c3334b0d0663f583a4914523b2ac2e7adffdb026ab9109295ff6af003ef8357026dbcf789896d2afded8d73", - "0xacb72df56a0b65496cd534448ed4f62950bb1e11e50873b6ed349c088ee364441821294ce0f7c61bd7d38105bea3b442", - "0xabae12df83e01ec947249fedd0115dc501d2b03ff7232092979eda531dbbca29ace1d46923427c7dde4c17bdf3fd7708", - "0x820b4fc2b63a9fda7964acf5caf19a2fc4965007cb6d6b511fcafcb1f71c3f673a1c0791d3f86e3a9a1eb6955b191cc0", - "0xaf277259d78c6b0f4f030a10c53577555df5e83319ddbad91afbd7c30bc58e7671c56d00d66ec3ab5ef56470cd910cee", - "0xad4a861c59f1f5ca1beedd488fb3d131dea924fffd8e038741a1a7371fad7370ca5cf80dc01f177fbb9576713bb9a5b3", - "0xb67a5162982ce6a55ccfb2f177b1ec26b110043cf18abd6a6c451cf140b5af2d634591eb4f28ad92177d8c7e5cd0a5e8", - "0x96176d0a83816330187798072d449cbfccff682561e668faf6b1220c9a6535b32a6e4f852e8abb00f79abb87493df16b", - "0xb0afe6e7cb672e18f0206e4423f51f8bd0017bf464c4b186d46332c5a5847647f89ff7fa4801a41c1b0b42f6135bcc92", - "0x8fc5e7a95ef20c1278c645892811f6fe3f15c431ebc998a32ec0da44e7213ea934ed2be65239f3f49b8ec471e9914160", - "0xb7793e41adda6c82ba1f2a31f656f6205f65bf8a3d50d836ee631bc7ce77c153345a2d0fc5c60edf8b37457c3729c4ec", - "0xa504dd7e4d6b2f4379f22cc867c65535079c75ccc575955f961677fa63ecb9f74026fa2f60c9fb6323c1699259e5e9c8", - "0xab899d00ae693649cc1afdf30fb80d728973d2177c006e428bf61c7be01e183866614e05410041bc82cb14a33330e69c", - "0x8a3bd8b0b1be570b65c4432a0f6dc42f48a2000e30ab089cf781d38f4090467b54f79c0d472fcbf18ef6a00df69cc6f3", - "0xb4d7028f7f76a96a3d7803fca7f507ae11a77c5346e9cdfccb120a833a59bda1f4264e425aa588e7a16f8e7638061d84", - "0xb9c7511a76ea5fb105de905d44b02edb17008335766ee357ed386b7b3cf19640a98b38785cb14603c1192bee5886c9b6", - "0x8563afb12e53aed71ac7103ab8602bfa8371ae095207cb0d59e8fd389b6ad1aff0641147e53cb6a7ca16c7f37c9c5e6b", - "0x8e108be614604e09974a9ed90960c28c4ea330a3d9a0cb4af6dd6f193f84ab282b243ecdf549b3131036bebc8905690c", - "0xb794d127fbedb9c5b58e31822361706ffac55ce023fbfe55716c3c48c2fd2f2c7660a67346864dfe588812d369cb50b6", - "0xb797a3442fc3b44f41baefd30346f9ac7f96e770d010d53c146ce74ce424c10fb62758b7e108b8abfdc5fafd89d745cb", - "0x993bb71e031e8096442e6205625e1bfddfe6dd6a83a81f3e2f84fafa9e5082ab4cad80a099f21eff2e81c83457c725c3", - "0x8711ab833fc03e37acf2e1e74cfd9133b101ff4144fe30260654398ae48912ab46549d552eb9d15d2ea57760d35ac62e", - "0xb21321fd2a12083863a1576c5930e1aecb330391ef83326d9d92e1f6f0d066d1394519284ddab55b2cb77417d4b0292f", - "0x877d98f731ffe3ee94b0b5b72d127630fa8a96f6ca4f913d2aa581f67732df6709493693053b3e22b0181632ac6c1e3b", - "0xae391c12e0eb8c145103c62ea64f41345973311c3bf7281fa6bf9b7faafac87bcf0998e5649b9ef81e288c369c827e07", - "0xb83a2842f36998890492ab1cd5a088d9423d192681b9a3a90ec518d4c541bce63e6c5f4df0f734f31fbfdd87785a2463", - "0xa21b6a790011396e1569ec5b2a423857b9bec16f543e63af28024e116c1ea24a3b96e8e4c75c6537c3e4611fd265e896", - "0xb4251a9c4aab3a495da7a42e684ba4860dbcf940ad1da4b6d5ec46050cbe8dab0ab9ae6b63b5879de97b905723a41576", - "0x8222f70aebfe6ac037f8543a08498f4cadb3edaac00336fc00437eb09f2cba758f6c38e887cc634b4d5b7112b6334836", - "0x86f05038e060594c46b5d94621a1d9620aa8ba59a6995baf448734e21f58e23c1ea2993d3002ad5250d6edd5ba59b34f", - "0xa7c0c749baef811ab31b973c39ceb1d94750e2bc559c90dc5eeb20d8bb6b78586a2b363c599ba2107d6be65cd435f24e", - "0x861d46a5d70b38d6c1cd72817a2813803d9f34c00320c8b62f8b9deb67f5b5687bc0b37c16d28fd017367b92e05da9ca", - "0xb3365d3dab639bffbe38e35383686a435c8c88b397b717cd4aeced2772ea1053ceb670f811f883f4e02975e5f1c4ac58", - "0xa5750285f61ab8f64cd771f6466e2c0395e01b692fd878f2ef2d5c78bdd8212a73a3b1dfa5e4c8d9e1afda7c84857d3b", - "0x835a10809ccf939bc46cf950a33b36d71be418774f51861f1cd98a016ade30f289114a88225a2c11e771b8b346cbe6ef", - "0xa4f59473a037077181a0a62f1856ec271028546ca9452b45cedfcb229d0f4d1aabfc13062b07e536cc8a0d4b113156a2", - "0x95cd14802180b224d44a73cc1ed599d6c4ca62ddcaa503513ccdc80aaa8be050cc98bd4b4f3b639549beb4587ac6caf9", - "0x973b731992a3e69996253d7f36dd7a0af1982b5ed21624b77a7965d69e9a377b010d6dabf88a8a97eec2a476259859cc", - "0xaf8a1655d6f9c78c8eb9a95051aa3baaf9c811adf0ae8c944a8d3fcba87b15f61021f3baf6996fa0aa51c81b3cb69de1", - "0x835aad5c56872d2a2d6c252507b85dd742bf9b8c211ccb6b25b52d15c07245b6d89b2a40f722aeb5083a47cca159c947", - "0xabf4e970b02bef8a102df983e22e97e2541dd3650b46e26be9ee394a3ea8b577019331857241d3d12b41d4eacd29a3ac", - "0xa13c32449dbedf158721c13db9539ae076a6ce5aeaf68491e90e6ad4e20e20d1cdcc4a89ed9fd49cb8c0dd50c17633c1", - "0x8c8f78f88b7e22dd7e9150ab1c000f10c28e696e21d85d6469a6fe315254740f32e73d81ab1f3c1cf8f544c86df506e8", - "0xb4b77f2acfe945abf81f2605f906c10b88fb4d28628487fb4feb3a09f17f28e9780445dfcee4878349d4c6387a9d17d4", - "0x8d255c235f3812c6ecc646f855fa3832be5cb4dbb9c9e544989fafdf3f69f05bfd370732eaf954012f0044aa013fc9c6", - "0xb982efd3f34b47df37c910148ac56a84e8116647bea24145a49e34e0a6c0176e3284d838dae6230cb40d0be91c078b85", - "0x983f365aa09bd85df2a6a2ad8e4318996b1e27d02090755391d4486144e40d80b1fbfe1c798d626db92f52e33aa634da", - "0x95fd1981271f3ea3a41d654cf497e6696730d9ff7369f26bc4d7d15c7adb4823dd0c42e4a005a810af12d234065e5390", - "0xa9f5219bd4b913c186ef30c02f995a08f0f6f1462614ea5f236964e02bdaa33db9d9b816c4aee5829947840a9a07ba60", - "0x9210e6ceb05c09b46fd09d036287ca33c45124ab86315e5d6911ff89054f1101faaa3e83d123b7805056d388bcec6664", - "0x8ed9cbf69c6ff3a5c62dd9fe0d7264578c0f826a29e614bc2fb4d621d90c8c9992438accdd7a614b1dca5d1bb73dc315", - "0x85cf2a8cca93e00da459e3cecd22c342d697eee13c74d5851634844fc215f60053cf84b0e03c327cb395f48d1c71a8a4", - "0x8818a18e9a2ec90a271b784400c1903089ffb0e0b40bc5abbbe12fbebe0f731f91959d98c5519ef1694543e31e2016d4", - "0x8dabc130f296fa7a82870bf9a8405aaf542b222ed9276bba9bd3c3555a0f473acb97d655ee7280baff766a827a8993f0", - "0xac7952b84b0dc60c4d858f034093b4d322c35959605a3dad2b806af9813a4680cb038c6d7f4485b4d6b2ff502aaeca25", - "0xad65cb6d57b48a2602568d2ec8010baed0eb440eec7638c5ec8f02687d764e9de5b5d42ad5582934e592b48471c22d26", - "0xa02ab8bd4c3d114ea23aebdd880952f9495912817da8c0c08eabc4e6755439899d635034413d51134c72a6320f807f1c", - "0x8319567764b8295402ec1ebef4c2930a138480b37e6d7d01c8b4c9cd1f2fc3f6e9a44ae6e380a0c469b25b06db23305f", - "0xafec53b2301dc0caa8034cd9daef78c48905e6068d692ca23d589b84a6fa9ddc2ed24a39480597e19cb3e83eec213b3f", - "0xac0b4ffdb5ae08e586a9cdb98f9fe56f4712af3a97065e89e274feacfb52b53c839565aee93c4cfaaccfe51432c4fab0", - "0x8972cbf07a738549205b1094c5987818124144bf187bc0a85287c94fdb22ce038c0f11df1aa16ec5992e91b44d1af793", - "0xb7267aa6f9e3de864179b7da30319f1d4cb2a3560f2ea980254775963f1523b44c680f917095879bebfa3dc2b603efcf", - "0x80f68f4bfc337952e29504ee5149f15093824ea7ab02507efd1317a670f6cbc3611201848560312e3e52e9d9af72eccf", - "0x8897fee93ce8fc1e1122e46b6d640bba309384dbd92e46e185e6364aa8210ebf5f9ee7e5e604b6ffba99aa80a10dd7d0", - "0xb58ea6c02f2360be60595223d692e82ee64874fda41a9f75930f7d28586f89be34b1083e03bbc1575bbfdda2d30db1ea", - "0x85a523a33d903280d70ac5938770453a58293480170c84926457ac2df45c10d5ff34322ab130ef4a38c916e70d81af53", - "0xa2cbf045e1bed38937492c1f2f93a5ba41875f1f262291914bc1fc40c60bd0740fb3fea428faf6da38b7c180fe8ac109", - "0x8c09328770ed8eb17afc6ac7ddd87bb476de18ed63cab80027234a605806895959990c47bd10d259d7f3e2ecb50074c9", - "0xb4b9e19edb4a33bde8b7289956568a5b6b6557404e0a34584b5721fe6f564821091013fbb158e2858c6d398293bb4b59", - "0x8a47377df61733a2aa5a0e945fce00267f8e950f37e109d4487d92d878fb8b573317bb382d902de515b544e9e233458d", - "0xb5804c9d97efeff5ca94f3689b8088c62422d92a1506fd1d8d3b1b30e8a866ad0d6dad4abfa051dfc4471250cac4c5d9", - "0x9084a6ee8ec22d4881e9dcc8a9eb3c2513523d8bc141942370fd191ad2601bf9537a0b1e84316f3209b3d8a54368051e", - "0x85447eea2fa26656a649f8519fa67279183044791d61cf8563d0783d46d747d96af31d0a93507bbb2242666aa87d3720", - "0x97566a84481027b60116c751aec552adfff2d9038e68d48c4db9811fb0cbfdb3f1d91fc176a0b0d988a765f8a020bce1", - "0xae87e5c1b9e86c49a23dceda4ecfd1dcf08567f1db8e5b6ec752ebd45433c11e7da4988573cdaebbb6f4135814fc059e", - "0xabee05cf9abdbc52897ac1ce9ed157f5466ed6c383d6497de28616238d60409e5e92619e528af8b62cc552bf09970dc2", - "0xae6d31cd7bf9599e5ee0828bab00ceb4856d829bba967278a73706b5f388465367aa8a6c7da24b5e5f1fdd3256ef8e63", - "0xac33e7b1ee47e1ee4af472e37ab9e9175260e506a4e5ce449788075da1b53c44cb035f3792d1eea2aa24b1f688cc6ed3", - "0x80f65b205666b0e089bb62152251c48c380a831e5f277f11f3ef4f0d52533f0851c1b612267042802f019ec900dc0e8f", - "0x858520ad7aa1c9fed738e3b583c84168f2927837ad0e1d326afe9935c26e9b473d7f8c382e82ef1fe37d2b39bb40a1ee", - "0xb842dd4af8befe00a97c2d0f0c33c93974761e2cb9e5ab8331b25170318ddd5e4bdbc02d8f90cbfdd5f348f4f371c1f7", - "0x8bf2cb79bc783cb57088aae7363320cbeaabd078ffdec9d41bc74ff49e0043d0dad0086a30e5112b689fd2f5a606365d", - "0x982eb03bbe563e8850847cd37e6a3306d298ab08c4d63ab6334e6b8c1fa13fce80cf2693b09714c7621d74261a0ff306", - "0xb143edb113dec9f1e5105d4a93fbe502b859e587640d3db2f628c09a17060e6aec9e900e2c8c411cda99bc301ff96625", - "0xaf472d9befa750dcebc5428fe1a024f18ec1c07bca0f95643ce6b5f4189892a910285afb03fd7ed7068fbe614e80d33c", - "0xa97e3bc57ede73ecd1bbf02de8f51b4e7c1a067da68a3cd719f4ba26a0156cbf1cef2169fd35a18c5a4cced50d475998", - "0xa862253c937cf3d75d7183e5f5be6a4385d526aeda5171c1c60a8381fea79f88f5f52a4fab244ecc70765d5765e6dfd5", - "0x90cb776f8e5a108f1719df4a355bebb04bf023349356382cae55991b31720f0fd03206b895fa10c56c98f52453be8778", - "0xa7614e8d0769dccd520ea4b46f7646e12489951efaef5176bc889e9eb65f6e31758df136b5bf1e9107e68472fa9b46ec", - "0xac3a9b80a3254c42e5ed3a090a0dd7aee2352f480de96ad187027a3bb6c791eddfc3074b6ffd74eea825188f107cda4d", - "0x82a01d0168238ef04180d4b6e0a0e39024c02c2d75b065017c2928039e154d093e1af4503f4d1f3d8a948917abb5d09f", - "0x8fab000a2b0eef851a483aec8d2dd85fe60504794411a2f73ed82e116960547ac58766cb73df71aea71079302630258d", - "0x872451a35c6db61c63e9b8bb9f16b217f985c20be4451c14282c814adb29d7fb13f201367c664435c7f1d4d9375d7a58", - "0x887d9ff54cc96b35d562df4a537ff972d7c4b3fd91ab06354969a4cfede0b9fc68bbffb61d0dbf1a58948dc701e54f5a", - "0x8cb5c2a6bd956875d88f41ae24574434f1308514d44057b55c9c70f13a3366ed054150eed0955a38fda3f757be73d55f", - "0x89ad0163cad93e24129d63f8e38422b7674632a8d0a9016ee8636184cab177659a676c4ee7efba3abe1a68807c656d60", - "0xb9ec01c7cab6d00359b5a0b4a1573467d09476e05ca51a9227cd16b589a9943d161eef62dcc73f0de2ec504d81f4d252", - "0x8031d17635d39dfe9705c485d2c94830b6fc9bc67b91300d9d2591b51e36a782e77ab5904662effa9382d9cca201f525", - "0x8be5a5f6bc8d680e5092d6f9a6585acbaaaa2ddc671da560dcf5cfa4472f4f184b9597b5b539438accd40dda885687cc", - "0xb1fc0f052fae038a2e3de3b3a96b0a1024b009de8457b8b3adb2d315ae68a89af905720108a30038e5ab8d0d97087785", - "0x8b8bdc77bd3a6bc7ca5492b6f8c614852c39a70d6c8a74916eaca0aeb4533b11898b8820a4c2620a97bf35e275480029", - "0xaf35f4dc538d4ad5cdf710caa38fd1eb496c3fa890a047b6a659619c5ad3054158371d1e88e0894428282eed9f47f76b", - "0x8166454a7089cc07758ad78724654f4e7a1a13e305bbf88ddb86f1a4b2904c4fc8ab872d7da364cdd6a6c0365239e2ad", - "0xab287c7d3addce74ce40491871c768abe01daaa0833481276ff2e56926b38a7c6d2681ffe837d2cc323045ad1a4414f9", - "0xb90317f4505793094d89365beb35537f55a6b5618904236258dd04ca61f21476837624a2f45fef8168acf732cab65579", - "0x98ae5ea27448e236b6657ab5ef7b1cccb5372f92ab25f5fa651fbac97d08353a1dae1b280b1cd42b17d2c6a70a63ab9d", - "0xadcf54e752d32cbaa6cb98fbca48d8cd087b1db1d131d465705a0d8042c8393c8f4d26b59006eb50129b21e6240f0c06", - "0xb591a3e4db18a7345fa935a8dd7994bbac5cc270b8ebd84c8304c44484c7a74afb45471fdbe4ab22156a30fae1149b40", - "0x806b53ac049a42f1dcc1d6335505371da0bf27c614f441b03bbf2e356be7b2fb4eed7117eabcce9e427a542eaa2bf7d8", - "0x800482e7a772d49210b81c4a907f5ce97f270b959e745621ee293cf8c71e8989363d61f66a98f2d16914439544ca84c7", - "0x99de9eafdad3617445312341644f2bb888680ff01ce95ca9276b1d2e5ef83fa02dab5e948ebf66c17df0752f1bd37b70", - "0x961ee30810aa4c93ae157fbe9009b8e443c082192bd36a73a6764ff9b2ad8b0948fe9a73344556e01399dd77badb4257", - "0xae0a361067c52efbe56c8adf982c00432cd478929459fc7f74052c8ee9531cd031fe1335418fde53f7c2ef34254eb7ac", - "0xa3503d16b6b27eb20c1b177bcf90d13706169220523a6271b85b2ce35a9a2b9c5bed088540031c0a4ebfdae3a4c6ab04", - "0x909420122c3e723289ca4e7b81c2df5aff312972a2203f4c45821b176e7c862bf9cac7f7df3adf1d59278f02694d06e7", - "0x989f42380ae904b982f85d0c6186c1aef5d6bcba29bcfbb658e811b587eb2749c65c6e4a8cc6409c229a107499a4f5d7", - "0x8037a6337195c8e26a27ea4ef218c6e7d79a9720aaab43932d343192abc2320fe72955f5e431c109093bda074103330a", - "0xb312e168663842099b88445e940249cc508f080ab0c94331f672e7760258dbd86be5267e4cf25ea25facb80bff82a7e9", - "0xaaa3ff8639496864fcdbfdda1ac97edc4f08e3c9288b768f6c8073038c9fbbf7e1c4bea169b4d45c31935cdf0680d45e", - "0x97dbd3df37f0b481a311dfc5f40e59227720f367912200d71908ef6650f32cc985cb05b981e3eea38958f7e48d10a15d", - "0xa89d49d1e267bb452d6cb621b9a90826fe55e9b489c0427b94442d02a16f390eed758e209991687f73f6b5a032321f42", - "0x9530dea4e0e19d6496f536f2e75cf7d814d65fde567055eb20db48fd8d20d501cd2a22fb506db566b94c9ee10f413d43", - "0x81a7009b9e67f1965fa7da6a57591c307de91bf0cd35ab4348dc4a98a4961e096d004d7e7ad318000011dc4342c1b809", - "0x83440a9402b766045d7aca61a58bba2aa29cac1cf718199e472ba086f5d48093d9dda4d135292ba51d049a23964eceae", - "0xa06c9ce5e802df14f6b064a3d1a0735d429b452f0e2e276042800b0a4f16df988fd94cf3945921d5dd3802ab2636f867", - "0xb1359e358b89936dee9e678a187aad3e9ab14ac40e96a0a68f70ee2583cdcf467ae03bef4215e92893f4e12f902adec8", - "0x835304f8619188b4d14674d803103d5a3fa594d48e96d9699e653115dd05fdc2dda6ba3641cf7ad53994d448da155f02", - "0x8327cba5a9ff0d3f5cd0ae55e77167448926d5fcf76550c0ad978092a14122723090c51c415e88e42a2b62eb07cc3981", - "0xb373dcdaea85f85ce9978b1426a7ef4945f65f2d3467a9f1cc551a99766aac95df4a09e2251d3f89ca8c9d1a7cfd7b0e", - "0xab1422dc41af2a227b973a6fd124dfcb2367e2a11a21faa1d381d404f51b7257e5bc82e9cf20cd7fe37d7ae761a2ab37", - "0xa93774a03519d2f20fdf2ef46547b0a5b77c137d6a3434b48d56a2cbef9e77120d1b85d0092cf8842909213826699477", - "0x8eb967a495a38130ea28711580b7e61bcd1d051cd9e4f2dbf62f1380bd86e0d60e978d72f6f31e909eb97b3b9a2b867c", - "0xae8213378da1287ba1fe4242e1acaec19b877b6fe872400013c6eac1084b8d03156792fa3020201725b08228a1e80f49", - "0xb143daf6893d674d607772b3b02d8ac48f294237e2f2c87963c0d4e26d9227d94a2a13512457c3d5883544bbc259f0ef", - "0xb343bd2aca8973888e42542218924e2dda2e938fd1150d06878af76f777546213912b7c7a34a0f94186817d80ffa185c", - "0xb188ebc6a8c3007001aa347ae72cc0b15d09bc6c19a80e386ee4b334734ec0cc2fe8b493c2422f38d1e6d133cc3db6fe", - "0xb795f6a8b9b826aaeee18ccd6baf6c5adeeec85f95eb5b6d19450085ec7217e95a2d9e221d77f583b297d0872073ba0e", - "0xb1c7dbd998ad32ae57bfa95deafa147024afd57389e98992c36b6e52df915d3d5a39db585141ec2423173e85d212fed8", - "0x812bcdeb9fe5f12d0e1df9964798056e1f1c3de3b17b6bd2919b6356c4b86d8e763c01933efbe0224c86a96d5198a4be", - "0xb19ebeda61c23d255cbf472ef0b8a441f4c55b70f0d8ed47078c248b1d3c7c62e076b43b95c00a958ec8b16d5a7cb0d7", - "0xb02adc9aaa20e0368a989c2af14ff48b67233d28ebee44ff3418bb0473592e6b681af1cc45450bd4b175df9051df63d9", - "0x8d87f0714acee522eb58cec00360e762adc411901dba46adc9227124fa70ee679f9a47e91a6306d6030dd4eb8de2f3c1", - "0x8be54cec21e74bcc71de29dc621444263737db15f16d0bb13670f64e42f818154e04b484593d19ef95f2ee17e4b3fe21", - "0xab8e20546c1db38d31493b5d5f535758afb17e459645c1b70813b1cf7d242fd5d1f4354a7c929e8f7259f6a25302e351", - "0x89f035a1ed8a1e302ac893349ba8ddf967580fcb6e73d44af09e3929cde445e97ff60c87dafe489e2c0ab9c9986cfa00", - "0x8b2b0851a795c19191a692af55f7e72ad2474efdc5401bc3733cfdd910e34c918aaebe69d5ea951bdddf3c01cabbfc67", - "0xa4edb52c2b51495ccd1ee6450fc14b7b3ede8b3d106808929d02fb31475bacb403e112ba9c818d2857651e508b3a7dd1", - "0x9569341fded45d19f00bcf3cbf3f20eb2b4d82ef92aba3c8abd95866398438a2387437e580d8b646f17cf6fde8c5af23", - "0xaa4b671c6d20f72f2f18a939a6ff21cc37e0084b44b4a717f1be859a80b39fb1be026b3205adec2a66a608ec2bcd578f", - "0x94902e980de23c4de394ad8aec91b46f888d18f045753541492bfbb92c59d3daa8de37ae755a6853744af8472ba7b72b", - "0xaf651ef1b2a0d30a7884557edfad95b6b5d445a7561caebdc46a485aedd25932c62c0798465c340a76f6feaa196dd712", - "0xb7b669b8e5a763452128846dd46b530dca4893ace5cc5881c7ddcd3d45969d7e73fbebdb0e78aa81686e5f7b22ec5759", - "0x82507fd4ebe9fa656a7f2e084d64a1fa6777a2b0bc106d686e2d9d2edafc58997e58cb6bfd0453b2bf415704aa82ae62", - "0xb40bce2b42b88678400ecd52955bbdadd15f8b9e1b3751a1a3375dc0efb5ca3ee258cf201e1140b3c09ad41217d1d49e", - "0xb0210d0cbb3fbf3b8cdb39e862f036b0ff941cd838e7aaf3a8354e24246e64778d22f3de34572e6b2a580614fb6425be", - "0x876693cba4301b251523c7d034108831df3ce133d8be5a514e7a2ca494c268ca0556fa2ad8310a1d92a16b55bcd99ea9", - "0x8660281406d22a4950f5ef050bf71dd3090edb16eff27fa29ef600cdea628315e2054211ed2cc6eaf8f2a1771ef689fd", - "0xa610e7e41e41ab66955b809ba4ade0330b8e9057d8efc9144753caed81995edeb1a42a53f93ce93540feca1fae708dac", - "0xa49e2c176a350251daef1218efaccc07a1e06203386ede59c136699d25ca5cb2ac1b800c25b28dd05678f14e78e51891", - "0x83e0915aa2b09359604566080d411874af8c993beba97d4547782fdbe1a68e59324b800ff1f07b8db30c71adcbd102a8", - "0xa19e84e3541fb6498e9bb8a099c495cbfcad113330e0262a7e4c6544495bb8a754b2208d0c2d895c93463558013a5a32", - "0x87f2bd49859a364912023aca7b19a592c60214b8d6239e2be887ae80b69ebdeb59742bdebcfa73a586ab23b2c945586c", - "0xb8e8fdddae934a14b57bc274b8dcd0d45ebb95ddbaabef4454e0f6ce7d3a5a61c86181929546b3d60c447a15134d08e1", - "0x87e0c31dcb736ea4604727e92dc1d9a3cf00adcff79df3546e02108355260f3dd171531c3c0f57be78d8b28058fcc8c0", - "0x9617d74e8f808a4165a8ac2e30878c349e1c3d40972006f0787b31ea62d248c2d9f3fc3da83181c6e57e95feedfd0e8c", - "0x8949e2cee582a2f8db86e89785a6e46bc1565c2d8627d5b6bf43ba71ffadfab7e3c5710f88dcb5fb2fc6edf6f4fae216", - "0xad3fa7b0edceb83118972a2935a09f409d09a8db3869f30be3a76f67aa9fb379cabb3a3aff805ba023a331cad7d7eb64", - "0x8c95718a4112512c4efbd496be38bf3ca6cdcaad8a0d128f32a3f9aae57f3a57bdf295a3b372a8c549fda8f4707cffed", - "0x88f3261d1e28a58b2dee3fcc799777ad1c0eb68b3560f9b4410d134672d9533532a91ea7be28a041784872632d3c9d80", - "0xb47472a41d72dd2e8b72f5c4f8ad626737dde3717f63d6bc776639ab299e564cbad0a2ad5452a07f02ff49a359c437e5", - "0x9896d21dc2e8aad87b76d6df1654f10cd7bceed4884159d50a818bea391f8e473e01e14684814c7780235f28e69dca6e", - "0x82d47c332bbd31bbe83b5eb44a23da76d4a7a06c45d7f80f395035822bc27f62f59281d5174e6f8e77cc9b5c3193d6f0", - "0x95c74cd46206e7f70c9766117c34c0ec45c2b0f927a15ea167901a160e1530d8522943c29b61e03568aa0f9c55926c53", - "0xa89d7757825ae73a6e81829ff788ea7b3d7409857b378ebccd7df73fdbe62c8d9073741cf038314971b39af6c29c9030", - "0x8c1cd212d0b010905d560688cfc036ae6535bc334fa8b812519d810b7e7dcf1bb7c5f43deaa40f097158358987324a7f", - "0xb86993c383c015ed8d847c6b795164114dd3e9efd25143f509da318bfba89389ea72a420699e339423afd68b6512fafb", - "0x8d06bd379c6d87c6ed841d8c6e9d2d0de21653a073725ff74be1934301cc3a79b81ef6dd0aad4e7a9dc6eac9b73019bc", - "0x81af4d2d87219985b9b1202d724fe39ef988f14fef07dfe3c3b11714e90ffba2a97250838e8535eb63f107abfe645e96", - "0x8c5e0af6330a8becb787e4b502f34f528ef5756e298a77dc0c7467433454347f3a2e0bd2641fbc2a45b95e231c6e1c02", - "0x8e2a8f0f04562820dc8e7da681d5cad9fe2e85dd11c785fb6fba6786c57a857e0b3bd838fb849b0376c34ce1665e4837", - "0xa39be8269449bfdfc61b1f62077033649f18dae9bef7c6163b9314ca8923691fb832f42776f0160b9e8abd4d143aa4e1", - "0x8c154e665706355e1cc98e0a4cabf294ab019545ba9c4c399d666e6ec5c869ca9e1faf8fb06cd9c0a5c2f51a7d51b70a", - "0xa046a7d4de879d3ebd4284f08f24398e9e3bf006cd4e25b5c67273ade248689c69affff92ae810c07941e4904296a563", - "0xafd94c1cb48758e5917804df03fb38a6da0e48cd9b6262413ea13b26973f9e266690a1b7d9d24bbaf7e82718e0e594b0", - "0x859e21080310c8d6a38e12e2ac9f90a156578cdeb4bb2e324700e97d9a5511cd6045dc39d1d0de3f94aeed043a24119d", - "0xa219fb0303c379d0ab50893264919f598e753aac9065e1f23ef2949abc992577ab43c636a1d2c089203ec9ddb941e27d", - "0xb0fdb639d449588a2ca730afcba59334e7c387342d56defdfb7ef79c493f7fd0e5277eff18e7203e756c7bdda5803047", - "0x87f9c3b7ed01f54368aca6dbcf2f6e06bff96e183c4b2c65f8baa23b377988863a0a125d5cdd41a072da8462ced4c070", - "0x99ef7a5d5ac2f1c567160e1f8c95f2f38d41881850f30c461a205f7b1b9fb181277311333839b13fb3ae203447e17727", - "0xaeaca9b1c2afd24e443326cc68de67b4d9cedb22ad7b501a799d30d39c85bb2ea910d4672673e39e154d699e12d9b3dc", - "0xa11675a1721a4ba24dd3d0e4c3c33a6edf4cd1b9f6b471070b4386c61f77452266eae6e3f566a40cfc885eada9a29f23", - "0xb228334445e37b9b49cb4f2cc56b454575e92173ddb01370a553bba665adadd52df353ad74470d512561c2c3473c7bb9", - "0xa18177087c996572d76f81178d18ed1ceebc8362a396348ce289f1d8bd708b9e99539be6fccd4acb1112381cfc5749b4", - "0x8e7b8bf460f0d3c99abb19803b9e43422e91507a1c0c22b29ee8b2c52d1a384da4b87c292e28eff040db5be7b1f8641f", - "0xb03d038d813e29688b6e6f444eb56fec3abba64c3d6f890a6bcf2e916507091cdb2b9d2c7484617be6b26552ed1c56cb", - "0xa1c88ccd30e934adfc5494b72655f8afe1865a84196abfb376968f22ddc07761210b6a9fb7638f1413d1b4073d430290", - "0x961b714faebf172ad2dbc11902461e286e4f24a99a939152a53406117767682a571057044decbeb3d3feef81f4488497", - "0xa03dc4059b46effdd786a0a03cc17cfee8585683faa35bb07936ded3fa3f3a097f518c0b8e2db92fd700149db1937789", - "0xadf60180c99ca574191cbcc23e8d025b2f931f98ca7dfcebfc380226239b6329347100fcb8b0fcb12db108c6ad101c07", - "0x805d4f5ef24d46911cbf942f62cb84b0346e5e712284f82b0db223db26d51aabf43204755eb19519b00e665c7719fcaa", - "0x8dea7243e9c139662a7fe3526c6c601eee72fd8847c54c8e1f2ad93ef7f9e1826b170afe58817dac212427164a88e87f", - "0xa2ba42356606d651b077983de1ad643650997bb2babb188c9a3b27245bb65d2036e46667c37d4ce02cb1be5ae8547abe", - "0xaf2ae50b392bdc013db2d12ce2544883472d72424fc767d3f5cb0ca2d973fc7d1f425880101e61970e1a988d0670c81b", - "0x98e6bec0568d3939b31d00eb1040e9b8b2a35db46ddf4369bdaee41bbb63cc84423d29ee510a170fb5b0e2df434ba589", - "0x822ff3cd12fbef4f508f3ca813c04a2e0b9b799c99848e5ad3563265979e753ee61a48f6adc2984a850f1b46c1a43d35", - "0x891e8b8b92a394f36653d55725ef514bd2e2a46840a0a2975c76c2a935577f85289026aaa74384da0afe26775cbddfb9", - "0xb2a3131a5d2fe7c8967047aa66e4524babae941d90552171cc109527f345f42aa0df06dcbb2fa01b33d0043917bbed69", - "0x80c869469900431f3eeefafdbe07b8afd8cee7739e659e6d0109b397cacff85a88247698f87dc4e2fe39a592f250ac64", - "0x9091594f488b38f9d2bb5df49fd8b4f8829d9c2f11a197dd1431ed5abbc5c954bbde3387088f9ee3a5a834beb7619bce", - "0xb472e241e6956146cca57b97a8a204668d050423b4e76f857bad5b47f43b203a04c8391ba9d9c3e95093c071f9d376a1", - "0xb7dd2de0284844392f7dfb56fe7ca3ede41e27519753ffc579a0a8d2d65ceb8108d06b6b0d4c3c1a2588951297bd1a1e", - "0x902116ce70d0a079ac190321c1f48701318c05f8e69ee09694754885d33a835a849cafe56f499a2f49f6cda413ddf9a7", - "0xb18105cc736787fafaf7c3c11c448bce9466e683159dff52723b7951dff429565e466e4841d982e3aaa9ee2066838666", - "0x97ab9911f3f659691762d568ae0b7faa1047b0aed1009c319fa79d15d0db8db9f808fc385dc9a68fa388c10224985379", - "0xb2a2cba65f5b927e64d2904ba412e2bac1cf18c9c3eda9c72fb70262497ecf505b640827e2afebecf10eebbcf48ccd3e", - "0xb36a3fd677baa0d3ef0dac4f1548ff50a1730286b8c99d276a0a45d576e17b39b3cbadd2fe55e003796d370d4be43ce3", - "0xa5dfec96ca3c272566e89dc453a458909247e3895d3e44831528130bc47cc9d0a0dac78dd3cad680a4351d399d241967", - "0x8029382113909af6340959c3e61db27392531d62d90f92370a432aec3eb1e4c36ae1d4ef2ba8ec6edb4d7320c7a453f6", - "0x971d85121ea108e6769d54f9c51299b0381ece8b51d46d49c89f65bedc123bab4d5a8bc14d6f67f4f680077529cbae4c", - "0x98ff6afc01d0bec80a278f25912e1b1ebff80117adae72e31d5b9fa4d9624db4ba2065b444df49b489b0607c45e26c4c", - "0x8fa29be10fb3ab30ce25920fec0187e6e91e458947009dabb869aade7136c8ba23602682b71e390c251f3743164cbdaa", - "0xb3345c89eb1653418fe3940cf3e56a9a9c66526389b98f45ca02dd62bfb37baa69a4baaa7132d7320695f8ea6ad1fd94", - "0xb72c7f5541c9ac6b60a7ec9f5415e7fb14da03f7164ea529952a29399f3a071576608dbbcc0d45994f21f92ddbeb1e19", - "0xaa3450bb155a5f9043d0ef95f546a2e6ade167280bfb75c9f09c6f9cdb1fffb7ce8181436161a538433afa3681c7a141", - "0x92a18fecaded7854b349f441e7102b638ababa75b1b0281dd0bded6541abe7aa37d96693595be0b01fe0a2e2133d50f9", - "0x980756ddf9d2253cfe6c94960b516c94889d09e612810935150892627d2ecee9a2517e04968eea295d0106850c04ca44", - "0xae68c6ccc454318cdd92f32b11d89116a3b8350207a36d22a0f626718cad671d960090e054c0c77ac3162ae180ecfd4b", - "0x99f31f66eaaa551749ad91d48a0d4e3ff4d82ef0e8b28f3184c54e852422ba1bdafd53b1e753f3a070f3b55f3c23b6a2", - "0xa44eaeaa6589206069e9c0a45ff9fc51c68da38d4edff1d15529b7932e6f403d12b9387019c44a1488a5d5f27782a51f", - "0xb80b5d54d4b344840e45b79e621bd77a3f83fb4ce6d8796b7d6915107b3f3c34d2e7d95bdafd120f285669e5acf2437a", - "0xb36c069ec085a612b5908314d6b84c00a83031780261d1c77a0384c406867c9847d5b0845deddfa512cc04a8df2046fb", - "0xb09dbe501583220f640d201acea7ee3e39bf9eda8b91aa07b5c50b7641d86d71acb619b38d27835ce97c3759787f08e9", - "0x87403d46a2bf63170fff0b857acacf42ee801afe9ccba8e5b4aea967b68eac73a499a65ca46906c2eb4c8f27bc739faa", - "0x82b93669f42a0a2aa5e250ffe6097269da06a9c02fcd1801abbad415a7729a64f830754bafc702e64600ba47671c2208", - "0x8e3a3029be7edb8dd3ab1f8216664c8dc50d395f603736061d802cef77627db7b859ef287ed850382c13b4d22d6a2d80", - "0x968e9ec7194ff424409d182ce0259acd950c384c163c04463bc8700a40b79beba6146d22b7fa7016875a249b7b31c602", - "0x8b42c984bbe4996e0c20862059167c6bdc5164b1ffcd928f29512664459212d263e89f0f0e30eed4e672ffa5ed0b01b5", - "0x96bac54062110dada905363211133f1f15dc7e4fd80a4c6e4a83bc9a0bcbbaba11cd2c7a13debcf0985e1a954c1da66b", - "0xa16dc8a653d67a7cd7ae90b2fffac0bf1ca587005430fe5ba9403edd70ca33e38ba5661d2ed6e9d2864400d997626a62", - "0xa68ab11a570a27853c8d67e491591dcba746bfbee08a2e75ae0790399130d027ed387f41ef1d7de8df38b472df309161", - "0x92532b74886874447c0300d07eda9bbe4b41ed25349a3da2e072a93fe32c89d280f740d8ff70d5816793d7f2b97373cc", - "0x88e35711b471e89218fd5f4d0eadea8a29405af1cd81974427bc4a5fb26ed60798daaf94f726c96e779b403a2cd82820", - "0xb5c72aa4147c19f8c4f3a0a62d32315b0f4606e0a7025edc5445571eaf4daff64f4b7a585464821574dd50dbe1b49d08", - "0x9305d9b4095258e79744338683fd93f9e657367b3ab32d78080e51d54eec331edbc224fad5093ebf8ee4bd4286757eb8", - "0xb2a17abb3f6a05bcb14dc7b98321fa8b46d299626c73d7c6eb12140bf4c3f8e1795250870947af817834f033c88a59d6", - "0xb3477004837dbd8ba594e4296f960fc91ab3f13551458445e6c232eb04b326da803c4d93e2e8dcd268b4413305ff84da", - "0x924b4b2ebaafdcfdfedb2829a8bf46cd32e1407d8d725a5bd28bdc821f1bafb3614f030ea4352c671076a63494275a3f", - "0x8b81b9ef6125c82a9bece6fdcb9888a767ac16e70527753428cc87c56a1236e437da8be4f7ecfe57b9296dc3ae7ba807", - "0x906e19ec8b8edd58bdf9ae05610a86e4ea2282b1bbc1e8b00b7021d093194e0837d74cf27ac9916bdb8ec308b00da3da", - "0xb41c5185869071760ac786078a57a2ab4e2af60a890037ac0c0c28d6826f15c2cf028fddd42a9b6de632c3d550bfbc14", - "0xa646e5dec1b713ae9dfdf7bdc6cd474d5731a320403c7dfcfd666ffc9ae0cff4b5a79530e8df3f4aa9cb80568cb138e9", - "0xb0efad22827e562bd3c3e925acbd0d9425d19057868608d78c2209a531cccd0f2c43dc5673acf9822247428ffa2bb821", - "0xa94c19468d14b6f99002fc52ac06bbe59e5c472e4a0cdb225144a62f8870b3f10593749df7a2de0bd3c9476ce682e148", - "0x803864a91162f0273d49271dafaab632d93d494d1af935aefa522768af058fce52165018512e8d6774976d52bd797e22", - "0xa08711c2f7d45c68fb340ac23597332e1bcaec9198f72967b9921204b9d48a7843561ff318f87908c05a44fc35e3cc9d", - "0x91c3cad94a11a3197ae4f9461faab91a669e0dddb0371d3cab3ed9aeb1267badc797d8375181130e461eadd05099b2a2", - "0x81bdaaf48aae4f7b480fc13f1e7f4dd3023a41439ba231760409ce9292c11128ab2b0bdbbf28b98af4f97b3551f363af", - "0x8d60f9df9fd303f625af90e8272c4ecb95bb94e6efc5da17b8ab663ee3b3f673e9f6420d890ccc94acf4d2cae7a860d8", - "0xa7b75901520c06e9495ab983f70b61483504c7ff2a0980c51115d11e0744683ce022d76e3e09f4e99e698cbd21432a0d", - "0x82956072df0586562fda7e7738226f694e1c73518dd86e0799d2e820d7f79233667192c9236dcb27637e4c65ef19d493", - "0xa586beb9b6ffd06ad200957490803a7cd8c9bf76e782734e0f55e04a3dc38949de75dc607822ec405736c576cf83bca3", - "0xa179a30d00def9b34a7e85607a447eea0401e32ab5abeee1a281f2acd1cf6ec81a178020666f641d9492b1bdf66f05a3", - "0x83e129705c538787ed8e0fdc1275e6466a3f4ee21a1e6abedd239393b1df72244723b92f9d9d9339a0cab6ebf28f5a16", - "0x811bd8d1e3722b64cd2f5b431167e7f91456e8bba2cc669d3fbbce7d553e29c3c19f629fcedd2498bc26d33a24891d17", - "0xa243c030c858f1f60cccd26b45b024698cc6d9d9e6198c1ed4964a235d9f8d0baf9cde10c8e63dfaa47f8e74e51a6e85", - "0xab839eb82e23ca52663281f863b55b0a3d6d4425c33ffb4eeb1d7979488ab068bf99e2a60e82cea4dc42c56c26cbfebe", - "0x8b896f9bb21d49343e67aec6ad175b58c0c81a3ca73d44d113ae4354a0065d98eb1a5cafedaf232a2bb9cdc62152f309", - "0xaf6230340cc0b66f5bf845540ed4fc3e7d6077f361d60762e488d57834c3e7eb7eacc1b0ed73a7d134f174a01410e50c", - "0x88975e1b1af678d1b5179f72300a30900736af580dd748fd9461ef7afccc91ccd9bed33f9da55c8711a7635b800e831f", - "0xa97486bb9047391661718a54b8dd5a5e363964e495eae6c692730264478c927cf3e66dd3602413189a3699fbeae26e15", - "0xa5973c161ab38732885d1d2785fd74bf156ba34881980cba27fe239caef06b24a533ffe6dbbbeca5e6566682cc00300a", - "0xa24776e9a840afda0003fa73b415d5bd6ecd9b5c2cc842b643ee51b8c6087f4eead4d0bfbd987eb174c489a7b952ff2a", - "0xa8a6ee06e3af053b705a12b59777267c546f33ba8a0f49493af8e6df4e15cf8dd2d4fb4daf7e84c6b5d3a7363118ff03", - "0xa28e59ce6ad02c2ce725067c0123117e12ac5a52c8f5af13eec75f4a9efc4f696777db18a374fa33bcae82e0734ebd16", - "0x86dfc3b78e841c708aff677baa8ee654c808e5d257158715097c1025d46ece94993efe12c9d188252ad98a1e0e331fec", - "0xa88d0275510f242eab11fdb0410ff6e1b9d7a3cbd3658333539815f1b450a84816e6613d15aa8a8eb15d87cdad4b27a2", - "0x8440acea2931118a5b481268ff9f180ee4ede85d14a52c026adc882410825b8275caa44aff0b50c2b88d39f21b1a0696", - "0xa7c3182eab25bd6785bacf12079d0afb0a9b165d6ed327814e2177148539f249eb9b5b2554538f54f3c882d37c0a8abe", - "0x85291fbe10538d7da38efdd55a7acebf03b1848428a2f664c3ce55367aece60039f4f320b1771c9c89a35941797f717c", - "0xa2c6414eeb1234728ab0de94aa98fc06433a58efa646ca3fcbd97dbfb8d98ae59f7ce6d528f669c8149e1e13266f69c9", - "0x840c8462785591ee93aee2538d9f1ec44ba2ca61a569ab51d335ac873f5d48099ae8d7a7efa0725d9ff8f9475bfa4f56", - "0xa7065a9d02fb3673acf7702a488fbc01aa69580964932f6f40b6c2d1c386b19e50b0e104fcac24ea26c4e723611d0238", - "0xb72db6d141267438279e032c95e6106c2ccb3164b842ba857a2018f3a35f4b040da92680881eb17cd61d0920d5b8f006", - "0xa8005d6c5960e090374747307ef0be2871a7a43fa4e76a16c35d2baab808e9777b496e9f57a4218b23390887c33a0b55", - "0x8e152cea1e00a451ca47c20a1e8875873419700af15a5f38ee2268d3fbc974d4bd5f4be38008fa6f404dbdedd6e6e710", - "0xa3391aed1fcd68761f06a7d1008ec62a09b1cb3d0203cd04e300a0c91adfed1812d8bc1e4a3fd7976dc0aae0e99f52f1", - "0x967eb57bf2aa503ee0c6e67438098149eac305089c155f1762cf5e84e31f0fbf27c34a9af05621e34645c1ec96afaec8", - "0x88af97ddc4937a95ec0dcd25e4173127260f91c8db2f6eac84afb789b363705fb3196235af631c70cafd09411d233589", - "0xa32df75b3f2c921b8767638fd289bcfc61e08597170186637a7128ffedd52c798c434485ac2c7de07014f9e895c2c3d8", - "0xb0a783832153650aa0d766a3a73ec208b6ce5caeb40b87177ffc035ab03c7705ecdd1090b6456a29f5fb7e90e2fa8930", - "0xb59c8e803b4c3486777d15fc2311b97f9ded1602fa570c7b0200bada36a49ee9ef4d4c1474265af8e1c38a93eb66b18b", - "0x982f2c85f83e852022998ff91bafbb6ff093ef22cf9d5063e083a48b29175ccbd51b9c6557151409e439096300981a6c", - "0x939e3b5989fefebb9d272a954659a4eb125b98c9da6953f5e628d26266bd0525ec38304b8d56f08d65abc4d6da4a8dbb", - "0x8898212fe05bc8de7d18503cb84a1c1337cc2c09d1eeef2b475aa79185b7322bf1f8e065f1bf871c0c927dd19faf1f6d", - "0x94b0393a41cd00f724aee2d4bc72103d626a5aecb4b5486dd1ef8ac27528398edf56df9db5c3d238d8579af368afeb09", - "0x96ac564450d998e7445dd2ea8e3fc7974d575508fa19e1c60c308d83b645864c029f2f6b7396d4ff4c1b24e92e3bac37", - "0x8adf6638e18aff3eb3b47617da696eb6c4bdfbecbbc3c45d3d0ab0b12cbad00e462fdfbe0c35780d21aa973fc150285e", - "0xb53f94612f818571b5565bbb295e74bada9b5f9794b3b91125915e44d6ddcc4da25510eab718e251a09c99534d6042d9", - "0x8b96462508d77ee083c376cd90807aebad8de96bca43983c84a4a6f196d5faf6619a2351f43bfeec101864c3bf255519", - "0xaeadf34657083fc71df33bd44af73bf5281c9ca6d906b9c745536e1819ea90b56107c55e2178ebad08f3ba75b3f81c86", - "0x9784ba29b2f0057b5af1d3ab2796d439b8753f1f749c73e791037461bdfc3f7097394283105b8ab01788ea5255a96710", - "0x8756241bda159d4a33bf74faba0d4594d963c370fb6a18431f279b4a865b070b0547a6d1613cf45b8cfb5f9236bbf831", - "0xb03ebfd6b71421dfd49a30460f9f57063eebfe31b9ceaa2a05c37c61522b35bdc09d7db3ad75c76c253c00ba282d3cd2", - "0xb34e7e6341fa9d854b2d3153bdda0c4ae2b2f442ab7af6f99a0975d45725aa48e36ae5f7011edd249862e91f499687d4", - "0xb462ee09dc3963a14354244313e3444de5cc37ea5ccfbf14cd9aca8027b59c4cb2a949bc30474497cab8123e768460e6", - "0xaea753290e51e2f6a21a9a0ee67d3a2713f95c2a5c17fe41116c87d3aa77b1683761264d704df1ac34f8b873bc88ef7b", - "0x98430592afd414394f98ddfff9f280fcb1c322dbe3510f45e1e9c4bb8ee306b3e0cf0282c0ee73ebb8ba087d4d9e0858", - "0xb95d3b5aaf54ffca11f4be8d57f76e14afdb20afc859dc7c7471e0b42031e8f3d461b726ecb979bdb2f353498dfe95ea", - "0x984d17f9b11a683132e0b5a9ee5945e3ff7054c2d5c716be73b29078db1d36f54c6e652fd2f52a19da313112e97ade07", - "0xab232f756b3fff3262be418a1af61a7e0c95ceebbc775389622a8e10610508cd6784ab7960441917a83cc191c58829ea", - "0xa28f41678d6e60de76b0e36ab10e4516e53e02e9c77d2b5af3cfeee3ce94cfa30c5797bd1daab20c98e1cad83ad0f633", - "0xb55395fca84dd3ccc05dd480cb9b430bf8631ff06e24cb51d54519703d667268c2f8afcde4ba4ed16bece8cc7bc8c6e0", - "0x8a8a5392a0e2ea3c7a8c51328fab11156004e84a9c63483b64e8f8ebf18a58b6ffa8fe8b9d95af0a2f655f601d096396", - "0xab480000fe194d23f08a7a9ec1c392334e9c687e06851f083845121ce502c06b54dda8c43092bcc1035df45cc752fe9b", - "0xb265644c29f628d1c7e8e25a5e845cabb21799371814730a41a363e1bda8a7be50fee7c3996a365b7fcba4642add10db", - "0xb8a915a3c685c2d4728f6931c4d29487cad764c5ce23c25e64b1a3259ac27235e41b23bfe7ae982921b4cb84463097df", - "0x8efa7338442a4b6318145a5440fc213b97869647eeae41b9aa3c0a27ee51285b73e3ae3b4a9423df255e6add58864aa9", - "0x9106d65444f74d217f4187dfc8fcf3810b916d1e4275f94f6a86d1c4f3565b131fd6cde1fa708bc05fe183c49f14941a", - "0x948252dac8026bbbdb0a06b3c9d66ec4cf9532163bab68076fda1bd2357b69e4b514729c15aaa83b5618b1977bbc60c4", - "0xae6596ccfdf5cbbc5782efe3bb0b101bb132dbe1d568854ca24cacc0b2e0e9fabcb2ca7ab42aecec412efd15cf8cb7a2", - "0x84a0b6c198ff64fd7958dfd1b40eac9638e8e0b2c4cd8cf5d8cdf80419baee76a05184bce6c5b635f6bf2d30055476a7", - "0x8893118be4a055c2b3da593dbca51b1ae2ea2469911acfb27ee42faf3e6c3ad0693d3914c508c0b05b36a88c8b312b76", - "0xb097479e967504deb6734785db7e60d1d8034d6ca5ba9552887e937f5e17bb413fccac2c1d1082154ed76609127860ad", - "0xa0294e6b9958f244d29943debf24b00b538b3da1116269b6e452bb12dc742226712fd1a15b9c88195afeb5d2415f505c", - "0xb3cc15f635080bc038f61b615f62b5b5c6f2870586191f59476e8368a73641d6ac2f7d0c1f54621982defdb318020230", - "0x99856f49b9fe1604d917c94d09cc0ed753d13d015d30587a94e6631ffd964b214e607deb8a69a8b5e349a7edf4309206", - "0xa8571e113ea22b4b4fce41a094da8c70de37830ae32e62c65c2fa5ad06a9bc29e884b945e73d448c72b176d6ecebfb58", - "0xa9e9c6e52beb0013273c29844956b3ce291023678107cdc785f7b44eff5003462841ad8780761b86aefc6b734adde7cf", - "0x80a784b0b27edb51ef2bad3aee80e51778dcaa0f3f5d3dcb5dc5d4f4b2cf7ae35b08de6680ea9dac53f8438b92eb09ef", - "0x827b543e609ea328e97e373f70ad72d4915a2d1daae0c60d44ac637231070e164c43a2a58db80a64df1c624a042b38f9", - "0xb449c65e8195202efdcb9bdb4e869a437313b118fef8b510cbbf8b79a4e99376adb749b37e9c20b51b31ed3310169e27", - "0x8ea3028f4548a79a94c717e1ed28ad4d8725b8d6ab18b021063ce46f665c79da3c49440c6577319dab2d036b7e08f387", - "0x897798431cfb17fe39f08f5f854005dc37b1c1ec1edba6c24bc8acb3b88838d0534a75475325a5ea98b326ad47dbad75", - "0x89cf232e6303b0751561960fd4dea5754a28c594daf930326b4541274ffb03c7dd75938e411eb9a375006a70ce38097f", - "0x9727c6ae7f0840f0b6c8bfb3a1a5582ceee705e0b5c59b97def7a7a2283edd4d3f47b7971e902a3a2079e40b53ff69b8", - "0xb76ed72b122c48679d221072efc0eeea063cb205cbf5f9ef0101fd10cb1075b8628166c83577cced654e1c001c7882f7", - "0xae908c42d208759da5ee9b405df85a6532ea35c6f0f6a1288d22870f59d98edc896841b8ac890a538e6c8d1e8b02d359", - "0x809d12fe4039a0ec80dc9be6a89acaab7797e5f7f9b163378f52f9a75a1d73b2e9ae6e3dd49e32ced439783c1cabbef5", - "0xa4149530b7f85d1098ba534d69548c6c612c416e8d35992fc1f64f4deeb41e09e49c6cf7aadbed7e846b91299358fe2d", - "0xa49342eacd1ec1148b8df1e253b1c015f603c39de11fa0a364ccb86ea32d69c34fd7aa6980a1fadcd8e785a57fa46f60", - "0x87d43eff5a006dc4dddcf76cc96c656a1f3a68f19f124181feab86c6cc9a52cb9189cdbb423414defdd9bb0ca8ff1ddc", - "0x861367e87a9aa2f0f68296ba50aa5dbc5713008d260cc2c7e62d407c2063064749324c4e8156dc21b749656cfebce26b", - "0xb5303c2f72e84e170e66ae1b0fbd51b8c7a6f27476eaf5694b64e8737d5c84b51fe90100b256465a4c4156dd873cddb0", - "0xb62849a4f891415d74f434cdc1d23c4a69074487659ca96e1762466b2b7a5d8525b056b891d0feea6fe6845cba8bc7fb", - "0x923dd9e0d6590a9307e8c4c23f13bae3306b580e297a937711a8b13e8de85e41a61462f25b7d352b682e8437bf2b4ab3", - "0x9147379860cd713cd46c94b8cdf75125d36c37517fbecf81ace9680b98ce6291cd1c3e472f84249cc3b2b445e314b1b6", - "0xa808a4f17ac21e3fb5cfef404e61fae3693ca3e688d375f99b6116779696059a146c27b06de3ac36da349b0649befd56", - "0x87787e9322e1b75e66c1f0d9ea0915722a232770930c2d2a95e9478c4b950d15ab767e30cea128f9ed65893bfc2d0743", - "0x9036a6ee2577223be105defe1081c48ea7319e112fff9110eb9f61110c319da25a6cea0464ce65e858635b079691ef1f", - "0xaf5548c7c24e1088c23b57ee14d26c12a83484c9fd9296edf1012d8dcf88243f20039b43c8c548c265ef9a1ffe9c1c88", - "0xa0fff520045e14065965fb8accd17e878d3fcaf9e0af2962c8954e50be6683d31fa0bf4816ab68f08630dbac6bfce52a", - "0xb4c1b249e079f6ae1781af1d97a60b15855f49864c50496c09c91fe1946266915b799f0406084d7783f5b1039116dd8b", - "0x8b0ffa5e7c498cb3879dddca34743b41eee8e2dea3d4317a6e961b58adb699ef0c92400c068d5228881a2b08121226bf", - "0x852ae8b19a1d80aa8ae5382e7ee5c8e7670ceb16640871c56b20b96b66b3b60e00015a3dde039446972e57b49a999ddd", - "0xa49942f04234a7d8492169da232cfff8051df86e8e1ba3db46aede02422c689c87dc1d99699c25f96cb763f5ca0983e5", - "0xb04b597b7760cf5dcf411ef896d1661e6d5b0db3257ac2cf64b20b60c6cc18fa10523bb958a48d010b55bac7b02ab3b1", - "0xa494591b51ea8285daecc194b5e5bd45ae35767d0246ac94fae204d674ee180c8e97ff15f71f28b7aeb175b8aea59710", - "0x97d2624919e78406e7460730680dea8e71c8571cf988e11441aeea54512b95bd820e78562c99372d535d96f7e200d20d", - "0xac693ddb00e48f76e667243b9b6a7008424043fb779e4f2252330285232c3fccac4da25cbd6d95fe9ad959ff305a91f6", - "0x8d20ca0a71a64a3f702a0825bb46bd810d03bebfb227683680d474a52f965716ff99e19a165ebaf6567987f4f9ee3c94", - "0xa5c516a438f916d1d68ca76996404792e0a66e97b7f18fc54c917bf10cf3211b62387932756e39e67e47b0bd6e88385a", - "0xb089614d830abc0afa435034cec7f851f2f095d479cacf1a3fb57272da826c499a52e7dcbc0eb85f4166fb94778e18e9", - "0xa8dacc943765d930848288192f4c69e2461c4b9bc6e79e30eeef9a543318cf9ae9569d6986c65c5668a89d49993f8e07", - "0xab5a9361fa339eec8c621bdad0a58078983abd8942d4282b22835d7a3a47e132d42414b7c359694986f7db39386c2e19", - "0x94230517fb57bd8eb26c6f64129b8b2abd0282323bf7b94b8bac7fab27b4ecc2c4290c294275e1a759de19f2216134f3", - "0xb8f158ea5006bc3b90b285246625faaa6ac9b5f5030dc69701b12f3b79a53ec7e92eeb5a63bbd1f9509a0a3469ff3ffc", - "0x8b6944fd8cb8540957a91a142fdcda827762aa777a31e8810ca6d026e50370ee1636fc351724767e817ca38804ebe005", - "0x82d1ee40fe1569c29644f79fa6c4033b7ed45cd2c3b343881f6eb0de2e79548fded4787fae19bed6ee76ed76ff9f2f11", - "0xa8924c7035e99eaed244ca165607e7e568b6c8085510dcdbaf6ebdbed405af2e6c14ee27d94ffef10d30aa52a60bf66d", - "0x956f82a6c2ae044635e85812581e4866c5fa2f427b01942047d81f6d79a14192f66fbbe77c9ffeaef4e6147097fdd2b5", - "0xb1100255a1bcf5e05b6aff1dfeb6e1d55b5d68d43a7457ba10cc76b61885f67f4d0d5179abda786e037ae95deb8eea45", - "0x99510799025e3e5e8fbf06dedb14c060c6548ba2bda824f687d3999dc395e794b1fb6514b9013f3892b6cf65cb0d65aa", - "0x8f9091cebf5e9c809aab415942172258f894e66e625d7388a05289183f01b8d994d52e05a8e69f784fba41db9ea357f0", - "0xa13d2eeb0776bdee9820ecb6693536720232848c51936bb4ef4fe65588d3f920d08a21907e1fdb881c1ad70b3725e726", - "0xa68b8f18922d550284c5e5dc2dda771f24c21965a6a4d5e7a71678178f46df4d8a421497aad8fcb4c7e241aba26378a0", - "0x8b7601f0a3c6ad27f03f2d23e785c81c1460d60100f91ea9d1cab978aa03b523150206c6d52ce7c7769c71d2c8228e9e", - "0xa8e02926430813caa851bb2b46de7f0420f0a64eb5f6b805401c11c9091d3b6d67d841b5674fa2b1dce0867714124cd8", - "0xb7968ecba568b8193b3058400af02c183f0a6df995a744450b3f7e0af7a772454677c3857f99c140bbdb2a09e832e8e0", - "0x8f20b1e9ba87d0a3f35309b985f3c18d2e8800f1ca7f0c52cadef773f1496b6070c936eea48c4a1cae83fd2524e9d233", - "0x88aef260042db0d641a51f40639dbeeefa9e9811df30bee695f3791f88a2f84d318f04e8926b7f47bf25956cb9e3754f", - "0x9725345893b647e9ba4e6a29e12f96751f1ae25fcaec2173e9a259921a1a7edb7a47159b3c8767e44d9e2689f5aa0f72", - "0x8c281e6f72752cb11e239e4df9341c45106eb7993c160e54423c2bffe10bc39d42624b45a1f673936ef2e1a02fc92f1a", - "0x90aba2f68bddb2fcce6c51430dacdfeec43ea8dc379660c99095df11017691ccf5faa27665cf4b9f0eea7728ae53c327", - "0xb7022695c16521c5704f49b7ddbdbec9b5f57ce0ceebe537bc0ebb0906d8196cc855a9afeb8950a1710f6a654464d93f", - "0x8fe1b9dd3c6a258116415d36e08374e094b22f0afb104385a5da48be17123e86fb8327baacc4f0d9ebae923d55d99bb5", - "0x817e85d8e3d19a4cbc1dec31597142c2daa4871bda89c2177fa719c00eda3344eb08b82eb92d4aa91a9eaacb3fc09783", - "0xb59053e1081d2603f1ca0ba553804d6fa696e1fd996631db8f62087b26a40dfef02098b0326bb75f99ec83b9267ca738", - "0x990a173d857d3ba81ff3789b931bfc9f5609cde0169b7f055fa3cb56451748d593d62d46ba33f80f9cafffe02b68dd14", - "0xb0c538dbba4954b809ab26f9f94a3cf1dcb77ce289eaec1d19f556c0ae4be1fa03af4a9b7057837541c3cc0a80538736", - "0xac3ba42f5f44f9e1fc453ce49c4ab79d0e1d5c42d3b30b1e098f3ab3f414c4c262fa12fb2be249f52d4aaf3c5224beb9", - "0xaf47467eb152e59870e21f0d4da2f43e093daf40180ab01438030684b114d025326928eaab12c41b81a066d94fce8436", - "0x98d1b58ba22e7289b1c45c79a24624f19b1d89e00f778eef327ec4856a9a897278e6f1a9a7e673844b31dde949153000", - "0x97ccb15dfadc7c59dca08cfe0d22df2e52c684cf97de1d94bc00d7ba24e020025130b0a39c0f4d46e4fc872771ee7875", - "0xb699e4ed9a000ff96ca296b2f09dce278832bc8ac96851ff3cff99ed3f6f752cfc0fea8571be28cd9b5a7ec36f1a08ee", - "0xb9f49f0edb7941cc296435ff0a912e3ad16848ee8765ab5f60a050b280d6ea585e5b34051b15f6b8934ef01ceb85f648", - "0xac3893df7b4ceab23c6b9054e48e8ba40d6e5beda8fbe90b814f992f52494186969b35d8c4cdc3c99890a222c9c09008", - "0xa41293ad22fae81dea94467bc1488c3707f3d4765059173980be93995fa4fcc3c9340796e3eed0beeb0ba0d9bb4fa3aa", - "0xa0543e77acd2aeecde13d18d258aeb2c7397b77f17c35a1992e8666ea7abcd8a38ec6c2741bd929abba2f766138618cc", - "0x92e79b22bc40e69f6527c969500ca543899105837b6b1075fa1796755c723462059b3d1b028e0b3df2559fa440e09175", - "0xa1fa1eac8f41a5197a6fb4aa1eae1a031c89f9c13ff9448338b222780cf9022e0b0925d930c37501a0ef7b2b00fdaf83", - "0xb3cb29ff73229f0637335f28a08ad8c5f166066f27c6c175164d0f26766a927f843b987ee9b309ed71cbf0a65d483831", - "0x84d4ab787f0ac00f104f4a734dc693d62d48c2aeb03913153da62c2ae2c27d11b1110dcef8980368dd84682ea2c1a308", - "0xab6a8e4bbc78d4a7b291ad3e9a8fe2d65f640524ba3181123b09d2d18a9e300e2509ccf7000fe47e75b65f3e992a2e7e", - "0xb7805ebe4f1a4df414003dc10bca805f2ab86ca75820012653e8f9b79c405196b0e2cab099f2ab953d67f0d60d31a0f9", - "0xb12c582454148338ea605d22bd00a754109063e22617f1f8ac8ddf5502c22a181c50c216c3617b9852aa5f26af56b323", - "0x86333ad9f898947e31ce747728dc8c887479e18d36ff3013f69ebef807d82c6981543b5c3788af93c4d912ba084d3cba", - "0xb514efa310dc4ad1258add138891e540d8c87142a881b5f46563cc58ecd1488e6d3a2fca54c0b72a929f3364ca8c333e", - "0xaa0a30f92843cf2f484066a783a1d75a7aa6f41f00b421d4baf20a6ac7886c468d0eea7ca8b17dd22f4f74631b62b640", - "0xb3b7dc63baec9a752e8433c0cdee4d0f9bc41f66f2b8d132faf925eef9cf89aae756fc132c45910f057122462605dc10", - "0xb9b8190dac5bfdeb59fd44f4da41a57e7f1e7d2c21faba9da91fa45cbeca06dcf299c9ae22f0c89ece11ac46352d619f", - "0x89f8cf36501ad8bdfeab863752a9090e3bfda57cf8fdeca2944864dc05925f501e252c048221bcc57136ab09a64b64b2", - "0xb0cbfaf317f05f97be47fc9d69eda2dd82500e00d42612f271a1fe24626408c28881f171e855bd5bd67409f9847502b4", - "0xa7c21a8fcede581bfd9847b6835eda62ba250bea81f1bb17372c800a19c732abe03064e64a2f865d974fb636cab4b859", - "0x95f9df524ba7a4667351696c4176b505d8ea3659f5ff2701173064acc624af69a0fad4970963736383b979830cb32260", - "0x856a74fe8b37a2e3afeac858c8632200485d438422a16ae3b29f359e470e8244995c63ad79c7e007ed063f178d0306fd", - "0xb37faa4d78fdc0bb9d403674dbea0176c2014a171c7be8527b54f7d1a32a76883d3422a3e7a5f5fcc5e9b31b57822eeb", - "0x8d37234d8594ec3fe75670b5c9cc1ec3537564d4739b2682a75b18b08401869a4264c0f264354219d8d896cded715db4", - "0xb5289ee5737f0e0bde485d32096d23387d68dab8f01f47821ab4f06cc79a967afe7355e72dc0c751d96b2747b26f6255", - "0x9085e1fdf9f813e9c3b8232d3c8863cd84ab30d45e8e0d3d6a0abd9ebc6fd70cdf749ff4d04390000e14c7d8c6655fc7", - "0x93a388c83630331eca4da37ea4a97b3b453238af474817cc0a0727fd3138dcb4a22de38c04783ec829c22cb459cb4e8e", - "0xa5377116027c5d061dbe24c240b891c08cdd8cd3f0899e848d682c873aff5b8132c1e7cfe76d2e5ed97ee0eb1d42cb68", - "0xa274c84b04338ed28d74683e2a7519c2591a3ce37c294d6f6e678f7d628be2db8eff253ede21823e2df7183e6552f622", - "0x8bc201147a842453a50bec3ac97671397bc086d6dfc9377fa38c2124cdc286abda69b7324f47d64da094ae011d98d9d9", - "0x9842d0c066c524592b76fbec5132bc628e5e1d21c424bec4555efca8619cc1fd8ea3161febcb8b9e8ab54702f4e815e2", - "0xa19191b713a07efe85c266f839d14e25660ee74452e6c691cd9997d85ae4f732052d802d3deb018bdd847caa298a894b", - "0xa24f71fc0db504da4e287dd118a4a74301cbcd16033937ba2abc8417956fcb4ae19b8e63b931795544a978137eff51cb", - "0xa90eec4a6a3a4b8f9a5b93d978b5026fcf812fe65585b008d7e08c4aaf21195a1d0699f12fc16f79b6a18a369af45771", - "0x8b551cf89737d7d06d9b3b9c4c1c73b41f2ea0af4540999c70b82dabff8580797cf0a3caf34c86c59a7069eb2e38f087", - "0xb8d312e6c635e7a216a1cda075ae77ba3e1d2fd501dc31e83496e6e81ed5d9c7799f8e578869c2e0e256fb29f5de10a7", - "0x8d144bdb8cae0b2cdb5b33d44bbc96984a5925202506a8cc65eb67ac904b466f5a7fe3e1cbf04aa785bbb7348c4bb73c", - "0xa101b3d58b7a98659244b88de0b478b3fb87dc5fc6031f6e689b99edf498abd43e151fd32bd4bbd240e0b3e59c440359", - "0x907453abca7d8e7151a05cc3d506c988007692fe7401395dc93177d0d07d114ab6cca0cc658eb94c0223fe8658295cad", - "0x825329ffbe2147ddb68f63a0a67f32d7f309657b8e5d9ab5bb34b3730bfa2c77a23eaaadb05def7d9f94a9e08fdc1e96", - "0x88ee923c95c1dac99ae7ed6067906d734d793c5dc5d26339c1bb3314abe201c5dccb33b9007351885eb2754e9a8ea06c", - "0x98bc9798543f5f1adc9f2cfcfa72331989420e9c3f6598c45269f0dc9b7c8607bbeaf03faa0aea2ddde2b8f17fdceff5", - "0x8ee87877702a79aef923ab970db6fa81561b3c07d5bf1a072af0a7bad765b4cbaec910afe1a91703feacc7822fa38a94", - "0x8060b9584aa294fe8adc2b22f67e988bc6da768eae91e429dcc43ddc53cfcc5d6753fdc1b420b268c7eb2fb50736a970", - "0xb344a5524d80a2f051870c7001f74fcf348a70fcf78dbd20c6ff9ca85d81567d2318c8b8089f2c4f195d6aec9fc15fa6", - "0x8f5a5d893e1936ed062149d20eb73d98b62b7f50ab5d93a6429c03656b36688d1c80cb5010e4977491e51fa0d7dd35d5", - "0x86fa32ebbf97328c5f5f15564e1238297e289ec3219b9a741724e9f3ae8d5c15277008f555863a478b247ba5dc601d44", - "0x9557e55377e279f4b6b5e0ffe01eca037cc13aac242d67dfcd0374a1e775c5ed5cb30c25fe21143fee54e3302d34a3ea", - "0x8cb6bcbc39372d23464a416ea7039f57ba8413cf3f00d9a7a5b356ab20dcb8ed11b3561f7bce372b8534d2870c7ee270", - "0xb5d59075cb5abde5391f64b6c3b8b50adc6e1f654e2a580b6d6d6eff3f4fbdd8fffc92e06809c393f5c8eab37f774c4b", - "0xafcfb6903ef13e493a1f7308675582f15af0403b6553e8c37afb8b2808ad21b88b347dc139464367dc260df075fea1ad", - "0x810fbbe808375735dd22d5bc7fc3828dc49fdd22cc2d7661604e7ac9c4535c1df578780affb3b895a0831640a945bcad", - "0x8056b0c678803b416f924e09a6299a33cf9ad7da6fe1ad7accefe95c179e0077da36815fde3716711c394e2c5ea7127f", - "0x8b67403702d06979be19f1d6dc3ec73cc2e81254d6b7d0cc49cd4fdda8cd51ab0835c1d2d26fc0ecab5df90585c2f351", - "0x87f97f9e6d4be07e8db250e5dd2bffdf1390665bc5709f2b631a6fa69a7fca958f19bd7cc617183da1f50ee63e9352b5", - "0xae151310985940471e6803fcf37600d7fa98830613e381e00dab943aec32c14162d51c4598e8847148148000d6e5af5c", - "0x81eb537b35b7602c45441cfc61b27fa9a30d3998fad35a064e05bc9479e9f10b62eba2b234b348219eea3cadcaac64bb", - "0x8a441434934180ab6f5bc541f86ebd06eadbee01f438836d797e930fa803a51510e005c9248cecc231a775b74d12b5e9", - "0x81f3c250a27ba14d8496a5092b145629eb2c2e6a5298438670375363f57e2798207832c8027c3e9238ad94ecdadfc4df", - "0xa6217c311f2f3db02ceaa5b6096849fe92b6f4b6f1491535ef8525f6ccee6130bed2809e625073ecbaddd4a3eb3df186", - "0x82d1c396f0388b942cf22b119d7ef1ad03d3dad49a74d9d01649ee284f377c8daddd095d596871669e16160299a210db", - "0xa40ddf7043c5d72a7246bd727b07f7fff1549f0e443d611de6f9976c37448b21664c5089c57f20105102d935ab82f27b", - "0xb6c03c1c97adf0c4bf4447ec71366c6c1bff401ba46236cd4a33d39291e7a1f0bb34bd078ba3a18d15c98993b153a279", - "0x8a94f5f632068399c359c4b3a3653cb6df2b207379b3d0cdace51afdf70d6d5cce6b89a2b0fee66744eba86c98fb21c2", - "0xb2f19e78ee85073f680c3bba1f07fd31b057c00b97040357d97855b54a0b5accb0d3b05b2a294568fcd6a4be6f266950", - "0xa74632d13bbe2d64b51d7a9c3ae0a5a971c19f51cf7596a807cea053e6a0f3719700976d4e394b356c0329a2dced9aa2", - "0xafef616d341a9bc94393b8dfba68ff0581436aa3a3adb7c26a1bbf2cf19fa877066191681f71f17f3cd6f9cf6bf70b5a", - "0x8ce96d93ae217408acf7eb0f9cbb9563363e5c7002e19bbe1e80760bc9d449daee2118f3878b955163ed664516b97294", - "0x8414f79b496176bc8b8e25f8e4cfee28f4f1c2ddab099d63d2aca1b6403d26a571152fc3edb97794767a7c4686ad557c", - "0xb6c61d01fd8ce087ef9f079bf25bf10090db483dd4f88c4a786d31c1bdf52065651c1f5523f20c21e75cea17df69ab73", - "0xa5790fd629be70545093631efadddc136661f63b65ec682609c38ef7d3d7fa4e56bdf94f06e263bc055b90cb1c6bcefe", - "0xb515a767e95704fb7597bca9e46f1753abacdc0e56e867ee3c6f4cd382643c2a28e65312c05ad040eaa3a8cbe7217a65", - "0x8135806a02ead6aa92e9adb6fefb91349837ab73105aaa7be488ef966aa8dfaafdfa64bbae30fcbfa55dd135a036a863", - "0x8f22435702716d76b1369750694540742d909d5e72b54d0878245fab7c269953b1c6f2b29c66f08d5e0263ca3a731771", - "0x8e0f8a8e8753e077dac95848212aeffd51c23d9b6d611df8b102f654089401954413ecbedc6367561ca599512ae5dda7", - "0x815a9084e3e2345f24c5fa559deec21ee1352fb60f4025c0779be65057f2d528a3d91593bd30d3a185f5ec53a9950676", - "0x967e6555ccba395b2cc1605f8484c5112c7b263f41ce8439a99fd1c71c5ed14ad02684d6f636364199ca48afbbde13be", - "0x8cd0ccf17682950b34c796a41e2ea7dd5367aba5e80a907e01f4cdc611e4a411918215e5aebf4292f8b24765d73314a6", - "0xa58bf1bbb377e4b3915df6f058a0f53b8fb8130fdec8c391f6bc82065694d0be59bb67ffb540e6c42cc8b380c6e36359", - "0x92af3151d9e6bfb3383d85433e953c0160859f759b0988431ec5893542ba40288f65db43c78a904325ef8d324988f09d", - "0x8011bbb05705167afb47d4425065630f54cb86cd462095e83b81dfebf348f846e4d8fbcf1c13208f5de1931f81da40b9", - "0x81c743c104fc3cb047885c9fa0fb9705c3a83ee24f690f539f4985509c3dafd507af3f6a2128276f45d5939ef70c167f", - "0xa2c9679b151c041aaf5efeac5a737a8f70d1631d931609fca16be1905682f35e291292874cb3b03f14994f98573c6f44", - "0xa4949b86c4e5b1d5c82a337e5ce6b2718b1f7c215148c8bfb7e7c44ec86c5c9476048fc5c01f57cb0920876478c41ad6", - "0x86c2495088bd1772152e527a1da0ef473f924ea9ab0e5b8077df859c28078f73c4e22e3a906b507fdf217c3c80808b5c", - "0x892e0a910dcf162bcea379763c3e2349349e4cda9402949255ac4a78dd5a47e0bf42f5bd0913951576b1d206dc1e536a", - "0xa7009b2c6b396138afe4754b7cc10dee557c51c7f1a357a11486b3253818531f781ea8107360c8d4c3b1cd96282353c0", - "0x911763ef439c086065cc7b4e57484ed6d693ea44acee4b18c9fd998116da55fbe7dcb8d2a0f0f9b32132fca82d73dff6", - "0xa722000b95a4a2d40bed81870793f15ba2af633f9892df507f2842e52452e02b5ea8dea6a043c2b2611d82376e33742a", - "0x9387ac49477bd719c2f92240d0bdfcf9767aad247ca93dc51e56106463206bc343a8ec855eb803471629a66fffb565d6", - "0x92819a1fa48ab4902939bb72a0a4e6143c058ea42b42f9bc6cea5df45f49724e2530daf3fc4f097cceefa2a8b9db0076", - "0x98eac7b04537653bc0f4941aae732e4b1f84bd276c992c64a219b8715eb1fb829b5cbd997d57feb15c7694c468f95f70", - "0xb275e7ba848ce21bf7996e12dbeb8dadb5d0e4f1cb5a0248a4f8f9c9fe6c74e3c93f4b61edbcb0a51af5a141e1c14bc7", - "0x97243189285aba4d49c53770c242f2faf5fd3914451da4931472e3290164f7663c726cf86020f8f181e568c72fd172d1", - "0x839b0b3c25dd412bee3dc24653b873cc65454f8f16186bb707bcd58259c0b6765fa4c195403209179192a4455c95f3b8", - "0x8689d1a870514568a074a38232e2ceb4d7df30fabeb76cff0aed5b42bf7f02baea12c5fadf69f4713464dbd52aafa55f", - "0x8958ae7b290f0b00d17c3e9fdb4dbf168432b457c7676829299dd428984aba892de1966fc106cfc58a772862ecce3976", - "0xa422bc6bd68b8870cfa5bc4ce71781fd7f4368b564d7f1e0917f6013c8bbb5b240a257f89ecfdbecb40fe0f3aa31d310", - "0xaa61f78130cebe09bc9a2c0a37f0dd57ed2d702962e37d38b1df7f17dc554b1d4b7a39a44182a452ce4c5eb31fa4cfcc", - "0xb7918bd114f37869bf1a459023386825821bfadce545201929d13ac3256d92a431e34f690a55d944f77d0b652cefeffc", - "0x819bba35fb6ace1510920d4dcff30aa682a3c9af9022e287751a6a6649b00c5402f14b6309f0aeef8fce312a0402915e", - "0x8b7c9ad446c6f63c11e1c24e24014bd570862b65d53684e107ba9ad381e81a2eaa96731b4b33536efd55e0f055071274", - "0x8fe79b53f06d33386c0ec7d6d521183c13199498594a46d44a8a716932c3ec480c60be398650bbfa044fa791c4e99b65", - "0x9558e10fb81250b9844c99648cf38fa05ec1e65d0ccbb18aa17f2d1f503144baf59d802c25be8cc0879fff82ed5034ad", - "0xb538a7b97fbd702ba84645ca0a63725be1e2891c784b1d599e54e3480e4670d0025526674ef5cf2f87dddf2290ba09f0", - "0x92eafe2e869a3dd8519bbbceb630585c6eb21712b2f31e1b63067c0acb5f9bdbbcbdb612db4ea7f9cc4e7be83d31973f", - "0xb40d21390bb813ab7b70a010dff64c57178418c62685761784e37d327ba3cb9ef62df87ecb84277c325a637fe3709732", - "0xb349e6fbf778c4af35fbed33130bd8a7216ed3ba0a79163ebb556e8eb8e1a7dad3456ddd700dad9d08d202491c51b939", - "0xa8fdaedecb251f892b66c669e34137f2650509ade5d38fbe8a05d9b9184bb3b2d416186a3640429bd1f3e4b903c159dd", - "0xac6167ebfee1dbab338eff7642f5e785fc21ef0b4ddd6660333fe398068cbd6c42585f62e81e4edbb72161ce852a1a4f", - "0x874b1fbf2ebe140c683bd7e4e0ab017afa5d4ad38055aaa83ee6bbef77dbc88a6ce8eb0dcc48f0155244af6f86f34c2d", - "0x903c58e57ddd9c446afab8256a6bb6c911121e6ccfb4f9b4ed3e2ed922a0e500a5cb7fa379d5285bc16e11dac90d1fda", - "0x8dae7a0cffa2fd166859cd1bf10ff82dd1932e488af377366b7efc0d5dec85f85fe5e8150ff86a79a39cefc29631733a", - "0xaa047857a47cc4dfc08585f28640420fcf105b881fd59a6cf7890a36516af0644d143b73f3515ab48faaa621168f8c31", - "0x864508f7077c266cc0cb3f7f001cb6e27125ebfe79ab57a123a8195f2e27d3799ff98413e8483c533b46a816a3557f1f", - "0x8bcd45ab1f9cbab36937a27e724af819838f66dfeb15923f8113654ff877bd8667c54f6307aaf0c35027ca11b6229bfd", - "0xb21aa34da9ab0a48fcfdd291df224697ce0c1ebc0e9b022fdee8750a1a4b5ba421c419541ed5c98b461eecf363047471", - "0xa9a18a2ab2fae14542dc336269fe612e9c1af6cf0c9ac933679a2f2cb77d3c304114f4d219ca66fe288adde30716775b", - "0xb5205989b92c58bdda71817f9a897e84100b5c4e708de1fced5c286f7a6f01ae96b1c8d845f3a320d77c8e2703c0e8b1", - "0xa364059412bbcc17b8907d43ac8e5df90bc87fd1724b5f99832d0d24559fae6fa76a74cff1d1eac8cbac6ec80b44af20", - "0xae709f2c339886b31450834cf29a38b26eb3b0779bd77c9ac269a8a925d1d78ea3837876c654b61a8fe834b3b6940808", - "0x8802581bba66e1952ac4dab36af371f66778958f4612901d95e5cac17f59165e6064371d02de8fb6fccf89c6dc8bd118", - "0xa313252df653e29c672cbcfd2d4f775089cb77be1077381cf4dc9533790e88af6cedc8a119158e7da5bf6806ad9b91a1", - "0x992a065b4152c7ef11515cd54ba9d191fda44032a01aed954acff3443377ee16680c7248d530b746b8c6dee2d634e68c", - "0xb627b683ee2b32c1ab4ccd27b9f6cce2fe097d96386fa0e5c182ad997c4c422ab8dfc03870cd830b8c774feb66537282", - "0xb823cf8a9aee03dadd013eb9efe40a201b4b57ef67efaae9f99683005f5d1bf55e950bf4af0774f50859d743642d3fea", - "0xb8a7449ffac0a3f206677097baf7ce00ca07a4d2bd9b5356fbcb83f3649b0fda07cfebad220c1066afba89e5a52abf4b", - "0xb2dd1a2f986395bb4e3e960fbbe823dbb154f823284ebc9068502c19a7609790ec0073d08bfa63f71e30c7161b6ef966", - "0x98e5236de4281245234f5d40a25b503505af140b503a035fc25a26159a9074ec81512b28f324c56ea2c9a5aa7ce90805", - "0x89070847dc8bbf5bc4ed073aa2e2a1f699cf0c2ca226f185a0671cecc54e7d3e14cd475c7752314a7a8e7476829da4bc", - "0xa9402dc9117fdb39c4734c0688254f23aed3dce94f5f53f5b7ef2b4bf1b71a67f85ab1a38ec224a59691f3bee050aeb3", - "0x957288f9866a4bf56a4204218ccc583f717d7ce45c01ea27142a7e245ad04a07f289cc044f8cf1f21d35e67e39299e9c", - "0xb2fb31ccb4e69113763d7247d0fc8edaae69b550c5c56aecacfd780c7217dc672f9fb7496edf4aba65dacf3361268e5b", - "0xb44a4526b2f1d6eb2aa8dba23bfa385ff7634572ab2afddd0546c3beb630fbfe85a32f42dd287a7fec069041411537f7", - "0x8db5a6660c3ac7fd7a093573940f068ee79a82bc17312af900b51c8c439336bc86ca646c6b7ab13aaaa008a24ca508ab", - "0x8f9899a6d7e8eb4367beb5c060a1f8e94d8a21099033ae582118477265155ba9e72176a67f7f25d7bad75a152b56e21a", - "0xa67de0e91ade8d69a0e00c9ff33ee2909b8a609357095fa12319e6158570c232e5b6f4647522efb7345ce0052aa9d489", - "0x82eb2414898e9c3023d57907a2b17de8e7eea5269029d05a94bfd7bf5685ac4a799110fbb375eb5e0e2bd16acf6458ae", - "0x94451fc7fea3c5a89ba701004a9693bab555cb622caf0896b678faba040409fdfd14a978979038b2a81e8f0abc4994d2", - "0xac879a5bb433998e289809a4a966bd02b4bf6a9c1cc276454e39c886efcf4fc68baebed575826bde577ab5aa71d735a9", - "0x880c0f8f49c875dfd62b4ddedde0f5c8b19f5687e693717f7e5c031bc580e58e13ab497d48b4874130a18743c59fdce3", - "0xb582af8d8ff0bf76f0a3934775e0b54c0e8fed893245d7d89cae65b03c8125b7237edc29dc45b4fe1a3fe6db45d280ee", - "0x89f337882ed3ae060aaee98efa20d79b6822bde9708c1c5fcee365d0ec9297f694cae37d38fd8e3d49717c1e86f078e7", - "0x826d2c1faea54061848b484e288a5f4de0d221258178cf87f72e14baaa4acc21322f8c9eab5dde612ef497f2d2e1d60b", - "0xa5333d4f227543e9cd741ccf3b81db79f2f03ca9e649e40d6a6e8ff9073e06da83683566d3b3c8d7b258c62970fb24d1", - "0xa28f08c473db06aaf4c043a2fae82b3c8cfaa160bce793a4c208e4e168fb1c65115ff8139dea06453c5963d95e922b94", - "0x8162546135cc5e124e9683bdfaa45833c18553ff06a0861c887dc84a5b12ae8cd4697f6794c7ef6230492c32faba7014", - "0xb23f0d05b74c08d6a7df1760792be83a761b36e3f8ae360f3c363fb196e2a9dd2de2e492e49d36561366e14daa77155c", - "0xb6f70d6c546722d3907c708d630dbe289771d2c8bf059c2e32b77f224696d750b4dda9b3a014debda38e7d02c9a77585", - "0x83bf4c4a9f3ca022c631017e7a30ea205ba97f7f5927cba8fc8489a4646eac6712cb821c5668c9ffe94d69d524374a27", - "0xb0371475425a8076d0dd5f733f55aabbe42d20a7c8ea7da352e736d4d35a327b2beb370dfcb05284e22cfd69c5f6c4cc", - "0xa0031ba7522c79211416c2cca3aa5450f96f8fee711552a30889910970ba13608646538781a2c08b834b140aadd7166f", - "0x99d273c80c7f2dc6045d4ed355d9fc6f74e93549d961f4a3b73cd38683f905934d359058cd1fc4da8083c7d75070487f", - "0xb0e4b0efa3237793e9dcce86d75aafe9879c5fa23f0d628649aef2130454dcf72578f9bf227b9d2b9e05617468e82588", - "0xa5ab076fa2e1c5c51f3ae101afdd596ad9d106bba7882b359c43d8548b64f528af19afa76cd6f40da1e6c5fca4def3fa", - "0x8ce2299e570331d60f6a6eff1b271097cd5f1c0e1113fc69b89c6a0f685dabea3e5bc2ac6bd789aa492ab189f89be494", - "0x91b829068874d911a310a5f9dee001021f97471307b5a3de9ec336870ec597413e1d92010ce320b619f38bed7c4f7910", - "0xb14fe91f4b07bf33b046e9285b66cb07927f3a8da0af548ac2569b4c4fb1309d3ced76d733051a20814e90dd5b75ffd1", - "0xabaab92ea6152d40f82940277c725aa768a631ee0b37f5961667f82fb990fc11e6d3a6a2752b0c6f94563ed9bb28265c", - "0xb7fe28543eca2a716859a76ab9092f135337e28109544f6bd2727728d0a7650428af5713171ea60bfc273d1c821d992c", - "0x8a4917b2ab749fc7343fc64bdf51b6c0698ff15d740cc7baf248c030475c097097d5a473bcc00d8c25817563fe0447b4", - "0xaa96156d1379553256350a0a3250166add75948fb9cde62aa555a0a9dc0a9cb7f2f7b8428aff66097bf6bfedaf14bbe2", - "0xae4ffeb9bdc76830d3eca2b705f30c1bdede6412fa064260a21562c8850c7fb611ec62bc68479fe48f692833e6f66d8d", - "0xb96543caaba9d051600a14997765d49e4ab10b07c7a92cccf0c90b309e6da334fdd6d18c96806cbb67a7801024fbd3c7", - "0x97b2b9ad76f19f500fcc94ca8e434176249f542ac66e5881a3dccd07354bdab6a2157018b19f8459437a68d8b86ba8e0", - "0xa8d206f6c5a14c80005849474fde44b1e7bcf0b2d52068f5f97504c3c035b09e65e56d1cf4b5322791ae2c2fdbd61859", - "0x936bad397ad577a70cf99bf9056584a61bd7f02d2d5a6cf219c05d770ae30a5cd902ba38366ce636067fc1dd10108d31", - "0xa77e30195ee402b84f3882e2286bf5380c0ed374a112dbd11e16cef6b6b61ab209d4635e6f35cdaaa72c1a1981d5dabe", - "0xa46ba4d3947188590a43c180757886a453a0503f79cc435322d92490446f37419c7b999fdf868a023601078070e03346", - "0x80d8d4c5542f223d48240b445d4d8cf6a75d120b060bc08c45e99a13028b809d910b534d2ac47fb7068930c54efd8da9", - "0x803be9c68c91b42b68e1f55e58917a477a9a6265e679ca44ee30d3eb92453f8c89c64eafc04c970d6831edd33d066902", - "0xb14b2b3d0dfe2bb57cee4cd72765b60ac33c1056580950be005790176543826c1d4fbd737f6cfeada6c735543244ab57", - "0xa9e480188bba1b8fb7105ff12215706665fd35bf1117bacfb6ab6985f4dbc181229873b82e5e18323c2b8f5de03258e0", - "0xa66a0f0779436a9a3999996d1e6d3000f22c2cac8e0b29cddef9636393c7f1457fb188a293b6c875b05d68d138a7cc4a", - "0x848397366300ab40c52d0dbbdafbafef6cd3dadf1503bb14b430f52bb9724188928ac26f6292a2412bc7d7aa620763c8", - "0x95466cc1a78c9f33a9aaa3829a4c8a690af074916b56f43ae46a67a12bb537a5ac6dbe61590344a25b44e8512355a4a7", - "0x8b5f7a959f818e3baf0887f140f4575cac093d0aece27e23b823cf421f34d6e4ff4bb8384426e33e8ec7b5eed51f6b5c", - "0x8d5e1368ec7e3c65640d216bcc5d076f3d9845924c734a34f3558ac0f16e40597c1a775a25bf38b187213fbdba17c93b", - "0xb4647c1b823516880f60d20c5cc38c7f80b363c19d191e8992226799718ee26b522a12ecb66556ed3d483aa4824f3326", - "0xac3abaea9cd283eb347efda4ed9086ea3acf495043e08d0d19945876329e8675224b685612a6badf8fd72fb6274902b1", - "0x8eae1ce292d317aaa71bcf6e77e654914edd5090e2e1ebab78b18bb41b9b1bc2e697439f54a44c0c8aa0d436ebe6e1a9", - "0x94dc7d1aec2c28eb43d93b111fa59aaa0d77d5a09501220bd411768c3e52208806abf973c6a452fd8292ff6490e0c9e2", - "0x8fd8967f8e506fef27d17b435d6b86b232ec71c1036351f12e6fb8a2e12daf01d0ee04451fb944d0f1bf7fd20e714d02", - "0x824e6865be55d43032f0fec65b3480ea89b0a2bf860872237a19a54bc186a85d2f8f9989cc837fbb325b7c72d9babe2c", - "0x8bd361f5adb27fd6f4e3f5de866e2befda6a8454efeb704aacc606f528c03f0faae888f60310e49440496abd84083ce2", - "0xb098a3c49f2aaa28b6b3e85bc40ce6a9cdd02134ee522ae73771e667ad7629c8d82c393fba9f27f5416986af4c261438", - "0xb385f5ca285ff2cfe64dcaa32dcde869c28996ed091542600a0b46f65f3f5a38428cca46029ede72b6cf43e12279e3d3", - "0x8196b03d011e5be5288196ef7d47137d6f9237a635ab913acdf9c595fa521d9e2df722090ec7eb0203544ee88178fc5f", - "0x8ed1270211ef928db18e502271b7edf24d0bbd11d97f2786aee772d70c2029e28095cf8f650b0328cc8a4c38d045316d", - "0xa52ab60e28d69b333d597a445884d44fd2a7e1923dd60f763951e1e45f83e27a4dac745f3b9eff75977b3280e132c15d", - "0x91e9fe78cdac578f4a4687f71b800b35da54b824b1886dafec073a3c977ce7a25038a2f3a5b1e35c2c8c9d1a7312417c", - "0xa42832173f9d9491c7bd93b21497fbfa4121687cd4d2ab572e80753d7edcbb42cfa49f460026fbde52f420786751a138", - "0x97b947126d84dcc70c97be3c04b3de3f239b1c4914342fa643b1a4bb8c4fe45c0fcb585700d13a7ed50784790c54bef9", - "0x860e407d353eac070e2418ef6cb80b96fc5f6661d6333e634f6f306779651588037be4c2419562c89c61f9aa2c4947f5", - "0xb2c9d93c3ba4e511b0560b55d3501bf28a510745fd666b3cb532db051e6a8617841ea2f071dda6c9f15619c7bfd2737f", - "0x8596f4d239aeeac78311207904d1bd863ef68e769629cc379db60e019aaf05a9d5cd31dc8e630b31e106a3a93e47cbc5", - "0x8b26e14e2e136b65c5e9e5c2022cee8c255834ea427552f780a6ca130a6446102f2a6f334c3f9a0308c53df09e3dba7e", - "0xb54724354eb515a3c8bed0d0677ff1db94ac0a07043459b4358cb90e3e1aa38ac23f2caa3072cf9647275d7cd61d0e80", - "0xb7ce9fe0e515e7a6b2d7ddcb92bc0196416ff04199326aea57996eef8c5b1548bd8569012210da317f7c0074691d01b7", - "0xa1a13549c82c877253ddefa36a29ea6a23695ee401fdd48e65f6f61e5ebd956d5e0edeff99484e9075cb35071fec41e2", - "0x838ba0c1e5bd1a6da05611ff1822b8622457ebd019cb065ece36a2d176bd2d889511328120b8a357e44569e7f640c1e6", - "0xb916eccff2a95519400bbf76b5f576cbe53cf200410370a19d77734dc04c05b585cfe382e8864e67142d548cd3c4c2f4", - "0xa610447cb7ca6eea53a6ff1f5fe562377dcb7f4aaa7300f755a4f5e8eba61e863c51dc2aa9a29b35525b550fbc32a0fe", - "0x9620e8f0f0ee9a4719aa9685eeb1049c5c77659ba6149ec4c158f999cfd09514794b23388879931fe26fea03fa471fd3", - "0xa9dcf8b679e276583cf5b9360702a185470d09aea463dc474ee9c8aee91ef089dacb073e334e47fbc78ec5417c90465c", - "0x8c9adee8410bdd99e5b285744cee61e2593b6300ff31a8a83b0ec28da59475a5c6fb9346fe43aadea2e6c3dad2a8e30a", - "0x97d5afe9b3897d7b8bb628b7220cf02d8ee4e9d0b78f5000d500aaf4c1df9251aaaabfd1601626519f9d66f00a821d4e", - "0x8a382418157b601ce4c3501d3b8409ca98136a4ef6abcbf62885e16e215b76b035c94d149cc41ff92e42ccd7c43b9b3d", - "0xb64b8d11fb3b01abb2646ac99fdb9c02b804ce15d98f9fe0fbf1c9df8440c71417487feb6cdf51e3e81d37104b19e012", - "0x849d7d044f9d8f0aab346a9374f0b3a5d14a9d1faa83dbacccbdc629ad1ef903a990940255564770537f8567521d17f0", - "0x829dbb0c76b996c2a91b4cbbe93ba455ca0d5729755e5f0c92aaee37dff7f36fcdc06f33aca41f1b609c784127b67d88", - "0x85a7c0069047b978422d264d831ab816435f63938015d2e977222b6b5746066c0071b7f89267027f8a975206ed25c1b0", - "0x84b9fbc1cfb302df1acdcf3dc5d66fd1edfe7839f7a3b2fb3a0d5548656249dd556104d7c32b73967bccf0f5bdcf9e3b", - "0x972220ac5b807f53eac37dccfc2ad355d8b21ea6a9c9b011c09fe440ddcdf7513e0b43d7692c09ded80d7040e26aa28f", - "0x855885ed0b21350baeca890811f344c553cf9c21024649c722453138ba29193c6b02c4b4994cd414035486f923472e28", - "0x841874783ae6d9d0e59daea03e96a01cbbe4ecaced91ae4f2c8386e0d87b3128e6d893c98d17c59e4de1098e1ad519dd", - "0x827e50fc9ce56f97a4c3f2f4cbaf0b22f1c3ce6f844ff0ef93a9c57a09b8bf91ebfbd2ba9c7f83c442920bffdaf288cc", - "0xa441f9136c7aa4c08d5b3534921b730e41ee91ab506313e1ba5f7c6f19fd2d2e1594e88c219834e92e6fb95356385aa7", - "0x97d75b144471bf580099dd6842b823ec0e6c1fb86dd0da0db195e65524129ea8b6fd4a7a9bbf37146269e938a6956596", - "0xa4b6fa87f09d5a29252efb2b3aaab6b3b6ea9fab343132a651630206254a25378e3e9d6c96c3d14c150d01817d375a8e", - "0xa31a671876d5d1e95fe2b8858dc69967231190880529d57d3cab7f9f4a2b9b458ac9ee5bdaa3289158141bf18f559efb", - "0x90bee6fff4338ba825974021b3b2a84e36d617e53857321f13d2b3d4a28954e6de3b3c0e629d61823d18a9763313b3bf", - "0x96b622a63153f393bb419bfcf88272ea8b3560dbd46b0aa07ada3a6223990d0abdd6c2adb356ef4be5641688c8d83941", - "0x84c202adeaff9293698022bc0381adba2cd959f9a35a4e8472288fd68f96f6de8be9da314c526d88e291c96b1f3d6db9", - "0x8ca01a143b8d13809e5a8024d03e6bc9492e22226073ef6e327edf1328ef4aff82d0bcccee92cb8e212831fa35fe1204", - "0xb2f970dbad15bfbefb38903c9bcc043d1367055c55dc1100a850f5eb816a4252c8c194b3132c929105511e14ea10a67d", - "0xa5e36556472a95ad57eb90c3b6623671b03eafd842238f01a081997ffc6e2401f76e781d049bb4aa94d899313577a9cf", - "0x8d1057071051772f7c8bedce53a862af6fd530dd56ae6321eaf2b9fc6a68beff5ed745e1c429ad09d5a118650bfd420a", - "0x8aadc4f70ace4fcb8d93a78610779748dcffc36182d45b932c226dc90e48238ea5daa91f137c65ed532352c4c4d57416", - "0xa2ea05ae37e673b4343232ae685ee14e6b88b867aef6dfac35db3589cbcd76f99540fed5c2641d5bb5a4a9f808e9bf0d", - "0x947f1abad982d65648ae4978e094332b4ecb90f482c9be5741d5d1cf5a28acf4680f1977bf6e49dd2174c37f11e01296", - "0xa27b144f1565e4047ba0e3f4840ef19b5095d1e281eaa463c5358f932114cbd018aa6dcf97546465cf2946d014d8e6d6", - "0x8574e1fc3acade47cd4539df578ce9205e745e161b91e59e4d088711a7ab5aa3b410d517d7304b92109924d9e2af8895", - "0xa48ee6b86b88015d6f0d282c1ae01d2a5b9e8c7aa3d0c18b35943dceb1af580d08a65f54dc6903cde82fd0d73ce94722", - "0x8875650cec543a7bf02ea4f2848a61d167a66c91ffaefe31a9e38dc8511c6a25bde431007eefe27a62af3655aca208dc", - "0x999b0a6e040372e61937bf0d68374e230346b654b5a0f591a59d33a4f95bdb2f3581db7c7ccb420cd7699ed709c50713", - "0x878c9e56c7100c5e47bbe77dc8da5c5fe706cec94d37fa729633bca63cace7c40102eee780fcdabb655f5fa47a99600e", - "0x865006fb5b475ada5e935f27b96f9425fc2d5449a3c106aa366e55ebed3b4ee42adc3c3f0ac19fd129b40bc7d6bc4f63", - "0xb7a7da847f1202e7bc1672553e68904715e84fd897d529243e3ecda59faa4e17ba99c649a802d53f6b8dfdd51f01fb74", - "0x8b2fb4432c05653303d8c8436473682933a5cb604da10c118ecfcd2c8a0e3132e125afef562bdbcc3df936164e5ce4f2", - "0x808d95762d33ddfa5d0ee3d7d9f327de21a994d681a5f372e2e3632963ea974da7f1f9e5bac8ccce24293509d1f54d27", - "0x932946532e3c397990a1df0e94c90e1e45133e347a39b6714c695be21aeb2d309504cb6b1dde7228ff6f6353f73e1ca2", - "0x9705e7c93f0cdfaa3fa96821f830fe53402ad0806036cd1b48adc2f022d8e781c1fbdab60215ce85c653203d98426da3", - "0xaa180819531c3ec1feb829d789cb2092964c069974ae4faad60e04a6afcce5c3a59aec9f11291e6d110a788d22532bc6", - "0x88f755097f7e25cb7dd3c449520c89b83ae9e119778efabb54fbd5c5714b6f37c5f9e0346c58c6ab09c1aef2483f895d", - "0x99fc03ab7810e94104c494f7e40b900f475fde65bdec853e60807ffd3f531d74de43335c3b2646b5b8c26804a7448898", - "0xaf2dea9683086bed1a179110efb227c9c00e76cd00a2015b089ccbcee46d1134aa18bda5d6cab6f82ae4c5cd2461ac21", - "0xa500f87ba9744787fdbb8e750702a3fd229de6b8817594348dec9a723b3c4240ddfa066262d002844b9e38240ce55658", - "0x924d0e45c780f5bc1c1f35d15dfc3da28036bdb59e4c5440606750ecc991b85be18bc9a240b6c983bc5430baa4c68287", - "0x865b11e0157b8bf4c5f336024b016a0162fc093069d44ac494723f56648bc4ded13dfb3896e924959ea11c96321afefc", - "0x93672d8607d4143a8f7894f1dcca83fb84906dc8d6dd7dd063bb0049cfc20c1efd933e06ca7bd03ea4cb5a5037990bfe", - "0x826891efbdff0360446825a61cd1fa04326dd90dae8c33dfb1ed97b045e165766dd070bd7105560994d0b2044bdea418", - "0x93c4a4a8bcbc8b190485cc3bc04175b7c0ed002c28c98a540919effd6ed908e540e6594f6db95cd65823017258fb3b1c", - "0xaeb2a0af2d2239fda9aa6b8234b019708e8f792834ff0dd9c487fa09d29800ddceddd6d7929faa9a3edcb9e1b3aa0d6b", - "0x87f11de7236d387863ec660d2b04db9ac08143a9a2c4dfff87727c95b4b1477e3bc473a91e5797313c58754905079643", - "0x80dc1db20067a844fe8baceca77f80db171a5ca967acb24e2d480eae9ceb91a3343c31ad1c95b721f390829084f0eae6", - "0x9825c31f1c18da0de3fa84399c8b40f8002c3cae211fb6a0623c76b097b4d39f5c50058f57a16362f7a575909d0a44a2", - "0xa99fc8de0c38dbf7b9e946de83943a6b46a762167bafe2a603fb9b86f094da30d6de7ed55d639aafc91936923ee414b3", - "0xad594678b407db5d6ea2e90528121f84f2b96a4113a252a30d359a721429857c204c1c1c4ff71d8bb5768c833f82e80e", - "0xb33d985e847b54510b9b007e31053732c8a495e43be158bd2ffcea25c6765bcbc7ca815f7c60b36ad088b955dd6e9350", - "0x815f8dfc6f90b3342ca3fbd968c67f324dae8f74245cbf8bc3bef10e9440c65d3a2151f951e8d18959ba01c1b50b0ec1", - "0x94c608a362dd732a1abc56e338637c900d59013db8668e49398b3c7a0cae3f7e2f1d1bf94c0299eeafe6af7f76c88618", - "0x8ebd8446b23e5adfcc393adc5c52fe172f030a73e63cd2d515245ca0dd02782ceed5bcdd9ccd9c1b4c5953dfac9c340c", - "0x820437f3f6f9ad0f5d7502815b221b83755eb8dc56cd92c29e9535eb0b48fb8d08c9e4fcc26945f9c8cca60d89c44710", - "0x8910e4e8a56bf4be9cc3bbf0bf6b1182a2f48837a2ed3c2aaec7099bfd7f0c83e14e608876b17893a98021ff4ab2f20d", - "0x9633918fde348573eec15ce0ad53ac7e1823aac86429710a376ad661002ae6d049ded879383faaa139435122f64047c6", - "0xa1f5e3fa558a9e89318ca87978492f0fb4f6e54a9735c1b8d2ecfb1d1c57194ded6e0dd82d077b2d54251f3bee1279e1", - "0xb208e22d04896abfd515a95c429ff318e87ff81a5d534c8ac2c33c052d6ffb73ef1dccd39c0bbe0734b596c384014766", - "0x986d5d7d2b5bde6d16336f378bd13d0e671ad23a8ec8a10b3fc09036faeeb069f60662138d7a6df3dfb8e0d36180f770", - "0xa2d4e6c5f5569e9cef1cddb569515d4b6ace38c8aed594f06da7434ba6b24477392cc67ba867c2b079545ca0c625c457", - "0xb5ac32b1d231957d91c8b7fc43115ce3c5c0d8c13ca633374402fa8000b6d9fb19499f9181844f0c10b47357f3f757ce", - "0x96b8bf2504b4d28fa34a4ec378e0e0b684890c5f44b7a6bb6e19d7b3db2ab27b1e2686389d1de9fbd981962833a313ea", - "0x953bfd7f6c3a0469ad432072b9679a25486f5f4828092401eff494cfb46656c958641a4e6d0d97d400bc59d92dba0030", - "0x876ab3cea7484bbfd0db621ec085b9ac885d94ab55c4bb671168d82b92e609754b86aaf472c55df3d81421d768fd108a", - "0x885ff4e67d9ece646d02dd425aa5a087e485c3f280c3471b77532b0db6145b69b0fbefb18aa2e3fa5b64928b43a94e57", - "0xb91931d93f806d0b0e6cc62a53c718c099526140f50f45d94b8bbb57d71e78647e06ee7b42aa5714aed9a5c05ac8533f", - "0xa0313eeadd39c720c9c27b3d671215331ab8d0a794e71e7e690f06bcd87722b531d6525060c358f35f5705dbb7109ccb", - "0x874c0944b7fedc6701e53344100612ddcb495351e29305c00ec40a7276ea5455465ffb7bded898886c1853139dfb1fc7", - "0x8dc31701a01ee8137059ca1874a015130d3024823c0576aa9243e6942ec99d377e7715ed1444cd9b750a64b85dcaa3e5", - "0x836d2a757405e922ec9a2dfdcf489a58bd48b5f9683dd46bf6047688f778c8dee9bc456de806f70464df0b25f3f3d238", - "0xb30b0a1e454a503ea3e2efdec7483eaf20b0a5c3cefc42069e891952b35d4b2c955cf615f3066285ed8fafd9fcfbb8f6", - "0x8e6d4044b55ab747e83ec8762ea86845f1785cc7be0279c075dadf08aca3ccc5a096c015bb3c3f738f647a4eadea3ba5", - "0xad7735d16ab03cbe09c029610aa625133a6daecfc990b297205b6da98eda8c136a7c50db90f426d35069708510d5ae9c", - "0x8d62d858bbb59ec3c8cc9acda002e08addab4d3ad143b3812098f3d9087a1b4a1bb255dcb1635da2402487d8d0249161", - "0x805beec33238b832e8530645a3254aeef957e8f7ea24bcfc1054f8b9c69421145ebb8f9d893237e8a001c857fedfc77e", - "0xb1005644be4b085e3f5775aa9bd3e09a283e87ddada3082c04e7a62d303dcef3b8cf8f92944c200c7ae6bb6bdf63f832", - "0xb4ba0e0790dc29063e577474ffe3b61f5ea2508169f5adc1e394934ebb473e356239413a17962bc3e5d3762d72cce8c2", - "0xa157ba9169c9e3e6748d9f1dd67fbe08b9114ade4c5d8fc475f87a764fb7e6f1d21f66d7905cd730f28a1c2d8378682a", - "0x913e52b5c93989b5d15e0d91aa0f19f78d592bc28bcfdfddc885a9980c732b1f4debb8166a7c4083c42aeda93a702898", - "0x90fbfc1567e7cd4e096a38433704d3f96a2de2f6ed3371515ccc30bc4dd0721a704487d25a97f3c3d7e4344472702d8d", - "0x89646043028ffee4b69d346907586fd12c2c0730f024acb1481abea478e61031966e72072ff1d5e65cb8c64a69ad4eb1", - "0xb125a45e86117ee11d2fb42f680ab4a7894edd67ff927ae2c808920c66c3e55f6a9d4588eee906f33a05d592e5ec3c04", - "0xaad47f5b41eae9be55fb4f67674ff1e4ae2482897676f964a4d2dcb6982252ee4ff56aac49578b23f72d1fced707525e", - "0xb9ddff8986145e33851b4de54d3e81faa3352e8385895f357734085a1616ef61c692d925fe62a5ed3be8ca49f5d66306", - "0xb3cb0963387ed28c0c0adf7fe645f02606e6e1780a24d6cecef5b7c642499109974c81a7c2a198b19862eedcea2c2d8c", - "0xac9c53c885457aaf5cb36c717a6f4077af701e0098eebd7aa600f5e4b14e6c1067255b3a0bc40e4a552025231be7de60", - "0x8e1a8d823c4603f6648ec21d064101094f2a762a4ed37dd2f0a2d9aa97b2d850ce1e76f4a4b8cae58819b058180f7031", - "0xb268b73bf7a179b6d22bd37e5e8cb514e9f5f8968c78e14e4f6d5700ca0d0ca5081d0344bb73b028970eebde3cb4124e", - "0xa7f57d71940f0edbd29ed8473d0149cae71d921dd15d1ff589774003e816b54b24de2620871108cec1ab9fa956ad6ce6", - "0x8053e6416c8b120e2b999cc2fc420a6a55094c61ac7f2a6c6f0a2c108a320890e389af96cbe378936132363c0d551277", - "0xb3823f4511125e5aa0f4269e991b435a0d6ceb523ebd91c04d7add5534e3df5fc951c504b4fd412a309fd3726b7f940b", - "0xae6eb04674d04e982ca9a6add30370ab90e303c71486f43ed3efbe431af1b0e43e9d06c11c3412651f304c473e7dbf39", - "0x96ab55e641ed2e677591f7379a3cd126449614181fce403e93e89b1645d82c4af524381ff986cae7f9cebe676878646d", - "0xb52423b4a8c37d3c3e2eca8f0ddbf7abe0938855f33a0af50f117fab26415fb0a3da5405908ec5fdc22a2c1f2ca64892", - "0x82a69ce1ee92a09cc709d0e3cd22116c9f69d28ea507fe5901f5676000b5179b9abe4c1875d052b0dd42d39925e186bb", - "0xa84c8cb84b9d5cfb69a5414f0a5283a5f2e90739e9362a1e8c784b96381b59ac6c18723a4aa45988ee8ef5c1f45cc97d", - "0xafd7efce6b36813082eb98257aae22a4c1ae97d51cac7ea9c852d4a66d05ef2732116137d8432e3f117119725a817d24", - "0xa0f5fe25af3ce021b706fcff05f3d825384a272284d04735574ce5fb256bf27100fad0b1f1ba0e54ae9dcbb9570ecad3", - "0x8751786cb80e2e1ff819fc7fa31c2833d25086534eb12b373d31f826382430acfd87023d2a688c65b5e983927e146336", - "0x8cf5c4b17fa4f3d35c78ce41e1dc86988fd1135cd5e6b2bb0c108ee13538d0d09ae7102609c6070f39f937b439b31e33", - "0xa9108967a2fedd7c322711eca8159c533dd561bedcb181b646de98bf5c3079449478eab579731bee8d215ae8852c7e21", - "0xb54c5171704f42a6f0f4e70767cdb3d96ffc4888c842eece343a01557da405961d53ffdc34d2f902ea25d3e1ed867cad", - "0xae8d4b764a7a25330ba205bf77e9f46182cd60f94a336bbd96773cf8064e3d39caf04c310680943dc89ed1fbad2c6e0d", - "0xaa5150e911a8e1346868e1b71c5a01e2a4bb8632c195861fb6c3038a0e9b85f0e09b3822e9283654a4d7bb17db2fc5f4", - "0x9685d3756ce9069bf8bb716cf7d5063ebfafe37e15b137fc8c3159633c4e006ff4887ddd0ae90360767a25c3f90cba7f", - "0x82155fd70f107ab3c8e414eadf226c797e07b65911508c76c554445422325e71af8c9a8e77fd52d94412a6fc29417cd3", - "0xabfae52f53a4b6e00760468d973a267f29321997c3dbb5aee36dc1f20619551229c0c45b9d9749f410e7f531b73378e8", - "0x81a76d921f8ef88e774fd985e786a4a330d779b93fad7def718c014685ca0247379e2e2a007ad63ee7f729cd9ed6ce1b", - "0x81947c84bc5e28e26e2e533af5ae8fe10407a7b77436dbf8f1d5b0bbe86fc659eae10f974659dc7c826c6dabd03e3a4b", - "0x92b8c07050d635b8dd4fd09df9054efe4edae6b86a63c292e73cc819a12a21dd7d104ce51fa56af6539dedf6dbe6f7b6", - "0xb44c579e3881f32b32d20c82c207307eca08e44995dd2aac3b2692d2c8eb2a325626c80ac81c26eeb38c4137ff95add5", - "0x97efab8941c90c30860926dea69a841f2dcd02980bf5413b9fd78d85904588bf0c1021798dbc16c8bbb32cce66c82621", - "0x913363012528b50698e904de0588bf55c8ec5cf6f0367cfd42095c4468fcc64954fbf784508073e542fee242d0743867", - "0x8ed203cf215148296454012bd10fddaf119203db1919a7b3d2cdc9f80e66729464fdfae42f1f2fc5af1ed53a42b40024", - "0xab84312db7b87d711e9a60824f4fe50e7a6190bf92e1628688dfcb38930fe87b2d53f9e14dd4de509b2216856d8d9188", - "0x880726def069c160278b12d2258eac8fa63f729cd351a710d28b7e601c6712903c3ac1e7bbd0d21e4a15f13ca49db5aa", - "0x980699cd51bac6283959765f5174e543ed1e5f5584b5127980cbc2ef18d984ecabba45042c6773b447b8e694db066028", - "0xaeb019cb80dc4cb4207430d0f2cd24c9888998b6f21d9bf286cc638449668d2eec0018a4cf3fe6448673cd6729335e2b", - "0xb29852f6aa6c60effdffe96ae88590c88abae732561d35cc19e82d3a51e26cb35ea00986193e07f90060756240f5346e", - "0xa0fa855adc5ba469f35800c48414b8921455950a5c0a49945d1ef6e8f2a1881f2e2dfae47de6417270a6bf49deeb091d", - "0xb6c7332e3b14813641e7272d4f69ecc7e09081df0037d6dab97ce13a9e58510f5c930d300633f208181d9205c5534001", - "0x85a6c050f42fce560b5a8d54a11c3bbb8407abbadd859647a7b0c21c4b579ec65671098b74f10a16245dc779dff7838e", - "0x8f3eb34bb68759d53c6677de4de78a6c24dd32c8962a7fb355ed362572ef8253733e6b52bc21c9f92ecd875020a9b8de", - "0xa17dd44181e5dab4dbc128e1af93ec22624b57a448ca65d2d9e246797e4af7d079e09c6e0dfb62db3a9957ce92f098d5", - "0xa56a1b854c3183082543a8685bb34cae1289f86cfa8123a579049dbd059e77982886bfeb61bf6e05b4b1fe4e620932e7", - "0xaedae3033cb2fb7628cb4803435bdd7757370a86f808ae4cecb9a268ad0e875f308c048c80cbcac523de16b609683887", - "0x9344905376aa3982b1179497fac5a1d74b14b7038fd15e3b002db4c11c8bfc7c39430db492cdaf58b9c47996c9901f28", - "0xa3bfafdae011a19f030c749c3b071f83580dee97dd6f949e790366f95618ca9f828f1daaeabad6dcd664fcef81b6556d", - "0x81c03d8429129e7e04434dee2c529194ddb01b414feda3adee2271eb680f6c85ec872a55c9fa9d2096f517e13ed5abcc", - "0x98205ef3a72dff54c5a9c82d293c3e45d908946fa74bb749c3aabe1ab994ea93c269bcce1a266d2fe67a8f02133c5985", - "0x85a70aeed09fda24412fadbafbbbf5ba1e00ac92885df329e147bfafa97b57629a3582115b780d8549d07d19b7867715", - "0xb0fbe81c719f89a57d9ea3397705f898175808c5f75f8eb81c2193a0b555869ba7bd2e6bc54ee8a60cea11735e21c68c", - "0xb03a0bd160495ee626ff3a5c7d95bc79d7da7e5a96f6d10116600c8fa20bedd1132f5170f25a22371a34a2d763f2d6d0", - "0xa90ab04091fbca9f433b885e6c1d60ab45f6f1daf4b35ec22b09909d493a6aab65ce41a6f30c98239cbca27022f61a8b", - "0xb66f92aa3bf2549f9b60b86f99a0bd19cbdd97036d4ae71ca4b83d669607f275260a497208f6476cde1931d9712c2402", - "0xb08e1fdf20e6a9b0b4942f14fa339551c3175c1ffc5d0ab5b226b6e6a322e9eb0ba96adc5c8d59ca4259e2bdd04a7eb0", - "0xa2812231e92c1ce74d4f5ac3ab6698520288db6a38398bb38a914ac9326519580af17ae3e27cde26607e698294022c81", - "0xabfcbbcf1d3b9e84c02499003e490a1d5d9a2841a9e50c7babbef0b2dd20d7483371d4dc629ba07faf46db659459d296", - "0xb0fe9f98c3da70927c23f2975a9dc4789194d81932d2ad0f3b00843dd9cbd7fb60747a1da8fe5a79f136a601becf279d", - "0xb130a6dba7645165348cb90f023713bed0eefbd90a976b313521c60a36d34f02032e69a2bdcf5361e343ed46911297ec", - "0x862f0cffe3020cea7a5fd4703353aa1eb1be335e3b712b29d079ff9f7090d1d8b12013011e1bdcbaa80c44641fd37c9f", - "0x8c6f11123b26633e1abb9ed857e0bce845b2b3df91cc7b013b2fc77b477eee445da0285fc6fc793e29d5912977f40916", - "0x91381846126ea819d40f84d3005e9fb233dc80071d1f9bb07f102bf015f813f61e5884ffffb4f5cd333c1b1e38a05a58", - "0x8add7d908de6e1775adbd39c29a391f06692b936518db1f8fde74eb4f533fc510673a59afb86e3a9b52ade96e3004c57", - "0x8780e086a244a092206edcde625cafb87c9ab1f89cc3e0d378bc9ee776313836160960a82ec397bc3800c0a0ec3da283", - "0xa6cb4cd9481e22870fdd757fae0785edf4635e7aacb18072fe8dc5876d0bab53fb99ce40964a7d3e8bcfff6f0ab1332f", - "0xaf30ff47ecc5b543efba1ba4706921066ca8bb625f40e530fb668aea0551c7647a9d126e8aba282fbcce168c3e7e0130", - "0x91b0bcf408ce3c11555dcb80c4410b5bc2386d3c05caec0b653352377efdcb6bab4827f2018671fc8e4a0e90d772acc1", - "0xa9430b975ef138b6b2944c7baded8fe102d31da4cfe3bd3d8778bda79189c99d38176a19c848a19e2d1ee0bddd9a13c1", - "0xaa5a4eef849d7c9d2f4b018bd01271c1dd83f771de860c4261f385d3bdcc130218495860a1de298f14b703ec32fa235f", - "0xb0ce79e7f9ae57abe4ff366146c3b9bfb38b0dee09c28c28f5981a5d234c6810ad4d582751948affb480d6ae1c8c31c4", - "0xb75122748560f73d15c01a8907d36d06dc068e82ce22b84b322ac1f727034493572f7907dec34ebc3ddcc976f2f89ed7", - "0xb0fc7836369a3e4411d34792d6bd5617c14f61d9bba023dda64e89dc5fb0f423244e9b48ee64869258931daa9753a56f", - "0x8956d7455ae9009d70c6e4a0bcd7610e55f37494cf9897a8f9e1b904cc8febc3fd2d642ebd09025cfff4609ad7e3bc52", - "0xad741efe9e472026aa49ae3d9914cb9c1a6f37a54f1a6fe6419bebd8c7d68dca105a751c7859f4389505ede40a0de786", - "0xb52f418797d719f0d0d0ffb0846788b5cba5d0454a69a2925de4b0b80fa4dd7e8c445e5eac40afd92897ed28ca650566", - "0xa0ab65fb9d42dd966cd93b1de01d7c822694669dd2b7a0c04d99cd0f3c3de795f387b9c92da11353412f33af5c950e9a", - "0xa0052f44a31e5741a331f7cac515a08b3325666d388880162d9a7b97598fde8b61f9ff35ff220df224eb5c4e40ef0567", - "0xa0101cfdc94e42b2b976c0d89612a720e55d145a5ef6ef6f1f78cf6de084a49973d9b5d45915349c34ce712512191e3c", - "0xa0dd99fcf3f5cead5aaf08e82212df3a8bb543c407a4d6fab88dc5130c1769df3f147e934a46f291d6c1a55d92b86917", - "0xa5939153f0d1931bbda5cf6bdf20562519ea55fbfa978d6dbc6828d298260c0da7a50c37c34f386e59431301a96c2232", - "0x9568269f3f5257200f9ca44afe1174a5d3cf92950a7f553e50e279c239e156a9faaa2a67f288e3d5100b4142efe64856", - "0xb746b0832866c23288e07f24991bbf687cad794e7b794d3d3b79367566ca617d38af586cdc8d6f4a85a34835be41d54f", - "0xa871ce28e39ab467706e32fec1669fda5a4abba2f8c209c6745df9f7a0fa36bbf1919cf14cb89ea26fa214c4c907ae03", - "0xa08dacdd758e523cb8484f6bd070642c0c20e184abdf8e2a601f61507e93952d5b8b0c723c34fcbdd70a8485eec29db2", - "0x85bdb78d501382bb95f1166b8d032941005661aefd17a5ac32df9a3a18e9df2fc5dc2c1f07075f9641af10353cecc0c9", - "0x98d730c28f6fa692a389e97e368b58f4d95382fad8f0baa58e71a3d7baaea1988ead47b13742ce587456f083636fa98e", - "0xa557198c6f3d5382be9fb363feb02e2e243b0c3c61337b3f1801c4a0943f18e38ce1a1c36b5c289c8fa2aa9d58742bab", - "0x89174f79201742220ac689c403fc7b243eed4f8e3f2f8aba0bf183e6f5d4907cb55ade3e238e3623d9885f03155c4d2b", - "0xb891d600132a86709e06f3381158db300975f73ea4c1f7c100358e14e98c5fbe792a9af666b85c4e402707c3f2db321e", - "0xb9e5b2529ef1043278c939373fc0dbafe446def52ddd0a8edecd3e4b736de87e63e187df853c54c28d865de18a358bb6", - "0x8589b2e9770340c64679062c5badb7bbef68f55476289b19511a158a9a721f197da03ece3309e059fc4468b15ac33aa3", - "0xaad8c6cd01d785a881b446f06f1e9cd71bca74ba98674c2dcddc8af01c40aa7a6d469037498b5602e76e9c91a58d3dbd", - "0xabaccb1bd918a8465f1bf8dbe2c9ad4775c620b055550b949a399f30cf0d9eb909f3851f5b55e38f9e461e762f88f499", - "0xae62339d26db46e85f157c0151bd29916d5cc619bd4b832814b3fd2f00af8f38e7f0f09932ffe5bba692005dab2d9a74", - "0x93a6ff30a5c0edf8058c89aba8c3259e0f1b1be1b80e67682de651e5346f7e1b4b4ac3d87cbaebf198cf779524aff6bf", - "0x8980a2b1d8f574af45b459193c952400b10a86122b71fca2acb75ee0dbd492e7e1ef5b959baf609a5172115e371f3177", - "0x8c2f49f3666faee6940c75e8c7f6f8edc3f704cca7a858bbb7ee5e96bba3b0cf0993996f781ba6be3b0821ef4cb75039", - "0xb14b9e348215b278696018330f63c38db100b0542cfc5be11dc33046e3bca6a13034c4ae40d9cef9ea8b34fef0910c4e", - "0xb59bc3d0a30d66c16e6a411cb641f348cb1135186d5f69fda8b0a0934a5a2e7f6199095ba319ec87d3fe8f1ec4a06368", - "0x8874aca2a3767aa198e4c3fec2d9c62d496bc41ff71ce242e9e082b7f38cdf356089295f80a301a3cf1182bde5308c97", - "0xb1820ebd61376d91232423fc20bf008b2ba37e761199f4ef0648ea2bd70282766799b4de814846d2f4d516d525c8daa7", - "0xa6b202e5dedc16a4073e04a11af3a8509b23dfe5a1952f899adeb240e75c3f5bde0c424f811a81ea48d343591faffe46", - "0xa69becee9c93734805523b92150a59a62eed4934f66056b645728740d42223f2925a1ad38359ba644da24d9414f4cdda", - "0xad72f0f1305e37c7e6b48c272323ee883320994cb2e0d850905d6655fafc9f361389bcb9c66b3ff8d2051dbb58c8aa96", - "0xb563600bd56fad7c8853af21c6a02a16ed9d8a8bbeea2c31731d63b976d83cb05b9779372d898233e8fd597a75424797", - "0xb0abb78ce465bf7051f563c62e8be9c57a2cc997f47c82819300f36e301fefd908894bb2053a9d27ce2d0f8c46d88b5b", - "0xa071a85fb8274bac2202e0cb8e0e2028a5e138a82d6e0374d39ca1884a549c7c401312f00071b91f455c3a2afcfe0cda", - "0xb931c271513a0f267b9f41444a5650b1918100b8f1a64959c552aff4e2193cc1b9927906c6fa7b8a8c68ef13d79aaa52", - "0xa6a1bb9c7d32cb0ca44d8b75af7e40479fbce67d216b48a2bb680d3f3a772003a49d3cd675fc64e9e0f8fabeb86d6d61", - "0xb98d609858671543e1c3b8564162ad828808bb50ded261a9f8690ded5b665ed8368c58f947365ed6e84e5a12e27b423d", - "0xb3dca58cd69ec855e2701a1d66cad86717ff103ef862c490399c771ad28f675680f9500cb97be48de34bcdc1e4503ffd", - "0xb34867c6735d3c49865e246ddf6c3b33baf8e6f164db3406a64ebce4768cb46b0309635e11be985fee09ab7a31d81402", - "0xacb966c554188c5b266624208f31fab250b3aa197adbdd14aee5ab27d7fb886eb4350985c553b20fdf66d5d332bfd3fe", - "0x943c36a18223d6c870d54c3b051ef08d802b85e9dd6de37a51c932f90191890656c06adfa883c87b906557ae32d09da0", - "0x81bca7954d0b9b6c3d4528aadf83e4bc2ef9ea143d6209bc45ae9e7ae9787dbcd8333c41f12c0b6deee8dcb6805e826a", - "0xaba176b92256efb68f574e543479e5cf0376889fb48e3db4ebfb7cba91e4d9bcf19dcfec444c6622d9398f06de29e2b9", - "0xb9f743691448053216f6ece7cd699871fff4217a1409ceb8ab7bdf3312d11696d62c74b0664ba0a631b1e0237a8a0361", - "0xa383c2b6276fa9af346b21609326b53fb14fdf6f61676683076e80f375b603645f2051985706d0401e6fbed7eb0666b6", - "0xa9ef2f63ec6d9beb8f3d04e36807d84bda87bdd6b351a3e4a9bf7edcb5618c46c1f58cfbf89e64b40f550915c6988447", - "0xa141b2d7a82f5005eaea7ae7d112c6788b9b95121e5b70b7168d971812f3381de8b0082ac1f0a82c7d365922ebd2d26a", - "0xb1b76ef8120e66e1535c17038b75255a07849935d3128e3e99e56567b842fb1e8d56ef932d508d2fb18b82f7868fe1a9", - "0x8e2e234684c81f21099f5c54f6bbe2dd01e3b172623836c77668a0c49ce1fe218786c3827e4d9ae2ea25c50a8924fb3c", - "0xa5caf5ff948bfd3c4ca3ffbdfcd91eec83214a6c6017235f309a0bbf7061d3b0b466307c00b44a1009cf575163898b43", - "0x986415a82ca16ebb107b4c50b0c023c28714281db0bcdab589f6cb13d80e473a3034b7081b3c358e725833f6d845cb14", - "0xb94836bf406ac2cbacb10e6df5bcdfcc9d9124ae1062767ca4e322d287fd5e353fdcebd0e52407cb3cd68571258a8900", - "0x83c6d70a640b33087454a4788dfd9ef3ed00272da084a8d36be817296f71c086b23b576f98178ab8ca6a74f04524b46b", - "0xad4115182ad784cfe11bcfc5ce21fd56229cc2ce77ac82746e91a2f0aa53ca6593a22efd2dc4ed8d00f84542643d9c58", - "0xab1434c5e5065da826d10c2a2dba0facccab0e52b506ce0ce42fbe47ced5a741797151d9ecc99dc7d6373cfa1779bbf6", - "0x8a8b591d82358d55e6938f67ea87a89097ab5f5496f7260adb9f649abb289da12b498c5b2539c2f9614fb4e21b1f66b0", - "0x964f355d603264bc1f44c64d6d64debca66f37dff39c971d9fc924f2bc68e6c187b48564a6dc82660a98b035f8addb5d", - "0xb66235eaaf47456bc1dc4bde454a028e2ce494ece6b713a94cd6bf27cf18c717fd0c57a5681caaa2ad73a473593cdd7a", - "0x9103e3bb74304186fa4e3e355a02da77da4aca9b7e702982fc2082af67127ebb23a455098313c88465bc9b7d26820dd5", - "0xb6a42ff407c9dd132670cdb83cbad4b20871716e44133b59a932cd1c3f97c7ac8ff7f61acfaf8628372508d8dc8cad7c", - "0x883a9c21c16a167a4171b0f084565c13b6f28ba7c4977a0de69f0a25911f64099e7bbb4da8858f2e93068f4155d04e18", - "0x8dbb3220abc6a43220adf0331e3903d3bfd1d5213aadfbd8dfcdf4b2864ce2e96a71f35ecfb7a07c3bbabf0372b50271", - "0xb4ad08aee48e176bda390b7d9acf2f8d5eb008f30d20994707b757dc6a3974b2902d29cd9b4d85e032810ad25ac49e97", - "0x865bb0f33f7636ec501bb634e5b65751c8a230ae1fa807a961a8289bbf9c7fe8c59e01fbc4c04f8d59b7f539cf79ddd5", - "0x86a54d4c12ad1e3605b9f93d4a37082fd26e888d2329847d89afa7802e815f33f38185c5b7292293d788ad7d7da1df97", - "0xb26c8615c5e47691c9ff3deca3021714662d236c4d8401c5d27b50152ce7e566266b9d512d14eb63e65bc1d38a16f914", - "0x827639d5ce7db43ba40152c8a0eaad443af21dc92636cc8cc2b35f10647da7d475a1e408901cd220552fddad79db74df", - "0xa2b79a582191a85dbe22dc384c9ca3de345e69f6aa370aa6d3ff1e1c3de513e30b72df9555b15a46586bd27ea2854d9d", - "0xae0d74644aba9a49521d3e9553813bcb9e18f0b43515e4c74366e503c52f47236be92dfbd99c7285b3248c267b1de5a0", - "0x80fb0c116e0fd6822a04b9c25f456bdca704e2be7bdc5d141dbf5d1c5eeb0a2c4f5d80db583b03ef3e47517e4f9a1b10", - "0xac3a1fa3b4a2f30ea7e0a114cdc479eb51773573804c2a158d603ad9902ae8e39ffe95df09c0d871725a5d7f9ba71a57", - "0xb56b2b0d601cba7f817fa76102c68c2e518c6f20ff693aad3ff2e07d6c4c76203753f7f91686b1801e8c4659e4d45c48", - "0x89d50c1fc56e656fb9d3915964ebce703cb723fe411ab3c9eaa88ccc5d2b155a9b2e515363d9c600d3c0cee782c43f41", - "0xb24207e61462f6230f3cd8ccf6828357d03e725769f7d1de35099ef9ee4dca57dbce699bb49ed994462bee17059d25ce", - "0xb886f17fcbcbfcd08ac07f04bb9543ef58510189decaccea4b4158c9174a067cb67d14b6be3c934e6e2a18c77efa9c9c", - "0xb9c050ad9cafd41c6e2e192b70d080076eed59ed38ea19a12bd92fa17b5d8947d58d5546aaf5e8e27e1d3b5481a6ce51", - "0xaaf7a34d3267e3b1ddbc54c641e3922e89303f7c86ebebc7347ebca4cffad5b76117dac0cbae1a133053492799cd936f", - "0xa9ee604ada50adef82e29e893070649d2d4b7136cc24fa20e281ce1a07bd736bf0de7c420369676bcbcecff26fb6e900", - "0x9855315a12a4b4cf80ab90b8bd13003223ba25206e52fd4fe6a409232fbed938f30120a3db23eab9c53f308bd8b9db81", - "0x8cd488dd7a24f548a3cf03c54dec7ff61d0685cb0f6e5c46c2d728e3500d8c7bd6bba0156f4bf600466fda53e5b20444", - "0x890ad4942ebac8f5b16c777701ab80c68f56fa542002b0786f8fea0fb073154369920ac3dbfc07ea598b82f4985b8ced", - "0x8de0cf9ddc84c9b92c59b9b044387597799246b30b9f4d7626fc12c51f6e423e08ee4cbfe9289984983c1f9521c3e19d", - "0xb474dfb5b5f4231d7775b3c3a8744956b3f0c7a871d835d7e4fd9cc895222c7b868d6c6ce250de568a65851151fac860", - "0x86433b6135d9ed9b5ee8cb7a6c40e5c9d30a68774cec04988117302b8a02a11a71a1e03fd8e0264ef6611d219f103007", - "0x80b9ed4adbe9538fb1ef69dd44ec0ec5b57cbfea820054d8d445b4261962624b4c70ac330480594bc5168184378379c3", - "0x8b2e83562ccd23b7ad2d17f55b1ab7ef5fbef64b3a284e6725b800f3222b8bdf49937f4a873917ada9c4ddfb090938c2", - "0xabe78cebc0f5a45d754140d1f685e387489acbfa46d297a8592aaa0d676a470654f417a4f7d666fc0b2508fab37d908e", - "0xa9c5f8ff1f8568e252b06d10e1558326db9901840e6b3c26bbd0cd5e850cb5fb3af3f117dbb0f282740276f6fd84126f", - "0x975f8dc4fb55032a5df3b42b96c8c0ffecb75456f01d4aef66f973cb7270d4eff32c71520ceefc1adcf38d77b6b80c67", - "0xb043306ed2c3d8a5b9a056565afd8b5e354c8c4569fda66b0d797a50a3ce2c08cffbae9bbe292da69f39e89d5dc7911e", - "0x8d2afc36b1e44386ba350c14a6c1bb31ff6ea77128a0c5287584ac3584282d18516901ce402b4644a53db1ed8e7fa581", - "0x8c294058bed53d7290325c363fe243f6ec4f4ea2343692f4bac8f0cb86f115c069ccb8334b53d2e42c067691ad110dba", - "0xb92157b926751aaf7ef82c1aa8c654907dccab6376187ee8b3e8c0c82811eae01242832de953faa13ebaff7da8698b3e", - "0xa780c4bdd9e4ba57254b09d745075cecab87feda78c88ffee489625c5a3cf96aa6b3c9503a374a37927d9b78de9bd22b", - "0x811f548ef3a2e6a654f7dcb28ac9378de9515ed61e5a428515d9594a83e80b35c60f96a5cf743e6fab0d3cb526149f49", - "0x85a4dccf6d90ee8e094731eec53bd00b3887aec6bd81a0740efddf812fd35e3e4fe4f983afb49a8588691c202dabf942", - "0xb152c2da6f2e01c8913079ae2b40a09b1f361a80f5408a0237a8131b429677c3157295e11b365b1b1841924b9efb922e", - "0x849b9efee8742502ffd981c4517c88ed33e4dd518a330802caff168abae3cd09956a5ee5eda15900243bc2e829016b74", - "0x955a933f3c18ec0f1c0e38fa931e4427a5372c46a3906ebe95082bcf878c35246523c23f0266644ace1fa590ffa6d119", - "0x911989e9f43e580c886656377c6f856cdd4ff1bd001b6db3bbd86e590a821d34a5c6688a29b8d90f28680e9fdf03ba69", - "0xb73b8b4f1fd6049fb68d47cd96a18fcba3f716e0a1061aa5a2596302795354e0c39dea04d91d232aec86b0bf2ba10522", - "0x90f87456d9156e6a1f029a833bf3c7dbed98ca2f2f147a8564922c25ae197a55f7ea9b2ee1f81bf7383197c4bad2e20c", - "0x903cba8b1e088574cb04a05ca1899ab00d8960580c884bd3c8a4c98d680c2ad11410f2b75739d6050f91d7208cac33a5", - "0x9329987d42529c261bd15ecedd360be0ea8966e7838f32896522c965adfc4febf187db392bd441fb43bbd10c38fdf68b", - "0x8178ee93acf5353baa349285067b20e9bb41aa32d77b5aeb7384fe5220c1fe64a2461bd7a83142694fe673e8bbf61b7c", - "0xa06a8e53abcff271b1394bcc647440f81fb1c1a5f29c27a226e08f961c3353f4891620f2d59b9d1902bf2f5cc07a4553", - "0xaaf5fe493b337810889e777980e6bbea6cac39ac66bc0875c680c4208807ac866e9fda9b5952aa1d04539b9f4a4bec57", - "0xaa058abb1953eceac14ccfa7c0cc482a146e1232905dcecc86dd27f75575285f06bbae16a8c9fe8e35d8713717f5f19f", - "0x8f15dd732799c879ca46d2763453b359ff483ca33adb1d0e0a57262352e0476c235987dc3a8a243c74bc768f93d3014c", - "0xa61cc8263e9bc03cce985f1663b8a72928a607121005a301b28a278e9654727fd1b22bc8a949af73929c56d9d3d4a273", - "0x98d6dc78502d19eb9f921225475a6ebcc7b44f01a2df6f55ccf6908d65b27af1891be2a37735f0315b6e0f1576c1f8d8", - "0x8bd258b883f3b3793ec5be9472ad1ff3dc4b51bc5a58e9f944acfb927349ead8231a523cc2175c1f98e7e1e2b9f363b8", - "0xaeacc2ecb6e807ad09bedd99654b097a6f39840e932873ace02eabd64ccfbb475abdcb62939a698abf17572d2034c51e", - "0xb8ccf78c08ccd8df59fd6eda2e01de328bc6d8a65824d6f1fc0537654e9bc6bf6f89c422dd3a295cce628749da85c864", - "0x8f91fd8cb253ba2e71cc6f13da5e05f62c2c3b485c24f5d68397d04665673167fce1fc1aec6085c69e87e66ec555d3fd", - "0xa254baa10cb26d04136886073bb4c159af8a8532e3fd36b1e9c3a2e41b5b2b6a86c4ebc14dbe624ee07b7ccdaf59f9ab", - "0x94e3286fe5cd68c4c7b9a7d33ae3d714a7f265cf77cd0e9bc19fc51015b1d1c34ad7e3a5221c459e89f5a043ee84e3a9", - "0xa279da8878af8d449a9539bec4b17cea94f0242911f66fab275b5143ab040825f78c89cb32a793930609415cfa3a1078", - "0xac846ceb89c9e5d43a2991c8443079dc32298cd63e370e64149cec98cf48a6351c09c856f2632fd2f2b3d685a18bbf8b", - "0xa847b27995c8a2e2454aaeb983879fb5d3a23105c33175839f7300b7e1e8ec3efd6450e9fa3f10323609dee7b98c6fd5", - "0xa2f432d147d904d185ff4b2de8c6b82fbea278a2956bc406855b44c18041854c4f0ecccd472d1d0dff1d8aa8e281cb1d", - "0x94a48ad40326f95bd63dff4755f863a1b79e1df771a1173b17937f9baba57b39e651e7695be9f66a472f098b339364fc", - "0xa12a0ccd8f96e96e1bc6494341f7ebce959899341b3a084aa1aa87d1c0d489ac908552b7770b887bb47e7b8cbc3d8e66", - "0x81a1f1681bda923bd274bfe0fbb9181d6d164fe738e54e25e8d4849193d311e2c4253614ed673c98af2c798f19a93468", - "0xabf71106a05d501e84cc54610d349d7d5eae21a70bd0250f1bebbf412a130414d1c8dbe673ffdb80208fd72f1defa4d4", - "0x96266dc2e0df18d8136d79f5b59e489978eee0e6b04926687fe389d4293c14f36f055c550657a8e27be4118b64254901", - "0x8df5dcbefbfb4810ae3a413ca6b4bf08619ca53cd50eb1dde2a1c035efffc7b7ac7dff18d403253fd80104bd83dc029e", - "0x9610b87ff02e391a43324a7122736876d5b3af2a137d749c52f75d07b17f19900b151b7f439d564f4529e77aa057ad12", - "0xa90a5572198b40fe2fcf47c422274ff36c9624df7db7a89c0eb47eb48a73a03c985f4ac5016161c76ca317f64339bce1", - "0x98e5e61a6ab6462ba692124dba7794b6c6bde4249ab4fcc98c9edd631592d5bc2fb5e38466691a0970a38e48d87c2e43", - "0x918cefb8f292f78d4db81462c633daf73b395e772f47b3a7d2cea598025b1d8c3ec0cbff46cdb23597e74929981cde40", - "0xa98918a5dc7cf610fe55f725e4fd24ce581d594cb957bb9b4e888672e9c0137003e1041f83e3f1d7b9caab06462c87d4", - "0xb92b74ac015262ca66c33f2d950221e19d940ba3bf4cf17845f961dc1729ae227aa9e1f2017829f2135b489064565c29", - "0xa053ee339f359665feb178b4e7ee30a85df37debd17cacc5a27d6b3369d170b0114e67ad1712ed26d828f1df641bcd99", - "0x8c3c8bad510b35da5ce5bd84b35c958797fbea024ad1c97091d2ff71d9b962e9222f65a9b776e5b3cc29c36e1063d2ee", - "0xaf99dc7330fe7c37e850283eb47cc3257888e7c197cb0d102edf94439e1e02267b6a56306d246c326c4c79f9dc8c6986", - "0xafecb2dc34d57a725efbd7eb93d61eb29dbe8409b668ab9ea040791f5b796d9be6d4fc10d7f627bf693452f330cf0435", - "0x93334fedf19a3727a81a6b6f2459db859186227b96fe7a391263f69f1a0884e4235de64d29edebc7b99c44d19e7c7d7a", - "0x89579c51ac405ad7e9df13c904061670ce4b38372492764170e4d3d667ed52e5d15c7cd5c5991bbfa3a5e4e3fa16363e", - "0x9778f3e8639030f7ef1c344014f124e375acb8045bd13d8e97a92c5265c52de9d1ffebaa5bc3e1ad2719da0083222991", - "0x88f77f34ee92b3d36791bdf3326532524a67d544297dcf1a47ff00b47c1b8219ff11e34034eab7d23b507caa2fd3c6b9", - "0xa699c1e654e7c484431d81d90657892efeb4adcf72c43618e71ca7bd7c7a7ebbb1db7e06e75b75dc4c74efd306b5df3f", - "0x81d13153baebb2ef672b5bdb069d3cd669ce0be96b742c94e04038f689ff92a61376341366b286eee6bf3ae85156f694", - "0x81efb17de94400fdacc1deec2550cbe3eecb27c7af99d8207e2f9be397e26be24a40446d2a09536bb5172c28959318d9", - "0x989b21ebe9ceab02488992673dc071d4d5edec24bff0e17a4306c8cb4b3c83df53a2063d1827edd8ed16d6e837f0d222", - "0x8d6005d6536825661b13c5fdce177cb37c04e8b109b7eb2b6d82ea1cb70efecf6a0022b64f84d753d165edc2bba784a3", - "0xa32607360a71d5e34af2271211652d73d7756d393161f4cf0da000c2d66a84c6826e09e759bd787d4fd0305e2439d342", - "0xaaad8d6f6e260db45d51b2da723be6fa832e76f5fbcb77a9a31e7f090dd38446d3b631b96230d78208cae408c288ac4e", - "0xabcfe425255fd3c5cffd3a818af7650190c957b6b07b632443f9e33e970a8a4c3bf79ac9b71f4d45f238a04d1c049857", - "0xaeabf026d4c783adc4414b5923dbd0be4b039cc7201219f7260d321f55e9a5b166d7b5875af6129c034d0108fdc5d666", - "0xaf49e740c752d7b6f17048014851f437ffd17413c59797e5078eaaa36f73f0017c3e7da020310cfe7d3c85f94a99f203", - "0x8854ca600d842566e3090040cd66bb0b3c46dae6962a13946f0024c4a8aca447e2ccf6f240045f1ceee799a88cb9210c", - "0xb6c03b93b1ab1b88ded8edfa1b487a1ed8bdce8535244dddb558ffb78f89b1c74058f80f4db2320ad060d0c2a9c351cc", - "0xb5bd7d17372faff4898a7517009b61a7c8f6f0e7ed4192c555db264618e3f6e57fb30a472d169fea01bf2bf0362a19a8", - "0x96eb1d38319dc74afe7e7eb076fcd230d19983f645abd14a71e6103545c01301b31c47ae931e025f3ecc01fb3d2f31fa", - "0xb55a8d30d4403067def9b65e16f867299f8f64c9b391d0846d4780bc196569622e7e5b64ce799b5aefac8f965b2a7a7b", - "0x8356d199a991e5cbbff608752b6291731b6b6771aed292f8948b1f41c6543e4ab1bedc82dd26d10206c907c03508df06", - "0x97f4137445c2d98b0d1d478049de952610ad698c91c9d0f0e7227d2aae690e9935e914ec4a2ea1fbf3fc1dddfeeacebb", - "0xaf5621707e0938320b15ddfc87584ab325fbdfd85c30efea36f8f9bd0707d7ec12c344eff3ec21761189518d192df035", - "0x8ac7817e71ea0825b292687928e349da7140285d035e1e1abff0c3704fa8453faaae343a441b7143a74ec56539687cc4", - "0x8a5e0a9e4758449489df10f3386029ada828d1762e4fb0a8ffe6b79e5b6d5d713cb64ed95960e126398b0cdb89002bc9", - "0x81324be4a71208bbb9bca74b77177f8f1abb9d3d5d9db195d1854651f2cf333cd618d35400da0f060f3e1b025124e4b2", - "0x849971d9d095ae067525b3cbc4a7dfae81f739537ade6d6cec1b42fb692d923176197a8770907c58069754b8882822d6", - "0x89f830825416802477cc81fdf11084885865ee6607aa15aa4eb28e351c569c49b8a1b9b5e95ddc04fa0ebafe20071313", - "0x9240aeeaff37a91af55f860b9badd466e8243af9e8c96a7aa8cf348cd270685ab6301bc135b246dca9eda696f8b0e350", - "0xacf74db78cc33138273127599eba35b0fb4e7b9a69fe02dae18fc6692d748ca332bd00b22afa8e654ed587aab11833f3", - "0xb091e6d37b157b50d76bd297ad752220cd5c9390fac16dc838f8557aed6d9833fc920b61519df21265406216315e883f", - "0xa6446c429ebf1c7793c622250e23594c836b2fbcaf6c5b3d0995e1595a37f50ea643f3e549b0be8bbdadd69044d72ab9", - "0x93e675353bd60e996bf1c914d5267eeaa8a52fc3077987ccc796710ef9becc6b7a00e3d82671a6bdfb8145ee3c80245a", - "0xa2f731e43251d04ed3364aa2f072d05355f299626f2d71a8a38b6f76cf08c544133f7d72dd0ab4162814b674b9fc7fa6", - "0x97a8b791a5a8f6e1d0de192d78615d73d0c38f1e557e4e15d15adc663d649e655bc8da3bcc499ef70112eafe7fb45c7a", - "0x98cd624cbbd6c53a94469be4643c13130916b91143425bcb7d7028adbbfede38eff7a21092af43b12d4fab703c116359", - "0x995783ce38fd5f6f9433027f122d4cf1e1ff3caf2d196ce591877f4a544ce9113ead60de2de1827eaff4dd31a20d79a8", - "0x8cf251d6f5229183b7f3fe2f607a90b4e4b6f020fb4ba2459d28eb8872426e7be8761a93d5413640a661d73e34a5b81f", - "0xb9232d99620652a3aa7880cad0876f153ff881c4ed4c0c2e7b4ea81d5d42b70daf1a56b869d752c3743c6d4c947e6641", - "0x849716f938f9d37250cccb1bf77f5f9fde53096cdfc6f2a25536a6187029a8f1331cdbed08909184b201f8d9f04b792f", - "0x80c7c4de098cbf9c6d17b14eba1805e433b5bc905f6096f8f63d34b94734f2e4ebf4bce8a177efd1186842a61204a062", - "0xb790f410cf06b9b8daadceeb4fd5ff40a2deda820c8df2537e0a7554613ae3948e149504e3e79aa84889df50c8678eeb", - "0x813aab8bd000299cd37485b73cd7cba06e205f8efb87f1efc0bae8b70f6db2bc7702eb39510ad734854fb65515fe9d0f", - "0x94f0ab7388ac71cdb67f6b85dfd5945748afb2e5abb622f0b5ad104be1d4d0062b651f134ba22385c9e32c2dfdcccce1", - "0xab6223dca8bd6a4f969e21ccd9f8106fc5251d321f9e90cc42cea2424b3a9c4e5060a47eeef6b23c7976109b548498e8", - "0x859c56b71343fce4d5c5b87814c47bf55d581c50fd1871a17e77b5e1742f5af639d0e94d19d909ec7dfe27919e954e0c", - "0xaae0d632b6191b8ad71b027791735f1578e1b89890b6c22e37de0e4a6074886126988fe8319ae228ac9ef3b3bcccb730", - "0x8ca9f32a27a024c3d595ecfaf96b0461de57befa3b331ab71dc110ec3be5824fed783d9516597537683e77a11d334338", - "0xa061df379fb3f4b24816c9f6cd8a94ecb89b4c6dc6cd81e4b8096fa9784b7f97ab3540259d1de9c02eb91d9945af4823", - "0x998603102ac63001d63eb7347a4bb2bf4cf33b28079bb48a169076a65c20d511ccd3ef696d159e54cc8e772fb5d65d50", - "0x94444d96d39450872ac69e44088c252c71f46be8333a608a475147752dbb99db0e36acfc5198f158509401959c12b709", - "0xac1b51b6c09fe055c1d7c9176eea9adc33f710818c83a1fbfa073c8dc3a7eb3513cbdd3f5960b7845e31e3e83181e6ba", - "0x803d530523fc9e1e0f11040d2412d02baef3f07eeb9b177fa9bfa396af42eea898a4276d56e1db998dc96ae47b644cb2", - "0x85a3c9fc7638f5bf2c3e15ba8c2fa1ae87eb1ceb44c6598c67a2948667a9dfa41e61f66d535b4e7fda62f013a5a8b885", - "0xa961cf5654c46a1a22c29baf7a4e77837a26b7f138f410e9d1883480ed5fa42411d522aba32040b577046c11f007388e", - "0xad1154142344f494e3061ef45a34fab1aaacf5fdf7d1b26adbb5fbc3d795655fa743444e39d9a4119b4a4f82a6f30441", - "0xb1d6c30771130c77806e7ab893b73d4deb590b2ff8f2f8b5e54c2040c1f3e060e2bd99afc668cf706a2df666a508bbf6", - "0xa00361fd440f9decabd98d96c575cd251dc94c60611025095d1201ef2dedde51cb4de7c2ece47732e5ed9b3526c2012c", - "0xa85c5ab4d17d328bda5e6d839a9a6adcc92ff844ec25f84981e4f44a0e8419247c081530f8d9aa629c7eb4ca21affba6", - "0xa4ddd3eab4527a2672cf9463db38bc29f61460e2a162f426b7852b7a7645fbd62084fd39a8e4d60e1958cce436dd8f57", - "0x811648140080fe55b8618f4cf17f3c5a250adb0cd53d885f2ddba835d2b4433188e41fc0661faac88e4ff910b16278c0", - "0xb85c7f1cfb0ed29addccf7546023a79249e8f15ac2d14a20accbfef4dd9dc11355d599815fa09d2b6b4e966e6ea8cff1", - "0xa10b5d8c260b159043b020d5dd62b3467df2671afea6d480ca9087b7e60ed170c82b121819d088315902842d66c8fb45", - "0x917e191df1bcf3f5715419c1e2191da6b8680543b1ba41fe84ed07ef570376e072c081beb67b375fca3565a2565bcabb", - "0x881fd967407390bfd7badc9ab494e8a287559a01eb07861f527207c127eadea626e9bcc5aa9cca2c5112fbac3b3f0e9c", - "0x959fd71149af82cc733619e0e5bf71760ca2650448c82984b3db74030d0e10f8ab1ce1609a6de6f470fe8b5bd90df5b3", - "0xa3370898a1c5f33d15adb4238df9a6c945f18b9ada4ce2624fc32a844f9ece4c916a64e9442225b6592afa06d2e015f2", - "0x817efb8a791435e4236f7d7b278181a5fa34587578c629dbc14fbf9a5c26772290611395eecd20222a4c58649fc256d8", - "0xa04c9876acf2cfdc8ef96de4879742709270fa1d03fe4c8511fbef2d59eb0aaf0336fa2c7dfe41a651157377fa217813", - "0x81e15875d7ea7f123e418edf14099f2e109d4f3a6ce0eb65f67fe9fb10d2f809a864a29f60ad3fc949f89e2596b21783", - "0xb49f529975c09e436e6bc202fdc16e3fdcbe056db45178016ad6fdece9faad4446343e83aed096209690b21a6910724f", - "0x879e8eda589e1a279f7f49f6dd0580788c040d973748ec4942dbe51ea8fbd05983cc919b78f0c6b92ef3292ae29db875", - "0x81a2b74b2118923f34139a102f3d95e7eee11c4c2929c2576dee200a5abfd364606158535a6c9e4178a6a83dbb65f3c4", - "0x8913f281d8927f2b45fc815d0f7104631cb7f5f7278a316f1327d670d15868daadd2a64e3eb98e1f53fe7e300338cc80", - "0xa6f815fba7ef9af7fbf45f93bc952e8b351f5de6568a27c7c47a00cb39a254c6b31753794f67940fc7d2e9cc581529f4", - "0xb3722a15c66a0014ce4d082de118def8d39190c15678a472b846225585f3a83756ae1b255b2e3f86a26168878e4773b2", - "0x817ae61ab3d0dd5b6e24846b5a5364b1a7dc2e77432d9fed587727520ae2f307264ea0948c91ad29f0aea3a11ff38624", - "0xb3db467464415fcad36dc1de2d6ba7686772a577cc2619242ac040d6734881a45d3b40ed4588db124e4289cfeec4bbf6", - "0xad66a14f5a54ac69603b16e5f1529851183da77d3cc60867f10aea41339dd5e06a5257982e9e90a352cdd32750f42ee4", - "0xadafa3681ef45d685555601a25a55cf23358319a17f61e2179e704f63df83a73bdd298d12cf6cef86db89bd17119e11d", - "0xa379dc44cb6dd3b9d378c07b2ec654fec7ca2f272de6ba895e3d00d20c9e4c5550498a843c8ac67e4221db2115bedc1c", - "0xb7bf81c267a78efc6b9e5a904574445a6487678d7ef70054e3e93ea6a23f966c2b68787f9164918e3b16d2175459ed92", - "0xb41d66a13a4afafd5760062b77f79de7e6ab8ccacde9c6c5116a6d886912fb491dc027af435b1b44aacc6af7b3c887f2", - "0x9904d23a7c1c1d2e4bab85d69f283eb0a8e26d46e8b7b30224438015c936729b2f0af7c7c54c03509bb0500acb42d8a4", - "0xae30d65e9e20c3bfd603994ae2b175ff691d51f3e24b2d058b3b8556d12ca4c75087809062dddd4aaac81c94d15d8a17", - "0x9245162fab42ac01527424f6013310c3eb462982518debef6c127f46ba8a06c705d7dc9f0a41e796ba8d35d60ae6cc64", - "0x87fab853638d7a29a20f3ba2b1a7919d023e9415bfa78ebb27973d8cbc7626f584dc5665d2e7ad71f1d760eba9700d88", - "0x85aac46ecd330608e5272430970e6081ff02a571e8ea444f1e11785ea798769634a22a142d0237f67b75369d3c484a8a", - "0x938c85ab14894cc5dfce3d80456f189a2e98eddbc8828f4ff6b1df1dcb7b42b17ca2ff40226a8a1390a95d63dca698dd", - "0xa18ce1f846e3e3c4d846822f60271eecf0f5d7d9f986385ac53c5ace9589dc7c0188910448c19b91341a1ef556652fa9", - "0x8611608a9d844f0e9d7584ad6ccf62a5087a64f764caf108db648a776b5390feb51e5120f0ef0e9e11301af3987dd7dc", - "0x8106333ba4b4de8d1ae43bc9735d3fea047392e88efd6a2fa6f7b924a18a7a265ca6123c3edc0f36307dd7fb7fe89257", - "0xa91426fa500951ff1b051a248c050b7139ca30dde8768690432d597d2b3c4357b11a577be6b455a1c5d145264dcf81fc", - "0xb7f9f90e0e450f37b081297f7f651bad0496a8b9afd2a4cf4120a2671aaaa8536dce1af301258bfbfdb122afa44c5048", - "0x84126da6435699b0c09fa4032dec73d1fca21d2d19f5214e8b0bea43267e9a8dd1fc44f8132d8315e734c8e2e04d7291", - "0xaff064708103884cb4f1a3c1718b3fc40a238d35cf0a7dc24bdf9823693b407c70da50df585bf5bc4e9c07d1c2d203e8", - "0xa8b40fc6533752983a5329c31d376c7a5c13ce6879cc7faee648200075d9cd273537001fb4c86e8576350eaac6ba60c2", - "0xa02db682bdc117a84dcb9312eb28fcbde12d49f4ce915cc92c610bb6965ec3cc38290f8c5b5ec70afe153956692cda95", - "0x86decd22b25d300508472c9ce75d3e465b737e7ce13bc0fcce32835e54646fe12322ba5bc457be18bfd926a1a6ca4a38", - "0xa18666ef65b8c2904fd598791f5627207165315a85ee01d5fb0e6b2e10bdd9b00babc447da5bd63445e3337de33b9b89", - "0x89bb0c06effadefdaf34ffe4b123e1678a90d4451ee856c863df1e752eef41fd984689ded8f0f878bf8916d5dd8e8024", - "0x97cfcba08ebec05d0073992a66b1d7d6fb9d95871f2cdc36db301f78bf8069294d1c259efef5c93d20dc937eedae3a1a", - "0xac2643b14ece79dcb2e289c96776a47e2bebd40dd6dc74fd035df5bb727b5596f40e3dd2d2202141e69b0993717ede09", - "0xa5e6fd88a2f9174d9bd4c6a55d9c30974be414992f22aa852f552c7648f722ed8077acf5aba030abd47939bb451b2c60", - "0x8ad40a612824a7994487731a40b311b7349038c841145865539c6ada75c56de6ac547a1c23df190e0caaafecddd80ccc", - "0x953a7cea1d857e09202c438c6108060961f195f88c32f0e012236d7a4b39d840c61b162ec86436e8c38567328bea0246", - "0x80d8b47a46dae1868a7b8ccfe7029445bbe1009dad4a6c31f9ef081be32e8e1ac1178c3c8fb68d3e536c84990cc035b1", - "0x81ecd99f22b3766ce0aca08a0a9191793f68c754fdec78b82a4c3bdc2db122bbb9ebfd02fc2dcc6e1567a7d42d0cc16a", - "0xb1dd0446bccc25846fb95d08c1c9cc52fb51c72c4c5d169ffde56ecfe800f108dc1106d65d5c5bd1087c656de3940b63", - "0xb87547f0931e164e96de5c550ca5aa81273648fe34f6e193cd9d69cf729cb432e17aa02e25b1c27a8a0d20a3b795e94e", - "0x820a94e69a927e077082aae66f6b292cfbe4589d932edf9e68e268c9bd3d71ef76cf7d169dd445b93967c25db11f58f1", - "0xb0d07ddf2595270c39adfa0c8cf2ab1322979b0546aa4d918f641be53cd97f36c879bb75d205e457c011aca3bbd9f731", - "0x8700b876b35b4b10a8a9372c5230acecd39539c1bb87515640293ad4464a9e02929d7d6a6a11112e8a29564815ac0de4", - "0xa61a601c5bb27dcb97e37c8e2b9ce479c6b192a5e04d9ed5e065833c5a1017ee5f237b77d1a17be5d48f8e7cc0bcacf6", - "0x92fb88fe774c1ba1d4a08cae3c0e05467ad610e7a3f1d2423fd47751759235fe0a3036db4095bd6404716aa03820f484", - "0xb274f140d77a3ce0796f5e09094b516537ccaf27ae1907099bff172e6368ba85e7c3ef8ea2a07457cac48ae334da95b3", - "0xb2292d9181f16581a9a9142490b2bdcdfb218ca6315d1effc8592100d792eb89d5356996c890441f04f2b4a95763503e", - "0x8897e73f576d86bc354baa3bd96e553107c48cf5889dcc23c5ba68ab8bcd4e81f27767be2233fdfa13d39f885087e668", - "0xa29eac6f0829791c728d71abc49569df95a4446ecbfc534b39f24f56c88fe70301838dfc1c19751e7f3c5c1b8c6af6a0", - "0x9346dc3720adc5df500a8df27fd9c75ef38dc5c8f4e8ed66983304750e66d502c3c59b8e955be781b670a0afc70a2167", - "0x9566d534e0e30a5c5f1428665590617e95fd05d45f573715f58157854ad596ece3a3cfec61356aee342308d623e029d5", - "0xa464fb8bffe6bd65f71938c1715c6e296cc6d0311a83858e4e7eb5873b7f2cf0c584d2101e3407b85b64ca78b2ac93ce", - "0xb54088f7217987c87e9498a747569ac5b2f8afd5348f9c45bf3fd9fbf713a20f495f49c8572d087efe778ac7313ad6d3", - "0x91fa9f5f8000fe050f5b224d90b59fcce13c77e903cbf98ded752e5b3db16adb2bc1f8c94be48b69f65f1f1ad81d6264", - "0x92d04a5b0ac5d8c8e313709b432c9434ecd3e73231f01e9b4e7952b87df60cbfa97b5dedd2200bd033b4b9ea8ba45cc1", - "0xa94b90ad3c3d6c4bbe169f8661a790c40645b40f0a9d1c7220f01cf7fc176e04d80bab0ced9323fcafb93643f12b2760", - "0x94d86149b9c8443b46196f7e5a3738206dd6f3be7762df488bcbb9f9ee285a64c997ed875b7b16b26604fa59020a8199", - "0x82efe4ae2c50a2d7645240c173a047f238536598c04a2c0b69c96e96bd18e075a99110f1206bc213f39edca42ba00cc1", - "0xab8667685f831bc14d4610f84a5da27b4ea5b133b4d991741a9e64dceb22cb64a3ce8f1b6e101d52af6296df7127c9ad", - "0x83ba433661c05dcc5d562f4a9a261c8110dac44b8d833ae1514b1fc60d8b4ee395b18804baea04cb10adb428faf713c3", - "0xb5748f6f660cc5277f1211d2b8649493ed8a11085b871cd33a5aea630abd960a740f08c08be5f9c21574600ac9bf5737", - "0xa5c8dd12af48fb710642ad65ebb97ca489e8206741807f7acfc334f8035d3c80593b1ff2090c9bb7bd138f0c48714ca8", - "0xa2b382fd5744e3babf454b1d806cc8783efeb4761bc42b6914ea48a46a2eae835efbe0a18262b6bc034379e03cf1262b", - "0xb3145ffaf603f69f15a64936d32e3219eea5ed49fdfd2f5bf40ea0dfd974b36fb6ff12164d4c2282d892db4cf3ff3ce1", - "0x87a316fb213f4c5e30c5e3face049db66be4f28821bd96034714ec23d3e97849d7b301930f90a4323c7ccf53de23050c", - "0xb9de09a919455070fed6220fc179c8b7a4c753062bcd27acf28f5b9947a659c0b364298daf7c85c4ca6fca7f945add1f", - "0x806fbd98d411b76979464c40ad88bc07a151628a27fcc1012ba1dfbaf5b5cc9d962fb9b3386008978a12515edce934bc", - "0xa15268877fae0d21610ae6a31061ed7c20814723385955fac09fdc9693a94c33dea11db98bb89fdfe68f933490f5c381", - "0x8d633fb0c4da86b2e0b37d8fad5972d62bff2ac663c5ec815d095cd4b7e1fe66ebef2a2590995b57eaf941983c7ad7a4", - "0x8139e5dd9cf405e8ef65f11164f0440827d98389ce1b418b0c9628be983a9ddd6cf4863036ccb1483b40b8a527acd9ed", - "0x88b15fa94a08eac291d2b94a2b30eb851ff24addf2cc30b678e72e32cfcb3424cf4b33aa395d741803f3e578ddf524de", - "0xb5eaf0c8506e101f1646bcf049ee38d99ea1c60169730da893fd6020fd00a289eb2f415947e44677af49e43454a7b1be", - "0x8489822ad0647a7e06aa2aa5595960811858ddd4542acca419dd2308a8c5477648f4dd969a6740bb78aa26db9bfcc555", - "0xb1e9a7b9f3423c220330d45f69e45fa03d7671897cf077f913c252e3e99c7b1b1cf6d30caad65e4228d5d7b80eb86e5e", - "0xb28fe9629592b9e6a55a1406903be76250b1c50c65296c10c5e48c64b539fb08fe11f68cf462a6edcbba71b0cee3feb2", - "0xa41acf96a02c96cd8744ff6577c244fc923810d17ade133587e4c223beb7b4d99fa56eae311a500d7151979267d0895c", - "0x880798938fe4ba70721be90e666dfb62fcab4f3556fdb7b0dc8ec5bc34f6b4513df965eae78527136eb391889fe2caf9", - "0x98d4d89d358e0fb7e212498c73447d94a83c1b66e98fc81427ab13acddb17a20f52308983f3a5a8e0aaacec432359604", - "0x81430b6d2998fc78ba937a1639c6020199c52da499f68109da227882dc26d005b73d54c5bdcac1a04e8356a8ca0f7017", - "0xa8d906a4786455eb74613aba4ce1c963c60095ffb8658d368df9266fdd01e30269ce10bf984e7465f34b4fd83beba26a", - "0xaf54167ac1f954d10131d44a8e0045df00d581dd9e93596a28d157543fbe5fb25d213806ed7fb3cba6b8f5b5423562db", - "0x8511e373a978a12d81266b9afbd55035d7bc736835cfa921903a92969eeba3624437d1346b55382e61415726ab84a448", - "0x8cf43eea93508ae586fa9a0f1354a1e16af659782479c2040874a46317f9e8d572a23238efa318fdfb87cc63932602b7", - "0xb0bdd3bacff077173d302e3a9678d1d37936188c7ecc34950185af6b462b7c679815176f3cce5db19aac8b282f2d60ad", - "0xa355e9b87f2f2672052f5d4d65b8c1c827d24d89b0d8594641fccfb69aef1b94009105f3242058bb31c8bf51caae5a41", - "0xb8baa9e4b950b72ff6b88a6509e8ed1304bc6fd955748b2e59a523a1e0c5e99f52aec3da7fa9ff407a7adf259652466c", - "0x840bc3dbb300ea6f27d1d6dd861f15680bd098be5174f45d6b75b094d0635aced539fa03ddbccb453879de77fb5d1fe9", - "0xb4bc7e7e30686303856472bae07e581a0c0bfc815657c479f9f5931cff208d5c12930d2fd1ff413ebd8424bcd7a9b571", - "0x89b5d514155d7999408334a50822508b9d689add55d44a240ff2bdde2eee419d117031f85e924e2a2c1ca77db9b91eea", - "0xa8604b6196f87a04e1350302e8aa745bba8dc162115d22657b37a1d1a98cb14876ddf7f65840b5dbd77e80cd22b4256c", - "0x83cb7acdb9e03247515bb2ce0227486ccf803426717a14510f0d59d45e998b245797d356f10abca94f7a14e1a2f0d552", - "0xaeb3266a9f16649210ab2df0e1908ac259f34ce1f01162c22b56cf1019096ee4ea5854c36e30bb2feb06c21a71e8a45c", - "0x89e72e86edf2aa032a0fc9acf4d876a40865fbb2c8f87cb7e4d88856295c4ac14583e874142fd0c314a49aba68c0aa3c", - "0x8c3576eba0583c2a7884976b4ed11fe1fda4f6c32f6385d96c47b0e776afa287503b397fa516a455b4b8c3afeedc76db", - "0xa31e5b633bda9ffa174654fee98b5d5930a691c3c42fcf55673d927dbc8d91c58c4e42e615353145431baa646e8bbb30", - "0x89f2f3f7a8da1544f24682f41c68114a8f78c86bd36b066e27da13acb70f18d9f548773a16bd8e24789420e17183f137", - "0xada27fa4e90a086240c9164544d2528621a415a5497badb79f8019dc3dce4d12eb6b599597e47ec6ac39c81efda43520", - "0x90dc1eb21bf21c0187f359566fc4bf5386abea52799306a0e5a1151c0817c5f5bc60c86e76b1929c092c0f3ff48cedd2", - "0xb702a53ebcc17ae35d2e735a347d2c700e9cbef8eadbece33cac83df483b2054c126593e1f462cfc00a3ce9d737e2af5", - "0x9891b06455ec925a6f8eafffba05af6a38cc5e193acaaf74ffbf199df912c5197106c5e06d72942bbb032ce277b6417f", - "0x8c0ee71eb01197b019275bcf96cae94e81d2cdc3115dbf2d8e3080074260318bc9303597e8f72b18f965ad601d31ec43", - "0x8aaf580aaf75c1b7a5f99ccf60503506e62058ef43b28b02f79b8536a96be3f019c9f71caf327b4e6730134730d1bef5", - "0xae6f9fc21dd7dfa672b25a87eb0a41644f7609fab5026d5cedb6e43a06dbbfd6d6e30322a2598c8dedde88c52eaed626", - "0x8159b953ffece5693edadb2e906ebf76ff080ee1ad22698950d2d3bfc36ac5ea78f58284b2ca180664452d55bd54716c", - "0xab7647c32ca5e9856ac283a2f86768d68de75ceeba9e58b74c5324f8298319e52183739aba4340be901699d66ac9eb3f", - "0xa4d85a5701d89bcfaf1572db83258d86a1a0717603d6f24ac2963ffcf80f1265e5ab376a4529ca504f4396498791253c", - "0x816080c0cdbfe61b4d726c305747a9eb58ac26d9a35f501dd32ba43c098082d20faf3ccd41aad24600aa73bfa453dfac", - "0x84f3afac024f576b0fd9acc6f2349c2fcefc3f77dbe5a2d4964d14b861b88e9b1810334b908cf3427d9b67a8aee74b18", - "0x94b390655557b1a09110018e9b5a14490681ade275bdc83510b6465a1218465260d9a7e2a6e4ec700f58c31dc3659962", - "0xa8c66826b1c04a2dd4c682543242e7a57acae37278bd09888a3d17747c5b5fec43548101e6f46d703638337e2fd3277b", - "0x86e6f4608a00007fa533c36a5b054c5768ccafe41ad52521d772dcae4c8a4bcaff8f7609be30d8fab62c5988cbbb6830", - "0x837da4cf09ae8aa0bceb16f8b3bfcc3b3367aecac9eed6b4b56d7b65f55981ef066490764fb4c108792623ecf8cad383", - "0x941ff3011462f9b5bf97d8cbdb0b6f5d37a1b1295b622f5485b7d69f2cb2bcabc83630dae427f0259d0d9539a77d8424", - "0xb99e5d6d82aa9cf7d5970e7f710f4039ac32c2077530e4c2779250c6b9b373bc380adb0a03b892b652f649720672fc8c", - "0xa791c78464b2d65a15440b699e1e30ebd08501d6f2720adbc8255d989a82fcded2f79819b5f8f201bed84a255211b141", - "0x84af7ad4a0e31fcbb3276ab1ad6171429cf39adcf78dc03750dc5deaa46536d15591e26d53e953dfb31e1622bc0743ab", - "0xa833e62fe97e1086fae1d4917fbaf09c345feb6bf1975b5cb863d8b66e8d621c7989ab3dbecda36bc9eaffc5eaa6fa66", - "0xb4ef79a46a2126f53e2ebe62770feb57fd94600be29459d70a77c5e9cc260fa892be06cd60f886bf48459e48eb50d063", - "0xb43b8f61919ea380bf151c294e54d3a3ff98e20d1ee5efbfe38aa2b66fafbc6a49739793bd5cb1c809f8b30466277c3a", - "0xab37735af2412d2550e62df9d8b3b5e6f467f20de3890bf56faf1abf2bf3bd1d98dc3fa0ad5e7ab3fce0fa20409eb392", - "0x82416b74b1551d484250d85bb151fabb67e29cce93d516125533df585bc80779ab057ea6992801a3d7d5c6dcff87a018", - "0x8145d0787f0e3b5325190ae10c1d6bee713e6765fb6a0e9214132c6f78f4582bb2771aaeae40d3dad4bafb56bf7e36d8", - "0xb6935886349ecbdd5774e12196f4275c97ec8279fdf28ccf940f6a022ebb6de8e97d6d2173c3fe402cbe9643bed3883b", - "0x87ef9b4d3dc71ac86369f8ed17e0dd3b91d16d14ae694bc21a35b5ae37211b043d0e36d8ff07dcc513fb9e6481a1f37f", - "0xae1d0ded32f7e6f1dc8fef495879c1d9e01826f449f903c1e5034aeeabc5479a9e323b162b688317d46d35a42d570d86", - "0xa40d16497004db4104c6794e2f4428d75bdf70352685944f3fbe17526df333e46a4ca6de55a4a48c02ecf0bde8ba03c0", - "0x8d45121efba8cc308a498e8ee39ea6fa5cae9fb2e4aab1c2ff9d448aa8494ccbec9a078f978a86fcd97b5d5e7be7522a", - "0xa8173865c64634ba4ac2fa432740f5c05056a9deaf6427cb9b4b8da94ca5ddbc8c0c5d3185a89b8b28878194de9cdfcd", - "0xb6ec06a74d690f6545f0f0efba236e63d1fdfba54639ca2617408e185177ece28901c457d02b849fd00f1a53ae319d0a", - "0xb69a12df293c014a40070e3e760169b6f3c627caf9e50b35a93f11ecf8df98b2bc481b410eecb7ab210bf213bbe944de", - "0x97e7dc121795a533d4224803e591eef3e9008bab16f12472210b73aaf77890cf6e3877e0139403a0d3003c12c8f45636", - "0xacdfa6fdd4a5acb7738cc8768f7cba84dbb95c639399b291ae8e4e63df37d2d4096900a84d2f0606bf534a9ccaa4993f", - "0x86ee253f3a9446a33e4d1169719b7d513c6b50730988415382faaf751988c10a421020609f7bcdef91be136704b906e2", - "0xaac9438382a856caf84c5a8a234282f71b5fc5f65219103b147e7e6cf565522285fbfd7417b513bdad8277a00f652ca1", - "0x83f3799d8e5772527930f5dc071a2e0a65471618993ec8990a96ccdeee65270e490bda9d26bb877612475268711ffd80", - "0x93f28a81ac8c0ec9450b9d762fae9c7f8feaace87a6ee6bd141ef1d2d0697ef1bbd159fe6e1de640dbdab2b0361fca8a", - "0xa0825c95ba69999b90eac3a31a3fd830ea4f4b2b7409bde5f202b61d741d6326852ce790f41de5cb0eccec7af4db30c1", - "0x83924b0e66233edd603c3b813d698daa05751fc34367120e3cf384ea7432e256ccee4d4daf13858950549d75a377107d", - "0x956fd9fa58345277e06ba2ec72f49ed230b8d3d4ff658555c52d6cddeb84dd4e36f1a614f5242d5ca0192e8daf0543c2", - "0x944869912476baae0b114cced4ff65c0e4c90136f73ece5656460626599051b78802df67d7201c55d52725a97f5f29fe", - "0x865cb25b64b4531fb6fe4814d7c8cd26b017a6c6b72232ff53defc18a80fe3b39511b23f9e4c6c7249d06e03b2282ed2", - "0x81e09ff55214960775e1e7f2758b9a6c4e4cd39edf7ec1adfaad51c52141182b79fe2176b23ddc7df9fd153e5f82d668", - "0xb31006896f02bc90641121083f43c3172b1039334501fbaf1672f7bf5d174ddd185f945adf1a9c6cf77be34c5501483d", - "0x88b92f6f42ae45e9f05b16e52852826e933efd0c68b0f2418ac90957fd018df661bc47c8d43c2a7d7bfcf669dab98c3c", - "0x92fc68f595853ee8683930751789b799f397135d002eda244fe63ecef2754e15849edde3ba2f0cc8b865c9777230b712", - "0x99ca06a49c5cd0bb097c447793fcdd809869b216a34c66c78c7e41e8c22f05d09168d46b8b1f3390db9452d91bc96dea", - "0xb48b9490a5d65296802431852d548d81047bbefc74fa7dc1d4e2a2878faacdfcb365ae59209cb0ade01901a283cbd15d", - "0xaff0fdbef7c188b120a02bc9085d7b808e88f73973773fef54707bf2cd772cd066740b1b6f4127b5c349f657bd97e738", - "0x966fd4463b4f43dd8ccba7ad50baa42292f9f8b2e70da23bb6780e14155d9346e275ef03ddaf79e47020dcf43f3738bd", - "0x9330c3e1fadd9e08ac85f4839121ae20bbeb0a5103d84fa5aadbd1213805bdcda67bf2fb75fc301349cbc851b5559d20", - "0x993bb99867bd9041a71a55ad5d397755cfa7ab6a4618fc526179bfc10b7dc8b26e4372fe9a9b4a15d64f2b63c1052dda", - "0xa29b59bcfab51f9b3c490a3b96f0bf1934265c315349b236012adbd64a56d7f6941b2c8cc272b412044bc7731f71e1dc", - "0xa65c9cefe1fc35d089fe8580c2e7671ebefdb43014ac291528ff4deefd4883fd4df274af83711dad610dad0d615f9d65", - "0x944c78c56fb227ae632805d448ca3884cd3d2a89181cead3d2b7835e63297e6d740aa79a112edb1d4727824991636df5", - "0xa73d782da1db7e4e65d7b26717a76e16dd9fab4df65063310b8e917dc0bc24e0d6755df5546c58504d04d9e68c3b474a", - "0xaf80f0b87811ae3124f68108b4ca1937009403f87928bbc53480e7c5408d072053ace5eeaf5a5aba814dab8a45502085", - "0x88aaf1acfc6e2e19b8387c97da707cb171c69812fefdd4650468e9b2c627bd5ccfb459f4d8e56bdfd84b09ddf87e128f", - "0x92c97276ff6f72bab6e9423d02ad6dc127962dbce15a0dd1e4a393b4510c555df6aa27be0f697c0d847033a9ca8b8dfd", - "0xa0e07d43d96e2d85b6276b3c60aadb48f0aedf2de8c415756dc597249ea64d2093731d8735231dadc961e5682ac59479", - "0xadc9e6718a8f9298957d1da3842a7751c5399bbdf56f8de6c1c4bc39428f4aee6f1ba6613d37bf46b9403345e9d6fc81", - "0x951da434da4b20d949b509ceeba02e24da7ed2da964c2fcdf426ec787779c696b385822c7dbea4df3e4a35921f1e912c", - "0xa04cbce0d2b2e87bbf038c798a12ec828423ca6aca08dc8d481cf6466e3c9c73d4d4a7fa47df9a7e2e15aae9e9f67208", - "0x8f855cca2e440d248121c0469de1f94c2a71b8ee2682bbad3a78243a9e03da31d1925e6760dbc48a1957e040fae9abe8", - "0xb642e5b17c1df4a4e101772d73851180b3a92e9e8b26c918050f51e6dd3592f102d20b0a1e96f0e25752c292f4c903ff", - "0xa92454c300781f8ae1766dbbb50a96192da7d48ef4cbdd72dd8cbb44c6eb5913c112cc38e9144615fdc03684deb99420", - "0x8b74f7e6c2304f8e780df4649ef8221795dfe85fdbdaa477a1542d135b75c8be45bf89adbbb6f3ddf54ca40f02e733e9", - "0x85cf66292cbb30cec5fd835ab10c9fcb3aea95e093aebf123e9a83c26f322d76ebc89c4e914524f6c5f6ee7d74fc917d", - "0xae0bfe0cdc97c09542a7431820015f2d16067b30dca56288013876025e81daa8c519e5e347268e19aa1a85fa1dc28793", - "0x921322fc6a47dc091afa0ad6df18ed14cde38e48c6e71550aa513918b056044983aee402de21051235eecf4ce8040fbe", - "0x96c030381e97050a45a318d307dcb3c8377b79b4dd5daf6337cded114de26eb725c14171b9b8e1b3c08fe1f5ea6b49e0", - "0x90c23b86b6111818c8baaf53a13eaee1c89203b50e7f9a994bf0edf851919b48edbac7ceef14ac9414cf70c486174a77", - "0x8bf6c301240d2d1c8d84c71d33a6dfc6d9e8f1cfae66d4d0f7a256d98ae12b0bcebfa94a667735ee89f810bcd7170cff", - "0xa41a4ffbbea0e36874d65c009ee4c3feffff322f6fc0e30d26ee4dbc1f46040d05e25d9d0ecb378cef0d24a7c2c4b850", - "0xa8d4cdd423986bb392a0a92c12a8bd4da3437eec6ef6af34cf5310944899287452a2eb92eb5386086d5063381189d10e", - "0xa81dd26ec057c4032a4ed7ad54d926165273ed51d09a1267b2e477535cf6966835a257c209e4e92d165d74fa75695fa3", - "0x8d7f708c3ee8449515d94fc26b547303b53d8dd55f177bc3b25d3da2768accd9bc8e9f09546090ebb7f15c66e6c9c723", - "0x839ba65cffcd24cfffa7ab3b21faabe3c66d4c06324f07b2729c92f15cad34e474b0f0ddb16cd652870b26a756b731d3", - "0x87f1a3968afec354d92d77e2726b702847c6afcabb8438634f9c6f7766de4c1504317dc4fa9a4a735acdbf985e119564", - "0x91a8a7fd6542f3e0673f07f510d850864b34ac087eb7eef8845a1d14b2b1b651cbdc27fa4049bdbf3fea54221c5c8549", - "0xaef3cf5f5e3a2385ead115728d7059e622146c3457d266c612e778324b6e06fbfb8f98e076624d2f3ce1035d65389a07", - "0x819915d6232e95ccd7693fdd78d00492299b1983bc8f96a08dcb50f9c0a813ed93ae53c0238345d5bea0beda2855a913", - "0x8e9ba68ded0e94935131b392b28218315a185f63bf5e3c1a9a9dd470944509ca0ba8f6122265f8da851b5cc2abce68f1", - "0xb28468e9b04ee9d69003399a3cf4457c9bf9d59f36ab6ceeb8e964672433d06b58beeea198fedc7edbaa1948577e9fa2", - "0xa633005e2c9f2fd94c8bce2dd5bb708fe946b25f1ec561ae65e54e15cdd88dc339f1a083e01f0d39610c8fe24151aaf0", - "0x841d0031e22723f9328dd993805abd13e0c99b0f59435d2426246996b08d00ce73ab906f66c4eab423473b409e972ce0", - "0x85758d1b084263992070ec8943f33073a2d9b86a8606672550c17545507a5b3c88d87382b41916a87ee96ff55a7aa535", - "0x8581b06b0fc41466ef94a76a1d9fb8ae0edca6d018063acf6a8ca5f4b02d76021902feba58972415691b4bdbc33ae3b4", - "0x83539597ff5e327357ee62bc6bf8c0bcaec2f227c55c7c385a4806f0d37fb461f1690bad5066b8a5370950af32fafbef", - "0xaee3557290d2dc10827e4791d00e0259006911f3f3fce4179ed3c514b779160613eca70f720bff7804752715a1266ffa", - "0xb48d2f0c4e90fc307d5995464e3f611a9b0ef5fe426a289071f4168ed5cc4f8770c9332960c2ca5c8c427f40e6bb389f", - "0x847af8973b4e300bb06be69b71b96183fd1a0b9d51b91701bef6fcfde465068f1eb2b1503b07afda380f18d69de5c9e1", - "0xa70a6a80ce407f07804c0051ac21dc24d794b387be94eb24e1db94b58a78e1bcfb48cd0006db8fc1f9bedaece7a44fbe", - "0xb40e942b8fa5336910ff0098347df716bff9d1fa236a1950c16eeb966b3bc1a50b8f7b0980469d42e75ae13ced53cead", - "0xb208fabaa742d7db3148515330eb7a3577487845abdb7bd9ed169d0e081db0a5816595c33d375e56aeac5b51e60e49d3", - "0xb7c8194b30d3d6ef5ab66ec88ad7ebbc732a3b8a41731b153e6f63759a93f3f4a537eab9ad369705bd730184bdbbdc34", - "0x9280096445fe7394d04aa1bc4620c8f9296e991cc4d6c131bd703cb1cc317510e6e5855ac763f4d958c5edfe7eebeed7", - "0xabc2aa4616a521400af1a12440dc544e3c821313d0ab936c86af28468ef8bbe534837e364598396a81cf8d06274ed5a6", - "0xb18ca8a3325adb0c8c18a666d4859535397a1c3fe08f95eebfac916a7a99bbd40b3c37b919e8a8ae91da38bc00fa56c0", - "0x8a40c33109ecea2a8b3558565877082f79121a432c45ec2c5a5e0ec4d1c203a6788e6b69cb37f1fd5b8c9a661bc5476d", - "0x88c47301dd30998e903c84e0b0f2c9af2e1ce6b9f187dab03528d44f834dc991e4c86d0c474a2c63468cf4020a1e24a0", - "0x920c832853e6ab4c851eecfa9c11d3acc7da37c823be7aa1ab15e14dfd8beb5d0b91d62a30cec94763bd8e4594b66600", - "0x98e1addbe2a6b8edc7f12ecb9be81c3250aeeca54a1c6a7225772ca66549827c15f3950d01b8eb44aecb56fe0fff901a", - "0x8cfb0fa1068be0ec088402f5950c4679a2eb9218c729da67050b0d1b2d7079f3ddf4bf0f57d95fe2a8db04bc6bcdb20c", - "0xb70f381aafe336b024120453813aeab70baac85b9c4c0f86918797b6aee206e6ed93244a49950f3d8ec9f81f4ac15808", - "0xa4c8edf4aa33b709a91e1062939512419711c1757084e46f8f4b7ed64f8e682f4e78b7135920c12f0eb0422fe9f87a6a", - "0xb4817e85fd0752d7ebb662d3a51a03367a84bac74ebddfba0e5af5e636a979500f72b148052d333b3dedf9edd2b4031b", - "0xa87430169c6195f5d3e314ff2d1c2f050e766fd5d2de88f5207d72dba4a7745bb86d0baca6e9ae156582d0d89e5838c7", - "0x991b00f8b104566b63a12af4826b61ce7aa40f4e5b8fff3085e7a99815bdb4471b6214da1e480214fac83f86a0b93cc5", - "0xb39966e3076482079de0678477df98578377a094054960ee518ef99504d6851f8bcd3203e8da5e1d4f6f96776e1fe6eb", - "0xa448846d9dc2ab7a0995fa44b8527e27f6b3b74c6e03e95edb64e6baa4f1b866103f0addb97c84bef1d72487b2e21796", - "0x894bec21a453ae84b592286e696c35bc30e820e9c2fd3e63dd4fbe629e07df16439c891056070faa490155f255bf7187", - "0xa9ec652a491b11f6a692064e955f3f3287e7d2764527e58938571469a1e29b5225b9415bd602a45074dfbfe9c131d6ca", - "0xb39d37822e6cbe28244b5f42ce467c65a23765bd16eb6447c5b3e942278069793763483dafd8c4dd864f8917aad357fe", - "0x88dba51133f2019cb266641c56101e3e5987d3b77647a2e608b5ff9113dfc5f85e2b7c365118723131fbc0c9ca833c9c", - "0xb566579d904b54ecf798018efcb824dccbebfc6753a0fd2128ac3b4bd3b038c2284a7c782b5ca6f310eb7ea4d26a3f0a", - "0xa97a55c0a492e53c047e7d6f9d5f3e86fb96f3dddc68389c0561515343b66b4bc02a9c0d5722dff1e3445308240b27f7", - "0xa044028ab4bcb9e1a2b9b4ca4efbf04c5da9e4bf2fff0e8bd57aa1fc12a71e897999c25d9117413faf2f45395dee0f13", - "0xa78dc461decbeaeed8ebd0909369b491a5e764d6a5645a7dac61d3140d7dc0062526f777b0eb866bff27608429ebbdde", - "0xb2c2a8991f94c39ca35fea59f01a92cb3393e0eccb2476dfbf57261d406a68bd34a6cff33ed80209991688c183609ef4", - "0x84189eefb521aff730a4fd3fd5b10ddfd29f0d365664caef63bb015d07e689989e54c33c2141dd64427805d37a7e546e", - "0x85ac80bd734a52235da288ff042dea9a62e085928954e8eacd2c751013f61904ed110e5b3afe1ab770a7e6485efb7b5e", - "0x9183a560393dcb22d0d5063e71182020d0fbabb39e32493eeffeb808df084aa243eb397027f150b55a247d1ed0c8513e", - "0x81c940944df7ecc58d3c43c34996852c3c7915ed185d7654627f7af62abae7e0048dd444a6c09961756455000bd96d09", - "0xaa8c34e164019743fd8284b84f06c3b449aae7996e892f419ee55d82ad548cb300fd651de329da0384243954c0ef6a60", - "0x89a7b7bdfc7e300d06a14d463e573d6296d8e66197491900cc9ae49504c4809ff6e61b758579e9091c61085ba1237b83", - "0x878d21809ba540f50bd11f4c4d9590fb6f3ab9de5692606e6e2ef4ed9d18520119e385be5e1f4b3f2e2b09c319f0e8fc", - "0x8eb248390193189cf0355365e630b782cd15751e672dc478b39d75dc681234dcd9309df0d11f4610dbb249c1e6be7ef9", - "0xa1d7fb3aecb896df3a52d6bd0943838b13f1bd039c936d76d03de2044c371d48865694b6f532393b27fd10a4cf642061", - "0xa34bca58a24979be442238cbb5ece5bee51ae8c0794dd3efb3983d4db713bc6f28a96e976ac3bd9a551d3ed9ba6b3e22", - "0x817c608fc8cacdd178665320b5a7587ca21df8bdd761833c3018b967575d25e3951cf3d498a63619a3cd2ad4406f5f28", - "0x86c95707db0495689afd0c2e39e97f445f7ca0edffad5c8b4cacd1421f2f3cc55049dfd504f728f91534e20383955582", - "0x99c3b0bb15942c301137765d4e19502f65806f3b126dc01a5b7820c87e8979bce6a37289a8f6a4c1e4637227ad5bf3bf", - "0x8aa1518a80ea8b074505a9b3f96829f5d4afa55a30efe7b4de4e5dbf666897fdd2cf31728ca45921e21a78a80f0e0f10", - "0x8d74f46361c79e15128ac399e958a91067ef4cec8983408775a87eca1eed5b7dcbf0ddf30e66f51780457413496c7f07", - "0xa41cde4a786b55387458a1db95171aca4fd146507b81c4da1e6d6e495527c3ec83fc42fad1dfe3d92744084a664fd431", - "0x8c352852c906fae99413a84ad11701f93f292fbf7bd14738814f4c4ceab32db02feb5eb70bc73898b0bc724a39d5d017", - "0xa5993046e8f23b71ba87b7caa7ace2d9023fb48ce4c51838813174880d918e9b4d2b0dc21a2b9c6f612338c31a289df8", - "0x83576d3324bf2d8afbfb6eaecdc5d767c8e22e7d25160414924f0645491df60541948a05e1f4202e612368e78675de8a", - "0xb43749b8df4b15bc9a3697e0f1c518e6b04114171739ef1a0c9c65185d8ec18e40e6954d125cbc14ebc652cf41ad3109", - "0xb4eebd5d80a7327a040cafb9ccdb12b2dfe1aa86e6bc6d3ac8a57fadfb95a5b1a7332c66318ff72ba459f525668af056", - "0x9198be7f1d413c5029b0e1c617bcbc082d21abe2c60ec8ce9b54ca1a85d3dba637b72fda39dae0c0ae40d047eab9f55a", - "0x8d96a0232832e24d45092653e781e7a9c9520766c3989e67bbe86b3a820c4bf621ea911e7cd5270a4bfea78b618411f6", - "0x8d7160d0ea98161a2d14d46ef01dff72d566c330cd4fabd27654d300e1bc7644c68dc8eabf2a20a59bfe7ba276545f9b", - "0xabb60fce29dec7ba37e3056e412e0ec3e05538a1fc0e2c68877378c867605966108bc5742585ab6a405ce0c962b285b6", - "0x8fabffa3ed792f05e414f5839386f6449fd9f7b41a47595c5d71074bd1bb3784cc7a1a7e1ad6b041b455035957e5b2dc", - "0x90ff017b4804c2d0533b72461436b10603ab13a55f86fd4ec11b06a70ef8166f958c110519ca1b4cc7beba440729fe2d", - "0xb340cfd120f6a4623e3a74cf8c32bfd7cd61a280b59dfd17b15ca8fae4d82f64a6f15fbde4c02f424debc72b7db5fe67", - "0x871311c9c7220c932e738d59f0ecc67a34356d1429fe570ca503d340c9996cb5ee2cd188fad0e3bd16e4c468ec1dbebd", - "0xa772470262186e7b94239ba921b29f2412c148d6f97c4412e96d21e55f3be73f992f1ad53c71008f0558ec3f84e2b5a7", - "0xb2a897dcb7ffd6257f3f2947ec966f2077d57d5191a88840b1d4f67effebe8c436641be85524d0a21be734c63ab5965d", - "0xa044f6eacc48a4a061fa149500d96b48cbf14853469aa4d045faf3dca973be1bd4b4ce01646d83e2f24f7c486d03205d", - "0x981af5dc2daa73f7fa9eae35a93d81eb6edba4a7f673b55d41f6ecd87a37685d31bb40ef4f1c469b3d72f2f18b925a17", - "0x912d2597a07864de9020ac77083eff2f15ceb07600f15755aba61251e8ce3c905a758453b417f04d9c38db040954eb65", - "0x9642b7f6f09394ba5e0805734ef6702c3eddf9eea187ba98c676d5bbaec0e360e3e51dc58433aaa1e2da6060c8659cb7", - "0x8ab3836e0a8ac492d5e707d056310c4c8e0489ca85eb771bff35ba1d658360084e836a6f51bb990f9e3d2d9aeb18fbb5", - "0x879e058e72b73bb1f4642c21ffdb90544b846868139c6511f299aafe59c2d0f0b944dffc7990491b7c4edcd6a9889250", - "0xb9e60b737023f61479a4a8fd253ed0d2a944ea6ba0439bbc0a0d3abf09b0ad1f18d75555e4a50405470ae4990626f390", - "0xb9c2535d362796dcd673640a9fa2ebdaec274e6f8b850b023153b0a7a30fffc87f96e0b72696f647ebe7ab63099a6963", - "0x94aeff145386a087b0e91e68a84a5ede01f978f9dd9fe7bebca78941938469495dc30a96bba9508c0d017873aeea9610", - "0x98b179f8a3d9f0d0a983c30682dd425a2ddc7803be59bd626c623c8951a5179117d1d2a68254c95c9952989877d0ee55", - "0x889ecf5f0ee56938273f74eb3e9ecfb5617f04fb58e83fe4c0e4aef51615cf345bc56f3f61b17f6eed3249d4afd54451", - "0xa0f2b2c39bcea4b50883e2587d16559e246248a66ecb4a4b7d9ab3b51fb39fe98d83765e087eee37a0f86b0ba4144c02", - "0xb2a61e247ed595e8a3830f7973b07079cbda510f28ad8c78c220b26cb6acde4fbb5ee90c14a665f329168ee951b08cf0", - "0x95bd0fcfb42f0d6d8a8e73d7458498a85bcddd2fb132fd7989265648d82ac2707d6d203fac045504977af4f0a2aca4b7", - "0x843e5a537c298666e6cf50fcc044f13506499ef83c802e719ff2c90e85003c132024e04711be7234c04d4b0125512d5d", - "0xa46d1797c5959dcd3a5cfc857488f4d96f74277c3d13b98b133620192f79944abcb3a361d939a100187f1b0856eae875", - "0xa1c7786736d6707a48515c38660615fcec67eb8a2598f46657855215f804fd72ab122d17f94fcffad8893f3be658dca7", - "0xb23dc9e610abc7d8bd21d147e22509a0fa49db5be6ea7057b51aae38e31654b3aa044df05b94b718153361371ba2f622", - "0xb00cc8f257d659c22d30e6d641f79166b1e752ea8606f558e4cad6fc01532e8319ea4ee12265ba4140ac45aa4613c004", - "0xac7019af65221b0cc736287b32d7f1a3561405715ba9a6a122342e04e51637ba911c41573de53e4781f2230fdcb2475f", - "0x81a630bc41b3da8b3eb4bf56cba10cd9f93153c3667f009dc332287baeb707d505fb537e6233c8e53d299ec0f013290c", - "0xa6b7aea5c545bb76df0f230548539db92bc26642572cb7dd3d5a30edca2b4c386f44fc8466f056b42de2a452b81aff5b", - "0x8271624ff736b7b238e43943c81de80a1612207d32036d820c11fc830c737972ccc9c60d3c2359922b06652311e3c994", - "0x8a684106458cb6f4db478170b9ad595d4b54c18bf63b9058f095a2fa1b928c15101472c70c648873d5887880059ed402", - "0xa5cc3c35228122f410184e4326cf61a37637206e589fcd245cb5d0cec91031f8f7586b80503070840fdfd8ce75d3c88b", - "0x9443fc631aed8866a7ed220890911057a1f56b0afe0ba15f0a0e295ab97f604b134b1ed9a4245e46ee5f9a93aa74f731", - "0x984b6f7d79835dffde9558c6bb912d992ca1180a2361757bdba4a7b69dc74b056e303adc69fe67414495dd9c2dd91e64", - "0xb15a5c8cba5de080224c274d31c68ed72d2a7126d347796569aef0c4e97ed084afe3da4d4b590b9dda1a07f0c2ff3dfb", - "0x991708fe9650a1f9a4e43938b91d45dc68c230e05ee999c95dbff3bf79b1c1b2bb0e7977de454237c355a73b8438b1d9", - "0xb4f7edc7468b176a4a7c0273700c444fa95c726af6697028bed4f77eee887e3400f9c42ee15b782c0ca861c4c3b8c98a", - "0x8c60dcc16c51087eb477c13e837031d6c6a3dc2b8bf8cb43c23f48006bc7173151807e866ead2234b460c2de93b31956", - "0x83ad63e9c910d1fc44bc114accfb0d4d333b7ebe032f73f62d25d3e172c029d5e34a1c9d547273bf6c0fead5c8801007", - "0x85de73213cc236f00777560756bdbf2b16841ba4b55902cf2cad9742ecaf5d28209b012ceb41f337456dfeca93010cd7", - "0xa7561f8827ccd75b6686ba5398bb8fc3083351c55a589b18984e186820af7e275af04bcd4c28e1dc11be1e8617a0610b", - "0x88c0a4febd4068850557f497ea888035c7fc9f404f6cc7794e7cc8722f048ad2f249e7dc62743e7a339eb7473ad3b0cd", - "0x932b22b1d3e6d5a6409c34980d176feb85ada1bf94332ef5c9fc4d42b907dabea608ceef9b5595ef3feee195151f18d8", - "0xa2867bb3f5ab88fbdae3a16c9143ab8a8f4f476a2643c505bb9f37e5b1fd34d216cab2204c9a017a5a67b7ad2dda10e8", - "0xb573d5f38e4e9e8a3a6fd82f0880dc049efa492a946d00283019bf1d5e5516464cf87039e80aef667cb86fdea5075904", - "0xb948f1b5ab755f3f5f36af27d94f503b070696d793b1240c1bdfd2e8e56890d69e6904688b5f8ff5a4bdf5a6abfe195f", - "0x917eae95ebc4109a2e99ddd8fec7881d2f7aaa0e25fda44dec7ce37458c2ee832f1829db7d2dcfa4ca0f06381c7fe91d", - "0x95751d17ed00a3030bce909333799bb7f4ab641acf585807f355b51d6976dceee410798026a1a004ef4dcdff7ec0f5b8", - "0xb9b7bd266f449a79bbfe075e429613e76c5a42ac61f01c8f0bbbd34669650682efe01ff9dbbc400a1e995616af6aa278", - "0xac1722d097ce9cd7617161f8ec8c23d68f1fb1c9ca533e2a8b4f78516c2fd8fb38f23f834e2b9a03bb06a9d655693ca9", - "0xa7ad9e96ffd98db2ecdb6340c5d592614f3c159abfd832fe27ee9293519d213a578e6246aae51672ee353e3296858873", - "0x989b8814d5de7937c4acafd000eec2b4cd58ba395d7b25f98cafd021e8efa37029b29ad8303a1f6867923f5852a220eb", - "0xa5bfe6282c771bc9e453e964042d44eff4098decacb89aecd3be662ea5b74506e1357ab26f3527110ba377711f3c9f41", - "0x8900a7470b656639721d2abbb7b06af0ac4222ab85a1976386e2a62eb4b88bfb5b72cf7921ddb3cf3a395d7eeb192a2e", - "0x95a71b55cd1f35a438cf5e75f8ff11c5ec6a2ebf2e4dba172f50bfad7d6d5dca5de1b1afc541662c81c858f7604c1163", - "0x82b5d62fea8db8d85c5bc3a76d68dedd25794cf14d4a7bc368938ffca9e09f7e598fdad2a5aac614e0e52f8112ae62b9", - "0x997173f07c729202afcde3028fa7f52cefc90fda2d0c8ac2b58154a5073140683e54c49ed1f254481070d119ce0ce02a", - "0xaeffb91ccc7a72bbd6ffe0f9b99c9e66e67d59cec2e02440465e9636a613ab3017278cfa72ea8bc4aba9a8dc728cb367", - "0x952743b06e8645894aeb6440fc7a5f62dd3acf96dab70a51e20176762c9751ea5f2ba0b9497ccf0114dc4892dc606031", - "0x874c63baeddc56fbbca2ff6031f8634b745f6e34ea6791d7c439201aee8f08ef5ee75f7778700a647f3b21068513fce6", - "0x85128fec9c750c1071edfb15586435cc2f317e3e9a175bb8a9697bcda1eb9375478cf25d01e7fed113483b28f625122d", - "0x85522c9576fd9763e32af8495ae3928ed7116fb70d4378448926bc9790e8a8d08f98cf47648d7da1b6e40d6a210c7924", - "0x97d0f37a13cfb723b848099ca1c14d83e9aaf2f7aeb71829180e664b7968632a08f6a85f557d74b55afe6242f2a36e7c", - "0xabaa472d6ad61a5fccd1a57c01aa1bc081253f95abbcba7f73923f1f11c4e79b904263890eeb66926de3e2652f5d1c70", - "0xb3c04945ba727a141e5e8aec2bf9aa3772b64d8fd0e2a2b07f3a91106a95cbcb249adcd074cbe498caf76fffac20d4ef", - "0x82c46781a3d730d9931bcabd7434a9171372dde57171b6180e5516d4e68db8b23495c8ac3ab96994c17ddb1cf249b9fb", - "0xa202d8b65613c42d01738ccd68ed8c2dbc021631f602d53f751966e04182743ebc8e0747d600b8a8676b1da9ae7f11ab", - "0xae73e7256e9459db04667a899e0d3ea5255211fb486d084e6550b6dd64ca44af6c6b2d59d7aa152de9f96ce9b58d940d", - "0xb67d87b176a9722945ec7593777ee461809861c6cfd1b945dde9ee4ff009ca4f19cf88f4bbb5c80c9cbab2fe25b23ac8", - "0x8f0b7a317a076758b0dac79959ee4a06c08b07d0f10538a4b53d3da2eda16e2af26922feb32c090330dc4d969cf69bd3", - "0x90b36bf56adbd8c4b6cb32febc3a8d5f714370c2ac3305c10fa6d168dffb2a026804517215f9a2d4ec8310cdb6bb459b", - "0xaa80c19b0682ead69934bf18cf476291a0beddd8ef4ed75975d0a472e2ab5c70f119722a8574ae4973aceb733d312e57", - "0xa3fc9abb12574e5c28dcb51750b4339b794b8e558675eef7d26126edf1de920c35e992333bcbffcbf6a5f5c0d383ce62", - "0xa1573ff23ab972acdcd08818853b111fc757fdd35aa070186d3e11e56b172fb49d840bf297ac0dd222e072fc09f26a81", - "0x98306f2be4caa92c2b4392212d0cbf430b409b19ff7d5b899986613bd0e762c909fc01999aa94be3bd529d67f0113d7f", - "0x8c1fc42482a0819074241746d17dc89c0304a2acdae8ed91b5009e9e3e70ff725ba063b4a3e68fdce05b74f5180c545e", - "0xa6c6113ebf72d8cf3163b2b8d7f3fa24303b13f55752522c660a98cd834d85d8c79214d900fa649499365e2e7641f77a", - "0xab95eea424f8a2cfd9fb1c78bb724e5b1d71a0d0d1e4217c5d0f98b0d8bbd3f8400a2002abc0a0e4576d1f93f46fefad", - "0x823c5a4fd8cf4a75fdc71d5f2dd511b6c0f189b82affeacd2b7cfcad8ad1a5551227dcc9bfdb2e34b2097eaa00efbb51", - "0xb97314dfff36d80c46b53d87a61b0e124dc94018a0bb680c32765b9a2d457f833a7c42bbc90b3b1520c33a182580398d", - "0xb17566ee3dcc6bb3b004afe4c0136dfe7dd27df9045ae896dca49fb36987501ae069eb745af81ba3fc19ff037e7b1406", - "0xb0bdc0f55cfd98d331e3a0c4fbb776a131936c3c47c6bffdc3aaf7d8c9fa6803fbc122c2fefbb532e634228687d52174", - "0xaa5d9e60cc9f0598559c28bb9bdd52aa46605ab4ffe3d192ba982398e72cec9a2a44c0d0d938ce69935693cabc0887ea", - "0x802b6459d2354fa1d56c592ac1346c428dadea6b6c0a87bf7d309bab55c94e1cf31dd98a7a86bd92a840dd51f218b91b", - "0xa526914efdc190381bf1a73dd33f392ecf01350b9d3f4ae96b1b1c3d1d064721c7d6eec5788162c933245a3943f5ee51", - "0xb3b8fcf637d8d6628620a1a99dbe619eabb3e5c7ce930d6efd2197e261bf394b74d4e5c26b96c4b8009c7e523ccfd082", - "0x8f7510c732502a93e095aba744535f3928f893f188adc5b16008385fb9e80f695d0435bfc5b91cdad4537e87e9d2551c", - "0x97b90beaa56aa936c3ca45698f79273a68dd3ccd0076eab48d2a4db01782665e63f33c25751c1f2e070f4d1a8525bf96", - "0xb9fb798324b1d1283fdc3e48288e3861a5449b2ab5e884b34ebb8f740225324af86e4711da6b5cc8361c1db15466602f", - "0xb6d52b53cea98f1d1d4c9a759c25bf9d8a50b604b144e4912acbdbdc32aab8b9dbb10d64a29aa33a4f502121a6fb481c", - "0x9174ffff0f2930fc228f0e539f5cfd82c9368d26b074467f39c07a774367ff6cccb5039ac63f107677d77706cd431680", - "0xa33b6250d4ac9e66ec51c063d1a6a31f253eb29bbaed12a0d67e2eccfffb0f3a52750fbf52a1c2aaba8c7692346426e7", - "0xa97025fd5cbcebe8ef865afc39cd3ea707b89d4e765ec817fd021d6438e02fa51e3544b1fd45470c58007a08efac6edd", - "0xb32a78480edd9ff6ba2f1eec4088db5d6ceb2d62d7e59e904ecaef7bb4a2e983a4588e51692b3be76e6ffbc0b5f911a5", - "0xb5ab590ef0bb77191f00495b33d11c53c65a819f7d0c1f9dc4a2caa147a69c77a4fff7366a602d743ee1f395ce934c1e", - "0xb3fb0842f9441fb1d0ee0293b6efbc70a8f58d12d6f769b12872db726b19e16f0f65efbc891cf27a28a248b0ef9c7e75", - "0x9372ad12856fefb928ccb0d34e198df99e2f8973b07e9d417a3134d5f69e12e79ff572c4e03ccd65415d70639bc7c73e", - "0xaa8d6e83d09ce216bfe2009a6b07d0110d98cf305364d5529c170a23e693aabb768b2016befb5ada8dabdd92b4d012bb", - "0xa954a75791eeb0ce41c85200c3763a508ed8214b5945a42c79bfdcfb1ec4f86ad1dd7b2862474a368d4ac31911a2b718", - "0x8e2081cfd1d062fe3ab4dab01f68062bac802795545fede9a188f6c9f802cb5f884e60dbe866710baadbf55dc77c11a4", - "0xa2f06003b9713e7dd5929501ed485436b49d43de80ea5b15170763fd6346badf8da6de8261828913ee0dacd8ff23c0e1", - "0x98eecc34b838e6ffd1931ca65eec27bcdb2fdcb61f33e7e5673a93028c5865e0d1bf6d3bec040c5e96f9bd08089a53a4", - "0x88cc16019741b341060b95498747db4377100d2a5bf0a5f516f7dec71b62bcb6e779de2c269c946d39040e03b3ae12b7", - "0xad1135ccbc3019d5b2faf59a688eef2500697642be8cfbdf211a1ab59abcc1f24483e50d653b55ff1834675ac7b4978f", - "0xa946f05ed9972f71dfde0020bbb086020fa35b482cce8a4cc36dd94355b2d10497d7f2580541bb3e81b71ac8bba3c49f", - "0xa83aeed488f9a19d8cfd743aa9aa1982ab3723560b1cd337fc2f91ad82f07afa412b3993afb845f68d47e91ba4869840", - "0x95eebe006bfc316810cb71da919e5d62c2cebb4ac99d8e8ef67be420302320465f8b69873470982de13a7c2e23516be9", - "0xa55f8961295a11e91d1e5deadc0c06c15dacbfc67f04ccba1d069cba89d72aa3b3d64045579c3ea8991b150ac29366ae", - "0xb321991d12f6ac07a5de3c492841d1a27b0d3446082fbce93e7e1f9e8d8fe3b45d41253556261c21b70f5e189e1a7a6f", - "0xa0b0822f15f652ce7962a4f130104b97bf9529797c13d6bd8e24701c213cc37f18157bd07f3d0f3eae6b7cd1cb40401f", - "0x96e2fa4da378aa782cc2d5e6e465fc9e49b5c805ed01d560e9b98abb5c0de8b74a2e7bec3aa5e2887d25cccb12c66f0c", - "0x97e4ab610d414f9210ed6f35300285eb3ccff5b0b6a95ed33425100d7725e159708ea78704497624ca0a2dcabce3a2f9", - "0x960a375b17bdb325761e01e88a3ea57026b2393e1d887b34b8fa5d2532928079ce88dc9fd06a728b26d2bb41b12b9032", - "0x8328a1647398e832aadc05bd717487a2b6fcdaa0d4850d2c4da230c6a2ed44c3e78ec4837b6094f3813f1ee99414713f", - "0xaa283834ebd18e6c99229ce4b401eda83f01d904f250fedd4e24f1006f8fa0712a6a89a7296a9bf2ce8de30e28d1408e", - "0xb29e097f2caadae3e0f0ae3473c072b0cd0206cf6d2e9b22c1a5ad3e07d433e32bd09ed1f4e4276a2da4268633357b7f", - "0x9539c5cbba14538b2fe077ecf67694ef240da5249950baaabea0340718b882a966f66d97f08556b08a4320ceb2cc2629", - "0xb4529f25e9b42ae8cf8338d2eface6ba5cd4b4d8da73af502d081388135c654c0b3afb3aa779ffc80b8c4c8f4425dd2b", - "0x95be0739c4330619fbe7ee2249c133c91d6c07eab846c18c5d6c85fc21ac5528c5d56dcb0145af68ed0c6a79f68f2ccd", - "0xac0c83ea802227bfc23814a24655c9ff13f729619bcffdb487ccbbf029b8eaee709f8bddb98232ef33cd70e30e45ca47", - "0xb503becb90acc93b1901e939059f93e671900ca52c6f64ae701d11ac891d3a050b505d89324ce267bc43ab8275da6ffe", - "0x98e3811b55b1bacb70aa409100abb1b870f67e6d059475d9f278c751b6e1e2e2d6f2e586c81a9fb6597fda06e7923274", - "0xb0b0f61a44053fa6c715dbb0731e35d48dba257d134f851ee1b81fd49a5c51a90ebf5459ec6e489fce25da4f184fbdb1", - "0xb1d2117fe811720bb997c7c93fe9e4260dc50fca8881b245b5e34f724aaf37ed970cdad4e8fcb68e05ac8cf55a274a53", - "0xa10f502051968f14b02895393271776dee7a06db9de14effa0b3471825ba94c3f805302bdddac4d397d08456f620999d", - "0xa3dbad2ef060ae0bb7b02eaa4a13594f3f900450faa1854fc09620b01ac94ab896321dfb1157cf2374c27e5718e8026a", - "0xb550fdec503195ecb9e079dcdf0cad559d64d3c30818ef369b4907e813e689da316a74ad2422e391b4a8c2a2bef25fc0", - "0xa25ba865e2ac8f28186cea497294c8649a201732ecb4620c4e77b8e887403119910423df061117e5f03fc5ba39042db1", - "0xb3f88174e03fdb443dd6addd01303cf88a4369352520187c739fc5ae6b22fa99629c63c985b4383219dab6acc5f6f532", - "0x97a7503248e31e81b10eb621ba8f5210c537ad11b539c96dfb7cf72b846c7fe81bd7532c5136095652a9618000b7f8d3", - "0xa8bcdc1ce5aa8bfa683a2fc65c1e79de8ff5446695dcb8620f7350c26d2972a23da22889f9e2b1cacb3f688c6a2953dc", - "0x8458c111df2a37f5dd91a9bee6c6f4b79f4f161c93fe78075b24a35f9817da8dde71763218d627917a9f1f0c4709c1ed", - "0xac5f061a0541152b876cbc10640f26f1cc923c9d4ae1b6621e4bb3bf2cec59bbf87363a4eb72fb0e5b6d4e1c269b52d5", - "0xa9a25ca87006e8a9203cbb78a93f50a36694aa4aad468b8d80d3feff9194455ca559fcc63838128a0ab75ad78c07c13a", - "0xa450b85f5dfffa8b34dfd8bc985f921318efacf8857cf7948f93884ba09fb831482ee90a44224b1a41e859e19b74962f", - "0x8ed91e7f92f5c6d7a71708b6132f157ac226ecaf8662af7d7468a4fa25627302efe31e4620ad28719318923e3a59bf82", - "0xab524165fd4c71b1fd395467a14272bd2b568592deafa039d8492e9ef36c6d3f96927c95c72d410a768dc0b6d1fbbc9b", - "0xb662144505aa8432c75ffb8d10318526b6d5777ac7af9ebfad87d9b0866c364f7905a6352743bd8fd79ffd9d5dd4f3e6", - "0xa48f1677550a5cd40663bb3ba8f84caaf8454f332d0ceb1d94dbea52d0412fe69c94997f7749929712fd3995298572f7", - "0x8391cd6e2f6b0c242de1117a612be99776c3dc95cb800b187685ea5bf7e2722275eddb79fd7dfc8be8e389c4524cdf70", - "0x875d3acb9af47833b72900bc0a2448999d638f153c5e97e8a14ec02d0c76f6264353a7e275e1f1a5855daced523d243b", - "0x91f1823657d30b59b2f627880a9a9cb530f5aca28a9fd217fe6f2f5133690dfe7ad5a897872e400512db2e788b3f7628", - "0xad3564332aa56cea84123fc7ca79ea70bb4fef2009fa131cb44e4b15e8613bd11ca1d83b9d9bf456e4b7fee9f2e8b017", - "0x8c530b84001936d5ab366c84c0b105241a26d1fb163669f17c8f2e94776895c2870edf3e1bc8ccd04d5e65531471f695", - "0x932d01fa174fdb0c366f1230cffde2571cc47485f37f23ba5a1825532190cc3b722aeb1f15aed62cf83ccae9403ba713", - "0x88b28c20585aca50d10752e84b901b5c2d58efef5131479fbbe53de7bce2029e1423a494c0298e1497669bd55be97a5d", - "0xb914148ca717721144ebb3d3bf3fcea2cd44c30c5f7051b89d8001502f3856fef30ec167174d5b76265b55d70f8716b5", - "0x81d0173821c6ddd2a068d70766d9103d1ee961c475156e0cbd67d54e668a796310474ef698c7ab55abe6f2cf76c14679", - "0x8f28e8d78e2fe7fa66340c53718e0db4b84823c8cfb159c76eac032a62fb53da0a5d7e24ca656cf9d2a890cb2a216542", - "0x8a26360335c73d1ab51cec3166c3cf23b9ea51e44a0ad631b0b0329ef55aaae555420348a544e18d5760969281759b61", - "0x94f326a32ed287545b0515be9e08149eb0a565025074796d72387cc3a237e87979776410d78339e23ef3172ca43b2544", - "0xa785d2961a2fa5e70bffa137858a92c48fe749fee91b02599a252b0cd50d311991a08efd7fa5e96b78d07e6e66ffe746", - "0x94af9030b5ac792dd1ce517eaadcec1482206848bea4e09e55cc7f40fd64d4c2b3e9197027c5636b70d6122c51d2235d", - "0x9722869f7d1a3992850fe7be405ec93aa17dc4d35e9e257d2e469f46d2c5a59dbd504056c85ab83d541ad8c13e8bcd54", - "0xb13c4088b61a06e2c03ac9813a75ff1f68ffdfee9df6a8f65095179a475e29cc49119cad2ce05862c3b1ac217f3aace9", - "0x8c64d51774753623666b10ca1b0fe63ae42f82ed6aa26b81dc1d48c86937c5772eb1402624c52a154b86031854e1fb9f", - "0xb47e4df18002b7dac3fee945bf9c0503159e1b8aafcce2138818e140753011b6d09ef1b20894e08ba3006b093559061b", - "0x93cb5970076522c5a0483693f6a35ffd4ea2aa7aaf3730c4eccd6af6d1bebfc1122fc4c67d53898ae13eb6db647be7e2", - "0xa68873ef80986795ea5ed1a597d1cd99ed978ec25e0abb57fdcc96e89ef0f50aeb779ff46e3dce21dc83ada3157a8498", - "0x8cab67f50949cc8eee6710e27358aea373aae3c92849f8f0b5531c080a6300cdf2c2094fe6fecfef6148de0d28446919", - "0x993e932bcb616dbaa7ad18a4439e0565211d31071ef1b85a0627db74a05d978c60d507695eaeea5c7bd9868a21d06923", - "0xacdadff26e3132d9478a818ef770e9fa0d2b56c6f5f48bd3bd674436ccce9bdfc34db884a73a30c04c5f5e9764cb2218", - "0xa0d3e64c9c71f84c0eef9d7a9cb4fa184224b969db5514d678e93e00f98b41595588ca802643ea225512a4a272f5f534", - "0x91c9140c9e1ba6e330cb08f6b2ce4809cd0d5a0f0516f70032bf30e912b0ed684d07b413b326ab531ee7e5b4668c799b", - "0x87bc2ee7a0c21ba8334cd098e35cb703f9af57f35e091b8151b9b63c3a5b0f89bd7701dbd44f644ea475901fa6d9ef08", - "0x9325ccbf64bf5d71b303e31ee85d486298f9802c5e55b2c3d75427097bf8f60fa2ab4fcaffa9b60bf922c3e24fbd4b19", - "0x95d0506e898318f3dc8d28d16dfd9f0038b54798838b3c9be2a2ae3c2bf204eb496166353fc042220b0bd4f6673b9285", - "0x811de529416331fe9c416726d45df9434c29dcd7e949045eb15740f47e97dde8f31489242200e19922cac2a8b7c6fd1f", - "0xade632d04a4c8bbab6ca7df370b2213cb9225023e7973f0e29f4f5e52e8aeaabc65171306bbdd12a67b195dfbb96d48f", - "0x88b7f029e079b6ae956042c0ea75d53088c5d0efd750dd018adaeacf46be21bf990897c58578c491f41afd3978d08073", - "0x91f477802de507ffd2be3f4319903119225b277ad24f74eb50f28b66c14d32fae53c7edb8c7590704741af7f7f3e3654", - "0x809838b32bb4f4d0237e98108320d4b079ee16ed80c567e7548bd37e4d7915b1192880f4812ac0e00476d246aec1dbc8", - "0x84183b5fc4a7997a8ae5afedb4d21dce69c480d5966b5cbdafd6dd10d29a9a6377f3b90ce44da0eb8b176ac3af0253bb", - "0x8508abbf6d3739a16b9165caf0f95afb3b3ac1b8c38d6d374cf0c91296e2c1809a99772492b539cda184510bce8a0271", - "0x8722054e59bab2062e6419a6e45fc803af77fde912ef2cd23055ad0484963de65a816a2debe1693d93c18218d2b8e81a", - "0x8e895f80e485a7c4f56827bf53d34b956281cdc74856c21eb3b51f6288c01cc3d08565a11cc6f3e2604775885490e8c5", - "0xafc92714771b7aa6e60f3aee12efd9c2595e9659797452f0c1e99519f67c8bc3ac567119c1ddfe82a3e961ee9defea9a", - "0x818ff0fd9cefd32db87b259e5fa32967201016fc02ef44116cdca3c63ce5e637756f60477a408709928444a8ad69c471", - "0x8251e29af4c61ae806fc5d032347fb332a94d472038149225298389495139ce5678fae739d02dfe53a231598a992e728", - "0xa0ea39574b26643f6f1f48f99f276a8a64b5481989cfb2936f9432a3f8ef5075abfe5c067dc5512143ce8bf933984097", - "0xaf67a73911b372bf04e57e21f289fc6c3dfac366c6a01409b6e76fea4769bdb07a6940e52e8d7d3078f235c6d2f632c6", - "0xb5291484ef336024dd2b9b4cf4d3a6b751133a40656d0a0825bcc6d41c21b1c79cb50b0e8f4693f90c29c8f4358641f9", - "0x8bc0d9754d70f2cb9c63f991902165a87c6535a763d5eece43143b5064ae0bcdce7c7a8f398f2c1c29167b2d5a3e6867", - "0x8d7faff53579ec8f6c92f661c399614cc35276971752ce0623270f88be937c414eddcb0997e14724a783905a026c8883", - "0x9310b5f6e675fdf60796f814dbaa5a6e7e9029a61c395761e330d9348a7efab992e4e115c8be3a43d08e90d21290c892", - "0xb5eb4f3eb646038ad2a020f0a42202532d4932e766da82b2c1002bf9c9c2e5336b54c8c0ffcc0e02d19dde2e6a35b6cc", - "0x91dabfd30a66710f1f37a891136c9be1e23af4abf8cb751f512a40c022a35f8e0a4fb05b17ec36d4208de02d56f0d53a", - "0xb3ded14e82d62ac7a5a036122a62f00ff8308498f3feae57d861babaff5a6628d43f0a0c5fc903f10936bcf4e2758ceb", - "0xa88e8348fed2b26acca6784d19ef27c75963450d99651d11a950ea81d4b93acd2c43e0ecce100eaf7e78508263d5baf3", - "0xb1f5bbf7c4756877b87bb42163ac570e08c6667c4528bf68b5976680e19beeff7c5effd17009b0718797077e2955457a", - "0xad2e7b516243f915d4d1415326e98b1a7390ae88897d0b03b66c2d9bd8c3fba283d7e8fe44ed3333296a736454cef6d8", - "0x8f82eae096d5b11f995de6724a9af895f5e1c58d593845ad16ce8fcae8507e0d8e2b2348a0f50a1f66a17fd6fac51a5c", - "0x890e4404d0657c6c1ee14e1aac132ecf7a568bb3e04137b85ac0f84f1d333bd94993e8750f88eee033a33fb00f85dcc7", - "0x82ac7d3385e035115f1d39a99fc73e5919de44f5e6424579776d118d711c8120b8e5916372c6f27bed4cc64cac170b6c", - "0x85ee16d8901c272cfbbe966e724b7a891c1bd5e68efd5d863043ad8520fc409080af61fd726adc680b3f1186fe0ac8b8", - "0x86dc564c9b545567483b43a38f24c41c6551a49cabeebb58ce86404662a12dbfafd0778d30d26e1c93ce222e547e3898", - "0xa29f5b4522db26d88f5f95f18d459f8feefab02e380c2edb65aa0617a82a3c1a89474727a951cef5f15050bcf7b380fb", - "0xa1ce039c8f6cac53352899edb0e3a72c76da143564ad1a44858bd7ee88552e2fe6858d1593bbd74aeee5a6f8034b9b9d", - "0x97f10d77983f088286bd7ef3e7fdd8fa275a56bec19919adf33cf939a90c8f2967d2b1b6fc51195cb45ad561202a3ed7", - "0xa25e2772e8c911aaf8712bdac1dd40ee061c84d3d224c466cfaae8e5c99604053f940cde259bd1c3b8b69595781dbfec", - "0xb31bb95a0388595149409c48781174c340960d59032ab2b47689911d03c68f77a2273576fbe0c2bf4553e330656058c7", - "0xb8b2e9287ad803fb185a13f0d7456b397d4e3c8ad5078f57f49e8beb2e85f661356a3392dbd7bcf6a900baa5582b86a1", - "0xa3d0893923455eb6e96cc414341cac33d2dbc88fba821ac672708cce131761d85a0e08286663a32828244febfcae6451", - "0x82310cb42f647d99a136014a9f881eb0b9791efd2e01fc1841907ad3fc8a9654d3d1dab6689c3607214b4dc2aca01cee", - "0x874022d99c16f60c22de1b094532a0bc6d4de700ad01a31798fac1d5088b9a42ad02bef8a7339af7ed9c0d4f16b186ee", - "0x94981369e120265aed40910eebc37eded481e90f4596b8d57c3bec790ab7f929784bd33ddd05b7870aad6c02e869603b", - "0xa4f1f50e1e2a73f07095e0dd31cb45154f24968dae967e38962341c1241bcd473102fff1ff668b20c6547e9732d11701", - "0xae2328f3b0ad79fcda807e69a1b5278145225083f150f67511dafc97e079f860c3392675f1752ae7e864c056e592205b", - "0x875d8c971e593ca79552c43d55c8c73b17cd20c81ff2c2fed1eb19b1b91e4a3a83d32df150dbfd5db1092d0aebde1e1f", - "0xadd2e80aa46aae95da73a11f130f4bda339db028e24c9b11e5316e75ba5e63bc991d2a1da172c7c8e8fee038baae3433", - "0xb46dbe1cb3424002aa7de51e82f600852248e251465c440695d52538d3f36828ff46c90ed77fc1d11534fe3c487df8ef", - "0xa5e5045d28b4e83d0055863c30c056628c58d4657e6176fd0536f5933f723d60e851bb726d5bf3c546b8ce4ac4a57ef8", - "0x91fec01e86dd1537e498fff7536ea3ca012058b145f29d9ada49370cd7b7193ac380e116989515df1b94b74a55c45df3", - "0xa7428176d6918cd916a310bdc75483c72de660df48cac4e6e7478eef03205f1827ea55afc0df5d5fa7567d14bbea7fc9", - "0x851d89bef45d9761fe5fdb62972209335193610015e16a675149519f9911373bac0919add226ef118d9f3669cfdf4734", - "0xb74acf5c149d0042021cb2422ea022be4c4f72a77855f42393e71ffd12ebb3eec16bdf16f812159b67b79a9706e7156d", - "0x99f35dce64ec99aa595e7894b55ce7b5a435851b396e79036ffb249c28206087db4c85379df666c4d95857db02e21ff9", - "0xb6b9a384f70db9e298415b8ab394ee625dafff04be2886476e59df8d052ca832d11ac68a9b93fba7ab055b7bc36948a4", - "0x898ee4aefa923ffec9e79f2219c7389663eb11eb5b49014e04ed4a336399f6ea1691051d86991f4c46ca65bcd4fdf359", - "0xb0f948217b0d65df7599a0ba4654a5e43c84db477936276e6f11c8981efc6eaf14c90d3650107ed4c09af4cc8ec11137", - "0xaa6286e27ac54f73e63dbf6f41865dd94d24bc0cf732262fcaff67319d162bb43af909f6f8ee27b1971939cfbba08141", - "0x8bca7cdf730cf56c7b2c8a2c4879d61361a6e1dba5a3681a1a16c17a56e168ace0e99cf0d15826a1f5e67e6b8a8a049a", - "0xa746d876e8b1ce225fcafca603b099b36504846961526589af977a88c60d31ba2cc56e66a3dec8a77b3f3531bf7524c9", - "0xa11e2e1927e6704cdb8874c75e4f1842cef84d7d43d7a38e339e61dc8ba90e61bbb20dd3c12e0b11d2471d58eed245be", - "0xa36395e22bc1d1ba8b0459a235203177737397da5643ce54ded3459d0869ff6d8d89f50c73cb62394bf66a959cde9b90", - "0x8b49f12ba2fdf9aca7e5f81d45c07d47f9302a2655610e7634d1e4bd16048381a45ef2c95a8dd5b0715e4b7cf42273af", - "0x91cffa2a17e64eb7f76bccbe4e87280ee1dd244e04a3c9eac12e15d2d04845d876eb24fe2ec6d6d266cce9efb281077f", - "0xa6b8afabf65f2dee01788114e33a2f3ce25376fb47a50b74da7c3c25ff1fdc8aa9f41307534abbf48acb6f7466068f69", - "0x8d13db896ccfea403bd6441191995c1a65365cab7d0b97fbe9526da3f45a877bd1f4ef2edef160e8a56838cd1586330e", - "0x98c717de9e01bef8842c162a5e757fe8552d53269c84862f4d451e7c656ae6f2ae473767b04290b134773f63be6fdb9d", - "0x8c2036ace1920bd13cf018e82848c49eb511fad65fd0ff51f4e4b50cf3bfc294afb63cba682c16f52fb595a98fa84970", - "0xa3520fdff05dbad9e12551b0896922e375f9e5589368bcb2cc303bde252743b74460cb5caf99629325d3620f13adc796", - "0x8d4f83a5bfec05caf5910e0ce538ee9816ee18d0bd44c1d0da2a87715a23cd2733ad4d47552c6dc0eb397687d611dd19", - "0xa7b39a0a6a02823452d376533f39d35029867b3c9a6ad6bca181f18c54132d675613a700f9db2440fb1b4fa13c8bf18a", - "0x80bcb114b2544b80f404a200fc36860ed5e1ad31fe551acd4661d09730c452831751baa9b19d7d311600d267086a70bc", - "0x90dcce03c6f88fc2b08f2b42771eedde90cc5330fe0336e46c1a7d1b5a6c1641e5fcc4e7b3d5db00bd8afca9ec66ed81", - "0xaec15f40805065c98e2965b1ae12a6c9020cfdb094c2d0549acfc7ea2401a5fb48d3ea7d41133cf37c4e096e7ff53eb9", - "0x80e129b735dba49fa627a615d6c273119acec8e219b2f2c4373a332b5f98d66cbbdd688dfbe72a8f8bfefaccc02c50c1", - "0xa9b596da3bdfe23e6799ece5f7975bf7a1979a75f4f546deeaf8b34dfe3e0d623217cb4cf4ccd504cfa3625b88cd53f1", - "0xabcbbb70b16f6e517c0ab4363ab76b46e4ff58576b5f8340e5c0e8cc0e02621b6e23d742d73b015822a238b17cfd7665", - "0xa046937cc6ea6a2e1adae543353a9fe929c1ae4ad655be1cc051378482cf88b041e28b1e9a577e6ccff2d3570f55e200", - "0x831279437282f315e65a60184ef158f0a3dddc15a648dc552bdc88b3e6fe8288d3cfe9f0031846d81350f5e7874b4b33", - "0x993d7916fa213c6d66e7c4cafafc1eaec9a2a86981f91c31eb8a69c5df076c789cbf498a24c84e0ee77af95b42145026", - "0x823907a3b6719f8d49b3a4b7c181bd9bb29fcf842d7c70660c4f351852a1e197ca46cf5e879b47fa55f616fa2b87ce5e", - "0x8d228244e26132b234930ee14c75d88df0943cdb9c276a8faf167d259b7efc1beec2a87c112a6c608ad1600a239e9aae", - "0xab6e55766e5bfb0cf0764ed909a8473ab5047d3388b4f46faeba2d1425c4754c55c6daf6ad4751e634c618b53e549529", - "0xab0cab6860e55a84c5ad2948a7e0989e2b4b1fd637605634b118361497332df32d9549cb854b2327ca54f2bcb85eed8f", - "0xb086b349ae03ef34f4b25a57bcaa5d1b29bd94f9ebf87e22be475adfe475c51a1230c1ebe13506cb72c4186192451658", - "0x8a0b49d8a254ca6d91500f449cbbfbb69bb516c6948ac06808c65595e46773e346f97a5ce0ef7e5a5e0de278af22709c", - "0xac49de11edaaf04302c73c578cc0824bdd165c0d6321be1c421c1950e68e4f3589aa3995448c9699e93c6ebae8803e27", - "0x884f02d841cb5d8f4c60d1402469216b114ab4e93550b5bc1431756e365c4f870a9853449285384a6fa49e12ce6dc654", - "0xb75f3a28fa2cc8d36b49130cb7448a23d73a7311d0185ba803ad55c8219741d451c110f48b786e96c728bc525903a54f", - "0x80ae04dbd41f4a35e33f9de413b6ad518af0919e5a30cb0fa1b061b260420780bb674f828d37fd3b52b5a31673cbd803", - "0xb9a8011eb5fcea766907029bf743b45262db3e49d24f84503687e838651ed11cb64c66281e20a0ae9f6aa51acc552263", - "0x90bfdd75e2dc9cf013e22a5d55d2d2b8a754c96103a17524488e01206e67f8b6d52b1be8c4e3d5307d4fe06d0e51f54c", - "0xb4af353a19b06203a815ec43e79a88578cc678c46f5a954b85bc5c53b84059dddba731f3d463c23bfd5273885c7c56a4", - "0xaa125e96d4553b64f7140e5453ff5d2330318b69d74d37d283e84c26ad672fa00e3f71e530eb7e28be1e94afb9c4612e", - "0xa18e060aee3d49cde2389b10888696436bb7949a79ca7d728be6456a356ea5541b55492b2138da90108bd1ce0e6f5524", - "0x93e55f92bdbccc2de655d14b1526836ea2e52dba65eb3f87823dd458a4cb5079bf22ce6ef625cb6d6bfdd0995ab9a874", - "0x89f5a683526b90c1c3ceebbb8dc824b21cff851ce3531b164f6626e326d98b27d3e1d50982e507d84a99b1e04e86a915", - "0x83d1c38800361633a3f742b1cb2bfc528129496e80232611682ddbe403e92c2ac5373aea0bca93ecb5128b0b2b7a719e", - "0x8ecba560ac94905e19ce8d9c7af217bf0a145d8c8bd38e2db82f5e94cc3f2f26f55819176376b51f154b4aab22056059", - "0xa7e2a4a002b60291924850642e703232994acb4cfb90f07c94d1e0ecd2257bb583443283c20fc6017c37e6bfe85b7366", - "0x93ed7316fa50b528f1636fc6507683a672f4f4403e55e94663f91221cc198199595bd02eef43d609f451acc9d9b36a24", - "0xa1220a8ebc5c50ceed76a74bc3b7e0aa77f6884c71b64b67c4310ac29ce5526cb8992d6abc13ef6c8413ce62486a6795", - "0xb2f6eac5c869ad7f4a25161d3347093e2f70e66cd925032747e901189355022fab3038bca4d610d2f68feb7e719c110b", - "0xb703fa11a4d511ca01c7462979a94acb40b5d933759199af42670eb48f83df202fa0c943f6ab3b4e1cc54673ea3aab1e", - "0xb5422912afbfcb901f84791b04f1ddb3c3fbdc76d961ee2a00c5c320e06d3cc5b5909c3bb805df66c5f10c47a292b13d", - "0xad0934368da823302e1ac08e3ede74b05dfdbfffca203e97ffb0282c226814b65c142e6e15ec1e754518f221f01b30f7", - "0xa1dd302a02e37df15bf2f1147efe0e3c06933a5a767d2d030e1132f5c3ce6b98e216b6145eb39e1e2f74e76a83165b8d", - "0xa346aab07564432f802ae44738049a36f7ca4056df2d8f110dbe7fef4a3e047684dea609b2d03dc6bf917c9c2a47608f", - "0xb96c5f682a5f5d02123568e50f5d0d186e4b2c4c9b956ec7aabac1b3e4a766d78d19bd111adb5176b898e916e49be2aa", - "0x8a96676d56876fc85538db2e806e1cba20fd01aeb9fa3cb43ca6ca94a2c102639f65660db330e5d74a029bb72d6a0b39", - "0xab0048336bd5c3def1a4064eadd49e66480c1f2abb4df46e03afbd8a3342c2c9d74ee35d79f08f4768c1646681440984", - "0x888427bdf76caec90814c57ee1c3210a97d107dd88f7256f14f883ad0f392334b82be11e36dd8bfec2b37935177c7831", - "0xb622b282becf0094a1916fa658429a5292ba30fb48a4c8066ce1ddcefb71037948262a01c95bab6929ed3a76ba5db9fe", - "0xb5b9e005c1f456b6a368a3097634fb455723abe95433a186e8278dceb79d4ca2fbe21f8002e80027b3c531e5bf494629", - "0xa3c6707117a1e48697ed41062897f55d8119403eea6c2ee88f60180f6526f45172664bfee96bf61d6ec0b7fbae6aa058", - "0xb02a9567386a4fbbdb772d8a27057b0be210447348efe6feb935ceec81f361ed2c0c211e54787dc617cdffed6b4a6652", - "0xa9b8364e40ef15c3b5902e5534998997b8493064fa2bea99600def58279bb0f64574c09ba11e9f6f669a8354dd79dc85", - "0x9998a2e553a9aa9a206518fae2bc8b90329ee59ab23005b10972712389f2ec0ee746033c733092ffe43d73d33abbb8ef", - "0x843a4b34d9039bf79df96d79f2d15e8d755affb4d83d61872daf540b68c0a3888cf8fc00d5b8b247b38524bcb3b5a856", - "0x84f7128920c1b0bb40eee95701d30e6fc3a83b7bb3709f16d97e72acbb6057004ee7ac8e8f575936ca9dcb7866ab45f7", - "0x918d3e2222e10e05edb34728162a899ad5ada0aaa491aeb7c81572a9c0d506e31d5390e1803a91ff3bd8e2bb15d47f31", - "0x9442d18e2489613a7d47bb1cb803c8d6f3259d088cd079460976d87f7905ee07dea8f371b2537f6e1d792d36d7e42723", - "0xb491976970fe091995b2ed86d629126523ccf3e9daf8145302faca71b5a71a5da92e0e05b62d7139d3efac5c4e367584", - "0xaa628006235dc77c14cef4c04a308d66b07ac92d377df3de1a2e6ecfe3144f2219ad6d7795e671e1cb37a3641910b940", - "0x99d386adaea5d4981d7306feecac9a555b74ffdc218c907c5aa7ac04abaead0ec2a8237300d42a3fbc464673e417ceed", - "0x8f78e8b1556f9d739648ea3cab9606f8328b52877fe72f9305545a73b74d49884044ba9c1f1c6db7d9b7c7b7c661caba", - "0x8fb357ae49932d0babdf74fc7aa7464a65d3b6a2b3acf4f550b99601d3c0215900cfd67f2b6651ef94cfc323bac79fae", - "0x9906f2fa25c0290775aa001fb6198113d53804262454ae8b83ef371b5271bde189c0460a645829cb6c59f9ee3a55ce4d", - "0x8f4379b3ebb50e052325b27655ca6a82e6f00b87bf0d2b680d205dd2c7afdc9ff32a9047ae71a1cdf0d0ce6b9474d878", - "0xa85534e88c2bd43c043792eaa75e50914b21741a566635e0e107ae857aed0412035f7576cf04488ade16fd3f35fdbb87", - "0xb4ce93199966d3c23251ca7f28ec5af7efea1763d376b0385352ffb2e0a462ef95c69940950278cf0e3dafd638b7bd36", - "0xb10cb3d0317dd570aa73129f4acf63c256816f007607c19b423fb42f65133ce21f2f517e0afb41a5378cccf893ae14d0", - "0xa9b231c9f739f7f914e5d943ed9bff7eba9e2c333fbd7c34eb1648a362ee01a01af6e2f7c35c9fe962b11152cddf35de", - "0x99ff6a899e156732937fb81c0cced80ae13d2d44c40ba99ac183aa246103b31ec084594b1b7feb96da58f4be2dd5c0ed", - "0x8748d15d18b75ff2596f50d6a9c4ce82f61ecbcee123a6ceae0e43cab3012a29b6f83cf67b48c22f6f9d757c6caf76b2", - "0xb88ab05e4248b7fb634cf640a4e6a945d13e331237410f7217d3d17e3e384ddd48897e7a91e4516f1b9cbd30f35f238b", - "0x8d826deaeeb84a3b2d2c04c2300ca592501f992810582d6ae993e0d52f6283a839dba66c6c72278cff5871802b71173b", - "0xb36fed027c2f05a5ef625ca00b0364b930901e9e4420975b111858d0941f60e205546474bb25d6bfa6928d37305ae95f", - "0xaf2fcfc6b87967567e8b8a13a4ed914478185705724e56ce68fb2df6d1576a0cf34a61e880997a0d35dc2c3276ff7501", - "0xac351b919cd1fbf106feb8af2c67692bfcddc84762d18cea681cfa7470a5644839caace27efee5f38c87d3df306f4211", - "0x8d6665fb1d4d8d1fa23bd9b8a86e043b8555663519caac214d1e3e3effbc6bee7f2bcf21e645f77de0ced279d69a8a8b", - "0xa9fc1c2061756b2a1a169c1b149f212ff7f0d2488acd1c5a0197eba793cffa593fc6d1d1b40718aa75ca3ec77eff10e1", - "0xaff64f0fa009c7a6cf0b8d7a22ddb2c8170c3cb3eec082e60d5aadb00b0040443be8936d728d99581e33c22178c41c87", - "0x82e0b181adc5e3b1c87ff8598447260e839d53debfae941ebea38265575546c3a74a14b4325a030833a62ff6c52d9365", - "0xb7ad43cbb22f6f892c2a1548a41dc120ab1f4e1b8dea0cb6272dd9cb02054c542ecabc582f7e16de709d48f5166cae86", - "0x985e0c61094281532c4afb788ecb2dfcba998e974b5d4257a22040a161883908cdd068fe80f8eb49b8953cfd11acf43a", - "0xae46895c6d67ea6d469b6c9c07b9e5d295d9ae73b22e30da4ba2c973ba83a130d7eef39717ec9d0f36e81d56bf742671", - "0x8600177ea1f7e7ef90514b38b219a37dedfc39cb83297e4c7a5b479817ef56479d48cf6314820960c751183f6edf8b0e", - "0xb9208ec1c1d7a1e99b59c62d3e4e61dfb706b0e940d09d3abfc3454c19749083260614d89cfd7e822596c3cdbcc6bb95", - "0xa1e94042c796c2b48bc724352d2e9f3a22291d9a34705993357ddb6adabd76da6fc25dac200a8cb0b5bbd99ecddb7af6", - "0xb29c3adedd0bcad8a930625bc4dfdc3552a9afd5ca6dd9c0d758f978068c7982b50b711aa0eb5b97f2b84ee784637835", - "0xaf0632a238bb1f413c7ea8e9b4c3d68f2827bd2e38cd56024391fba6446ac5d19a780d0cfd4a78fe497d537b766a591a", - "0xaaf6e7f7d54f8ef5e2e45dd59774ecbeecf8683aa70483b2a75be6a6071b5981bbaf1627512a65d212817acdfab2e428", - "0x8c751496065da2e927cf492aa5ca9013b24f861d5e6c24b30bbf52ec5aaf1905f40f9a28175faef283dd4ed4f2182a09", - "0x8952377d8e80a85cf67d6b45499f3bad5fd452ea7bcd99efc1b066c4720d8e5bff1214cea90fd1f972a7f0baac3d29be", - "0xa1946ee543d1a6e21f380453be4d446e4130950c5fc3d075794eb8260f6f52d0a795c1ff91d028a648dc1ce7d9ab6b47", - "0x89f3fefe37af31e0c17533d2ca1ce0884cc1dc97c15cbfab9c331b8debd94781c9396abef4bb2f163d09277a08d6adf0", - "0xa2753f1e6e1a154fb117100a5bd9052137add85961f8158830ac20541ab12227d83887d10acf7fd36dcaf7c2596d8d23", - "0x814955b4198933ee11c3883863b06ff98c7eceb21fc3e09df5f916107827ccf3323141983e74b025f46ae00284c9513b", - "0x8cc5c6bb429073bfef47cae7b3bfccb0ffa076514d91a1862c6bda4d581e0df87db53cc6c130bf8a7826304960f5a34e", - "0x909f22c1f1cdc87f7be7439c831a73484a49acbf8f23d47087d7cf867c64ef61da3bde85dc57d705682b4c3fc710d36e", - "0x8048fee7f276fcd504aed91284f28e73693615e0eb3858fa44bcf79d7285a9001c373b3ef71d9a3054817ba293ebe28c", - "0x94400e5cf5d2700ca608c5fe35ce14623f71cc24959f2bc27ca3684092850f76b67fb1f07ca9e5b2ca3062cf8ad17bd4", - "0x81c2ae7d4d1b17f8b6de6a0430acc0d58260993980fe48dc2129c4948269cdc74f9dbfbf9c26b19360823fd913083d48", - "0x8c41fe765128e63f6889d6a979f6a4342300327c8b245a8cfe3ecfbcac1e09c3da30e2a1045b24b78efc6d6d50c8c6ac", - "0xa5dd4ae51ae48c8be4b218c312ade226cffce671cf121cb77810f6c0990768d6dd767badecb5c69921d5574d5e8433d3", - "0xb7642e325f4ba97ae2a39c1c9d97b35aafd49d53dba36aed3f3cb0ca816480b3394079f46a48252d46596559c90f4d58", - "0xae87375b40f35519e7bd4b1b2f73cd0b329b0c2cb9d616629342a71c6c304338445eda069b78ea0fbe44087f3de91e09", - "0xb08918cb6f736855e11d3daca1ddfbdd61c9589b203b5493143227bf48e2c77c2e8c94b0d1aa2fab2226e0eae83f2681", - "0xac36b84a4ac2ebd4d6591923a449c564e3be8a664c46092c09e875c2998eba16b5d32bfd0882fd3851762868e669f0b1", - "0xa44800a3bb192066fa17a3f29029a23697240467053b5aa49b9839fb9b9b8b12bcdcbfc557f024b61f4f51a9aacdefcb", - "0x9064c688fec23441a274cdf2075e5a449caf5c7363cc5e8a5dc9747183d2e00a0c69f2e6b3f6a7057079c46014c93b3b", - "0xaa367b021469af9f5b764a79bb3afbe2d87fe1e51862221672d1a66f954b165778b7c27a705e0f93841fab4c8468344d", - "0xa1a8bfc593d4ab71f91640bc824de5c1380ab2591cfdafcbc78a14b32de3c0e15f9d1b461d85c504baa3d4232c16bb53", - "0x97df48da1799430f528184d30b6baa90c2a2f88f34cdfb342d715339c5ebd6d019aa693cea7c4993daafc9849063a3aa", - "0xabd923831fbb427e06e0dd335253178a9e5791395c84d0ab1433c07c53c1209161097e9582fb8736f8a60bde62d8693e", - "0x84cd1a43f1a438b43dc60ffc775f646937c4f6871438163905a3cebf1115f814ccd38a6ccb134130bff226306e412f32", - "0x91426065996b0743c5f689eb3ca68a9f7b9e4d01f6c5a2652b57fa9a03d8dc7cd4bdbdab0ca5a891fee1e97a7f00cf02", - "0xa4bee50249db3df7fd75162b28f04e57c678ba142ce4d3def2bc17bcb29e4670284a45f218dad3969af466c62a903757", - "0x83141ebcc94d4681404e8b67a12a46374fded6df92b506aff3490d875919631408b369823a08b271d006d5b93136f317", - "0xa0ea1c8883d58d5a784da3d8c8a880061adea796d7505c1f903d07c287c5467f71e4563fc0faafbc15b5a5538b0a7559", - "0x89d9d480574f201a87269d26fb114278ed2c446328df431dc3556e3500e80e4cd01fcac196a2459d8646361ebda840df", - "0x8bf302978973632dd464bec819bdb91304712a3ec859be071e662040620422c6e75eba6f864f764cffa2799272efec39", - "0x922f666bc0fd58b6d7d815c0ae4f66d193d32fc8382c631037f59eeaeae9a8ca6c72d08e72944cf9e800b8d639094e77", - "0x81ad8714f491cdff7fe4399f2eb20e32650cff2999dd45b9b3d996d54a4aba24cc6c451212e78c9e5550368a1a38fb3f", - "0xb58fcf4659d73edb73175bd9139d18254e94c3e32031b5d4b026f2ed37aa19dca17ec2eb54c14340231615277a9d347e", - "0xb365ac9c2bfe409b710928c646ea2fb15b28557e0f089d39878e365589b9d1c34baf5566d20bb28b33bb60fa133f6eff", - "0x8fcae1d75b53ab470be805f39630d204853ca1629a14158bac2f52632277d77458dec204ff84b7b2d77e641c2045be65", - "0xa03efa6bebe84f4f958a56e2d76b5ba4f95dd9ed7eb479edc7cc5e646c8d4792e5b0dfc66cc86aa4b4afe2f7a4850760", - "0xaf1c823930a3638975fb0cc5c59651771b2719119c3cd08404fbd4ce77a74d708cefbe3c56ea08c48f5f10e6907f338f", - "0x8260c8299b17898032c761c325ac9cabb4c5b7e735de81eacf244f647a45fb385012f4f8df743128888c29aefcaaad16", - "0xab2f37a573c82e96a8d46198691cd694dfa860615625f477e41f91b879bc58a745784fccd8ffa13065834ffd150d881d", - "0x986c746c9b4249352d8e5c629e8d7d05e716b3c7aab5e529ca969dd1e984a14b5be41528baef4c85d2369a42d7209216", - "0xb25e32da1a8adddf2a6080725818b75bc67240728ad1853d90738485d8924ea1e202df0a3034a60ffae6f965ec55cf63", - "0xa266e627afcebcefea6b6b44cbc50f5c508f7187e87d047b0450871c2a030042c9e376f3ede0afcf9d1952f089582f71", - "0x86c3bbca4c0300606071c0a80dbdec21ce1dd4d8d4309648151c420854032dff1241a1677d1cd5de4e4de4385efda986", - "0xb9a21a1fe2d1f3273a8e4a9185abf2ff86448cc98bfa435e3d68306a2b8b4a6a3ea33a155be3cb62a2170a86f77679a5", - "0xb117b1ea381adce87d8b342cba3a15d492ff2d644afa28f22424cb9cbc820d4f7693dfc1a4d1b3697046c300e1c9b4c8", - "0x9004c425a2e68870d6c69b658c344e3aa3a86a8914ee08d72b2f95c2e2d8a4c7bb0c6e7e271460c0e637cec11117bf8e", - "0x86a18aa4783b9ebd9131580c8b17994825f27f4ac427b0929a1e0236907732a1c8139e98112c605488ee95f48bbefbfc", - "0x84042243b955286482ab6f0b5df4c2d73571ada00716d2f737ca05a0d2e88c6349e8ee9e67934cfee4a1775dbf7f4800", - "0x92c2153a4733a62e4e1d5b60369f3c26777c7d01cd3c8679212660d572bd3bac9b8a8a64e1f10f7dbf5eaa7579c4e423", - "0x918454b6bb8e44a2afa144695ba8d48ae08d0cdfef4ad078f67709eddf3bb31191e8b006f04e82ea45a54715ef4d5817", - "0xacf0b54f6bf34cf6ed6c2b39cf43194a40d68de6bcf1e4b82c34c15a1343e9ac3737885e1a30b78d01fa3a5125463db8", - "0xa7d60dbe4b6a7b054f7afe9ee5cbbfeca0d05dc619e6041fa2296b549322529faddb8a11e949562309aecefb842ac380", - "0x91ffb53e6d7e5f11159eaf13e783d6dbdfdb1698ed1e6dbf3413c6ea23492bbb9e0932230a9e2caac8fe899a17682795", - "0xb6e8d7be5076ee3565d5765a710c5ecf17921dd3cf555c375d01e958a365ae087d4a88da492a5fb81838b7b92bf01143", - "0xa8c6b763de2d4b2ed42102ef64eccfef31e2fb2a8a2776241c82912fa50fc9f77f175b6d109a97ede331307c016a4b1a", - "0x99839f86cb700c297c58bc33e28d46b92931961548deac29ba8df91d3e11721b10ea956c8e16984f9e4acf1298a79b37", - "0x8c2e2c338f25ea5c25756b7131cde0d9a2b35abf5d90781180a00fe4b8e64e62590dc63fe10a57fba3a31c76d784eb01", - "0x9687d7df2f41319ca5469d91978fed0565a5f11f829ebadaa83db92b221755f76c6eacd7700735e75c91e257087512e3", - "0x8795fdfb7ff8439c58b9bf58ed53873d2780d3939b902b9ddaaa4c99447224ced9206c3039a23c2c44bcc461e2bb637f", - "0xa803697b744d2d087f4e2307218d48fa88620cf25529db9ce71e2e3bbcc65bac5e8bb9be04777ef7bfb5ed1a5b8e6170", - "0x80f3d3efbbb9346ddd413f0a8e36b269eb5d7ff6809d5525ff9a47c4bcab2c01b70018b117f6fe05253775612ff70c6b", - "0x9050e0e45bcc83930d4c505af35e5e4d7ca01cd8681cba92eb55821aececcebe32bb692ebe1a4daac4e7472975671067", - "0x8d206812aac42742dbaf233e0c080b3d1b30943b54b60283515da005de05ea5caa90f91fedcfcba72e922f64d7040189", - "0xa2d44faaeb2eff7915c83f32b13ca6f31a6847b1c1ce114ea240bac3595eded89f09b2313b7915ad882292e2b586d5b4", - "0x961776c8576030c39f214ea6e0a3e8b3d32f023d2600958c098c95c8a4e374deeb2b9dc522adfbd6bda5949bdc09e2a2", - "0x993fa7d8447407af0fbcd9e6d77f815fa5233ab00674efbcf74a1f51c37481445ae291cc7b76db7c178f9cb0e570e0fc", - "0xabd5b1c78e05f9d7c8cc99bdaef8b0b6a57f2daf0f02bf492bec48ea4a27a8f1e38b5854da96efff11973326ff980f92", - "0x8f15af4764bc275e6ccb892b3a4362cacb4e175b1526a9a99944e692fe6ccb1b4fc19abf312bb2a089cb1f344d91a779", - "0xa09b27ccd71855512aba1d0c30a79ffbe7f6707a55978f3ced50e674b511a79a446dbc6d7946add421ce111135a460af", - "0x94b2f98ce86a9271fbd4153e1fc37de48421fe3490fb3840c00f2d5a4d0ba8810c6a32880b002f6374b59e0a7952518b", - "0x8650ac644f93bbcb88a6a0f49fee2663297fd4bc6fd47b6a89b9d8038d32370438ab3a4775ec9b58cb10aea8a95ef7b6", - "0x95e5c2f2e84eed88c6980bbba5a1c0bb375d5a628bff006f7516d45bb7d723da676add4fdd45956f312e7bab0f052644", - "0xb3278a3fa377ac93af7cfc9453f8cb594aae04269bbc99d2e0e45472ff4b6a2f97a26c4c57bf675b9d86f5e77a5d55d1", - "0xb4bcbe6eb666a206e2ea2f877912c1d3b5bdbd08a989fc4490eb06013e1a69ad1ba08bcdac048bf29192312be399077b", - "0xa76d70b78c99fffcbf9bb9886eab40f1ea4f99a309710b660b64cbf86057cbcb644d243f6e341711bb7ef0fedf0435a7", - "0xb2093c1ee945dca7ac76ad5aed08eae23af31dd5a77c903fd7b6f051f4ab84425d33a03c3d45bf2907bc93c02d1f3ad8", - "0x904b1f7534e053a265b22d20be859912b9c9ccb303af9a8d6f1d8f6ccdc5c53eb4a45a1762b880d8444d9be0cd55e7f9", - "0x8f664a965d65bc730c9ef1ec7467be984d4b8eb46bd9b0d64e38e48f94e6e55dda19aeac82cbcf4e1473440e64c4ca18", - "0x8bcee65c4cc7a7799353d07b114c718a2aae0cd10a3f22b7eead5185d159dafd64852cb63924bf87627d176228878bce", - "0x8c78f2e3675096fef7ebaa898d2615cd50d39ca3d8f02b9bdfb07e67da648ae4be3da64838dffc5935fd72962c4b96c7", - "0x8c40afd3701629421fec1df1aac4e849384ef2e80472c0e28d36cb1327acdf2826f99b357f3d7afdbc58a6347fc40b3c", - "0xa197813b1c65a8ea5754ef782522a57d63433ef752215ecda1e7da76b0412ee619f58d904abd2e07e0c097048b6ae1dd", - "0xa670542629e4333884ad7410f9ea3bd6f988df4a8f8a424ca74b9add2312586900cf9ae8bd50411f9146e82626b4af56", - "0xa19875cc07ab84e569d98b8b67fb1dbbdfb59093c7b748fae008c8904a6fd931a63ca8d03ab5fea9bc8d263568125a9b", - "0xb57e7f68e4eb1bd04aafa917b1db1bdab759a02aa8a9cdb1cba34ba8852b5890f655645c9b4e15d5f19bf37e9f2ffe9f", - "0x8abe4e2a4f6462b6c64b3f10e45db2a53c2b0d3c5d5443d3f00a453e193df771eda635b098b6c8604ace3557514027af", - "0x8459e4fb378189b22b870a6ef20183deb816cefbf66eca1dc7e86d36a2e011537db893729f500dc154f14ce24633ba47", - "0x930851df4bc7913c0d8c0f7bd3b071a83668987ed7c397d3d042fdc0d9765945a39a3bae83da9c88cb6b686ed8aeeb26", - "0x8078c9e5cd05e1a8c932f8a1d835f61a248b6e7133fcbb3de406bf4ffc0e584f6f9f95062740ba6008d98348886cf76b", - "0xaddff62bb29430983fe578e3709b0949cdc0d47a13a29bc3f50371a2cb5c822ce53e2448cfaa01bcb6e0aa850d5a380e", - "0x9433add687b5a1e12066721789b1db2edf9b6558c3bdc0f452ba33b1da67426abe326e9a34d207bfb1c491c18811bde1", - "0x822beda3389963428cccc4a2918fa9a8a51cf0919640350293af70821967108cded5997adae86b33cb917780b097f1ca", - "0xa7a9f52bda45e4148ed56dd176df7bd672e9b5ed18888ccdb405f47920fdb0844355f8565cefb17010b38324edd8315f", - "0xb35c3a872e18e607b2555c51f9696a17fa18da1f924d503b163b4ec9fe22ed0c110925275cb6c93ce2d013e88f173d6a", - "0xadf34b002b2b26ab84fc1bf94e05bd8616a1d06664799ab149363c56a6e0c807fdc473327d25632416e952ea327fcd95", - "0xae4a6b9d22a4a3183fac29e2551e1124a8ce4a561a9a2afa9b23032b58d444e6155bb2b48f85c7b6d70393274e230db7", - "0xa2ea3be4fc17e9b7ce3110284038d46a09e88a247b6971167a7878d9dcf36925d613c382b400cfa4f37a3ebea3699897", - "0x8e5863786b641ce3140fbfe37124d7ad3925472e924f814ebfc45959aaf3f61dc554a597610b5defaecc85b59a99b50f", - "0xaefde3193d0f700d0f515ab2aaa43e2ef1d7831c4f7859f48e52693d57f97fa9e520090f3ed700e1c966f4b76048e57f", - "0x841a50f772956622798e5cd208dc7534d4e39eddee30d8ce133383d66e5f267e389254a0cdae01b770ecd0a9ca421929", - "0x8fbc2bfd28238c7d47d4c03b1b910946c0d94274a199575e5b23242619b1de3497784e646a92aa03e3e24123ae4fcaba", - "0x926999579c8eec1cc47d7330112586bdca20b4149c8b2d066f527c8b9f609e61ce27feb69db67eea382649c6905efcf9", - "0xb09f31f305efcc65589adf5d3690a76cf339efd67cd43a4e3ced7b839507466e4be72dd91f04e89e4bbef629d46e68c0", - "0xb917361f6b95f759642638e0b1d2b3a29c3bdef0b94faa30de562e6078c7e2d25976159df3edbacbf43614635c2640b4", - "0x8e7e8a1253bbda0e134d62bfe003a2669d471b47bd2b5cde0ff60d385d8e62279d54022f5ac12053b1e2d3aaa6910b4c", - "0xb69671a3c64e0a99d90b0ed108ce1912ff8ed983e4bddd75a370e9babde25ee1f5efb59ec707edddd46793207a8b1fe7", - "0x910b2f4ebd37b7ae94108922b233d0920b4aba0bd94202c70f1314418b548d11d8e9caa91f2cd95aff51b9432d122b7f", - "0x82f645c90dfb52d195c1020346287c43a80233d3538954548604d09fbab7421241cde8593dbc4acc4986e0ea39a27dd9", - "0x8fee895f0a140d88104ce442fed3966f58ff9d275e7373483f6b4249d64a25fb5374bbdc6bce6b5ab0270c2847066f83", - "0x84f5bd7aab27b2509397aeb86510dd5ac0a53f2c8f73799bf720f2f87a52277f8d6b0f77f17bc80739c6a7119b7eb062", - "0x9903ceced81099d7e146e661bcf01cbaccab5ba54366b85e2177f07e2d8621e19d9c9c3eee14b9266de6b3f9b6ea75ae", - "0xb9c16ea2a07afa32dd6c7c06df0dec39bca2067a9339e45475c98917f47e2320f6f235da353fd5e15b477de97ddc68dd", - "0x9820a9bbf8b826bec61ebf886de2c4f404c1ebdc8bab82ee1fea816d9de29127ce1852448ff717a3fe8bbfe9e92012e5", - "0x817224d9359f5da6f2158c2c7bf9165501424f063e67ba9859a07ab72ee2ee62eb00ca6da821cfa19065c3282ca72c74", - "0x94b95c465e6cb00da400558a3c60cfec4b79b27e602ca67cbc91aead08de4b6872d8ea096b0dc06dca4525c8992b8547", - "0xa2b539a5bccd43fa347ba9c15f249b417997c6a38c63517ca38394976baa08e20be384a360969ff54e7e721db536b3e5", - "0x96caf707e34f62811ee8d32ccf28d8d6ec579bc33e424d0473529af5315c456fd026aa910c1fed70c91982d51df7d3ca", - "0x8a77b73e890b644c6a142bdbac59b22d6a676f3b63ddafb52d914bb9d395b8bf5aedcbcc90429337df431ebd758a07a6", - "0x8857830a7351025617a08bc44caec28d2fae07ebf5ffc9f01d979ce2a53839a670e61ae2783e138313929129790a51a1", - "0xaa3e420321ed6f0aa326d28d1a10f13facec6f605b6218a6eb9cbc074801f3467bf013a456d1415a5536f12599efa3d3", - "0x824aed0951957b00ea2f3d423e30328a3527bf6714cf9abbae84cf27e58e5c35452ba89ccc011de7c68c75d6e021d8f1", - "0xa2e87cc06bf202e953fb1081933d8b4445527dde20e38ed1a4f440144fd8fa464a2b73e068b140562e9045e0f4bd3144", - "0xae3b8f06ad97d7ae3a5e5ca839efff3e4824dc238c0c03fc1a8d2fc8aa546cdfd165b784a31bb4dec7c77e9305b99a4b", - "0xb30c3e12395b1fb8b776f3ec9f87c70e35763a7b2ddc68f0f60a4982a84017f27c891a98561c830038deb033698ed7fc", - "0x874e507757cd1177d0dff0b0c62ce90130324442a33da3b2c8ee09dbca5d543e3ecfe707e9f1361e7c7db641c72794bb", - "0xb53012dd10b5e7460b57c092eaa06d6502720df9edbbe3e3f61a9998a272bf5baaac4a5a732ad4efe35d6fac6feca744", - "0x85e6509d711515534d394e6cacbed6c81da710074d16ef3f4950bf2f578d662a494d835674f79c4d6315bced4defc5f0", - "0xb6132b2a34b0905dcadc6119fd215419a7971fe545e52f48b768006944b4a9d7db1a74b149e2951ea48c083b752d0804", - "0x989867da6415036d19b4bacc926ce6f4df7a556f50a1ba5f3c48eea9cefbb1c09da81481c8009331ee83f0859185e164", - "0x960a6c36542876174d3fbc1505413e29f053ed87b8d38fef3af180491c7eff25200b45dd5fe5d4d8e63c7e8c9c00f4c8", - "0x9040b59bd739d9cc2e8f6e894683429e4e876a8106238689ff4c22770ae5fdae1f32d962b30301fa0634ee163b524f35", - "0xaf3fcd0a45fe9e8fe256dc7eab242ef7f582dd832d147444483c62787ac820fafc6ca55d639a73f76bfa5e7f5462ab8f", - "0xb934c799d0736953a73d91e761767fdb78454355c4b15c680ce08accb57ccf941b13a1236980001f9e6195801cffd692", - "0x8871e8e741157c2c326b22cf09551e78da3c1ec0fc0543136f581f1550f8bab03b0a7b80525c1e99812cdbf3a9698f96", - "0xa8a977f51473a91d178ee8cfa45ffef8d6fd93ab1d6e428f96a3c79816d9c6a93cd70f94d4deda0125fd6816e30f3bea", - "0xa7688b3b0a4fc1dd16e8ba6dc758d3cfe1b7cf401c31739484c7fa253cce0967df1b290769bcefc9d23d3e0cb19e6218", - "0x8ae84322662a57c6d729e6ff9d2737698cc2da2daeb1f39e506618750ed23442a6740955f299e4a15dda6db3e534d2c6", - "0xa04a961cdccfa4b7ef83ced17ab221d6a043b2c718a0d6cc8e6f798507a31f10bf70361f70a049bc8058303fa7f96864", - "0xb463e39732a7d9daec8a456fb58e54b30a6e160aa522a18b9a9e836488cce3342bcbb2e1deab0f5e6ec0a8796d77197d", - "0xb1434a11c6750f14018a2d3bcf94390e2948f4f187e93bb22070ca3e5393d339dc328cbfc3e48815f51929465ffe7d81", - "0x84ff81d73f3828340623d7e3345553610aa22a5432217ef0ebd193cbf4a24234b190c65ca0873c22d10ea7b63bd1fbed", - "0xb6fe2723f0c47757932c2ddde7a4f8434f665612f7b87b4009c2635d56b6e16b200859a8ade49276de0ef27a2b6c970a", - "0x9742884ed7cd52b4a4a068a43d3faa02551a424136c85a9313f7cb58ea54c04aa83b0728fd741d1fe39621e931e88f8f", - "0xb7d2d65ea4d1ad07a5dee39e40d6c03a61264a56b1585b4d76fc5b2a68d80a93a42a0181d432528582bf08d144c2d6a9", - "0x88c0f66bada89f8a43e5a6ead2915088173d106c76f724f4a97b0f6758aed6ae5c37c373c6b92cdd4aea8f6261f3a374", - "0x81f9c43582cb42db3900747eb49ec94edb2284999a499d1527f03315fd330e5a509afa3bff659853570e9886aab5b28b", - "0x821f9d27d6beb416abf9aa5c79afb65a50ed276dbda6060103bc808bcd34426b82da5f23e38e88a55e172f5c294b4d40", - "0x8ba307b9e7cb63a6c4f3851b321aebfdb6af34a5a4c3bd949ff7d96603e59b27ff4dc4970715d35f7758260ff942c9e9", - "0xb142eb6c5f846de33227d0bda61d445a7c33c98f0a8365fe6ab4c1fabdc130849be597ef734305894a424ea715372d08", - "0xa732730ae4512e86a741c8e4c87fee8a05ee840fec0e23b2e037d58dba8dde8d10a9bc5191d34d00598941becbbe467f", - "0xadce6f7c30fd221f6b10a0413cc76435c4bb36c2d60bca821e5c67409fe9dbb2f4c36ef85eb3d734695e4be4827e9fd3", - "0xa74f00e0f9b23aff7b2527ce69852f8906dab9d6abe62ecd497498ab21e57542e12af9918d4fd610bb09e10b0929c510", - "0xa593b6b0ef26448ce4eb3ab07e84238fc020b3cb10d542ff4b16d4e2be1bcde3797e45c9cf753b8dc3b0ffdb63984232", - "0xaed3913afccf1aa1ac0eb4980eb8426d0baccebd836d44651fd72af00d09fac488a870223c42aca3ceb39752070405ae", - "0xb2c44c66a5ea7fde626548ba4cef8c8710191343d3dadfd3bb653ce715c0e03056a5303a581d47dde66e70ea5a2d2779", - "0x8e5029b2ccf5128a12327b5103f7532db599846e422531869560ceaff392236434d87159f597937dbf4054f810c114f4", - "0x82beed1a2c4477e5eb39fc5b0e773b30cfec77ef2b1bf17eadaf60eb35b6d0dd9d8cf06315c48d3546badb3f21cd0cca", - "0x90077bd6cc0e4be5fff08e5d07a5a158d36cebd1d1363125bc4fae0866ffe825b26f933d4ee5427ba5cd0c33c19a7b06", - "0xa7ec0d8f079970e8e34f0ef3a53d3e0e45428ddcef9cc776ead5e542ef06f3c86981644f61c5a637e4faf001fb8c6b3e", - "0xae6d4add6d1a6f90b22792bc9d40723ee6850c27d0b97eefafd5b7fd98e424aa97868b5287cc41b4fbd7023bca6a322c", - "0x831aa917533d077da07c01417feaa1408846363ba2b8d22c6116bb858a95801547dd88b7d7fa1d2e3f0a02bdeb2e103d", - "0x96511b860b07c8a5ed773f36d4aa9d02fb5e7882753bf56303595bcb57e37ccc60288887eb83bef08c657ec261a021a2", - "0x921d2a3e7e9790f74068623de327443666b634c8443aba80120a45bba450df920b2374d96df1ce3fb1b06dd06f8cf6e3", - "0xaa74451d51fe82b4581ead8e506ec6cd881010f7e7dd51fc388eb9a557db5d3c6721f81c151d08ebd9c2591689fbc13e", - "0xa972bfbcf4033d5742d08716c927c442119bdae336bf5dff914523b285ccf31953da2733759aacaa246a9af9f698342c", - "0xad1fcd0cae0e76840194ce4150cb8a56ebed728ec9272035f52a799d480dfc85840a4d52d994a18b6edb31e79be6e8ad", - "0xa2c69fe1d36f235215432dad48d75887a44c99dfa0d78149acc74087da215a44bdb5f04e6eef88ff7eff80a5a7decc77", - "0xa94ab2af2b6ee1bc6e0d4e689ca45380d9fbd3c5a65b9bd249d266a4d4c07bf5d5f7ef2ae6000623aee64027892bf8fe", - "0x881ec1fc514e926cdc66480ac59e139148ff8a2a7895a49f0dff45910c90cdda97b66441a25f357d6dd2471cddd99bb3", - "0x884e6d3b894a914c8cef946a76d5a0c8351843b2bffa2d1e56c6b5b99c84104381dd1320c451d551c0b966f4086e60f9", - "0x817c6c10ce2677b9fc5223500322e2b880583254d0bb0d247d728f8716f5e05c9ff39f135854342a1afecd9fbdcf7c46", - "0xaaf4a9cb686a14619aa1fc1ac285dd3843ac3dd99f2b2331c711ec87b03491c02f49101046f3c5c538dc9f8dba2a0ac2", - "0x97ecea5ce53ca720b5d845227ae61d70269a2f53540089305c86af35f0898bfd57356e74a8a5e083fa6e1ea70080bd31", - "0xa22d811e1a20a75feac0157c418a4bfe745ccb5d29466ffa854dca03e395b6c3504a734341746b2846d76583a780b32e", - "0x940cbaa0d2b2db94ae96b6b9cf2deefbfd059e3e5745de9aec4a25f0991b9721e5cd37ef71c631575d1a0c280b01cd5b", - "0xae33cb4951191258a11044682de861bf8d92d90ce751b354932dd9f3913f542b6a0f8a4dc228b3cd9244ac32c4582832", - "0xa580df5e58c4274fe0f52ac2da1837e32f5c9db92be16c170187db4c358f43e5cfdda7c5911dcc79d77a5764e32325f5", - "0x81798178cb9d8affa424f8d3be67576ba94d108a28ccc01d330c51d5a63ca45bb8ca63a2f569b5c5fe1303cecd2d777f", - "0x89975b91b94c25c9c3660e4af4047a8bacf964783010820dbc91ff8281509379cb3b24c25080d5a01174dd9a049118d5", - "0xa7327fcb3710ed3273b048650bde40a32732ef40a7e58cf7f2f400979c177944c8bc54117ba6c80d5d4260801dddab79", - "0x92b475dc8cb5be4b90c482f122a51bcb3b6c70593817e7e2459c28ea54a7845c50272af38119406eaadb9bcb993368d0", - "0x9645173e9ecefc4f2eae8363504f7c0b81d85f8949a9f8a6c01f2d49e0a0764f4eacecf3e94016dd407fc14494fce9f9", - "0x9215fd8983d7de6ae94d35e6698226fc1454977ae58d42d294be9aad13ac821562ad37d5e7ee5cdfe6e87031d45cd197", - "0x810360a1c9b88a9e36f520ab5a1eb8bed93f52deefbe1312a69225c0a08edb10f87cc43b794aced9c74220cefcc57e7d", - "0xad7e810efd61ed4684aeda9ed8bb02fb9ae4b4b63fda8217d37012b94ff1b91c0087043bfa4e376f961fff030c729f3b", - "0x8b07c95c6a06db8738d10bb03ec11b89375c08e77f0cab7e672ce70b2685667ca19c7e1c8b092821d31108ea18dfd4c7", - "0x968825d025ded899ff7c57245250535c732836f7565eab1ae23ee7e513201d413c16e1ba3f5166e7ac6cf74de8ceef4f", - "0x908243370c5788200703ade8164943ad5f8c458219186432e74dbc9904a701ea307fd9b94976c866e6c58595fd891c4b", - "0x959969d16680bc535cdc6339e6186355d0d6c0d53d7bbfb411641b9bf4b770fd5f575beef5deec5c4fa4d192d455c350", - "0xad177f4f826a961adeac76da40e2d930748effff731756c797eddc4e5aa23c91f070fb69b19221748130b0961e68a6bb", - "0x82f8462bcc25448ef7e0739425378e9bb8a05e283ce54aae9dbebaf7a3469f57833c9171672ad43a79778366c72a5e37", - "0xa28fb275b1845706c2814d9638573e9bc32ff552ebaed761fe96fdbce70395891ca41c400ae438369264e31a2713b15f", - "0x8a9c613996b5e51dadb587a787253d6081ea446bf5c71096980bf6bd3c4b69905062a8e8a3792de2d2ece3b177a71089", - "0x8d5aefef9f60cb27c1db2c649221204dda48bb9bf8bf48f965741da051340e8e4cab88b9d15c69f3f84f4c854709f48a", - "0x93ebf2ca6ad85ab6deace6de1a458706285b31877b1b4d7dcb9d126b63047efaf8c06d580115ec9acee30c8a7212fa55", - "0xb3ee46ce189956ca298057fa8223b7fd1128cf52f39159a58bca03c71dd25161ac13f1472301f72aef3e1993fe1ab269", - "0xa24d7a8d066504fc3f5027ccb13120e2f22896860e02c45b5eba1dbd512d6a17c28f39155ea581619f9d33db43a96f92", - "0xae9ceacbfe12137db2c1a271e1b34b8f92e4816bad1b3b9b6feecc34df0f8b3b0f7ed0133acdf59c537d43d33fc8d429", - "0x83967e69bf2b361f86361bd705dce0e1ad26df06da6c52b48176fe8dfcbeb03c462c1a4c9e649eff8c654b18c876fdef", - "0x9148e6b814a7d779c19c31e33a068e97b597de1f8100513db3c581190513edc4d544801ce3dd2cf6b19e0cd6daedd28a", - "0x94ccdafc84920d320ed22de1e754adea072935d3c5f8c2d1378ebe53d140ea29853f056fb3fb1e375846061a038cc9bc", - "0xafb43348498c38b0fa5f971b8cdd3a62c844f0eb52bc33daf2f67850af0880fce84ecfb96201b308d9e6168a0d443ae3", - "0x86d5736520a83538d4cd058cc4b4e84213ed00ebd6e7af79ae787adc17a92ba5359e28ba6c91936d967b4b28d24c3070", - "0xb5210c1ff212c5b1e9ef9126e08fe120a41e386bb12c22266f7538c6d69c7fd8774f11c02b81fd4e88f9137b020801fe", - "0xb78cfd19f94d24e529d0f52e18ce6185cb238edc6bd43086270fd51dd99f664f43dd4c7d2fe506762fbd859028e13fcf", - "0xa6e7220598c554abdcc3fdc587b988617b32c7bb0f82c06205467dbedb58276cc07cae317a190f19d19078773f4c2bbb", - "0xb88862809487ee430368dccd85a5d72fa4d163ca4aad15c78800e19c1a95be2192719801e315d86cff7795e0544a77e4", - "0x87ecb13a03921296f8c42ceb252d04716f10e09c93962239fcaa0a7fef93f19ab3f2680bc406170108bc583e9ff2e721", - "0xa810cd473832b6581c36ec4cb403f2849357ba2d0b54df98ef3004b8a530c078032922a81d40158f5fb0043d56477f6e", - "0xa247b45dd85ca7fbb718b328f30a03f03c84aef2c583fbdc9fcc9eb8b52b34529e8c8f535505c10598b1b4dac3d7c647", - "0x96ee0b91313c68bac4aa9e065ce9e1d77e51ca4cff31d6a438718c58264dee87674bd97fc5c6b8008be709521e4fd008", - "0x837567ad073e42266951a9a54750919280a2ac835a73c158407c3a2b1904cf0d17b7195a393c71a18ad029cbd9cf79ee", - "0xa6a469c44b67ebf02196213e7a63ad0423aab9a6e54acc6fcbdbb915bc043586993454dc3cd9e4be8f27d67c1050879b", - "0x8712d380a843b08b7b294f1f06e2f11f4ad6bcc655fdde86a4d8bc739c23916f6fad2b902fe47d6212f03607907e9f0e", - "0x920adfb644b534789943cdae1bdd6e42828dda1696a440af2f54e6b97f4f97470a1c6ea9fa6a2705d8f04911d055acd1", - "0xa161c73adf584a0061e963b062f59d90faac65c9b3a936b837a10d817f02fcabfa748824607be45a183dd40f991fe83f", - "0x874f4ecd408c76e625ea50bc59c53c2d930ee25baf4b4eca2440bfbffb3b8bc294db579caa7c68629f4d9ec24187c1ba", - "0x8bff18087f112be7f4aa654e85c71fef70eee8ae480f61d0383ff6f5ab1a0508f966183bb3fc4d6f29cb7ca234aa50d3", - "0xb03b46a3ca3bc743a173cbc008f92ab1aedd7466b35a6d1ca11e894b9482ea9dc75f8d6db2ddd1add99bfbe7657518b7", - "0x8b4f3691403c3a8ad9e097f02d130769628feddfa8c2b3dfe8cff64e2bed7d6e5d192c1e2ba0ac348b8585e94acd5fa1", - "0xa0d9ca4a212301f97591bf65d5ef2b2664766b427c9dd342e23cb468426e6a56be66b1cb41fea1889ac5d11a8e3c50a5", - "0x8c93ed74188ca23b3df29e5396974b9cc135c91fdefdea6c0df694c8116410e93509559af55533a3776ac11b228d69b1", - "0x82dd331fb3f9e344ebdeeb557769b86a2cc8cc38f6c298d7572a33aea87c261afa9dbd898989139b9fc16bc1e880a099", - "0xa65faedf326bcfd8ef98a51410c78b021d39206704e8291cd1f09e096a66b9b0486be65ff185ca224c45918ac337ddeb", - "0xa188b37d363ac072a766fd5d6fa27df07363feff1342217b19e3c37385e42ffde55e4be8355aceaa2f267b6d66b4ac41", - "0x810fa3ba3e96d843e3bafd3f2995727f223d3567c8ba77d684c993ba1773c66551eb5009897c51b3fe9b37196984f5ec", - "0x87631537541852da323b4353af45a164f68b304d24c01183bf271782e11687f3fcf528394e1566c2a26cb527b3148e64", - "0xb721cb2b37b3c477a48e3cc0044167d51ff568a5fd2fb606e5aec7a267000f1ddc07d3db919926ae12761a8e017c767c", - "0x904dfad4ba2cc1f6e60d1b708438a70b1743b400164cd981f13c064b8328d5973987d4fb9cf894068f29d3deaf624dfb", - "0xa70491538893552c20939fae6be2f07bfa84d97e2534a6bbcc0f1729246b831103505e9f60e97a8fa7d2e6c1c2384579", - "0x8726cf1b26b41f443ff7485adcfddc39ace2e62f4d65dd0bb927d933e262b66f1a9b367ded5fbdd6f3b0932553ac1735", - "0xae8a11cfdf7aa54c08f80cb645e3339187ab3886babe9fae5239ba507bb3dd1c0d161ca474a2df081dcd3d63e8fe445e", - "0x92328719e97ce60e56110f30a00ac5d9c7a2baaf5f8d22355d53c1c77941e3a1fec7d1405e6fbf8959665fe2ba7a8cad", - "0x8d9d6255b65798d0018a8cccb0b6343efd41dc14ff2058d3eed9451ceaad681e4a0fa6af67b0a04318aa628024e5553d", - "0xb70209090055459296006742d946a513f0cba6d83a05249ee8e7a51052b29c0ca9722dc4af5f9816a1b7938a5dac7f79", - "0xaab7b766b9bf91786dfa801fcef6d575dc6f12b77ecc662eb4498f0312e54d0de9ea820e61508fc8aeee5ab5db529349", - "0xa8104b462337748b7f086a135d0c3f87f8e51b7165ca6611264b8fb639d9a2f519926cb311fa2055b5fadf03da70c678", - "0xb0d2460747d5d8b30fc6c6bd0a87cb343ddb05d90a51b465e8f67d499cfc5e3a9e365da05ae233bbee792cdf90ec67d5", - "0xaa55f5bf3815266b4a149f85ed18e451c93de9163575e3ec75dd610381cc0805bb0a4d7c4af5b1f94d10231255436d2c", - "0x8d4c6a1944ff94426151909eb5b99cfd92167b967dabe2bf3aa66bb3c26c449c13097de881b2cfc1bf052862c1ef7b03", - "0x8862296162451b9b6b77f03bf32e6df71325e8d7485cf3335d66fd48b74c2a8334c241db8263033724f26269ad95b395", - "0x901aa96deb26cda5d9321190ae6624d357a41729d72ef1abfd71bebf6139af6d690798daba53b7bc5923462115ff748a", - "0x96c195ec4992728a1eb38cdde42d89a7bce150db43adbc9e61e279ea839e538deec71326b618dd39c50d589f78fc0614", - "0xb6ff8b8aa0837b99a1a8b46fb37f20ad4aecc6a98381b1308697829a59b8442ffc748637a88cb30c9b1f0f28a926c4f6", - "0x8d807e3dca9e7bef277db1d2cfb372408dd587364e8048b304eff00eacde2c723bfc84be9b98553f83cba5c7b3cba248", - "0x8800c96adb0195c4fc5b24511450dee503c32bf47044f5e2e25bd6651f514d79a2dd9b01cd8c09f3c9d3859338490f57", - "0x89fe366096097e38ec28dd1148887112efa5306cc0c3da09562aafa56f4eb000bf46ff79bf0bdd270cbde6bf0e1c8957", - "0xaf409a90c2776e1e7e3760b2042507b8709e943424606e31e791d42f17873a2710797f5baaab4cc4a19998ef648556b0", - "0x8d761863c9b6edbd232d35ab853d944f5c950c2b643f84a1a1327ebb947290800710ff01dcfa26dc8e9828481240e8b1", - "0x90b95e9be1e55c463ed857c4e0617d6dc3674e99b6aa62ed33c8e79d6dfcf7d122f4f4cc2ee3e7c5a49170cb617d2e2e", - "0xb3ff381efefabc4db38cc4727432e0301949ae4f16f8d1dea9b4f4de611cf5a36d84290a0bef160dac4e1955e516b3b0", - "0xa8a84564b56a9003adcadb3565dc512239fc79572762cda7b5901a255bc82656bb9c01212ad33d6bef4fbbce18dacc87", - "0x90a081890364b222eef54bf0075417f85e340d2fec8b7375995f598aeb33f26b44143ebf56fca7d8b4ebb36b5747b0eb", - "0xade6ee49e1293224ddf2d8ab7f14bb5be6bc6284f60fd5b3a1e0cf147b73cff57cf19763b8a36c5083badc79c606b103", - "0xb2fa99806dd2fa3de09320b615a2570c416c9bcdb052e592b0aead748bbe407ec9475a3d932ae48b71c2627eb81986a6", - "0x91f3b7b73c8ccc9392542711c45fe6f236057e6efad587d661ad5cb4d6e88265f86b807bb1151736b1009ab74fd7acb4", - "0x8800e2a46af96696dfbdcbf2ca2918b3dcf28ad970170d2d1783b52b8d945a9167d052beeb55f56c126da7ffa7059baa", - "0x9862267a1311c385956b977c9aa08548c28d758d7ba82d43dbc3d0a0fd1b7a221d39e8399997fea9014ac509ff510ac4", - "0xb7d24f78886fd3e2d283e18d9ad5a25c1a904e7d9b9104bf47da469d74f34162e27e531380dbbe0a9d051e6ffd51d6e7", - "0xb0f445f9d143e28b9df36b0f2c052da87ee2ca374d9d0fbe2eff66ca6fe5fe0d2c1951b428d58f7314b7e74e45d445ea", - "0xb63fc4083eabb8437dafeb6a904120691dcb53ce2938b820bb553da0e1eecd476f72495aacb72600cf9cad18698fd3db", - "0xb9ffd8108eaebd582d665f8690fe8bb207fd85185e6dd9f0b355a09bac1bbff26e0fdb172bc0498df025414e88fe2eda", - "0x967ed453e1f1a4c5b7b6834cc9f75c13f6889edc0cc91dc445727e9f408487bbf05c337103f61397a10011dfbe25d61d", - "0x98ceb673aff36e1987d5521a3984a07079c3c6155974bb8b413e8ae1ce84095fe4f7862fba7aefa14753eb26f2a5805f", - "0x85f01d28603a8fdf6ce6a50cb5c44f8a36b95b91302e3f4cd95c108ce8f4d212e73aec1b8d936520d9226802a2bd9136", - "0x88118e9703200ca07910345fbb789e7a8f92bd80bbc79f0a9e040e8767d33df39f6eded403a9b636eabf9101e588482a", - "0x90833a51eef1b10ed74e8f9bbd6197e29c5292e469c854eed10b0da663e2bceb92539710b1858bbb21887bd538d28d89", - "0xb513b905ec19191167c6193067b5cfdf5a3d3828375360df1c7e2ced5815437dfd37f0c4c8f009d7fb29ff3c8793f560", - "0xb1b6d405d2d18f9554b8a358cc7e2d78a3b34269737d561992c8de83392ac9a2857be4bf15de5a6c74e0c9d0f31f393c", - "0xb828bd3e452b797323b798186607849f85d1fb20c616833c0619360dfd6b3e3aa000fd09dafe4b62d74abc41072ff1a9", - "0x8efde67d0cca56bb2c464731879c9ac46a52e75bac702a63200a5e192b4f81c641f855ca6747752b84fe469cb7113b6c", - "0xb2762ba1c89ac3c9a983c242e4d1c2610ff0528585ed5c0dfc8a2c0253551142af9b59f43158e8915a1da7cc26b9df67", - "0x8a3f1157fb820d1497ef6b25cd70b7e16bb8b961b0063ad340d82a79ee76eb2359ca9e15e6d42987ed7f154f5eeaa2da", - "0xa75e29f29d38f09c879f971c11beb5368affa084313474a5ecafa2896180b9e47ea1995c2733ec46f421e395a1d9cffe", - "0x8e8c3dd3e7196ef0b4996b531ec79e4a1f211db5d5635e48ceb80ff7568b2ff587e845f97ee703bb23a60945ad64314a", - "0x8e7f32f4a3e3c584af5e3d406924a0aa34024c42eca74ef6cc2a358fd3c9efaf25f1c03aa1e66bb94b023a2ee2a1cace", - "0xab7dce05d59c10a84feb524fcb62478906b3fa045135b23afbede3bb32e0c678d8ebe59feabccb5c8f3550ea76cae44b", - "0xb38bb4b44d827f6fd3bd34e31f9186c59e312dbfadd4a7a88e588da10146a78b1f8716c91ad8b806beb8da65cab80c4c", - "0x9490ce9442bbbd05438c7f5c4dea789f74a7e92b1886a730544b55ba377840740a3ae4f2f146ee73f47c9278b0e233bc", - "0x83c003fab22a7178eed1a668e0f65d4fe38ef3900044e9ec63070c23f2827d36a1e73e5c2b883ec6a2afe2450171b3b3", - "0x9982f02405978ddc4fca9063ebbdb152f524c84e79398955e66fe51bc7c1660ec1afc3a86ec49f58d7b7dde03505731c", - "0xab337bd83ccdd2322088ffa8d005f450ced6b35790f37ab4534313315ee84312adc25e99cce052863a8bedee991729ed", - "0x8312ce4bec94366d88f16127a17419ef64285cd5bf9e5eda010319b48085966ed1252ed2f5a9fd3e0259b91bb65f1827", - "0xa60d5a6327c4041b0c00a1aa2f0af056520f83c9ce9d9ccd03a0bd4d9e6a1511f26a422ea86bd858a1f77438adf07e6c", - "0xb84a0a0b030bdad83cf5202aa9afe58c9820e52483ab41f835f8c582c129ee3f34aa096d11c1cd922eda02ea1196a882", - "0x8077d105317f4a8a8f1aadeb05e0722bb55f11abcb490c36c0904401107eb3372875b0ac233144829e734f0c538d8c1d", - "0x9202503bd29a6ec198823a1e4e098f9cfe359ed51eb5174d1ca41368821bfeebcbd49debfd02952c41359d1c7c06d2b1", - "0xabc28c155e09365cb77ffead8dc8f602335ef93b2f44e4ef767ce8fc8ef9dd707400f3a722e92776c2e0b40192c06354", - "0xb0f6d1442533ca45c9399e0a63a11f85ff288d242cea6cb3b68c02e77bd7d158047cae2d25b3bcd9606f8f66d9b32855", - "0xb01c3d56a0db84dc94575f4b6ee2de4beca3230e86bed63e2066beb22768b0a8efb08ebaf8ac3dedb5fe46708b084807", - "0x8c8634b0432159f66feaabb165842d1c8ac378f79565b1b90c381aa8450eb4231c3dad11ec9317b9fc2b155c3a771e32", - "0x8e67f623d69ecd430c9ee0888520b6038f13a2b6140525b056dc0951f0cfed2822e62cf11d952a483107c5c5acac4826", - "0x9590bb1cba816dd6acd5ac5fba5142c0a19d53573e422c74005e0bcf34993a8138c83124cad35a3df65879dba6134edd", - "0x801cd96cde0749021a253027118d3ea135f3fcdbe895db08a6c145641f95ebd368dd6a1568d995e1d0084146aebe224a", - "0x848b5d196427f6fc1f762ee3d36e832b64a76ec1033cfedc8b985dea93932a7892b8ef1035c653fb9dcd9ab2d9a44ac8", - "0xa1017eb83d5c4e2477e7bd2241b2b98c4951a3b391081cae7d75965cadc1acaec755cf350f1f3d29741b0828e36fedea", - "0x8d6d2785e30f3c29aad17bd677914a752f831e96d46caf54446d967cb2432be2c849e26f0d193a60bee161ea5c6fe90a", - "0x935c0ba4290d4595428e034b5c8001cbd400040d89ab00861108e8f8f4af4258e41f34a7e6b93b04bc253d3b9ffc13bf", - "0xaac02257146246998477921cef2e9892228590d323b839f3e64ea893b991b463bc2f47e1e5092ddb47e70b2f5bce7622", - "0xb921fde9412970a5d4c9a908ae8ce65861d06c7679af577cf0ad0d5344c421166986bee471fd6a6cecb7d591f06ec985", - "0x8ef4c37487b139d6756003060600bb6ebac7ea810b9c4364fc978e842f13ac196d1264fbe5af60d76ff6d9203d8e7d3f", - "0x94b65e14022b5cf6a9b95f94be5ace2711957c96f4211c3f7bb36206bd39cfbd0ea82186cab5ad0577a23214a5c86e9e", - "0xa31c166d2a2ca1d5a75a5920fef7532681f62191a50d8555fdaa63ba4581c3391cc94a536fc09aac89f64eafceec3f90", - "0x919a8cc128de01e9e10f5d83b08b52293fdd41bde2b5ae070f3d95842d4a16e5331cf2f3d61c765570c8022403610fa4", - "0xb23d6f8331eef100152d60483cfa14232a85ee712c8538c9b6417a5a7c5b353c2ac401390c6c215cb101f5cee6b5f43e", - "0xab357160c08a18319510a571eafff154298ce1020de8e1dc6138a09fcb0fcbcdd8359f7e9386bda00b7b9cdea745ffdc", - "0xab55079aea34afa5c0bd1124b9cdfe01f325b402fdfa017301bf87812eaa811ea5798c3aaf818074d420d1c782b10ada", - "0xade616010dc5009e7fc4f8d8b00dc716686a5fa0a7816ad9e503e15839d3b909b69d9dd929b7575376434ffec0d2bea8", - "0x863997b97ed46898a8a014599508fa3079f414b1f4a0c4fdc6d74ae8b444afa350f327f8bfc2a85d27f9e2d049c50135", - "0x8d602ff596334efd4925549ed95f2aa762b0629189f0df6dbb162581657cf3ea6863cd2287b4d9c8ad52813d87fcd235", - "0xb70f68c596dcdeed92ad5c6c348578b26862a51eb5364237b1221e840c47a8702f0fbc56eb520a22c0eed99795d3903e", - "0x9628088f8e0853cefadee305a8bf47fa990c50fa96a82511bbe6e5dc81ef4b794e7918a109070f92fc8384d77ace226f", - "0x97e26a46e068b605ce96007197ecd943c9a23881862f4797a12a3e96ba2b8d07806ad9e2a0646796b1889c6b7d75188c", - "0xb1edf467c068cc163e2d6413cc22b16751e78b3312fe47b7ea82b08a1206d64415b2c8f2a677fa89171e82cc49797150", - "0xa44d15ef18745b251429703e3cab188420e2d974de07251501799b016617f9630643fcd06f895634d8ecdd579e1bf000", - "0xabd126df3917ba48c618ee4dbdf87df506193462f792874439043fa1b844466f6f4e0ff2e42516e63b5b23c0892b2695", - "0xa2a67f57c4aa3c2aa1eeddbfd5009a89c26c2ce8fa3c96a64626aba19514beb125f27df8559506f737de3eae0f1fc18f", - "0xa633e0132197e6038197304b296ab171f1d8e0d0f34dcf66fe9146ac385b0239232a8470b9205a4802ab432389f4836d", - "0xa914b3a28509a906c3821463b936455d58ff45dcbe158922f9efb2037f2eb0ce8e92532d29b5d5a3fcd0d23fa773f272", - "0xa0e1412ce4505daf1a2e59ce4f0fc0e0023e335b50d2b204422f57cd65744cc7a8ed35d5ef131a42c70b27111d3115b7", - "0xa2339e2f2b6072e88816224fdd612c04d64e7967a492b9f8829db15367f565745325d361fd0607b0def1be384d010d9e", - "0xa7309fc41203cb99382e8193a1dcf03ac190a7ce04835304eb7e341d78634e83ea47cb15b885601956736d04cdfcaa01", - "0x81f3ccd6c7f5b39e4e873365f8c37b214e8ab122d04a606fbb7339dc3298c427e922ec7418002561d4106505b5c399ee", - "0x92c121cf914ca549130e352eb297872a63200e99b148d88fbc9506ad882bec9d0203d65f280fb5b0ba92e336b7f932e8", - "0xa4b330cf3f064f5b131578626ad7043ce2a433b6f175feb0b52d36134a454ca219373fd30d5e5796410e005b69082e47", - "0x86fe5774112403ad83f9c55d58317eeb17ad8e1176d9f2f69c2afb7ed83bc718ed4e0245ceab4b377f5f062dcd4c00e7", - "0x809d152a7e2654c7fd175b57f7928365a521be92e1ed06c05188a95864ddb25f7cab4c71db7d61bbf4cae46f3a1d96ce", - "0xb82d663e55c2a5ada7e169e9b1a87bc1c0177baf1ec1c96559b4cb1c5214ce1ddf2ab8d345014cab6402f3774235cf5a", - "0x86580af86df1bd2c385adb8f9a079e925981b7184db66fc5fe5b14cddb82e7d836b06eaeef14924ac529487b23dae111", - "0xb5f5f4c5c94944ecc804df6ab8687d64e27d988cbfeae1ba7394e0f6adbf778c5881ead7cd8082dd7d68542b9bb4ecd5", - "0xa6016916146c2685c46e8fdd24186394e2d5496e77e08c0c6a709d4cd7dfa97f1efcef94922b89196819076a91ad37b5", - "0xb778e7367ded3b6eab53d5fc257f7a87e8faf74a593900f2f517220add2125be3f6142022660d8181df8d164ad9441ce", - "0x8581b2d36abe6f553add4d24be761bec1b8efaa2929519114346615380b3c55b59e6ad86990e312f7e234d0203bdf59b", - "0x9917e74fd45c3f71a829ff5498a7f6b5599b48c098dda2339bf04352bfc7f368ccf1a407f5835901240e76452ae807d7", - "0xafd196ce6f9335069138fd2e3d133134da253978b4ce373152c0f26affe77a336505787594022e610f8feb722f7cc1fb", - "0xa477491a1562e329764645e8f24d8e228e5ef28c9f74c6b5b3abc4b6a562c15ffb0f680d372aed04d9e1bf944dece7be", - "0x9767440d58c57d3077319d3a330e5322b9ba16981ec74a5a14d53462eab59ae7fd2b14025bfc63b268862094acb444e6", - "0x80986d921be3513ef69264423f351a61cb48390c1be8673aee0f089076086aaebea7ebe268fd0aa7182695606116f679", - "0xa9554c5c921c07b450ee04e34ec58e054ac1541b26ce2ce5a393367a97348ba0089f53db6660ad76b60278b66fd12e3e", - "0x95097e7d2999b3e84bf052c775581cf361325325f4a50192521d8f4693c830bed667d88f482dc1e3f833aa2bd22d2cbf", - "0x9014c91d0f85aefd28436b5228c12f6353c055a9326c7efbf5e071e089e2ee7c070fcbc84c5fafc336cbb8fa6fec1ca1", - "0x90f57ba36ee1066b55d37384942d8b57ae00f3cf9a3c1d6a3dfee1d1af42d4b5fa9baeb0cd7e46687d1d6d090ddb931d", - "0x8e4b1db12fd760a17214c9e47f1fce6e43c0dbb4589a827a13ac61aaae93759345697bb438a00edab92e0b7b62414683", - "0x8022a959a513cdc0e9c705e0fc04eafd05ff37c867ae0f31f6d01cddd5df86138a426cab2ff0ac8ff03a62e20f7e8f51", - "0x914e9a38829834c7360443b8ed86137e6f936389488eccf05b4b4db7c9425611705076ecb3f27105d24b85c852be7511", - "0x957fb10783e2bd0db1ba66b18e794df710bc3b2b05776be146fa5863c15b1ebdd39747b1a95d9564e1772cdfc4f37b8a", - "0xb6307028444daed8ed785ac9d0de76bc3fe23ff2cc7e48102553613bbfb5afe0ebe45e4212a27021c8eb870721e62a1f", - "0x8f76143597777d940b15a01b39c5e1b045464d146d9a30a6abe8b5d3907250e6c7f858ff2308f8591e8b0a7b3f3c568a", - "0x96163138ac0ce5fd00ae9a289648fd9300a0ca0f63a88481d703ecd281c06a52a3b5178e849e331f9c85ca4ba398f4cc", - "0xa63ef47c3e18245b0482596a09f488a716df3cbd0f9e5cfabed0d742843e65db8961c556f45f49762f3a6ac8b627b3ef", - "0x8cb595466552e7c4d42909f232d4063e0a663a8ef6f6c9b7ce3a0542b2459cde04e0e54c7623d404acb5b82775ac04f6", - "0xb47fe69960eb45f399368807cff16d941a5a4ebad1f5ec46e3dc8a2e4d598a7e6114d8f0ca791e9720fd786070524e2b", - "0x89eb5ff83eea9df490e5beca1a1fbbbbcf7184a37e2c8c91ede7a1e654c81e8cd41eceece4042ea7918a4f4646b67fd6", - "0xa84f5d155ed08b9054eecb15f689ba81e44589e6e7207a99790c598962837ca99ec12344105b16641ca91165672f7153", - "0xa6cc8f25c2d5b2d2f220ec359e6a37a52b95fa6af6e173c65e7cd55299eff4aa9e6d9e6f2769e6459313f1f2aecb0fab", - "0xafcde944411f017a9f7979755294981e941cc41f03df5e10522ef7c7505e5f1babdd67b3bf5258e8623150062eb41d9b", - "0x8fab39f39c0f40182fcd996ade2012643fe7731808afbc53f9b26900b4d4d1f0f5312d9d40b3df8baa4739970a49c732", - "0xae193af9726da0ebe7df1f9ee1c4846a5b2a7621403baf8e66c66b60f523e719c30c6b4f897bb14b27d3ff3da8392eeb", - "0x8ac5adb82d852eba255764029f42e6da92dcdd0e224d387d1ef94174038db9709ac558d90d7e7c57ad4ce7f89bbfc38c", - "0xa2066b3458fdf678ee487a55dd5bfb74fde03b54620cb0e25412a89ee28ad0d685e309a51e3e4694be2fa6f1593a344c", - "0x88d031745dd0ae07d61a15b594be5d4b2e2a29e715d081649ad63605e3404b0c3a5353f0fd9fad9c05c18e93ce674fa1", - "0x8283cfb0ef743a043f2b77ecaeba3005e2ca50435585b5dd24777ee6bce12332f85e21b446b536da38508807f0f07563", - "0xb376de22d5f6b0af0b59f7d9764561f4244cf8ffe22890ecd3dcf2ff1832130c9b821e068c9d8773136f4796721e5963", - "0xae3afc50c764f406353965363840bf28ee85e7064eb9d5f0bb3c31c64ab10f48c853e942ee2c9b51bae59651eaa08c2f", - "0x948b204d103917461a01a6c57a88f2d66b476eae5b00be20ec8c747650e864bc8a83aee0aff59cb7584b7a3387e0ee48", - "0x81ab098a082b07f896c5ffd1e4446cb7fb44804cbbf38d125208b233fc82f8ec9a6a8d8dd1c9a1162dc28ffeec0dde50", - "0xa149c6f1312821ced2969268789a3151bdda213451760b397139a028da609c4134ac083169feb0ee423a0acafd10eceb", - "0xb0ac9e27a5dadaf523010f730b28f0ebac01f460d3bbbe277dc9d44218abb5686f4fac89ae462682fef9edbba663520a", - "0x8d0e0073cca273daaaa61b6fc54bfe5a009bc3e20ae820f6c93ba77b19eca517d457e948a2de5e77678e4241807157cb", - "0xad61d3a2edf7c7533a04964b97499503fd8374ca64286dba80465e68fe932e96749b476f458c6fc57cb1a7ca85764d11", - "0x90eb5e121ae46bc01a30881eaa556f46bd8457a4e80787cf634aab355082de34ac57d7f497446468225f7721e68e2a47", - "0x8cdac557de7c42d1f3780e33dec1b81889f6352279be81c65566cdd4952d4c15d79e656cbd46035ab090b385e90245ef", - "0x82b67e61b88b84f4f4d4f65df37b3e3dcf8ec91ea1b5c008fdccd52da643adbe6468a1cfdb999e87d195afe2883a3b46", - "0x8503b467e8f5d6048a4a9b78496c58493a462852cab54a70594ae3fd064cfd0deb4b8f336a262155d9fedcaa67d2f6fd", - "0x8db56c5ac763a57b6ce6832930c57117058e3e5a81532b7d19346346205e2ec614eb1a2ee836ef621de50a7bc9b7f040", - "0xad344699198f3c6e8c0a3470f92aaffc805b76266734414c298e10b5b3797ca53578de7ccb2f458f5e0448203f55282b", - "0x80602032c43c9e2a09154cc88b83238343b7a139f566d64cb482d87436b288a98f1ea244fd3bff8da3c398686a900c14", - "0xa6385bd50ecd548cfb37174cdbb89e10025b5cadaf3cff164c95d7aef5a33e3d6a9bf0c681b9e11db9ef54ebeee2a0c1", - "0xabf2d95f4aa34b0581eb9257a0cc8462b2213941a5deb8ba014283293e8b36613951b61261cc67bbd09526a54cbbff76", - "0xa3d5de52f48df72c289ff713e445991f142390798cd42bd9d9dbefaee4af4f5faf09042d126b975cf6b98711c3072553", - "0x8e627302ff3d686cff8872a1b7c2a57b35f45bf2fc9aa42b049d8b4d6996a662b8e7cbac6597f0cb79b0cc4e29fbf133", - "0x8510702e101b39a1efbf4e504e6123540c34b5689645e70d0bac1ecc1baf47d86c05cef6c4317a4e99b4edaeb53f2d00", - "0xaa173f0ecbcc6088f878f8726d317748c81ebf501bba461f163b55d66099b191ec7c55f7702f351a9c8eb42cfa3280e2", - "0xb560a697eafab695bcef1416648a0a664a71e311ecbe5823ae903bd0ed2057b9d7574b9a86d3fe22aa3e6ddce38ea513", - "0x8df6304a3d9cf40100f3f687575419c998cd77e5cc27d579cf4f8e98642de3609af384a0337d145dd7c5635172d26a71", - "0x8105c7f3e4d30a29151849673853b457c1885c186c132d0a98e63096c3774bc9deb956cf957367e633d0913680bda307", - "0x95373fc22c0917c3c2044ac688c4f29a63ed858a45c0d6d2d0fe97afd6f532dcb648670594290c1c89010ecc69259bef", - "0x8c2fae9bcadab341f49b55230310df93cac46be42d4caa0d42e45104148a91e527af1b4209c0d972448162aed28fab64", - "0xb05a77baab70683f76209626eaefdda2d36a0b66c780a20142d23c55bd479ddd4ad95b24579384b6cf62c8eb4c92d021", - "0x8e6bc6a7ea2755b4aaa19c1c1dee93811fcde514f03485fdc3252f0ab7f032c315614f6336e57cea25dcfb8fb6084eeb", - "0xb656a27d06aade55eadae2ad2a1059198918ea6cc3fd22c0ed881294d34d5ac7b5e4700cc24350e27d76646263b223aa", - "0xa296469f24f6f56da92d713afcd4dd606e7da1f79dc4e434593c53695847eefc81c7c446486c4b3b8c8d00c90c166f14", - "0x87a326f57713ac2c9dffeb3af44b9f3c613a8f952676fc46343299122b47ee0f8d792abaa4b5db6451ced5dd153aabd0", - "0xb689e554ba9293b9c1f6344a3c8fcb6951d9f9eac4a2e2df13de021aade7c186be27500e81388e5b8bcab4c80f220a31", - "0x87ae0aa0aa48eac53d1ca5a7b93917de12db9e40ceabf8fdb40884ae771cfdf095411deef7c9f821af0b7070454a2608", - "0xa71ffa7eae8ace94e6c3581d4cb2ad25d48cbd27edc9ec45baa2c8eb932a4773c3272b2ffaf077b40f76942a1f3af7f2", - "0x94c218c91a9b73da6b7a495b3728f3028df8ad9133312fc0c03e8c5253b7ccb83ed14688fd4602e2fd41f29a0bc698bd", - "0xae1e77b90ca33728af07a4c03fb2ef71cd92e2618e7bf8ed4d785ce90097fc4866c29999eb84a6cf1819d75285a03af2", - "0xb7a5945b277dab9993cf761e838b0ac6eaa903d7111fca79f9fde3d4285af7a89bf6634a71909d095d7619d913972c9c", - "0x8c43b37be02f39b22029b20aca31bff661abce4471dca88aa3bddefd9c92304a088b2dfc8c4795acc301ca3160656af2", - "0xb32e5d0fba024554bd5fe8a793ebe8003335ddd7f585876df2048dcf759a01285fecb53daae4950ba57f3a282a4d8495", - "0x85ea7fd5e10c7b659df5289b2978b2c89e244f269e061b9a15fcab7983fc1962b63546e82d5731c97ec74b6804be63ef", - "0x96b89f39181141a7e32986ac02d7586088c5a9662cec39843f397f3178714d02f929af70630c12cbaba0268f8ba2d4fa", - "0x929ab1a2a009b1eb37a2817c89696a06426529ebe3f306c586ab717bd34c35a53eca2d7ddcdef36117872db660024af9", - "0xa696dccf439e9ca41511e16bf3042d7ec0e2f86c099e4fc8879d778a5ea79e33aa7ce96b23dc4332b7ba26859d8e674d", - "0xa8fe69a678f9a194b8670a41e941f0460f6e2dbc60470ab4d6ae2679cc9c6ce2c3a39df2303bee486dbfde6844e6b31a", - "0x95f58f5c82de2f2a927ca99bf63c9fc02e9030c7e46d0bf6b67fe83a448d0ae1c99541b59caf0e1ccab8326231af09a5", - "0xa57badb2c56ca2c45953bd569caf22968f76ed46b9bac389163d6fe22a715c83d5e94ae8759b0e6e8c2f27bff7748f3f", - "0x868726fd49963b24acb5333364dffea147e98f33aa19c7919dc9aca0fd26661cfaded74ede7418a5fadbe7f5ae67b67b", - "0xa8d8550dcc64d9f1dd7bcdab236c4122f2b65ea404bb483256d712c7518f08bb028ff8801f1da6aed6cbfc5c7062e33b", - "0x97e25a87dae23155809476232178538d4bc05d4ff0882916eb29ae515f2a62bfce73083466cc0010ca956aca200aeacc", - "0xb4ea26be3f4bd04aa82d7c4b0913b97bcdf5e88b76c57eb1a336cbd0a3eb29de751e1bc47c0e8258adec3f17426d0c71", - "0x99ee555a4d9b3cf2eb420b2af8e3bc99046880536116d0ce7193464ac40685ef14e0e3c442f604e32f8338cb0ef92558", - "0x8c64efa1da63cd08f319103c5c7a761221080e74227bbc58b8fb35d08aa42078810d7af3e60446cbaff160c319535648", - "0x8d9fd88040076c28420e3395cbdfea402e4077a3808a97b7939d49ecbcf1418fe50a0460e1c1b22ac3f6e7771d65169a", - "0xae3c19882d7a9875d439265a0c7003c8d410367627d21575a864b9cb4918de7dbdb58a364af40c5e045f3df40f95d337", - "0xb4f7bfacab7b2cafe393f1322d6dcc6f21ffe69cd31edc8db18c06f1a2b512c27bd0618091fd207ba8df1808e9d45914", - "0x94f134acd0007c623fb7934bcb65ef853313eb283a889a3ffa79a37a5c8f3665f3d5b4876bc66223610c21dc9b919d37", - "0xaa15f74051171daacdc1f1093d3f8e2d13da2833624b80a934afec86fc02208b8f55d24b7d66076444e7633f46375c6a", - "0xa32d6bb47ef9c836d9d2371807bafbbbbb1ae719530c19d6013f1d1f813c49a60e4fa51d83693586cba3a840b23c0404", - "0xb61b3599145ea8680011aa2366dc511a358b7d67672d5b0c5be6db03b0efb8ca5a8294cf220ea7409621f1664e00e631", - "0x859cafc3ee90b7ececa1ed8ef2b2fc17567126ff10ca712d5ffdd16aa411a5a7d8d32c9cab1fbf63e87dce1c6e2f5f53", - "0xa2fef1b0b2874387010e9ae425f3a9676d01a095d017493648bcdf3b31304b087ccddb5cf76abc4e1548b88919663b6b", - "0x939e18c73befc1ba2932a65ede34c70e4b91e74cc2129d57ace43ed2b3af2a9cc22a40fbf50d79a63681b6d98852866d", - "0xb3b4259d37b1b14aee5b676c9a0dd2d7f679ab95c120cb5f09f9fbf10b0a920cb613655ddb7b9e2ba5af4a221f31303c", - "0x997255fe51aaca6e5a9cb3359bcbf25b2bb9e30649bbd53a8a7c556df07e441c4e27328b38934f09c09d9500b5fabf66", - "0xabb91be2a2d860fd662ed4f1c6edeefd4da8dc10e79251cf87f06029906e7f0be9b486462718f0525d5e049472692cb7", - "0xb2398e593bf340a15f7801e1d1fbda69d93f2a32a889ec7c6ae5e8a37567ac3e5227213c1392ee86cfb3b56ec2787839", - "0x8ddf10ccdd72922bed36829a36073a460c2118fc7a56ff9c1ac72581c799b15c762cb56cb78e3d118bb9f6a7e56cb25e", - "0x93e6bc0a4708d16387cacd44cf59363b994dc67d7ada7b6d6dbd831c606d975247541b42b2a309f814c1bfe205681fc6", - "0xb93fc35c05998cffda2978e12e75812122831523041f10d52f810d34ff71944979054b04de0117e81ddf5b0b4b3e13c0", - "0x92221631c44d60d68c6bc7b287509f37ee44cbe5fdb6935cee36b58b17c7325098f98f7910d2c3ca5dc885ad1d6dabc7", - "0xa230124424a57fad3b1671f404a94d7c05f4c67b7a8fbacfccea28887b78d7c1ed40b92a58348e4d61328891cd2f6cee", - "0xa6a230edb8518a0f49d7231bc3e0bceb5c2ac427f045819f8584ba6f3ae3d63ed107a9a62aad543d7e1fcf1f20605706", - "0x845be1fe94223c7f1f97d74c49d682472585d8f772762baad8a9d341d9c3015534cc83d102113c51a9dea2ab10d8d27b", - "0xb44262515e34f2db597c8128c7614d33858740310a49cdbdf9c8677c5343884b42c1292759f55b8b4abc4c86e4728033", - "0x805592e4a3cd07c1844bc23783408310accfdb769cca882ad4d07d608e590a288b7370c2cb327f5336e72b7083a0e30f", - "0x95153e8b1140df34ee864f4ca601cb873cdd3efa634af0c4093fbaede36f51b55571ab271e6a133020cd34db8411241f", - "0x82878c1285cfa5ea1d32175c9401f3cc99f6bb224d622d3fd98cc7b0a27372f13f7ab463ce3a33ec96f9be38dbe2dfe3", - "0xb7588748f55783077c27fc47d33e20c5c0f5a53fc0ac10194c003aa09b9f055d08ec971effa4b7f760553997a56967b3", - "0xb36b4de6d1883b6951f59cfae381581f9c6352fcfcf1524fccdab1571a20f80441d9152dc6b48bcbbf00371337ca0bd5", - "0x89c5523f2574e1c340a955cbed9c2f7b5fbceb260cb1133160dabb7d41c2f613ec3f6e74bbfab3c4a0a6f0626dbe068f", - "0xa52f58cc39f968a9813b1a8ddc4e83f4219e4dd82c7aa1dd083bea7edf967151d635aa9597457f879771759b876774e4", - "0x8300a67c2e2e123f89704abfde095463045dbd97e20d4c1157bab35e9e1d3d18f1f4aaba9cbe6aa2d544e92578eaa1b6", - "0xac6a7f2918768eb6a43df9d3a8a04f8f72ee52f2e91c064c1c7d75cad1a3e83e5aba9fe55bb94f818099ac91ccf2e961", - "0x8d64a2b0991cf164e29835c8ddef6069993a71ec2a7de8157bbfa2e00f6367be646ed74cbaf524f0e9fe13fb09fa15fd", - "0x8b2ffe5a545f9f680b49d0a9797a4a11700a2e2e348c34a7a985fc278f0f12def6e06710f40f9d48e4b7fbb71e072229", - "0x8ab8f71cd337fa19178924e961958653abf7a598e3f022138b55c228440a2bac4176cea3aea393549c03cd38a13eb3fc", - "0x8419d28318c19ea4a179b7abb43669fe96347426ef3ac06b158d79c0acf777a09e8e770c2fb10e14b3a0421705990b23", - "0x8bacdac310e1e49660359d0a7a17fe3d334eb820e61ae25e84cb52f863a2f74cbe89c2e9fc3283745d93a99b79132354", - "0xb57ace3fa2b9f6b2db60c0d861ace7d7e657c5d35d992588aeed588c6ce3a80b6f0d49f8a26607f0b17167ab21b675e4", - "0x83e265cde477f2ecc164f49ddc7fb255bb05ff6adc347408353b7336dc3a14fdedc86d5a7fb23f36b8423248a7a67ed1", - "0xa60ada971f9f2d79d436de5d3d045f5ab05308cae3098acaf5521115134b2a40d664828bb89895840db7f7fb499edbc5", - "0xa63eea12efd89b62d3952bf0542a73890b104dd1d7ff360d4755ebfa148fd62de668edac9eeb20507967ea37fb220202", - "0xa0275767a270289adc991cc4571eff205b58ad6d3e93778ddbf95b75146d82517e8921bd0d0564e5b75fa0ccdab8e624", - "0xb9b03fd3bf07201ba3a039176a965d736b4ef7912dd9e9bf69fe1b57c330a6aa170e5521fe8be62505f3af81b41d7806", - "0xa95f640e26fb1106ced1729d6053e41a16e4896acac54992279ff873e5a969aad1dcfa10311e28b8f409ac1dab7f03bb", - "0xb144778921742418053cb3c70516c63162c187f00db2062193bb2c14031075dbe055d020cde761b26e8c58d0ea6df2c1", - "0x8432fbb799e0435ef428d4fefc309a05dd589bce74d7a87faf659823e8c9ed51d3e42603d878e80f439a38be4321c2fa", - "0xb08ddef14e42d4fd5d8bf39feb7485848f0060d43b51ed5bdda39c05fe154fb111d29719ee61a23c392141358c0cfcff", - "0x8ae3c5329a5e025b86b5370e06f5e61177df4bda075856fade20a17bfef79c92f54ed495f310130021ba94fb7c33632b", - "0x92b6d3c9444100b4d7391febfc1dddaa224651677c3695c47a289a40d7a96d200b83b64e6d9df51f534564f272a2c6c6", - "0xb432bc2a3f93d28b5e506d68527f1efeb2e2570f6be0794576e2a6ef9138926fdad8dd2eabfa979b79ab7266370e86bc", - "0x8bc315eacedbcfc462ece66a29662ca3dcd451f83de5c7626ef8712c196208fb3d8a0faf80b2e80384f0dd9772f61a23", - "0xa72375b797283f0f4266dec188678e2b2c060dfed5880fc6bb0c996b06e91a5343ea2b695adaab0a6fd183b040b46b56", - "0xa43445036fbaa414621918d6a897d3692fdae7b2961d87e2a03741360e45ebb19fcb1703d23f1e15bb1e2babcafc56ac", - "0xb9636b2ffe305e63a1a84bd44fb402442b1799bd5272638287aa87ca548649b23ce8ce7f67be077caed6aa2dbc454b78", - "0x99a30bf0921d854c282b83d438a79f615424f28c2f99d26a05201c93d10378ab2cd94a792b571ddae5d4e0c0013f4006", - "0x8648e3c2f93d70b392443be116b48a863e4b75991bab5db656a4ef3c1e7f645e8d536771dfe4e8d1ceda3be8d32978b0", - "0xab50dc9e6924c1d2e9d2e335b2d679fc7d1a7632e84964d3bac0c9fe57e85aa5906ec2e7b0399d98ddd022e9b19b5904", - "0xab729328d98d295f8f3272afaf5d8345ff54d58ff9884da14f17ecbdb7371857fdf2f3ef58080054e9874cc919b46224", - "0x83fa5da7592bd451cad3ad7702b4006332b3aae23beab4c4cb887fa6348317d234bf62a359e665b28818e5410c278a09", - "0x8bdbff566ae9d368f114858ef1f009439b3e9f4649f73efa946e678d6c781d52c69af195df0a68170f5f191b2eac286b", - "0x91245e59b4425fd4edb2a61d0d47c1ccc83d3ced8180de34887b9655b5dcda033d48cde0bdc3b7de846d246c053a02e8", - "0xa2cb00721e68f1cad8933947456f07144dc69653f96ceed845bd577d599521ba99cdc02421118971d56d7603ed118cbf", - "0xaf8cd66d303e808b22ec57860dd909ca64c27ec2c60e26ffecfdc1179d8762ffd2739d87b43959496e9fee4108df71df", - "0x9954136812dffcd5d3f167a500e7ab339c15cfc9b3398d83f64b0daa3dd5b9a851204f424a3493b4e326d3de81e50a62", - "0x93252254d12511955f1aa464883ad0da793f84d900fea83e1df8bca0f2f4cf5b5f9acbaec06a24160d33f908ab5fea38", - "0x997cb55c26996586ba436a95566bd535e9c22452ca5d2a0ded2bd175376557fa895f9f4def4519241ff386a063f2e526", - "0xa12c78ad451e0ac911260ade2927a768b50cb4125343025d43474e7f465cdc446e9f52a84609c5e7e87ae6c9b3f56cda", - "0xa789d4ca55cbba327086563831b34487d63d0980ba8cf55197c016702ed6da9b102b1f0709ce3da3c53ff925793a3d73", - "0xa5d76acbb76741ce85be0e655b99baa04f7f587347947c0a30d27f8a49ae78cce06e1cde770a8b618d3db402be1c0c4b", - "0x873c0366668c8faddb0eb7c86f485718d65f8c4734020f1a18efd5fa123d3ea8a990977fe13592cd01d17e60809cb5ff", - "0xb659b71fe70f37573ff7c5970cc095a1dc0da3973979778f80a71a347ef25ad5746b2b9608bad4ab9a4a53a4d7df42d7", - "0xa34cbe05888e5e5f024a2db14cb6dcdc401a9cbd13d73d3c37b348f68688f87c24ca790030b8f84fef9e74b4eab5e412", - "0x94ce8010f85875c045b0f014db93ef5ab9f1f6842e9a5743dce9e4cb872c94affd9e77c1f1d1ab8b8660b52345d9acb9", - "0xadefa9b27a62edc0c5b019ddd3ebf45e4de846165256cf6329331def2e088c5232456d3de470fdce3fa758bfdd387512", - "0xa6b83821ba7c1f83cc9e4529cf4903adb93b26108e3d1f20a753070db072ad5a3689643144bdd9c5ea06bb9a7a515cd0", - "0xa3a9ddedc2a1b183eb1d52de26718151744db6050f86f3580790c51d09226bf05f15111691926151ecdbef683baa992c", - "0xa64bac89e7686932cdc5670d07f0b50830e69bfb8c93791c87c7ffa4913f8da881a9d8a8ce8c1a9ce5b6079358c54136", - "0xa77b5a63452cb1320b61ab6c7c2ef9cfbcade5fd4727583751fb2bf3ea330b5ca67757ec1f517bf4d503ec924fe32fbd", - "0x8746fd8d8eb99639d8cd0ca34c0d9c3230ed5a312aab1d3d925953a17973ee5aeb66e68667e93caf9cb817c868ea8f3d", - "0x88a2462a26558fc1fbd6e31aa8abdc706190a17c27fdc4217ffd2297d1b1f3321016e5c4b2384c5454d5717dc732ed03", - "0xb78893a97e93d730c8201af2e0d3b31cb923d38dc594ffa98a714e627c473d42ea82e0c4d2eeb06862ee22a9b2c54588", - "0x920cc8b5f1297cf215a43f6fc843e379146b4229411c44c0231f6749793d40f07b9af7699fd5d21fd69400b97febe027", - "0xa0f0eafce1e098a6b58c7ad8945e297cd93aaf10bc55e32e2e32503f02e59fc1d5776936577d77c0b1162cb93b88518b", - "0x98480ba0064e97a2e7a6c4769b4d8c2a322cfc9a3b2ca2e67e9317e2ce04c6e1108169a20bd97692e1cb1f1423b14908", - "0x83dbbb2fda7e287288011764a00b8357753a6a44794cc8245a2275237f11affdc38977214e463ad67aec032f3dfa37e9", - "0x86442fff37598ce2b12015ff19b01bb8a780b40ad353d143a0f30a06f6d23afd5c2b0a1253716c855dbf445cc5dd6865", - "0xb8a4c60c5171189414887847b9ed9501bff4e4c107240f063e2d254820d2906b69ef70406c585918c4d24f1dd052142b", - "0x919f33a98e84015b2034b57b5ffe9340220926b2c6e45f86fd79ec879dbe06a148ae68b77b73bf7d01bd638a81165617", - "0x95c13e78d89474a47fbc0664f6f806744b75dede95a479bbf844db4a7f4c3ae410ec721cb6ffcd9fa9c323da5740d5ae", - "0xab7151acc41fffd8ec6e90387700bcd7e1cde291ea669567295bea1b9dd3f1df2e0f31f3588cd1a1c08af8120aca4921", - "0x80e74c5c47414bd6eeef24b6793fb1fa2d8fb397467045fcff887c52476741d5bc4ff8b6d3387cb53ad285485630537f", - "0xa296ad23995268276aa351a7764d36df3a5a3cffd7dbeddbcea6b1f77adc112629fdeffa0918b3242b3ccd5e7587e946", - "0x813d2506a28a2b01cb60f49d6bd5e63c9b056aa56946faf2f33bd4f28a8d947569cfead3ae53166fc65285740b210f86", - "0x924b265385e1646287d8c09f6c855b094daaee74b9e64a0dddcf9ad88c6979f8280ba30c8597b911ef58ddb6c67e9fe3", - "0x8d531513c70c2d3566039f7ca47cd2352fd2d55b25675a65250bdb8b06c3843db7b2d29c626eed6391c238fc651cf350", - "0x82b338181b62fdc81ceb558a6843df767b6a6e3ceedc5485664b4ea2f555904b1a45fbb35f6cf5d96f27da10df82a325", - "0x92e62faaedea83a37f314e1d3cb4faaa200178371d917938e59ac35090be1db4b4f4e0edb78b9c991de202efe4f313d8", - "0x99d645e1b642c2dc065bac9aaa0621bc648c9a8351efb6891559c3a41ba737bd155fb32d7731950514e3ecf4d75980e4", - "0xb34a13968b9e414172fb5d5ece9a39cf2eb656128c3f2f6cc7a9f0c69c6bae34f555ecc8f8837dc34b5e470e29055c78", - "0xa2a0bb7f3a0b23a2cbc6585d59f87cd7e56b2bbcb0ae48f828685edd9f7af0f5edb4c8e9718a0aaf6ef04553ba71f3b7", - "0x8e1a94bec053ed378e524b6685152d2b52d428266f2b6eadd4bcb7c4e162ed21ab3e1364879673442ee2162635b7a4d8", - "0x9944adaff14a85eab81c73f38f386701713b52513c4d4b838d58d4ffa1d17260a6d056b02334850ea9a31677c4b078bd", - "0xa450067c7eceb0854b3eca3db6cf38669d72cb7143c3a68787833cbca44f02c0be9bfbe082896f8a57debb13deb2afb1", - "0x8be4ad3ac9ef02f7df09254d569939757101ee2eda8586fefcd8c847adc1efe5bdcb963a0cafa17651befaafb376a531", - "0x90f6de91ea50255f148ac435e08cf2ac00c772a466e38155bd7e8acf9197af55662c7b5227f88589b71abe9dcf7ba343", - "0x86e5a24f0748b106dee2d4d54e14a3b0af45a96cbee69cac811a4196403ebbee17fd24946d7e7e1b962ac7f66dbaf610", - "0xafdd96fbcda7aa73bf9eeb2292e036c25753d249caee3b9c013009cc22e10d3ec29e2aa6ddbb21c4e949b0c0bccaa7f4", - "0xb5a4e7436d5473647c002120a2cb436b9b28e27ad4ebdd7c5f122b91597c507d256d0cbd889d65b3a908531936e53053", - "0xb632414c3da704d80ac2f3e5e0e9f18a3637cdc2ebeb613c29300745582427138819c4e7b0bec3099c1b8739dac1807b", - "0xa28df1464d3372ce9f37ef1db33cc010f752156afae6f76949d98cd799c0cf225c20228ae86a4da592d65f0cffe3951b", - "0x898b93d0a31f7d3f11f253cb7a102db54b669fd150da302d8354d8e02b1739a47cb9bd88015f3baf12b00b879442464e", - "0x96fb88d89a12049091070cb0048a381902965e67a8493e3991eaabe5d3b7ff7eecd5c94493a93b174df3d9b2c9511755", - "0xb899cb2176f59a5cfba3e3d346813da7a82b03417cad6342f19cc8f12f28985b03bf031e856a4743fd7ebe16324805b0", - "0xa60e2d31bc48e0c0579db15516718a03b73f5138f15037491f4dae336c904e312eda82d50862f4debd1622bb0e56d866", - "0x979fc8b987b5cef7d4f4b58b53a2c278bd25a5c0ea6f41c715142ea5ff224c707de38451b0ad3aa5e749aa219256650a", - "0xb2a75bff18e1a6b9cf2a4079572e41205741979f57e7631654a3c0fcec57c876c6df44733c9da3d863db8dff392b44a3", - "0xb7a0f0e811222c91e3df98ff7f286b750bc3b20d2083966d713a84a2281744199e664879401e77470d44e5a90f3e5181", - "0x82b74ba21c9d147fbc338730e8f1f8a6e7fc847c3110944eb17a48bea5e06eecded84595d485506d15a3e675fd0e5e62", - "0xa7f44eef817d5556f0d1abcf420301217d23c69dd2988f44d91ea1f1a16c322263cbacd0f190b9ba22b0f141b9267b4f", - "0xaadb68164ede84fc1cb3334b3194d84ba868d5a88e4c9a27519eef4923bc4abf81aab8114449496c073c2a6a0eb24114", - "0xb5378605fabe9a8c12a5dc55ef2b1de7f51aedb61960735c08767a565793cea1922a603a6983dc25f7cea738d0f7c40d", - "0xa97a4a5cd8d51302e5e670aee78fe6b5723f6cc892902bbb4f131e82ca1dfd5de820731e7e3367fb0c4c1922a02196e3", - "0x8bdfeb15c29244d4a28896f2b2cb211243cd6a1984a3f5e3b0ebe5341c419beeab3304b390a009ffb47588018034b0ea", - "0xa9af3022727f2aa2fca3b096968e97edad3f08edcbd0dbca107b892ae8f746a9c0485e0d6eb5f267999b23a845923ed0", - "0x8e7594034feef412f055590fbb15b6322dc4c6ab7a4baef4685bd13d71a83f7d682b5781bdfa0d1c659489ce9c2b8000", - "0x84977ca6c865ebee021c58106c1a4ad0c745949ecc5332948002fd09bd9b890524878d0c29da96fd11207621136421fe", - "0x8687551a79158e56b2375a271136756313122132a6670fa51f99a1b5c229ed8eea1655a734abae13228b3ebfd2a825dd", - "0xa0227d6708979d99edfc10f7d9d3719fd3fc68b0d815a7185b60307e4c9146ad2f9be2b8b4f242e320d4288ceeb9504c", - "0x89f75583a16735f9dd8b7782a130437805b34280ccea8dac6ecaee4b83fe96947e7b53598b06fecfffdf57ffc12cc445", - "0xa0056c3353227f6dd9cfc8e3399aa5a8f1d71edf25d3d64c982910f50786b1e395c508d3e3727ac360e3e040c64b5298", - "0xb070e61a6d813626144b312ded1788a6d0c7cec650a762b2f8df6e4743941dd82a2511cd956a3f141fc81e15f4e092da", - "0xb4e6db232e028a1f989bb5fc13416711f42d389f63564d60851f009dcffac01acfd54efa307aa6d4c0f932892d4e62b0", - "0x89b5991a67db90024ddd844e5e1a03ef9b943ad54194ae0a97df775dde1addf31561874f4e40fbc37a896630f3bbda58", - "0xad0e8442cb8c77d891df49cdb9efcf2b0d15ac93ec9be1ad5c3b3cca1f4647b675e79c075335c1f681d56f14dc250d76", - "0xb5d55a6ae65bb34dd8306806cb49b5ccb1c83a282ee47085cf26c4e648e19a52d9c422f65c1cd7e03ca63e926c5e92ea", - "0xb749501347e5ec07e13a79f0cb112f1b6534393458b3678a77f02ca89dca973fa7b30e55f0b25d8b92b97f6cb0120056", - "0x94144b4a3ffc5eec6ba35ce9c245c148b39372d19a928e236a60e27d7bc227d18a8cac9983851071935d8ffb64b3a34f", - "0x92bb4f9f85bc8c028a3391306603151c6896673135f8a7aefedd27acb322c04ef5dac982fc47b455d6740023e0dd3ea3", - "0xb9633a4a101461a782fc2aa092e9dbe4e2ad00987578f18cd7cf0021a909951d60fe79654eb7897806795f93c8ff4d1c", - "0x809f0196753024821b48a016eca5dbb449a7c55750f25981bb7a4b4c0e0846c09b8f6128137905055fc43a3f0deb4a74", - "0xa27dc9cdd1e78737a443570194a03d89285576d3d7f3a3cf15cc55b3013e42635d4723e2e8fe1d0b274428604b630db9", - "0x861f60f0462e04cd84924c36a28163def63e777318d00884ab8cb64c8df1df0bce5900342163edb60449296484a6c5bf", - "0xb7bc23fb4e14af4c4704a944253e760adefeca8caee0882b6bbd572c84434042236f39ae07a8f21a560f486b15d82819", - "0xb9a6eb492d6dd448654214bd01d6dc5ff12067a11537ab82023fc16167507ee25eed2c91693912f4155d1c07ed9650b3", - "0x97678af29c68f9a5e213bf0fb85c265303714482cfc4c2c00b4a1e8a76ed08834ee6af52357b143a1ca590fb0265ea5a", - "0x8a15b499e9eca5b6cac3070b5409e8296778222018ad8b53a5d1f6b70ad9bb10c68a015d105c941ed657bf3499299e33", - "0xb487fefede2e8091f2c7bfe85770db2edff1db83d4effe7f7d87bff5ab1ace35e9b823a71adfec6737fede8d67b3c467", - "0x8b51b916402aa2c437fce3bcad6dad3be8301a1a7eab9d163085b322ffb6c62abf28637636fe6114573950117fc92898", - "0xb06a2106d031a45a494adec0881cb2f82275dff9dcdd2bc16807e76f3bec28a6734edd3d54f0be8199799a78cd6228ad", - "0xaf0a185391bbe2315eb97feac98ad6dd2e5d931d012c621abd6e404a31cc188b286fef14871762190acf086482b2b5e2", - "0x8e78ee8206506dd06eb7729e32fceda3bebd8924a64e4d8621c72e36758fda3d0001af42443851d6c0aea58562870b43", - "0xa1ba52a569f0461aaf90b49b92be976c0e73ec4a2c884752ee52ffb62dd137770c985123d405dfb5de70692db454b54a", - "0x8d51b692fa1543c51f6b62b9acb8625ed94b746ef96c944ca02859a4133a5629da2e2ce84e111a7af8d9a5b836401c64", - "0xa7a20d45044cf6492e0531d0b8b26ffbae6232fa05a96ed7f06bdb64c2b0f5ca7ec59d5477038096a02579e633c7a3ff", - "0x84df867b98c53c1fcd4620fef133ee18849c78d3809d6aca0fb6f50ff993a053a455993f216c42ab6090fa5356b8d564", - "0xa7227c439f14c48e2577d5713c97a5205feb69acb0b449152842e278fa71e8046adfab468089c8b2288af1fc51fa945b", - "0x855189b3a105670779997690876dfaa512b4a25a24931a912c2f0f1936971d2882fb4d9f0b3d9daba77eaf660e9d05d5", - "0xb5696bd6706de51c502f40385f87f43040a5abf99df705d6aac74d88c913b8ecf7a99a63d7a37d9bdf3a941b9e432ff5", - "0xab997beb0d6df9c98d5b49864ef0b41a2a2f407e1687dfd6089959757ba30ed02228940b0e841afe6911990c74d536c4", - "0xb36b65f85546ebfdbe98823d5555144f96b4ab39279facd19c0de3b8919f105ba0315a0784dce4344b1bc62d8bb4a5a3", - "0xb8371f0e4450788720ac5e0f6cd3ecc5413d33895083b2c168d961ec2b5c3de411a4cc0712481cbe8df8c2fa1a7af006", - "0x98325d8026b810a8b7a114171ae59a57e8bbc9848e7c3df992efc523621729fd8c9f52114ce01d7730541a1ada6f1df1", - "0x8d0e76dbd37806259486cd9a31bc8b2306c2b95452dc395546a1042d1d17863ef7a74c636b782e214d3aa0e8d717f94a", - "0xa4e15ead76da0214d702c859fb4a8accdcdad75ed08b865842bd203391ec4cba2dcc916455e685f662923b96ee0c023f", - "0x8618190972086ebb0c4c1b4a6c94421a13f378bc961cc8267a301de7390c5e73c3333864b3b7696d81148f9d4843fd02", - "0x85369d6cc7342e1aa15b59141517d8db8baaaeb7ab9670f3ba3905353948d575923d283b7e5a05b13a30e7baf1208a86", - "0x87c51ef42233c24a6da901f28c9a075d9ba3c625687c387ad6757b72ca6b5a8885e6902a3082da7281611728b1e45f26", - "0xaa6348a4f71927a3106ad0ea8b02fc8d8c65531e4ab0bd0a17243e66f35afe252e40ab8eef9f13ae55a72566ffdaff5c", - "0x96a3bc976e9d03765cc3fee275fa05b4a84c94fed6b767e23ca689394501e96f56f7a97cffddc579a6abff632bf153be", - "0x97dbf96c6176379fdb2b888be4e757b2bca54e74124bd068d3fa1dbd82a011bbeb75079da38e0cd22a761fe208ecad9b", - "0xb70cf0a1d14089a4129ec4e295313863a59da8c7e26bf74cc0e704ed7f0ee4d7760090d0ddf7728180f1bf2c5ac64955", - "0x882d664714cc0ffe53cbc9bef21f23f3649824f423c4dbad1f893d22c4687ab29583688699efc4d5101aa08b0c3e267a", - "0x80ecb7cc963e677ccaddbe3320831dd6ee41209acf4ed41b16dc4817121a3d86a1aac9c4db3d8c08a55d28257088af32", - "0xa25ba667d832b145f9ce18c3f9b1bd00737aa36db020e1b99752c8ef7d27c6c448982bd8d352e1b6df266b8d8358a8d5", - "0x83734841c13dee12759d40bdd209b277e743b0d08cc0dd1e0b7afd2d65bfa640400eefcf6be4a52e463e5b3d885eeac6", - "0x848d16505b04804afc773aebabb51b36fd8aacfbb0e09b36c0d5d57df3c0a3b92f33e7d5ad0a7006ec46ebb91df42b8c", - "0x909a8d793f599e33bb9f1dc4792a507a97169c87cd5c087310bc05f30afcd247470b4b56dec59894c0fb1d48d39bb54e", - "0x8e558a8559df84a1ba8b244ece667f858095c50bb33a5381e60fcc6ba586b69693566d8819b4246a27287f16846c1dfa", - "0x84d6b69729f5aaa000cd710c2352087592cfbdf20d5e1166977e195818e593fa1a50d1e04566be23163a2523dc1612f1", - "0x9536d262b7a42125d89f4f32b407d737ba8d9242acfc99d965913ab3e043dcac9f7072a43708553562cac4cba841df30", - "0x9598548923ca119d6a15fd10861596601dd1dedbcccca97bb208cdc1153cf82991ea8cc17686fbaa867921065265970c", - "0xb87f2d4af6d026e4d2836bc3d390a4a18e98a6e386282ce96744603bab74974272e97ac2da281afa21885e2cbb3a8001", - "0x991ece62bf07d1a348dd22191868372904b9f8cf065ae7aa4e44fd24a53faf6d851842e35fb472895963aa1992894918", - "0xa8c53dea4c665b30e51d22ca6bc1bc78aaf172b0a48e64a1d4b93439b053877ec26cb5221c55efd64fa841bbf7d5aff4", - "0x93487ec939ed8e740f15335b58617c3f917f72d07b7a369befd479ae2554d04deb240d4a14394b26192efae4d2f4f35d", - "0xa44793ab4035443f8f2968a40e043b4555960193ffa3358d22112093aadfe2c136587e4139ffd46d91ed4107f61ea5e0", - "0xb13fe033da5f0d227c75927d3dacb06dbaf3e1322f9d5c7c009de75cdcba5e308232838785ab69a70f0bedea755e003f", - "0x970a29b075faccd0700fe60d1f726bdebf82d2cc8252f4a84543ebd3b16f91be42a75c9719a39c4096139f0f31393d58", - "0xa4c3eb1f7160f8216fc176fb244df53008ff32f2892363d85254002e66e2de21ccfe1f3b1047589abee50f29b9d507e3", - "0x8c552885eab04ba40922a8f0c3c38c96089c95ff1405258d3f1efe8d179e39e1295cbf67677894c607ae986e4e6b1fb0", - "0xb3671746fa7f848c4e2ae6946894defadd815230b906b419143523cc0597bc1d6c0a4c1e09d49b66b4a2c11cde3a4de3", - "0x937a249a95813a5e2ef428e355efd202e15a37d73e56cfb7e57ea9f943f2ce5ca8026f2f1fd25bf164ba89d07077d858", - "0x83646bdf6053a04aa9e2f112499769e5bd5d0d10f2e13db3ca89bd45c0b3b7a2d752b7d137fb3909f9c62b78166c9339", - "0xb4eac4b91e763666696811b7ed45e97fd78310377ebea1674b58a2250973f80492ac35110ed1240cd9bb2d17493d708c", - "0x82db43a99bc6573e9d92a3fd6635dbbb249ac66ba53099c3c0c8c8080b121dd8243cd5c6e36ba0a4d2525bae57f5c89c", - "0xa64d6a264a681b49d134c655d5fc7756127f1ee7c93d328820f32bca68869f53115c0d27fef35fe71f7bc4fdaed97348", - "0x8739b7a9e2b4bc1831e7f04517771bc7cde683a5e74e052542517f8375a2f64e53e0d5ac925ef722327e7bb195b4d1d9", - "0x8f337cdd29918a2493515ebb5cf702bbe8ecb23b53c6d18920cc22f519e276ca9b991d3313e2d38ae17ae8bdfa4f8b7e", - "0xb0edeab9850e193a61f138ef2739fc42ceec98f25e7e8403bfd5fa34a7bc956b9d0898250d18a69fa4625a9b3d6129da", - "0xa9920f26fe0a6d51044e623665d998745c9eca5bce12051198b88a77d728c8238f97d4196f26e43b24f8841500b998d0", - "0x86e655d61502b979eeeeb6f9a7e1d0074f936451d0a1b0d2fa4fb3225b439a3770767b649256fe481361f481a8dbc276", - "0x84d3b32fa62096831cc3bf013488a9f3f481dfe293ae209ed19585a03f7db8d961a7a9dd0db82bd7f62d612707575d9c", - "0x81c827826ec9346995ffccf62a241e3b2d32f7357acd1b1f8f7a7dbc97022d3eb51b8a1230e23ce0b401d2e535e8cd78", - "0x94a1e40c151191c5b055b21e86f32e69cbc751dcbdf759a48580951834b96a1eed75914c0d19a38aefd21fb6c8d43d0c", - "0xab890222b44bc21b71f7c75e15b6c6e16bb03371acce4f8d4353ff3b8fcd42a14026589c5ed19555a3e15e4d18bfc3a3", - "0xaccb0be851e93c6c8cc64724cdb86887eea284194b10e7a43c90528ed97e9ec71ca69c6fac13899530593756dd49eab2", - "0xb630220aa9e1829c233331413ee28c5efe94ea8ea08d0c6bfd781955078b43a4f92915257187d8526873e6c919c6a1de", - "0xadd389a4d358c585f1274b73f6c3c45b58ef8df11f9d11221f620e241bf3579fba07427b288c0c682885a700cc1fa28d", - "0xa9fe6ca8bf2961a3386e8b8dcecc29c0567b5c0b3bcf3b0f9169f88e372b80151af883871fc5229815f94f43a6f5b2b0", - "0xad839ae003b92b37ea431fa35998b46a0afc3f9c0dd54c3b3bf7a262467b13ff3c323ada1c1ae02ac7716528bdf39e3e", - "0x9356d3fd0edcbbb65713c0f2a214394f831b26f792124b08c5f26e7f734b8711a87b7c4623408da6a091c9aef1f6af3c", - "0x896b25b083c35ac67f0af3784a6a82435b0e27433d4d74cd6d1eafe11e6827827799490fb1c77c11de25f0d75f14e047", - "0x8bfa019391c9627e8e5f05c213db625f0f1e51ec68816455f876c7e55b8f17a4f13e5aae9e3fb9e1cf920b1402ee2b40", - "0x8ba3a6faa6a860a8f3ce1e884aa8769ceded86380a86520ab177ab83043d380a4f535fe13884346c5e51bee68da6ab41", - "0xa8292d0844084e4e3bb7af92b1989f841a46640288c5b220fecfad063ee94e86e13d3d08038ec2ac82f41c96a3bfe14d", - "0x8229bb030b2fc566e11fd33c7eab7a1bb7b49fed872ea1f815004f7398cb03b85ea14e310ec19e1f23e0bdaf60f8f76c", - "0x8cfbf869ade3ec551562ff7f63c2745cc3a1f4d4dc853a0cd42dd5f6fe54228f86195ea8fe217643b32e9f513f34a545", - "0xac52a3c8d3270ddfe1b5630159da9290a5ccf9ccbdef43b58fc0a191a6c03b8a5974cf6e2bbc7bd98d4a40a3581482d7", - "0xab13decb9e2669e33a7049b8eca3ca327c40dea15ad6e0e7fa63ed506db1d258bc36ac88b35f65cae0984e937eb6575d", - "0xb5e748eb1a7a1e274ff0cc56311c198f2c076fe4b7e73e5f80396fe85358549df906584e6bb2c8195b3e2be7736850a5", - "0xb5cb911325d8f963c41f691a60c37831c7d3bbd92736efa33d1f77a22b3fde7f283127256c2f47e197571e6fe0b46149", - "0x8a01dc6ed1b55f26427a014faa347130738b191a06b800e32042a46c13f60b49534520214359d68eb2e170c31e2b8672", - "0xa72fa874866e19b2efb8e069328362bf7921ec375e3bcd6b1619384c3f7ee980f6cf686f3544e9374ff54b4d17a1629c", - "0x8db21092f7c5f110fba63650b119e82f4b42a997095d65f08f8237b02dd66fdf959f788df2c35124db1dbd330a235671", - "0x8c65d50433d9954fe28a09fa7ba91a70a590fe7ba6b3060f5e4be0f6cef860b9897fa935fb4ebc42133524eb071dd169", - "0xb4614058e8fa21138fc5e4592623e78b8982ed72aa35ee4391b164f00c68d277fa9f9eba2eeefc890b4e86eba5124591", - "0xab2ad3a1bce2fbd55ca6b7c23786171fe1440a97d99d6df4d80d07dd56ac2d7203c294b32fc9e10a6c259381a73f24a1", - "0x812ae3315fdc18774a8da3713a4679e8ed10b9405edc548c00cacbe25a587d32040566676f135e4723c5dc25df5a22e9", - "0xa464b75f95d01e5655b54730334f443c8ff27c3cb79ec7af4b2f9da3c2039c609908cd128572e1fd0552eb597e8cef8d", - "0xa0db3172e93ca5138fe419e1c49a1925140999f6eff7c593e5681951ee0ec1c7e454c851782cbd2b8c9bc90d466e90e0", - "0x806db23ba7d00b87d544eed926b3443f5f9c60da6b41b1c489fba8f73593b6e3b46ebfcab671ee009396cd77d5e68aa1", - "0x8bfdf2c0044cc80260994e1c0374588b6653947b178e8b312be5c2a05e05767e98ea15077278506aee7df4fee1aaf89e", - "0x827f6558c16841b5592ff089c9c31e31eb03097623524394813a2e4093ad2d3f8f845504e2af92195aaa8a1679d8d692", - "0x925c4f8eab2531135cd71a4ec88e7035b5eea34ba9d799c5898856080256b4a15ed1a746e002552e2a86c9c157e22e83", - "0xa9f9a368f0e0b24d00a35b325964c85b69533013f9c2cfad9708be5fb87ff455210f8cb8d2ce3ba58ca3f27495552899", - "0x8ac0d3bebc1cae534024187e7c71f8927ba8fcc6a1926cb61c2b6c8f26bb7831019e635a376146c29872a506784a4aaa", - "0x97c577be2cbbfdb37ad754fae9df2ada5fc5889869efc7e18a13f8e502fbf3f4067a509efbd46fd990ab47ce9a70f5a8", - "0x935e7d82bca19f16614aa43b4a3474e4d20d064e4bfdf1cea2909e5c9ab72cfe3e54dc50030e41ee84f3588cebc524e9", - "0x941aafc08f7c0d94cebfbb1f0aad5202c02e6e37f2c12614f57e727efa275f3926348f567107ee6d8914dd71e6060271", - "0xaf0fbc1ba05b4b5b63399686df3619968be5d40073de0313cbf5f913d3d4b518d4c249cdd2176468ccaa36040a484f58", - "0xa0c414f23f46ca6d69ce74c6f8a00c036cb0edd098af0c1a7d39c802b52cfb2d5dbdf93fb0295453d4646e2af7954d45", - "0x909cf39e11b3875bb63b39687ae1b5d1f5a15445e39bf164a0b14691b4ddb39a8e4363f584ef42213616abc4785b5d66", - "0xa92bac085d1194fbd1c88299f07a061d0bdd3f980b663e81e6254dbb288bf11478c0ee880e28e01560f12c5ccb3c0103", - "0x841705cd5cd76b943e2b7c5e845b9dd3c8defe8ef67e93078d6d5e67ade33ad4b0fd413bc196f93b0a4073c855cd97d4", - "0x8e7eb8364f384a9161e81d3f1d52ceca9b65536ae49cc35b48c3e2236322ba4ae9973e0840802d9fa4f4d82ea833544f", - "0xaed3ab927548bc8bec31467ba80689c71a168e34f50dcb6892f19a33a099f5aa6b3f9cb79f5c0699e837b9a8c7f27efe", - "0xb8fbf7696210a36e20edabd77839f4dfdf50d6d015cdf81d587f90284a9bcef7d2a1ff520728d7cc69a4843d6c20dedd", - "0xa9d533769ce6830211c884ae50a82a7bf259b44ac71f9fb11f0296fdb3981e6b4c1753fe744647b247ebc433a5a61436", - "0x8b4bdf90d33360b7f428c71cde0a49fb733badba8c726876945f58c620ce7768ae0e98fc8c31fa59d8955a4823336bb1", - "0x808d42238e440e6571c59e52a35ae32547d502dc24fd1759d8ea70a7231a95859baf30b490a4ba55fa2f3aaa11204597", - "0x85594701f1d2fee6dc1956bc44c7b31db93bdeec2f3a7d622c1a08b26994760773e3d57521a44cfd7e407ac3fd430429", - "0xa66de045ce7173043a6825e9dc440ac957e2efb6df0a337f4f8003eb0c719d873a52e6eba3cb0d69d977ca37d9187674", - "0x87a1c6a1fdff993fa51efa5c3ba034c079c0928a7d599b906336af7c2dcab9721ceaf3108c646490af9dff9a754f54b3", - "0x926424223e462ceb75aed7c22ade8a7911a903b7e5dd4bc49746ddce8657f4616325cd12667d4393ac52cdd866396d0e", - "0xb5dc96106593b42b30f06f0b0a1e0c1aafc70432e31807252d3674f0b1ea5e58eac8424879d655c9488d85a879a3e572", - "0x997ca0987735cc716507cb0124b1d266d218b40c9d8e0ecbf26a1d65719c82a637ce7e8be4b4815d307df717bde7c72a", - "0x92994d3f57a569b7760324bb5ae4e8e14e1633d175dab06aa57b8e391540e05f662fdc08b8830f489a063f59b689a688", - "0xa8087fcc6aa4642cb998bea11facfe87eb33b90a9aa428ab86a4124ad032fc7d2e57795311a54ec9f55cc120ebe42df1", - "0xa9bd7d1de6c0706052ca0b362e2e70e8c8f70f1f026ea189b4f87a08ce810297ebfe781cc8004430776c54c1a05ae90c", - "0x856d33282e8a8e33a3d237fb0a0cbabaf77ba9edf2fa35a831fdafcadf620561846aa6cbb6bdc5e681118e1245834165", - "0x9524a7aa8e97a31a6958439c5f3339b19370f03e86b89b1d02d87e4887309dbbe9a3a8d2befd3b7ed5143c8da7e0a8ad", - "0x824fdf433e090f8acbd258ac7429b21f36f9f3b337c6d0b71d1416a5c88a767883e255b2888b7c906dd2e9560c4af24c", - "0x88c7fee662ca7844f42ed5527996b35723abffd0d22d4ca203b9452c639a5066031207a5ae763dbc0865b3299d19b1ec", - "0x919dca5c5595082c221d5ab3a5bc230f45da7f6dec4eb389371e142c1b9c6a2c919074842479c2844b72c0d806170c0c", - "0xb939be8175715e55a684578d8be3ceff3087f60fa875fff48e52a6e6e9979c955efef8ff67cfa2b79499ea23778e33b0", - "0x873b6db725e7397d11bc9bed9ac4468e36619135be686790a79bc6ed4249058f1387c9a802ea86499f692cf635851066", - "0xaeae06db3ec47e9e5647323fa02fac44e06e59b885ad8506bf71b184ab3895510c82f78b6b22a5d978e8218e7f761e9f", - "0xb99c0a8359c72ab88448bae45d4bf98797a26bca48b0d4460cd6cf65a4e8c3dd823970ac3eb774ae5d0cea4e7fadf33e", - "0x8f10c8ec41cdfb986a1647463076a533e6b0eec08520c1562401b36bb063ac972aa6b28a0b6ce717254e35940b900e3c", - "0xa106d9be199636d7add43b942290269351578500d8245d4aae4c083954e4f27f64740a3138a66230391f2d0e6043a8de", - "0xa469997908244578e8909ff57cffc070f1dbd86f0098df3cfeb46b7a085cfecc93dc69ee7cad90ff1dc5a34d50fe580c", - "0xa4ef087bea9c20eb0afc0ee4caba7a9d29dfa872137828c721391273e402fb6714afc80c40e98bbd8276d3836bffa080", - "0xb07a013f73cd5b98dae0d0f9c1c0f35bff8a9f019975c4e1499e9bee736ca6fcd504f9bc32df1655ff333062382cff04", - "0xb0a77188673e87cc83348c4cc5db1eecf6b5184e236220c8eeed7585e4b928db849944a76ec60ef7708ef6dac02d5592", - "0xb1284b37e59b529f0084c0dacf0af6c0b91fc0f387bf649a8c74819debf606f7b07fc3e572500016fb145ec2b24e9f17", - "0x97b20b5b4d6b9129da185adfbf0d3d0b0faeba5b9715f10299e48ea0521709a8296a9264ce77c275a59c012b50b6519a", - "0xb9d37e946fae5e4d65c1fbfacc8a62e445a1c9d0f882e60cca649125af303b3b23af53c81d7bac544fb7fcfc7a314665", - "0x8e5acaac379f4bb0127efbef26180f91ff60e4c525bc9b798fc50dfaf4fe8a5aa84f18f3d3cfb8baead7d1e0499af753", - "0xb0c0b8ab1235bf1cda43d4152e71efc1a06c548edb964eb4afceb201c8af24240bf8ab5cae30a08604e77432b0a5faf0", - "0x8cc28d75d5c8d062d649cbc218e31c4d327e067e6dbd737ec0a35c91db44fbbd0d40ec424f5ed79814add16947417572", - "0x95ae6219e9fd47efaa9cb088753df06bc101405ba50a179d7c9f7c85679e182d3033f35b00dbba71fdcd186cd775c52e", - "0xb5d28fa09f186ebc5aa37453c9b4d9474a7997b8ae92748ecb940c14868792292ac7d10ade01e2f8069242b308cf97e5", - "0x8c922a0faa14cc6b7221f302df3342f38fc8521ec6c653f2587890192732c6da289777a6cd310747ea7b7d104af95995", - "0xb9ad5f660b65230de54de535d4c0fcae5bc6b59db21dea5500fdc12eea4470fb8ea003690fdd16d052523418d5e01e8c", - "0xa39a9dd41a0ff78c82979483731f1cd68d3921c3e9965869662c22e02dde3877802e180ba93f06e7346f96d9fa9261d2", - "0x8b32875977ec372c583b24234c27ed73aef00cdff61eb3c3776e073afbdeade548de9497c32ec6d703ff8ad0a5cb7fe4", - "0x9644cbe755a5642fe9d26cfecf170d3164f1848c2c2e271d5b6574a01755f3980b3fc870b98cf8528fef6ecef4210c16", - "0x81ea9d1fdd9dd66d60f40ce0712764b99da9448ae0b300f8324e1c52f154e472a086dda840cb2e0b9813dc8ce8afd4b5", - "0x906aaa4a7a7cdf01909c5cfbc7ded2abc4b869213cbf7c922d4171a4f2e637e56f17020b852ad339d83b8ac92f111666", - "0x939b5f11acbdeff998f2a080393033c9b9d8d5c70912ea651c53815c572d36ee822a98d6dfffb2e339f29201264f2cf4", - "0xaba4898bf1ccea9b9e2df1ff19001e05891581659c1cbbde7ee76c349c7fc7857261d9785823c9463a8aea3f40e86b38", - "0x83ca1a56b8a0be4820bdb5a9346357c68f9772e43f0b887729a50d2eb2a326bbcede676c8bf2e51d7c89bbd8fdb778a6", - "0x94e86e9fe6addfe2c3ee3a547267ed921f4230d877a85bb4442c2d9350c2fa9a9c54e6fe662de82d1a2407e4ab1691c2", - "0xa0cc3bdef671a59d77c6984338b023fa2b431b32e9ed2abe80484d73edc6540979d6f10812ecc06d4d0c5d4eaca7183c", - "0xb5343413c1b5776b55ea3c7cdd1f3af1f6bd802ea95effe3f2b91a523817719d2ecc3f8d5f3cc2623ace7e35f99ca967", - "0x92085d1ed0ed28d8cabe3e7ff1905ed52c7ceb1eac5503760c52fb5ee3a726aba7c90b483c032acc3f166b083d7ec370", - "0x8ec679520455275cd957fca8122724d287db5df7d29f1702a322879b127bff215e5b71d9c191901465d19c86c8d8d404", - "0xb65eb2c63d8a30332eb24ee8a0c70156fc89325ebbb38bacac7cf3f8636ad8a472d81ccca80423772abc00192d886d8a", - "0xa9fe1c060b974bee4d590f2873b28635b61bfcf614e61ff88b1be3eee4320f4874e21e8d666d8ac8c9aba672efc6ecae", - "0xb3fe2a9a389c006a831dea7e777062df84b5c2803f9574d7fbe10b7e1c125817986af8b6454d6be9d931a5ac94cfe963", - "0x95418ad13b734b6f0d33822d9912c4c49b558f68d08c1b34a0127fcfa666bcae8e6fda8832d2c75bb9170794a20e4d7c", - "0xa9a7df761e7f18b79494bf429572140c8c6e9d456c4d4e336184f3f51525a65eb9582bea1e601bdb6ef8150b7ca736a5", - "0xa0de03b1e75edf7998c8c1ac69b4a1544a6fa675a1941950297917366682e5644a4bda9cdeedfaf9473d7fccd9080b0c", - "0xa61838af8d95c95edf32663a68f007d95167bf6e41b0c784a30b22d8300cfdd5703bd6d16e86396638f6db6ae7e42a85", - "0x8866d62084d905c145ff2d41025299d8b702ac1814a7dec4e277412c161bc9a62fed735536789cb43c88693c6b423882", - "0x91da22c378c81497fe363e7f695c0268443abee50f8a6625b8a41e865638a643f07b157ee566de09ba09846934b4e2d7", - "0x941d21dd57c9496aa68f0c0c05507405fdd413acb59bc668ce7e92e1936c68ec4b065c3c30123319884149e88228f0b2", - "0xa77af9b094bc26966ddf2bf9e1520c898194a5ccb694915950dadc204facbe3066d3d89f50972642d76b14884cfbaa21", - "0x8e76162932346869f4618bde744647f7ab52ab498ad654bdf2a4feeb986ac6e51370841e5acbb589e38b6e7142bb3049", - "0xb60979ace17d6937ece72e4f015da4657a443dd01cebc7143ef11c09e42d4aa8855999a65a79e2ea0067f31c9fc2ab0f", - "0xb3e2ffdd5ee6fd110b982fd4fad4b93d0fca65478f986d086eeccb0804960bfaa1919afa743c2239973ea65091fe57d2", - "0x8ce0ce05e7d7160d44574011da687454dbd3c8b8290aa671731b066e2c82f8cf2d63cb8e932d78c6122ec610e44660e6", - "0xab005dd8d297045c39e2f72fb1c48edb501ccf3575d3d04b9817b3afee3f0bb0f3f53f64bda37d1d9cde545aae999bae", - "0x95bd7edb4c4cd60e3cb8a72558845a3cce6bb7032ccdf33d5a49ebb6ddf203bc3c79e7b7e550735d2d75b04c8b2441e8", - "0x889953ee256206284094e4735dbbb17975bafc7c3cb94c9fbfee4c3e653857bfd49e818f64a47567f721b98411a3b454", - "0xb188423e707640ab0e75a061e0b62830cde8afab8e1ad3dae30db69ffae4e2fc005bababbdcbd7213b918ed4f70e0c14", - "0xa97e0fafe011abd70d4f99a0b36638b3d6e7354284588f17a88970ed48f348f88392779e9a038c6cbc9208d998485072", - "0x87db11014a91cb9b63e8dfaa82cdebca98272d89eb445ee1e3ff9dbaf2b3fad1a03b888cffc128e4fe208ed0dddece0f", - "0xaad2e40364edd905d66ea4ac9d51f9640d6fda9a54957d26ba233809851529b32c85660fa401dbee3679ec54fa6dd966", - "0x863e99336ca6edf03a5a259e59a2d0f308206e8a2fb320cfc0be06057366df8e0f94b33a28f574092736b3c5ada84270", - "0xb34bcc56a057589f34939a1adc51de4ff6a9f4fee9c7fa9aa131e28d0cf0759a0c871b640162acdfbf91f3f1b59a3703", - "0x935dd28f2896092995c5eff1618e5b6efe7a40178888d7826da9b0503c2d6e68a28e7fac1a334e166d0205f0695ef614", - "0xb842cd5f8f5de5ca6c68cb4a5c1d7b451984930eb4cc18fd0934d52fdc9c3d2d451b1c395594d73bc3451432bfba653f", - "0x9014537885ce2debad736bc1926b25fdab9f69b216bf024f589c49dc7e6478c71d595c3647c9f65ff980b14f4bb2283b", - "0x8e827ccca1dd4cd21707140d10703177d722be0bbe5cac578db26f1ef8ad2909103af3c601a53795435b27bf95d0c9ed", - "0x8a0b8ad4d466c09d4f1e9167410dbe2edc6e0e6229d4b3036d30f85eb6a333a18b1c968f6ca6d6889bb08fecde017ef4", - "0x9241ee66c0191b06266332dc9161dede384c4bb4e116dbd0890f3c3790ec5566da4568243665c4725b718ac0f6b5c179", - "0xaeb4d5fad81d2b505d47958a08262b6f1b1de9373c2c9ba6362594194dea3e002ab03b8cbb43f867be83065d3d370f19", - "0x8781bc83bb73f7760628629fe19e4714b494dbed444c4e4e4729b7f6a8d12ee347841a199888794c2234f51fa26fc2b9", - "0xb58864f0acd1c2afa29367e637cbde1968d18589245d9936c9a489c6c495f54f0113ecdcbe4680ac085dd3c397c4d0c3", - "0x94a24284afaeead61e70f3e30f87248d76e9726759445ca18cdb9360586c60cc9f0ec1c397f9675083e0b56459784e2e", - "0xaed358853f2b54dcbddf865e1816c2e89be12e940e1abfa661e2ee63ffc24a8c8096be2072fa83556482c0d89e975124", - "0xb95374e6b4fc0765708e370bc881e271abf2e35c08b056a03b847e089831ef4fe3124b9c5849d9c276eb2e35b3daf264", - "0xb834cdbcfb24c8f84bfa4c552e7fadc0028a140952fd69ed13a516e1314a4cd35d4b954a77d51a1b93e1f5d657d0315d", - "0x8fb6d09d23bfa90e7443753d45a918d91d75d8e12ec7d016c0dfe94e5c592ba6aaf483d2f16108d190822d955ad9cdc3", - "0xaa315cd3c60247a6ad4b04f26c5404c2713b95972843e4b87b5a36a89f201667d70f0adf20757ebe1de1b29ae27dda50", - "0xa116862dca409db8beff5b1ccd6301cdd0c92ca29a3d6d20eb8b87f25965f42699ca66974dd1a355200157476b998f3b", - "0xb4c2f5fe173c4dc8311b60d04a65ce1be87f070ac42e13cd19c6559a2931c6ee104859cc2520edebbc66a13dc7d30693", - "0x8d4a02bf99b2260c334e7d81775c5cf582b00b0c982ce7745e5a90624919028278f5e9b098573bad5515ce7fa92a80c8", - "0x8543493bf564ce6d97bd23be9bff1aba08bd5821ca834f311a26c9139c92a48f0c2d9dfe645afa95fec07d675d1fd53b", - "0x9344239d13fde08f98cb48f1f87d34cf6abe8faecd0b682955382a975e6eed64e863fa19043290c0736261622e00045c", - "0xaa49d0518f343005ca72b9e6c7dcaa97225ce6bb8b908ebbe7b1a22884ff8bfb090890364e325a0d414ad180b8f161d1", - "0x907d7fd3e009355ab326847c4a2431f688627faa698c13c03ffdd476ecf988678407f029b8543a475dcb3dafdf2e7a9c", - "0x845f1f10c6c5dad2adc7935f5cd2e2b32f169a99091d4f1b05babe7317b9b1cdce29b5e62f947dc621b9acbfe517a258", - "0x8f3be8e3b380ea6cdf9e9c237f5e88fd5a357e5ded80ea1fc2019810814de82501273b4da38916881125b6fa0cfd4459", - "0xb9c7f487c089bf1d20c822e579628db91ed9c82d6ca652983aa16d98b4270c4da19757f216a71b9c13ddee3e6e43705f", - "0x8ba2d8c88ad2b872db104ea8ddbb006ec2f3749fd0e19298a804bb3a5d94de19285cc7fb19fee58a66f7851d1a66c39f", - "0x9375ecd3ed16786fe161af5d5c908f56eeb467a144d3bbddfc767e90065b7c94fc53431adebecba2b6c9b5821184d36e", - "0xa49e069bfadb1e2e8bff6a4286872e2a9765d62f0eaa4fcb0e5af4bbbed8be3510fb19849125a40a8a81d1e33e81c3eb", - "0x9522cc66757b386aa6b88619525c8ce47a5c346d590bb3647d12f991e6c65c3ab3c0cfc28f0726b6756c892eae1672be", - "0xa9a0f1f51ff877406fa83a807aeb17b92a283879f447b8a2159653db577848cc451cbadd01f70441e351e9ed433c18bc", - "0x8ff7533dcff6be8714df573e33f82cf8e9f2bcaaa43e939c4759d52b754e502717950de4b4252fb904560fc31dce94a4", - "0x959724671e265a28d67c29d95210e97b894b360da55e4cf16e6682e7912491ed8ca14bfaa4dce9c25a25b16af580494f", - "0x92566730c3002f4046c737032487d0833c971e775de59fe02d9835c9858e2e3bc37f157424a69764596c625c482a2219", - "0xa84b47ceff13ed9c3e5e9cdf6739a66d3e7c2bd8a6ba318fefb1a9aecf653bb2981da6733ddb33c4b0a4523acc429d23", - "0xb4ddf571317e44f859386d6140828a42cf94994e2f1dcbcc9777f4eebbfc64fc1e160b49379acc27c4672b8e41835c5d", - "0x8ab95c94072b853d1603fdd0a43b30db617d13c1d1255b99075198e1947bfa5f59aed2b1147548a1b5e986cd9173d15c", - "0x89511f2eab33894fd4b3753d24249f410ff7263052c1fef6166fc63a79816656b0d24c529e45ccce6be28de6e375d916", - "0xa0866160ca63d4f2be1b4ea050dac6b59db554e2ebb4e5b592859d8df339b46fd7cb89aaed0951c3ee540aee982c238a", - "0x8fcc5cbba1b94970f5ff2eb1922322f5b0aa7d918d4b380c9e7abfd57afd8b247c346bff7b87af82efbce3052511cd1b", - "0x99aeb2a5e846b0a2874cca02c66ed40d5569eb65ab2495bc3f964a092e91e1517941f2688e79f8cca49cd3674c4e06dc", - "0xb7a096dc3bad5ca49bee94efd884aa3ff5615cf3825cf95fbe0ce132e35f46581d6482fa82666c7ef5f1643eaee8f1ca", - "0x94393b1da6eaac2ffd186b7725eca582f1ddc8cdd916004657f8a564a7c588175cb443fc6943b39029f5bbe0add3fad8", - "0x884b85fe012ccbcd849cb68c3ad832d83b3ef1c40c3954ffdc97f103b1ed582c801e1a41d9950f6bddc1d11f19d5ec76", - "0xb00061c00131eded8305a7ce76362163deb33596569afb46fe499a7c9d7a0734c084d336b38d168024c2bb42b58e7660", - "0xa439153ac8e6ca037381e3240e7ba08d056c83d7090f16ed538df25901835e09e27de2073646e7d7f3c65056af6e4ce7", - "0x830fc9ca099097d1f38b90e6843dc86f702be9d20bdacc3e52cae659dc41df5b8d2c970effa6f83a5229b0244a86fe22", - "0xb81ea2ffaaff2bb00dd59a9ab825ba5eed4db0d8ac9c8ed1a632ce8f086328a1cddd045fbe1ace289083c1325881b7e7", - "0xb51ea03c58daf2db32c99b9c4789b183365168cb5019c72c4cc91ac30b5fb7311d3db76e6fa41b7cd4a8c81e2f6cdc94", - "0xa4170b2c6d09ca5beb08318730419b6f19215ce6c631c854116f904be3bc30dd85a80c946a8ab054d3e307afaa3f8fbc", - "0x897cc42ff28971ff54d2a55dd6b35cfb8610ac902f3c06e3a5cea0e0a257e870c471236a8e84709211c742a09c5601a6", - "0xa18f2e98d389dace36641621488664ecbb422088ab03b74e67009b8b8acacaaa24fdcf42093935f355207d934adc52a8", - "0x92adcfb678cc2ba19c866f3f2b988fdcb4610567f3ab436cc0cb9acaf5a88414848d71133ebdbec1983e38e6190f1b5f", - "0xa86d43c2ce01b366330d3b36b3ca85f000c3548b8297e48478da1ee7d70d8576d4650cba7852ed125c0d7cb6109aa7f3", - "0x8ed31ceed9445437d7732dce78a762d72ff32a7636bfb3fd7974b7ae15db414d8184a1766915244355deb354fbc5803b", - "0x9268f70032584f416e92225d65af9ea18c466ebc7ae30952d56a4e36fd9ea811dde0a126da9220ba3c596ec54d8a335e", - "0x9433b99ee94f2d3fbdd63b163a2bdf440379334c52308bd24537f7defd807145a062ff255a50d119a7f29f4b85d250e3", - "0x90ce664f5e4628a02278f5cf5060d1a34f123854634b1870906e5723ac9afd044d48289be283b267d45fcbf3f4656aaf", - "0xaaf21c4d59378bb835d42ae5c5e5ab7a3c8c36a59e75997989313197752b79a472d866a23683b329ea69b048b87fa13e", - "0xb83c0589b304cec9ede549fde54f8a7c2a468c6657da8c02169a6351605261202610b2055c639b9ed2d5b8c401fb8f56", - "0x9370f326ea0f170c2c05fe2c5a49189f20aec93b6b18a5572a818cd4c2a6adb359e68975557b349fb54f065d572f4c92", - "0xac3232fa5ce6f03fca238bef1ce902432a90b8afce1c85457a6bee5571c033d4bceefafc863af04d4e85ac72a4d94d51", - "0x80d9ea168ff821b22c30e93e4c7960ce3ad3c1e6deeebedd342a36d01bd942419b187e2f382dbfd8caa34cca08d06a48", - "0xa387a3c61676fb3381eefa2a45d82625635a666e999aba30e3b037ec9e040f414f9e1ad9652abd3bcad63f95d85038db", - "0xa1b229fe32121e0b391b0f6e0180670b9dc89d79f7337de4c77ea7ad0073e9593846f06797c20e923092a08263204416", - "0x92164a9d841a2b828cedf2511213268b698520f8d1285852186644e9a0c97512cafa4bfbe29af892c929ebccd102e998", - "0x82ee2fa56308a67c7db4fd7ef539b5a9f26a1c2cc36da8c3206ba4b08258fbb3cec6fe5cdbd111433fb1ba2a1e275927", - "0x8c77bfe9e191f190a49d46f05600603fa42345592539b82923388d72392404e0b29a493a15e75e8b068dddcd444c2928", - "0x80b927f93ccf79dcf5c5b20bcf5a7d91d7a17bc0401bb7cc9b53a6797feac31026eb114257621f5a64a52876e4474cc1", - "0xb6b68b6501c37804d4833d5a063dd108a46310b1400549074e3cac84acc6d88f73948b7ad48d686de89c1ec043ae8c1a", - "0xab3da00f9bdc13e3f77624f58a3a18fc3728956f84b5b549d62f1033ae4b300538e53896e2d943f160618e05af265117", - "0xb6830e87233b8eace65327fdc764159645b75d2fd4024bf8f313b2dd5f45617d7ecfb4a0b53ccafb5429815a9a1adde6", - "0xb9251cfe32a6dc0440615aadcd98b6b1b46e3f4e44324e8f5142912b597ee3526bea2431e2b0282bb58f71be5b63f65e", - "0xaf8d70711e81cdddfb39e67a1b76643292652584c1ce7ce4feb1641431ad596e75c9120e85f1a341e7a4da920a9cdd94", - "0x98cd4e996594e89495c078bfd52a4586b932c50a449a7c8dfdd16043ca4cda94dafbaa8ad1b44249c99bbcc52152506e", - "0xb9fc6d1c24f48404a4a64fbe3e43342738797905db46e4132aee5f086aaa4c704918ad508aaefa455cfe1b36572e6242", - "0xa365e871d30ba9291cedaba1be7b04e968905d003e9e1af7e3b55c5eb048818ae5b913514fb08b24fb4fbdccbb35d0b8", - "0x93bf99510971ea9af9f1e364f1234c898380677c8e8de9b0dd24432760164e46c787bc9ec42a7ad450500706cf247b2d", - "0xb872f825a5b6e7b9c7a9ddfeded3516f0b1449acc9b4fd29fc6eba162051c17416a31e5be6d3563f424d28e65bab8b8f", - "0xb06b780e5a5e8eb4f4c9dc040f749cf9709c8a4c9ef15e925f442b696e41e5095db0778a6c73bcd329b265f2c6955c8b", - "0x848f1a981f5fc6cd9180cdddb8d032ad32cdfa614fc750d690dbae36cc0cd355cbf1574af9b3ffc8b878f1b2fafb9544", - "0xa03f48cbff3e9e8a3a655578051a5ae37567433093ac500ed0021c6250a51b767afac9bdb194ee1e3eac38a08c0eaf45", - "0xb5be78ce638ff8c4aa84352b536628231d3f7558c5be3bf010b28feac3022e64691fa672f358c8b663904aebe24a54ed", - "0xa9d4da70ff676fa55d1728ba6ab03b471fa38b08854d99e985d88c2d050102d8ccffbe1c90249a5607fa7520b15fe791", - "0x8fe9f7092ffb0b69862c8e972fb1ecf54308c96d41354ed0569638bb0364f1749838d6d32051fff1599112978c6e229c", - "0xae6083e95f37770ecae0df1e010456f165d96cfe9a7278c85c15cffd61034081ce5723e25e2bede719dc9341ec8ed481", - "0xa260891891103089a7afbd9081ea116cfd596fd1015f5b65e10b0961eb37fab7d09c69b7ce4be8bf35e4131848fb3fe4", - "0x8d729fa32f6eb9fd2f6a140bef34e8299a2f3111bffd0fe463aa8622c9d98bfd31a1df3f3e87cd5abc52a595f96b970e", - "0xa30ec6047ae4bc7da4daa7f4c28c93aedb1112cfe240e681d07e1a183782c9ff6783ac077c155af23c69643b712a533f", - "0xac830726544bfe7b5467339e5114c1a75f2a2a8d89453ce86115e6a789387e23551cd64620ead6283dfa4538eb313d86", - "0x8445c135b7a48068d8ed3e011c6d818cfe462b445095e2fbf940301e50ded23f272d799eea47683fc027430ce14613ef", - "0x95785411715c9ae9d8293ce16a693a2aa83e3cb1b4aa9f76333d0da2bf00c55f65e21e42e50e6c5772ce213dd7b4f7a0", - "0xb273b024fa18b7568c0d1c4d2f0c4e79ec509dafac8c5951f14192d63ddbcf2d8a7512c1c1b615cc38fa3e336618e0c5", - "0xa78b9d3ea4b6a90572eb27956f411f1d105fdb577ee2ffeec9f221da9b45db84bfe866af1f29597220c75e0c37a628d8", - "0xa4be2bf058c36699c41513c4d667681ce161a437c09d81383244fc55e1c44e8b1363439d0cce90a3e44581fb31d49493", - "0xb6eef13040f17dd4eba22aaf284d2f988a4a0c4605db44b8d2f4bf9567ac794550b543cc513c5f3e2820242dd704152e", - "0x87eb00489071fa95d008c5244b88e317a3454652dcb1c441213aa16b28cd3ecaa9b22fec0bdd483c1df71c37119100b1", - "0x92d388acdcb49793afca329cd06e645544d2269234e8b0b27d2818c809c21726bc9cf725651b951e358a63c83dedee24", - "0xae27e219277a73030da27ab5603c72c8bd81b6224b7e488d7193806a41343dff2456132274991a4722fdb0ef265d04cd", - "0x97583e08ecb82bbc27c0c8476d710389fa9ffbead5c43001bd36c1b018f29faa98de778644883e51870b69c5ffb558b5", - "0x90a799a8ce73387599babf6b7da12767c0591cadd36c20a7990e7c05ea1aa2b9645654ec65308ee008816623a2757a6a", - "0xa1b47841a0a2b06efd9ab8c111309cc5fc9e1d5896b3e42ed531f6057e5ade8977c29831ce08dbda40348386b1dcc06d", - "0xb92b8ef59bbddb50c9457691bc023d63dfcc54e0fd88bd5d27a09e0d98ac290fc90e6a8f6b88492043bf7c87fac8f3e4", - "0xa9d6240b07d62e22ec8ab9b1f6007c975a77b7320f02504fc7c468b4ee9cfcfd945456ff0128bc0ef2174d9e09333f8d", - "0x8e96534c94693226dc32bca79a595ca6de503af635f802e86442c67e77564829756961d9b701187fe91318da515bf0e6", - "0xb6ba290623cd8dd5c2f50931c0045d1cfb0c30877bc8fe58cbc3ff61ee8da100045a39153916efa1936f4aee0892b473", - "0xb43baa7717fac02d4294f5b3bb5e58a65b3557747e3188b482410388daac7a9c177f762d943fd5dcf871273921213da8", - "0xb9cf00f8fb5e2ef2b836659fece15e735060b2ea39b8e901d3dcbdcf612be8bf82d013833718c04cd46ffaa70b85f42e", - "0x8017d0c57419e414cbba504368723e751ef990cc6f05dad7b3c2de6360adc774ad95512875ab8337d110bf39a42026fa", - "0xae7401048b838c0dcd4b26bb6c56d79d51964a0daba780970b6c97daee4ea45854ea0ac0e4139b3fe60dac189f84df65", - "0x887b237b0cd0f816b749b21db0b40072f9145f7896c36916296973f9e6990ede110f14e5976c906d08987c9836cca57f", - "0xa88c3d5770148aee59930561ca1223aceb2c832fb5417e188dca935905301fc4c6c2c9270bc1dff7add490a125eb81c6", - "0xb6cf9b02c0cd91895ad209e38c54039523f137b5848b9d3ad33ae43af6c20c98434952db375fe378de7866f2d0e8b18a", - "0x84ef3d322ff580c8ad584b1fe4fe346c60866eb6a56e982ba2cf3b021ecb1fdb75ecc6c29747adda86d9264430b3f816", - "0xa0561c27224baf0927ad144cb71e31e54a064c598373fcf0d66aebf98ab7af1d8e2f343f77baefff69a6da750a219e11", - "0xaa5cc43f5b8162b016f5e1b61214c0c9d15b1078911c650b75e6cdfb49b85ee04c6739f5b1687d15908444f691f732de", - "0xad4ac099b935589c7b8fdfdf3db332b7b82bb948e13a5beb121ebd7db81a87d278024a1434bcf0115c54ca5109585c3d", - "0x8a00466abf3f109a1dcd19e643b603d3af23d42794ef8ca2514dd507ecea44a031ac6dbc18bd02f99701168b25c1791e", - "0xb00b5900dfad79645f8bee4e5adc7b84eb22e5b1e67df77ccb505b7fc044a6c08a8ea5faca662414eb945f874f884cea", - "0x950e204e5f17112250b22ea6bb8423baf522fc0af494366f18fe0f949f51d6e6812074a80875cf1ed9c8e7420058d541", - "0x91e5cbf8bb1a1d50c81608c9727b414d0dd2fb467ebc92f100882a3772e54f94979cfdf8e373fdef7c7fcdd60fec9e00", - "0xa093f6a857b8caaff80599c2e89c962b415ecbaa70d8fd973155fa976a284c6b29a855f5f7a3521134d00d2972755188", - "0xb4d55a3551b00da54cc010f80d99ddd2544bde9219a3173dfaadf3848edc7e4056ab532fb75ac26f5f7141e724267663", - "0xa03ea050fc9b011d1b04041b5765d6f6453a93a1819cd9bd6328637d0b428f08526466912895dcc2e3008ee58822e9a7", - "0x99b12b3665e473d01bc6985844f8994fb65cb15745024fb7af518398c4a37ff215da8f054e8fdf3286984ae36a73ca5e", - "0x9972c7e7a7fb12e15f78d55abcaf322c11249cd44a08f62c95288f34f66b51f146302bce750ff4d591707075d9123bd2", - "0xa64b4a6d72354e596d87cda213c4fc2814009461570ccb27d455bbe131f8d948421a71925425b546d8cf63d5458cd64b", - "0x91c215c73b195795ede2228b7ed1f6e37892e0c6b0f4a0b5a16c57aa1100c84df9239054a173b6110d6c2b7f4bf1ce52", - "0x88807198910ec1303480f76a3683870246a995e36adaeadc29c22f0bdba8152fe705bd070b75de657b04934f7d0ccf80", - "0xb37c0026c7b32eb02cacac5b55cb5fe784b8e48b2945c64d3037af83ece556a117f0ff053a5968c2f5fa230e291c1238", - "0x94c768384ce212bc2387e91ce8b45e4ff120987e42472888a317abc9dcdf3563b62e7a61c8e98d7cdcbe272167d91fc6", - "0xa10c2564936e967a390cb14ef6e8f8b04ea9ece5214a38837eda09e79e0c7970b1f83adf017c10efd6faa8b7ffa2c567", - "0xa5085eed3a95f9d4b1269182ea1e0d719b7809bf5009096557a0674bde4201b0ddc1f0f16a908fc468846b3721748ce3", - "0x87468eb620b79a0a455a259a6b4dfbc297d0d53336537b771254dd956b145dc816b195b7002647ea218552e345818a3f", - "0xace2b77ffb87366af0a9cb5d27d6fc4a14323dbbf1643f5f3c4559306330d86461bb008894054394cbfaefeaa0bc2745", - "0xb27f56e840a54fbd793f0b7a7631aa4cee64b5947e4382b2dfb5eb1790270288884c2a19afebe5dc0c6ef335d4531c1c", - "0x876e438633931f7f895062ee16c4b9d10428875f7bc79a8e156a64d379a77a2c45bf5430c5ab94330f03da352f1e9006", - "0xa2512a252587d200d2092b44c914df54e04ff8bcef36bf631f84bde0cf5a732e3dc7f00f662842cfd74b0b0f7f24180e", - "0x827f1bc8f54a35b7a4bd8154f79bcc055e45faed2e74adf7cf21cca95df44d96899e847bd70ead6bb27b9c0ed97bbd8b", - "0xa0c92cf5a9ed843714f3aea9fe7b880f622d0b4a3bf66de291d1b745279accf6ba35097849691370f41732ba64b5966b", - "0xa63f5c1e222775658421c487b1256b52626c6f79cb55a9b7deb2352622cedffb08502042d622eb3b02c97f9c09f9c957", - "0x8cc093d52651e65fb390e186db6cc4de559176af4624d1c44cb9b0e836832419dacac7b8db0627b96288977b738d785d", - "0xaa7b6a17dfcec146134562d32a12f7bd7fe9522e300859202a02939e69dbd345ed7ff164a184296268f9984f9312e8fc", - "0x8ac76721f0d2b679f023d06cbd28c85ae5f4b43c614867ccee88651d4101d4fd352dbdb65bf36bfc3ebc0109e4b0c6f9", - "0x8d350f7c05fc0dcd9a1170748846fb1f5d39453e4cb31e6d1457bed287d96fc393b2ecc53793ca729906a33e59c6834a", - "0xb9913510dfc5056d7ec5309f0b631d1ec53e3a776412ada9aefdaf033c90da9a49fdde6719e7c76340e86599b1f0eec2", - "0x94955626bf4ce87612c5cfffcf73bf1c46a4c11a736602b9ba066328dc52ad6d51e6d4f53453d4ed55a51e0aad810271", - "0xb0fcab384fd4016b2f1e53f1aafd160ae3b1a8865cd6c155d7073ecc1664e05b1d8bca1def39c158c7086c4e1103345e", - "0x827de3f03edfbde08570b72de6662c8bfa499b066a0a27ebad9b481c273097d17a5a0a67f01553da5392ec3f149b2a78", - "0xab7940384c25e9027c55c40df20bd2a0d479a165ced9b1046958353cd69015eeb1e44ed2fd64e407805ba42df10fc7bf", - "0x8ad456f6ff8cd58bd57567d931f923d0c99141978511b17e03cab7390a72b9f62498b2893e1b05c7c22dd274e9a31919", - "0xac75399e999effe564672db426faa17a839e57c5ef735985c70cd559a377adec23928382767b55ed5a52f7b11b54b756", - "0xb17f975a00b817299ac7af5f2024ea820351805df58b43724393bfb3920a8cd747a3bbd4b8286e795521489db3657168", - "0xa2bed800a6d95501674d9ee866e7314063407231491d794f8cf57d5be020452729c1c7cefd8c50dc1540181f5caab248", - "0x9743f5473171271ffdd3cc59a3ae50545901a7b45cd4bc3570db487865f3b73c0595bebabbfe79268809ee1862e86e4a", - "0xb7eab77c2d4687b60d9d7b04e842b3880c7940140012583898d39fcc22d9b9b0a9be2c2e3788b3e6f30319b39c338f09", - "0x8e2b8f797a436a1b661140e9569dcf3e1eea0a77c7ff2bc4ff0f3e49af04ed2de95e255df8765f1d0927fb456a9926b1", - "0x8aefea201d4a1f4ff98ffce94e540bb313f2d4dfe7e9db484a41f13fc316ed02b282e1acc9bc6f56cad2dc2e393a44c9", - "0xb950c17c0e5ca6607d182144aa7556bb0efe24c68f06d79d6413a973b493bfdf04fd147a4f1ab03033a32004cc3ea66f", - "0xb7b8dcbb179a07165f2dc6aa829fad09f582a71b05c3e3ea0396bf9e6fe73076f47035c031c2101e8e38e0d597eadd30", - "0xa9d77ed89c77ec1bf8335d08d41c3c94dcca9fd1c54f22837b4e54506b212aa38d7440126c80648ab7723ff18e65ed72", - "0xa819d6dfd4aef70e52b8402fe5d135f8082d40eb7d3bb5c4d7997395b621e2bb10682a1bad2c9caa33dd818550fc3ec6", - "0x8f6ee34128fac8bbf13ce2d68b2bb363eb4fd65b297075f88e1446ddeac242500eeb4ef0735e105882ff5ba8c44c139b", - "0xb4440e48255c1644bcecf3a1e9958f1ec4901cb5b1122ee5b56ffd02cad1c29c4266999dbb85aa2605c1b125490074d4", - "0xa43304a067bede5f347775d5811cf65a6380a8d552a652a0063580b5c5ef12a0867a39c7912fa219e184f4538eba1251", - "0xa891ad67a790089ffc9f6d53e6a3d63d3556f5f693e0cd8a7d0131db06fd4520e719cfcc3934f0a8f62a95f90840f1d4", - "0xaea6df8e9bb871081aa0fc5a9bafb00be7d54012c5baf653791907d5042a326aeee966fd9012a582cc16695f5baf7042", - "0x8ffa2660dc52ed1cd4eff67d6a84a8404f358a5f713d04328922269bee1e75e9d49afeec0c8ad751620f22352a438e25", - "0x87ec6108e2d63b06abed350f8b363b7489d642486f879a6c3aa90e5b0f335efc2ff2834eef9353951a42136f8e6a1b32", - "0x865619436076c2760d9e87ddc905023c6de0a8d56eef12c98a98c87837f2ca3f27fd26a2ad752252dbcbe2b9f1d5a032", - "0x980437dce55964293cb315c650c5586ffd97e7a944a83f6618af31c9d92c37b53ca7a21bb5bc557c151b9a9e217e7098", - "0x95d128fc369df4ad8316b72aea0ca363cbc7b0620d6d7bb18f7076a8717a6a46956ff140948b0cc4f6d2ce33b5c10054", - "0x8c7212d4a67b9ec70ebbca04358ad2d36494618d2859609163526d7b3acc2fc935ca98519380f55e6550f70a9bc76862", - "0x893a2968819401bf355e85eee0f0ed0406a6d4a7d7f172d0017420f71e00bb0ba984f6020999a3cdf874d3cd8ebcd371", - "0x9103c1af82dece25d87274e89ea0acd7e68c2921c4af3d8d7c82ab0ed9990a5811231b5b06113e7fa43a6bd492b4564f", - "0x99cfd87a94eab7d35466caa4ed7d7bb45e5c932b2ec094258fb14bf205659f83c209b83b2f2c9ccb175974b2a33e7746", - "0x874b6b93e4ee61be3f00c32dd84c897ccd6855c4b6251eb0953b4023634490ed17753cd3223472873cbc6095b2945075", - "0x84a32c0dc4ea60d33aac3e03e70d6d639cc9c4cc435c539eff915017be3b7bdaba33349562a87746291ebe9bc5671f24", - "0xa7057b24208928ad67914e653f5ac1792c417f413d9176ba635502c3f9c688f7e2ee81800d7e3dc0a340c464da2fd9c5", - "0xa03fb9ed8286aacfa69fbd5d953bec591c2ae4153400983d5dbb6cd9ea37fff46ca9e5cceb9d117f73e9992a6c055ad2", - "0x863b2de04e89936c9a4a2b40380f42f20aefbae18d03750fd816c658aee9c4a03df7b12121f795c85d01f415baaeaa59", - "0x8526eb9bd31790fe8292360d7a4c3eed23be23dd6b8b8f01d2309dbfdc0cfd33ad1568ddd7f8a610f3f85a9dfafc6a92", - "0xb46ab8c5091a493d6d4d60490c40aa27950574a338ea5bbc045be3a114af87bdcb160a8c80435a9b7ad815f3cb56a3f3", - "0xaeadc47b41a8d8b4176629557646202f868b1d728b2dda58a347d937e7ffc8303f20d26d6c00b34c851b8aeec547885d", - "0xaebb19fc424d72c1f1822aa7adc744cd0ef7e55727186f8df8771c784925058c248406ebeeaf3c1a9ee005a26e9a10c6", - "0x8ff96e81c1a4a2ab1b4476c21018fae0a67e92129ee36120cae8699f2d7e57e891f5c624902cb1b845b944926a605cc3", - "0x8251b8d2c43fadcaa049a9e7aff838dae4fb32884018d58d46403ac5f3beb5c518bfd45f03b8abb710369186075eb71c", - "0xa8b2a64f865f51a5e5e86a66455c093407933d9d255d6b61e1fd81ffafc9538d73caaf342338a66ba8ee166372a3d105", - "0xaad915f31c6ba7fdc04e2aaac62e84ef434b7ee76a325f07dc430d12c84081999720181067b87d792efd0117d7ee1eab", - "0xa13db3bb60389883fd41d565c54fb5180d9c47ce2fe7a169ae96e01d17495f7f4fa928d7e556e7c74319c4c25d653eb2", - "0xa4491b0198459b3f552855d680a59214eb74e6a4d6c5fa3b309887dc50ebea2ecf6d26c040550f7dc478b452481466fb", - "0x8f017f13d4b1e3f0c087843582b52d5f8d13240912254d826dd11f8703a99a2f3166dfbdfdffd9a3492979d77524276b", - "0x96c3d5dcd032660d50d7cd9db2914f117240a63439966162b10c8f1f3cf74bc83b0f15451a43b31dbd85e4a7ce0e4bb1", - "0xb479ec4bb79573d32e0ec93b92bdd7ec8c26ddb5a2d3865e7d4209d119fd3499eaac527615ffac78c440e60ef3867ae0", - "0xb2c49c4a33aa94b52b6410b599e81ff15490aafa7e43c8031c865a84e4676354a9c81eb4e7b8be6825fdcefd1e317d44", - "0x906dc51d6a90c089b6704b47592805578a6eed106608eeb276832f127e1b8e858b72e448edcbefb497d152447e0e68ff", - "0xb0e81c63b764d7dfbe3f3fddc9905aef50f3633e5d6a4af6b340495124abedcff5700dfd1577bbbed7b6bf97d02719cb", - "0x9304c64701e3b4ed6d146e48a881f7d83a17f58357cca0c073b2bb593afd2d94f6e2a7a1ec511d0a67ad6ff4c3be5937", - "0xb6fdbd12ba05aa598d80b83f70a15ef90e5cba7e6e75fa038540ee741b644cd1f408a6cecfd2a891ef8d902de586c6b5", - "0xb80557871a6521b1b3c74a1ba083ae055b575df607f1f7b04c867ba8c8c181ea68f8d90be6031f4d25002cca27c44da2", - "0xaa7285b8e9712e06b091f64163f1266926a36607f9d624af9996856ed2aaf03a580cb22ce407d1ade436c28b44ca173f", - "0x8148d72b975238b51e6ea389e5486940d22641b48637d7dfadfa603a605bfc6d74a016480023945d0b85935e396aea5d", - "0x8a014933a6aea2684b5762af43dcf4bdbb633cd0428d42d71167a2b6fc563ece5e618bff22f1db2ddb69b845b9a2db19", - "0x990d91740041db770d0e0eb9d9d97d826f09fd354b91c41e0716c29f8420e0e8aac0d575231efba12fe831091ec38d5a", - "0x9454d0d32e7e308ddec57cf2522fb1b67a2706e33fb3895e9e1f18284129ab4f4c0b7e51af25681d248d7832c05eb698", - "0xa5bd434e75bac105cb3e329665a35bce6a12f71dd90c15165777d64d4c13a82bceedb9b48e762bd24034e0fc9fbe45f4", - "0xb09e3b95e41800d4dc29c6ffdaab2cd611a0050347f6414f154a47ee20ee59bf8cf7181454169d479ebce1eb5c777c46", - "0xb193e341d6a047d15eea33766d656d807b89393665a783a316e9ba10518e5515c8e0ade3d6e15641d917a8a172a5a635", - "0xade435ec0671b3621dde69e07ead596014f6e1daa1152707a8c18877a8b067bde2895dd47444ffa69db2bbef1f1d8816", - "0xa7fd3d6d87522dfc56fb47aef9ce781a1597c56a8bbfd796baba907afdc872f753d732bfda1d3402aee6c4e0c189f52d", - "0xa298cb4f4218d0464b2fab393e512bbc477c3225aa449743299b2c3572f065bc3a42d07e29546167ed9e1b6b3b3a3af3", - "0xa9ee57540e1fd9c27f4f0430d194b91401d0c642456c18527127d1f95e2dba41c2c86d1990432eb38a692fda058fafde", - "0x81d6c1a5f93c04e6d8e5a7e0678c1fc89a1c47a5c920bcd36180125c49fcf7c114866b90e90a165823560b19898a7c16", - "0xa4b7a1ec9e93c899b9fd9aaf264c50e42c36c0788d68296a471f7a3447af4dbc81e4fa96070139941564083ec5b5b5a1", - "0xb3364e327d381f46940c0e11e29f9d994efc6978bf37a32586636c0070b03e4e23d00650c1440f448809e1018ef9f6d8", - "0x8056e0913a60155348300e3a62e28b5e30629a90f7dd4fe11289097076708110a1d70f7855601782a3cdc5bdb1ca9626", - "0xb4980fd3ea17bac0ba9ee1c470b17e575bb52e83ebdd7d40c93f4f87bebeaff1c8a679f9d3d09d635f068d37d5bd28bd", - "0x905a9299e7e1853648e398901dfcd437aa575c826551f83520df62984f5679cb5f0ea86aa45ed3e18b67ddc0dfafe809", - "0xab99553bf31a84f2e0264eb34a08e13d8d15e2484aa9352354becf9a15999c76cc568d68274b70a65e49703fc23540d0", - "0xa43681597bc574d2dae8964c9a8dc1a07613d7a1272bdcb818d98c85d44e16d744250c33f3b5e4d552d97396b55e601f", - "0xa54e5a31716fccb50245898c99865644405b8dc920ded7a11f3d19bdc255996054b268e16f2e40273f11480e7145f41e", - "0x8134f3ad5ef2ad4ba12a8a4e4d8508d91394d2bcdc38b7c8c8c0b0a820357ac9f79d286c65220f471eb1adca1d98fc68", - "0x94e2f755e60471578ab2c1adb9e9cea28d4eec9b0e92e0140770bca7002c365fcabfe1e5fb4fe6cfe79a0413712aa3ef", - "0xad48f8d0ce7eb3cc6e2a3086ad96f562e5bed98a360721492ae2e74dc158586e77ec8c35d5fd5927376301b7741bad2b", - "0x8614f0630bdd7fbad3a31f55afd9789f1c605dc85e7dc67e2edfd77f5105f878bb79beded6e9f0b109e38ea7da67e8d5", - "0x9804c284c4c5e77dabb73f655b12181534ca877c3e1e134aa3f47c23b7ec92277db34d2b0a5d38d2b69e5d1c3008a3e3", - "0xa51b99c3088e473afdaa9e0a9f7e75a373530d3b04e44e1148da0726b95e9f5f0c7e571b2da000310817c36f84b19f7f", - "0xac4ff909933b3b76c726b0a382157cdc74ab851a1ac6cef76953c6444441804cc43abb883363f416592e8f6cfbc4550b", - "0xae7d915eb9fc928b65a29d6edbc75682d08584d0014f7bcf17d59118421ae07d26a02137d1e4de6938bcd1ab8ef48fad", - "0x852f7e453b1af89b754df6d11a40d5d41ea057376e8ecacd705aacd2f917457f4a093d6b9a8801837fa0f62986ad7149", - "0x92c6bf5ada5d0c3d4dd8058483de36c215fa98edab9d75242f3eff9db07c734ad67337da6f0eefe23a487bf75a600dee", - "0xa2b42c09d0db615853763552a48d2e704542bbd786aae016eb58acbf6c0226c844f5fb31e428cb6450b9db855f8f2a6f", - "0x880cc07968266dbfdcfbc21815cd69e0eddfee239167ac693fb0413912d816f2578a74f7716eecd6deefa68c6eccd394", - "0xb885b3ace736cd373e8098bf75ba66fa1c6943ca1bc4408cd98ac7074775c4478594f91154b8a743d9c697e1b29f5840", - "0xa51ce78de512bd87bfa0835de819941dffbf18bec23221b61d8096fc9436af64e0693c335b54e7bfc763f287bdca2db6", - "0xa3c76166a3bdb9b06ef696e57603b58871bc72883ee9d45171a30fe6e1d50e30bc9c51b4a0f5a7270e19a77b89733850", - "0xacefc5c6f8a1e7c24d7b41e0fc7f6f3dc0ede6cf3115ffb9a6e54b1d954cbca9bda8ad7a084be9be245a1b8e9770d141", - "0xb420ed079941842510e31cfad117fa11fb6b4f97dfbc6298cb840f27ebaceba23eeaf3f513bcffbf5e4aae946310182d", - "0x95c3bb5ef26c5ed2f035aa5d389c6b3c15a6705b9818a3fefaed28922158b35642b2e8e5a1a620fdad07e75ad4b43af4", - "0x825149f9081ecf07a2a4e3e8b5d21bade86c1a882475d51c55ee909330b70c5a2ac63771c8600c6f38df716af61a3ea1", - "0x873b935aae16d9f08adbc25353cee18af2f1b8d5f26dec6538d6bbddc515f2217ed7d235dcfea59ae61b428798b28637", - "0x9294150843a2bedcedb3bb74c43eb28e759cf9499582c5430bccefb574a8ddd4f11f9929257ff4c153990f9970a2558f", - "0xb619563a811cc531da07f4f04e5c4c6423010ff9f8ed7e6ec9449162e3d501b269fb1c564c09c0429431879b0f45df02", - "0x91b509b87eb09f007d839627514658c7341bc76d468920fe8a740a8cb96a7e7e631e0ea584a7e3dc1172266f641d0f5c", - "0x8b8aceace9a7b9b4317f1f01308c3904d7663856946afbcea141a1c615e21ccad06b71217413e832166e9dd915fbe098", - "0x87b3b36e725833ea0b0f54753c3728c0dbc87c52d44d705ffc709f2d2394414c652d3283bab28dcce09799504996cee0", - "0xb2670aad5691cbf308e4a6a77a075c4422e6cbe86fdba24e9f84a313e90b0696afb6a067eebb42ba2d10340d6a2f6e51", - "0x876784a9aff3d54faa89b2bacd3ff5862f70195d0b2edc58e8d1068b3c9074c0da1cfa23671fe12f35e33b8a329c0ccd", - "0x8b48b9e758e8a8eae182f5cbec96f67d20cca6d3eee80a2d09208eb1d5d872e09ef23d0df8ebbb9b01c7449d0e3e3650", - "0xb79303453100654c04a487bdcadc9e3578bc80930c489a7069a52e8ca1dba36c492c8c899ce025f8364599899baa287d", - "0x961b35a6111da54ece6494f24dacd5ea46181f55775b5f03df0e370c34a5046ac2b4082925855325bb42bc2a2c98381d", - "0xa31feb1be3f5a0247a1f7d487987eb622e34fca817832904c6ee3ee60277e5847945a6f6ea1ac24542c72e47bdf647df", - "0xa12a2aa3e7327e457e1aae30e9612715dd2cfed32892c1cd6dcda4e9a18203af8a44afb46d03b2eed89f6b9c5a2c0c23", - "0xa08265a838e69a2ca2f80fead6ccf16f6366415b920c0b22ee359bcd8d4464ecf156f400a16a7918d52e6d733dd64211", - "0xb723d6344e938d801cca1a00032af200e541d4471fd6cbd38fb9130daa83f6a1dffbbe7e67fc20f9577f884acd7594b2", - "0xa6733d83ec78ba98e72ddd1e7ff79b7adb0e559e256760d0c590a986e742445e8cdf560d44b29439c26d87edd0b07c8c", - "0xa61c2c27d3f7b9ff4695a17afedf63818d4bfba390507e1f4d0d806ce8778d9418784430ce3d4199fd3bdbc2504d2af3", - "0x8332f3b63a6dc985376e8b1b25eeae68be6160fbe40053ba7bcf6f073204f682da72321786e422d3482fd60c9e5aa034", - "0xa280f44877583fbb6b860d500b1a3f572e3ee833ec8f06476b3d8002058e25964062feaa1e5bec1536d734a5cfa09145", - "0xa4026a52d277fcea512440d2204f53047718ebfcae7b48ac57ea7f6bfbc5de9d7304db9a9a6cbb273612281049ddaec5", - "0x95cdf69c831ab2fad6c2535ede9c07e663d2ddccc936b64e0843d2df2a7b1c31f1759c3c20f1e7a57b1c8f0dbb21b540", - "0x95c96cec88806469c277ab567863c5209027cecc06c7012358e5f555689c0d9a5ffb219a464f086b45817e8536b86d2f", - "0xafe38d4684132a0f03d806a4c8df556bf589b25271fbc6fe2e1ed16de7962b341c5003755da758d0959d2e6499b06c68", - "0xa9b77784fda64987f97c3a23c5e8f61b918be0f7c59ba285084116d60465c4a2aaafc8857eb16823282cc83143eb9126", - "0xa830f05881ad3ce532a55685877f529d32a5dbe56cea57ffad52c4128ee0fad0eeaf0da4362b55075e77eda7babe70e5", - "0x992b3ad190d6578033c13ed5abfee4ef49cbc492babb90061e3c51ee4b5790cdd4c8fc1abff1fa2c00183b6b64f0bbbe", - "0xb1015424d9364aeff75de191652dc66484fdbec3e98199a9eb9671ec57bec6a13ff4b38446e28e4d8aedb58dd619cd90", - "0xa745304604075d60c9db36cada4063ac7558e7ec2835d7da8485e58d8422e817457b8da069f56511b02601289fbb8981", - "0xa5ba4330bc5cb3dbe0486ddf995632a7260a46180a08f42ae51a2e47778142132463cc9f10021a9ad36986108fefa1a9", - "0xb419e9fd4babcaf8180d5479db188bb3da232ae77a1c4ed65687c306e6262f8083070a9ac32220cddb3af2ec73114092", - "0xa49e23dc5f3468f3bf3a0bb7e4a114a788b951ff6f23a3396ae9e12cbff0abd1240878a3d1892105413dbc38818e807c", - "0xb7ecc7b4831f650202987e85b86bc0053f40d983f252e9832ef503aea81c51221ce93279da4aa7466c026b2d2070e55d", - "0x96a8c35cb87f84fa84dcd6399cc2a0fd79cc9158ef4bdde4bae31a129616c8a9f2576cd19baa3f497ca34060979aed7d", - "0x8681b2c00aa62c2b519f664a95dcb8faef601a3b961bb4ce5d85a75030f40965e2983871d41ea394aee934e859581548", - "0x85c229a07efa54a713d0790963a392400f55fbb1a43995a535dc6c929f20d6a65cf4efb434e0ad1cb61f689b8011a3bc", - "0x90856f7f3444e5ad44651c28e24cc085a5db4d2ffe79aa53228c26718cf53a6e44615f3c5cda5aa752d5f762c4623c66", - "0x978999b7d8aa3f28a04076f74d11c41ef9c89fdfe514936c4238e0f13c38ec97e51a5c078ebc6409e517bfe7ccb42630", - "0xa099914dd7ed934d8e0d363a648e9038eb7c1ec03fa04dbcaa40f7721c618c3ef947afef7a16b4d7ac8c12aa46637f03", - "0xab2a104fed3c83d16f2cda06878fa5f30c8c9411de71bfb67fd2fc9aa454dcbcf3d299d72f8cc12e919466a50fcf7426", - "0xa4471d111db4418f56915689482f6144efc4664cfb0311727f36c864648d35734351becc48875df96f4abd3cfcf820f9", - "0x83be11727cd30ea94ccc8fa31b09b81c9d6a9a5d3a4686af9da99587332fe78c1f94282f9755854bafd6033549afec91", - "0x88020ff971dc1a01a9e993cd50a5d2131ffdcbb990c1a6aaa54b20d8f23f9546a70918ea57a21530dcc440c1509c24ad", - "0xae24547623465e87905eaffa1fa5d52bb7c453a8dbd89614fa8819a2abcedaf455c2345099b7324ae36eb0ad7c8ef977", - "0xb59b0c60997de1ee00b7c388bc7101d136c9803bf5437b1d589ba57c213f4f835a3e4125b54738e78abbc21b000f2016", - "0xa584c434dfe194546526691b68fa968c831c31da42303a1d735d960901c74011d522246f37f299555416b8cf25c5a548", - "0x80408ce3724f4837d4d52376d255e10f69eb8558399ae5ca6c11b78b98fe67d4b93157d2b9b639f1b5b64198bfe87713", - "0xabb941e8d406c2606e0ddc35c113604fdd9d249eacc51cb64e2991e551b8639ce44d288cc92afa7a1e7fc599cfc84b22", - "0xb223173f560cacb1c21dba0f1713839e348ad02cbfdef0626748604c86f89e0f4c919ed40b583343795bdd519ba952c8", - "0xaf1c70512ec3a19d98b8a1fc3ff7f7f5048a27d17d438d43f561974bbdd116fcd5d5c21040f3447af3f0266848d47a15", - "0x8a44809568ebe50405bede19b4d2607199159b26a1b33e03d180e6840c5cf59d991a4fb150d111443235d75ecad085b7", - "0xb06207cdca46b125a27b3221b5b50cf27af4c527dd7c80e2dbcebbb09778a96df3af67e50f07725239ce3583dad60660", - "0x993352d9278814ec89b26a11c4a7c4941bf8f0e6781ae79559d14749ee5def672259792db4587f85f0100c7bb812f933", - "0x9180b8a718b971fd27bc82c8582d19c4b4f012453e8c0ffeeeffe745581fc6c07875ab28be3af3fa3896d19f0c89ac5b", - "0x8b8e1263eb48d0fe304032dd5ea1f30e73f0121265f7458ba9054d3626894e8a5fef665340abd2ede9653045c2665938", - "0x99a2beee4a10b7941c24b2092192faf52b819afd033e4a2de050fd6c7f56d364d0cf5f99764c3357cf32399e60fc5d74", - "0x946a4aad7f8647ea60bee2c5fcdeb6f9a58fb2cfca70c4d10e458027a04846e13798c66506151be3df9454b1e417893f", - "0xa672a88847652d260b5472d6908d1d57e200f1e492d30dd1cecc441cdfc9b76e016d9bab560efd4d7f3c30801de884a9", - "0x9414e1959c156cde1eb24e628395744db75fc24b9df4595350aaad0bc38e0246c9b4148f6443ef68b8e253a4a6bcf11c", - "0x9316e9e4ec5fab4f80d6540df0e3a4774db52f1d759d2e5b5bcd3d7b53597bb007eb1887cb7dc61f62497d51ffc8d996", - "0x902d6d77bb49492c7a00bc4b70277bc28c8bf9888f4307bb017ac75a962decdedf3a4e2cf6c1ea9f9ba551f4610cbbd7", - "0xb07025a18b0e32dd5e12ec6a85781aa3554329ea12c4cd0d3b2c22e43d777ef6f89876dd90a9c8fb097ddf61cf18adc5", - "0xb355a849ad3227caa4476759137e813505ec523cbc2d4105bc7148a4630f9e81918d110479a2d5f5e4cd9ccec9d9d3e3", - "0xb49532cfdf02ee760109881ad030b89c48ee3bb7f219ccafc13c93aead754d29bdafe345be54c482e9d5672bd4505080", - "0x9477802410e263e4f938d57fa8f2a6cac7754c5d38505b73ee35ea3f057aad958cb9722ba6b7b3cfc4524e9ca93f9cdc", - "0x9148ea83b4436339580f3dbc9ba51509e9ab13c03063587a57e125432dd0915f5d2a8f456a68f8fff57d5f08c8f34d6e", - "0xb00b6b5392b1930b54352c02b1b3b4f6186d20bf21698689bbfc7d13e86538a4397b90e9d5c93fd2054640c4dbe52a4f", - "0x926a9702500441243cd446e7cbf15dde16400259726794694b1d9a40263a9fc9e12f7bcbf12a27cb9aaba9e2d5848ddc", - "0xa0c6155f42686cbe7684a1dc327100962e13bafcf3db97971fc116d9f5c0c8355377e3d70979cdbd58fd3ea52440901c", - "0xa277f899f99edb8791889d0817ea6a96c24a61acfda3ad8c3379e7c62b9d4facc4b965020b588651672fd261a77f1bfc", - "0x8f528cebb866b501f91afa50e995234bef5bf20bff13005de99cb51eaac7b4f0bf38580cfd0470de40f577ead5d9ba0f", - "0x963fc03a44e9d502cc1d23250efef44d299befd03b898d07ce63ca607bb474b5cf7c965a7b9b0f32198b04a8393821f7", - "0xab087438d0a51078c378bf4a93bd48ef933ff0f1fa68d02d4460820df564e6642a663b5e50a5fe509527d55cb510ae04", - "0xb0592e1f2c54746bb076be0fa480e1c4bebc4225e1236bcda3b299aa3853e3afb401233bdbcfc4a007b0523a720fbf62", - "0x851613517966de76c1c55a94dc4595f299398a9808f2d2f0a84330ba657ab1f357701d0895f658c18a44cb00547f6f57", - "0xa2fe9a1dd251e72b0fe4db27be508bb55208f8f1616b13d8be288363ec722826b1a1fd729fc561c3369bf13950bf1fd6", - "0xb896cb2bc2d0c77739853bc59b0f89b2e008ba1f701c9cbe3bef035f499e1baee8f0ff1e794854a48c320586a2dfc81a", - "0xa1b60f98e5e5106785a9b81a85423452ee9ef980fa7fa8464f4366e73f89c50435a0c37b2906052b8e58e212ebd366cf", - "0xa853b0ebd9609656636df2e6acd5d8839c0fda56f7bf9288a943b06f0b67901a32b95e016ca8bc99bd7b5eab31347e72", - "0xb290fa4c1346963bd5225235e6bdf7c542174dab4c908ab483d1745b9b3a6015525e398e1761c90e4b49968d05e30eea", - "0xb0f65a33ad18f154f1351f07879a183ad62e5144ad9f3241c2d06533dad09cbb2253949daff1bb02d24d16a3569f7ef0", - "0xa00db59b8d4218faf5aeafcd39231027324408f208ec1f54d55a1c41228b463b88304d909d16b718cfc784213917b71e", - "0xb8d695dd33dc2c3bc73d98248c535b2770ad7fa31aa726f0aa4b3299efb0295ba9b4a51c71d314a4a1bd5872307534d1", - "0xb848057cca2ca837ee49c42b88422303e58ea7d2fc76535260eb5bd609255e430514e927cc188324faa8e657396d63ec", - "0x92677836061364685c2aaf0313fa32322746074ed5666fd5f142a7e8f87135f45cd10e78a17557a4067a51dfde890371", - "0xa854b22c9056a3a24ab164a53e5c5cf388616c33e67d8ebb4590cb16b2e7d88b54b1393c93760d154208b5ca822dc68f", - "0x86fff174920388bfab841118fb076b2b0cdec3fdb6c3d9a476262f82689fb0ed3f1897f7be9dbf0932bb14d346815c63", - "0x99661cf4c94a74e182752bcc4b98a8c2218a8f2765642025048e12e88ba776f14f7be73a2d79bd21a61def757f47f904", - "0x8a8893144d771dca28760cba0f950a5d634195fd401ec8cf1145146286caffb0b1a6ba0c4c1828d0a5480ce49073c64c", - "0x938a59ae761359ee2688571e7b7d54692848eb5dde57ffc572b473001ea199786886f8c6346a226209484afb61d2e526", - "0x923f68a6aa6616714cf077cf548aeb845bfdd78f2f6851d8148cba9e33a374017f2f3da186c39b82d14785a093313222", - "0xac923a93d7da7013e73ce8b4a2b14b8fd0cc93dc29d5de941a70285bdd19be4740fedfe0c56b046689252a3696e9c5bc", - "0xb49b32c76d4ec1a2c68d4989285a920a805993bc6fcce6dacd3d2ddae73373050a5c44ba8422a3781050682fa0ef6ba2", - "0x8a367941c07c3bdca5712524a1411bad7945c7c48ffc7103b1d4dff2c25751b0624219d1ccde8c3f70c465f954be5445", - "0xb838f029df455efb6c530d0e370bbbf7d87d61a9aea3d2fe5474c5fe0a39cf235ceecf9693c5c6c5820b1ba8f820bd31", - "0xa8983b7c715eaac7f13a001d2abc462dfc1559dab4a6b554119c271aa8fe00ffcf6b6949a1121f324d6d26cb877bcbae", - "0xa2afb24ad95a6f14a6796315fbe0d8d7700d08f0cfaf7a2abe841f5f18d4fecf094406cbd54da7232a159f9c5b6e805e", - "0x87e8e95ad2d62f947b2766ff405a23f7a8afba14e7f718a691d95369c79955cdebe24c54662553c60a3f55e6322c0f6f", - "0x87c2cbcecb754e0cc96128e707e5c5005c9de07ffd899efa3437cadc23362f5a1d3fcdd30a1f5bdc72af3fb594398c2a", - "0x91afd6ee04f0496dc633db88b9370d41c428b04fd991002502da2e9a0ef051bcd7b760e860829a44fbe5539fa65f8525", - "0x8c50e5d1a24515a9dd624fe08b12223a75ca55196f769f24748686315329b337efadca1c63f88bee0ac292dd0a587440", - "0x8a07e8f912a38d94309f317c32068e87f68f51bdfa082d96026f5f5f8a2211621f8a3856dda8069386bf15fb2d28c18f", - "0x94ad1dbe341c44eeaf4dc133eed47d8dbfe752575e836c075745770a6679ff1f0e7883b6aa917462993a7f469d74cab5", - "0x8745f8bd86c2bb30efa7efb7725489f2654f3e1ac4ea95bd7ad0f3cfa223055d06c187a16192d9d7bdaea7b050c6a324", - "0x900d149c8d79418cda5955974c450a70845e02e5a4ecbcc584a3ca64d237df73987c303e3eeb79da1af83bf62d9e579f", - "0x8f652ab565f677fb1a7ba03b08004e3cda06b86c6f1b0b9ab932e0834acf1370abb2914c15b0d08327b5504e5990681c", - "0x9103097d088be1f75ab9d3da879106c2f597e2cc91ec31e73430647bdd5c33bcfd771530d5521e7e14df6acda44f38a6", - "0xb0fec7791cfb0f96e60601e1aeced9a92446b61fedab832539d1d1037558612d78419efa87ff5f6b7aab8fd697d4d9de", - "0xb9d2945bdb188b98958854ba287eb0480ef614199c4235ce5f15fc670b8c5ffe8eeb120c09c53ea8a543a022e6a321ac", - "0xa9461bb7d5490973ebaa51afc0bb4a5e42acdccb80e2f939e88b77ac28a98870e103e1042899750f8667a8cc9123bae9", - "0xa37fdf11d4bcb2aed74b9f460a30aa34afea93386fa4cdb690f0a71bc58f0b8df60bec56e7a24f225978b862626fa00e", - "0xa214420e183e03d531cf91661466ea2187d84b6e814b8b20b3730a9400a7d25cf23181bb85589ebc982cec414f5c2923", - "0xad09a45a698a6beb3e0915f540ef16e9af7087f53328972532d6b5dfe98ce4020555ece65c6cbad8bd6be8a4dfefe6fd", - "0xab6742800b02728c92d806976764cb027413d6f86edd08ad8bb5922a2969ee9836878cd39db70db0bd9a2646862acc4f", - "0x974ca9305bd5ea1dc1755dff3b63e8bfe9f744321046c1395659bcea2a987b528e64d5aa96ac7b015650b2253b37888d", - "0x84eee9d6bce039c52c2ebc4fccc0ad70e20c82f47c558098da4be2f386a493cbc76adc795b5488c8d11b6518c2c4fab8", - "0x875d7bda46efcb63944e1ccf760a20144df3b00d53282b781e95f12bfc8f8316dfe6492c2efbf796f1150e36e436e9df", - "0xb68a2208e0c587b5c31b5f6cb32d3e6058a9642e2d9855da4f85566e1412db528475892060bb932c55b3a80877ad7b4a", - "0xba006368ecab5febb6ab348644d9b63de202293085ed468df8bc24d992ae8ce468470aa37f36a73630c789fb9c819b30", - "0x90a196035150846cd2b482c7b17027471372a8ce7d914c4d82b6ea7fa705d8ed5817bd42d63886242585baf7d1397a1c", - "0xa223b4c85e0daa8434b015fd9170b5561fe676664b67064974a1e9325066ecf88fc81f97ab5011c59fad28cedd04b240", - "0x82e8ec43139cf15c6bbeed484b62e06cded8a39b5ce0389e4cbe9c9e9c02f2f0275d8d8d4e8dfec8f69a191bef220408", - "0x81a3fc07a7b68d92c6ee4b6d28f5653ee9ec85f7e2ee1c51c075c1b130a8c5097dc661cf10c5aff1c7114b1a6a19f11a", - "0x8ed2ef8331546d98819a5dd0e6c9f8cb2630d0847671314a28f277faf68da080b53891dd75c82cbcf7788b255490785d", - "0xacecabf84a6f9bbed6b2fc2e7e4b48f02ef2f15e597538a73aea8f98addc6badda15e4695a67ecdb505c1554e8f345ec", - "0xb8f51019b2aa575f8476e03dcadf86cc8391f007e5f922c2a36b2daa63f5a503646a468990cd5c65148d323942193051", - "0xaaa595a84b403ec65729bc1c8055a94f874bf9adddc6c507b3e1f24f79d3ad359595a672b93aab3394db4e2d4a7d8970", - "0x895144c55fcbd0f64d7dd69e6855cfb956e02b5658eadf0f026a70703f3643037268fdd673b0d21b288578a83c6338dd", - "0xa2e92ae6d0d237d1274259a8f99d4ea4912a299816350b876fba5ebc60b714490e198a916e1c38c6e020a792496fa23c", - "0xa45795fda3b5bb0ad1d3c628f6add5b2a4473a1414c1a232e80e70d1cfffd7f8a8d9861f8df2946999d7dbb56bf60113", - "0xb6659bf7f6f2fef61c39923e8c23b8c70e9c903028d8f62516d16755cd3fba2fe41c285aa9432dc75ab08f8a1d8a81fc", - "0xa735609a6bc5bfd85e58234fc439ff1f58f1ff1dd966c5921d8b649e21f006bf2b8642ad8a75063c159aaf6935789293", - "0xa3c622eb387c9d15e7bda2e3e84d007cb13a6d50d655c3f2f289758e49d3b37b9a35e4535d3cc53d8efd51f407281f19", - "0x8afe147b53ad99220f5ef9d763bfc91f9c20caecbcf823564236fb0e6ede49414c57d71eec4772c8715cc65a81af0047", - "0xb5f0203233cf71913951e9c9c4e10d9243e3e4a1f2cb235bf3f42009120ba96e04aa414c9938ea8873b63148478927e8", - "0x93c52493361b458d196172d7ba982a90a4f79f03aa8008edc322950de3ce6acf4c3977807a2ffa9e924047e02072b229", - "0xb9e72b805c8ac56503f4a86c82720afbd5c73654408a22a2ac0b2e5caccdfb0e20b59807433a6233bc97ae58cf14c70a", - "0xaf0475779b5cee278cca14c82da2a9f9c8ef222eb885e8c50cca2315fea420de6e04146590ed0dd5a29c0e0812964df5", - "0xb430ccab85690db02c2d0eb610f3197884ca12bc5f23c51e282bf3a6aa7e4a79222c3d8761454caf55d6c01a327595f9", - "0x830032937418b26ee6da9b5206f3e24dc76acd98589e37937e963a8333e5430abd6ce3dd93ef4b8997bd41440eed75d6", - "0x8820a6d73180f3fe255199f3f175c5eb770461ad5cfdde2fb11508041ed19b8c4ce66ad6ecebf7d7e836cc2318df47ca", - "0xaef1393e7d97278e77bbf52ef6e1c1d5db721ccf75fe753cf47a881fa034ca61eaa5098ee5a344c156d2b14ff9e284ad", - "0x8a4a26c07218948c1196c45d927ef4d2c42ade5e29fe7a91eaebe34a29900072ce5194cf28d51f746f4c4c649daf4396", - "0x84011dc150b7177abdcb715efbd8c201f9cb39c36e6069af5c50a096021768ba40cef45b659c70915af209f904ede3b6", - "0xb1bd90675411389bb66910b21a4bbb50edce5330850c5ab0b682393950124252766fc81f5ecfc72fb7184387238c402e", - "0x8dfdcd30583b696d2c7744655f79809f451a60c9ad5bf1226dc078b19f4585d7b3ef7fa9d54e1ac09520d95cbfd20928", - "0xb351b4dc6d98f75b8e5a48eb7c6f6e4b78451991c9ba630e5a1b9874c15ac450cd409c1a024713bf2cf82dc400e025ef", - "0xa462b8bc97ac668b97b28b3ae24b9f5de60e098d7b23ecb600d2194cd35827fb79f77c3e50d358f5bd72ee83fef18fa0", - "0xa183753265c5f7890270821880cce5f9b2965b115ba783c6dba9769536f57a04465d7da5049c7cf8b3fcf48146173c18", - "0xa8a771b81ed0d09e0da4d79f990e58eabcd2be3a2680419502dd592783fe52f657fe55125b385c41d0ba3b9b9cf54a83", - "0xa71ec577db46011689d073245e3b1c3222a9b1fe6aa5b83629adec5733dd48617ebea91346f0dd0e6cdaa86e4931b168", - "0xa334b8b244f0d598a02da6ae0f918a7857a54dce928376c4c85df15f3b0f2ba3ac321296b8b7c9dd47d770daf16c8f8c", - "0xa29037f8ef925c417c90c4df4f9fb27fb977d04e2b3dd5e8547d33e92ab72e7a00f5461de21e28835319eae5db145eb7", - "0xb91054108ae78b00e3298d667b913ebc44d8f26e531eae78a8fe26fdfb60271c97efb2dee5f47ef5a3c15c8228138927", - "0x926c13efbe90604f6244be9315a34f72a1f8d1aab7572df431998949c378cddbf2fe393502c930fff614ff06ae98a0ce", - "0x995c758fd5600e6537089b1baa4fbe0376ab274ff3e82a17768b40df6f91c2e443411de9cafa1e65ea88fb8b87d504f4", - "0x9245ba307a7a90847da75fca8d77ec03fdfc812c871e7a2529c56a0a79a6de16084258e7a9ac4ae8a3756f394336e21c", - "0x99e0cfa2bb57a7e624231317044c15e52196ecce020db567c8e8cb960354a0be9862ee0c128c60b44777e65ac315e59f", - "0xad4f6b3d27bbbb744126601053c3dc98c07ff0eb0b38a898bd80dce778372846d67e5ab8fb34fb3ad0ef3f235d77ba7f", - "0xa0f12cae3722bbbca2e539eb9cc7614632a2aefe51410430070a12b5bc5314ecec5857b7ff8f41e9980cac23064f7c56", - "0xb487f1bc59485848c98222fd3bc36c8c9bb3d2912e2911f4ceca32c840a7921477f9b1fe00877e05c96c75d3eecae061", - "0xa6033db53925654e18ecb3ce715715c36165d7035db9397087ac3a0585e587998a53973d011ac6d48af439493029cee6", - "0xa6b4d09cd01c70a3311fd131d3710ccf97bde3e7b80efd5a8c0eaeffeb48cca0f951ced905290267b115b06d46f2693b", - "0xa9dff1df0a8f4f218a98b6f818a693fb0d611fed0fc3143537cbd6578d479af13a653a8155e535548a2a0628ae24fa58", - "0xa58e469f65d366b519f9a394cacb7edaddac214463b7b6d62c2dbc1316e11c6c5184ce45c16de2d77f990dcdd8b55430", - "0x989e71734f8119103586dc9a3c5f5033ddc815a21018b34c1f876cdfc112efa868d5751bf6419323e4e59fa6a03ece1c", - "0xa2da00e05036c884369e04cf55f3de7d659cd5fa3f849092b2519dd263694efe0f051953d9d94b7e121f0aee8b6174d7", - "0x968f3c029f57ee31c4e1adea89a7f92e28483af9a74f30fbdb995dc2d40e8e657dff8f8d340d4a92bf65f54440f2859f", - "0x932778df6f60ac1639c1453ef0cbd2bf67592759dcccb3e96dcc743ff01679e4c7dd0ef2b0833dda548d32cb4eba49e2", - "0xa805a31139f8e0d6dae1ac87d454b23a3dc9fc653d4ca18d4f8ebab30fc189c16e73981c2cb7dd6f8c30454a5208109d", - "0xa9ba0991296caa2aaa4a1ceacfb205544c2a2ec97088eace1d84ee5e2767656a172f75d2f0c4e16a3640a0e0dec316e0", - "0xb1e49055c968dced47ec95ae934cf45023836d180702e20e2df57e0f62fb85d7ac60d657ba3ae13b8560b67210449459", - "0xa94e1da570a38809c71e37571066acabff7bf5632737c9ab6e4a32856924bf6211139ab3cedbf083850ff2d0e0c0fcfc", - "0x88ef1bb322000c5a5515b310c838c9af4c1cdbb32eab1c83ac3b2283191cd40e9573747d663763a28dad0d64adc13840", - "0xa987ce205f923100df0fbd5a85f22c9b99b9b9cbe6ddfa8dfda1b8fe95b4f71ff01d6c5b64ca02eb24edb2b255a14ef0", - "0x84fe8221a9e95d9178359918a108de4763ebfa7a6487facb9c963406882a08a9a93f492f8e77cf9e7ea41ae079c45993", - "0xaa1cf3dc7c5dcfa15bbbc811a4bb6dbac4fba4f97fb1ed344ab60264d7051f6eef19ea9773441d89929ee942ed089319", - "0x8f6a7d610d59d9f54689bbe6a41f92d9f6096cde919c1ab94c3c7fcecf0851423bc191e5612349e10f855121c0570f56", - "0xb5af1fa7894428a53ea520f260f3dc3726da245026b6d5d240625380bfb9c7c186df0204bb604efac5e613a70af5106e", - "0xa5bce6055ff812e72ce105f147147c7d48d7a2313884dd1f488b1240ee320f13e8a33f5441953a8e7a3209f65b673ce1", - "0xb9b55b4a1422677d95821e1d042ab81bbf0bf087496504021ec2e17e238c2ca6b44fb3b635a5c9eac0871a724b8d47c3", - "0x941c38e533ce4a673a3830845b56786585e5fe49c427f2e5c279fc6db08530c8f91db3e6c7822ec6bb4f956940052d18", - "0xa38e191d66c625f975313c7007bbe7431b5a06ed2da1290a7d5d0f2ec73770d476efd07b8e632de64597d47df175cbb0", - "0x94ba76b667abf055621db4c4145d18743a368d951565632ed4e743dd50dd3333507c0c34f286a5c5fdbf38191a2255cd", - "0xa5ca38c60be5602f2bfa6e00c687ac96ac36d517145018ddbee6f12eb0faa63dd57909b9eeed26085fe5ac44e55d10ab", - "0xb00fea3b825e60c1ed1c5deb4b551aa65a340e5af36b17d5262c9cd2c508711e4dc50dc2521a2c16c7c901902266e64a", - "0x971b86fc4033485e235ccb0997a236206ba25c6859075edbcdf3c943116a5030b7f75ebca9753d863a522ba21a215a90", - "0xb3b31f52370de246ee215400975b674f6da39b2f32514fe6bd54e747752eedca22bb840493b44a67df42a3639c5f901f", - "0xaffbbfac9c1ba7cbfa1839d2ae271dd6149869b75790bf103230637da41857fc326ef3552ff31c15bda0694080198143", - "0xa95d42aa7ef1962520845aa3688f2752d291926f7b0d73ea2ee24f0612c03b43f2b0fe3c9a9a99620ffc8d487b981bc2", - "0x914a266065caf64985e8c5b1cb2e3f4e3fe94d7d085a1881b1fefa435afef4e1b39a98551d096a62e4f5cc1a7f0fdc2e", - "0x81a0b4a96e2b75bc1bf2dbd165d58d55cfd259000a35504d1ffb18bc346a3e6f07602c683723864ffb980f840836fd8d", - "0x91c1556631cddd4c00b65b67962b39e4a33429029d311c8acf73a18600e362304fb68bccb56fde40f49e95b7829e0b87", - "0x8befbacc19e57f7c885d1b7a6028359eb3d80792fe13b92a8400df21ce48deb0bb60f2ddb50e3d74f39f85d7eab23adc", - "0x92f9458d674df6e990789690ec9ca73dacb67fc9255b58c417c555a8cc1208ace56e8e538f86ba0f3615573a0fbac00d", - "0xb4b1b3062512d6ae7417850c08c13f707d5838e43d48eb98dd4621baf62eee9e82348f80fe9b888a12874bfa538771f8", - "0xa13c4a3ac642ede37d9c883f5319e748d2b938f708c9d779714108a449b343f7b71a6e3ef4080fee125b416762920273", - "0xaf44983d5fc8cceee0551ef934e6e653f2d3efa385e5c8a27a272463a6f333e290378cc307c2b664eb923c78994e706e", - "0xa389fd6c59fe2b4031cc244e22d3991e541bd203dd5b5e73a6159e72df1ab41d49994961500dcde7989e945213184778", - "0x8d2141e4a17836c548de9598d7b298b03f0e6c73b7364979a411c464e0628e21cff6ac3d6decdba5d1c4909eff479761", - "0x980b22ef53b7bdf188a3f14bc51b0dbfdf9c758826daa3cbc1e3986022406a8aa9a6a79e400567120b88c67faa35ce5f", - "0xa28882f0a055f96df3711de5d0aa69473e71245f4f3e9aa944e9d1fb166e02caa50832e46da6d3a03b4801735fd01b29", - "0x8db106a37d7b88f5d995c126abb563934dd8de516af48e85695d02b1aea07f79217e3cdd03c6f5ca57421830186c772b", - "0xb5a7e50da0559a675c472f7dfaee456caab6695ab7870541b2be8c2b118c63752427184aad81f0e1afc61aef1f28c46f", - "0x9962118780e20fe291d10b64f28d09442a8e1b5cffd0f3dd68d980d0614050a626c616b44e9807fbee7accecae00686a", - "0xb38ddf33745e8d2ad6a991aefaf656a33c5f8cbe5d5b6b6fd03bd962153d8fd0e01b5f8f96d80ae53ab28d593ab1d4e7", - "0x857dc12c0544ff2c0c703761d901aba636415dee45618aba2e3454ff9cbc634a85c8b05565e88520ff9be2d097c8b2b1", - "0xa80d465c3f8cc63af6d74a6a5086b626c1cb4a8c0fee425964c3bd203d9d7094e299f81ce96d58afc20c8c9a029d9dae", - "0x89e1c8fbde8563763be483123a3ed702efac189c6d8ab4d16c85e74bbaf856048cc42d5d6e138633a38572ba5ec3f594", - "0x893a594cf495535f6d216508f8d03c317dcf03446668cba688da90f52d0111ac83d76ad09bf5ea47056846585ee5c791", - "0xaadbd8be0ae452f7f9450c7d2957598a20cbf10139a4023a78b4438172d62b18b0de39754dd2f8862dbd50a3a0815e53", - "0xae7d39670ecca3eb6db2095da2517a581b0e8853bdfef619b1fad9aacd443e7e6a40f18209fadd44038a55085c5fe8b2", - "0x866ef241520eacb6331593cfcb206f7409d2f33d04542e6e52cba5447934e02d44c471f6c9a45963f9307e9809ab91d9", - "0xb1a09911ad3864678f7be79a9c3c3eb5c84a0a45f8dcb52c67148f43439aeaaa9fd3ed3471276b7e588b49d6ebe3033a", - "0xadd07b7f0dbb34049cd8feeb3c18da5944bf706871cfd9f14ff72f6c59ad217ebb1f0258b13b167851929387e4e34cfe", - "0xae048892d5c328eefbdd4fba67d95901e3c14d974bfc0a1fc68155ca9f0d59e61d7ba17c6c9948b120cf35fd26e6fee9", - "0x9185b4f3b7da0ddb4e0d0f09b8a9e0d6943a4611e43f13c3e2a767ed8592d31e0ba3ebe1914026a3627680274291f6e5", - "0xa9c022d4e37b0802284ce3b7ee9258628ab4044f0db4de53d1c3efba9de19d15d65cc5e608dbe149c21c2af47d0b07b5", - "0xb24dbd5852f8f24921a4e27013b6c3fa8885b973266cb839b9c388efad95821d5d746348179dcc07542bd0d0aefad1ce", - "0xb5fb4f279300876a539a27a441348764908bc0051ebd66dc51739807305e73db3d2f6f0f294ffb91b508ab150eaf8527", - "0xace50841e718265b290c3483ed4b0fdd1175338c5f1f7530ae9a0e75d5f80216f4de37536adcbc8d8c95982e88808cd0", - "0xb19cadcde0f63bd1a9c24bd9c2806f53c14c0b9735bf351601498408ba503ddbd2037c891041cbba47f58b8c483f3b21", - "0xb6061e63558d312eb891b97b39aa552fa218568d79ee26fe6dd5b864aea9e3216d8f2e2f3b093503be274766dac41426", - "0x89730fdb2876ab6f0fe780d695f6e12090259027e789b819956d786e977518057e5d1d7f5ab24a3ae3d5d4c97773bd2b", - "0xb6fa841e81f9f2cad0163a02a63ae96dc341f7ae803b616efc6e1da2fbea551c1b96b11ad02c4afbdf6d0cc9f23da172", - "0x8fb66187182629c861ddb6896d7ed3caf2ad050c3dba8ab8eb0d7a2c924c3d44c48d1a148f9e33fb1f061b86972f8d21", - "0x86022ac339c1f84a7fa9e05358c1a5b316b4fc0b83dbe9c8c7225dc514f709d66490b539359b084ce776e301024345fa", - "0xb50b9c321468da950f01480bb62b6edafd42f83c0001d6e97f2bd523a1c49a0e8574fb66380ea28d23a7c4d54784f9f0", - "0xa31c05f7032f30d1dac06678be64d0250a071fd655e557400e4a7f4c152be4d5c7aa32529baf3e5be7c4bd49820054f6", - "0xb95ac0848cd322684772119f5b682d90a66bbf9dac411d9d86d2c34844bbd944dbaf8e47aa41380455abd51687931a78", - "0xae4a6a5ce9553b65a05f7935e61e496a4a0f6fd8203367a2c627394c9ce1e280750297b74cdc48fd1d9a31e93f97bef4", - "0xa22daf35f6e9b05e52e0b07f7bd1dbbebd2c263033fb0e1b2c804e2d964e2f11bc0ece6aca6af079dd3a9939c9c80674", - "0x902150e0cb1f16b9b59690db35281e28998ce275acb313900da8b2d8dfd29fa1795f8ca3ff820c31d0697de29df347c1", - "0xb17b5104a5dc665cdd7d47e476153d715eb78c6e5199303e4b5445c21a7fa7cf85fe7cfd08d7570f4e84e579b005428c", - "0xa03f49b81c15433f121680aa02d734bb9e363af2156654a62bcb5b2ba2218398ccb0ff61104ea5d7df5b16ea18623b1e", - "0x802101abd5d3c88876e75a27ffc2f9ddcce75e6b24f23dba03e5201281a7bd5cc7530b6a003be92d225093ca17d3c3bb", - "0xa4d183f63c1b4521a6b52226fc19106158fc8ea402461a5cccdaa35fee93669df6a8661f45c1750cd01308149b7bf08e", - "0x8d17c22e0c8403b69736364d460b3014775c591032604413d20a5096a94d4030d7c50b9fe3240e31d0311efcf9816a47", - "0x947225acfcce5992eab96276f668c3cbe5f298b90a59f2bb213be9997d8850919e8f496f182689b5cbd54084a7332482", - "0x8df6f4ed216fc8d1905e06163ba1c90d336ab991a18564b0169623eb39b84e627fa267397da15d3ed754d1f3423bff07", - "0x83480007a88f1a36dea464c32b849a3a999316044f12281e2e1c25f07d495f9b1710b4ba0d88e9560e72433addd50bc2", - "0xb3019d6e591cf5b33eb972e49e06c6d0a82a73a75d78d383dd6f6a4269838289e6e07c245f54fed67f5c9bb0fd5e1c5f", - "0x92e8ce05e94927a9fb02debadb99cf30a26172b2705003a2c0c47b3d8002bf1060edb0f6a5750aad827c98a656b19199", - "0xac2aff801448dbbfc13cca7d603fd9c69e82100d997faf11f465323b97255504f10c0c77401e4d1890339d8b224f5803", - "0xb0453d9903d08f508ee27e577445dc098baed6cde0ac984b42e0f0efed62760bd58d5816cf1e109d204607b7b175e30c", - "0xae68dc4ba5067e825d46d2c7c67f1009ceb49d68e8d3e4c57f4bcd299eb2de3575d42ea45e8722f8f28497a6e14a1cfe", - "0xb22486c2f5b51d72335ce819bbafb7fa25eb1c28a378a658f13f9fc79cd20083a7e573248d911231b45a5cf23b561ca7", - "0x89d1201d1dbd6921867341471488b4d2fd0fc773ae1d4d074c78ae2eb779a59b64c00452c2a0255826fca6b3d03be2b1", - "0xa2998977c91c7a53dc6104f5bc0a5b675e5350f835e2f0af69825db8af4aeb68435bdbcc795f3dd1f55e1dd50bc0507f", - "0xb0be4937a925b3c05056ed621910d535ccabf5ab99fd3b9335080b0e51d9607d0fd36cb5781ff340018f6acfca4a9736", - "0xaea145a0f6e0ba9df8e52e84bb9c9de2c2dc822f70d2724029b153eb68ee9c17de7d35063dcd6a39c37c59fdd12138f7", - "0x91cb4545d7165ee8ffbc74c874baceca11fdebbc7387908d1a25877ca3c57f2c5def424dab24148826832f1e880bede0", - "0xb3b579cb77573f19c571ad5eeeb21f65548d7dff9d298b8d7418c11f3e8cd3727c5b467f013cb87d6861cfaceee0d2e3", - "0xb98a1eeec2b19fecc8378c876d73645aa52fb99e4819903735b2c7a885b242787a30d1269a04bfb8573d72d9bbc5f0f0", - "0x940c1f01ed362bd588b950c27f8cc1d52276c71bb153d47f07ec85b038c11d9a8424b7904f424423e714454d5e80d1cd", - "0xaa343a8ecf09ce11599b8cf22f7279cf80f06dbf9f6d62cb05308dbbb39c46fd0a4a1240b032665fbb488a767379b91b", - "0x87c3ac72084aca5974599d3232e11d416348719e08443acaba2b328923af945031f86432e170dcdd103774ec92e988c9", - "0x91d6486eb5e61d2b9a9e742c20ec974a47627c6096b3da56209c2b4e4757f007e793ebb63b2b246857c9839b64dc0233", - "0xaebcd3257d295747dd6fc4ff910d839dd80c51c173ae59b8b2ec937747c2072fa85e3017f9060aa509af88dfc7529481", - "0xb3075ba6668ca04eff19efbfa3356b92f0ab12632dcda99cf8c655f35b7928c304218e0f9799d68ef9f809a1492ff7db", - "0x93ba7468bb325639ec2abd4d55179c69fd04eaaf39fc5340709227bbaa4ad0a54ea8b480a1a3c8d44684e3be0f8d1980", - "0xa6aef86c8c0d92839f38544d91b767c582568b391071228ff5a5a6b859c87bf4f81a7d926094a4ada1993ddbd677a920", - "0x91dcd6d14207aa569194aa224d1e5037b999b69ade52843315ca61ba26abe9a76412c9e88259bc5cf5d7b95b97d9c3bc", - "0xb3b483d31c88f78d49bd065893bc1e3d2aa637e27dedb46d9a7d60be7660ce7a10aaaa7deead362284a52e6d14021178", - "0x8e5730070acf8371461ef301cc4523e8e672aa0e3d945d438a0e0aa6bdf8cb9c685dcf38df429037b0c8aff3955c6f5b", - "0xb8c6d769890a8ee18dc4f9e917993315877c97549549b34785a92543cbeec96a08ae3a28d6e809c4aacd69de356c0012", - "0x95ca86cd384eaceaa7c077c5615736ca31f36824bd6451a16142a1edc129fa42b50724aeed7c738f08d7b157f78b569e", - "0x94df609c6d71e8eee7ab74226e371ccc77e01738fe0ef1a6424435b4570fe1e5d15797b66ed0f64eb88d4a3a37631f0e", - "0x89057b9783212add6a0690d6bb99097b182738deff2bd9e147d7fd7d6c8eacb4c219923633e6309ad993c24572289901", - "0x83a0f9f5f265c5a0e54defa87128240235e24498f20965009fef664f505a360b6fb4020f2742565dfc7746eb185bcec0", - "0x91170da5306128931349bc3ed50d7df0e48a68b8cc8420975170723ac79d8773e4fa13c5f14dc6e3fafcad78379050b1", - "0xb7178484d1b55f7e56a4cc250b6b2ec6040437d96bdfddfa7b35ed27435860f3855c2eb86c636f2911b012eb83b00db8", - "0xac0b00c4322d1e4208e09cd977b4e54d221133ff09551f75b32b0b55d0e2be80941dda26257b0e288c162e63c7e9cf68", - "0x9690ed9e7e53ed37ff362930e4096b878b12234c332fd19d5d064824084245952eda9f979e0098110d6963e468cf513e", - "0xb6fa547bb0bb83e5c5be0ed462a8783fba119041c136a250045c09d0d2af330c604331e7de960df976ff76d67f8000cd", - "0x814603907c21463bcf4e59cfb43066dfe1a50344ae04ef03c87c0f61b30836c3f4dea0851d6fa358c620045b7f9214c8", - "0x9495639e3939fad2a3df00a88603a5a180f3c3a0fe4d424c35060e2043e0921788003689887b1ed5be424d9a89bb18bb", - "0xaba4c02d8d57f2c92d5bc765885849e9ff8393d6554f5e5f3e907e5bfac041193a0d8716d7861104a4295d5a03c36b03", - "0x8ead0b56c1ca49723f94a998ba113b9058059321da72d9e395a667e6a63d5a9dac0f5717cec343f021695e8ced1f72af", - "0xb43037f7e3852c34ed918c5854cd74e9d5799eeddfe457d4f93bb494801a064735e326a76e1f5e50a339844a2f4a8ec9", - "0x99db8422bb7302199eb0ff3c3d08821f8c32f53a600c5b6fb43e41205d96adae72be5b460773d1280ad1acb806af9be8", - "0x8a9be08eae0086c0f020838925984df345c5512ff32e37120b644512b1d9d4fecf0fd30639ca90fc6cf334a86770d536", - "0x81b43614f1c28aa3713a309a88a782fb2bdfc4261dd52ddc204687791a40cf5fd6a263a8179388596582cccf0162efc2", - "0xa9f3a8b76912deb61d966c75daf5ddb868702ebec91bd4033471c8e533183df548742a81a2671de5be63a502d827437d", - "0x902e2415077f063e638207dc7e14109652e42ab47caccd6204e2870115791c9defac5425fd360b37ac0f7bd8fe7011f8", - "0xaa18e4fdc1381b59c18503ae6f6f2d6943445bd00dd7d4a2ad7e5adad7027f2263832690be30d456e6d772ad76f22350", - "0xa348b40ba3ba7d81c5d4631f038186ebd5e5f314f1ea737259151b07c3cc8cf0c6ed4201e71bcc1c22fefda81a20cde6", - "0xaa1306f7ac1acbfc47dc6f7a0cb6d03786cec8c8dc8060388ccda777bca24bdc634d03e53512c23dba79709ff64f8620", - "0x818ccfe46e700567b7f3eb400e5a35f6a5e39b3db3aa8bc07f58ace35d9ae5a242faf8dbccd08d9a9175bbce15612155", - "0xb7e3da2282b65dc8333592bb345a473f03bd6df69170055fec60222de9897184536bf22b9388b08160321144d0940279", - "0xa4d976be0f0568f4e57de1460a1729129252b44c552a69fceec44e5b97c96c711763360d11f9e5bf6d86b4976bf40d69", - "0x85d185f0397c24c2b875b09b6328a23b87982b84ee880f2677a22ff4c9a1ba9f0fea000bb3f7f66375a00d98ebafce17", - "0xb4ccbb8c3a2606bd9b87ce022704663af71d418351575f3b350d294f4efc68c26f9a2ce49ff81e6ff29c3b63d746294e", - "0x93ffd3265fddb63724dfde261d1f9e22f15ecf39df28e4d89e9fea03221e8e88b5dd9b77628bacaa783c6f91802d47cc", - "0xb1fd0f8d7a01378e693da98d03a2d2fda6b099d03454b6f2b1fa6472ff6bb092751ce6290059826b74ac0361eab00e1e", - "0xa89f440c71c561641589796994dd2769616b9088766e983c873fae0716b95c386c8483ab8a4f367b6a68b72b7456dd32", - "0xaf4fe92b01d42d03dd5d1e7fa55e96d4bbcb7bf7d4c8c197acd16b3e0f3455807199f683dcd263d74547ef9c244b35cc", - "0xa8227f6e0a344dfe76bfbe7a1861be32c4f4bed587ccce09f9ce2cf481b2dda8ae4f566154bc663d15f962f2d41761bd", - "0xa7b361663f7495939ed7f518ba45ea9ff576c4e628995b7aea026480c17a71d63fc2c922319f0502eb7ef8f14a406882", - "0x8ddcf382a9f39f75777160967c07012cfa89e67b19714a7191f0c68eaf263935e5504e1104aaabd0899348c972a8d3c6", - "0x98c95b9f6f5c91f805fb185eedd06c6fc4457d37dd248d0be45a6a168a70031715165ea20606245cbdf8815dc0ac697f", - "0x805b44f96e001e5909834f70c09be3efcd3b43632bcac5b6b66b6d227a03a758e4b1768ce2a723045681a1d34562aaeb", - "0xb0e81b07cdc45b3dca60882676d9badb99f25c461b7efe56e3043b80100bb62d29e1873ae25eb83087273160ece72a55", - "0xb0c53f0abe78ee86c7b78c82ae1f7c070bb0b9c45c563a8b3baa2c515d482d7507bb80771e60b38ac13f78b8af92b4a9", - "0xa7838ef6696a9e4d2e5dfd581f6c8d6a700467e8fd4e85adabb5f7a56f514785dd4ab64f6f1b48366f7d94728359441b", - "0x88c76f7700a1d23c30366a1d8612a796da57b2500f97f88fdf2d76b045a9d24e7426a8ffa2f4e86d3046937a841dad58", - "0xad8964baf98c1f02e088d1d9fcb3af6b1dfa44cdfe0ed2eae684e7187c33d3a3c28c38e8f4e015f9c04d451ed6f85ff6", - "0x90e9d00a098317ececaa9574da91fc149eda5b772dedb3e5a39636da6603aa007804fa86358550cfeff9be5a2cb7845e", - "0xa56ff4ddd73d9a6f5ab23bb77efa25977917df63571b269f6a999e1ad6681a88387fcc4ca3b26d57badf91b236503a29", - "0x97ad839a6302c410a47e245df84c01fb9c4dfef86751af3f9340e86ff8fc3cd52fa5ff0b9a0bd1d9f453e02ca80658a6", - "0xa4c8c44cbffa804129e123474854645107d1f0f463c45c30fd168848ebea94880f7c0c5a45183e9eb837f346270bdb35", - "0xa72e53d0a1586d736e86427a93569f52edd2f42b01e78aee7e1961c2b63522423877ae3ac1227a2cf1e69f8e1ff15bc3", - "0x8559f88a7ef13b4f09ac82ae458bbae6ab25671cfbf52dae7eac7280d6565dd3f0c3286aec1a56a8a16dc3b61d78ce47", - "0x8221503f4cdbed550876c5dc118a3f2f17800c04e8be000266633c83777b039a432d576f3a36c8a01e8fd18289ebc10b", - "0x99bfbe5f3e46d4d898a578ba86ed26de7ed23914bd3bcdf3c791c0bcd49398a52419077354a5ab75cea63b6c871c6e96", - "0xaa134416d8ff46f2acd866c1074af67566cfcf4e8be8d97329dfa0f603e1ff208488831ce5948ac8d75bfcba058ddcaa", - "0xb02609d65ebfe1fe8e52f21224a022ea4b5ea8c1bd6e7b9792eed8975fc387cdf9e3b419b8dd5bcce80703ab3a12a45f", - "0xa4f14798508698fa3852e5cac42a9db9797ecee7672a54988aa74037d334819aa7b2ac7b14efea6b81c509134a6b7ad2", - "0x884f01afecbcb987cb3e7c489c43155c416ed41340f61ecb651d8cba884fb9274f6d9e7e4a46dd220253ae561614e44c", - "0xa05523c9e71dce1fe5307cc71bd721feb3e1a0f57a7d17c7d1c9fb080d44527b7dbaa1f817b1af1c0b4322e37bc4bb1e", - "0x8560aec176a4242b39f39433dd5a02d554248c9e49d3179530815f5031fee78ba9c71a35ceeb2b9d1f04c3617c13d8f0", - "0x996aefd402748d8472477cae76d5a2b92e3f092fc834d5222ae50194dd884c9fb8b6ed8e5ccf8f6ed483ddbb4e80c747", - "0x8fd09900320000cbabc40e16893e2fcf08815d288ec19345ad7b6bb22f7d78a52b6575a3ca1ca2f8bc252d2eafc928ec", - "0x939e51f73022bc5dc6862a0adf8fb8a3246b7bfb9943cbb4b27c73743926cc20f615a036c7e5b90c80840e7f1bfee0e7", - "0xa0a6258700cadbb9e241f50766573bf9bdb7ad380b1079dc3afb4054363d838e177b869cad000314186936e40359b1f2", - "0x972699a4131c8ed27a2d0e2104d54a65a7ff1c450ad9da3a325c662ab26869c21b0a84d0700b98c8b5f6ce3b746873d7", - "0xa454c7fe870cb8aa6491eafbfb5f7872d6e696033f92e4991d057b59d70671f2acdabef533e229878b60c7fff8f748b1", - "0xa167969477214201f09c79027b10221e4707662e0c0fde81a0f628249f2f8a859ce3d30a7dcc03b8ecca8f7828ad85c7", - "0x8ff6b7265175beb8a63e1dbf18c9153fb2578c207c781282374f51b40d57a84fd2ef2ea2b9c6df4a54646788a62fd17f", - "0xa3d7ebeccde69d73d8b3e76af0da1a30884bb59729503ff0fb0c3bccf9221651b974a6e72ea33b7956fc3ae758226495", - "0xb71ef144c9a98ce5935620cb86c1590bd4f48e5a2815d25c0cdb008fde628cf628c31450d3d4f67abbfeb16178a74cfd", - "0xb5e0a16d115134f4e2503990e3f2035ed66b9ccf767063fe6747870d97d73b10bc76ed668550cb82eedc9a2ca6f75524", - "0xb30ffaaf94ee8cbc42aa2c413175b68afdb207dbf351fb20be3852cb7961b635c22838da97eaf43b103aff37e9e725cc", - "0x98aa7d52284f6c1f22e272fbddd8c8698cf8f5fbb702d5de96452141fafb559622815981e50b87a72c2b1190f59a7deb", - "0x81fbacda3905cfaf7780bb4850730c44166ed26a7c8d07197a5d4dcd969c09e94a0461638431476c16397dd7bdc449f9", - "0x95e47021c1726eac2e5853f570d6225332c6e48e04c9738690d53e07c6b979283ebae31e2af1fc9c9b3e59f87e5195b1", - "0xac024a661ba568426bb8fce21780406537f518075c066276197300841e811860696f7588188bc01d90bace7bc73d56e3", - "0xa4ebcaf668a888dd404988ab978594dee193dad2d0aec5cdc0ccaf4ec9a7a8228aa663db1da8ddc52ec8472178e40c32", - "0xa20421b8eaf2199d93b083f2aff37fb662670bd18689d046ae976d1db1fedd2c2ff897985ecc6277b396db7da68bcb27", - "0x8bc33d4b40197fd4d49d1de47489d10b90d9b346828f53a82256f3e9212b0cbc6930b895e879da9cec9fedf026aadb3e", - "0xaaafdd1bec8b757f55a0433eddc0a39f818591954fd4e982003437fcceb317423ad7ee74dbf17a2960380e7067a6b4e2", - "0xaad34277ebaed81a6ec154d16736866f95832803af28aa5625bf0461a71d02b1faba02d9d9e002be51c8356425a56867", - "0x976e9c8b150d08706079945bd0e84ab09a648ecc6f64ded9eb5329e57213149ae409ae93e8fbd8eda5b5c69f5212b883", - "0x8097fae1653247d2aed4111533bc378171d6b2c6d09cbc7baa9b52f188d150d645941f46d19f7f5e27b7f073c1ebd079", - "0x83905f93b250d3184eaba8ea7d727c4464b6bdb027e5cbe4f597d8b9dc741dcbea709630bd4fd59ce24023bec32fc0f3", - "0x8095030b7045cff28f34271386e4752f9a9a0312f8df75de4f424366d78534be2b8e1720a19cb1f9a2d21105d790a225", - "0xa7b7b73a6ae2ed1009c49960374b0790f93c74ee03b917642f33420498c188a169724945a975e5adec0a1e83e07fb1b2", - "0x856a41c54df393b6660b7f6354572a4e71c8bfca9cabaffb3d4ef2632c015e7ee2bc10056f3eccb3dbed1ad17d939178", - "0xa8f7a55cf04b38cd4e330394ee6589da3a07dc9673f74804fdf67b364e0b233f14aec42e783200a2e4666f7c5ff62490", - "0x82c529f4e543c6bca60016dc93232c115b359eaee2798a9cf669a654b800aafe6ab4ba58ea8b9cdda2b371c8d62fa845", - "0x8caab020c1baddce77a6794113ef1dfeafc5f5000f48e97f4351b588bf02f1f208101745463c480d37f588d5887e6d8c", - "0x8fa91b3cc400f48b77b6fd77f3b3fbfb3f10cdff408e1fd22d38f77e087b7683adad258804409ba099f1235b4b4d6fea", - "0x8aa02787663d6be9a35677d9d8188b725d5fcd770e61b11b64e3def8808ea5c71c0a9afd7f6630c48634546088fcd8e2", - "0xb5635b7b972e195cab878b97dea62237c7f77eb57298538582a330b1082f6207a359f2923864630136d8b1f27c41b9aa", - "0x8257bb14583551a65975946980c714ecd6e5b629672bb950b9caacd886fbd22704bc9e3ba7d30778adab65dc74f0203a", - "0xab5fe1cd12634bfa4e5c60d946e2005cbd38f1063ec9a5668994a2463c02449a0a185ef331bd86b68b6e23a8780cb3ba", - "0xa7d3487da56cda93570cc70215d438204f6a2709bfb5fda6c5df1e77e2efc80f4235c787e57fbf2c74aaff8cbb510a14", - "0xb61cff7b4c49d010e133319fb828eb900f8a7e55114fc86b39c261a339c74f630e1a7d7e1350244ada566a0ff3d46c4b", - "0x8d4d1d55d321d278db7a85522ccceca09510374ca81d4d73e3bb5249ace7674b73900c35a531ec4fa6448fabf7ad00dc", - "0x966492248aee24f0f56c8cfca3c8ec6ba3b19abb69ae642041d4c3be8523d22c65c4dafcab4c58989ccc4e0bd2f77919", - "0xb20c320a90cb220b86e1af651cdc1e21315cd215da69f6787e28157172f93fc8285dcd59b039c626ed8ca4633cba1a47", - "0xaae9e6b22f018ceb5c0950210bb8182cb8cb61014b7e14581a09d36ebd1bbfebdb2b82afb7fdb0cf75e58a293d9c456d", - "0x875547fb67951ad37b02466b79f0c9b985ccbc500cfb431b17823457dc79fb9597ec42cd9f198e15523fcd88652e63a4", - "0x92afce49773cb2e20fb21e4f86f18e0959ebb9c33361547ddb30454ee8e36b1e234019cbdca0e964cb292f7f77df6b90", - "0x8af85343dfe1821464c76ba11c216cbef697b5afc69c4d821342e55afdac047081ec2e3f7b09fc14b518d9a23b78c003", - "0xb7de4a1648fd63f3a918096ea669502af5357438e69dac77cb8102b6e6c15c76e033cfaa80dafc806e535ede5c1a20aa", - "0xac80e9b545e8bd762951d96c9ce87f629d01ffcde07efc2ef7879ca011f1d0d8a745abf26c9d452541008871304fac00", - "0xa4cf0f7ed724e481368016c38ea5816698a5f68eb21af4d3c422d2ba55f96a33e427c2aa40de1b56a7cfac7f7cf43ab0", - "0x899b0a678bb2db2cae1b44e75a661284844ebcdd87abf308fedeb2e4dbe5c5920c07db4db7284a7af806a2382e8b111a", - "0xaf0588a2a4afce2b1b13c1230816f59e8264177e774e4a341b289a101dcf6af813638fed14fb4d09cb45f35d5d032609", - "0xa4b8df79e2be76e9f5fc5845f06fe745a724cf37c82fcdb72719b77bdebea3c0e763f37909373e3a94480cc5e875cba0", - "0x83e42c46d88930c8f386b19fd999288f142d325e2ebc86a74907d6d77112cb0d449bc511c95422cc810574031a8cbba9", - "0xb5e39534070de1e5f6e27efbdd3dc917d966c2a9b8cf2d893f964256e95e954330f2442027dc148c776d63a95bcde955", - "0x958607569dc28c075e658cd4ae3927055c6bc456eef6212a6fea8205e48ed8777a8064f584cda38fe5639c371e2e7fba", - "0x812adf409fa63575113662966f5078a903212ffb65c9b0bbe62da0f13a133443a7062cb8fd70f5e5dd5559a32c26d2c8", - "0xa679f673e5ce6a3cce7fa31f22ee3785e96bcb55e5a776e2dd3467bef7440e3555d1a9b87cb215e86ee9ed13a090344b", - "0xafedbb34508b159eb25eb2248d7fe328f86ef8c7d84c62d5b5607d74aae27cc2cc45ee148eb22153b09898a835c58df4", - "0xb75505d4f6b67d31e665cfaf5e4acdb5838ae069166b7fbcd48937c0608a59e40a25302fcc1873d2e81c1782808c70f0", - "0xb62515d539ec21a155d94fc00ea3c6b7e5f6636937bce18ed5b618c12257fb82571886287fd5d1da495296c663ebc512", - "0xab8e1a9446bbdd588d1690243b1549d230e6149c28f59662b66a8391a138d37ab594df38e7720fae53217e5c3573b5be", - "0xb31e8abf4212e03c3287bb2c0a153065a7290a16764a0bac8f112a72e632185a654bb4e88fdd6053e6c7515d9719fadb", - "0xb55165477fe15b6abd2d0f4fddaa9c411710dcc4dd712daba3d30e303c9a3ee5415c256f9dc917ecf18c725b4dbab059", - "0xa0939d4f57cacaae549b78e87cc234de4ff6a35dc0d9cd5d7410abc30ebcd34c135e008651c756e5a9d2ca79c40ef42b", - "0x8cf10e50769f3443340844aad4d56ec790850fed5a41fcbd739abac4c3015f0a085a038fbe7fae9f5ad899cce5069f6b", - "0x924055e804d82a99ea4bb160041ea4dc14b568abf379010bc1922fde5d664718c31d103b8b807e3a1ae809390e708c73", - "0x8ec0f9d26f71b0f2e60a179e4fd1778452e2ffb129d50815e5d7c7cb9415fa69ae5890578086e8ef6bfde35ad2a74661", - "0x98c7f12b15ec4426b59f737f73bf5faea4572340f4550b7590dfb7f7ffedb2372e3e555977c63946d579544c53210ad0", - "0x8a935f7a955c78f69d66f18eee0092e5e833fa621781c9581058e219af4d7ceee48b84e472e159dda6199715fb2f9acf", - "0xb78d4219f95a2dbfaa7d0c8a610c57c358754f4f43c2af312ab0fe8f10a5f0177e475332fb8fd23604e474fc2abeb051", - "0x8d086a14803392b7318c28f1039a17e3cfdcece8abcaca3657ec3d0ac330842098a85c0212f889fabb296dfb133ce9aa", - "0xa53249f417aac82f2c2a50c244ce21d3e08a5e5a8bd33bec2a5ab0d6cd17793e34a17edfa3690899244ce201e2fb9986", - "0x8619b0264f9182867a1425be514dc4f1ababc1093138a728a28bd7e4ecc99b9faaff68c23792264bc6e4dce5f52a5c52", - "0x8c171edbbbde551ec19e31b2091eb6956107dd9b1f853e1df23bff3c10a3469ac77a58335eee2b79112502e8e163f3de", - "0xa9d19ec40f0ca07c238e9337c6d6a319190bdba2db76fb63902f3fb459aeeb50a1ac30db5b25ee1b4201f3ca7164a7f4", - "0xb9c6ec14b1581a03520b8d2c1fbbc31fb8ceaef2c0f1a0d0080b6b96e18442f1734bea7ef7b635d787c691de4765d469", - "0x8cb437beb4cfa013096f40ccc169a713dc17afee6daa229a398e45fd5c0645a9ad2795c3f0cd439531a7151945d7064d", - "0xa6e8740cc509126e146775157c2eb278003e5bb6c48465c160ed27888ca803fa12eee1f6a8dd7f444f571664ed87fdc1", - "0xb75c1fecc85b2732e96b3f23aefb491dbd0206a21d682aee0225838dc057d7ed3b576176353e8e90ae55663f79e986e4", - "0xad8d249b0aea9597b08358bce6c77c1fd552ef3fbc197d6a1cfe44e5e6f89b628b12a6fb04d5dcfcbacc51f46e4ae7bb", - "0xb998b2269932cbd58d04b8e898d373ac4bb1a62e8567484f4f83e224061bc0f212459f1daae95abdbc63816ae6486a55", - "0x827988ef6c1101cddc96b98f4a30365ff08eea2471dd949d2c0a9b35c3bbfa8c07054ad1f4c88c8fbf829b20bb5a9a4f", - "0x8692e638dd60babf7d9f2f2d2ce58e0ac689e1326d88311416357298c6a2bffbfebf55d5253563e7b3fbbf5072264146", - "0xa685d75b91aea04dbc14ab3c1b1588e6de96dae414c8e37b8388766029631b28dd860688079b12d09cd27f2c5af11adf", - "0xb57eced93eec3371c56679c259b34ac0992286be4f4ff9489d81cf9712403509932e47404ddd86f89d7c1c3b6391b28c", - "0xa1c8b4e42ebcbd8927669a97f1b72e236fb19249325659e72be7ddaaa1d9e81ca2abb643295d41a8c04a2c01f9c0efd7", - "0x877c33de20d4ed31674a671ba3e8f01a316581e32503136a70c9c15bf0b7cb7b1cba6cd4eb641fad165fb3c3c6c235fd", - "0xa2a469d84ec478da40838f775d11ad38f6596eb41caa139cc190d6a10b5108c09febae34ffdafac92271d2e73c143693", - "0x972f817caedb254055d52e963ed28c206848b6c4cfdb69dbc961c891f8458eaf582a6d4403ce1177d87bc2ea410ef60a", - "0xaccbd739e138007422f28536381decc54bb6bd71d93edf3890e54f9ef339f83d2821697d1a4ac1f5a98175f9a9ecb9b5", - "0x8940f8772e05389f823b62b3adc3ed541f91647f0318d7a0d3f293aeeb421013de0d0a3664ea53dd24e5fbe02d7efef6", - "0x8ecce20f3ef6212edef07ec4d6183fda8e0e8cad2c6ccd0b325e75c425ee1faba00b5c26b4d95204238931598d78f49d", - "0x97cc72c36335bd008afbed34a3b0c7225933faba87f7916d0a6d2161e6f82e0cdcda7959573a366f638ca75d30e9dab1", - "0x9105f5de8699b5bdb6bd3bb6cc1992d1eac23929c29837985f83b22efdda92af64d9c574aa9640475087201bbbe5fd73", - "0x8ffb33c4f6d05c413b9647eb6933526a350ed2e4278ca2ecc06b0e8026d8dbe829c476a40e45a6df63a633090a3f82ef", - "0x8bfc6421fdc9c2d2aaa68d2a69b1a2728c25b84944cc3e6a57ff0c94bfd210d1cbf4ff3f06702d2a8257024d8be7de63", - "0xa80e1dc1dddfb41a70220939b96dc6935e00b32fb8be5dff4eed1f1c650002ff95e4af481c43292e3827363b7ec4768a", - "0x96f714ebd54617198bd636ba7f7a7f8995a61db20962f2165078d9ed8ee764d5946ef3cbdc7ebf8435bb8d5dd4c1deac", - "0x8cdb0890e33144d66391d2ae73f5c71f5a861f72bc93bff6cc399fc25dd1f9e17d8772592b44593429718784802ac377", - "0x8ccf9a7f80800ee770b92add734ed45a73ecc31e2af0e04364eefc6056a8223834c7c0dc9dfc52495bdec6e74ce69994", - "0xaa0875f423bd68b5f10ba978ddb79d3b96ec093bfbac9ff366323193e339ed7c4578760fb60f60e93598bdf1e5cc4995", - "0xa9214f523957b59c7a4cb61a40251ad72aba0b57573163b0dc0f33e41d2df483fb9a1b85a5e7c080e9376c866790f8cb", - "0xb6224b605028c6673a536cc8ff9aeb94e7a22e686fda82cf16068d326469172f511219b68b2b3affb7933af0c1f80d07", - "0xb6d58968d8a017c6a34e24c2c09852f736515a2c50f37232ac6b43a38f8faa7572cc31dade543b594b61b5761c4781d0", - "0x8a97cefe5120020c38deeb861d394404e6c993c6cbd5989b6c9ebffe24f46ad11b4ba6348e2991cbf3949c28cfc3c99d", - "0x95bf046f8c3a9c0ce2634be4de3713024daec3fc4083e808903b25ce3ac971145af90686b451efcc72f6b22df0216667", - "0xa6a4e2f71b8fa28801f553231eff2794c0f10d12e7e414276995e21195abc9c2983a8997e41af41e78d19ff6fbb2680b", - "0x8e5e62a7ca9c2f58ebaab63db2ff1fb1ff0877ae94b7f5e2897f273f684ae639dff44cc65718f78a9c894787602ab26a", - "0x8542784383eec4f565fcb8b9fc2ad8d7a644267d8d7612a0f476fc8df3aff458897a38003d506d24142ad18f93554f2b", - "0xb7db68ba4616ea072b37925ec4fb39096358c2832cc6d35169e032326b2d6614479f765ae98913c267105b84afcb9bf2", - "0x8b31dbb9457d23d416c47542c786e07a489af35c4a87dadb8ee91bea5ac4a5315e65625d78dad2cf8f9561af31b45390", - "0xa8545a1d91ac17257732033d89e6b7111db8242e9c6ebb0213a88906d5ef407a2c6fdb444e29504b06368b6efb4f4839", - "0xb1bd85d29ebb28ccfb05779aad8674906b267c2bf8cdb1f9a0591dd621b53a4ee9f2942687ee3476740c0b4a7621a3ae", - "0xa2b54534e152e46c50d91fff03ae9cd019ff7cd9f4168b2fe7ac08ef8c3bbc134cadd3f9d6bd33d20ae476c2a8596c8a", - "0xb19b571ff4ae3e9f5d95acda133c455e72c9ea9973cae360732859836c0341c4c29ab039224dc5bc3deb824e031675d8", - "0x940b5f80478648bac025a30f3efeb47023ce20ee98be833948a248bca6979f206bb28fc0f17b90acf3bb4abd3d14d731", - "0x8f106b40588586ac11629b96d57808ad2808915d89539409c97414aded90b4ff23286a692608230a52bff696055ba5d6", - "0xae6bda03aa10da3d2abbc66d764ca6c8d0993e7304a1bdd413eb9622f3ca1913baa6da1e9f4f9e6cf847f14f44d6924d", - "0xa18e7796054a340ef826c4d6b5a117b80927afaf2ebd547794c400204ae2caf277692e2eabb55bc2f620763c9e9da66d", - "0x8d2d25180dc2c65a4844d3e66819ccfcf48858f0cc89e1c77553b463ec0f7feb9a4002ce26bc618d1142549b9850f232", - "0x863f413a394de42cc8166c1c75d513b91d545fff1de6b359037a742c70b008d34bf8e587afa2d62c844d0c6f0ea753e7", - "0x83cd0cf62d63475e7fcad18a2e74108499cdbf28af2113cfe005e3b5887794422da450b1944d0a986eb7e1f4c3b18f25", - "0xb4f8b350a6d88fea5ab2e44715a292efb12eb52df738c9b2393da3f1ddee68d0a75b476733ccf93642154bceb208f2b8", - "0xb3f52aaa4cd4221cb9fc45936cc67fd3864bf6d26bf3dd86aa85aa55ecfc05f5e392ecce5e7cf9406b4b1c4fce0398c8", - "0xb33137084422fb643123f40a6df2b498065e65230fc65dc31791c330e898c51c3a65ff738930f32c63d78f3c9315f85b", - "0x91452bfa75019363976bb7337fe3a73f1c10f01637428c135536b0cdc7da5ce558dae3dfc792aa55022292600814a8ef", - "0xad6ba94c787cd4361ca642c20793ea44f1f127d4de0bb4a77c7fbfebae0fcadbf28e2cb6f0c12c12a07324ec8c19761d", - "0x890aa6248b17f1501b0f869c556be7bf2b1d31a176f9978bb97ab7a6bd4138eed32467951c5ef1871944b7f620542f43", - "0x82111db2052194ee7dd22ff1eafffac0443cf969d3762cceae046c9a11561c0fdce9c0711f88ac01d1bed165f8a7cee3", - "0xb1527b71df2b42b55832f72e772a466e0fa05743aacc7814f4414e4bcc8d42a4010c9e0fd940e6f254cafedff3cd6543", - "0x922370fa49903679fc565f09c16a5917f8125e72acfeb060fcdbadbd1644eb9f4016229756019c93c6d609cda5d5d174", - "0xaa4c7d98a96cab138d2a53d4aee8ebff6ef903e3b629a92519608d88b3bbd94de5522291a1097e6acf830270e64c8ee1", - "0xb3dc21608a389a72d3a752883a382baaafc61ecc44083b832610a237f6a2363f24195acce529eb4aed4ef0e27a12b66e", - "0x94619f5de05e07b32291e1d7ab1d8b7337a2235e49d4fb5f3055f090a65e932e829efa95db886b32b153bdd05a53ec8c", - "0xade1e92722c2ffa85865d2426fb3d1654a16477d3abf580cfc45ea4b92d5668afc9d09275d3b79283e13e6b39e47424d", - "0xb7201589de7bed094911dd62fcd25c459a8e327ac447b69f541cdba30233063e5ddffad0b67e9c3e34adcffedfd0e13d", - "0x809d325310f862d6549e7cb40f7e5fc9b7544bd751dd28c4f363c724a0378c0e2adcb5e42ec8f912f5f49f18f3365c07", - "0xa79c20aa533de7a5d671c99eb9eb454803ba54dd4f2efa3c8fec1a38f8308e9905c71e9282955225f686146388506ff6", - "0xa85eeacb5e8fc9f3ed06a3fe2dc3108ab9f8c5877b148c73cf26e4e979bf5795edbe2e63a8d452565fd1176ed40402b2", - "0x97ef55662f8a1ec0842b22ee21391227540adf7708f491436044f3a2eb18c471525e78e1e14fa292507c99d74d7437c6", - "0x93110d64ed5886f3d16ce83b11425576a3a7a9bb831cd0de3f9a0b0f2270a730d68136b4ef7ff035ede004358f419b5c", - "0xac9ed0a071517f0ae4f61ce95916a90ba9a77a3f84b0ec50ef7298acdcd44d1b94525d191c39d6bd1bb68f4471428760", - "0x98abd6a02c7690f5a339adf292b8c9368dfc12e0f8069cf26a5e0ce54b4441638f5c66ea735142f3c28e00a0024267e6", - "0xb51efb73ba6d44146f047d69b19c0722227a7748b0e8f644d0fc9551324cf034c041a2378c56ce8b58d06038fb8a78de", - "0x8f115af274ef75c1662b588b0896b97d71f8d67986ae846792702c4742ab855952865ce236b27e2321967ce36ff93357", - "0xb3c4548f14d58b3ab03c222da09e4381a0afe47a72d18d50a94e0008797f78e39e99990e5b4757be62310d400746e35a", - "0xa9b1883bd5f31f909b8b1b6dcb48c1c60ed20aa7374b3ffa7f5b2ed036599b5bef33289d23c80a5e6420d191723b92f7", - "0x85d38dffd99487ae5bb41ab4a44d80a46157bbbe8ef9497e68f061721f74e4da513ccc3422936b059575975f6787c936", - "0xadf870fcb96e972c033ab7a35d28ae79ee795f82bc49c3bd69138f0e338103118d5529c53f2d72a9c0d947bf7d312af2", - "0xab4c7a44e2d9446c6ff303eb49aef0e367a58b22cc3bb27b4e69b55d1d9ee639c9234148d2ee95f9ca8079b1457d5a75", - "0xa386420b738aba2d7145eb4cba6d643d96bda3f2ca55bb11980b318d43b289d55a108f4bc23a9606fb0bccdeb3b3bb30", - "0x847020e0a440d9c4109773ecca5d8268b44d523389993b1f5e60e541187f7c597d79ebd6e318871815e26c96b4a4dbb1", - "0xa530aa7e5ca86fcd1bec4b072b55cc793781f38a666c2033b510a69e110eeabb54c7d8cbcb9c61fee531a6f635ffa972", - "0x87364a5ea1d270632a44269d686b2402da737948dac27f51b7a97af80b66728b0256547a5103d2227005541ca4b7ed04", - "0x8816fc6e16ea277de93a6d793d0eb5c15e9e93eb958c5ef30adaf8241805adeb4da8ce19c3c2167f971f61e0b361077d", - "0x8836a72d301c42510367181bb091e4be377777aed57b73c29ef2ce1d475feedd7e0f31676284d9a94f6db01cc4de81a2", - "0xb0d9d8b7116156d9dde138d28aa05a33e61f8a85839c1e9071ccd517b46a5b4b53acb32c2edd7150c15bc1b4bd8db9e3", - "0xae931b6eaeda790ba7f1cd674e53dc87f6306ff44951fa0df88d506316a5da240df9794ccbd7215a6470e6b31c5ea193", - "0x8c6d5bdf87bd7f645419d7c6444e244fe054d437ed1ba0c122fde7800603a5fadc061e5b836cb22a6cfb2b466f20f013", - "0x90d530c6d0cb654999fa771b8d11d723f54b8a8233d1052dc1e839ea6e314fbed3697084601f3e9bbb71d2b4eaa596df", - "0xb0d341a1422588c983f767b1ed36c18b141774f67ef6a43cff8e18b73a009da10fc12120938b8bba27f225bdfd3138f9", - "0xa131b56f9537f460d304e9a1dd75702ace8abd68cb45419695cb8dee76998139058336c87b7afd6239dc20d7f8f940cc", - "0xaa6c51fa28975f709329adee1bbd35d49c6b878041841a94465e8218338e4371f5cb6c17f44a63ac93644bf28f15d20f", - "0x88440fb584a99ebd7f9ea04aaf622f6e44e2b43bbb49fb5de548d24a238dc8f26c8da2ccf03dd43102bda9f16623f609", - "0x9777b8695b790e702159a4a750d5e7ff865425b95fa0a3c15495af385b91c90c00a6bd01d1b77bffe8c47d01baae846f", - "0x8b9d764ece7799079e63c7f01690c8eff00896a26a0d095773dea7a35967a8c40db7a6a74692f0118bf0460c26739af4", - "0x85808c65c485520609c9e61fa1bb67b28f4611d3608a9f7a5030ee61c3aa3c7e7dc17fff48af76b4aecee2cb0dbd22ac", - "0xad2783a76f5b3db008ef5f7e67391fda4e7e36abde6b3b089fc4835b5c339370287935af6bd53998bed4e399eda1136d", - "0x96f18ec03ae47c205cc4242ca58e2eff185c9dca86d5158817e2e5dc2207ab84aadda78725f8dc080a231efdc093b940", - "0x97de1ab6c6cc646ae60cf7b86df73b9cf56cc0cd1f31b966951ebf79fc153531af55ca643b20b773daa7cab784b832f7", - "0x870ba266a9bfa86ef644b1ef025a0f1b7609a60de170fe9508de8fd53170c0b48adb37f19397ee8019b041ce29a16576", - "0xad990e888d279ac4e8db90619d663d5ae027f994a3992c2fbc7d262b5990ae8a243e19157f3565671d1cb0de17fe6e55", - "0x8d9d5adcdd94c5ba3be4d9a7428133b42e485f040a28d16ee2384758e87d35528f7f9868de9bd23d1a42a594ce50a567", - "0x85a33ed75d514ece6ad78440e42f7fcdb59b6f4cff821188236d20edae9050b3a042ce9bc7d2054296e133d033e45022", - "0x92afd2f49a124aaba90de59be85ff269457f982b54c91b06650c1b8055f9b4b0640fd378df02a00e4fc91f7d226ab980", - "0x8c0ee09ec64bd831e544785e3d65418fe83ed9c920d9bb4d0bf6dd162c1264eb9d6652d2def0722e223915615931581c", - "0x8369bedfa17b24e9ad48ebd9c5afea4b66b3296d5770e09b00446c5b0a8a373d39d300780c01dcc1c6752792bccf5fd0", - "0x8b9e960782576a59b2eb2250d346030daa50bbbec114e95cdb9e4b1ba18c3d34525ae388f859708131984976ca439d94", - "0xb682bface862008fea2b5a07812ca6a28a58fd151a1d54c708fc2f8572916e0d678a9cb8dc1c10c0470025c8a605249e", - "0xa38d5e189bea540a824b36815fc41e3750760a52be0862c4cac68214febdc1a754fb194a7415a8fb7f96f6836196d82a", - "0xb9e7fbda650f18c7eb8b40e42cc42273a7298e65e8be524292369581861075c55299ce69309710e5b843cb884de171bd", - "0xb6657e5e31b3193874a1bace08f42faccbd3c502fb73ad87d15d18a1b6c2a146f1baa929e6f517db390a5a47b66c0acf", - "0xae15487312f84ed6265e4c28327d24a8a0f4d2d17d4a5b7c29b974139cf93223435aaebe3af918f5b4bb20911799715f", - "0x8bb4608beb06bc394e1a70739b872ce5a2a3ffc98c7547bf2698c893ca399d6c13686f6663f483894bccaabc3b9c56ad", - "0xb58ac36bc6847077584308d952c5f3663e3001af5ecf2e19cb162e1c58bd6c49510205d453cffc876ca1dc6b8e04a578", - "0x924f65ced61266a79a671ffb49b300f0ea44c50a0b4e3b02064faa99fcc3e4f6061ea8f38168ab118c5d47bd7804590e", - "0x8d67d43b8a06b0ff4fafd7f0483fa9ed1a9e3e658a03fb49d9d9b74e2e24858dc1bed065c12392037b467f255d4e5643", - "0xb4d4f87813125a6b355e4519a81657fa97c43a6115817b819a6caf4823f1d6a1169683fd68f8d025cdfa40ebf3069acb", - "0xa7fd4d2c8e7b59b8eed3d4332ae94b77a89a2616347402f880bc81bde072220131e6dbec8a605be3a1c760b775375879", - "0x8d4a7d8fa6f55a30df37bcf74952e2fa4fd6676a2e4606185cf154bdd84643fd01619f8fb8813a564f72e3f574f8ce30", - "0x8086fb88e6260e9a9c42e9560fde76315ff5e5680ec7140f2a18438f15bc2cc7d7d43bfb5880b180b738c20a834e6134", - "0x916c4c54721de03934fee6f43de50bb04c81f6f8dd4f6781e159e71c40c60408aa54251d457369d133d4ba3ed7c12cb4", - "0x902e5bf468f11ed9954e2a4a595c27e34abe512f1d6dc08bbca1c2441063f9af3dc5a8075ab910a10ff6c05c1c644a35", - "0xa1302953015e164bf4c15f7d4d35e3633425a78294406b861675667eec77765ff88472306531e5d3a4ec0a2ff0dd6a9e", - "0x87874461df3c9aa6c0fa91325576c0590f367075f2f0ecfeb34afe162c04c14f8ce9d608c37ac1adc8b9985bc036e366", - "0x84b50a8a61d3cc609bfb0417348133e698fe09a6d37357ce3358de189efcf35773d78c57635c2d26c3542b13cc371752", - "0xacaed2cff8633d12c1d12bb7270c54d65b0b0733ab084fd47f81d0a6e1e9b6f300e615e79538239e6160c566d8bb8d29", - "0x889e6a0e136372ca4bac90d1ab220d4e1cad425a710e8cdd48b400b73bb8137291ceb36a39440fa84305783b1d42c72f", - "0x90952e5becec45b2b73719c228429a2c364991cf1d5a9d6845ae5b38018c2626f4308daa322cab1c72e0f6c621bb2b35", - "0x8f5a97a801b6e9dcd66ccb80d337562c96f7914e7169e8ff0fda71534054c64bf2a9493bb830623d612cfe998789be65", - "0x84f3df8b9847dcf1d63ca470dc623154898f83c25a6983e9b78c6d2d90a97bf5e622445be835f32c1e55e6a0a562ea78", - "0x91d12095cd7a88e7f57f254f02fdb1a1ab18984871dead2f107404bcf8069fe68258c4e6f6ebd2477bddf738135400bb", - "0xb771a28bc04baef68604d4723791d3712f82b5e4fe316d7adc2fc01b935d8e644c06d59b83bcb542afc40ebafbee0683", - "0x872f6341476e387604a7e93ae6d6117e72d164e38ebc2b825bc6df4fcce815004d7516423c190c1575946b5de438c08d", - "0x90d6b4aa7d40a020cdcd04e8b016d041795961a8e532a0e1f4041252131089114a251791bf57794cadb7d636342f5d1c", - "0x899023ba6096a181448d927fed7a0fe858be4eac4082a42e30b3050ee065278d72fa9b9d5ce3bc1372d4cbd30a2f2976", - "0xa28f176571e1a9124f95973f414d5bdbf5794d41c3839d8b917100902ac4e2171eb940431236cec93928a60a77ede793", - "0x838dbe5bcd29c4e465d02350270fa0036cd46f8730b13d91e77afb7f5ed16525d0021d3b2ae173a76c378516a903e0cb", - "0x8e105d012dd3f5d20f0f1c4a7e7f09f0fdd74ce554c3032e48da8cce0a77260d7d47a454851387770f5c256fa29bcb88", - "0x8f4df0f9feeb7a487e1d138d13ea961459a6402fd8f8cabb226a92249a0d04ded5971f3242b9f90d08da5ff66da28af6", - "0xad1cfda4f2122a20935aa32fb17c536a3653a18617a65c6836700b5537122af5a8206befe9eaea781c1244c43778e7f1", - "0x832c6f01d6571964ea383292efc8c8fa11e61c0634a25fa180737cc7ab57bc77f25e614aac9a2a03d98f27b3c1c29de2", - "0x903f89cc13ec6685ac7728521898781fecb300e9094ef913d530bf875c18bcc3ceed7ed51e7b482d45619ab4b025c2e9", - "0xa03c474bb915aad94f171e8d96f46abb2a19c9470601f4c915512ec8b9e743c3938450a2a5b077b4618b9df8809e1dc1", - "0x83536c8456f306045a5f38ae4be2e350878fa7e164ea408d467f8c3bc4c2ee396bd5868008c089183868e4dfad7aa50b", - "0x88f26b4ea1b236cb326cd7ad7e2517ec8c4919598691474fe15d09cabcfc37a8d8b1b818f4d112432ee3a716b0f37871", - "0xa44324e3fe96e9c12b40ded4f0f3397c8c7ee8ff5e96441118d8a6bfad712d3ac990b2a6a23231a8f691491ac1fd480f", - "0xb0de4693b4b9f932191a21ee88629964878680152a82996c0019ffc39f8d9369bbe2fe5844b68d6d9589ace54af947e4", - "0x8e5d8ba948aea5fd26035351a960e87f0d23efddd8e13236cc8e4545a3dda2e9a85e6521efb8577e03772d3637d213d9", - "0x93efc82d2017e9c57834a1246463e64774e56183bb247c8fc9dd98c56817e878d97b05f5c8d900acf1fbbbca6f146556", - "0x8731176363ad7658a2862426ee47a5dce9434216cef60e6045fa57c40bb3ce1e78dac4510ae40f1f31db5967022ced32", - "0xb10c9a96745722c85bdb1a693100104d560433d45b9ac4add54c7646a7310d8e9b3ca9abd1039d473ae768a18e489845", - "0xa2ac374dfbb464bf850b4a2caf15b112634a6428e8395f9c9243baefd2452b4b4c61b0cb2836d8eae2d57d4900bf407e", - "0xb69fe3ded0c4f5d44a09a0e0f398221b6d1bf5dbb8bc4e338b93c64f1a3cac1e4b5f73c2b8117158030ec03787f4b452", - "0x8852cdbaf7d0447a8c6f211b4830711b3b5c105c0f316e3a6a18dcfbb9be08bd6f4e5c8ae0c3692da08a2dfa532f9d5c", - "0x93bbf6d7432a7d98ade3f94b57bf9f4da9bc221a180a370b113066dd42601bb9e09edd79e2e6e04e00423399339eebda", - "0xa80941c391f1eeafc1451c59e4775d6a383946ff22997aeaadf806542ba451d3b0f0c6864eeba954174a296efe2c1550", - "0xa045fe2bb011c2a2f71a0181a8f457a3078470fb74c628eab8b59aef69ffd0d649723bf74d6885af3f028bc5a104fb39", - "0xb9d8c35911009c4c8cad64692139bf3fc16b78f5a19980790cb6a7aea650a25df4231a4437ae0c351676a7e42c16134f", - "0x94c79501ded0cfcbab99e1841abe4a00a0252b3870e20774c3da16c982d74c501916ec28304e71194845be6e3113c7ab", - "0x900a66418b082a24c6348d8644ddb1817df5b25cb33044a519ef47cc8e1f7f1e38d2465b7b96d32ed472d2d17f8414c6", - "0xb26f45d393b8b2fcb29bdbb16323dc7f4b81c09618519ab3a39f8ee5bd148d0d9f3c0b5dfab55b5ce14a1cb9206d777b", - "0xaa1a87735fc493a80a96a9a57ca40a6d9c32702bfcaa9869ce1a116ae65d69cefe2f3e79a12454b4590353e96f8912b4", - "0xa922b188d3d0b69b4e4ea2a2aa076566962844637da12c0832105d7b31dea4a309eee15d12b7a336be3ea36fcbd3e3b7", - "0x8f3841fcf4105131d8c4d9885e6e11a46c448226401cf99356c291fadb864da9fa9d30f3a73c327f23f9fd99a11d633e", - "0x9791d1183fae270e226379af6c497e7da803ea854bb20afa74b253239b744c15f670ee808f708ede873e78d79a626c9a", - "0xa4cad52e3369491ada61bf28ada9e85de4516d21c882e5f1cd845bea9c06e0b2887b0c5527fcff6fc28acd3c04f0a796", - "0xb9ac86a900899603452bd11a7892a9bfed8054970bfcbeaa8c9d1930db891169e38d6977f5258c25734f96c8462eee3b", - "0xa3a154c28e5580656a859f4efc2f5ebfa7eaa84ca40e3f134fa7865e8581586db74992dbfa4036aa252fba103773ddde", - "0x95cc2a0c1885a029e094f5d737e3ecf4d26b99036453a8773c77e360101f9f98676ee246f6f732a377a996702d55691f", - "0x842651bbe99720438d8d4b0218feb60481280c05beb17750e9ca0d8c0599a60f873b7fbdcc7d8835ba9a6d57b16eec03", - "0x81ee54699da98f5620307893dcea8f64670609fa20e5622265d66283adeac122d458b3308c5898e6c57c298db2c8b24f", - "0xb97868b0b2bc98032d68352a535a1b341b9ff3c7af4e3a7f3ebc82d3419daa1b5859d6aedc39994939623c7cd878bd9b", - "0xb60325cd5d36461d07ef253d826f37f9ee6474a760f2fff80f9873d01fd2b57711543cdc8d7afa1c350aa753c2e33dea", - "0x8c205326c11d25a46717b780c639d89714c7736c974ae71287e3f4b02e6605ac2d9b4928967b1684f12be040b7bf2dd3", - "0x95a392d82db51e26ade6c2ccd3396d7e40aff68fa570b5951466580d6e56dda51775dce5cf3a74a7f28c3cb2eb551c4d", - "0x8f2cc8071eb56dffb70bda6dd433b556221dc8bba21c53353c865f00e7d4d86c9e39f119ea9a8a12ef583e9a55d9a6b6", - "0x9449a71af9672aaf8856896d7e3d788b22991a7103f75b08c0abbcc2bfe60fda4ed8ce502cea4511ff0ea52a93e81222", - "0x857090ab9fdb7d59632d068f3cc8cf27e61f0d8322d30e6b38e780a1f05227199b4cd746aac1311c36c659ef20931f28", - "0x98a891f4973e7d9aaf9ac70854608d4f7493dffc7e0987d7be9dd6029f6ea5636d24ef3a83205615ca1ff403750058e1", - "0xa486e1365bbc278dd66a2a25d258dc82f46b911103cb16aab3945b9c95ae87b386313a12b566df5b22322ede0afe25ad", - "0xa9a1eb399ed95d396dccd8d1ac718043446f8b979ec62bdce51c617c97a312f01376ab7fb87d27034e5f5570797b3c33", - "0xb7abc3858d7a74bb446218d2f5a037e0fae11871ed9caf44b29b69c500c1fa1dcfad64c9cdccc9d80d5e584f06213deb", - "0x8cfb09fe2e202faa4cebad932b1d35f5ca204e1c2a0c740a57812ac9a6792130d1312aabd9e9d4c58ca168bfebd4c177", - "0xa90a305c2cd0f184787c6be596fa67f436afd1f9b93f30e875f817ac2aae8bdd2e6e656f6be809467e6b3ad84adb86b1", - "0x80a9ef993c2b009ae172cc8f7ec036f5734cf4f4dfa06a7db4d54725e7fbfae5e3bc6f22687bdbb6961939d6f0c87537", - "0x848ade1901931e72b955d7db1893f07003e1708ff5d93174bac5930b9a732640f0578839203e9b77eb27965c700032d3", - "0x93fdf4697609c5ae9c33b9ca2f5f1af44abeb2b98dc4fdf732cf7388de086f410730dc384d9b7a7f447bb009653c8381", - "0x89ce3fb805aea618b5715c0d22a9f46da696b6fa86794f56fdf1d44155a33d42daf1920bcbe36cbacf3cf4c92df9cbc7", - "0x829ce2c342cf82aa469c65f724f308f7a750bd1494adc264609cd790c8718b8b25b5cab5858cf4ee2f8f651d569eea67", - "0xaf2f0cee7bf413204be8b9df59b9e4991bc9009e0d6dbe6815181df0ec2ca93ab8f4f3135b1c14d8f53d74bff0bd6f27", - "0xb87998cecf7b88cde93d1779f10a521edd5574a2fbd240102978639ec57433ba08cdb53849038a329cebbe74657268d2", - "0xa64542a1261a6ed3d720c2c3a802303aad8c4c110c95d0f12e05c1065e66f42da494792b6bfc5b9272363f3b1d457f58", - "0x86a6fd042e4f282fadf07a4bfee03fc96a3aea49f7a00f52bf249a20f1ec892326855410e61f37fbb27d9305eb2fc713", - "0x967ea5bc403b6db269682f7fd0df90659350d7e1aa66bc4fab4c9dfcd75ed0bba4b52f1cebc5f34dc8ba810793727629", - "0xa52990f9f3b8616ce3cdc2c74cd195029e6a969753dcf2d1630438700e7d6ebde36538532b3525ac516f5f2ce9dd27a3", - "0xa64f7ff870bab4a8bf0d4ef6f5c744e9bf1021ed08b4c80903c7ad318e80ba1817c3180cc45cb5a1cae1170f0241655f", - "0xb00f706fa4de1f663f021e8ad3d155e84ce6084a409374b6e6cd0f924a0a0b51bebaaaf1d228c77233a73b0a5a0df0e9", - "0x8b882cc3bff3e42babdb96df95fb780faded84887a0a9bab896bef371cdcf169d909f5658649e93006aa3c6e1146d62e", - "0x9332663ef1d1dcf805c3d0e4ce7a07d9863fb1731172e766b3cde030bf81682cc011e26b773fb9c68e0477b4ae2cfb79", - "0xa8aa8151348dbd4ef40aaeb699b71b4c4bfd3218560c120d85036d14f678f6736f0ec68e80ce1459d3d35feccc575164", - "0xa16cd8b729768f51881c213434aa28301fa78fcb554ddd5f9012ee1e4eae7b5cb3dd88d269d53146dea92d10790faf0b", - "0x86844f0ef9d37142faf3b1e196e44fbe280a3ba4189aa05c356778cb9e3b388a2bff95eed305ada8769935c9974e4c57", - "0xae2eec6b328fccf3b47bcdac32901ac2744a51beb410b04c81dea34dee4912b619466a4f5e2780d87ecefaebbe77b46d", - "0x915df4c38d301c8a4eb2dc5b1ba0ffaad67cbb177e0a80095614e9c711f4ef24a4cef133f9d982a63d2a943ba6c8669d", - "0xae6a2a4dedfc2d1811711a8946991fede972fdf2a389b282471280737536ffc0ac3a6d885b1f8bda0366eb0b229b9979", - "0xa9b628c63d08b8aba6b1317f6e91c34b2382a6c85376e8ef2410a463c6796740ae936fc4e9e0737cb9455d1daa287bd8", - "0x848e30bf7edf2546670b390d5cf9ab71f98fcb6add3c0b582cb34996c26a446dee5d1bde4fdcde4fc80c10936e117b29", - "0x907d6096c7c8c087d1808dd995d5d2b9169b3768c3f433475b50c2e2bd4b082f4d543afd8b0b0ddffa9c66222a72d51d", - "0xa59970a2493b07339124d763ac9d793c60a03354539ecbcf6035bc43d1ea6e35718202ae6d7060b7d388f483d971573c", - "0xb9cfef2af9681b2318f119d8611ff6d9485a68d8044581b1959ab1840cbca576dbb53eec17863d2149966e9feb21122f", - "0xad47271806161f61d3afa45cdfe2babceef5e90031a21779f83dc8562e6076680525b4970b2f11fe9b2b23c382768323", - "0x8e425a99b71677b04fe044625d338811fbb8ee32368a424f6ab2381c52e86ee7a6cecedf777dc97181519d41c351bc22", - "0x86b55b54d7adefc12954a9252ee23ae83efe8b5b4b9a7dc307904413e5d69868c7087a818b2833f9b004213d629be8ad", - "0xa14fda6b93923dd11e564ae4457a66f397741527166e0b16a8eb91c6701c244fd1c4b63f9dd3515193ec88fa6c266b35", - "0xa9b17c36ae6cd85a0ed7f6cabc5b47dc8f80ced605db327c47826476dc1fb8f8669aa7a7dc679fbd4ee3d8e8b4bd6a6f", - "0x82a0829469c1458d959c821148f15dacae9ea94bf56c59a6ab2d4dd8b3d16d73e313b5a3912a6c1f131d73a8f06730c4", - "0xb22d56d549a53eaef549595924bdb621ff807aa4513feedf3fdcbf7ba8b6b9cfa4481c2f67fc642db397a6b794a8b63a", - "0x974c59c24392e2cb9294006cbe3c52163e255f3bd0c2b457bdc68a6338e6d5b6f87f716854492f8d880a6b896ccf757c", - "0xb70d247ba7cad97c50b57f526c2ba915786e926a94e8f8c3eebc2e1be6f4255411b9670e382060049c8f4184302c40b2", - "0xad80201fe75ef21c3ddbd98cf23591e0d7a3ba1036dfe77785c32f44755a212c31f0ceb0a0b6f5ee9b6dc81f358d30c3", - "0x8c656e841f9bb90b9a42d425251f3fdbc022a604d75f5845f479ed4be23e02aaf9e6e56cde351dd7449c50574818a199", - "0x8b88dd3fa209d3063b7c5b058f7249ee9900fbc2287d16da61a0704a0a1d71e45d9c96e1cda7fdf9654534ec44558b22", - "0x961da00cc8750bd84d253c08f011970ae1b1158ad6778e8ed943d547bceaf52d6d5a212a7de3bf2706688c4389b827d2", - "0xa5dd379922549a956033e3d51a986a4b1508e575042b8eaa1df007aa77cf0b8c2ab23212f9c075702788fa9c53696133", - "0xac8fcfde3a349d1e93fc8cf450814e842005c545c4844c0401bc80e6b96cdb77f29285a14455e167c191d4f312e866cd", - "0xac63d79c799783a8466617030c59dd5a8f92ee6c5204676fd8d881ce5f7f8663bdbeb0379e480ea9b6340ab0dc88e574", - "0x805874fde19ce359041ae2bd52a39e2841acabfd31f965792f2737d7137f36d4e4722ede8340d8c95afa6af278af8acb", - "0x8d2f323a228aa8ba7b7dc1399138f9e6b41df1a16a7069003ab8104b8b68506a45141bc5fe66acf430e23e13a545190b", - "0xa1610c721a2d9af882bb6b39bea97cff1527a3aea041d25934de080214ae77c959e79957164440686d15ab301e897d4d", - "0xaba16d29a47fc36f12b654fde513896723e2c700c4190f11b26aa4011da57737ad717daa02794aa3246e4ae5f0b0cc3a", - "0xa406db2f15fdd135f346cc4846623c47edd195e80ba8c7cb447332095314d565e4040694ca924696bb5ee7f8996ea0ba", - "0x8b30e2cd9b47d75ba57b83630e40f832249af6c058d4f490416562af451993eec46f3e1f90bc4d389e4c06abd1b32a46", - "0xaacf9eb7036e248e209adbfc3dd7ce386569ea9b312caa4b240726549db3c68c4f1c8cbf8ed5ea9ea60c7e57c9df3b8e", - "0xb20fcac63bf6f5ee638a42d7f89be847f348c085ddcbec3fa318f4323592d136c230495f188ef2022aa355cc2b0da6f9", - "0x811eff750456a79ec1b1249d76d7c1547065b839d8d4aaad860f6d4528eb5b669473dcceeeea676cddbc3980b68461b7", - "0xb52d14ae33f4ab422f953392ae76a19c618cc31afc96290bd3fe2fb44c954b5c92c4789f3f16e8793f2c0c1691ade444", - "0xa7826dafeeba0db5b66c4dfcf2b17fd7b40507a5a53ac2e42942633a2cb30b95ba1739a6e9f3b7a0e0f1ec729bf274e2", - "0x8acfd83ddf7c60dd7c8b20c706a3b972c65d336b8f9b3d907bdd8926ced271430479448100050b1ef17578a49c8fa616", - "0xaf0c69f65184bb06868029ad46f8465d75c36814c621ac20a5c0b06a900d59305584f5a6709683d9c0e4b6cd08d650a6", - "0xb6cc8588191e00680ee6c3339bd0f0a17ad8fd7f4be57d5d7075bede0ea593a19e67f3d7c1a20114894ee5bfcab71063", - "0xa82fd4f58635129dbb6cc3eb9391cf2d28400018b105fc41500fbbd12bd890b918f97d3d359c29dd3b4c4e34391dfab0", - "0x92fc544ed65b4a3625cf03c41ddff7c039bc22d22c0d59dcc00efd5438401f2606adb125a1d5de294cca216ec8ac35a3", - "0x906f67e4a32582b71f15940523c0c7ce370336935e2646bdaea16a06995256d25e99df57297e39d6c39535e180456407", - "0x97510337ea5bbd5977287339197db55c60533b2ec35c94d0a460a416ae9f60e85cee39be82abeeacd5813cf54df05862", - "0x87e6894643815c0ea48cb96c607266c5ee4f1f82ba5fe352fb77f9b6ed14bfc2b8e09e80a99ac9047dfcf62b2ae26795", - "0xb6fd55dd156622ad7d5d51b7dde75e47bd052d4e542dd6449e72411f68275775c846dde301e84613312be8c7bce58b07", - "0xb98461ac71f554b2f03a94e429b255af89eec917e208a8e60edf5fc43b65f1d17a20de3f31d2ce9f0cb573c25f2f4d98", - "0x96f0dea40ca61cefbee41c4e1fe9a7d81fbe1f49bb153d083ab70f5d0488a1f717fd28cedcf6aa18d07cce2c62801898", - "0x8d7c3ab310184f7dc34b6ce4684e4d29a31e77b09940448ea4daac730b7eb308063125d4dd229046cf11bfd521b771e0", - "0x96f0564898fe96687918bbf0a6adead99cf72e3a35ea3347e124af9d006221f8e82e5a9d2fe80094d5e8d48e610f415e", - "0xad50fcb92c2675a398cf07d4c40a579e44bf8d35f27cc330b57e54d5ea59f7d898af0f75dccfe3726e5471133d70f92b", - "0x828beed62020361689ae7481dd8f116902b522fb0c6c122678e7f949fdef70ead011e0e6bffd25678e388744e17cdb69", - "0x8349decac1ca16599eee2efc95bcaabf67631107da1d34a2f917884bd70dfec9b4b08ab7bc4379d6c73b19c0b6e54fb8", - "0xb2a6a2e50230c05613ace9e58bb2e98d94127f196f02d9dddc53c43fc68c184549ca12d713cb1b025d8260a41e947155", - "0x94ff52181aadae832aed52fc3b7794536e2a31a21fc8be3ea312ca5c695750d37f08002f286b33f4023dba1e3253ecfa", - "0xa21d56153c7e5972ee9a319501be4faff199fdf09bb821ea9ce64aa815289676c00f105e6f00311b3a5b627091b0d0fc", - "0xa27a60d219f1f0c971db73a7f563b371b5c9fc3ed1f72883b2eac8a0df6698400c9954f4ca17d7e94e44bd4f95532afb", - "0xa2fc56fae99b1f18ba5e4fe838402164ce82f8a7f3193d0bbd360c2bac07c46f9330c4c7681ffb47074c6f81ee6e7ac6", - "0xb748e530cd3afb96d879b83e89c9f1a444f54e55372ab1dcd46a0872f95ce8f49cf2363fc61be82259e04f555937ed16", - "0x8bf8993e81080c7cbba1e14a798504af1e4950b2f186ab3335b771d6acaee4ffe92131ae9c53d74379d957cb6344d9cd", - "0x96774d0ef730d22d7ab6d9fb7f90b9ead44285219d076584a901960542756700a2a1603cdf72be4708b267200f6c36a9", - "0xb47703c2ab17be1e823cc7bf3460db1d6760c0e33862c90ca058845b2ff234b0f9834ddba2efb2ee1770eb261e7d8ffd", - "0x84319e67c37a9581f8b09b5e4d4ae88d0a7fb4cbb6908971ab5be28070c3830f040b1de83ee663c573e0f2f6198640e4", - "0x96811875fa83133e0b3c0e0290f9e0e28bca6178b77fdf5350eb19344d453dbd0d71e55a0ef749025a5a2ca0ad251e81", - "0x81a423423e9438343879f2bfd7ee9f1c74ebebe7ce3cfffc8a11da6f040cc4145c3b527bd3cf63f9137e714dbcb474ef", - "0xb8c3535701ddbeec2db08e17a4fa99ba6752d32ece5331a0b8743676f421fcb14798afc7c783815484f14693d2f70db8", - "0x81aee980c876949bf40782835eec8817d535f6f3f7e00bf402ddd61101fdcd60173961ae90a1cf7c5d060339a18c959d", - "0x87e67b928d97b62c49dac321ce6cb680233f3a394d4c9a899ac2e8db8ccd8e00418e66cdfd68691aa3cb8559723b580c", - "0x8eac204208d99a2b738648df96353bbb1b1065e33ee4f6bba174b540bbbd37d205855e1f1e69a6b7ff043ca377651126", - "0x848e6e7a54ad64d18009300b93ea6f459ce855971dddb419b101f5ac4c159215626fadc20cc3b9ab1701d8f6dfaddd8b", - "0x88aa123d9e0cf309d46dddb6acf634b1ade3b090a2826d6e5e78669fa1220d6df9a6697d7778cd9b627db17eea846126", - "0x9200c2a629b9144d88a61151b661b6c4256cc5dadfd1e59a8ce17a013c2d8f7e754aabe61663c3b30f1bc47784c1f8cf", - "0xb6e1a2827c3bdda91715b0e1b1f10dd363cef337e7c80cac1f34165fc0dea7c8b69747e310563db5818390146ce3e231", - "0x92c333e694f89f0d306d54105b2a5dcc912dbe7654d9e733edab12e8537350815be472b063e56cfde5286df8922fdecb", - "0xa6fac04b6d86091158ebb286586ccfec2a95c9786e14d91a9c743f5f05546073e5e3cc717635a0c602cad8334e922346", - "0xa581b4af77feebc1fb897d49b5b507c6ad513d8f09b273328efbb24ef0d91eb740d01b4d398f2738125dacfe550330cd", - "0x81c4860cccf76a34f8a2bc3f464b7bfd3e909e975cce0d28979f457738a56e60a4af8e68a3992cf273b5946e8d7f76e2", - "0x8d1eaa09a3180d8af1cbaee673db5223363cc7229a69565f592fa38ba0f9d582cedf91e15dabd06ebbf2862fc0feba54", - "0x9832f49b0147f4552402e54593cfa51f99540bffada12759b71fcb86734be8e500eea2d8b3d036710bdf04c901432de9", - "0x8bdb0e8ec93b11e5718e8c13cb4f5de545d24829fd76161216340108098dfe5148ed25e3b57a89a516f09fa79043734d", - "0xab96f06c4b9b0b2c0571740b24fca758e6976315053a7ecb20119150a9fa416db2d3a2e0f8168b390bb063f0c1caf785", - "0xab777f5c52acd62ecf4d1f168b9cc8e1a9b45d4ec6a8ff52c583e867c2239aba98d7d3af977289b367edce03d9c2dfb1", - "0xa09d3ce5e748da84802436951acc3d3ea5d8ec1d6933505ed724d6b4b0d69973ab0930daec9c6606960f6e541e4a3ce2", - "0x8ef94f7be4d85d5ad3d779a5cf4d7b2fc3e65c52fb8e1c3c112509a4af77a0b5be994f251e5e40fabeeb1f7d5615c22b", - "0xa7406a5bf5708d9e10922d3c5c45c03ef891b8d0d74ec9f28328a72be4cdc05b4f2703fa99366426659dfca25d007535", - "0xb7f52709669bf92a2e070bfe740f422f0b7127392c5589c7f0af71bb5a8428697c762d3c0d74532899da24ea7d8695c2", - "0xb9dfb0c8df84104dbf9239ccefa4672ef95ddabb8801b74997935d1b81a78a6a5669a3c553767ec19a1281f6e570f4ff", - "0xae4d5c872156061ce9195ac640190d8d71dd406055ee43ffa6f9893eb24b870075b74c94d65bc1d5a07a6573282b5520", - "0xafe6bd3eb72266d333f1807164900dcfa02a7eb5b1744bb3c86b34b3ee91e3f05e38fa52a50dc64eeb4bdb1dd62874b8", - "0x948043cf1bc2ef3c01105f6a78dc06487f57548a3e6ef30e6ebc51c94b71e4bf3ff6d0058c72b6f3ecc37efd7c7fa8c0", - "0xa22fd17c2f7ffe552bb0f23fa135584e8d2d8d75e3f742d94d04aded2a79e22a00dfe7acbb57d44e1cdb962fb22ae170", - "0x8cd0f4e9e4fb4a37c02c1bde0f69359c43ab012eb662d346487be0c3758293f1ca560122b059b091fddce626383c3a8f", - "0x90499e45f5b9c81426f3d735a52a564cafbed72711d9279fdd88de8038e953bc48c57b58cba85c3b2e4ce56f1ddb0e11", - "0x8c30e4c034c02958384564cac4f85022ef36ab5697a3d2feaf6bf105049675bbf23d01b4b6814711d3d9271abff04cac", - "0x81f7999e7eeea30f3e1075e6780bbf054f2fb6f27628a2afa4d41872a385b4216dd5f549da7ce6cf39049b2251f27fb7", - "0xb36a7191f82fc39c283ffe53fc1f5a9a00b4c64eee7792a8443475da9a4d226cf257f226ea9d66e329af15d8f04984ec", - "0xaad4da528fdbb4db504f3041c747455baff5fcd459a2efd78f15bdf3aea0bdb808343e49df88fe7a7c8620009b7964a3", - "0x99ebd8c6dd5dd299517fb6381cfc2a7f443e6e04a351440260dd7c2aee3f1d8ef06eb6c18820b394366ecdfd2a3ce264", - "0x8873725b81871db72e4ec3643084b1cdce3cbf80b40b834b092767728605825c19b6847ad3dcf328438607e8f88b4410", - "0xb008ee2f895daa6abd35bd39b6f7901ae4611a11a3271194e19da1cdcc7f1e1ea008fe5c5440e50d2c273784541ad9c5", - "0x9036feafb4218d1f576ef89d0e99124e45dacaa6d816988e34d80f454d10e96809791d5b78f7fd65f569e90d4d7238c5", - "0x92073c1d11b168e4fa50988b0288638b4868e48bbc668c5a6dddf5499875d53be23a285acb5e4bad60114f6cf6c556e9", - "0x88c87dfcb8ba6cbfe7e1be081ccfadbd589301db2cb7c99f9ee5d7db90aa297ed1538d5a867678a763f2deede5fd219a", - "0xb42a562805c661a50f5dea63108002c0f27c0da113da6a9864c9feb5552225417c0356c4209e8e012d9bcc9d182c7611", - "0x8e6317d00a504e3b79cd47feb4c60f9df186467fe9ca0f35b55c0364db30528f5ff071109dabb2fc80bb9cd4949f0c24", - "0xb7b1ea6a88694f8d2f539e52a47466695e39e43a5eb9c6f23bca15305fe52939d8755cc3ac9d6725e60f82f994a3772f", - "0xa3cd55161befe795af93a38d33290fb642b8d80da8b786c6e6fb02d393ea308fbe87f486994039cbd7c7b390414594b6", - "0xb416d2d45b44ead3b1424e92c73c2cf510801897b05d1724ff31cbd741920cd858282fb5d6040fe1f0aa97a65bc49424", - "0x950ee01291754feace97c2e933e4681e7ddfbc4fcd079eb6ff830b0e481d929c93d0c7fb479c9939c28ca1945c40da09", - "0x869bd916aee8d86efe362a49010382674825d49195b413b4b4018e88ce43fe091b475d0b863ff0ba2259400f280c2b23", - "0x9782f38cd9c9d3385ec286ebbc7cba5b718d2e65a5890b0a5906b10a89dc8ed80d417d71d7c213bf52f2af1a1f513ea7", - "0x91cd33bc2628d096269b23faf47ee15e14cb7fdc6a8e3a98b55e1031ea0b68d10ba30d97e660f7e967d24436d40fad73", - "0x8becc978129cc96737034c577ae7225372dd855da8811ae4e46328e020c803833b5bdbc4a20a93270e2b8bd1a2feae52", - "0xa36b1d8076783a9522476ce17f799d78008967728ce920531fdaf88303321bcaf97ecaa08e0c01f77bc32e53c5f09525", - "0xb4720e744943f70467983aa34499e76de6d59aa6fadf86f6b787fdce32a2f5b535b55db38fe2da95825c51002cfe142d", - "0x91ad21fc502eda3945f6de874d1b6bf9a9a7711f4d61354f9e5634fc73f9c06ada848de15ab0a75811d3250be862827d", - "0x84f78e2ebf5fc077d78635f981712daf17e2475e14c2a96d187913006ad69e234746184a51a06ef510c9455b38acb0d7", - "0x960aa7906e9a2f11db64a26b5892ac45f20d2ccb5480f4888d89973beb6fa0dfdc06d68d241ff5ffc7f1b82b1aac242d", - "0xa99365dcd1a00c66c9db6924b97c920f5c723380e823b250db85c07631b320ec4e92e586f7319e67a522a0578f7b6d6c", - "0xa25d92d7f70cf6a88ff317cfec071e13774516da664f5fac0d4ecaa65b8bf4eb87a64a4d5ef2bd97dfae98d388dbf5cc", - "0xa7af47cd0041295798f9779020a44653007444e8b4ef0712982b06d0dcdd434ec4e1f7c5f7a049326602cb605c9105b7", - "0xaefe172eac5568369a05980931cc476bebd9dea573ba276d59b9d8c4420784299df5a910033b7e324a6c2dfc62e3ef05", - "0xb69bc9d22ffa645baa55e3e02522e9892bb2daa7fff7c15846f13517d0799766883ee09ae0869df4139150c5b843ca8a", - "0x95a10856140e493354fdd12722c7fdded21b6a2ffbc78aa2697104af8ad0c8e2206f44b0bfee077ef3949d46bbf7c16b", - "0x891f2fcd2c47cbea36b7fa715968540c233313f05333f09d29aba23c193f462ed490dd4d00969656e89c53155fdfe710", - "0xa6c33e18115e64e385c843dde34e8a228222795c7ca90bc2cc085705d609025f3351d9be61822c69035a49fb3e48f2d5", - "0xb87fb12f12c0533b005adad0487f03393ff682e13575e3cb57280c3873b2c38ba96a63c49eef7a442753d26b7005230b", - "0xb905c02ba451bfd411c135036d92c27af3b0b1c9c2f1309d6948544a264b125f39dd41afeff4666b12146c545adc168a", - "0x8b29c513f43a78951cf742231cf5457a6d9d55edf45df5481a0f299a418d94effef561b15d2c1a01d1b8067e7153fda9", - "0xb9941cccd51dc645920d2781c81a317e5a33cb7cf76427b60396735912cb6d2ca9292bb4d36b6392467d390d2c58d9f3", - "0xa8546b627c76b6ef5c93c6a98538d8593dbe21cb7673fd383d5401b0c935eea0bdeeefeb1af6ad41bad8464fb87bbc48", - "0xaa286b27de2812de63108a1aec29d171775b69538dc6198640ac1e96767c2b83a50391f49259195957d457b493b667c9", - "0xa932fb229f641e9abbd8eb2bd874015d97b6658ab6d29769fc23b7db9e41dd4f850382d4c1f08af8f156c5937d524473", - "0xa1412840fcc86e2aeec175526f2fb36e8b3b8d21a78412b7266daf81e51b3f68584ed8bd42a66a43afdd8c297b320520", - "0x89c78be9efb624c97ebca4fe04c7704fa52311d183ffd87737f76b7dadc187c12c982bd8e9ed7cd8beb48cdaafd2fd01", - "0xa3f5ddec412a5bec0ce15e3bcb41c6214c2b05d4e9135a0d33c8e50a78eaba71e0a5a6ea8b45854dec5c2ed300971fc2", - "0x9721f9cec7a68b7758e3887548790de49fa6a442d0396739efa20c2f50352a7f91d300867556d11a703866def2d5f7b5", - "0xa23764e140a87e5991573521af039630dd28128bf56eed2edbed130fd4278e090b60cf5a1dca9de2910603d44b9f6d45", - "0xa1a6494a994215e48ab55c70efa8ffdddce6e92403c38ae7e8dd2f8288cad460c6c7db526bbdf578e96ca04d9fe12797", - "0xb1705ea4cb7e074efe0405fc7b8ee2ec789af0426142f3ec81241cacd4f7edcd88e39435e4e4d8e7b1df64f3880d6613", - "0x85595d061d677116089a6064418b93eb44ff79e68d12bd9625078d3bbc440a60d0b02944eff6054433ee34710ae6fbb4", - "0x9978d5e30bedb7526734f9a1febd973a70bfa20890490e7cc6f2f9328feab1e24f991285dbc3711d892514e2d7d005ad", - "0xaf30243c66ea43b9f87a061f947f7bce745f09194f6e95f379c7582b9fead920e5d6957eaf05c12ae1282ada4670652f", - "0xa1930efb473f88001e47aa0b2b2a7566848cccf295792e4544096ecd14ee5d7927c173a8576b405bfa2eec551cd67eb5", - "0xb0446d1c590ee5a45f7e22d269c044f3848c97aec1d226b44bfd0e94d9729c28a38bccddc3a1006cc5fe4e3c24f001f2", - "0xb8a8380172df3d84b06176df916cf557966d4f2f716d3e9437e415d75b646810f79f2b2b71d857181b7fc944018883a3", - "0xa563afec25b7817bfa26e19dc9908bc00aa8fc3d19be7d6de23648701659009d10e3e4486c28e9c6b13d48231ae29ac5", - "0xa5a8e80579de886fb7d6408f542791876885947b27ad6fa99a8a26e381f052598d7b4e647b0115d4b5c64297e00ce28e", - "0x8f87afcc7ad33c51ac719bade3cd92da671a37a82c14446b0a2073f4a0a23085e2c8d31913ed2d0be928f053297de8f6", - "0xa43c455ce377e0bc434386c53c752880687e017b2f5ae7f8a15c044895b242dffde4c92fb8f8bb50b18470b17351b156", - "0x8368f8b12a5bceb1dba25adb3a2e9c7dc9b1a77a1f328e5a693f5aec195cd1e06b0fe9476b554c1c25dac6c4a5b640a3", - "0x919878b27f3671fc78396f11531c032f3e2bd132d04cc234fa4858676b15fb1db3051c0b1db9b4fc49038216f11321ce", - "0xb48cd67fb7f1242696c1f877da4bdf188eac676cd0e561fbac1a537f7b8229aff5a043922441d603a26aae56a15faee4", - "0xa3e0fdfd4d29ea996517a16f0370b54787fefe543c2fe73bfc6f9e560c1fd30dad8409859e2d7fa2d44316f24746c712", - "0x8bb156ade8faf149df7bea02c140c7e392a4742ae6d0394d880a849127943e6f26312033336d3b9fdc0092d71b5efe87", - "0x8845e5d5cc555ca3e0523244300f2c8d7e4d02aaebcb5bd749d791208856c209a6f84dd99fd55968c9f0ab5f82916707", - "0xa3e90bb5c97b07789c2f32dff1aec61d0a2220928202f5ad5355ae71f8249237799d6c8a22602e32e572cb12eabe0c17", - "0xb150bcc391884c996149dc3779ce71f15dda63a759ee9cc05871f5a8379dcb62b047098922c0f26c7bd04deb394c33f9", - "0x95cd4ad88d51f0f2efcfd0c2df802fe252bb9704d1afbf9c26a248df22d55da87bdfaf41d7bc6e5df38bd848f0b13f42", - "0xa05a49a31e91dff6a52ac8b9c2cfdd646a43f0d488253f9e3cfbce52f26667166bbb9b608fc358763a65cbf066cd6d05", - "0xa59c3c1227fdd7c2e81f5e11ef5c406da44662987bac33caed72314081e2eed66055d38137e01b2268e58ec85dd986c0", - "0xb7020ec3bd73a99861f0f1d88cf5a19abab1cbe14b7de77c9868398c84bb8e18dbbe9831838a96b6d6ca06e82451c67b", - "0x98d1ff2525e9718ee59a21d8900621636fcd873d9a564b8dceb4be80a194a0148daf1232742730b3341514b2e5a5436c", - "0x886d97b635975fc638c1b6afc493e5998ca139edba131b75b65cfe5a8e814f11bb678e0eeee5e6e5cd913ad3f2fefdfc", - "0x8fb9fd928d38d5d813b671c924edd56601dd7163b686c13f158645c2f869d9250f3859aa5463a39258c90fef0f41190a", - "0xaac35e1cd655c94dec3580bb3800bd9c2946c4a9856f7d725af15fbea6a2d8ca51c8ad2772abed60ee0e3fb9cb24046b", - "0xb8d71fa0fa05ac9e443c9b4929df9e7f09a919be679692682e614d24227e04894bfc14a5c73a62fb927fedff4a0e4aa7", - "0xa45a19f11fbbb531a704badbb813ed8088ab827c884ee4e4ebf363fa1132ff7cfa9d28be9c85b143e4f7cdbc94e7cf1a", - "0x82b54703a4f295f5471b255ab59dce00f0fe90c9fb6e06b9ee48b15c91d43f4e2ef4a96c3118aeb03b08767be58181bb", - "0x8283264c8e6d2a36558f0d145c18576b6600ff45ff99cc93eca54b6c6422993cf392668633e5df396b9331e873d457e5", - "0x8c549c03131ead601bc30eb6b9537b5d3beb7472f5bb1bcbbfd1e9f3704477f7840ab3ab7f7dc13bbbbcdff886a462d4", - "0xafbb0c520ac1b5486513587700ad53e314cb74bfbc12e0b5fbdcfdaac36d342e8b59856196a0d84a25cff6e6e1d17e76", - "0x89e4c22ffb51f2829061b3c7c1983c5c750cad158e3a825d46f7cf875677da5d63f653d8a297022b5db5845c9271b32b", - "0xafb27a86c4c2373088c96b9adf4433f2ebfc78ac5c526e9f0510670b6e4e5e0057c0a4f75b185e1a30331b9e805c1c15", - "0xa18e16b57445f88730fc5d3567bf5a176861dc14c7a08ed2996fe80eed27a0e7628501bcb78a1727c5e9ac55f29c12c4", - "0x93d61bf88b192d6825cf4e1120af1c17aa0f994d158b405e25437eaeefae049f7b721a206e7cc8a04fdc29d3c42580a1", - "0xa99f2995a2e3ed2fd1228d64166112038de2f516410aa439f4c507044e2017ea388604e2d0f7121256fadf7fbe7023d1", - "0x914fd91cffc23c32f1c6d0e98bf660925090d873367d543034654389916f65f552e445b0300b71b61b721a72e9a5983c", - "0xb42a578a7787b71f924e7def425d849c1c777156b1d4170a8ee7709a4a914e816935131afd9a0412c4cb952957b20828", - "0x82fb30590e84b9e45db1ec475a39971cf554dc01bcc7050bc89265740725c02e2be5a972168c5170c86ae83e5b0ad2c0", - "0xb14f8d8e1e93a84976289e0cf0dfa6f3a1809e98da16ee5c4932d0e1ed6bf8a07697fdd4dd86a3df84fb0003353cdcc0", - "0x85d7a2f4bda31aa2cb208b771fe03291a4ebdaf6f1dc944c27775af5caec412584c1f45bc741fca2a6a85acb3f26ad7d", - "0xaf02e56ce886ff2253bc0a68faad76f25ead84b2144e5364f3fb9b648f03a50ee9dc0b2c33ebacf7c61e9e43201ef9ef", - "0x87e025558c8a0b0abd06dfc350016847ea5ced7af2d135a5c9eec9324a4858c4b21510fb0992ec52a73447f24945058e", - "0x80fff0bafcd058118f5e7a4d4f1ae0912efeb281d2cbe4d34ba8945cc3dbe5d8baf47fb077343b90b8d895c90b297aca", - "0xb6edcf3a40e7b1c3c0148f47a263cd819e585a51ef31c2e35a29ce6f04c53e413f743034c0d998d9c00a08ba00166f31", - "0xabb87ed86098c0c70a76e557262a494ff51a30fb193f1c1a32f8e35eafa34a43fcc07aa93a3b7a077d9e35afa07b1a3d", - "0xa280214cd3bb0fb7ecd2d8bcf518cbd9078417f2b91d2533ec2717563f090fb84f2a5fcfdbbeb2a2a1f8a71cc5aa5941", - "0xa63083ca7238ea2b57d15a475963cf1d4f550d8cd76db290014a0461b90351f1f26a67d674c837b0b773b330c7c3d534", - "0xa8fa39064cb585ece5263e2f42f430206476bf261bd50f18d2b694889bd79d04d56410664cecad62690e5c5a20b3f6ff", - "0x85ba52ce9d700a5dcf6c5b00559acbe599d671ce5512467ff4b6179d7fad550567ce2a9c126a50964e3096458ea87920", - "0xb913501e1008f076e5eac6d883105174f88b248e1c9801e568fefaffa1558e4909364fc6d9512aa4d125cbd7cc895f05", - "0x8eb33b5266c8f2ed4725a6ad147a322e44c9264cf261c933cbbe230a43d47fca0f29ec39756b20561dabafadd5796494", - "0x850ebc8b661a04318c9db5a0515066e6454fa73865aa4908767a837857ecd717387f614acb614a88e075d4edc53a2f5a", - "0xa08d6b92d866270f29f4ce23a3f5d99b36b1e241a01271ede02817c8ec3f552a5c562db400766c07b104a331835c0c64", - "0x8131804c89bb3e74e9718bfc4afa547c1005ff676bd4db9604335032b203390cfa54478d45c6c78d1fe31a436ed4be9f", - "0x9106d94f23cc1eacec8316f16d6f0a1cc160967c886f51981fdb9f3f12ee1182407d2bb24e5b873de58cb1a3ee915a6b", - "0xa13806bfc3eae7a7000c9d9f1bd25e10218d4e67f59ae798b145b098bca3edad2b1040e3fc1e6310e612fb8818f459ac", - "0x8c69fbca502046cb5f6db99900a47b34117aef3f4b241690cdb3b84ca2a2fc7833e149361995dc41fa78892525bce746", - "0x852c473150c91912d58ecb05769222fa18312800c3f56605ad29eec9e2d8667b0b81c379048d3d29100ed2773bb1f3c5", - "0xb1767f6074426a00e01095dbb1795beb4e4050c6411792cbad6537bc444c3165d1058bafd1487451f9c5ddd209e0ae7e", - "0x80c600a5fe99354ce59ff0f84c760923dc8ff66a30bf47dc0a086181785ceb01f9b951c4e66df800ea6d705e8bc47055", - "0xb5cf19002fbc88a0764865b82afcb4d64a50196ea361e5c71dff7de084f4dcbbc34ec94a45cc9e0247bd51da565981aa", - "0x93e67a254ea8ce25e112d93cc927fadaa814152a2c4ec7d9a56eaa1ed47aec99b7e9916b02e64452cc724a6641729bbb", - "0xace70b32491bda18eee4a4d041c3bc9effae9340fe7e6c2f5ad975ee0874c17f1a7da7c96bd85fccff9312c518fac6e9", - "0xab4cfa02065017dd7f1aadc66f2c92f78f0f11b8597c03a5d69d82cb2eaf95a4476a836ac102908f137662472c8d914b", - "0xa40b8cd8deb8ae503d20364d64cab7c2801b7728a9646ed19c65edea6a842756a2f636283494299584ad57f4bb12cd0b", - "0x8594e11d5fc2396bcd9dbf5509ce4816dbb2b7305168021c426171fb444d111da5a152d6835ad8034542277011c26c0e", - "0x8024de98c26b4c994a66628dc304bb737f4b6859c86ded552c5abb81fd4c6c2e19d5a30beed398a694b9b2fdea1dd06a", - "0x8843f5872f33f54df8d0e06166c1857d733995f67bc54abb8dfa94ad92407cf0179bc91b0a50bbb56cdc2b350d950329", - "0xb8bab44c7dd53ef9edf497dcb228e2a41282c90f00ba052fc52d57e87b5c8ab132d227af1fcdff9a12713d1f980bcaae", - "0x982b4d7b29aff22d527fd82d2a52601d95549bfb000429bb20789ed45e5abf1f4b7416c7b7c4b79431eb3574b29be658", - "0x8eb1f571b6a1878e11e8c1c757e0bc084bab5e82e897ca9be9b7f4b47b91679a8190bf0fc8f799d9b487da5442415857", - "0xa6e74b588e5af935c8b243e888582ef7718f8714569dd4992920740227518305eb35fab674d21a5551cca44b3e511ef2", - "0xa30fc2f3a4cb4f50566e82307de73cd7bd8fe2c1184e9293c136a9b9e926a018d57c6e4f308c95b9eb8299e94d90a2a1", - "0xa50c5869ca5d2b40722c056a32f918d47e0b65ca9d7863ca7d2fb4a7b64fe523fe9365cf0573733ceaadebf20b48fff8", - "0x83bbdd32c04d17581418cf360749c7a169b55d54f2427390defd9f751f100897b2d800ce6636c5bbc046c47508d60c8c", - "0xa82904bdf614de5d8deaff688c8a5e7ac5b3431687acbcda8fa53960b7c417a39c8b2e462d7af91ce6d79260f412db8e", - "0xa4362e31ff4b05d278b033cf5eebea20de01714ae16d4115d04c1da4754269873afc8171a6f56c5104bfd7b0db93c3e7", - "0xb5b8daa63a3735581e74a021b684a1038cea77168fdb7fdf83c670c2cfabcfc3ab2fc7359069b5f9048188351aef26b5", - "0xb48d723894b7782d96ac8433c48faca1bdfa5238019c451a7f47d958097cce3ae599b876cf274269236b9d6ff8b6d7ca", - "0x98ffff6a61a3a6205c7820a91ca2e7176fab5dba02bc194c4d14942ac421cb254183c705506ab279e4f8db066f941c6c", - "0xae7db24731da2eaa6efc4f7fcba2ecc26940ddd68038dce43acf2cee15b72dc4ef42a7bfdd32946d1ed78786dd7696b3", - "0xa656db14f1de9a7eb84f6301b4acb2fbf78bfe867f48a270e416c974ab92821eb4df1cb881b2d600cfed0034ac784641", - "0xaa315f8ecba85a5535e9a49e558b15f39520fce5d4bf43131bfbf2e2c9dfccc829074f9083e8d49f405fb221d0bc4c3c", - "0x90bffba5d9ff40a62f6c8e9fc402d5b95f6077ed58d030c93e321b8081b77d6b8dac3f63a92a7ddc01585cf2c127d66c", - "0xabdd733a36e0e0f05a570d0504e73801bf9b5a25ff2c78786f8b805704997acb2e6069af342538c581144d53149fa6d3", - "0xb4a723bb19e8c18a01bd449b1bb3440ddb2017f10bb153da27deb7a6a60e9bb37619d6d5435fbb1ba617687838e01dd0", - "0x870016b4678bab3375516db0187a2108b2e840bae4d264b9f4f27dbbc7cc9cac1d7dc582d7a04d6fd1ed588238e5e513", - "0x80d33d2e20e8fc170aa3cb4f69fffb72aeafb3b5bb4ea0bc79ab55da14142ca19b2d8b617a6b24d537366e3b49cb67c3", - "0xa7ee76aec273aaae03b3b87015789289551969fb175c11557da3ab77e39ab49d24634726f92affae9f4d24003050d974", - "0x8415ea4ab69d779ebd42d0fe0c6aef531d6a465a5739e429b1fcf433ec45aa8296c527e965a20f0ec9f340c9273ea3cf", - "0x8c7662520794e8b4405d0b33b5cac839784bc86a5868766c06cbc1fa306dbe334978177417b31baf90ce7b0052a29c56", - "0x902b2abecc053a3dbdea9897ee21e74821f3a1b98b2d560a514a35799f4680322550fd3a728d4f6d64e1de98033c32b8", - "0xa05e84ed9ecab8d508d670c39f2db61ad6e08d2795ec32a3c9d0d3737ef3801618f4fc2a95f90ec2f068606131e076c5", - "0x8b9208ff4d5af0c2e3f53c9375da666773ac57197dfabb0d25b1c8d0588ba7f3c15ee9661bb001297f322ea2fbf6928b", - "0xa3c827741b34a03254d4451b5ab74a96f2b9f7fb069e2f5adaf54fd97cc7a4d516d378db5ca07da87d8566d6eef13726", - "0x8509d8a3f4a0ed378e0a1e28ea02f6bf1d7f6c819c6c2f5297c7df54c895b848f841653e32ba2a2c22c2ff739571acb8", - "0xa0ce988b7d3c40b4e496aa83a09e4b5472a2d98679622f32bea23e6d607bc7de1a5374fb162bce0549a67dad948519be", - "0xaa8a3dd12bd60e3d2e05f9c683cdcb8eab17fc59134815f8d197681b1bcf65108cba63ac5c58ee632b1e5ed6bba5d474", - "0x8b955f1d894b3aefd883fb4b65f14cd37fc2b9db77db79273f1700bef9973bf3fd123897ea2b7989f50003733f8f7f21", - "0xac79c00ddac47f5daf8d9418d798d8af89fc6f1682e7e451f71ea3a405b0d36af35388dd2a332af790bc83ca7b819328", - "0xa0d44dd2a4438b809522b130d0938c3fe7c5c46379365dbd1810a170a9aa5818e1c783470dd5d0b6d4ac7edbb7330910", - "0xa30b69e39ad43dd540a43c521f05b51b5f1b9c4eed54b8162374ae11eac25da4f5756e7b70ce9f3c92c2eeceee7431ed", - "0xac43220b762c299c7951222ea19761ab938bf38e4972deef58ed84f4f9c68c230647cf7506d7cbfc08562fcca55f0485", - "0xb28233b46a8fb424cfa386a845a3b5399d8489ceb83c8f3e05c22c934798d639c93718b7b68ab3ce24c5358339e41cbb", - "0xac30d50ee8ce59a10d4b37a3a35e62cdb2273e5e52232e202ca7d7b8d09d28958ee667fae41a7bb6cdc6fe8f6e6c9c85", - "0xb199842d9141ad169f35cc7ff782b274cbaa645fdb727761e0a89edbf0d781a15f8218b4bf4eead326f2903dd88a9cc1", - "0x85e018c7ddcad34bb8285a737c578bf741ccd547e68c734bdb3808380e12c5d4ef60fc896b497a87d443ff9abd063b38", - "0x8c856e6ba4a815bdb891e1276f93545b7072f6cb1a9aa6aa5cf240976f29f4dee01878638500a6bf1daf677b96b54343", - "0xb8a47555fa8710534150e1a3f13eab33666017be6b41005397afa647ea49708565f2b86b77ad4964d140d9ced6b4d585", - "0x8cd1f1db1b2f4c85a3f46211599caf512d5439e2d8e184663d7d50166fd3008f0e9253272f898d81007988435f715881", - "0xb1f34b14612c973a3eceb716dc102b82ab18afef9de7630172c2780776679a7706a4874e1df3eaadf541fb009731807f", - "0xb25464af9cff883b55be2ff8daf610052c02df9a5e147a2cf4df6ce63edcdee6dc535c533590084cc177da85c5dc0baa", - "0x91c3c4b658b42d8d3448ae1415d4541d02379a40dc51e36a59bd6e7b9ba3ea51533f480c7c6e8405250ee9b96a466c29", - "0x86dc027b95deb74c36a58a1333a03e63cb5ae22d3b29d114cfd2271badb05268c9d0c819a977f5e0c6014b00c1512e3a", - "0xae0e6ff58eb5fa35da5107ebeacf222ab8f52a22bb1e13504247c1dfa65320f40d97b0e6b201cb6613476687cb2f0681", - "0x8f13415d960b9d7a1d93ef28afc2223e926639b63bdefce0f85e945dfc81670a55df288893a0d8b3abe13c5708f82f91", - "0x956f67ca49ad27c1e3a68c1faad5e7baf0160c459094bf6b7baf36b112de935fdfd79fa4a9ea87ea8de0ac07272969f4", - "0x835e45e4a67df9fb51b645d37840b3a15c171d571a10b03a406dd69d3c2f22df3aa9c5cbe1e73f8d767ce01c4914ea9a", - "0x919b938e56d4b32e2667469d0bdccb95d9dda3341aa907683ee70a14bbbe623035014511c261f4f59b318b610ac90aa3", - "0x96b48182121ccd9d689bf1dfdc228175564cd68dc904a99c808a7f0053a6f636c9d953e12198bdf2ea49ea92772f2e18", - "0xac5e5a941d567fa38fdbcfa8cf7f85bb304e3401c52d88752bcd516d1fa9bac4572534ea2205e38423c1df065990790f", - "0xac0bd594fb85a8d4fc26d6df0fa81f11919401f1ecf9168b891ec7f061a2d9368af99f7fd8d9b43b2ce361e7b8482159", - "0x83d92c69ca540d298fe80d8162a1c7af3fa9b49dfb69e85c1d136a3ec39fe419c9fa78e0bb6d96878771fbd37fe92e40", - "0xb35443ae8aa66c763c2db9273f908552fe458e96696b90e41dd509c17a5c04ee178e3490d9c6ba2dc0b8f793c433c134", - "0x923b2d25aa45b2e580ffd94cbb37dc8110f340f0f011217ee1bd81afb0714c0b1d5fb4db86006cdd2457563276f59c59", - "0x96c9125d38fca1a61ac21257b696f8ac3dae78def50285e44d90ea293d591d1c58f703540a7e4e99e070afe4646bbe15", - "0xb57946b2332077fbcdcb406b811779aefd54473b5559a163cd65cb8310679b7e2028aa55c12a1401fdcfcac0e6fae29a", - "0x845daedc5cf972883835d7e13c937b63753c2200324a3b8082a6c4abb4be06c5f7c629d4abe4bfaf1d80a1f073eb6ce6", - "0x91a55dfd0efefcd03dc6dacc64ec93b8d296cb83c0ee72400a36f27246e7f2a60e73b7b70ba65819e9cfb73edb7bd297", - "0x8874606b93266455fe8fdd25df9f8d2994e927460af06f2e97dd4d2d90db1e6b06d441b72c2e76504d753badca87fb37", - "0x8ee99e6d231274ff9252c0f4e84549da173041299ad1230929c3e3d32399731c4f20a502b4a307642cac9306ccd49d3c", - "0x8836497714a525118e20849d6933bb8535fb6f72b96337d49e3133d936999c90a398a740f42e772353b5f1c63581df6d", - "0xa6916945e10628f7497a6cdc5e2de113d25f7ade3e41e74d3de48ccd4fce9f2fa9ab69645275002e6f49399b798c40af", - "0x9597706983107eb23883e0812e1a2c58af7f3499d50c6e29b455946cb9812fde1aa323d9ed30d1c0ffd455abe32303cd", - "0xa24ee89f7f515cc33bdbdb822e7d5c1877d337f3b2162303cfc2dae028011c3a267c5cb4194afa63a4856a6e1c213448", - "0x8cd25315e4318801c2776824ae6e7d543cb85ed3bc2498ba5752df2e8142b37653cf9e60104d674be3aeb0a66912e97a", - "0xb5085ecbe793180b40dbeb879f4c976eaaccaca3a5246807dced5890e0ed24d35f3f86955e2460e14fb44ff5081c07ba", - "0x960188cc0b4f908633a6840963a6fa2205fc42c511c6c309685234911c5304ef4c304e3ae9c9c69daa2fb6a73560c256", - "0xa32d0a70bf15d569b4cda5aebe3e41e03c28bf99cdd34ffa6c5d58a097f322772acca904b3a47addb6c7492a7126ebac", - "0x977f72d06ad72d4aa4765e0f1f9f4a3231d9f030501f320fe7714cc5d329d08112789fa918c60dd7fdb5837d56bb7fc6", - "0x99fa038bb0470d45852bb871620d8d88520adb701712fcb1f278fed2882722b9e729e6cdce44c82caafad95e37d0e6f7", - "0xb855e8f4fc7634ada07e83b6c719a1e37acb06394bc8c7dcab7747a8c54e5df3943915f021364bd019fdea103864e55f", - "0x88bc2cd7458532e98c596ef59ea2cf640d7cc31b4c33cef9ed065c078d1d4eb49677a67de8e6229cc17ea48bace8ee5a", - "0xaaa78a3feaa836d944d987d813f9b9741afb076e6aca1ffa42682ab06d46d66e0c07b8f40b9dbd63e75e81efa1ef7b08", - "0xb7b080420cc4d808723b98b2a5b7b59c81e624ab568ecdfdeb8bf3aa151a581b6f56e983ef1b6f909661e25db40b0c69", - "0xabee85c462ac9a2c58e54f06c91b3e5cd8c5f9ab5b5deb602b53763c54826ed6deb0d6db315a8d7ad88733407e8d35e2", - "0x994d075c1527407547590df53e9d72dd31f037c763848d1662eebd4cefec93a24328c986802efa80e038cb760a5300f5", - "0xab8777640116dfb6678e8c7d5b36d01265dfb16321abbfc277da71556a34bb3be04bc4ae90124ed9c55386d2bfb3bda0", - "0x967e3a828bc59409144463bcf883a3a276b5f24bf3cbfdd7a42343348cba91e00b46ac285835a9b91eef171202974204", - "0x875a9f0c4ffe5bb1d8da5e3c8e41d0397aa6248422a628bd60bfae536a651417d4e8a7d2fb98e13f2dad3680f7bd86d3", - "0xacaa330c3e8f95d46b1880126572b238dbb6d04484d2cd4f257ab9642d8c9fc7b212188b9c7ac9e0fd135c520d46b1bf", - "0xaceb762edbb0f0c43dfcdb01ea7a1ac5918ca3882b1e7ebc4373521742f1ed5250d8966b498c00b2b0f4d13212e6dd0b", - "0x81d072b4ad258b3646f52f399bced97c613b22e7ad76373453d80b1650c0ca87edb291a041f8253b649b6e5429bb4cff", - "0x980a47d27416ac39c7c3a0ebe50c492f8c776ea1de44d5159ac7d889b6d554357f0a77f0e5d9d0ff41aae4369eba1fc2", - "0x8b4dfd5ef5573db1476d5e43aacfb5941e45d6297794508f29c454fe50ea622e6f068b28b3debe8635cf6036007de2e3", - "0xa60831559d6305839515b68f8c3bc7abbd8212cc4083502e19dd682d56ca37c9780fc3ce4ec2eae81ab23b221452dc57", - "0x951f6b2c1848ced9e8a2339c65918e00d3d22d3e59a0a660b1eca667d18f8430d737884e9805865ef3ed0fe1638a22d9", - "0xb02e38fe790b492aa5e89257c4986c9033a8b67010fa2add9787de857d53759170fdd67715ca658220b4e14b0ca48124", - "0xa51007e4346060746e6b0e4797fc08ef17f04a34fe24f307f6b6817edbb8ce2b176f40771d4ae8a60d6152cbebe62653", - "0xa510005b05c0b305075b27b243c9d64bcdce85146b6ed0e75a3178b5ff9608213f08c8c9246f2ca6035a0c3e31619860", - "0xaaff4ef27a7a23be3419d22197e13676d6e3810ceb06a9e920d38125745dc68a930f1741c9c2d9d5c875968e30f34ab5", - "0x864522a9af9857de9814e61383bebad1ba9a881696925a0ea6bfc6eff520d42c506bbe5685a9946ed710e889765be4a0", - "0xb63258c080d13f3b7d5b9f3ca9929f8982a6960bdb1b0f8676f4dca823971601672f15e653917bf5d3746bb220504913", - "0xb51ce0cb10869121ae310c7159ee1f3e3a9f8ad498827f72c3d56864808c1f21fa2881788f19ece884d3f705cd7bd0c5", - "0x95d9cecfc018c6ed510e441cf84c712d9909c778c16734706c93222257f64dcd2a9f1bd0b400ca271e22c9c487014274", - "0x8beff4d7d0140b86380ff4842a9bda94c2d2be638e20ac68a4912cb47dbe01a261857536375208040c0554929ced1ddc", - "0x891ff49258749e2b57c1e9b8e04b12c77d79c3308b1fb615a081f2aacdfb4b39e32d53e069ed136fdbd43c53b87418fa", - "0x9625cad224e163d387738825982d1e40eeff35fe816d10d7541d15fdc4d3eee48009090f3faef4024b249205b0b28f72", - "0x8f3947433d9bd01aa335895484b540a9025a19481a1c40b4f72dd676bfcf332713714fd4010bde936eaf9470fd239ed0", - "0xa00ec2d67789a7054b53f0e858a8a232706ccc29a9f3e389df7455f1a51a2e75801fd78469a13dbc25d28399ae4c6182", - "0xa3f65884506d4a62b8775a0ea0e3d78f5f46bc07910a93cd604022154eabdf1d73591e304d61edc869e91462951975e1", - "0xa14eef4fd5dfac311713f0faa9a60415e3d30b95a4590cbf95f2033dffb4d16c02e7ceff3dcd42148a4e3bc49cce2dd4", - "0x8afa11c0eef3c540e1e3460bc759bb2b6ea90743623f88e62950c94e370fe4fd01c22b6729beba4dcd4d581198d9358f", - "0xafb05548a69f0845ffcc5f5dc63e3cdb93cd270f5655173b9a950394b0583663f2b7164ba6df8d60c2e775c1d9f120af", - "0x97f179e01a947a906e1cbeafa083960bc9f1bade45742a3afee488dfb6011c1c6e2db09a355d77f5228a42ccaa7bdf8e", - "0x8447fca4d35f74b3efcbd96774f41874ca376bf85b79b6e66c92fa3f14bdd6e743a051f12a7fbfd87f319d1c6a5ce217", - "0xa57ca39c23617cd2cf32ff93b02161bd7baf52c4effb4679d9d5166406e103bc8f3c6b5209e17c37dbb02deb8bc72ddd", - "0x9667c7300ff80f0140be002b0e36caab07aaee7cce72679197c64d355e20d96196acaf54e06e1382167d081fe6f739c1", - "0x828126bb0559ce748809b622677267ca896fa2ee76360fd2c02990e6477e06a667241379ca7e65d61a5b64b96d7867de", - "0x8b8835dea6ba8cf61c91f01a4b3d2f8150b687a4ee09b45f2e5fc8f80f208ae5d142d8e3a18153f0722b90214e60c5a7", - "0xa98e8ff02049b4da386e3ee93db23bbb13dfeb72f1cfde72587c7e6d962780b7671c63e8ac3fbaeb1a6605e8d79e2f29", - "0x87a4892a0026d7e39ef3af632172b88337cb03669dea564bcdb70653b52d744730ebb5d642e20cb627acc9dbb547a26b", - "0x877352a22fc8052878a57effc159dac4d75fe08c84d3d5324c0bab6d564cdf868f33ceee515eee747e5856b62cfa0cc7", - "0x8b801ba8e2ff019ee62f64b8cb8a5f601fc35423eb0f9494b401050103e1307dc584e4e4b21249cd2c686e32475e96c3", - "0xa9e7338d6d4d9bfec91b2af28a8ed13b09415f57a3a00e5e777c93d768fdb3f8e4456ae48a2c6626b264226e911a0e28", - "0x99c05fedf40ac4726ed585d7c1544c6e79619a0d3fb6bda75a08c7f3c0008e8d5e19ed4da48de3216135f34a15eba17c", - "0xa61cce8a1a8b13a4a650fdbec0eeea8297c352a8238fb7cac95a0df18ed16ee02a3daa2de108fa122aca733bd8ad7855", - "0xb97f37da9005b440b4cb05870dd881bf8491fe735844f2d5c8281818583b38e02286e653d9f2e7fa5e74c3c3eb616540", - "0xa72164a8554da8e103f692ac5ebb4aece55d5194302b9f74b6f2a05335b6e39beede0bf7bf8c5bfd4d324a784c5fb08c", - "0xb87e8221c5341cd9cc8bb99c10fe730bc105550f25ed4b96c0d45e6142193a1b2e72f1b3857373a659b8c09be17b3d91", - "0xa41fb1f327ef91dcb7ac0787918376584890dd9a9675c297c45796e32d6e5985b12f9b80be47fc3a8596c245f419d395", - "0x90dafa3592bdbb3465c92e2a54c2531822ba0459d45d3e7a7092fa6b823f55af28357cb51896d4ec2d66029c82f08e26", - "0xa0a9adc872ebc396557f484f1dd21954d4f4a21c4aa5eec543f5fa386fe590839735c01f236574f7ff95407cd12de103", - "0xb8c5c940d58be7538acf8672852b5da3af34f82405ef2ce8e4c923f1362f97fc50921568d0fd2fe846edfb0823e62979", - "0x85aaf06a8b2d0dac89dafd00c28533f35dbd074978c2aaa5bef75db44a7b12aeb222e724f395513b9a535809a275e30b", - "0x81f3cbe82fbc7028c26a6c1808c604c63ba023a30c9f78a4c581340008dbda5ec07497ee849a2183fcd9124f7936af32", - "0xa11ac738de75fd60f15a34209d3825d5e23385796a4c7fc5931822f3f380af977dd0f7b59fbd58eed7777a071e21b680", - "0x85a279c493de03db6fa6c3e3c1b1b29adc9a8c4effc12400ae1128da8421954fa8b75ad19e5388fe4543b76fb0812813", - "0x83a217b395d59ab20db6c4adb1e9713fc9267f5f31a6c936042fe051ce8b541f579442f3dcf0fa16b9e6de9fd3518191", - "0x83a0b86e7d4ed8f9ccdc6dfc8ff1484509a6378fa6f09ed908e6ab9d1073f03011dc497e14304e4e3d181b57de06a5ab", - "0xa63ad69c9d25704ce1cc8e74f67818e5ed985f8f851afa8412248b2df5f833f83b95b27180e9e7273833ed0d07113d3b", - "0x99b1bc2021e63b561fe44ddd0af81fcc8627a91bfeecbbc989b642bc859abc0c8d636399701aad7bbaf6a385d5f27d61", - "0xb53434adb66f4a807a6ad917c6e856321753e559b1add70824e5c1e88191bf6993fccb9b8b911fc0f473fb11743acacd", - "0x97ed3b9e6fb99bf5f945d4a41f198161294866aa23f2327818cdd55cb5dc4c1a8eff29dd8b8d04902d6cd43a71835c82", - "0xb1e808260e368a18d9d10bdea5d60223ba1713b948c782285a27a99ae50cc5fc2c53d407de07155ecc16fb8a36d744a0", - "0xa3eb4665f18f71833fec43802730e56b3ee5a357ea30a888ad482725b169d6f1f6ade6e208ee081b2e2633079b82ba7d", - "0xab8beb2c8353fc9f571c18fdd02bdb977fc883313469e1277b0372fbbb33b80dcff354ca41de436d98d2ed710faa467e", - "0xaa9071cfa971e4a335a91ad634c98f2be51544cb21f040f2471d01bb97e1df2277ae1646e1ea8f55b7ba9f5c8c599b39", - "0x80b7dbfdcaf40f0678012acc634eba44ea51181475180d9deb2050dc4f2de395289edd0223018c81057ec79b04b04c49", - "0x89623d7f6cb17aa877af14de842c2d4ab7fd576d61ddd7518b5878620a01ded40b6010de0da3cdf31d837eecf30e9847", - "0xa773bb024ae74dd24761f266d4fb27d6fd366a8634febe8235376b1ae9065c2fe12c769f1d0407867dfbe9f5272c352f", - "0x8455a561c3aaa6ba64c881a5e13921c592b3a02e968f4fb24a2243c36202795d0366d9cc1a24e916f84d6e158b7aeac7", - "0x81d8bfc4b283cf702a40b87a2b96b275bdbf0def17e67d04842598610b67ea08c804d400c3e69fa09ea001eaf345b276", - "0xb8f8f82cb11fea1c99467013d7e167ff03deb0c65a677fab76ded58826d1ba29aa7cf9fcd7763615735ea3ad38e28719", - "0x89a6a04baf9cccc1db55179e1650b1a195dd91fb0aebc197a25143f0f393524d2589975e3fbfc2547126f0bced7fd6f2", - "0xb81b2162df045390f04df07cbd0962e6b6ca94275a63edded58001a2f28b2ae2af2c7a6cba4ecd753869684e77e7e799", - "0xa3757f722776e50de45c62d9c4a2ee0f5655a512344c4cbec542d8045332806568dd626a719ef21a4eb06792ca70f204", - "0x8c5590df96ec22179a4e8786de41beb44f987a1dcc508eb341eecbc0b39236fdfad47f108f852e87179ccf4e10091e59", - "0x87502f026ed4e10167419130b88c3737635c5b9074c364e1dd247cef5ef0fc064b4ae99b187e33301e438bbd2fe7d032", - "0xaf925a2165e980ced620ff12289129fe17670a90ae0f4db9d4b39bd887ccb1f5d2514ac9ecf910f6390a8fc66bd5be17", - "0x857fca899828cf5c65d26e3e8a6e658542782fc72762b3b9c73514919f83259e0f849a9d4838b40dc905fe43024d0d23", - "0x87ffebdbfb69a9e1007ebac4ffcb4090ff13705967b73937063719aa97908986effcb7262fdadc1ae0f95c3690e3245d", - "0xa9ff6c347ac6f4c6ab993b748802e96982eaf489dc69032269568412fc9a79e7c2850dfc991b28211b3522ee4454344b", - "0xa65b3159df4ec48bebb67cb3663cd744027ad98d970d620e05bf6c48f230fa45bf17527fe726fdf705419bb7a1bb913e", - "0x84b97b1e6408b6791831997b03cd91f027e7660fd492a93d95daafe61f02427371c0e237c75706412f442991dfdff989", - "0xab761c26527439b209af0ae6afccd9340bbed5fbe098734c3145b76c5d2cd7115d9227b2eb523882b7317fbb09180498", - "0xa0479a8da06d7a69c0b0fee60df4e691c19c551f5e7da286dab430bfbcabf31726508e20d26ea48c53365a7f00a3ad34", - "0xa732dfc9baa0f4f40b5756d2e8d8937742999623477458e0bc81431a7b633eefc6f53b3b7939fe0a020018549c954054", - "0x901502436a1169ba51dc479a5abe7c8d84e0943b16bc3c6a627b49b92cd46263c0005bc324c67509edd693f28e612af1", - "0xb627aee83474e7f84d1bab9b7f6b605e33b26297ac6bbf52d110d38ba10749032bd551641e73a383a303882367af429b", - "0x95108866745760baef4a46ef56f82da6de7e81c58b10126ebd2ba2cd13d339f91303bf2fb4dd104a6956aa3b13739503", - "0x899ed2ade37236cec90056f3569bc50f984f2247792defafcceb49ad0ca5f6f8a2f06573705300e07f0de0c759289ff5", - "0xa9f5eee196d608efe4bcef9bf71c646d27feb615e21252cf839a44a49fd89da8d26a758419e0085a05b1d59600e2dc42", - "0xb36c6f68fed6e6c85f1f4a162485f24817f2843ec5cbee45a1ebfa367d44892e464949c6669f7972dc7167af08d55d25", - "0xaaaede243a9a1b6162afbc8f571a52671a5a4519b4062e3f26777664e245ba873ed13b0492c5dbf0258c788c397a0e9e", - "0x972b4fb39c31cbe127bf9a32a5cc10d621ebdd9411df5e5da3d457f03b2ab2cd1f6372d8284a4a9400f0b06ecdbfd38e", - "0x8f6ca1e110e959a4b1d9a5ce5f212893cec21db40d64d5ac4d524f352d72198f923416a850bf845bc5a22a79c0ea2619", - "0xa0f3c93b22134f66f04b2553a53b738644d1665ceb196b8494b315a4c28236fb492017e4a0de4224827c78e42f9908b7", - "0x807fb5ee74f6c8735b0b5ca07e28506214fe4047dbeb00045d7c24f7849e98706aea79771241224939cb749cf1366c7d", - "0x915eb1ff034224c0b645442cdb7d669303fdc00ca464f91aaf0b6fde0b220a3a74ff0cb043c26c9f3a5667b3fdaa9420", - "0x8fda6cef56ed33fefffa9e6ac8e6f76b1af379f89761945c63dd448801f7bb8ca970504a7105fac2f74f652ccff32327", - "0x87380cffdcffb1d0820fa36b63cc081e72187f86d487315177d4d04da4533eb19a0e2ff6115ceab528887819c44a5164", - "0x8cd89e03411a18e7f16f968b89fb500c36d47d229f6487b99e62403a980058db5925ce249206743333538adfad168330", - "0x974451b1df33522ce7056de9f03e10c70bf302c44b0741a59df3d6877d53d61a7394dcee1dd46e013d7cb9d73419c092", - "0x98c35ddf645940260c490f384a49496a7352bb8e3f686feed815b1d38f59ded17b1ad6e84a209e773ed08f7b8ff1e4c2", - "0x963f386cf944bb9b2ddebb97171b64253ea0a2894ac40049bdd86cda392292315f3a3d490ca5d9628c890cfb669f0acb", - "0x8d507712152babd6d142ee682638da8495a6f3838136088df9424ef50d5ec28d815a198c9a4963610b22e49b4cdf95e9", - "0x83d4bc6b0be87c8a4f1e9c53f257719de0c73d85b490a41f7420e777311640937320557ff2f1d9bafd1daaa54f932356", - "0x82f5381c965b7a0718441131c4d13999f4cdce637698989a17ed97c8ea2e5bdb5d07719c5f7be8688edb081b23ede0f4", - "0xa6ebecab0b72a49dfd01d69fa37a7f74d34fb1d4fef0aa10e3d6fceb9eccd671225c230af89f6eb514250e41a5f91f52", - "0x846d185bdad6e11e604df7f753b7a08a28b643674221f0e750ebdb6b86ec584a29c869e131bca868972a507e61403f6a", - "0x85a98332292acb744bd1c0fd6fdcf1f889a78a2c9624d79413ffa194cc8dfa7821a4b60cde8081d4b5f71f51168dd67f", - "0x8f7d97c3b4597880d73200d074eb813d95432306e82dafc70b580b8e08cb8098b70f2d07b4b3ac6a4d77e92d57035031", - "0x8185439c8751e595825d7053518cbe121f191846a38d4dbcb558c3f9d7a3104f3153401adaaaf27843bbe2edb504bfe3", - "0xb3c00d8ece1518fca6b1215a139b0a0e26d9cba1b3a424f7ee59f30ce800a5db967279ed60958dd1f3ee69cf4dd1b204", - "0xa2e6cb6978e883f9719c3c0d44cfe8de0cc6f644b98f98858433bea8bbe7b612c8aca5952fccce4f195f9d54f9722dc2", - "0x99663087e3d5000abbec0fbda4e7342ec38846cc6a1505191fb3f1a337cb369455b7f8531a6eb8b0f7b2c4baf83cbe2b", - "0xab0836c6377a4dbc7ca6a4d6cf021d4cd60013877314dd05f351706b128d4af6337711ed3443cb6ca976f40d74070a9a", - "0x87abfd5126152fd3bac3c56230579b489436755ea89e0566aa349490b36a5d7b85028e9fb0710907042bcde6a6f5d7e3", - "0x974ba1033f75f60e0cf7c718a57ae1da3721cf9d0fb925714c46f027632bdd84cd9e6de4cf4d00bc55465b1c5ebb7384", - "0xa607b49d73689ac64f25cec71221d30d53e781e1100d19a2114a21da6507a60166166369d860bd314acb226596525670", - "0xa7c2b0b915d7beba94954f2aa7dd08ec075813661e2a3ecca5d28a0733e59583247fed9528eb28aba55b972cdbaf06eb", - "0xb8b3123e44128cc8efbe3270f2f94e50ca214a4294c71c3b851f8cbb70cb67fe9536cf07d04bf7fe380e5e3a29dd3c15", - "0xa59a07e343b62ad6445a0859a32b58c21a593f9ddbfe52049650f59628c93715aa1f4e1f45b109321756d0eeec8a5429", - "0x94f51f8a4ed18a6030d0aaa8899056744bd0e9dc9ac68f62b00355cddab11da5da16798db75f0bfbce0e5bdfe750c0b6", - "0x97460a97ca1e1fa5ce243b81425edc0ec19b7448e93f0b55bc9785eedeeafe194a3c8b33a61a5c72990edf375f122777", - "0x8fa859a089bc17d698a7ee381f37ce9beadf4e5b44fce5f6f29762bc04f96faff5d58c48c73631290325f05e9a1ecf49", - "0xabdf38f3b20fc95eff31de5aa9ef1031abfa48f1305ee57e4d507594570401503476d3bcc493838fc24d6967a3082c7f", - "0xb8914bfb82815abb86da35c64d39ab838581bc0bf08967192697d9663877825f2b9d6fbdcf9b410463482b3731361aef", - "0xa8187f9d22b193a5f578999954d6ec9aa9b32338ccadb8a3e1ce5bad5ea361d69016e1cdfac44e9d6c54e49dd88561b9", - "0xaac262cb7cba7fd62c14daa7b39677cabc1ef0947dd06dd89cac8570006a200f90d5f0353e84f5ff03179e3bebe14231", - "0xa630ef5ece9733b8c46c0a2df14a0f37647a85e69c63148e79ffdcc145707053f9f9d305c3f1cf3c7915cb46d33abd07", - "0xb102c237cb2e254588b6d53350dfda6901bd99493a3fbddb4121d45e0b475cf2663a40d7b9a75325eda83e4ba1e68cb3", - "0x86a930dd1ddcc16d1dfa00aa292cb6c2607d42c367e470aa920964b7c17ab6232a7108d1c2c11fc40fb7496547d0bbf8", - "0xa832fdc4500683e72a96cce61e62ac9ee812c37fe03527ad4cf893915ca1962cee80e72d4f82b20c8fc0b764376635a1", - "0x88ad985f448dabb04f8808efd90f273f11f5e6d0468b5489a1a6a3d77de342992a73eb842d419034968d733f101ff683", - "0x98a8538145f0d86f7fbf9a81c9140f6095c5bdd8960b1c6f3a1716428cd9cca1bf8322e6d0af24e6169abcf7df2b0ff6", - "0x9048c6eba5e062519011e177e955a200b2c00b3a0b8615bdecdebc217559d41058d3315f6d05617be531ef0f6aef0e51", - "0x833bf225ab6fc68cdcacf1ec1b50f9d05f5410e6cdcd8d56a3081dc2be8a8d07b81534d1ec93a25c2e270313dfb99e3b", - "0xa84bcd24c3da5e537e64a811b93c91bfc84d7729b9ead7f79078989a6eb76717d620c1fad17466a0519208651e92f5ff", - "0xb7cdd0a3fbd79aed93e1b5a44ca44a94e7af5ed911e4492f332e3a5ed146c7286bde01b52276a2fcc02780d2109874dd", - "0x8a19a09854e627cb95750d83c20c67442b66b35896a476358f993ba9ac114d32c59c1b3d0b8787ee3224cf3888b56c64", - "0xa9abd5afb8659ee52ada8fa5d57e7dd355f0a7350276f6160bec5fbf70d5f99234dd179eb221c913e22a49ec6d267846", - "0x8c13c4274c0d30d184e73eaf812200094bbbd57293780bdadbceb262e34dee5b453991e7f37c7333a654fc71c69d6445", - "0xa4320d73296ff8176ce0127ca1921c450e2a9c06eff936681ebaffb5a0b05b17fded24e548454de89aca2dcf6d7a9de4", - "0xb2b8b3e15c1f645f07783e5628aba614e60157889db41d8161d977606788842b67f83f361eae91815dc0abd84e09abd5", - "0xad26c3aa35ddfddc15719b8bb6c264aaec7065e88ac29ba820eb61f220fef451609a7bb037f3722d022e6c86e4f1dc88", - "0xb8615bf43e13ae5d7b8dd903ce37190800cd490f441c09b22aa29d7a29ed2c0417b7a08ead417868f1de2589deaadd80", - "0x8d3425e1482cd1e76750a76239d33c06b3554c3c3c87c15cb7ab58b1cee86a4c5c4178b44e23f36928365a1b484bde02", - "0x806893a62e38c941a7dd6f249c83af16596f69877cc737d8f73f6b8cd93cbc01177a7a276b2b8c6b0e5f2ad864db5994", - "0x86618f17fa4b0d65496b661bbb5ba3bc3a87129d30a4b7d4f515b904f4206ca5253a41f49fd52095861e5e065ec54f21", - "0x9551915da1304051e55717f4c31db761dcdcf3a1366c89a4af800a9e99aca93a357bf928307f098e62b44a02cb689a46", - "0x8f79c4ec0ec1146cb2a523b52fe33def90d7b5652a0cb9c2d1c8808a32293e00aec6969f5b1538e3a94cd1efa3937f86", - "0xa0c03e329a707300081780f1e310671315b4c6a4cedcb29697aedfabb07a9d5df83f27b20e9c44cf6b16e39d9ded5b98", - "0x86a7cfa7c8e7ce2c01dd0baec2139e97e8e090ad4e7b5f51518f83d564765003c65968f85481bbb97cb18f005ccc7d9f", - "0xa33811770c6dfda3f7f74e6ad0107a187fe622d61b444bbd84fd7ef6e03302e693b093df76f6ab39bb4e02afd84a575a", - "0x85480f5c10d4162a8e6702b5e04f801874d572a62a130be94b0c02b58c3c59bdcd48cd05f0a1c2839f88f06b6e3cd337", - "0x8e181011564b17f7d787fe0e7f3c87f6b62da9083c54c74fd6c357a1f464c123c1d3d8ade3cf72475000b464b14e2be3", - "0x8ee178937294b8c991337e0621ab37e9ffa4ca2bdb3284065c5e9c08aad6785d50cf156270ff9daf9a9127289710f55b", - "0x8bd1e8e2d37379d4b172f1aec96f2e41a6e1393158d7a3dbd9a95c8dd4f8e0b05336a42efc11a732e5f22b47fc5c271d", - "0x8f3da353cd487c13136a85677de8cedf306faae0edec733cf4f0046f82fa4639db4745b0095ff33a9766aba50de0cbcf", - "0x8d187c1e97638df0e4792b78e8c23967dac43d98ea268ca4aabea4e0fa06cb93183fd92d4c9df74118d7cc27bf54415e", - "0xa4c992f08c2f8bac0b74b3702fb0c75c9838d2ce90b28812019553d47613c14d8ce514d15443159d700b218c5a312c49", - "0xa6fd1874034a34c3ea962a316c018d9493d2b3719bb0ec4edbc7c56b240802b2228ab49bee6f04c8a3e9f6f24a48c1c2", - "0xb2efed8e799f8a15999020900dc2c58ece5a3641c90811b86a5198e593d7318b9d53b167818ccdfbe7df2414c9c34011", - "0x995ff7de6181ddf95e3ead746089c6148da3508e4e7a2323c81785718b754d356789b902e7e78e2edc6b0cbd4ff22c78", - "0x944073d24750a9068cbd020b834afc72d2dde87efac04482b3287b40678ad07588519a4176b10f2172a2c463d063a5cd", - "0x99db4b1bb76475a6fd75289986ef40367960279524378cc917525fb6ba02a145a218c1e9caeb99332332ab486a125ac0", - "0x89fce4ecd420f8e477af4353b16faabb39e063f3f3c98fde2858b1f2d1ef6eed46f0975a7c08f233b97899bf60ccd60a", - "0x8c09a4f07a02b80654798bc63aada39fd638d3e3c4236ccd8a5ca280350c31e4a89e5f4c9aafb34116e71da18c1226b8", - "0x85325cfa7ded346cc51a2894257eab56e7488dbff504f10f99f4cd2b630d913003761a50f175ed167e8073f1b6b63fb0", - "0xb678b4fbec09a8cc794dcbca185f133578f29e354e99c05f6d07ac323be20aecb11f781d12898168e86f2e0f09aca15e", - "0xa249cfcbca4d9ba0a13b5f6aac72bf9b899adf582f9746bb2ad043742b28915607467eb794fca3704278f9136f7642be", - "0x9438e036c836a990c5e17af3d78367a75b23c37f807228362b4d13e3ddcb9e431348a7b552d09d11a2e9680704a4514f", - "0x925ab70450af28c21a488bfb5d38ac994f784cf249d7fd9ad251bb7fd897a23e23d2528308c03415074d43330dc37ef4", - "0xa290563904d5a8c0058fc8330120365bdd2ba1fdbaef7a14bc65d4961bb4217acfaed11ab82669e359531f8bf589b8db", - "0xa7e07a7801b871fc9b981a71e195a3b4ba6b6313bc132b04796a125157e78fe5c11a3a46cf731a255ac2d78a4ae78cd0", - "0xb26cd2501ee72718b0eebab6fb24d955a71f363f36e0f6dff0ab1d2d7836dab88474c0cef43a2cc32701fca7e82f7df3", - "0xa1dc3b6c968f3de00f11275092290afab65b2200afbcfa8ddc70e751fa19dbbc300445d6d479a81bda3880729007e496", - "0xa9bc213e28b630889476a095947d323b9ac6461dea726f2dc9084473ae8e196d66fb792a21905ad4ec52a6d757863e7d", - "0xb25d178df8c2df8051e7c888e9fa677fde5922e602a95e966db9e4a3d6b23ce043d7dc48a5b375c6b7c78e966893e8c3", - "0xa1c8d88d72303692eaa7adf68ea41de4febec40cc14ae551bb4012afd786d7b6444a3196b5d9d5040655a3366d96b7cd", - "0xb22bd44f9235a47118a9bbe2ba5a2ba9ec62476061be2e8e57806c1a17a02f9a51403e849e2e589520b759abd0117683", - "0xb8add766050c0d69fe81d8d9ea73e1ed05f0135d093ff01debd7247e42dbb86ad950aceb3b50b9af6cdc14ab443b238f", - "0xaf2cf95f30ef478f018cf81d70d47d742120b09193d8bb77f0d41a5d2e1a80bfb467793d9e2471b4e0ad0cb2c3b42271", - "0x8af5ef2107ad284e246bb56e20fef2a255954f72de791cbdfd3be09f825298d8466064f3c98a50496c7277af32b5c0bc", - "0x85dc19558572844c2849e729395a0c125096476388bd1b14fa7f54a7c38008fc93e578da3aac6a52ff1504d6ca82db05", - "0xae8c9b43c49572e2e166d704caf5b4b621a3b47827bb2a3bcd71cdc599bba90396fd9a405261b13e831bb5d44c0827d7", - "0xa7ba7efede25f02e88f6f4cbf70643e76784a03d97e0fbd5d9437c2485283ad7ca3abb638a5f826cd9f6193e5dec0b6c", - "0x94a9d122f2f06ef709fd8016fd4b712d88052245a65a301f5f177ce22992f74ad05552b1f1af4e70d1eac62cef309752", - "0x82d999b3e7cf563833b8bc028ff63a6b26eb357dfdb3fd5f10e33a1f80a9b2cfa7814d871b32a7ebfbaa09e753e37c02", - "0xaec6edcde234df502a3268dd2c26f4a36a2e0db730afa83173f9c78fcb2b2f75510a02b80194327b792811caefda2725", - "0x94c0bfa66c9f91d462e9194144fdd12d96f9bbe745737e73bab8130607ee6ea9d740e2cfcbbd00a195746edb6369ee61", - "0xab7573dab8c9d46d339e3f491cb2826cabe8b49f85f1ede78d845fc3995537d1b4ab85140b7d0238d9c24daf0e5e2a7e", - "0x87e8b16832843251fe952dadfd01d41890ed4bb4b8fa0254550d92c8cced44368225eca83a6c3ad47a7f81ff8a80c984", - "0x9189d2d9a7c64791b19c0773ad4f0564ce6bea94aa275a917f78ad987f150fdb3e5e26e7fef9982ac184897ecc04683f", - "0xb3661bf19e2da41415396ae4dd051a9272e8a2580b06f1a1118f57b901fa237616a9f8075af1129af4eabfefedbe2f1c", - "0xaf43c86661fb15daf5d910a4e06837225e100fb5680bd3e4b10f79a2144c6ec48b1f8d6e6b98e067d36609a5d038889a", - "0x82ac0c7acaa83ddc86c5b4249aae12f28155989c7c6b91e5137a4ce05113c6cbc16f6c44948b0efd8665362d3162f16a", - "0x8f268d1195ab465beeeb112cd7ffd5d5548559a8bc01261106d3555533fc1971081b25558d884d552df0db1cddda89d8", - "0x8ef7caa5521f3e037586ce8ac872a4182ee20c7921c0065ed9986c047e3dda08294da1165f385d008b40d500f07d895f", - "0x8c2f98f6880550573fad46075d3eba26634b5b025ce25a0b4d6e0193352c8a1f0661064027a70fe8190b522405f9f4e3", - "0xb7653f353564feb164f0f89ec7949da475b8dad4a4d396d252fc2a884f6932d027b7eb2dc4d280702c74569319ed701a", - "0xa026904f4066333befd9b87a8fad791d014096af60cdd668ef919c24dbe295ff31f7a790e1e721ba40cf5105abca67f4", - "0x988f982004ada07a22dd345f2412a228d7a96b9cae2c487de42e392afe1e35c2655f829ce07a14629148ce7079a1f142", - "0x9616add009067ed135295fb74d5b223b006b312bf14663e547a0d306694ff3a8a7bb9cfc466986707192a26c0bce599f", - "0xad4c425de9855f6968a17ee9ae5b15e0a5b596411388cf976df62ecc6c847a6e2ddb2cea792a5f6e9113c2445dba3e5c", - "0xb698ac9d86afa3dc69ff8375061f88e3b0cff92ff6dfe747cebaf142e813c011851e7a2830c10993b715e7fd594604a9", - "0xa386fa189847bb3b798efca917461e38ead61a08b101948def0f82cd258b945ed4d45b53774b400af500670149e601b7", - "0x905c95abda2c68a6559d8a39b6db081c68cef1e1b4be63498004e1b2f408409be9350b5b5d86a30fd443e2b3e445640a", - "0x9116dade969e7ce8954afcdd43e5cab64dc15f6c1b8da9d2d69de3f02ba79e6c4f6c7f54d6bf586d30256ae405cd1e41", - "0xa3084d173eacd08c9b5084a196719b57e47a0179826fda73466758235d7ecdb87cbcf097bd6b510517d163a85a7c7edd", - "0x85bb00415ad3c9be99ff9ba83672cc59fdd24356b661ab93713a3c8eab34e125d8867f628a3c3891b8dc056e69cd0e83", - "0x8d58541f9f39ed2ee4478acce5d58d124031338ec11b0d55551f00a5a9a6351faa903a5d7c132dc5e4bb026e9cbd18e4", - "0xa622adf72dc250e54f672e14e128c700166168dbe0474cecb340da175346e89917c400677b1bc1c11fcc4cc26591d9db", - "0xb3f865014754b688ca8372e8448114fff87bf3ca99856ab9168894d0c4679782c1ced703f5b74e851b370630f5e6ee86", - "0xa7e490b2c40c2446fcd91861c020da9742c326a81180e38110558bb5d9f2341f1c1885e79b364e6419023d1cbdc47380", - "0xb3748d472b1062e54572badbb8e87ac36534407f74932e7fc5b8392d008e8e89758f1671d1e4d30ab0fa40551b13bb5e", - "0x89898a5c5ec4313aabc607b0049fd1ebad0e0c074920cf503c9275b564d91916c2c446d3096491c950b7af3ac5e4b0ed", - "0x8eb8c83fef2c9dd30ea44e286e9599ec5c20aba983f702e5438afe2e5b921884327ad8d1566c72395587efac79ca7d56", - "0xb92479599e806516ce21fb0bd422a1d1d925335ebe2b4a0a7e044dd275f30985a72b97292477053ac5f00e081430da80", - "0xa34ae450a324fe8a3c25a4d653a654f9580ed56bbea213b8096987bbad0f5701d809a17076435e18017fea4d69f414bc", - "0x81381afe6433d62faf62ea488f39675e0091835892ecc238e02acf1662669c6d3962a71a3db652f6fe3bc5f42a0e5dc5", - "0xa430d475bf8580c59111103316fe1aa79c523ea12f1d47a976bbfae76894717c20220e31cf259f08e84a693da6688d70", - "0xb842814c359754ece614deb7d184d679d05d16f18a14b288a401cef5dad2cf0d5ee90bad487b80923fc5573779d4e4e8", - "0x971d9a2627ff2a6d0dcf2af3d895dfbafca28b1c09610c466e4e2bff2746f8369de7f40d65b70aed135fe1d72564aa88", - "0x8f4ce1c59e22b1ce7a0664caaa7e53735b154cfba8d2c5cc4159f2385843de82ab58ed901be876c6f7fce69cb4130950", - "0x86cc9dc321b6264297987000d344fa297ef45bcc2a4df04e458fe2d907ad304c0ea2318e32c3179af639a9a56f3263cf", - "0x8229e0876dfe8f665c3fb19b250bd89d40f039bbf1b331468b403655be7be2e104c2fd07b9983580c742d5462ca39a43", - "0x99299d73066e8eb128f698e56a9f8506dfe4bd014931e86b6b487d6195d2198c6c5bf15cccb40ccf1f8ddb57e9da44a2", - "0xa3a3be37ac554c574b393b2f33d0a32a116c1a7cfeaf88c54299a4da2267149a5ecca71f94e6c0ef6e2f472b802f5189", - "0xa91700d1a00387502cdba98c90f75fbc4066fefe7cc221c8f0e660994c936badd7d2695893fde2260c8c11d5bdcdd951", - "0x8e03cae725b7f9562c5c5ab6361644b976a68bada3d7ca508abca8dfc80a469975689af1fba1abcf21bc2a190dab397d", - "0xb01461ad23b2a8fa8a6d241e1675855d23bc977dbf4714add8c4b4b7469ccf2375cec20e80cedfe49361d1a30414ac5b", - "0xa2673bf9bc621e3892c3d7dd4f1a9497f369add8cbaa3472409f4f86bd21ac67cfac357604828adfee6ada1835365029", - "0xa042dff4bf0dfc33c178ba1b335e798e6308915128de91b12e5dbbab7c4ac8d60a01f6aea028c3a6d87b9b01e4e74c01", - "0x86339e8a75293e4b3ae66b5630d375736b6e6b6b05c5cda5e73fbf7b2f2bd34c18a1d6cefede08625ce3046e77905cb8", - "0xaf2ebe1b7d073d03e3d98bc61af83bf26f7a8c130fd607aa92b75db22d14d016481b8aa231e2c9757695f55b7224a27f", - "0xa00ee882c9685e978041fd74a2c465f06e2a42ffd3db659053519925be5b454d6f401e3c12c746e49d910e4c5c9c5e8c", - "0x978a781c0e4e264e0dad57e438f1097d447d891a1e2aa0d5928f79a9d5c3faae6f258bc94fdc530b7b2fa6a9932bb193", - "0xaa4b7ce2e0c2c9e9655bf21e3e5651c8503bce27483017b0bf476be743ba06db10228b3a4c721219c0779747f11ca282", - "0xb003d1c459dacbcf1a715551311e45d7dbca83a185a65748ac74d1800bbeaba37765d9f5a1a221805c571910b34ebca8", - "0x95b6e531b38648049f0d19de09b881baa1f7ea3b2130816b006ad5703901a05da57467d1a3d9d2e7c73fb3f2e409363c", - "0xa6cf9c06593432d8eba23a4f131bb7f72b9bd51ab6b4b772a749fe03ed72b5ced835a349c6d9920dba2a39669cb7c684", - "0xaa3d59f6e2e96fbb66195bc58c8704e139fa76cd15e4d61035470bd6e305db9f98bcbf61ac1b95e95b69ba330454c1b3", - "0xb57f97959c208361de6d7e86dff2b873068adb0f158066e646f42ae90e650079798f165b5cd713141cd3a2a90a961d9a", - "0xa76ee8ed9052f6a7a8c69774bb2597be182942f08115baba03bf8faaeaee526feba86120039fe8ca7b9354c3b6e0a8e6", - "0x95689d78c867724823f564627d22d25010f278674c6d2d0cdb10329169a47580818995d1d727ce46c38a1e47943ebb89", - "0xab676d2256c6288a88e044b3d9ffd43eb9d5aaee00e8fc60ac921395fb835044c71a26ca948e557fed770f52d711e057", - "0x96351c72785c32e5d004b6f4a1259fb8153d631f0c93fed172f18e8ba438fbc5585c1618deeabd0d6d0b82173c2e6170", - "0x93dd8d3db576418e22536eba45ab7f56967c6c97c64260d6cddf38fb19c88f2ec5cd0e0156f50e70855eee8a2b879ffd", - "0xad6ff16f40f6de3d7a737f8e6cebd8416920c4ff89dbdcd75eabab414af9a6087f83ceb9aff7680aa86bff98bd09c8cc", - "0x84de53b11671abc9c38710e19540c5c403817562aeb22a88404cdaff792c1180f717dbdfe8f54940c062c4d032897429", - "0x872231b9efa1cdd447b312099a5c164c560440a9441d904e70f5abfc3b2a0d16be9a01aca5e0a2599a61e19407587e3d", - "0x88f44ac27094a2aa14e9dc40b099ee6d68f97385950f303969d889ee93d4635e34dff9239103bdf66a4b7cbba3e7eb7a", - "0xa59afebadf0260e832f6f44468443562f53fbaf7bcb5e46e1462d3f328ac437ce56edbca617659ac9883f9e13261fad7", - "0xb1990e42743a88de4deeacfd55fafeab3bc380cb95de43ed623d021a4f2353530bcab9594389c1844b1c5ea6634c4555", - "0x85051e841149a10e83f56764e042182208591396d0ce78c762c4a413e6836906df67f38c69793e158d64fef111407ba3", - "0x9778172bbd9b1f2ec6bbdd61829d7b39a7df494a818e31c654bf7f6a30139899c4822c1bf418dd4f923243067759ce63", - "0x9355005b4878c87804fc966e7d24f3e4b02bed35b4a77369d01f25a3dcbff7621b08306b1ac85b76fe7b4a3eb5f839b1", - "0x8f9dc6a54fac052e236f8f0e1f571ac4b5308a43acbe4cc8183bce26262ddaf7994e41cf3034a4cbeca2c505a151e3b1", - "0x8cc59c17307111723fe313046a09e0e32ea0cce62c13814ab7c6408c142d6a0311d801be4af53fc9240523f12045f9ef", - "0x8e6057975ed40a1932e47dd3ac778f72ee2a868d8540271301b1aa6858de1a5450f596466494a3e0488be4fbeb41c840", - "0x812145efbd6559ae13325d56a15940ca4253b17e72a9728986b563bb5acc13ec86453796506ac1a8f12bd6f9e4a288c3", - "0x911da0a6d6489eb3dab2ec4a16e36127e8a291ae68a6c2c9de33e97f3a9b1f00da57a94e270a0de79ecc5ecb45d19e83", - "0xb72ea85973f4b2a7e6e71962b0502024e979a73c18a9111130e158541fa47bbaaf53940c8f846913a517dc69982ba9e1", - "0xa7a56ad1dbdc55f177a7ad1d0af78447dc2673291e34e8ab74b26e2e2e7d8c5fe5dc89e7ef60f04a9508847b5b3a8188", - "0xb52503f6e5411db5d1e70f5fb72ccd6463fa0f197b3e51ca79c7b5a8ab2e894f0030476ada72534fa4eb4e06c3880f90", - "0xb51c7957a3d18c4e38f6358f2237b3904618d58b1de5dec53387d25a63772e675a5b714ad35a38185409931157d4b529", - "0xb86b4266e719d29c043d7ec091547aa6f65bbf2d8d831d1515957c5c06513b72aa82113e9645ad38a7bc3f5383504fa6", - "0xb95b547357e6601667b0f5f61f261800a44c2879cf94e879def6a105b1ad2bbf1795c3b98a90d588388e81789bd02681", - "0xa58fd4c5ae4673fa350da6777e13313d5d37ed1dafeeb8f4f171549765b84c895875d9d3ae6a9741f3d51006ef81d962", - "0x9398dc348d078a604aadc154e6eef2c0be1a93bb93ba7fe8976edc2840a3a318941338cc4d5f743310e539d9b46613d2", - "0x902c9f0095014c4a2f0dccaaab543debba6f4cc82c345a10aaf4e72511725dbed7a34cd393a5f4e48a3e5142b7be84ed", - "0xa7c0447849bb44d04a0393a680f6cd390093484a79a147dd238f5d878030d1c26646d88211108e59fe08b58ad20c6fbd", - "0x80db045535d6e67a422519f5c89699e37098449d249698a7cc173a26ccd06f60238ae6cc7242eb780a340705c906790c", - "0x8e52b451a299f30124505de2e74d5341e1b5597bdd13301cc39b05536c96e4380e7f1b5c7ef076f5b3005a868657f17c", - "0x824499e89701036037571761e977654d2760b8ce21f184f2879fda55d3cda1e7a95306b8abacf1caa79d3cc075b9d27f", - "0x9049b956b77f8453d2070607610b79db795588c0cec12943a0f5fe76f358dea81e4f57a4692112afda0e2c05c142b26f", - "0x81911647d818a4b5f4990bfd4bc13bf7be7b0059afcf1b6839333e8569cdb0172fd2945410d88879349f677abaed5eb3", - "0xad4048f19b8194ed45b6317d9492b71a89a66928353072659f5ce6c816d8f21e69b9d1817d793effe49ca1874daa1096", - "0x8d22f7b2ddb31458661abd34b65819a374a1f68c01fc6c9887edeba8b80c65bceadb8f57a3eb686374004b836261ef67", - "0x92637280c259bc6842884db3d6e32602a62252811ae9b019b3c1df664e8809ffe86db88cfdeb8af9f46435c9ee790267", - "0xa2f416379e52e3f5edc21641ea73dc76c99f7e29ea75b487e18bd233856f4c0183429f378d2bfc6cd736d29d6cadfa49", - "0x882cb6b76dbdc188615dcf1a8439eba05ffca637dd25197508156e03c930b17b9fed2938506fdd7b77567cb488f96222", - "0xb68b621bb198a763fb0634eddb93ed4b5156e59b96c88ca2246fd1aea3e6b77ed651e112ac41b30cd361fadc011d385e", - "0xa3cb22f6b675a29b2d1f827cacd30df14d463c93c3502ef965166f20d046af7f9ab7b2586a9c64f4eae4fad2d808a164", - "0x8302d9ce4403f48ca217079762ce42cee8bc30168686bb8d3a945fbd5acd53b39f028dce757b825eb63af2d5ae41169d", - "0xb2eef1fbd1a176f1f4cd10f2988c7329abe4eb16c7405099fb92baa724ab397bc98734ef7d4b24c0f53dd90f57520d04", - "0xa1bbef0bd684a3f0364a66bde9b29326bac7aa3dde4caed67f14fb84fed3de45c55e406702f1495a3e2864d4ee975030", - "0x976acdb0efb73e3a3b65633197692dedc2adaed674291ae3df76b827fc866d214e9cac9ca46baefc4405ff13f953d936", - "0xb9fbf71cc7b6690f601f0b1c74a19b7d14254183a2daaafec7dc3830cba5ae173d854bbfebeca985d1d908abe5ef0cda", - "0x90591d7b483598c94e38969c4dbb92710a1a894bcf147807f1bcbd8aa3ac210b9f2be65519aa829f8e1ccdc83ad9b8cf", - "0xa30568577c91866b9c40f0719d46b7b3b2e0b4a95e56196ac80898a2d89cc67880e1229933f2cd28ee3286f8d03414d7", - "0x97589a88c3850556b359ec5e891f0937f922a751ac7c95949d3bbc7058c172c387611c0f4cb06351ef02e5178b3dd9e4", - "0x98e7bbe27a1711f4545df742f17e3233fbcc63659d7419e1ca633f104cb02a32c84f2fac23ca2b84145c2672f68077ab", - "0xa7ddb91636e4506d8b7e92aa9f4720491bb71a72dadc47c7f4410e15f93e43d07d2b371951a0e6a18d1bd087aa96a5c4", - "0xa7c006692227a06db40bceac3d5b1daae60b5692dd9b54772bedb5fea0bcc91cbcdb530cac31900ffc70c5b3ffadc969", - "0x8d3ec6032778420dfa8be52066ba0e623467df33e4e1901dbadd586c5d750f4ccde499b5197e26b9ea43931214060f69", - "0x8d9a8410518ea64f89df319bfd1fc97a0971cdb9ad9b11d1f8fe834042ea7f8dce4db56eeaf179ff8dda93b6db93e5ce", - "0xa3c533e9b3aa04df20b9ff635cb1154ce303e045278fcf3f10f609064a5445552a1f93989c52ce852fd0bbd6e2b6c22e", - "0x81934f3a7f8c1ae60ec6e4f212986bcc316118c760a74155d06ce0a8c00a9b9669ec4e143ca214e1b995e41271774fd9", - "0xab8e2d01a71192093ef8fafa7485e795567cc9db95a93fb7cc4cf63a391ef89af5e2bfad4b827fffe02b89271300407f", - "0x83064a1eaa937a84e392226f1a60b7cfad4efaa802f66de5df7498962f7b2649924f63cd9962d47906380b97b9fe80e1", - "0xb4f5e64a15c6672e4b55417ee5dc292dcf93d7ea99965a888b1cc4f5474a11e5b6520eacbcf066840b343f4ceeb6bf33", - "0xa63d278b842456ef15c278b37a6ea0f27c7b3ffffefca77c7a66d2ea06c33c4631eb242bbb064d730e70a8262a7b848a", - "0x83a41a83dbcdf0d22dc049de082296204e848c453c5ab1ba75aa4067984e053acf6f8b6909a2e1f0009ed051a828a73b", - "0x819485b036b7958508f15f3c19436da069cbe635b0318ebe8c014cf1ef9ab2df038c81161b7027475bcfa6fff8dd9faf", - "0xaa40e38172806e1e045e167f3d1677ef12d5dcdc89b43639a170f68054bd196c4fae34c675c1644d198907a03f76ba57", - "0x969bae484883a9ed1fbed53b26b3d4ee4b0e39a6c93ece5b3a49daa01444a1c25727dabe62518546f36b047b311b177c", - "0x80a9e73a65da99664988b238096a090d313a0ee8e4235bc102fa79bb337b51bb08c4507814eb5baec22103ec512eaab0", - "0x86604379aec5bddda6cbe3ef99c0ac3a3c285b0b1a15b50451c7242cd42ae6b6c8acb717dcca7917838432df93a28502", - "0xa23407ee02a495bed06aa7e15f94cfb05c83e6d6fba64456a9bbabfa76b2b68c5c47de00ba169e710681f6a29bb41a22", - "0x98cff5ecc73b366c6a01b34ac9066cb34f7eeaf4f38a5429bad2d07e84a237047e2a065c7e8a0a6581017dadb4695deb", - "0x8de9f68a938f441f3b7ab84bb1f473c5f9e5c9e139e42b7ccee1d254bd57d0e99c2ccda0f3198f1fc5737f6023dd204e", - "0xb0ce48d815c2768fb472a315cad86aa033d0e9ca506f146656e2941829e0acb735590b4fbc713c2d18d3676db0a954ac", - "0x82f485cdefd5642a6af58ac6817991c49fac9c10ace60f90b27f1788cc026c2fe8afc83cf499b3444118f9f0103598a8", - "0x82c24550ed512a0d53fc56f64cc36b553823ae8766d75d772dacf038c460f16f108f87a39ceef7c66389790f799dbab3", - "0x859ffcf1fe9166388316149b9acc35694c0ea534d43f09dae9b86f4aa00a23b27144dda6a352e74b9516e8c8d6fc809c", - "0xb8f7f353eec45da77fb27742405e5ad08d95ec0f5b6842025be9def3d9892f85eb5dd0921b41e6eff373618dba215bca", - "0x8ccca4436f9017e426229290f5cd05eac3f16571a4713141a7461acfe8ae99cd5a95bf5b6df129148693c533966145da", - "0xa2c67ecc19c0178b2994846fea4c34c327a5d786ac4b09d1d13549d5be5996d8a89021d63d65cb814923388f47cc3a03", - "0xaa0ff87d676b418ec08f5cbf577ac7e744d1d0e9ebd14615b550eb86931eafd2a36d4732cc5d6fab1713fd7ab2f6f7c0", - "0x8aef4730bb65e44efd6bb9441c0ae897363a2f3054867590a2c2ecf4f0224e578c7a67f10b40f8453d9f492ac15a9b2d", - "0x86a187e13d8fba5addcfdd5b0410cedd352016c930f913addd769ee09faa6be5ca3e4b1bdb417a965c643a99bd92be42", - "0xa0a4e9632a7a094b14b29b78cd9c894218cdf6783e61671e0203865dc2a835350f465fbaf86168f28af7c478ca17bc89", - "0xa8c7b02d8deff2cd657d8447689a9c5e2cd74ef57c1314ac4d69084ac24a7471954d9ff43fe0907d875dcb65fd0d3ce5", - "0x97ded38760aa7be6b6960b5b50e83b618fe413cbf2bcc1da64c05140bcc32f5e0e709cd05bf8007949953fac5716bad9", - "0xb0d293835a24d64c2ae48ce26e550b71a8c94a0883103757fb6b07e30747f1a871707d23389ba2b2065fa6bafe220095", - "0x8f9e291bf849feaa575592e28e3c8d4b7283f733d41827262367ea1c40f298c7bcc16505255a906b62bf15d9f1ba85fb", - "0x998f4e2d12708b4fd85a61597ca2eddd750f73c9e0c9b3cf0825d8f8e01f1628fd19797dcaed3b16dc50331fc6b8b821", - "0xb30d1f8c115d0e63bf48f595dd10908416774c78b3bbb3194192995154d80ea042d2e94d858de5f8aa0261b093c401fd", - "0xb5d9c75bb41f964cbff3f00e96d9f1480c91df8913f139f0d385d27a19f57a820f838eb728e46823cbff00e21c660996", - "0xa6edec90b5d25350e2f5f0518777634f9e661ec9d30674cf5b156c4801746d62517751d90074830ac0f4b09911c262f1", - "0x82f98da1264b6b75b8fbeb6a4d96d6a05b25c24db0d57ba3a38efe3a82d0d4e331b9fc4237d6494ccfe4727206457519", - "0xb89511843453cf4ecd24669572d6371b1e529c8e284300c43e0d5bb6b3aaf35aeb634b3cb5c0a2868f0d5e959c1d0772", - "0xa82bf065676583e5c1d3b81987aaae5542f522ba39538263a944bb33ea5b514c649344a96c0205a3b197a3f930fcda6c", - "0xa37b47ea527b7e06c460776aa662d9a49ff4149d3993f1a974b0dd165f7171770d189b0e2ea54fd5fccb6a14b116e68a", - "0xa1017677f97dda818274d47556d09d0e4ccacb23a252f82a6cfe78c630ad46fb9806307445a59fb61262182de3a2b29c", - "0xb01e9fcac239ba270e6877b79273ddd768bf8a51d2ed8a051b1c11e18eff3de5920e2fcbfbd26f06d381eddd3b1f1e1b", - "0x82fcd53d803b1c8e4ed76adc339b7f3a5962d37042b9683aabac7513ac68775d4a566a9460183926a6a95dbe7d551a1f", - "0xa763e78995d55cd21cdb7ef75d9642d6e1c72453945e346ab6690c20a4e1eeec61bb848ef830ae4b56182535e3c71d8f", - "0xb769f4db602251d4b0a1186782799bdcef66de33c110999a5775c50b349666ffd83d4c89714c4e376f2efe021a5cfdb2", - "0xa59cbd1b785efcfa6e83fc3b1d8cf638820bc0c119726b5368f3fba9dce8e3414204fb1f1a88f6c1ff52e87961252f97", - "0x95c8c458fd01aa23ecf120481a9c6332ebec2e8bb70a308d0576926a858457021c277958cf79017ddd86a56cacc2d7db", - "0x82eb41390800287ae56e77f2e87709de5b871c8bdb67c10a80fc65f3acb9f7c29e8fa43047436e8933f27449ea61d94d", - "0xb3ec25e3545eb83aed2a1f3558d1a31c7edde4be145ecc13b33802654b77dc049b4f0065069dd9047b051e52ab11dcdd", - "0xb78a0c715738f56f0dc459ab99e252e3b579b208142836b3c416b704ca1de640ca082f29ebbcee648c8c127df06f6b1e", - "0xa4083149432eaaf9520188ebf4607d09cf664acd1f471d4fb654476e77a9eaae2251424ffda78d09b6cb880df35c1219", - "0x8c52857d68d6e9672df3db2df2dbf46b516a21a0e8a18eec09a6ae13c1ef8f369d03233320dd1c2c0bbe00abfc1ea18b", - "0x8c856089488803066bff3f8d8e09afb9baf20cecc33c8823c1c0836c3d45498c3de37e87c016b705207f60d2b00f8609", - "0x831a3df39be959047b2aead06b4dcd3012d7b29417f642b83c9e8ce8de24a3dbbd29c6fdf55e2db3f7ea04636c94e403", - "0xaed84d009f66544addabe404bf6d65af7779ce140dc561ff0c86a4078557b96b2053b7b8a43432ffb18cd814f143b9da", - "0x93282e4d72b0aa85212a77b336007d8ba071eea17492da19860f1ad16c1ea8867ccc27ef5c37c74b052465cc11ea4f52", - "0xa7b78b8c8d057194e8d68767f1488363f77c77bddd56c3da2bc70b6354c7aa76247c86d51f7371aa38a4aa7f7e3c0bb7", - "0xb1c77283d01dcd1bde649b5b044eac26befc98ff57cbee379fb5b8e420134a88f2fc7f0bf04d15e1fbd45d29e7590fe6", - "0xa4aa8de70330a73b2c6458f20a1067eed4b3474829b36970a8df125d53bbdda4f4a2c60063b7cccb0c80fc155527652f", - "0x948a6c79ba1b8ad7e0bed2fae2f0481c4e41b4d9bbdd9b58164e28e9065700e83f210c8d5351d0212e0b0b68b345b3a5", - "0x86a48c31dcbbf7b082c92d28e1f613a2378a910677d7db3a349dc089e4a1e24b12eee8e8206777a3a8c64748840b7387", - "0x976adb1af21e0fc34148917cf43d933d7bfd3fd12ed6c37039dcd5a4520e3c6cf5868539ba5bf082326430deb8a4458d", - "0xb93e1a4476f2c51864bb4037e7145f0635eb2827ab91732b98d49b6c07f6ac443111aa1f1da76d1888665cb897c3834e", - "0x8afd46fb23bf869999fa19784b18a432a1f252d09506b8dbb756af900518d3f5f244989b3d7c823d9029218c655d3dc6", - "0x83f1e59e3abeed18cdc632921672673f1cb6e330326e11c4e600e13e0d5bc11bdc970ae12952e15103a706fe720bf4d6", - "0x90ce4cc660714b0b673d48010641c09c00fc92a2c596208f65c46073d7f349dd8e6e077ba7dcef9403084971c3295b76", - "0x8b09b0f431a7c796561ecf1549b85048564de428dac0474522e9558b6065fede231886bc108539c104ce88ebd9b5d1b0", - "0x85d6e742e2fb16a7b0ba0df64bc2c0dbff9549be691f46a6669bca05e89c884af16822b85faefefb604ec48c8705a309", - "0xa87989ee231e468a712c66513746fcf03c14f103aadca0eac28e9732487deb56d7532e407953ab87a4bf8961588ef7b0", - "0xb00da10efe1c29ee03c9d37d5918e391ae30e48304e294696b81b434f65cf8c8b95b9d1758c64c25e534d045ba28696f", - "0x91c0e1fb49afe46c7056400baa06dbb5f6e479db78ee37e2d76c1f4e88994357e257b83b78624c4ef6091a6c0eb8254d", - "0x883fb797c498297ccbf9411a3e727c3614af4eccde41619b773dc7f3259950835ee79453debf178e11dec4d3ada687a0", - "0xa14703347e44eb5059070b2759297fcfcfc60e6893c0373eea069388eba3950aa06f1c57cd2c30984a2d6f9e9c92c79e", - "0xafebc7585b304ceba9a769634adff35940e89cd32682c78002822aab25eec3edc29342b7f5a42a56a1fec67821172ad5", - "0xaea3ff3822d09dba1425084ca95fd359718d856f6c133c5fabe2b2eed8303b6e0ba0d8698b48b93136a673baac174fd9", - "0xaf2456a09aa777d9e67aa6c7c49a1845ea5cdda2e39f4c935c34a5f8280d69d4eec570446998cbbe31ede69a91e90b06", - "0x82cada19fed16b891ef3442bafd49e1f07c00c2f57b2492dd4ee36af2bd6fd877d6cb41188a4d6ce9ec8d48e8133d697", - "0x82a21034c832287f616619a37c122cee265cc34ae75e881fcaea4ea7f689f3c2bc8150bbf7dbcfd123522bfb7f7b1d68", - "0x86877217105f5d0ec3eeff0289fc2a70d505c9fdf7862e8159553ef60908fb1a27bdaf899381356a4ef4649072a9796c", - "0x82b196e49c6e861089a427c0b4671d464e9d15555ffb90954cd0d630d7ae02eb3d98ceb529d00719c2526cd96481355a", - "0xa29b41d0d43d26ce76d4358e0db2b77df11f56e389f3b084d8af70a636218bd3ac86b36a9fe46ec9058c26a490f887f7", - "0xa4311c4c20c4d7dd943765099c50f2fd423e203ccfe98ff00087d205467a7873762510cac5fdce7a308913ed07991ed7", - "0xb1f040fc5cc51550cb2c25cf1fd418ecdd961635a11f365515f0cb4ffb31da71f48128c233e9cc7c0cf3978d757ec84e", - "0xa9ebae46f86d3bd543c5f207ed0d1aed94b8375dc991161d7a271f01592912072e083e2daf30c146430894e37325a1b9", - "0x826418c8e17ad902b5fe88736323a47e0ca7a44bce4cbe27846ec8fe81de1e8942455dda6d30e192cdcc73e11df31256", - "0x85199db563427c5edcbac21f3d39fec2357be91fb571982ddcdc4646b446ad5ced84410de008cb47b3477ee0d532daf8", - "0xb7eed9cd400b2ca12bf1d9ae008214b8561fb09c8ad9ff959e626ffde00fee5ff2f5b6612e231f2a1a9b1646fcc575e3", - "0x8b40bf12501dcbac78f5a314941326bfcddf7907c83d8d887d0bb149207f85d80cd4dfbd7935439ea7b14ea39a3fded7", - "0x83e3041af302485399ba6cd5120e17af61043977083887e8d26b15feec4a6b11171ac5c06e6ad0971d4b58a81ff12af3", - "0x8f5b9a0eecc589dbf8c35a65d5e996a659277ef6ea509739c0cb7b3e2da9895e8c8012de662e5b23c5fa85d4a8f48904", - "0x835d71ed5e919d89d8e6455f234f3ff215462c4e3720c371ac8c75e83b19dfe3ae15a81547e4dc1138e5f5997f413cc9", - "0x8b7d2e4614716b1db18e9370176ea483e6abe8acdcc3dcdf5fb1f4d22ca55d652feebdccc171c6de38398d9f7bfdec7a", - "0x93eace72036fe57d019676a02acf3d224cf376f166658c1bf705db4f24295881d477d6fdd7916efcfceff8c7a063deda", - "0xb1ac460b3d516879a84bc886c54f020a9d799e7c49af3e4d7de5bf0d2793c852254c5d8fe5616147e6659512e5ccb012", - "0xacd0947a35cb167a48bcd9667620464b54ac0e78f9316b4aa92dcaab5422d7a732087e52e1c827faa847c6b2fe6e7766", - "0x94ac33d21c3d12ff762d32557860e911cd94d666609ddcc42161b9c16f28d24a526e8b10bb03137257a92cec25ae637d", - "0x832e02058b6b994eadd8702921486241f9a19e68ed1406dad545e000a491ae510f525ccf9d10a4bba91c68f2c53a0f58", - "0x9471035d14f78ff8f463b9901dd476b587bb07225c351161915c2e9c6114c3c78a501379ab6fb4eb03194c457cbd22bf", - "0xab64593e034c6241d357fcbc32d8ea5593445a5e7c24cac81ad12bd2ef01843d477a36dc1ba21dbe63b440750d72096a", - "0x9850f3b30045e927ad3ec4123a32ed2eb4c911f572b6abb79121873f91016f0d80268de8b12e2093a4904f6e6cab7642", - "0x987212c36b4722fe2e54fa30c52b1e54474439f9f35ca6ad33c5130cd305b8b54b532dd80ffd2c274105f20ce6d79f6e", - "0x8b4d0c6abcb239b5ed47bef63bc17efe558a27462c8208fa652b056e9eae9665787cd1aee34fbb55beb045c8bfdb882b", - "0xa9f3483c6fee2fe41312d89dd4355d5b2193ac413258993805c5cbbf0a59221f879386d3e7a28e73014f10e65dd503d9", - "0xa2225da3119b9b7c83d514b9f3aeb9a6d9e32d9cbf9309cbb971fd53c4b2c001d10d880a8ad8a7c281b21d85ceca0b7c", - "0xa050be52e54e676c151f7a54453bbb707232f849beab4f3bf504b4d620f59ed214409d7c2bd3000f3ff13184ccda1c35", - "0xadbccf681e15b3edb6455a68d292b0a1d0f5a4cb135613f5e6db9943f02181341d5755875db6ee474e19ace1c0634a28", - "0x8b6eff675632a6fad0111ec72aacc61c7387380eb87933fd1d098856387d418bd38e77d897e65d6fe35951d0627c550b", - "0xaabe2328ddf90989b15e409b91ef055cb02757d34987849ae6d60bef2c902bf8251ed21ab30acf39e500d1d511e90845", - "0x92ba4eb1f796bc3d8b03515f65c045b66e2734c2da3fc507fdd9d6b5d1e19ab3893726816a32141db7a31099ca817d96", - "0x8a98b3cf353138a1810beb60e946183803ef1d39ac4ea92f5a1e03060d35a4774a6e52b14ead54f6794d5f4022b8685c", - "0x909f8a5c13ec4a59b649ed3bee9f5d13b21d7f3e2636fd2bb3413c0646573fdf9243d63083356f12f5147545339fcd55", - "0x9359d914d1267633141328ed0790d81c695fea3ddd2d406c0df3d81d0c64931cf316fe4d92f4353c99ff63e2aefc4e34", - "0xb88302031681b54415fe8fbfa161c032ea345c6af63d2fb8ad97615103fd4d4281c5a9cae5b0794c4657b97571a81d3b", - "0x992c80192a519038082446b1fb947323005b275e25f2c14c33cc7269e0ec038581cc43705894f94bad62ae33a8b7f965", - "0xa78253e3e3eece124bef84a0a8807ce76573509f6861d0b6f70d0aa35a30a123a9da5e01e84969708c40b0669eb70aa6", - "0x8d5724de45270ca91c94792e8584e676547d7ac1ac816a6bb9982ee854eb5df071d20545cdfd3771cd40f90e5ba04c8e", - "0x825a6f586726c68d45f00ad0f5a4436523317939a47713f78fd4fe81cd74236fdac1b04ecd97c2d0267d6f4981d7beb1" - ], - "g2_monomial": [ - "0x93e02b6052719f607dacd3a088274f65596bd0d09920b61ab5da61bbdc7f5049334cf11213945d57e5ac7d055d042b7e024aa2b2f08f0a91260805272dc51051c6e47ad4fa403b02b4510b647ae3d1770bac0326a805bbefd48056c8c121bdb8", - "0xb5bfd7dd8cdeb128843bc287230af38926187075cbfbefa81009a2ce615ac53d2914e5870cb452d2afaaab24f3499f72185cbfee53492714734429b7b38608e23926c911cceceac9a36851477ba4c60b087041de621000edc98edada20c1def2", - "0xb5337ba0ce5d37224290916e268e2060e5c14f3f9fc9e1ec3af5a958e7a0303122500ce18f1a4640bf66525bd10e763501fe986d86649d8d45143c08c3209db3411802c226e9fe9a55716ac4a0c14f9dcef9e70b2bb309553880dc5025eab3cc", - "0xb3c1dcdc1f62046c786f0b82242ef283e7ed8f5626f72542aa2c7a40f14d9094dd1ebdbd7457ffdcdac45fd7da7e16c51200b06d791e5e43e257e45efdf0bd5b06cd2333beca2a3a84354eb48662d83aef5ecf4e67658c851c10b13d8d87c874", - "0x954d91c7688983382609fca9e211e461f488a5971fd4e40d7e2892037268eacdfd495cfa0a7ed6eb0eb11ac3ae6f651716757e7526abe1e06c64649d80996fd3105c20c4c94bc2b22d97045356fe9d791f21ea6428ac48db6f9e68e30d875280", - "0x88a6b6bb26c51cf9812260795523973bb90ce80f6820b6c9048ab366f0fb96e48437a7f7cb62aedf64b11eb4dfefebb0147608793133d32003cb1f2dc47b13b5ff45f1bb1b2408ea45770a08dbfaec60961acb8119c47b139a13b8641e2c9487", - "0x85cd7be9728bd925d12f47fb04b32d9fad7cab88788b559f053e69ca18e463113ecc8bbb6dbfb024835f901b3a957d3108d6770fb26d4c8be0a9a619f6e3a4bf15cbfd48e61593490885f6cee30e4300c5f9cf5e1c08e60a2d5b023ee94fcad0", - "0x80477dba360f04399821a48ca388c0fa81102dd15687fea792ee8c1114e00d1bc4839ad37ac58900a118d863723acfbe08126ea883be87f50e4eabe3b5e72f5d9e041db8d9b186409fd4df4a7dde38c0e0a3b1ae29b098e5697e7f110b6b27e4", - "0xb7a6aec08715a9f8672a2b8c367e407be37e59514ac19dd4f0942a68007bba3923df22da48702c63c0d6b3efd3c2d04e0fe042d8b5a54d562f9f33afc4865dcbcc16e99029e25925580e87920c399e710d438ac1ce3a6dc9b0d76c064a01f6f7", - "0xac1b001edcea02c8258aeffbf9203114c1c874ad88dae1184fadd7d94cd09053649efd0ca413400e6e9b5fa4eac33261000af88b6bd0d2abf877a4f0355d2fb4d6007adb181695201c5432e50b850b51b3969f893bddf82126c5a71b042b7686", - "0x90043fda4de53fb364fab2c04be5296c215599105ecff0c12e4917c549257125775c29f2507124d15f56e30447f367db0596c33237242c02d83dfd058735f1e3c1ff99069af55773b6d51d32a68bf75763f59ec4ee7267932ae426522b8aaab6", - "0xa8660ce853e9dc08271bf882e29cd53397d63b739584dda5263da4c7cc1878d0cf6f3e403557885f557e184700575fee016ee8542dec22c97befe1d10f414d22e84560741cdb3e74c30dda9b42eeaaf53e27822de2ee06e24e912bf764a9a533", - "0x8fe3921a96d0d065e8aa8fce9aa42c8e1461ca0470688c137be89396dd05103606dab6cdd2a4591efd6addf72026c12e065da7be276dee27a7e30afa2bd81c18f1516e7f068f324d0bad9570b95f6bd02c727cd2343e26db0887c3e4e26dceda", - "0x8ae1ad97dcb9c192c9a3933541b40447d1dc4eebf380151440bbaae1e120cc5cdf1bcea55180b128d8e180e3af623815191d063cc0d7a47d55fb7687b9d87040bf7bc1a7546b07c61db5ccf1841372d7c2fe4a5431ffff829f3c2eb590b0b710", - "0x8c2fa96870a88150f7876c931e2d3cc2adeaaaf5c73ef5fa1cf9dfa0991ae4819f9321af7e916e5057d87338e630a2f21242c29d76963cf26035b548d2a63d8ad7bd6efefa01c1df502cbdfdfe0334fb21ceb9f686887440f713bf17a89b8081", - "0xb9aa98e2f02bb616e22ee5dd74c7d1049321ac9214d093a738159850a1dbcc7138cb8d26ce09d8296368fd5b291d74fa17ac7cc1b80840fdd4ee35e111501e3fa8485b508baecda7c1ab7bd703872b7d64a2a40b3210b6a70e8a6ffe0e5127e3", - "0x9292db67f8771cdc86854a3f614a73805bf3012b48f1541e704ea4015d2b6b9c9aaed36419769c87c49f9e3165f03edb159c23b3a49c4390951f78e1d9b0ad997129b17cdb57ea1a6638794c0cca7d239f229e589c5ae4f9fe6979f7f8cba1d7", - "0x91cd9e86550f230d128664f7312591fee6a84c34f5fc7aed557bcf986a409a6de722c4330453a305f06911d2728626e611acfdf81284f77f60a3a1595053a9479964fd713117e27c0222cc679674b03bc8001501aaf9b506196c56de29429b46", - "0xa9516b73f605cc31b89c68b7675dc451e6364595243d235339437f556cf22d745d4250c1376182273be2d99e02c10eee047410a43eff634d051aeb784e76cb3605d8e079b9eb6ad1957dfdf77e1cd32ce4a573c9dfcc207ca65af6eb187f6c3d", - "0xa9667271f7d191935cc8ad59ef3ec50229945faea85bfdfb0d582090f524436b348aaa0183b16a6231c00332fdac2826125b8c857a2ed9ec66821cfe02b3a2279be2412441bc2e369b255eb98614e4be8490799c4df22f18d47d24ec70bba5f7", - "0xa4371144d2aa44d70d3cb9789096d3aa411149a6f800cb46f506461ee8363c8724667974252f28aea61b6030c05930ac039c1ee64bb4bd56532a685cae182bf2ab935eee34718cffcb46cae214c77aaca11dbb1320faf23c47247db1da04d8dc", - "0x89a7eb441892260b7e81168c386899cd84ffc4a2c5cad2eae0d1ab9e8b5524662e6f660fe3f8bfe4c92f60b060811bc605b14c5631d16709266886d7885a5eb5930097127ec6fb2ebbaf2df65909cf48f253b3d5e22ae48d3e9a2fd2b01f447e", - "0x9648c42ca97665b5eccb49580d8532df05eb5a68db07f391a2340769b55119eaf4c52fe4f650c09250fa78a76c3a1e271799b8333cc2628e3d4b4a6a3e03da1f771ecf6516dd63236574a7864ff07e319a6f11f153406280d63af9e2b5713283", - "0x9663bf6dd446ea7a90658ee458578d4196dc0b175ef7fcfa75f44d41670850774c2e46c5a6be132a2c072a3c0180a24f0305d1acac49d2d79878e5cda80c57feda3d01a6af12e78b5874e2a4b3717f11c97503b41a4474e2e95b179113726199", - "0xb212aeb4814e0915b432711b317923ed2b09e076aaf558c3ae8ef83f9e15a83f9ea3f47805b2750ab9e8106cb4dc6ad003522c84b03dc02829978a097899c773f6fb31f7fe6b8f2d836d96580f216fec20158f1590c3e0d7850622e15194db05", - "0x925f005059bf07e9ceccbe66c711b048e236ade775720d0fe479aebe6e23e8af281225ad18e62458dc1b03b42ad4ca290d4aa176260604a7aad0d9791337006fbdebe23746f8060d42876f45e4c83c3643931392fde1cd13ff8bddf8111ef974", - "0x9553edb22b4330c568e156a59ef03b26f5c326424f830fe3e8c0b602f08c124730ffc40bc745bec1a22417adb22a1a960243a10565c2be3066bfdb841d1cd14c624cd06e0008f4beb83f972ce6182a303bee3fcbcabc6cfe48ec5ae4b7941bfc", - "0x935f5a404f0a78bdcce709899eda0631169b366a669e9b58eacbbd86d7b5016d044b8dfc59ce7ed8de743ae16c2343b50e2f925e88ba6319e33c3fc76b314043abad7813677b4615c8a97eb83cc79de4fedf6ccbcfa4d4cbf759a5a84e4d9742", - "0xa5b014ab936eb4be113204490e8b61cd38d71da0dec7215125bcd131bf3ab22d0a32ce645bca93e7b3637cf0c2db3d6601a0ddd330dc46f9fae82abe864ffc12d656c88eb50c20782e5bb6f75d18760666f43943abb644b881639083e122f557", - "0x935b7298ae52862fa22bf03bfc1795b34c70b181679ae27de08a9f5b4b884f824ef1b276b7600efa0d2f1d79e4a470d51692fd565c5cf8343dd80e5d3336968fc21c09ba9348590f6206d4424eb229e767547daefa98bc3aa9f421158dee3f2a", - "0x9830f92446e708a8f6b091cc3c38b653505414f8b6507504010a96ffda3bcf763d5331eb749301e2a1437f00e2415efb01b799ad4c03f4b02de077569626255ac1165f96ea408915d4cf7955047620da573e5c439671d1fa5c833fb11de7afe6", - "0x840dcc44f673fff3e387af2bb41e89640f2a70bcd2b92544876daa92143f67c7512faf5f90a04b7191de01f3e2b1bde00622a20dc62ca23bbbfaa6ad220613deff43908382642d4d6a86999f662efd64b1df448b68c847cfa87630a3ffd2ec76", - "0x92950c895ed54f7f876b2fda17ecc9c41b7accfbdd42c210cc5b475e0737a7279f558148531b5c916e310604a1de25a80940c94fe5389ae5d6a5e9c371be67bceea1877f5401725a6595bcf77ece60905151b6dfcb68b75ed2e708c73632f4fd", - "0x8010246bf8e94c25fd029b346b5fbadb404ef6f44a58fd9dd75acf62433d8cc6db66974f139a76e0c26dddc1f329a88214dbb63276516cf325c7869e855d07e0852d622c332ac55609ba1ec9258c45746a2aeb1af0800141ee011da80af175d4", - "0xb0f1bad257ebd187bdc3f37b23f33c6a5d6a8e1f2de586080d6ada19087b0e2bf23b79c1b6da1ee82271323f5bdf3e1b018586b54a5b92ab6a1a16bb3315190a3584a05e6c37d5ca1e05d702b9869e27f513472bcdd00f4d0502a107773097da", - "0x9636d24f1ede773ce919f309448dd7ce023f424afd6b4b69cb98c2a988d849a283646dc3e469879daa1b1edae91ae41f009887518e7eb5578f88469321117303cd3ac2d7aee4d9cb5f82ab9ae3458e796dfe7c24284b05815acfcaa270ff22e2", - "0xb373feb5d7012fd60578d7d00834c5c81df2a23d42794fed91aa9535a4771fde0341c4da882261785e0caca40bf83405143085e7f17e55b64f6c5c809680c20b050409bf3702c574769127c854d27388b144b05624a0e24a1cbcc4d08467005b", - "0xb15680648949ce69f82526e9b67d9b55ce5c537dc6ab7f3089091a9a19a6b90df7656794f6edc87fb387d21573ffc847062623685931c2790a508cbc8c6b231dd2c34f4d37d4706237b1407673605a604bcf6a50cc0b1a2db20485e22b02c17e", - "0x8817e46672d40c8f748081567b038a3165f87994788ec77ee8daea8587f5540df3422f9e120e94339be67f186f50952504cb44f61e30a5241f1827e501b2de53c4c64473bcc79ab887dd277f282fbfe47997a930dd140ac08b03efac88d81075", - "0xa6e4ef6c1d1098f95aae119905f87eb49b909d17f9c41bcfe51127aa25fee20782ea884a7fdf7d5e9c245b5a5b32230b07e0dbf7c6743bf52ee20e2acc0b269422bd6cf3c07115df4aa85b11b2c16630a07c974492d9cdd0ec325a3fabd95044", - "0x8634aa7c3d00e7f17150009698ce440d8e1b0f13042b624a722ace68ead870c3d2212fbee549a2c190e384d7d6ac37ce14ab962c299ea1218ef1b1489c98906c91323b94c587f1d205a6edd5e9d05b42d591c26494a6f6a029a2aadb5f8b6f67", - "0x821a58092900bdb73decf48e13e7a5012a3f88b06288a97b855ef51306406e7d867d613d9ec738ebacfa6db344b677d21509d93f3b55c2ebf3a2f2a6356f875150554c6fff52e62e3e46f7859be971bf7dd9d5b3e1d799749c8a97c2e04325df", - "0x8dba356577a3a388f782e90edb1a7f3619759f4de314ad5d95c7cc6e197211446819c4955f99c5fc67f79450d2934e3c09adefc91b724887e005c5190362245eec48ce117d0a94d6fa6db12eda4ba8dde608fbbd0051f54dcf3bb057adfb2493", - "0xa32a690dc95c23ed9fb46443d9b7d4c2e27053a7fcc216d2b0020a8cf279729c46114d2cda5772fd60a97016a07d6c5a0a7eb085a18307d34194596f5b541cdf01b2ceb31d62d6b55515acfd2b9eec92b27d082fbc4dc59fc63b551eccdb8468", - "0xa040f7f4be67eaf0a1d658a3175d65df21a7dbde99bfa893469b9b43b9d150fc2e333148b1cb88cfd0447d88fa1a501d126987e9fdccb2852ecf1ba907c2ca3d6f97b055e354a9789854a64ecc8c2e928382cf09dda9abde42bbdf92280cdd96", - "0x864baff97fa60164f91f334e0c9be00a152a416556b462f96d7c43b59fe1ebaff42f0471d0bf264976f8aa6431176eb905bd875024cf4f76c13a70bede51dc3e47e10b9d5652d30d2663b3af3f08d5d11b9709a0321aba371d2ef13174dcfcaf", - "0x95a46f32c994133ecc22db49bad2c36a281d6b574c83cfee6680b8c8100466ca034b815cfaedfbf54f4e75188e661df901abd089524e1e0eb0bf48d48caa9dd97482d2e8c1253e7e8ac250a32fd066d5b5cb08a8641bdd64ecfa48289dca83a3", - "0xa2cce2be4d12144138cb91066e0cd0542c80b478bf467867ebef9ddaf3bd64e918294043500bf5a9f45ee089a8d6ace917108d9ce9e4f41e7e860cbce19ac52e791db3b6dde1c4b0367377b581f999f340e1d6814d724edc94cb07f9c4730774", - "0xb145f203eee1ac0a1a1731113ffa7a8b0b694ef2312dabc4d431660f5e0645ef5838e3e624cfe1228cfa248d48b5760501f93e6ab13d3159fc241427116c4b90359599a4cb0a86d0bb9190aa7fabff482c812db966fd2ce0a1b48cb8ac8b3bca", - "0xadabe5d215c608696e03861cbd5f7401869c756b3a5aadc55f41745ad9478145d44393fec8bb6dfc4ad9236dc62b9ada0f7ca57fe2bae1b71565dbf9536d33a68b8e2090b233422313cc96afc7f1f7e0907dc7787806671541d6de8ce47c4cd0", - "0xae7845fa6b06db53201c1080e01e629781817f421f28956589c6df3091ec33754f8a4bd4647a6bb1c141ac22731e3c1014865d13f3ed538dcb0f7b7576435133d9d03be655f8fbb4c9f7d83e06d1210aedd45128c2b0c9bab45a9ddde1c862a5", - "0x9159eaa826a24adfa7adf6e8d2832120ebb6eccbeb3d0459ffdc338548813a2d239d22b26451fda98cc0c204d8e1ac69150b5498e0be3045300e789bcb4e210d5cd431da4bdd915a21f407ea296c20c96608ded0b70d07188e96e6c1a7b9b86b", - "0xa9fc6281e2d54b46458ef564ffaed6944bff71e389d0acc11fa35d3fcd8e10c1066e0dde5b9b6516f691bb478e81c6b20865281104dcb640e29dc116daae2e884f1fe6730d639dbe0e19a532be4fb337bf52ae8408446deb393d224eee7cfa50", - "0x84291a42f991bfb36358eedead3699d9176a38f6f63757742fdbb7f631f2c70178b1aedef4912fed7b6cf27e88ddc7eb0e2a6aa4b999f3eb4b662b93f386c8d78e9ac9929e21f4c5e63b12991fcde93aa64a735b75b535e730ff8dd2abb16e04", - "0xa1b7fcacae181495d91765dfddf26581e8e39421579c9cbd0dd27a40ea4c54af3444a36bf85a11dda2114246eaddbdd619397424bb1eb41b5a15004b902a590ede5742cd850cf312555be24d2df8becf48f5afba5a8cd087cb7be0a521728386", - "0x92feaaf540dbd84719a4889a87cdd125b7e995a6782911931fef26da9afcfbe6f86aaf5328fe1f77631491ce6239c5470f44c7791506c6ef1626803a5794e76d2be0af92f7052c29ac6264b7b9b51f267ad820afc6f881460521428496c6a5f1", - "0xa525c925bfae1b89320a5054acc1fa11820f73d0cf28d273092b305467b2831fab53b6daf75fb926f332782d50e2522a19edcd85be5eb72f1497193c952d8cd0bcc5d43b39363b206eae4cb1e61668bde28a3fb2fc1e0d3d113f6dfadb799717", - "0x98752bb6f5a44213f40eda6aa4ff124057c1b13b6529ab42fe575b9afa66e59b9c0ed563fb20dff62130c436c3e905ee17dd8433ba02c445b1d67182ab6504a90bbe12c26a754bbf734665c622f76c62fe2e11dd43ce04fd2b91a8463679058b", - "0xa9aa9a84729f7c44219ff9e00e651e50ddea3735ef2a73fdf8ed8cd271961d8ed7af5cd724b713a89a097a3fe65a3c0202f69458a8b4c157c62a85668b12fc0d3957774bc9b35f86c184dd03bfefd5c325da717d74192cc9751c2073fe9d170e", - "0xb221c1fd335a4362eff504cd95145f122bf93ea02ae162a3fb39c75583fc13a932d26050e164da97cff3e91f9a7f6ff80302c19dd1916f24acf6b93b62f36e9665a8785413b0c7d930c7f1668549910f849bca319b00e59dd01e5dec8d2edacc", - "0xa71e2b1e0b16d754b848f05eda90f67bedab37709550171551050c94efba0bfc282f72aeaaa1f0330041461f5e6aa4d11537237e955e1609a469d38ed17f5c2a35a1752f546db89bfeff9eab78ec944266f1cb94c1db3334ab48df716ce408ef", - "0xb990ae72768779ba0b2e66df4dd29b3dbd00f901c23b2b4a53419226ef9232acedeb498b0d0687c463e3f1eead58b20b09efcefa566fbfdfe1c6e48d32367936142d0a734143e5e63cdf86be7457723535b787a9cfcfa32fe1d61ad5a2617220", - "0x8d27e7fbff77d5b9b9bbc864d5231fecf817238a6433db668d5a62a2c1ee1e5694fdd90c3293c06cc0cb15f7cbeab44d0d42be632cb9ff41fc3f6628b4b62897797d7b56126d65b694dcf3e298e3561ac8813fbd7296593ced33850426df42db", - "0xa92039a08b5502d5b211a7744099c9f93fa8c90cedcb1d05e92f01886219dd464eb5fb0337496ad96ed09c987da4e5f019035c5b01cc09b2a18b8a8dd419bc5895388a07e26958f6bd26751929c25f89b8eb4a299d822e2d26fec9ef350e0d3c", - "0x92dcc5a1c8c3e1b28b1524e3dd6dbecd63017c9201da9dbe077f1b82adc08c50169f56fc7b5a3b28ec6b89254de3e2fd12838a761053437883c3e01ba616670cea843754548ef84bcc397de2369adcca2ab54cd73c55dc68d87aec3fc2fe4f10" - ] -} \ No newline at end of file From eeeaa2d136843788e3b515daff410e0c5f5300c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sun, 18 May 2025 03:52:24 +0200 Subject: [PATCH 09/44] Rename embeded structs --- crypto/txsign/txsign.go | 2 +- rpc/hijack_address.go | 6 +- rpc/hijack_gaslimit.go | 4 +- rpc/hijack_nonce.go | 4 +- rpc/hijack_simulate.go | 4 +- rpc/hijack_util.go | 72 +- rpc/methods_common_test.go | 12 +- rpc/rpc.go | 184 ---- rpc/testutil/http.go | 34 + rpc/testutil/websocket.go | 109 ++ rpc/transport/multiplex.go | 71 ++ rpc/transport/router.go | 45 + rpc/transport/websocket.go | 2 + rpc/transport/websocket_nowasm.go | 55 + rpc/transport/websocket_test.go | 2 + types/call.go | 56 +- types/call_accesslist.go | 75 +- types/call_accesslist_test.go | 81 ++ types/call_blob.go | 125 +-- types/call_blob_test.go | 164 +++ types/call_dynamicfee.go | 81 +- types/call_dynamicfee_test.go | 83 ++ types/call_legacy.go | 61 +- types/call_legacy_test.go | 63 ++ types/embed.go | 410 +++++-- types/embed_test.go | 592 ++++++++++ types/structs.go | 117 +- types/structs_test.go | 30 +- types/tx.go | 56 +- types/tx_accesslist.go | 216 ++-- types/tx_accesslist_test.go | 230 ++-- types/tx_blob.go | 325 ++---- types/tx_blob_test.go | 480 +++++--- types/tx_decoder.go | 34 +- types/tx_decoder_test.go | 370 ++++--- types/tx_dynamicfee.go | 234 ++-- types/tx_dynamicfee_test.go | 248 +++-- types/tx_legacy.go | 197 ++-- types/tx_legacy_test.go | 254 +++-- types/tx_test.go | 35 - types/types.go | 177 +-- types/types_test.go | 1690 +++++++++++++++++++++++------ types/util.go | 73 +- types/util_test.go | 53 + wallet/key_rpc.go | 4 +- 45 files changed, 4964 insertions(+), 2256 deletions(-) delete mode 100644 rpc/rpc.go create mode 100644 rpc/testutil/http.go create mode 100644 rpc/testutil/websocket.go create mode 100644 rpc/transport/multiplex.go create mode 100644 rpc/transport/router.go create mode 100644 rpc/transport/websocket_nowasm.go create mode 100644 types/call_accesslist_test.go create mode 100644 types/call_blob_test.go create mode 100644 types/call_dynamicfee_test.go create mode 100644 types/call_legacy_test.go create mode 100644 types/embed_test.go delete mode 100644 types/tx_test.go diff --git a/crypto/txsign/txsign.go b/crypto/txsign/txsign.go index 5d235b6..555300a 100644 --- a/crypto/txsign/txsign.go +++ b/crypto/txsign/txsign.go @@ -32,7 +32,7 @@ func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { } } txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) - if cd, ok := tx.(types.HasCallData); ok { + if cd, ok := tx.(types.CallData); ok { cd.CallData().SetFrom(types.Address(ecdsa.PublicKeyToAddress(&key.PublicKey))) } return nil diff --git a/rpc/hijack_address.go b/rpc/hijack_address.go index 9b38ba3..241c23c 100644 --- a/rpc/hijack_address.go +++ b/rpc/hijack_address.go @@ -22,7 +22,7 @@ func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc return next(ctx, t, result, method, args...) } - var cd *types.EmbedCallData + var cd *types.CallFields switch method { case "eth_sendTransaction": // Verify arguments: @@ -32,7 +32,7 @@ func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc } // Get transaction call data: - if tx, ok := tx.(types.HasCallData); ok { + if tx, ok := tx.(types.CallData); ok { cd = tx.CallData() } case "eth_call", "eth_estimateGas": @@ -43,7 +43,7 @@ func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc } // Get call data: - if c, ok := c.(types.HasCallData); ok { + if c, ok := c.(types.CallData); ok { cd = c.CallData() } default: diff --git a/rpc/hijack_gaslimit.go b/rpc/hijack_gaslimit.go index 49c64ce..52b6f90 100644 --- a/rpc/hijack_gaslimit.go +++ b/rpc/hijack_gaslimit.go @@ -32,8 +32,8 @@ func (c *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc } // Get transaction call data: - var txcd *types.EmbedCallData - if tx, ok := tx.(types.HasCallData); ok { + var txcd *types.CallFields + if tx, ok := tx.(types.CallData); ok { txcd = tx.CallData() } diff --git a/rpc/hijack_nonce.go b/rpc/hijack_nonce.go index f90dadc..be7881f 100644 --- a/rpc/hijack_nonce.go +++ b/rpc/hijack_nonce.go @@ -35,8 +35,8 @@ func (c *hijackNonce) Call() func(next transport.CallFunc) transport.CallFunc { } // Get transaction call data: - var txcd *types.EmbedCallData - if tx, ok := tx.(types.HasCallData); ok { + var txcd *types.CallFields + if tx, ok := tx.(types.CallData); ok { txcd = tx.CallData() } diff --git a/rpc/hijack_simulate.go b/rpc/hijack_simulate.go index 8f28b9b..d7c2551 100644 --- a/rpc/hijack_simulate.go +++ b/rpc/hijack_simulate.go @@ -13,7 +13,7 @@ import ( // hijackSimulate hijacks "eth_send*Transaction" methods and simulates the // transaction execution before sending it. type hijackSimulate struct { - decoder types.RPCTransactionDecoder + decoder types.RLPTransactionDecoder } // Call implements the transport.Hijacker interface. @@ -74,7 +74,7 @@ func (h *hijackSimulate) Unsubscribe() func(next transport.UnsubscribeFunc) tran func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx types.Transaction) error { // Recover transaction sender if not present: txd := tx.TransactionData() - if txc, ok := tx.(types.HasCallData); ok && txd.Signature != nil && txc.CallData().From == nil { + if txc, ok := tx.(types.CallData); ok && txd.Signature != nil && txc.CallData().From == nil { from, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("unable to recover transaction sender: %w", err) diff --git a/rpc/hijack_util.go b/rpc/hijack_util.go index b71fde2..0279612 100644 --- a/rpc/hijack_util.go +++ b/rpc/hijack_util.go @@ -2,29 +2,29 @@ package rpc import "github.com/defiweb/go-eth/types" -func getCallData(tx types.Transaction) *types.EmbedCallData { - if tx, ok := tx.(types.HasCallData); ok { +func getCallData(tx types.Transaction) *types.CallFields { + if tx, ok := tx.(types.CallData); ok { return tx.CallData() } return nil } -func getLegacyPriceData(tx types.Transaction) *types.EmbedLegacyPriceData { - if tx, ok := tx.(types.HasLegacyPrice); ok { +func getLegacyPriceData(tx types.Transaction) *types.LegacyPriceField { + if tx, ok := tx.(types.LegacyPriceData); ok { return tx.LegacyPriceData() } return nil } -func getAccessListData(tx types.Transaction) *types.EmbedAccessListData { - if tx, ok := tx.(types.HasAccessListData); ok { +func getAccessListData(tx types.Transaction) *types.AccessListField { + if tx, ok := tx.(types.AccessListData); ok { return tx.AccessListData() } return nil } -func getDynamicFeeData(tx types.Transaction) *types.EmbedDynamicFeeData { - if tx, ok := tx.(types.HasDynamicFeeData); ok { +func getDynamicFeeData(tx types.Transaction) *types.DynamicFeeFields { + if tx, ok := tx.(types.DynamicFeeData); ok { return tx.DynamicFeeData() } return nil @@ -52,54 +52,54 @@ func convertTX(tx types.Transaction, typ types.TransactionType) types.Transactio switch typ { case types.LegacyTxType: ltx := types.NewTransactionLegacy() - ltx.SetTransactionData(tx.TransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - ltx.SetCallData(tx.CallData()) + ltx.SetTransactionData(*tx.TransactionData()) + if tx, ok := tx.(types.CallData); ok { + ltx.SetCallData(*tx.CallData()) } - if tx, ok := tx.(types.HasLegacyPrice); ok { - ltx.SetLegacyPriceData(tx.LegacyPriceData()) + if tx, ok := tx.(types.LegacyPriceData); ok { + ltx.SetLegacyPriceData(*tx.LegacyPriceData()) } return ltx case types.AccessListTxType: altx := types.NewTransactionAccessList() - altx.SetTransactionData(tx.TransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - altx.SetCallData(tx.CallData()) + altx.SetTransactionData(*tx.TransactionData()) + if tx, ok := tx.(types.CallData); ok { + altx.SetCallData(*tx.CallData()) } - if tx, ok := tx.(types.HasLegacyPrice); ok { - altx.SetLegacyPriceData(tx.LegacyPriceData()) + if tx, ok := tx.(types.LegacyPriceData); ok { + altx.SetLegacyPriceData(*tx.LegacyPriceData()) } - if tx, ok := tx.(types.HasAccessListData); ok { - altx.SetAccessListData(tx.AccessListData()) + if tx, ok := tx.(types.AccessListData); ok { + altx.SetAccessListData(*tx.AccessListData()) } return altx case types.DynamicFeeTxType: dftx := types.NewTransactionDynamicFee() - dftx.SetTransactionData(tx.TransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - dftx.SetCallData(tx.CallData()) + dftx.SetTransactionData(*tx.TransactionData()) + if tx, ok := tx.(types.CallData); ok { + dftx.SetCallData(*tx.CallData()) } - if tx, ok := tx.(types.HasAccessListData); ok { - dftx.SetAccessListData(tx.AccessListData()) + if tx, ok := tx.(types.AccessListData); ok { + dftx.SetAccessListData(*tx.AccessListData()) } - if tx, ok := tx.(types.HasDynamicFeeData); ok { - dftx.SetDynamicFeeData(tx.DynamicFeeData()) + if tx, ok := tx.(types.DynamicFeeData); ok { + dftx.SetDynamicFeeData(*tx.DynamicFeeData()) } return dftx case types.BlobTxType: btx := types.NewTransactionBlob() - btx.SetTransactionData(tx.TransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - btx.SetCallData(tx.CallData()) + btx.SetTransactionData(*tx.TransactionData()) + if tx, ok := tx.(types.CallData); ok { + btx.SetCallData(*tx.CallData()) } - if tx, ok := tx.(types.HasAccessListData); ok { - btx.SetAccessListData(tx.AccessListData()) + if tx, ok := tx.(types.AccessListData); ok { + btx.SetAccessListData(*tx.AccessListData()) } - if tx, ok := tx.(types.HasDynamicFeeData); ok { - btx.SetDynamicFeeData(tx.DynamicFeeData()) + if tx, ok := tx.(types.DynamicFeeData); ok { + btx.SetDynamicFeeData(*tx.DynamicFeeData()) } - if tx, ok := tx.(types.HasBlobData); ok { - btx.SetBlobData(tx.BlobData()) + if tx, ok := tx.(types.BlobData); ok { + btx.SetBlobData(*tx.BlobData()) } return btx default: diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index 3cb7cbd..e068319 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -591,7 +591,7 @@ const mockCallRequest = ` "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x2540be400", - "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" + "input": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" }, "0x1" ] @@ -627,14 +627,14 @@ func TestBaseClient_Call(t *testing.T) { response, err := client.Call( context.Background(), &types.CallLegacy{ - EmbedCallData: types.EmbedCallData{ + CallFields: types.CallFields{ From: from, To: to, GasLimit: &gasLimit, Value: value, Input: input, }, - EmbedLegacyPriceData: types.EmbedLegacyPriceData{ + LegacyPriceField: types.LegacyPriceField{ GasPrice: gasPrice, }, }, @@ -657,7 +657,7 @@ const mockEstimateGasRequest = ` "gas": "0x76c0", "gasPrice": "0x9184e72a000", "value": "0x2540be400", - "data": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" + "input": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" }, "latest" ] @@ -688,14 +688,14 @@ func TestBaseClient_EstimateGas(t *testing.T) { gas, err := client.EstimateGas( context.Background(), &types.CallLegacy{ - EmbedCallData: types.EmbedCallData{ + CallFields: types.CallFields{ From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), GasLimit: &gasLimit, Value: big.NewInt(10000000000), Input: hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), }, - EmbedLegacyPriceData: types.EmbedLegacyPriceData{ + LegacyPriceField: types.LegacyPriceField{ GasPrice: big.NewInt(10000000000000), }, }, diff --git a/rpc/rpc.go b/rpc/rpc.go deleted file mode 100644 index c268e80..0000000 --- a/rpc/rpc.go +++ /dev/null @@ -1,184 +0,0 @@ -package rpc - -import ( - "context" - "math/big" - - "github.com/defiweb/go-eth/types" -) - -// RPC is an RPC client for the Ethereum-compatible nodes. -type RPC2 interface { - - // GetBlockTransactionCountByHash performs eth_getBlockTransactionCountByHash RPC call. - // - // It returns the number of transactions in the block with the given hash. - GetBlockTransactionCountByHash(ctx context.Context, hash types.Hash) (uint64, error) - - // GetBlockTransactionCountByNumber performs eth_getBlockTransactionCountByNumber RPC call. - // - // It returns the number of transactions in the block with the given block - GetBlockTransactionCountByNumber(ctx context.Context, number types.BlockNumber) (uint64, error) - - // GetUncleCountByBlockHash performs eth_getUncleCountByBlockHash RPC call. - // - // It returns the number of uncles in the block with the given hash. - GetUncleCountByBlockHash(ctx context.Context, hash types.Hash) (uint64, error) - - // Sign performs eth_sign RPC call. - // - // It signs the given data with the given address. - Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) - - // SignTransaction performs eth_signTransaction RPC call. - // - // It signs the given transaction. - // - // If transaction was internally mutated, the mutated call is returned. - SignTransaction(ctx context.Context, tx types.Transaction) (types.Transaction, error) - - // SendTransaction performs eth_sendTransaction RPC call. - // - // It sends a transaction to the network. - // - // If transaction was internally mutated, the mutated call is returned. - SendTransaction(ctx context.Context, tx types.Transaction) (*types.Hash, error) - - // SendRawTransaction performs eth_sendRawTransaction RPC call. - // - // It sends an encoded transaction to the network. - SendRawTransaction(ctx context.Context, data []byte) (*types.Hash, error) - - // Call performs eth_call RPC call. - // - // It executes a new message call immediately without creating a - // transaction on the blockchain. - // - // If call was internally mutated, the mutated call is returned. - Call(ctx context.Context, call types.Call, block types.BlockNumber) ([]byte, error) - - // EstimateGas performs eth_estimateGas RPC call. - // - // It estimates the gas necessary to execute a specific transaction. - // - // If call was internally mutated, the mutated call is returned. - EstimateGas(ctx context.Context, call types.Call, block types.BlockNumber) (uint64, error) - - // BlockByHash performs eth_getBlockByHash RPC call. - // - // It returns information about a block by hash. - BlockByHash(ctx context.Context, hash types.Hash, full bool) (*types.Block, error) - - // BlockByNumber performs eth_getBlockByNumber RPC call. - // - // It returns the block with the given number. - BlockByNumber(ctx context.Context, number types.BlockNumber, full bool) (*types.Block, error) - - // GetTransactionByHash performs eth_getTransactionByHash RPC call. - // - // It returns the information about a transaction requested by transaction. - GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.TransactionOnChain, error) - - // GetTransactionByBlockHashAndIndex performs eth_getTransactionByBlockHashAndIndex RPC call. - // - // It returns the information about a transaction requested by transaction. - GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.TransactionOnChain, error) - - // GetTransactionByBlockNumberAndIndex performs eth_getTransactionByBlockNumberAndIndex RPC call. - // - // It returns the information about a transaction requested by transaction. - GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.TransactionOnChain, error) - - // GetTransactionReceipt performs eth_getTransactionReceipt RPC call. - // - // It returns the receipt of a transaction by transaction hash. - GetTransactionReceipt(ctx context.Context, hash types.Hash) (*types.TransactionReceipt, error) - - // GetBlockReceipts performs eth_getBlockReceipts RPC call. - // - // It returns all transaction receipts for a given block hash or number. - GetBlockReceipts(ctx context.Context, block types.BlockNumber) ([]*types.TransactionReceipt, error) - - // GetUncleByBlockHashAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. - // - // It returns information about an uncle of a block by number and uncle index position. - GetUncleByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.Block, error) - - // GetUncleByBlockNumberAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. - // - // It returns information about an uncle of a block by hash and uncle index position. - GetUncleByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.Block, error) - - // NewFilter performs eth_newFilter RPC call. - // - // It creates a filter object based on the given filter options. To check - // if the state has changed, use GetFilterChanges. - NewFilter(ctx context.Context, query *types.FilterLogsQuery) (*big.Int, error) - - // NewBlockFilter performs eth_newBlockFilter RPC call. - // - // It creates a filter in the node, to notify when a new block arrives. To - // check if the state has changed, use GetBlockFilterChanges. - NewBlockFilter(ctx context.Context) (*big.Int, error) - - // NewPendingTransactionFilter performs eth_newPendingTransactionFilter RPC call. - // - // It creates a filter in the node, to notify when new pending transactions - // arrive. To check if the state has changed, use GetFilterChanges. - NewPendingTransactionFilter(ctx context.Context) (*big.Int, error) - - // UninstallFilter performs eth_uninstallFilter RPC call. - // - // It uninstalls a filter with given ID. Should always be called when watch - // is no longer needed. - UninstallFilter(ctx context.Context, id *big.Int) (bool, error) - - // GetFilterChanges performs eth_getFilterChanges RPC call. - // - // It returns an array of logs that occurred since the given filter ID. - GetFilterChanges(ctx context.Context, id *big.Int) ([]types.Log, error) - - // GetBlockFilterChanges performs eth_getFilterChanges RPC call. - // - // It returns an array of block hashes that occurred since the given filter ID. - GetBlockFilterChanges(ctx context.Context, id *big.Int) ([]types.Hash, error) - - // GetFilterLogs performs eth_getFilterLogs RPC call. - // - // It returns an array of all logs matching filter with given ID. - GetFilterLogs(ctx context.Context, id *big.Int) ([]types.Log, error) - - // GetLogs performs eth_getLogs RPC call. - // - // It returns logs that match the given query. - GetLogs(ctx context.Context, query *types.FilterLogsQuery) ([]types.Log, error) - - // MaxPriorityFeePerGas performs eth_maxPriorityFeePerGas RPC call. - // - // It returns the estimated maximum priority fee per gas. - MaxPriorityFeePerGas(ctx context.Context) (*big.Int, error) - - // SubscribeLogs performs eth_subscribe RPC call with "logs" subscription - // type. - // - // It creates a subscription that will send logs that match the given query. - // - // Subscription channel will be closed when the context is canceled. - SubscribeLogs(ctx context.Context, query *types.FilterLogsQuery) (<-chan types.Log, error) - - // SubscribeNewHeads performs eth_subscribe RPC call with "newHeads" - // subscription type. - // - // It creates a subscription that will send new block headers. - // - // Subscription channel will be closed when the context is canceled. - SubscribeNewHeads(ctx context.Context) (<-chan types.Block, error) - - // SubscribeNewPendingTransactions performs eth_subscribe RPC call with - // "newPendingTransactions" subscription type. - // - // It creates a subscription that will send new pending transactions. - // - // Subscription channel will be closed when the context is canceled. - SubscribeNewPendingTransactions(ctx context.Context) (<-chan types.Hash, error) -} diff --git a/rpc/testutil/http.go b/rpc/testutil/http.go new file mode 100644 index 0000000..49c00a2 --- /dev/null +++ b/rpc/testutil/http.go @@ -0,0 +1,34 @@ +package testutil + +import ( + "net/http" + + "github.com/defiweb/go-eth/rpc/transport" +) + +type roundTripFunc func(req *http.Request) (*http.Response, error) + +func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { + return f(req) +} + +type HTTPMock struct { + *transport.HTTP + + Request *http.Request // Request that was sent. + Response *http.Response // Response that will be returned. +} + +func NewHTTPMock() *HTTPMock { + h := &HTTPMock{} + h.HTTP, _ = transport.NewHTTP(transport.HTTPOptions{ + URL: "http://localhost", + HTTPClient: &http.Client{ + Transport: roundTripFunc(func(req *http.Request) (*http.Response, error) { + h.Request = req + return h.Response, nil + }), + }, + }) + return h +} diff --git a/rpc/testutil/websocket.go b/rpc/testutil/websocket.go new file mode 100644 index 0000000..b1f5fa6 --- /dev/null +++ b/rpc/testutil/websocket.go @@ -0,0 +1,109 @@ +package testutil + +import ( + "context" + "encoding/json" + "errors" + "net" + "net/http" + "sync" + "time" + + "nhooyr.io/websocket" + "nhooyr.io/websocket/wsjson" + + "github.com/defiweb/go-eth/rpc/transport" +) + +type WebsocketMock struct { + *transport.Websocket + wg sync.WaitGroup + + RequestCh chan string // Request that was sent. + ResponseCh chan string // Response that will be returned. +} + +func NewWebsocketMock(ctx context.Context) *WebsocketMock { + w := &WebsocketMock{ + RequestCh: make(chan string), + ResponseCh: make(chan string), + } + + // Websocket server. + server := &http.Server{Handler: http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { + // Handle websocket requests. + conn, err := websocket.Accept(res, req, nil) + if err != nil { + panic(err) + } + + // Request reader. + w.wg.Add(1) + go func() { + defer w.wg.Done() + for { + var req json.RawMessage + if err := wsjson.Read(ctx, conn, &req); err != nil { + if errors.As(err, &websocket.CloseError{}) { + return + } + panic(err) + } + w.RequestCh <- string(req) + } + }() + + // Response writer. + w.wg.Add(1) + go func() { + defer w.wg.Done() + for { + select { + case <-ctx.Done(): + return + case res := <-w.ResponseCh: + if err := wsjson.Write(ctx, conn, json.RawMessage(res)); err != nil { + if errors.As(err, &websocket.CloseError{}) { + return + } + panic(err) + } + } + } + }() + + // Close the connection after the test. + <-ctx.Done() + _ = conn.Close(websocket.StatusNormalClosure, "") + })} + + // Close HTTP server after the test. + go func() { + <-ctx.Done() + _ = server.Close() + w.wg.Wait() + }() + + // Start HTTP server. + ln, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + panic(err) + } + w.wg.Add(1) + go func() { + defer w.wg.Done() + if err := server.Serve(ln); err != nil { + if !errors.Is(err, http.ErrServerClosed) { + panic(err) + } + } + }() + + w.Websocket, _ = transport.NewWebsocket(transport.WebsocketOptions{ + Context: ctx, + URL: "ws://" + ln.Addr().String(), + Timout: time.Second, + }) + + return w +} diff --git a/rpc/transport/multiplex.go b/rpc/transport/multiplex.go new file mode 100644 index 0000000..f497603 --- /dev/null +++ b/rpc/transport/multiplex.go @@ -0,0 +1,71 @@ +package transport + +import ( + "context" + "encoding/json" +) + +type Multiplex struct { + baseTransport Transport + txMultiplexTransports []Transport +} + +func NewMultiplex(baseTransport Transport, txMultiplexTransports ...Transport) *Multiplex { + return &Multiplex{ + baseTransport: baseTransport, + txMultiplexTransports: txMultiplexTransports, + } +} + +// Call implements the Transport interface. +func (c *Multiplex) Call(ctx context.Context, result any, method string, args ...any) error { + if shouldMultiplex(method) { + var ( + ok bool // True if at least one call was successful. + err error // The error of the last unsuccessful call. + ) + for _, txTransport := range c.txMultiplexTransports { + if ok { + // If there was a successful call, we still need to call the + // other transports, but we don't need to handle the result. + _ = txTransport.Call(ctx, nil, method, args...) + continue + } + callErr := txTransport.Call(ctx, result, method, args...) + if callErr != nil { + err = callErr + continue + } + ok = true + } + if !ok { + return err + } + } + return c.baseTransport.Call(ctx, result, method, args...) +} + +// Subscribe implements the SubscriptionTransport interface. +func (c *Multiplex) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { + if s, ok := c.baseTransport.(SubscriptionTransport); ok { + return s.Subscribe(ctx, method, args...) + } + return nil, "", ErrNotSubscriptionTransport +} + +// Unsubscribe implements the SubscriptionTransport interface. +func (c *Multiplex) Unsubscribe(ctx context.Context, id string) error { + if s, ok := c.baseTransport.(SubscriptionTransport); ok { + return s.Unsubscribe(ctx, id) + } + return ErrNotSubscriptionTransport +} + +func shouldMultiplex(method string) bool { + switch method { + case "eth_sendTransaction", "eth_sendRawTransaction", "eth_sendPrivateTransaction": + return true + default: + return false + } +} diff --git a/rpc/transport/router.go b/rpc/transport/router.go new file mode 100644 index 0000000..4e37ec1 --- /dev/null +++ b/rpc/transport/router.go @@ -0,0 +1,45 @@ +package transport + +/* +type Selector interface { + Select(ctx context.Context, count int, method string, args ...any) (Transport, error) +} + +type RoundRobinSelector struct { + selected int + transports []Transport +} + +func NewRoundRobinSelector(transports ...Transport) *RoundRobinSelector { + return &RoundRobinSelector{transports: transports} +} + +func (s *RoundRobinSelector) Select(_ context.Context, _ string, _ ...any) (Transport, error) { + s.selected = (s.selected + 1) % len(s.transports) + return s.transports[s.selected], nil +} + +type Router struct { + mu sync.Mutex + selector Selector +} + +func NewRouter(selector Selector) *Router { + return &Router{selector: selector} +} + +// Call implements the Transport interface. +func (c *Router) Call(ctx context.Context, result any, method string, args ...any) error { + transport, err := c.selectTransport(ctx, method, args...) + if err != nil { + return err + } + return transport.Call(ctx, result, method, args...) +} + +func (c *Router) selectTransport(ctx context.Context, method string, args ...any) (Transport, error) { + c.mu.Lock() + defer c.mu.Unlock() + return c.selector.Select(ctx, method, args...) +} +*/ diff --git a/rpc/transport/websocket.go b/rpc/transport/websocket.go index 1820bc6..fb84b7e 100644 --- a/rpc/transport/websocket.go +++ b/rpc/transport/websocket.go @@ -1,3 +1,5 @@ +//go:build !wasm && !tinygo + package transport import ( diff --git a/rpc/transport/websocket_nowasm.go b/rpc/transport/websocket_nowasm.go new file mode 100644 index 0000000..5f9ff25 --- /dev/null +++ b/rpc/transport/websocket_nowasm.go @@ -0,0 +1,55 @@ +//go:build wasm || tinygo + +package transport + +import ( + "context" + "encoding/json" + "errors" + "net/http" + "time" +) + +// Websocket is a Transport implementation that uses the websocket +// protocol. +type Websocket struct{} + +// WebsocketOptions contains options for the websocket transport. +type WebsocketOptions struct { + // Context used to close the connection. + Context context.Context + + // URL of the websocket endpoint. + URL string + + // HTTPClient is the HTTP client to use. If nil, http.DefaultClient is + // used. + HTTPClient *http.Client + + // HTTPHeader specifies the HTTP headers to be included in the + // websocket handshake request. + HTTPHeader http.Header + + // Timeout is the timeout for the websocket requests. Default is 60s. + Timout time.Duration + + // ErrorCh is an optional channel used to report errors. + ErrorCh chan error +} + +// NewWebsocket creates a new Websocket instance. +func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { + return nil, errors.New("websocket transport is not supported in WASM") +} + +func (w *Websocket) Call(ctx context.Context, result any, method string, args ...any) error { + return errors.New("websocket transport is not supported in WASM") +} + +func (w *Websocket) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { + return nil, "", errors.New("websocket transport is not supported in WASM") +} + +func (w *Websocket) Unsubscribe(ctx context.Context, id string) error { + return errors.New("websocket transport is not supported in WASM") +} diff --git a/rpc/transport/websocket_test.go b/rpc/transport/websocket_test.go index 288d54d..dd2b424 100644 --- a/rpc/transport/websocket_test.go +++ b/rpc/transport/websocket_test.go @@ -1,3 +1,5 @@ +//go:build !wasm && !tinygo + package transport import ( diff --git a/types/call.go b/types/call.go index 442e823..c899d8d 100644 --- a/types/call.go +++ b/types/call.go @@ -2,9 +2,63 @@ package types import "encoding/json" +// Call is an interface that represents a generic Ethereum call. type Call interface { json.Marshaler json.Unmarshaler - HasCallData + CallData } + +// CallBasic represents a simplest Ethereum call. +type CallBasic struct { + CallFields +} + +// NewCall creates a new CallBasic. +func NewCall() *CallBasic { + return &CallBasic{} +} + +// Copy creates a deep copy of the CallBasic. +func (c *CallBasic) Copy() *CallBasic { + return &CallBasic{ + CallFields: *c.CallFields.Copy(), + } +} + +// MarshalJSON implements the json.Marshaler interface. +func (c CallBasic) MarshalJSON() ([]byte, error) { + j := &jsonCall{} + c.CallFields.toJSON(j) + return json.Marshal(j) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (c CallBasic) UnmarshalJSON(bytes []byte) error { + j := &jsonCall{} + if err := json.Unmarshal(bytes, &j); err != nil { + return err + } + c.CallFields.fromJSON(j) + return nil +} + +type jsonCall struct { + From *Address `json:"from,omitempty"` + To *Address `json:"to,omitempty"` + GasLimit *Number `json:"gas,omitempty"` + GasPrice *Number `json:"gasPrice,omitempty"` + MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` + MaxFeePerBlobGas *Number `json:"maxFeePerBlobGas,omitempty"` + MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` + Input Bytes `json:"input,omitempty"` + Value *Number `json:"value,omitempty"` + AccessList AccessList `json:"accessList,omitempty"` + BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` + Blobs []kzgBlob `json:"blobs,omitempty"` + Commitments []kzgCommitment `json:"commitments,omitempty"` + Proofs []kzgProof `json:"proofs,omitempty"` +} + +var _ Call = (*CallBasic)(nil) diff --git a/types/call_accesslist.go b/types/call_accesslist.go index 9bc638b..d2c6914 100644 --- a/types/call_accesslist.go +++ b/types/call_accesslist.go @@ -2,75 +2,54 @@ package types import "encoding/json" +// CallAccessList represents a call corresponding to the access list +// transaction type. +// +// Introduced by EIP-2930, this transaction type includes an optional access +// list that specifies a list of addresses and storage keys the transaction +// plans to access. type CallAccessList struct { - EmbedCallData - EmbedLegacyPriceData - EmbedAccessListData + CallFields + LegacyPriceField + AccessListField } +// NewCallAccessList creates a new CallAccessList. func NewCallAccessList() *CallAccessList { return &CallAccessList{} } +// Copy creates a deep copy of the CallAccessList. func (c *CallAccessList) Copy() *CallAccessList { if c == nil { return nil } return &CallAccessList{ - EmbedCallData: *c.EmbedCallData.Copy(), - EmbedLegacyPriceData: *c.EmbedLegacyPriceData.Copy(), - EmbedAccessListData: *c.EmbedAccessListData.Copy(), + CallFields: *c.CallFields.Copy(), + LegacyPriceField: *c.LegacyPriceField.Copy(), + AccessListField: *c.AccessListField.Copy(), } } +// MarshalJSON implements the json.Marshaler interface. func (c *CallAccessList) MarshalJSON() ([]byte, error) { - call := &jsonCallAccessList{ - From: c.From, - To: c.To, - Data: c.Input, - AccessList: c.AccessList, - } - if c.GasLimit != nil { - call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) - } - if c.GasPrice != nil { - call.GasPrice = NumberFromBigIntPtr(c.GasPrice) - } - if c.Value != nil { - value := NumberFromBigInt(c.Value) - call.Value = &value - } - return json.Marshal(call) + j := &jsonCall{} + c.CallFields.toJSON(j) + c.LegacyPriceField.toJSON(j) + c.AccessListField.toJSON(j) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (c *CallAccessList) UnmarshalJSON(data []byte) error { - call := &jsonCallAccessList{} - if err := json.Unmarshal(data, call); err != nil { + j := &jsonCall{} + if err := json.Unmarshal(data, j); err != nil { return err } - c.From = call.From - c.To = call.To - if call.GasLimit != nil { - gas := call.GasLimit.Big().Uint64() - c.GasLimit = &gas - } - if call.GasPrice != nil { - c.GasPrice = call.GasPrice.Big() - } - if call.Value != nil { - c.Value = call.Value.Big() - } - c.Input = call.Data - c.AccessList = call.AccessList + c.CallFields.fromJSON(j) + c.LegacyPriceField.fromJSON(j) + c.AccessListField.fromJSON(j) return nil } -type jsonCallAccessList struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - Value *Number `json:"value,omitempty"` - Data Bytes `json:"data,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` -} +var _ Call = (*CallAccessList)(nil) diff --git a/types/call_accesslist_test.go b/types/call_accesslist_test.go new file mode 100644 index 0000000..c4e81ab --- /dev/null +++ b/types/call_accesslist_test.go @@ -0,0 +1,81 @@ +package types + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCallAccessList_JSON(t *testing.T) { + tests := []struct { + name string + call *CallAccessList + wantJSON string + }{ + { + name: "all fields nil", + call: &CallAccessList{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + call: &CallAccessList{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "value": "0xde0b6b3a7640000", + "gas": "0x186a0", + "input": "0x01020304", + "gasPrice": "0x3b9aca00", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ] + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.call.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Decode from JSON + call := NewCallAccessList() + err = call.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded call + call.From = tt.call.From + assertEqualCall(t, call, tt.call) + }) + } +} diff --git a/types/call_blob.go b/types/call_blob.go index 30edbcb..af57b7f 100644 --- a/types/call_blob.go +++ b/types/call_blob.go @@ -2,125 +2,58 @@ package types import ( "encoding/json" - - "github.com/defiweb/go-eth/crypto/kzg4844" ) +// CallBlob represents a call corresponding to the blob transaction type. +// +// Introduced by EIP-4844, this transaction type adds support for blob-carrying +// transactions. type CallBlob struct { - EmbedCallData - EmbedAccessListData - EmbedDynamicFeeData - EmbedBlobData + CallFields + AccessListField + DynamicFeeFields + BlobFields } +// NewCallBlob creates a new CallBlob. func NewCallBlob() *CallBlob { return &CallBlob{} } +// Copy creates a deep copy of the CallBlob. func (c *CallBlob) Copy() *CallBlob { if c == nil { return nil } return &CallBlob{ - EmbedCallData: *c.EmbedCallData.Copy(), - EmbedAccessListData: *c.EmbedAccessListData.Copy(), - EmbedDynamicFeeData: *c.EmbedDynamicFeeData.Copy(), - EmbedBlobData: *c.EmbedBlobData.Copy(), + CallFields: *c.CallFields.Copy(), + AccessListField: *c.AccessListField.Copy(), + DynamicFeeFields: *c.DynamicFeeFields.Copy(), + BlobFields: *c.BlobFields.Copy(), } } +// MarshalJSON implements the json.Marshaler interface. func (c *CallBlob) MarshalJSON() ([]byte, error) { - call := &jsonCallBlob{ - From: c.From, - To: c.To, - Data: c.Input, - AccessList: c.AccessList, - } - if c.GasLimit != nil { - call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) - } - if c.MaxFeePerGas != nil { - call.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) - } - if c.MaxFeePerBlobGas != nil { - call.MaxFeePerBlobGas = NumberFromBigIntPtr(c.MaxFeePerBlobGas) - } - if c.MaxPriorityFeePerGas != nil { - call.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) - } - if c.Value != nil { - value := NumberFromBigInt(c.Value) - call.Value = &value - } - for _, blob := range c.Blobs { - hash := blob.Hash - if hash.IsZero() && blob.Sidecar != nil { - hash = blob.Sidecar.ComputeHash() - } - call.BlobHashes = append(call.BlobHashes, hash) - if blob.Sidecar != nil { - call.Blobs = append(call.Blobs, kzgBlob(blob.Sidecar.Blob)) - call.Commitments = append(call.Commitments, kzgCommitment(blob.Sidecar.Commitment)) - call.Proofs = append(call.Proofs, kzgProof(blob.Sidecar.Proof)) - } - } - return json.Marshal(call) + j := &jsonCall{} + c.CallFields.toJSON(j) + c.AccessListField.toJSON(j) + c.DynamicFeeFields.toJSON(j) + c.BlobFields.toJSON(j) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (c *CallBlob) UnmarshalJSON(data []byte) error { - call := &jsonCallBlob{} - if err := json.Unmarshal(data, call); err != nil { + j := &jsonCall{} + if err := json.Unmarshal(data, &j); err != nil { return err } - c.From = call.From - c.To = call.To - if call.GasLimit != nil { - gas := call.GasLimit.Big().Uint64() - c.GasLimit = &gas - } - if call.MaxFeePerGas != nil { - c.MaxFeePerGas = call.MaxFeePerGas.Big() - } - if call.MaxFeePerBlobGas != nil { - c.MaxFeePerBlobGas = call.MaxFeePerBlobGas.Big() - } - if call.MaxPriorityFeePerGas != nil { - c.MaxPriorityFeePerGas = call.MaxPriorityFeePerGas.Big() - } - if call.Value != nil { - c.Value = call.Value.Big() - } - c.Input = call.Data - c.AccessList = call.AccessList - if len(call.BlobHashes) > 0 { - c.Blobs = make([]Blob, len(call.BlobHashes)) - for i, hash := range call.BlobHashes { - blob := Blob{Hash: hash} - if i < len(call.Blobs) && i < len(call.Commitments) && i < len(call.Proofs) { - blob.Sidecar = &BlobSidecar{ - Blob: kzg4844.Blob(call.Blobs[i]), - Commitment: kzg4844.Commitment(call.Commitments[i]), - Proof: kzg4844.Proof(call.Proofs[i]), - } - } - c.Blobs[i] = blob - } - } + c.CallFields.fromJSON(j) + c.AccessListField.fromJSON(j) + c.DynamicFeeFields.fromJSON(j) + c.BlobFields.fromJSON(j) return nil } -type jsonCallBlob struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxFeePerBlobGas *Number `json:"maxFeePerBlobGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Value *Number `json:"value,omitempty"` - Data Bytes `json:"data,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` - BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` - Blobs []kzgBlob `json:"blobs,omitempty"` - Commitments []kzgCommitment `json:"commitments,omitempty"` - Proofs []kzgProof `json:"proofs,omitempty"` -} +var _ Call = (*CallBlob)(nil) diff --git a/types/call_blob_test.go b/types/call_blob_test.go new file mode 100644 index 0000000..fe1cf7b --- /dev/null +++ b/types/call_blob_test.go @@ -0,0 +1,164 @@ +package types + +import ( + "math/big" + "regexp" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCallBlob_JSON(t *testing.T) { + remZerosRx := regexp.MustCompile(`0{128,}`) + tests := []struct { + name string + call *CallBlob + wantJSON string + }{ + { + name: "empty call", + call: &CallBlob{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + call: &CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, + {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, + }, + }, + }, + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxFeePerBlobGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "blobVersionedHashes": [ + "0x6666666666666666666666666666666666666666666666666666666666666666", + "0x7777777777777777777777777777777777777777777777777777777777777777" + ] + }`, + }, + { + name: "blobs with shortened zero fields", + call: &CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + newBlob("blob1"), + newBlob("blob2"), + }, + }, + }, + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxFeePerBlobGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "blobVersionedHashes": [ + "0x01e951827dab35ecb4ce6e29ca6779ad0ac958f06ac1d54eb6e7523f3e3febeb", + "0x01c6f423eec4f5e9ebd79e6fb5eb9bce57dd102f2f0a6fdee0bf58c4e109e27a" + ], + "blobs": [ + "0x626c6f6231", + "0x626c6f6232" + ], + "commitments": [ + "0x832726ece34fb93100194291b75b7f5fa920d5b896e5edafeed46f3636fadc485f493490bd596c76171516024bcf7a00", + "0x896a515deb6c1ac23436f5de75186316b53851be3cb4225437e58c34e376bbd6dea13d7a39b8d5dd9f6cba1c052ab0cb" + ], + "proofs": [ + "0xacbe7bde870d1e7c239063368dbf62ce3bfaef1c08006e8e724da2837294e19d991ba5677a628e64b6c6906ff1786b3c", + "0x8fd7fb4172048b9d8deccb939eeb787c45d0bb00d5f238e13084bd3fbe8050215ce488999f86fccddc36d1a257a19513" + ] + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.call.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(remZerosRx.ReplaceAll(jsonBytes, []byte("")))) + + // Decode from JSON + tx := NewCallBlob() + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded calls + tx.From = tt.call.From + assertEqualCall(t, tx, tt.call) + }) + } +} diff --git a/types/call_dynamicfee.go b/types/call_dynamicfee.go index 951b801..f9634d4 100644 --- a/types/call_dynamicfee.go +++ b/types/call_dynamicfee.go @@ -2,82 +2,53 @@ package types import "encoding/json" +// CallDynamicFee represents a call corresponding to the dynamic fee +// transaction type. +// +// Introduced by EIP-1559, this transaction type supports a new fee market +// mechanism with a base fee and a priority fee (tip). type CallDynamicFee struct { - EmbedCallData - EmbedDynamicFeeData - EmbedAccessListData + CallFields + DynamicFeeFields + AccessListField } +// NewCallDynamicFee creates a new CallDynamicFee. func NewCallDynamicFee() *CallDynamicFee { return &CallDynamicFee{} } +// Copy creates a deep copy of the CallDynamicFee. func (c *CallDynamicFee) Copy() *CallDynamicFee { if c == nil { return nil } return &CallDynamicFee{ - EmbedCallData: *c.EmbedCallData.Copy(), - EmbedDynamicFeeData: *c.EmbedDynamicFeeData.Copy(), - EmbedAccessListData: *c.EmbedAccessListData.Copy(), + CallFields: *c.CallFields.Copy(), + DynamicFeeFields: *c.DynamicFeeFields.Copy(), + AccessListField: *c.AccessListField.Copy(), } } +// MarshalJSON implements the json.Marshaler interface. func (c *CallDynamicFee) MarshalJSON() ([]byte, error) { - call := &jsonCallDynamicFee{ - From: c.From, - To: c.To, - Data: c.Input, - AccessList: c.AccessList, - } - if c.GasLimit != nil { - call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) - } - if c.MaxFeePerGas != nil { - call.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) - } - if c.MaxPriorityFeePerGas != nil { - call.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) - } - if c.Value != nil { - value := NumberFromBigInt(c.Value) - call.Value = &value - } - return json.Marshal(call) + j := &jsonCall{} + c.CallFields.toJSON(j) + c.DynamicFeeFields.toJSON(j) + c.AccessListField.toJSON(j) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (c *CallDynamicFee) UnmarshalJSON(data []byte) error { - call := &jsonCallDynamicFee{} - if err := json.Unmarshal(data, call); err != nil { + j := &jsonCall{} + if err := json.Unmarshal(data, &j); err != nil { return err } - c.From = call.From - c.To = call.To - if call.GasLimit != nil { - gas := call.GasLimit.Big().Uint64() - c.GasLimit = &gas - } - if call.MaxFeePerGas != nil { - c.MaxFeePerGas = call.MaxFeePerGas.Big() - } - if call.MaxPriorityFeePerGas != nil { - c.MaxPriorityFeePerGas = call.MaxPriorityFeePerGas.Big() - } - if call.Value != nil { - c.Value = call.Value.Big() - } - c.Input = call.Data - c.AccessList = call.AccessList + c.CallFields.fromJSON(j) + c.DynamicFeeFields.fromJSON(j) + c.AccessListField.fromJSON(j) return nil } -type jsonCallDynamicFee struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Value *Number `json:"value,omitempty"` - Data Bytes `json:"data,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` -} +var _ Call = (*CallDynamicFee)(nil) diff --git a/types/call_dynamicfee_test.go b/types/call_dynamicfee_test.go new file mode 100644 index 0000000..b071abb --- /dev/null +++ b/types/call_dynamicfee_test.go @@ -0,0 +1,83 @@ +package types + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCallDynamicFee_JSON(t *testing.T) { + tests := []struct { + name string + call *CallDynamicFee + wantJSON string + }{ + { + name: "empty call", + call: &CallDynamicFee{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + call: &CallDynamicFee{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + }, + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ] + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.call.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Decode from JSON + tx := NewCallDynamicFee() + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded calls + tx.From = tt.call.From + assertEqualCall(t, tx, tt.call) + }) + } +} diff --git a/types/call_legacy.go b/types/call_legacy.go index 63e07e8..8c504b6 100644 --- a/types/call_legacy.go +++ b/types/call_legacy.go @@ -2,70 +2,45 @@ package types import "encoding/json" +// CallLegacy represents a call corresponding to the legacy transaction type. type CallLegacy struct { - EmbedCallData - EmbedLegacyPriceData + CallFields + LegacyPriceField } +// NewCallLegacy creates a new CallLegacy. func NewCallLegacy() *CallLegacy { return &CallLegacy{} } +// Copy creates a deep copy of the CallLegacy. func (c *CallLegacy) Copy() *CallLegacy { if c == nil { return nil } return &CallLegacy{ - EmbedCallData: *c.EmbedCallData.Copy(), - EmbedLegacyPriceData: *c.EmbedLegacyPriceData.Copy(), + CallFields: *c.CallFields.Copy(), + LegacyPriceField: *c.LegacyPriceField.Copy(), } } +// MarshalJSON implements the json.Marshaler interface. func (c CallLegacy) MarshalJSON() ([]byte, error) { - call := &jsonCallLegacy{ - From: c.From, - To: c.To, - Data: c.Input, - } - if c.GasLimit != nil { - call.GasLimit = NumberFromUint64Ptr(*c.GasLimit) - } - if c.GasPrice != nil { - call.GasPrice = NumberFromBigIntPtr(c.GasPrice) - } - if c.Value != nil { - value := NumberFromBigInt(c.Value) - call.Value = &value - } - return json.Marshal(call) + j := &jsonCall{} + c.CallFields.toJSON(j) + c.LegacyPriceField.toJSON(j) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (c *CallLegacy) UnmarshalJSON(data []byte) error { - call := &jsonCallLegacy{} - if err := json.Unmarshal(data, call); err != nil { + j := &jsonCall{} + if err := json.Unmarshal(data, &j); err != nil { return err } - c.From = call.From - c.To = call.To - if call.GasLimit != nil { - gas := call.GasLimit.Big().Uint64() - c.GasLimit = &gas - } - if call.GasPrice != nil { - c.GasPrice = call.GasPrice.Big() - } - if call.Value != nil { - c.Value = call.Value.Big() - } - c.Input = call.Data + c.CallFields.fromJSON(j) + c.LegacyPriceField.fromJSON(j) return nil } -type jsonCallLegacy struct { - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - Value *Number `json:"value,omitempty"` - Data Bytes `json:"data,omitempty"` -} +var _ Call = (*CallLegacy)(nil) diff --git a/types/call_legacy_test.go b/types/call_legacy_test.go new file mode 100644 index 0000000..9f350a4 --- /dev/null +++ b/types/call_legacy_test.go @@ -0,0 +1,63 @@ +package types + +import ( + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestCallLegacy_JSON(t *testing.T) { + tests := []struct { + name string + call *CallLegacy + wantJSON string + }{ + { + name: "all fields nil", + call: &CallLegacy{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + call: &CallLegacy{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + }, + wantJSON: `{ + "gasPrice": "0x3b9aca00", + "gas": "0x186a0", + "to": "0x2222222222222222222222222222222222222222", + "value": "0xde0b6b3a7640000", + "input": "0x01020304", + "from": "0x1111111111111111111111111111111111111111" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.call.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Decode from JSON + call := NewCallLegacy() + err = call.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded call + call.From = tt.call.From + assertEqualCall(t, call, tt.call) + }) + } +} diff --git a/types/embed.go b/types/embed.go index 26ed2d1..0348ece 100644 --- a/types/embed.go +++ b/types/embed.go @@ -1,82 +1,179 @@ package types -import "math/big" +import ( + "math/big" -// Embedded types are used to embed common fields and methods into call and -// transaction types. + "github.com/defiweb/go-eth/crypto/kzg4844" +) -type HasCallData interface { - CallData() *EmbedCallData - SetCallData(data *EmbedCallData) +// Below types are used to embed common fields and methods into call and +// transaction types. You probably do not want to use them directly. +// +// Below interfaces are used to determine if a given call or transaction has +// specific capabilities. + +// TransactionData defines methods for accessing and setting transaction +// data. +type TransactionData interface { + TransactionData() *TransactionFields + SetTransactionData(data TransactionFields) +} + +// CallData defines methods for accessing and setting call data. +type CallData interface { + CallData() *CallFields + SetCallData(data CallFields) +} + +// LegacyPriceData defines methods for accessing and setting legacy price data. +type LegacyPriceData interface { + LegacyPriceData() *LegacyPriceField + SetLegacyPriceData(data LegacyPriceField) +} + +// AccessListData defines methods for accessing and setting access list +// data. +type AccessListData interface { + AccessListData() *AccessListField + SetAccessListData(data AccessListField) +} + +// DynamicFeeData defines methods for accessing and setting dynamic fee`1 +// data. +type DynamicFeeData interface { + DynamicFeeData() *DynamicFeeFields + SetDynamicFeeData(data DynamicFeeFields) +} + +// BlobData defines methods for accessing and setting blob data. +type BlobData interface { + BlobData() *BlobFields + SetBlobData(data BlobFields) +} + +// TransactionFields contains common fields for transactions. +// +// This type is used to embed transaction data into other types. +type TransactionFields struct { + ChainID *uint64 // ChainID is the chain ID. + Nonce *uint64 // Nonce is the transaction nonce. + Signature *Signature // Signature is the transaction signature. +} + +// TransactionData returns the embedded transaction data. +func (c *TransactionFields) TransactionData() *TransactionFields { + return c +} + +// SetTransactionData sets the embedded transaction data. +func (c *TransactionFields) SetTransactionData(data TransactionFields) { + *c = data +} + +// SetChainID sets the chain ID. +func (c *TransactionFields) SetChainID(chainID uint64) { + c.ChainID = &chainID } -type HasTransactionData interface { - TransactionData() *EmbedTransactionData - SetTransactionData(data *EmbedTransactionData) +// SetNonce sets the transaction nonce. +func (c *TransactionFields) SetNonce(nonce uint64) { + c.Nonce = &nonce } -type HasLegacyPrice interface { - LegacyPriceData() *EmbedLegacyPriceData - SetLegacyPriceData(data *EmbedLegacyPriceData) +// SetSignature sets the transaction signature. +func (c *TransactionFields) SetSignature(signature Signature) { + c.Signature = &signature } -type HasAccessListData interface { - AccessListData() *EmbedAccessListData - SetAccessListData(data *EmbedAccessListData) +// Copy creates a deep copy of the TransactionFields. +func (c *TransactionFields) Copy() *TransactionFields { + return &TransactionFields{ + ChainID: copyPtr(c.ChainID), + Nonce: copyPtr(c.Nonce), + Signature: c.Signature.Copy(), + } } -type HasDynamicFeeData interface { - DynamicFeeData() *EmbedDynamicFeeData - SetDynamicFeeData(data *EmbedDynamicFeeData) +func (c *TransactionFields) toJSON(j *jsonTransaction) { + if c.ChainID != nil { + j.ChainID = NumberFromUint64Ptr(*c.ChainID) + } + if c.Nonce != nil { + j.Nonce = NumberFromUint64Ptr(*c.Nonce) + } + if c.Signature != nil { + j.V = NumberFromBigIntPtr(c.Signature.V) + j.R = NumberFromBigIntPtr(c.Signature.R) + j.S = NumberFromBigIntPtr(c.Signature.S) + } } -type HasBlobData interface { - BlobData() *EmbedBlobData - SetBlobData(data *EmbedBlobData) +func (c *TransactionFields) fromJSON(j *jsonTransaction) { + if j.ChainID != nil { + chainID := j.ChainID.Big().Uint64() + c.ChainID = &chainID + } + if j.Nonce != nil { + nonce := j.Nonce.Big().Uint64() + c.Nonce = &nonce + } + if j.V != nil || j.R != nil || j.S != nil { + c.Signature = SignatureFromVRSPtr(j.V.Big(), j.R.Big(), j.S.Big()) + } } -// EmbedCallData is set of common fields for calls and transactions. -type EmbedCallData struct { +// CallFields contains the basic fields for a call. +// +// This type is used to embed call data into other types. +type CallFields struct { From *Address // From is the sender address. - To *Address // To is the recipient address. nil means contract creation. - GasLimit *uint64 // GasLimit is the gas limit, if 0, there is no limit. + To *Address // To is the recipient address. Nil means contract creation. + GasLimit *uint64 // GasLimit is the gas limit; if 0, there is no limit. Value *big.Int // Value is the amount of wei to send. Input []byte // Input is the input data. } -func (c *EmbedCallData) CallData() *EmbedCallData { +// CallData returns the embedded call data. +func (c *CallFields) CallData() *CallFields { return c } -func (c *EmbedCallData) SetCallData(data *EmbedCallData) { - *c = *data +// SetCallData sets the embedded call data. +func (c *CallFields) SetCallData(data CallFields) { + *c = data } -func (c *EmbedCallData) SetFrom(from Address) { +// SetFrom sets the sender address. +func (c *CallFields) SetFrom(from Address) { c.From = &from } -func (c *EmbedCallData) SetTo(to Address) { +// SetTo sets the recipient address. +func (c *CallFields) SetTo(to Address) { c.To = &to } -func (c *EmbedCallData) SetGasLimit(gasLimit uint64) { +// SetGasLimit sets the gas limit. +func (c *CallFields) SetGasLimit(gasLimit uint64) { c.GasLimit = &gasLimit } -func (c *EmbedCallData) SetValue(value *big.Int) { +// SetValue sets the amount of wei to send. +func (c *CallFields) SetValue(value *big.Int) { c.Value = value } -func (c *EmbedCallData) SetInput(input []byte) { +// SetInput sets the input data. +func (c *CallFields) SetInput(input []byte) { c.Input = input } -func (c *EmbedCallData) Copy() *EmbedCallData { +// Copy creates a deep copy of the CallFields. +func (c *CallFields) Copy() *CallFields { if c == nil { return nil } - return &EmbedCallData{ + return &CallFields{ From: copyPtr(c.From), To: copyPtr(c.To), GasLimit: copyPtr(c.GasLimit), @@ -85,158 +182,265 @@ func (c *EmbedCallData) Copy() *EmbedCallData { } } -// EmbedTransactionData is a set of common fields for transactions. -type EmbedTransactionData struct { - ChainID *uint64 - Nonce *uint64 - Signature *Signature -} - -func (c *EmbedTransactionData) TransactionData() *EmbedTransactionData { - return c -} - -func (c *EmbedTransactionData) SetTransactionData(data *EmbedTransactionData) { - *c = *data -} - -func (c *EmbedTransactionData) SetChainID(chainID uint64) { - c.ChainID = &chainID -} - -func (c *EmbedTransactionData) SetNonce(nonce uint64) { - c.Nonce = &nonce -} - -func (c *EmbedTransactionData) SetSignature(signature Signature) { - c.Signature = &signature +func (c *CallFields) toJSON(j *jsonCall) { + j.From = c.From + j.To = c.To + if c.GasLimit != nil { + j.GasLimit = NumberFromUint64Ptr(*c.GasLimit) + } + if c.Value != nil { + j.Value = NumberFromBigIntPtr(c.Value) + } + j.Input = c.Input } -func (c *EmbedTransactionData) Copy() *EmbedTransactionData { - return &EmbedTransactionData{ - ChainID: copyPtr(c.ChainID), - Nonce: copyPtr(c.Nonce), - Signature: c.Signature.Copy(), +func (c *CallFields) fromJSON(j *jsonCall) { + c.From = j.From + c.To = j.To + if j.GasLimit != nil { + gas := j.GasLimit.Big().Uint64() + c.GasLimit = &gas + } + if j.Value != nil { + c.Value = j.Value.Big() } + c.Input = j.Input } -type EmbedLegacyPriceData struct { - GasPrice *big.Int +// LegacyPriceField contains the gas price for legacy transactions. +// +// This type is used to embed legacy price data into other types. +type LegacyPriceField struct { + GasPrice *big.Int // GasPrice is the gas price. } -func (c *EmbedLegacyPriceData) LegacyPriceData() *EmbedLegacyPriceData { +// LegacyPriceData returns the embedded legacy price data. +func (c *LegacyPriceField) LegacyPriceData() *LegacyPriceField { return c } -func (c *EmbedLegacyPriceData) SetLegacyPriceData(data *EmbedLegacyPriceData) { - *c = *data +// SetLegacyPriceData sets the embedded legacy price data. +func (c *LegacyPriceField) SetLegacyPriceData(data LegacyPriceField) { + *c = data } -func (c *EmbedLegacyPriceData) SetGasPrice(gasPrice *big.Int) { +// SetGasPrice sets the gas price. +func (c *LegacyPriceField) SetGasPrice(gasPrice *big.Int) { c.GasPrice = gasPrice } -func (c *EmbedLegacyPriceData) Copy() *EmbedLegacyPriceData { +// Copy creates a deep copy of the LegacyPriceField. +func (c *LegacyPriceField) Copy() *LegacyPriceField { if c == nil { return nil } - return &EmbedLegacyPriceData{ + return &LegacyPriceField{ GasPrice: copyBigInt(c.GasPrice), } } -type EmbedAccessListData struct { - AccessList AccessList +func (c *LegacyPriceField) toJSON(j *jsonCall) { + if c.GasPrice != nil { + j.GasPrice = NumberFromBigIntPtr(c.GasPrice) + } +} + +func (c *LegacyPriceField) fromJSON(j *jsonCall) { + if j.GasPrice != nil { + c.GasPrice = j.GasPrice.Big() + } } -func (c *EmbedAccessListData) AccessListData() *EmbedAccessListData { +// AccessListField contains the access list for EIP-2930 transactions. +// +// This type is used to embed access list data into other types. +type AccessListField struct { + AccessList AccessList // AccessList is the EIP-2930 access list. +} + +// AccessListData returns the embedded access list data. +func (c *AccessListField) AccessListData() *AccessListField { return c } -func (c *EmbedAccessListData) SetAccessListData(data *EmbedAccessListData) { - *c = *data +// SetAccessListData sets the embedded access list data. +func (c *AccessListField) SetAccessListData(data AccessListField) { + *c = data } -func (c *EmbedAccessListData) SetAccessList(accessList AccessList) { +// SetAccessList sets the access list. +func (c *AccessListField) SetAccessList(accessList AccessList) { c.AccessList = accessList } -func (c *EmbedAccessListData) Copy() *EmbedAccessListData { +// Copy creates a deep copy of the AccessListField. +func (c *AccessListField) Copy() *AccessListField { if c == nil { return nil } - return &EmbedAccessListData{ + return &AccessListField{ AccessList: c.AccessList.Copy(), } } -type EmbedDynamicFeeData struct { - MaxFeePerGas *big.Int - MaxPriorityFeePerGas *big.Int +func (c *AccessListField) toJSON(j *jsonCall) { + j.AccessList = c.AccessList +} + +func (c *AccessListField) fromJSON(j *jsonCall) { + c.AccessList = j.AccessList +} + +// DynamicFeeFields contains fee data for EIP-1559 transactions. +// +// This type is used to embed dynamic fee data into other types. +type DynamicFeeFields struct { + MaxFeePerGas *big.Int // MaxFeePerGas is the maximum total fee per gas. + MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas. } -func (c *EmbedDynamicFeeData) DynamicFeeData() *EmbedDynamicFeeData { +// DynamicFeeData returns the embedded dynamic fee data. +func (c *DynamicFeeFields) DynamicFeeData() *DynamicFeeFields { return c } -func (c *EmbedDynamicFeeData) SetDynamicFeeData(data *EmbedDynamicFeeData) { - *c = *data +// SetDynamicFeeData sets the embedded dynamic fee data. +func (c *DynamicFeeFields) SetDynamicFeeData(data DynamicFeeFields) { + *c = data } -func (c *EmbedDynamicFeeData) SetMaxFeePerGas(maxFeePerGas *big.Int) { +// SetMaxFeePerGas sets the maximum total fee per gas. +func (c *DynamicFeeFields) SetMaxFeePerGas(maxFeePerGas *big.Int) { c.MaxFeePerGas = maxFeePerGas } -func (c *EmbedDynamicFeeData) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) { +// SetMaxPriorityFeePerGas sets the maximum priority fee per gas. +func (c *DynamicFeeFields) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) { c.MaxPriorityFeePerGas = maxPriorityFeePerGas } -func (c *EmbedDynamicFeeData) Copy() *EmbedDynamicFeeData { +// Copy creates a deep copy of the DynamicFeeFields. +func (c *DynamicFeeFields) Copy() *DynamicFeeFields { if c == nil { return nil } - return &EmbedDynamicFeeData{ + return &DynamicFeeFields{ MaxFeePerGas: copyBigInt(c.MaxFeePerGas), MaxPriorityFeePerGas: copyBigInt(c.MaxPriorityFeePerGas), } } -type EmbedBlobData struct { - MaxFeePerBlobGas *big.Int - Blobs []Blob +func (c *DynamicFeeFields) toJSON(j *jsonCall) { + if c.MaxFeePerGas != nil { + j.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) + } + if c.MaxPriorityFeePerGas != nil { + j.MaxPriorityFeePerGas = NumberFromBigIntPtr(c.MaxPriorityFeePerGas) + } +} + +func (c *DynamicFeeFields) fromJSON(j *jsonCall) { + if j.MaxFeePerGas != nil { + c.MaxFeePerGas = j.MaxFeePerGas.Big() + } + if j.MaxPriorityFeePerGas != nil { + c.MaxPriorityFeePerGas = j.MaxPriorityFeePerGas.Big() + } +} + +// BlobFields contains data for EIP-4844 blob transactions. +// +// Use NewBlobInfo to create a BlobInfo. +// +// This type is used to embed blob data into other types. +type BlobFields struct { + MaxFeePerBlobGas *big.Int // MaxFeePerBlobGas is the maximum fee per blob gas. + Blobs []BlobInfo // Blobs is the list of blobs. } -func (c *EmbedBlobData) BlobData() *EmbedBlobData { +// BlobData returns the embedded blob data. +func (c *BlobFields) BlobData() *BlobFields { return c } -func (c *EmbedBlobData) SetBlobData(data *EmbedBlobData) { - *c = *data +// SetBlobData sets the embedded blob data. +func (c *BlobFields) SetBlobData(data BlobFields) { + *c = data } -func (c *EmbedBlobData) SetMaxFeePerBlobGas(maxFeePerBlobGas *big.Int) { +// SetMaxFeePerBlobGas sets the maximum fee per blob gas. +func (c *BlobFields) SetMaxFeePerBlobGas(maxFeePerBlobGas *big.Int) { c.MaxFeePerBlobGas = maxFeePerBlobGas } -func (c *EmbedBlobData) SetBlobs(blobs []Blob) { +// SetBlobs sets the list of blobs. +// +// Use NewBlobInfo to create a BlobInfo. +func (c *BlobFields) SetBlobs(blobs []BlobInfo) { c.Blobs = blobs } -func (c *EmbedBlobData) AddBlob(blob Blob) { +// AddBlob adds a blob to the list. +// +// Use NewBlobInfo to create a BlobInfo. +func (c *BlobFields) AddBlob(blob BlobInfo) { c.Blobs = append(c.Blobs, blob) } -func (c *EmbedBlobData) Copy() *EmbedBlobData { +// Copy creates a deep copy of the BlobFields. +func (c *BlobFields) Copy() *BlobFields { if c == nil { return nil } - blobs := make([]Blob, len(c.Blobs)) + blobs := make([]BlobInfo, len(c.Blobs)) for i, blob := range c.Blobs { blobs[i].Hash = blob.Hash blobs[i].Sidecar = copyPtr(blob.Sidecar) } - return &EmbedBlobData{ + return &BlobFields{ MaxFeePerBlobGas: copyBigInt(c.MaxFeePerBlobGas), Blobs: blobs, } } + +func (c *BlobFields) toJSON(j *jsonCall) { + if c.MaxFeePerBlobGas != nil { + j.MaxFeePerBlobGas = NumberFromBigIntPtr(c.MaxFeePerBlobGas) + } + if len(c.Blobs) > 0 && c.Blobs[0].Sidecar != nil { + // If the first blob has a sidecar, then all blobs should have + // sidecars, so we can allocate memory for them. + j.BlobHashes = make([]Hash, 0, len(c.Blobs)) + j.Blobs = make([]kzgBlob, 0, len(c.Blobs)) + j.Commitments = make([]kzgCommitment, 0, len(c.Blobs)) + j.Proofs = make([]kzgProof, 0, len(c.Blobs)) + } + for _, b := range c.Blobs { + j.BlobHashes = append(j.BlobHashes, b.Hash) + if b.Sidecar != nil { + j.Blobs = append(j.Blobs, kzgBlob(b.Sidecar.Blob)) + j.Commitments = append(j.Commitments, kzgCommitment(b.Sidecar.Commitment)) + j.Proofs = append(j.Proofs, kzgProof(b.Sidecar.Proof)) + } + } +} + +func (c *BlobFields) fromJSON(j *jsonCall) { + if j.MaxFeePerBlobGas != nil { + c.MaxFeePerBlobGas = j.MaxFeePerBlobGas.Big() + } + if len(j.BlobHashes) > 0 { + c.Blobs = make([]BlobInfo, len(j.BlobHashes)) + for i, h := range j.BlobHashes { + b := BlobInfo{Hash: h} + if i < len(j.Blobs) && i < len(j.Commitments) && i < len(j.Proofs) { + b.Sidecar = &BlobSidecar{ + Blob: kzg4844.Blob(j.Blobs[i]), + Commitment: kzg4844.Commitment(j.Commitments[i]), + Proof: kzg4844.Proof(j.Proofs[i]), + } + } + c.Blobs[i] = b + } + } +} diff --git a/types/embed_test.go b/types/embed_test.go new file mode 100644 index 0000000..de6dd42 --- /dev/null +++ b/types/embed_test.go @@ -0,0 +1,592 @@ +package types + +import ( + "encoding/json" + "math/big" + "regexp" + "testing" + + "github.com/stretchr/testify/assert" + + "github.com/defiweb/go-eth/crypto/kzg4844" +) + +func TestTransactionData_JSON(t *testing.T) { + tests := []struct { + name string + data *TransactionFields + want *jsonTransaction + wantJSON string + }{ + { + name: "all fields nil", + data: &TransactionFields{}, + want: &jsonTransaction{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + data: &TransactionFields{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(2)), + Signature: &Signature{ + V: big.NewInt(27), + R: big.NewInt(123456), + S: big.NewInt(654321), + }, + }, + want: &jsonTransaction{ + ChainID: NumberFromUint64Ptr(1), + Nonce: NumberFromUint64Ptr(2), + V: NumberFromBigIntPtr(big.NewInt(27)), + R: NumberFromBigIntPtr(big.NewInt(123456)), + S: NumberFromBigIntPtr(big.NewInt(654321)), + }, + wantJSON: `{ + "chainId": "0x1", + "nonce": "0x2", + "v": "0x1b", + "r": "0x1e240", + "s": "0x9fbf1" + }`, + }, + { + name: "nil signature", + data: &TransactionFields{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(2)), + Signature: nil, + }, + want: &jsonTransaction{ + ChainID: NumberFromUint64Ptr(1), + Nonce: NumberFromUint64Ptr(2), + V: nil, + R: nil, + S: nil, + }, + wantJSON: `{ + "chainId": "0x1", + "nonce": "0x2" + }`, + }, + { + name: "max uint64 values", + data: &TransactionFields{ + ChainID: ptr(^uint64(0)), + Nonce: ptr(^uint64(0)), + }, + want: &jsonTransaction{ + ChainID: NumberFromUint64Ptr(^uint64(0)), + Nonce: NumberFromUint64Ptr(^uint64(0)), + }, + wantJSON: `{ + "chainId": "0xffffffffffffffff", + "nonce": "0xffffffffffffffff" + }`, + }, + { + name: "zero values", + data: &TransactionFields{ + ChainID: ptr(uint64(0)), + Nonce: ptr(uint64(0)), + Signature: &Signature{ + V: big.NewInt(0), + R: big.NewInt(0), + S: big.NewInt(0), + }, + }, + want: &jsonTransaction{ + ChainID: NumberFromUint64Ptr(0), + Nonce: NumberFromUint64Ptr(0), + V: NumberFromBigIntPtr(big.NewInt(0)), + R: NumberFromBigIntPtr(big.NewInt(0)), + S: NumberFromBigIntPtr(big.NewInt(0)), + }, + wantJSON: `{ + "chainId": "0x0", + "nonce": "0x0", + "v": "0x0", + "r": "0x0", + "s": "0x0" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonTransaction + tt.data.toJSON(&j) + assert.Equal(t, tt.want.ChainID, j.ChainID) + assert.Equal(t, tt.want.Nonce, j.Nonce) + assert.Equal(t, tt.want.V, j.V) + assert.Equal(t, tt.want.R, j.R) + assert.Equal(t, tt.want.S, j.S) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Test fromJSON + var data TransactionFields + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.ChainID, data.ChainID) + assert.Equal(t, tt.data.Nonce, data.Nonce) + if tt.data.Signature == nil { + assert.Nil(t, data.Signature) + } else { + assert.NotNil(t, data.Signature) + assert.Equal(t, tt.data.Signature.V, data.Signature.V) + assert.Equal(t, tt.data.Signature.R, data.Signature.R) + assert.Equal(t, tt.data.Signature.S, data.Signature.S) + } + }) + } +} + +func TestCallData_JSON(t *testing.T) { + tests := []struct { + name string + data *CallFields + want *jsonCall + wantJSON string + }{ + { + name: "all fields nil", + data: &CallFields{}, + want: &jsonCall{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + data: &CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + GasLimit: ptr(uint64(21000)), + Value: big.NewInt(1000000000000000000), + Input: []byte{0x01, 0x02, 0x03}, + }, + want: &jsonCall{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + GasLimit: NumberFromUint64Ptr(21000), + Value: NumberFromBigIntPtr(big.NewInt(1000000000000000000)), + Input: []byte{0x01, 0x02, 0x03}, + }, + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x5208", + "value": "0xde0b6b3a7640000", + "input": "0x010203" + }`, + }, + { + name: "max values", + data: &CallFields{ + From: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), + To: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), + GasLimit: ptr(^uint64(0)), + Value: big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1)), + Input: []byte{0x01, 0x02, 0x03}, + }, + want: &jsonCall{ + From: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), + To: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), + GasLimit: NumberFromUint64Ptr(^uint64(0)), + Value: NumberFromBigIntPtr(big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1))), + Input: []byte{0x01, 0x02, 0x03}, + }, + wantJSON: `{ + "from": "0xffffffffffffffffffffffffffffffffffffffff", + "to": "0xffffffffffffffffffffffffffffffffffffffff", + "gas": "0xffffffffffffffff", + "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "input": "0x010203" + }`, + }, + { + name: "zero values", + data: &CallFields{ + From: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), + To: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), + GasLimit: ptr(uint64(0)), + Value: big.NewInt(0), + Input: []byte{}, + }, + want: &jsonCall{ + From: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), + To: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), + GasLimit: NumberFromUint64Ptr(0), + Value: NumberFromBigIntPtr(big.NewInt(0)), + Input: []byte{}, + }, + wantJSON: `{ + "from": "0x0000000000000000000000000000000000000000", + "to": "0x0000000000000000000000000000000000000000", + "gas": "0x0", + "value": "0x0" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonCall + tt.data.toJSON(&j) + assert.Equal(t, tt.want.From, j.From) + assert.Equal(t, tt.want.To, j.To) + assert.Equal(t, tt.want.GasLimit, j.GasLimit) + assert.Equal(t, tt.want.Value, j.Value) + assert.Equal(t, tt.want.Input, j.Input) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Test fromJSON + var data CallFields + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.From, data.From) + assert.Equal(t, tt.data.To, data.To) + assert.Equal(t, tt.data.GasLimit, data.GasLimit) + assert.Equal(t, tt.data.Value, data.Value) + assert.Equal(t, tt.data.Input, data.Input) + }) + } +} + +func TestLegacyPriceData_JSON(t *testing.T) { + tests := []struct { + name string + data *LegacyPriceField + want *jsonCall + wantJSON string + }{ + { + name: "all fields nil", + data: &LegacyPriceField{}, + want: &jsonCall{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + data: &LegacyPriceField{ + GasPrice: big.NewInt(2000000000), + }, + want: &jsonCall{ + GasPrice: NumberFromBigIntPtr(big.NewInt(2000000000)), + }, + wantJSON: `{ + "gasPrice": "0x77359400" + }`, + }, + { + name: "zero value", + data: &LegacyPriceField{ + GasPrice: big.NewInt(0), + }, + want: &jsonCall{ + GasPrice: NumberFromBigIntPtr(big.NewInt(0)), + }, + wantJSON: `{ + "gasPrice": "0x0" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonCall + tt.data.toJSON(&j) + assert.Equal(t, tt.want.GasPrice, j.GasPrice) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Test fromJSON + var data LegacyPriceField + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.GasPrice, data.GasPrice) + }) + } +} + +func TestAccessListData_JSON(t *testing.T) { + tests := []struct { + name string + data *AccessListField + want *jsonCall + wantJSON string + }{ + { + name: "all fields nil", + data: &AccessListField{}, + want: &jsonCall{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + data: &AccessListField{ + AccessList: AccessList{ + { + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + }, + }, + want: &jsonCall{ + AccessList: AccessList{ + { + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + }, + }, + wantJSON: `{ + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ] + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonCall + tt.data.toJSON(&j) + assert.Equal(t, tt.want.AccessList, j.AccessList) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Test fromJSON + var data AccessListField + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.AccessList, data.AccessList) + }) + } +} + +func TestDynamicFeeData_JSON(t *testing.T) { + tests := []struct { + name string + data *DynamicFeeFields + want *jsonCall + wantJSON string + }{ + { + name: "all fields nil", + data: &DynamicFeeFields{}, + want: &jsonCall{}, + wantJSON: `{}`, + }, + { + name: "all fields set", + data: &DynamicFeeFields{ + MaxFeePerGas: big.NewInt(2000000000), + MaxPriorityFeePerGas: big.NewInt(1000000000), + }, + want: &jsonCall{ + MaxFeePerGas: NumberFromBigIntPtr(big.NewInt(2000000000)), + MaxPriorityFeePerGas: NumberFromBigIntPtr(big.NewInt(1000000000)), + }, + wantJSON: `{ + "maxFeePerGas": "0x77359400", + "maxPriorityFeePerGas": "0x3b9aca00" + }`, + }, + { + name: "zero values", + data: &DynamicFeeFields{ + MaxFeePerGas: big.NewInt(0), + MaxPriorityFeePerGas: big.NewInt(0), + }, + want: &jsonCall{ + MaxFeePerGas: NumberFromBigIntPtr(big.NewInt(0)), + MaxPriorityFeePerGas: NumberFromBigIntPtr(big.NewInt(0)), + }, + wantJSON: `{ + "maxFeePerGas": "0x0", + "maxPriorityFeePerGas": "0x0" + }`, + }, + { + name: "max values", + data: &DynamicFeeFields{ + MaxFeePerGas: big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1)), + MaxPriorityFeePerGas: big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1)), + }, + want: &jsonCall{ + MaxFeePerGas: NumberFromBigIntPtr(big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1))), + MaxPriorityFeePerGas: NumberFromBigIntPtr(big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1))), + }, + wantJSON: `{ + "maxFeePerGas": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "maxPriorityFeePerGas": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonCall + tt.data.toJSON(&j) + assert.Equal(t, tt.want.MaxFeePerGas, j.MaxFeePerGas) + assert.Equal(t, tt.want.MaxPriorityFeePerGas, j.MaxPriorityFeePerGas) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Test fromJSON + var data DynamicFeeFields + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.MaxFeePerGas, data.MaxFeePerGas) + assert.Equal(t, tt.data.MaxPriorityFeePerGas, data.MaxPriorityFeePerGas) + }) + } +} + +func TestBlobData_JSON(t *testing.T) { + remZerosRx := regexp.MustCompile(`0{128,}`) + tests := []struct { + name string + data *BlobFields + want *jsonCall + wantJSON string + }{ + { + name: "all fields nil", + data: &BlobFields{}, + want: &jsonCall{}, + wantJSON: `{}`, + }, + { + name: "blobs with sidecars", + data: &BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Sidecar: &BlobSidecar{ + Blob: kzg4844.Blob{0x01, 0x02, 0x03}, + Commitment: kzg4844.Commitment{0x04, 0x05, 0x06}, + Proof: kzg4844.Proof{0x07, 0x08, 0x09}, + }, + }, + }, + }, + want: &jsonCall{ + MaxFeePerBlobGas: NumberFromBigIntPtr(big.NewInt(3000000000)), + BlobHashes: []Hash{ + MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + Blobs: []kzgBlob{ + {0x01, 0x02, 0x03}, + }, + Commitments: []kzgCommitment{ + {0x04, 0x05, 0x06}, + }, + Proofs: []kzgProof{ + {0x07, 0x08, 0x09}, + }, + }, + // Note, that "blobs" fields should be 128KiB in length, but to keep the test readable, + // repeated zeros are removed. + wantJSON: `{ + "maxFeePerBlobGas": "0xb2d05e00", + "blobVersionedHashes": ["0x6666666666666666666666666666666666666666666666666666666666666666"], + "blobs": ["0x010203"], + "commitments": ["0x040506000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"], + "proofs": ["0x070809000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"] + }`, + }, + { + name: "blobs without sidecars", + data: &BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + { + Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone), + Sidecar: nil, + }, + }, + }, + want: &jsonCall{ + MaxFeePerBlobGas: NumberFromBigIntPtr(big.NewInt(3000000000)), + BlobHashes: []Hash{ + MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone), + }, + }, + wantJSON: `{ + "maxFeePerBlobGas": "0xb2d05e00", + "blobVersionedHashes": ["0x7777777777777777777777777777777777777777777777777777777777777777"] + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Test toJSON + var j jsonCall + tt.data.toJSON(&j) + assert.Equal(t, tt.want.MaxFeePerBlobGas, j.MaxFeePerBlobGas) + assert.Equal(t, tt.want.BlobHashes, j.BlobHashes) + assert.Equal(t, tt.want.Blobs, j.Blobs) + assert.Equal(t, tt.want.Commitments, j.Commitments) + assert.Equal(t, tt.want.Proofs, j.Proofs) + + // Verify generated JSON string + jsonBytes, err := json.Marshal(j) + assert.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(remZerosRx.ReplaceAll(jsonBytes, []byte("")))) + + // Test fromJSON + var data BlobFields + err = json.Unmarshal(jsonBytes, &j) + assert.NoError(t, err) + data.fromJSON(&j) + assert.Equal(t, tt.data.MaxFeePerBlobGas, data.MaxFeePerBlobGas) + assert.Equal(t, len(tt.data.Blobs), len(data.Blobs)) + for i := range tt.data.Blobs { + assert.Equal(t, tt.data.Blobs[i].Hash, data.Blobs[i].Hash) + if tt.data.Blobs[i].Sidecar == nil { + assert.Nil(t, data.Blobs[i].Sidecar) + } else { + assert.NotNil(t, data.Blobs[i].Sidecar) + assert.Equal(t, tt.data.Blobs[i].Sidecar.Blob, data.Blobs[i].Sidecar.Blob) + assert.Equal(t, tt.data.Blobs[i].Sidecar.Commitment, data.Blobs[i].Sidecar.Commitment) + assert.Equal(t, tt.data.Blobs[i].Sidecar.Proof, data.Blobs[i].Sidecar.Proof) + } + } + }) + } +} diff --git a/types/structs.go b/types/structs.go index 801ebe6..0eae31b 100644 --- a/types/structs.go +++ b/types/structs.go @@ -3,6 +3,7 @@ package types import ( "bytes" "encoding/json" + "errors" "fmt" "math/big" "time" @@ -13,7 +14,15 @@ import ( "github.com/defiweb/go-eth/crypto/kzg4844" ) -// AccessList is an EIP-2930 access list. +// AccessList represents an Ethereum access list as defined in EIP-2930. +// +// EIP-2930 introduced a new transaction type that includes an optional +// access list, which specifies a list of addresses and storage keys that the +// transaction plans to access. By declaring these accesses upfront, +// transactions can benefit from reduced gas costs for cold accesses, as +// the specified addresses and storage slots are warmed up ahead of execution. +// +// https://eips.ethereum.org/EIPS/eip-2930 type AccessList []AccessTuple // AccessTuple is the element type of access list. @@ -22,6 +31,7 @@ type AccessTuple struct { StorageKeys []Hash `json:"storageKeys"` } +// Copy creates a deep copy of the access list. func (a *AccessList) Copy() AccessList { if a == nil { return nil @@ -33,6 +43,7 @@ func (a *AccessList) Copy() AccessList { return c } +// EncodeRLP implements the rlp.Encoder interface. func (a AccessList) EncodeRLP() ([]byte, error) { l := rlp.List{} for _, tuple := range a { @@ -42,6 +53,7 @@ func (a AccessList) EncodeRLP() ([]byte, error) { return rlp.Encode(l) } +// DecodeRLP implements the rlp.Decoder interface. func (a *AccessList) DecodeRLP(data []byte) (int, error) { d, n, err := rlp.DecodeLazy(data) if err != nil { @@ -61,6 +73,7 @@ func (a *AccessList) DecodeRLP(data []byte) (int, error) { return n, nil } +// Copy creates a deep copy of the access tuple. func (a *AccessTuple) Copy() AccessTuple { keys := make([]Hash, len(a.StorageKeys)) copy(keys, a.StorageKeys) @@ -70,6 +83,7 @@ func (a *AccessTuple) Copy() AccessTuple { } } +// EncodeRLP implements the rlp.Encoder interface. func (a AccessTuple) EncodeRLP() ([]byte, error) { h := rlp.List{} for _, hash := range a.StorageKeys { @@ -79,6 +93,7 @@ func (a AccessTuple) EncodeRLP() ([]byte, error) { return rlp.Encode(rlp.List{a.Address, h}) } +// DecodeRLP implements the rlp.Decoder interface. func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { d, n, err := rlp.DecodeLazy(data) if err != nil { @@ -108,49 +123,69 @@ func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { return n, nil } -// Blob is an EIP-4844 blob for blob-carrying transactions. -type Blob struct { - Hash Hash // Hash is the hash of the blob. - Sidecar *BlobSidecar // Sidecar is an optional sidecar for the blob. +// BlobInfo represents the information of an EIP-4844 blob carried in a +// transaction. +// +// EIP-4844 introduces "blob-carrying transactions" to Ethereum, which include +// a new type of data called "blobs". These blobs are large binary objects that +// are not directly accessible by the EVM but are committed to the consensus +// layer. +// +// https://eips.ethereum.org/EIPS/eip-4844 +type BlobInfo struct { + Hash Hash // Hash of the blob. + Sidecar *BlobSidecar // Optional sidecar containing blob components. } -// BlobSidecar is part of the blob that is stored by the consensus layer. +// BlobSidecar contains the components of the blob stored by the consensus +// layer. type BlobSidecar struct { - Blob kzg4844.Blob // Blob needed by the blob pool - Commitment kzg4844.Commitment // Commitment needed by the blob pool - Proof kzg4844.Proof // Proof needed by the blob pool + Blob kzg4844.Blob // The actual blob data. + Commitment kzg4844.Commitment // Commitment for the blob. + Proof kzg4844.Proof // Proof for the blob. } -func NewBlob(data []byte) (Blob, error) { - if len(data) > kzg4844.BlobLength { - return Blob{}, fmt.Errorf("blob length exceeds maximum length of %d", kzg4844.BlobLength) +// ComputeHash computes the blob hash of the given blob sidecar. +func (sc *BlobSidecar) ComputeHash() Hash { + return crypto.KZGComputeBlobHashV1(sc.Commitment) +} + +// NewBlobInfo creates a new EIP-4844 BlobInfo from the given blob, computing +// its hash, commitment, and proof. +// +// The provided blob must not be nil and must be a valid EIP-4844 blob +// of length 131072 bytes (4096 field elements of 32 bytes each). +// Each field element is a 32-byte big-endian integer not exceeding the +// BLS12-381 field modulus specified in EIP-4844. +// +// NewBlobInfo does not perform any encoding on the provided data. +// +// Returns an error if the blob is nil or if the commitment/proof computation +// fails. +func NewBlobInfo(b *kzg4844.Blob) (BlobInfo, error) { + if b == nil { + return BlobInfo{}, errors.New("blob is nil") } - b := &kzg4844.Blob{} - copy(b[:], data) c, err := crypto.KZGBlobToCommitment(b) if err != nil { - return Blob{}, err + return BlobInfo{}, err } p, err := crypto.KZGComputeBlobProof(b, c) if err != nil { - return Blob{}, err + return BlobInfo{}, err } s := &BlobSidecar{ Blob: *b, Commitment: c, Proof: p, } - return Blob{ + return BlobInfo{ Hash: s.ComputeHash(), Sidecar: s, }, nil } -// ComputeHash computes the blob hash of the given blob sidecar. -func (sc *BlobSidecar) ComputeHash() Hash { - return crypto.KZGComputeBlobHashV1(sc.Commitment) -} - +// TransactionOnChain represents a transaction on the blockchain. type TransactionOnChain struct { Decoder JSONTransactionDecoder // Decoder is an optional transaction decoder, if nil, the default decoder is used. Transaction Transaction // Transaction is the transaction data. @@ -160,6 +195,7 @@ type TransactionOnChain struct { TransactionIndex *uint64 // TransactionIndex is the index of the transaction in the block. } +// MarshalJSON implements the json.Marshaler interface. func (t *TransactionOnChain) MarshalJSON() ([]byte, error) { ocd := &jsonOnChainTransaction{} ocd.Hash = t.Hash @@ -174,6 +210,7 @@ func (t *TransactionOnChain) MarshalJSON() ([]byte, error) { ) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionOnChain) UnmarshalJSON(data []byte) error { ocd := &jsonOnChainTransaction{} if err := json.Unmarshal(data, ocd); err != nil { @@ -223,6 +260,7 @@ type TransactionReceipt struct { Status *uint64 // Status is the status of the transaction. } +// MarshalJSON implements the json.Marshaler interface. func (t TransactionReceipt) MarshalJSON() ([]byte, error) { receipt := &jsonTransactionReceipt{ TransactionHash: t.TransactionHash, @@ -246,6 +284,7 @@ func (t TransactionReceipt) MarshalJSON() ([]byte, error) { return json.Marshal(receipt) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionReceipt) UnmarshalJSON(data []byte) error { receipt := &jsonTransactionReceipt{} if err := json.Unmarshal(data, receipt); err != nil { @@ -277,7 +316,7 @@ type jsonTransactionReceipt struct { BlockHash Hash `json:"blockHash"` BlockNumber Number `json:"blockNumber"` From Address `json:"from"` - To Address `json:"To"` + To Address `json:"to"` CumulativeGasUsed Number `json:"cumulativeGasUsed"` EffectiveGasPrice Number `json:"effectiveGasPrice"` GasUsed Number `json:"gasUsed"` @@ -288,6 +327,7 @@ type jsonTransactionReceipt struct { Status *Number `json:"status"` } +// Block represents a block on the blockchain. type Block struct { Number *big.Int // Block is the block number. Hash Hash // Hash is the hash of the block. @@ -312,6 +352,7 @@ type Block struct { ExtraData []byte // ExtraData is the "extra data" field of this block. } +// MarshalJSON implements the json.Marshaler interface. func (b Block) MarshalJSON() ([]byte, error) { block := &jsonBlock{ Number: NumberFromBigInt(b.Number), @@ -343,6 +384,7 @@ func (b Block) MarshalJSON() ([]byte, error) { return json.Marshal(block) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (b *Block) UnmarshalJSON(data []byte) error { block := &jsonBlock{} if err := json.Unmarshal(data, block); err != nil { @@ -417,7 +459,8 @@ func (b *jsonBlockTransactions) UnmarshalJSON(data []byte) error { return json.Unmarshal(data, &b.Hashes) } -// FeeHistory represents the result of the feeHistory Client call. +// FeeHistory contains information about the fee structure and gas usage +// over a range of blocks. type FeeHistory struct { OldestBlock uint64 // OldestBlock is the oldest block number for which the base fee and gas used are returned. Reward [][]*big.Int // Reward is the reward for each block in the range [OldestBlock, LatestBlock]. @@ -425,6 +468,7 @@ type FeeHistory struct { GasUsedRatio []float64 // GasUsedRatio is the gas used ratio for each block in the range [OldestBlock, LatestBlock]. } +// MarshalJSON implements the json.Marshaler interface. func (f FeeHistory) MarshalJSON() ([]byte, error) { feeHistory := &jsonFeeHistory{ OldestBlock: NumberFromUint64(f.OldestBlock), @@ -448,6 +492,7 @@ func (f FeeHistory) MarshalJSON() ([]byte, error) { return json.Marshal(feeHistory) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (f *FeeHistory) UnmarshalJSON(input []byte) error { feeHistory := &jsonFeeHistory{} if err := json.Unmarshal(input, feeHistory); err != nil { @@ -490,6 +535,7 @@ type Log struct { Removed bool // Removed is true if the log was reverted due to a chain reorganization. False if unknown. } +// MarshalJSON implements the json.Marshaler interface. func (l Log) MarshalJSON() ([]byte, error) { j := &jsonLog{} j.Address = l.Address @@ -510,6 +556,7 @@ func (l Log) MarshalJSON() ([]byte, error) { return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (l *Log) UnmarshalJSON(input []byte) error { log := &jsonLog{} if err := json.Unmarshal(input, log); err != nil { @@ -556,38 +603,47 @@ type FilterLogsQuery struct { BlockHash *Hash } +// NewFilterLogsQuery creates a new FilterLogsQuery. func NewFilterLogsQuery() *FilterLogsQuery { return &FilterLogsQuery{} } +// SetAddresses sets the addresses to filter logs. func (q *FilterLogsQuery) SetAddresses(addresses ...Address) { q.Address = addresses } +// AddAddresses adds addresses to filter logs. func (q *FilterLogsQuery) AddAddresses(addresses ...Address) { q.Address = append(q.Address, addresses...) } +// SetFromBlock sets the starting block number to filter logs. func (q *FilterLogsQuery) SetFromBlock(fromBlock *BlockNumber) { q.FromBlock = fromBlock } +// SetToBlock sets the ending block number to filter logs. func (q *FilterLogsQuery) SetToBlock(toBlock *BlockNumber) { q.ToBlock = toBlock } +// SetTopics sets the topics to filter logs. func (q *FilterLogsQuery) SetTopics(topics ...[]Hash) { q.Topics = topics } +// AddTopics adds topics to filter logs. func (q *FilterLogsQuery) AddTopics(topics ...[]Hash) { q.Topics = append(q.Topics, topics...) } +// SetBlockHash sets the block hash to filter logs. func (q *FilterLogsQuery) SetBlockHash(blockHash *Hash) { q.BlockHash = blockHash } +// MarshalJSON implements the json.Marshaler interface. func (q FilterLogsQuery) MarshalJSON() ([]byte, error) { logsQuery := &jsonFilterLogsQuery{ FromBlock: q.FromBlock, @@ -599,7 +655,7 @@ func (q FilterLogsQuery) MarshalJSON() ([]byte, error) { copy(logsQuery.Address, q.Address) } if len(q.Topics) > 0 { - logsQuery.Topics = make([]hashList, len(q.Topics)) + logsQuery.Topics = make([]oneOrList[Hash], len(q.Topics)) for i, t := range q.Topics { logsQuery.Topics[i] = make([]Hash, len(t)) copy(logsQuery.Topics[i], t) @@ -608,6 +664,7 @@ func (q FilterLogsQuery) MarshalJSON() ([]byte, error) { return json.Marshal(logsQuery) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (q *FilterLogsQuery) UnmarshalJSON(input []byte) error { logsQuery := &jsonFilterLogsQuery{} if err := json.Unmarshal(input, logsQuery); err != nil { @@ -631,11 +688,11 @@ func (q *FilterLogsQuery) UnmarshalJSON(input []byte) error { } type jsonFilterLogsQuery struct { - Address addressList `json:"address"` - FromBlock *BlockNumber `json:"fromBlock,omitempty"` - ToBlock *BlockNumber `json:"toBlock,omitempty"` - Topics []hashList `json:"topics"` - BlockHash *Hash `json:"blockhash,omitempty"` + Address oneOrList[Address] `json:"address"` + FromBlock *BlockNumber `json:"fromBlock,omitempty"` + ToBlock *BlockNumber `json:"toBlock,omitempty"` + Topics []oneOrList[Hash] `json:"topics"` + BlockHash *Hash `json:"blockhash,omitempty"` } // SyncStatus represents the sync status of a node. diff --git a/types/structs_test.go b/types/structs_test.go index 9a2e343..a5038b6 100644 --- a/types/structs_test.go +++ b/types/structs_test.go @@ -11,11 +11,11 @@ import ( func TestTransactionOnChain_JSON(t *testing.T) { tests := []struct { - tx *TransactionOnChain - json string + tx *TransactionOnChain + wantJSON string }{ { - json: ` + wantJSON: ` { "to": "0x2222222222222222222222222222222222222222", "gas": "0x186a0", @@ -34,18 +34,20 @@ func TestTransactionOnChain_JSON(t *testing.T) { `, tx: &TransactionOnChain{ Transaction: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, Hash: MustHashFromHexPtr("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), @@ -59,13 +61,13 @@ func TestTransactionOnChain_JSON(t *testing.T) { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { tx := &TransactionOnChain{} - err := tx.UnmarshalJSON([]byte(tt.json)) + err := tx.UnmarshalJSON([]byte(tt.wantJSON)) require.NoError(t, err) assert.Equal(t, tt.tx, tx) j, err := tx.MarshalJSON() require.NoError(t, err) - assert.JSONEq(t, tt.json, string(j)) + assert.JSONEq(t, tt.wantJSON, string(j)) }) } } diff --git a/types/tx.go b/types/tx.go index 4056c09..264a0fb 100644 --- a/types/tx.go +++ b/types/tx.go @@ -9,21 +9,40 @@ import ( // TransactionType is the type of transaction. type TransactionType uint8 -// Transaction types. const ( + // LegacyTxType represents the legacy transaction format (Type 0). + // + // This is the original transaction format used before EIP-2718. LegacyTxType TransactionType = iota + + // AccessListTxType represents the access list transaction format (Type 1). + // + // Introduced by EIP-2930, this transaction type includes an optional + // access list that specifies a list of addresses and storage keys the + // transaction plans to access. AccessListTxType + + // DynamicFeeTxType represents the dynamic fee transaction format (Type 2). + // + // Introduced by EIP-1559, this transaction type supports a new fee market + // mechanism with a base fee and a priority fee (tip). DynamicFeeTxType + + // BlobTxType represents the blob transaction format (Type 3). + // + // Introduced by EIP-4844, this transaction type adds support for + // blob-carrying transactions. BlobTxType ) +// Transaction is an interface that represents a generic Ethereum transaction. type Transaction interface { json.Marshaler json.Unmarshaler rlp.Encoder rlp.Decoder - HasTransactionData + TransactionData // Type returns the type of the transaction. Type() TransactionType @@ -33,33 +52,44 @@ type Transaction interface { // create a call. Call() Call - // CalculateHash calculates the hash of the transaction. + // CalculateHash computes and returns the hash of the transaction. CalculateHash() (Hash, error) - // CalculateSigningHash calculates the signing hash of the transaction. + // CalculateSigningHash computes and returns the hash used for signing + // the transaction. CalculateSigningHash() (Hash, error) } -// TransactionDecoder is an interface that is used to decode transactions of -// unknown types. +// TransactionDecoder is an interface for decoding transactions from JSON or +// RLP encoded data. // // Decoder may not set the From field of the transaction. -// To get signer of the transaction, use the Recoverer interface. +// To get signer of the transaction, use txsign.Recover function. type TransactionDecoder interface { - RPCTransactionDecoder + RLPTransactionDecoder JSONTransactionDecoder } -// RPCTransactionDecoder is an interface that is used to decode transactions -// from RLP encoded data. -type RPCTransactionDecoder interface { +// RLPTransactionDecoder is an interface for decoding transactions from +// RLP-encoded data. +type RLPTransactionDecoder interface { // DecodeRLP decodes the RLP encoded transaction data. DecodeRLP(data []byte) (Transaction, error) } -// JSONTransactionDecoder is an interface that is used to decode transactions -// from JSON encoded data. +// JSONTransactionDecoder is an interface for decoding transactions from +// JSON-encoded data. type JSONTransactionDecoder interface { // DecodeJSON decodes the JSON encoded transaction data. DecodeJSON(data []byte) (Transaction, error) } + +type jsonTransaction struct { + ChainID *Number `json:"chainId,omitempty"` + Nonce *Number `json:"nonce,omitempty"` + V *Number `json:"v,omitempty"` + R *Number `json:"r,omitempty"` + S *Number `json:"s,omitempty"` + + jsonCall +} diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index 2e5c08a..4e96ad4 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -3,36 +3,42 @@ package types import ( "encoding/json" "fmt" - "math/big" "github.com/defiweb/go-rlp" "github.com/defiweb/go-eth/crypto" ) +// TransactionAccessList is the access list transaction type (Type 1). +// +// Introduced by EIP-2930, this transaction type includes an optional access +// list that specifies a list of addresses and storage keys the transaction +// plans to access. type TransactionAccessList struct { - EmbedCallData - EmbedTransactionData - EmbedLegacyPriceData - EmbedAccessListData + TransactionFields + CallAccessList } +// NewTransactionAccessList creates a new access list transaction. func NewTransactionAccessList() *TransactionAccessList { return &TransactionAccessList{} } +// Type implements the Transaction interface. func (t *TransactionAccessList) Type() TransactionType { return AccessListTxType } +// Call implements the Transaction interface. func (t *TransactionAccessList) Call() Call { return &CallAccessList{ - EmbedCallData: *t.EmbedCallData.Copy(), - EmbedLegacyPriceData: *t.EmbedLegacyPriceData.Copy(), - EmbedAccessListData: *t.EmbedAccessListData.Copy(), + CallFields: *t.CallFields.Copy(), + LegacyPriceField: *t.LegacyPriceField.Copy(), + AccessListField: *t.AccessListField.Copy(), } } +// CalculateHash implements the Transaction interface. func (t *TransactionAccessList) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { @@ -41,34 +47,35 @@ func (t *TransactionAccessList) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } +// CalculateSigningHash implements the Transaction interface. func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasPrice = &rlp.BigInt{} + gasLimit = rlp.Uint(0) + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasPrice != nil { - gasPrice = t.GasPrice + gasPrice = (*rlp.BigInt)(t.GasPrice) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -77,54 +84,55 @@ func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { accessList = t.AccessList } bin, err := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(gasPrice), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + gasPrice, + gasLimit, + to, + value, + input, &accessList, }.EncodeRLP() if err != nil { return ZeroHash, err } - bin = append([]byte{byte(AccessListTxType)}, bin...) - return Hash(crypto.Keccak256(bin)), nil + return Hash(crypto.Keccak256(append([]byte{byte(AccessListTxType)}, bin...))), nil } +// EncodeRLP implements the rlp.Encoder interface. +// //nolint:funlen func (t TransactionAccessList) EncodeRLP() ([]byte, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasPrice = &rlp.BigInt{} + gasLimit = rlp.Uint(0) + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) - v = big.NewInt(0) - r = big.NewInt(0) - s = big.NewInt(0) + v = &rlp.BigInt{} + r = &rlp.BigInt{} + s = &rlp.BigInt{} ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasPrice != nil { - gasPrice = t.GasPrice + gasPrice = (*rlp.BigInt)(t.GasPrice) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -133,22 +141,22 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { accessList = t.AccessList } if t.Signature != nil { - v = t.Signature.V - r = t.Signature.R - s = t.Signature.S + v = (*rlp.BigInt)(t.Signature.V) + r = (*rlp.BigInt)(t.Signature.R) + s = (*rlp.BigInt)(t.Signature.S) } bin, err := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(gasPrice), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + gasPrice, + gasLimit, + to, + value, + input, &accessList, - (*rlp.BigInt)(v), - (*rlp.BigInt)(r), - (*rlp.BigInt)(s), + v, + r, + s, }.EncodeRLP() if err != nil { return nil, err @@ -156,9 +164,18 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { return append([]byte{byte(AccessListTxType)}, bin...), nil } +// Copy creates a deep copy of the transaction. +func (t *TransactionAccessList) Copy() *TransactionAccessList { + return &TransactionAccessList{ + TransactionFields: *t.TransactionFields.Copy(), + CallAccessList: *t.CallAccessList.Copy(), + } +} + +// DecodeRLP implements the rlp.Decoder interface. +// //nolint:funlen func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { - *t = TransactionAccessList{} if len(data) == 0 { return 0, fmt.Errorf("empty data") } @@ -195,6 +212,7 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { if _, err := rlp.Decode(data, &list); err != nil { return 0, err } + *t = TransactionAccessList{} if chainID.Get() != 0 { t.ChainID = chainID.Ptr() } @@ -230,81 +248,27 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { return len(data), nil } +// MarshalJSON implements the json.Marshaler interface. func (t *TransactionAccessList) MarshalJSON() ([]byte, error) { - transaction := &jsonTransactionAccessList{} - if t.ChainID != nil { - transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) - } - transaction.To = t.To - transaction.From = t.From - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.GasPrice != nil { - transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - transaction.AccessList = t.AccessList - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - return json.Marshal(transaction) + j := &jsonTransaction{} + t.TransactionFields.toJSON(j) + t.CallFields.toJSON(&j.jsonCall) + t.LegacyPriceField.toJSON(&j.jsonCall) + t.AccessListField.toJSON(&j.jsonCall) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionAccessList) UnmarshalJSON(data []byte) error { - transaction := &jsonTransactionAccessList{} - if err := json.Unmarshal(data, transaction); err != nil { + j := &jsonTransaction{} + if err := json.Unmarshal(data, &j); err != nil { return err } - if transaction.ChainID != nil { - chainID := transaction.ChainID.Big().Uint64() - t.ChainID = &chainID - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.GasPrice != nil { - t.GasPrice = transaction.GasPrice.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - t.AccessList = transaction.AccessList - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } + t.TransactionFields.fromJSON(j) + t.CallFields.fromJSON(&j.jsonCall) + t.LegacyPriceField.fromJSON(&j.jsonCall) + t.AccessListField.fromJSON(&j.jsonCall) return nil } -type jsonTransactionAccessList struct { - ChainID *Number `json:"chainId,omitempty"` - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - Input Bytes `json:"input,omitempty"` - Nonce *Number `json:"nonce,omitempty"` - Value *Number `json:"value,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` - V *Number `json:"v,omitempty"` - R *Number `json:"r,omitempty"` - S *Number `json:"s,omitempty"` -} - var _ Transaction = (*TransactionAccessList)(nil) diff --git a/types/tx_accesslist_test.go b/types/tx_accesslist_test.go index 6d7ee31..77d3944 100644 --- a/types/tx_accesslist_test.go +++ b/types/tx_accesslist_test.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "math/big" "testing" @@ -11,124 +10,203 @@ import ( "github.com/defiweb/go-eth/hexutil" ) -func TestTransactionAccessList_RLP(t *testing.T) { +func TestTransactionAccessList_JSON(t *testing.T) { tests := []struct { - tx *TransactionAccessList - want []byte + name string + tx *TransactionAccessList + wantJSON string }{ { - tx: &TransactionAccessList{}, - want: hexutil.MustHexToBytes("01cb80808080808080c0808080"), + name: "all fields nil", + tx: &TransactionAccessList{}, + wantJSON: `{}`, }, { + name: "all fields set", tx: &TransactionAccessList{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallAccessList: CallAccessList{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + }, + wantJSON: `{ + "chainId": "0x1", + "nonce": "0x1", + "gasPrice": "0x3b9aca00", + "gas": "0x186a0", + "to": "0x2222222222222222222222222222222222222222", + "value": "0xde0b6b3a7640000", + "input": "0x01020304", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + "from": "0x1111111111111111111111111111111111111111" + }`, + }, + { + name: "invalid negative nonce", + tx: &TransactionAccessList{ + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(18446744073709551615)), // Max uint64 value to simulate negative when interpreted incorrectly }, }, - want: hexutil.MustHexToBytes("01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + wantJSON: `{ + "nonce": "0xffffffffffffffff" + }`, }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - // Encode: - rlp, err := tt.tx.EncodeRLP() - require.NoError(t1, err) - assert.Equal(t1, tt.want, rlp) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.tx.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) - // Decode: + // Decode from JSON tx := NewTransactionAccessList() - _, err = tx.DecodeRLP(rlp) + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions tx.From = tt.tx.From - require.NoError(t1, err) - equalTX(t1, tx, tt.tx) + tx.ChainID = tt.tx.ChainID + assertEqualTX(t, tx, tt.tx) }) } } -func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { +func TestTransactionAccessList_RLP(t *testing.T) { tests := []struct { - tx *TransactionAccessList - want Hash + name string + tx *TransactionAccessList + wantHex string }{ { - tx: &TransactionAccessList{}, - want: MustHashFromHex("0xc0157440e7609b2ddee74686831421f05b238ed4c981363e64df8eb1c1ea6afc", PadNone), + name: "empty transaction", + tx: &TransactionAccessList{}, + wantHex: "0x01cb80808080808080c0808080", }, { + name: "all fields set", tx: &TransactionAccessList{ - EmbedTransactionData: EmbedTransactionData{ - ChainID: ptr(uint64(1)), - Nonce: ptr(uint64(1)), - }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallAccessList: CallAccessList{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, - want: MustHashFromHex("0x46ba790cdf341de06f08944eecd84721e9ae3c4324098f882597d9817eeba63b", PadNone), + wantHex: "0x01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to RLP + rlpBytes, err := tt.tx.EncodeRLP() + require.NoError(t, err) + assert.Equal(t, tt.wantHex, hexutil.BytesToHex(rlpBytes)) + + // Decode from RLP + tx := NewTransactionAccessList() + _, err = tx.DecodeRLP(rlpBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions + tx.From = tt.tx.From + assertEqualTX(t, tx, tt.tx) + }) + } +} + +func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { + tests := []struct { + name string + tx *TransactionAccessList + wantHex string + }{ + { + name: "empty transaction", + tx: &TransactionAccessList{}, + wantHex: "0xc0157440e7609b2ddee74686831421f05b238ed4c981363e64df8eb1c1ea6afc", }, { + name: "all fields set", tx: &TransactionAccessList{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: AccessList{ - AccessTuple{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }, + CallAccessList: CallAccessList{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), }, }, }, - want: MustHashFromHex("0x71cba0039a020b7a524d7746b79bf6d1f8a521eb1a76715d00116ef1c0f56107", PadNone), + wantHex: "0x46ba790cdf341de06f08944eecd84721e9ae3c4324098f882597d9817eeba63b", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { sh, err := tt.tx.CalculateSigningHash() - require.NoError(t1, err) - require.Equal(t1, tt.want, sh) + require.NoError(t, err) + assert.Equal(t, tt.wantHex, sh.String()) }) } } diff --git a/types/tx_blob.go b/types/tx_blob.go index d93f68a..8659702 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -3,7 +3,6 @@ package types import ( "encoding/json" "fmt" - "math/big" "github.com/defiweb/go-rlp" @@ -11,31 +10,31 @@ import ( "github.com/defiweb/go-eth/crypto/kzg4844" ) +// TransactionBlob is the blob transaction type (Type 3). +// +// Introduced by EIP-4844, this transaction type adds support for blob-carrying +// transactions. type TransactionBlob struct { - EmbedCallData - EmbedTransactionData - EmbedAccessListData - EmbedDynamicFeeData - EmbedBlobData + TransactionFields + CallBlob } +// NewTransactionBlob creates a new blob transaction. func NewTransactionBlob() *TransactionBlob { return &TransactionBlob{} } +// Type implements the Transaction interface. func (t *TransactionBlob) Type() TransactionType { return BlobTxType } +// Call implements the Transaction interface. func (t *TransactionBlob) Call() Call { - return &CallBlob{ - EmbedCallData: *t.EmbedCallData.Copy(), - EmbedAccessListData: *t.EmbedAccessListData.Copy(), - EmbedDynamicFeeData: *t.EmbedDynamicFeeData.Copy(), - EmbedBlobData: *t.EmbedBlobData.Copy(), - } + return t.CallBlob.Copy() } +// CalculateHash implements the Transaction interface. func (t *TransactionBlob) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { @@ -44,40 +43,41 @@ func (t *TransactionBlob) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } +// CalculateSigningHash implements the Transaction interface. func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasLimit = rlp.Uint(0) + maxPriorityFeePerGas = &rlp.BigInt{} + maxFeePerGas = &rlp.BigInt{} + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) - maxFeePerBlobGas = big.NewInt(0) - blobHashes = (hashList)(nil) + maxFeePerBlobGas = &rlp.BigInt{} + blobHashes = (rlp.TypedList[Hash])(nil) ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas + maxPriorityFeePerGas = (*rlp.BigInt)(t.MaxPriorityFeePerGas) } if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas + maxFeePerGas = (*rlp.BigInt)(t.MaxFeePerGas) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -86,79 +86,84 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { accessList = t.AccessList } if t.MaxFeePerBlobGas != nil { - maxFeePerBlobGas = t.MaxFeePerBlobGas + maxFeePerBlobGas = (*rlp.BigInt)(t.MaxFeePerBlobGas) } if len(t.Blobs) > 0 { - blobHashes = make(hashList, len(t.Blobs)) - for i, blob := range t.Blobs { - if blob.Hash.IsZero() && blob.Sidecar != nil { - blobHashes[i] = blob.Sidecar.ComputeHash() - continue - } - blobHashes[i] = blob.Hash + blobHashes = make(rlp.TypedList[Hash], len(t.Blobs)) + for i, _ := range t.Blobs { + blobHashes[i] = &t.Blobs[i].Hash } } bin, err := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(maxPriorityFeePerGas), - (*rlp.BigInt)(maxFeePerGas), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, &accessList, - (*rlp.BigInt)(maxFeePerBlobGas), + maxFeePerBlobGas, &blobHashes, }.EncodeRLP() if err != nil { return ZeroHash, err } - bin = append([]byte{byte(BlobTxType)}, bin...) - return Hash(crypto.Keccak256(bin)), nil + return Hash(crypto.Keccak256(append([]byte{byte(BlobTxType)}, bin...))), nil +} + +// Copy creates a deep copy of the transaction. +func (t *TransactionBlob) Copy() *TransactionBlob { + return &TransactionBlob{ + TransactionFields: *t.TransactionFields.Copy(), + CallBlob: *t.CallBlob.Copy(), + } } +// EncodeRLP implements the rlp.Encoder interface. +// //nolint:funlen func (t TransactionBlob) EncodeRLP() ([]byte, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasLimit = rlp.Uint(0) + maxPriorityFeePerGas = &rlp.BigInt{} + maxFeePerGas = &rlp.BigInt{} + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) - maxFeePerBlobGas = big.NewInt(0) - blobHashes = (hashList)(nil) - blobs = rlp.TypedList[kzgBlob]{} - commitments = rlp.TypedList[kzgCommitment]{} - proofs = rlp.TypedList[kzgProof]{} - v = big.NewInt(0) - r = big.NewInt(0) - s = big.NewInt(0) + maxFeePerBlobGas = &rlp.BigInt{} + blobHashes = (rlp.TypedList[Hash])(nil) + blobs = (rlp.TypedList[kzgBlob])(nil) + commitments = (rlp.TypedList[kzgCommitment])(nil) + proofs = (rlp.TypedList[kzgProof])(nil) + v = &rlp.BigInt{} + r = &rlp.BigInt{} + s = &rlp.BigInt{} ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas + maxPriorityFeePerGas = (*rlp.BigInt)(t.MaxPriorityFeePerGas) } if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas + maxFeePerGas = (*rlp.BigInt)(t.MaxFeePerGas) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -167,16 +172,14 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { accessList = t.AccessList } if t.MaxFeePerBlobGas != nil { - maxFeePerBlobGas = t.MaxFeePerBlobGas + maxFeePerBlobGas = (*rlp.BigInt)(t.MaxFeePerBlobGas) } if len(t.Blobs) > 0 { - blobHashes = make(hashList, 0, len(t.Blobs)) - for _, blob := range t.Blobs { - hash := blob.Hash - if hash.IsZero() && blob.Sidecar != nil { - hash = blob.Sidecar.ComputeHash() - } - blobHashes = append(blobHashes, hash) + blobHashes = make(rlp.TypedList[Hash], 0, len(t.Blobs)) + for i, _ := range t.Blobs { + blob := t.Blobs[i] + + blobHashes = append(blobHashes, &blob.Hash) if blob.Sidecar != nil { blobs.Add((*kzgBlob)(&blob.Sidecar.Blob)) commitments.Add((*kzgCommitment)(&blob.Sidecar.Commitment)) @@ -185,25 +188,25 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { } } if t.Signature != nil { - v = t.Signature.V - r = t.Signature.R - s = t.Signature.S + v = (*rlp.BigInt)(t.Signature.V) + r = (*rlp.BigInt)(t.Signature.R) + s = (*rlp.BigInt)(t.Signature.S) } tx := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(maxPriorityFeePerGas), - (*rlp.BigInt)(maxFeePerGas), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, &accessList, - (*rlp.BigInt)(maxFeePerBlobGas), + maxFeePerBlobGas, &blobHashes, - (*rlp.BigInt)(v), - (*rlp.BigInt)(r), - (*rlp.BigInt)(s), + v, + r, + s, } if len(blobHashes) > 0 && len(blobHashes) == len(blobs) { tx = rlp.List{ @@ -220,9 +223,10 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { return append([]byte{byte(BlobTxType)}, bin...), nil } +// DecodeRLP implements the rlp.Decoder interface. +// //nolint:funlen func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { - *t = TransactionBlob{} if len(data) == 0 { return 0, fmt.Errorf("empty data") } @@ -241,7 +245,7 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { input = new(rlp.Bytes) accessList = new(AccessList) maxFeePerBlobGas = new(rlp.BigInt) - blobHashes = &hashList{} + blobHashes = new(rlp.TypedList[Hash]) blobs = new(rlp.TypedList[kzgBlob]) commitments = new(rlp.TypedList[kzgCommitment]) proofs = new(rlp.TypedList[kzgProof]) @@ -301,6 +305,7 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { if err := dec.Decode(&list); err != nil { return 0, err } + *t = TransactionBlob{} if chainID.Get() != 0 { t.ChainID = chainID.Ptr() } @@ -332,9 +337,9 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { t.MaxFeePerBlobGas = maxFeePerBlobGas.Ptr() } if len(*blobHashes) > 0 { - t.Blobs = make([]Blob, len(*blobHashes)) + t.Blobs = make([]BlobInfo, len(*blobHashes)) for i, hash := range *blobHashes { - blob := Blob{Hash: hash} + blob := BlobInfo{Hash: *hash} if i < len(*blobs) && i < len(*commitments) && i < len(*proofs) { blob.Sidecar = &BlobSidecar{ Blob: kzg4844.Blob(*(*blobs)[i]), @@ -355,125 +360,29 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { return len(data), nil } +// MarshalJSON implements the json.Marshaler interface. func (t *TransactionBlob) MarshalJSON() ([]byte, error) { - transaction := &jsonTransactionBlob{} - if t.ChainID != nil { - transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) - } - transaction.To = t.To - transaction.From = t.From - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.MaxFeePerGas != nil { - transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) - } - if t.MaxFeePerBlobGas != nil { - transaction.MaxFeePerBlobGas = NumberFromBigIntPtr(t.MaxFeePerBlobGas) - } - if t.MaxPriorityFeePerGas != nil { - transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - transaction.AccessList = t.AccessList - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - for _, blob := range t.Blobs { - hash := blob.Hash - if hash.IsZero() && blob.Sidecar != nil { - hash = blob.Sidecar.ComputeHash() - } - transaction.BlobHashes = append(transaction.BlobHashes, hash) - if blob.Sidecar != nil { - transaction.Blobs = append(transaction.Blobs, kzgBlob(blob.Sidecar.Blob)) - transaction.Commitments = append(transaction.Commitments, kzgCommitment(blob.Sidecar.Commitment)) - transaction.Proofs = append(transaction.Proofs, kzgProof(blob.Sidecar.Proof)) - } - } - return json.Marshal(transaction) + j := &jsonTransaction{} + t.TransactionFields.toJSON(j) + t.CallFields.toJSON(&j.jsonCall) + t.AccessListField.toJSON(&j.jsonCall) + t.DynamicFeeFields.toJSON(&j.jsonCall) + t.BlobFields.toJSON(&j.jsonCall) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionBlob) UnmarshalJSON(data []byte) error { - transaction := &jsonTransactionBlob{} - if err := json.Unmarshal(data, transaction); err != nil { + j := &jsonTransaction{} + if err := json.Unmarshal(data, &j); err != nil { return err } - if transaction.ChainID != nil { - chainID := transaction.ChainID.Big().Uint64() - t.ChainID = &chainID - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.MaxFeePerGas != nil { - t.MaxFeePerGas = transaction.MaxFeePerGas.Big() - } - if transaction.MaxFeePerBlobGas != nil { - t.MaxFeePerBlobGas = transaction.MaxFeePerBlobGas.Big() - } - if transaction.MaxPriorityFeePerGas != nil { - t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - Nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &Nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - t.AccessList = transaction.AccessList - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } - if len(transaction.BlobHashes) > 0 { - t.Blobs = make([]Blob, len(transaction.BlobHashes)) - for i, hash := range transaction.BlobHashes { - blob := Blob{Hash: hash} - if i < len(transaction.Blobs) && i < len(transaction.Commitments) && i < len(transaction.Proofs) { - blob.Sidecar = &BlobSidecar{ - Blob: kzg4844.Blob(transaction.Blobs[i]), - Commitment: kzg4844.Commitment(transaction.Commitments[i]), - Proof: kzg4844.Proof(transaction.Proofs[i]), - } - } - t.Blobs[i] = blob - } - } + t.TransactionFields.fromJSON(j) + t.CallFields.fromJSON(&j.jsonCall) + t.AccessListField.fromJSON(&j.jsonCall) + t.DynamicFeeFields.fromJSON(&j.jsonCall) + t.BlobFields.fromJSON(&j.jsonCall) return nil } -type jsonTransactionBlob struct { - ChainID *Number `json:"chainId,omitempty"` - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxFeePerBlobGas *Number `json:"maxFeePerBlobGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Input Bytes `json:"input,omitempty"` - Nonce *Number `json:"nonce,omitempty"` - Value *Number `json:"value,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` - BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` - Blobs []kzgBlob `json:"blobs,omitempty"` - Commitments []kzgCommitment `json:"commitments,omitempty"` - Proofs []kzgProof `json:"proofs,omitempty"` - V *Number `json:"v,omitempty"` - R *Number `json:"r,omitempty"` - S *Number `json:"s,omitempty"` -} - var _ Transaction = (*TransactionBlob)(nil) diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index 255b9f1..10ae161 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -1,242 +1,444 @@ package types import ( - "fmt" "math/big" + "regexp" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/kzg4844" "github.com/defiweb/go-eth/hexutil" ) -func TestTransactionBlob_RLP(t *testing.T) { +func TestTransactionBlob_JSON(t *testing.T) { + remZerosRx := regexp.MustCompile(`0{128,}`) tests := []struct { + name string tx *TransactionBlob - want []byte - wantHash bool + wantJSON string }{ { - tx: &TransactionBlob{}, - want: hexutil.MustHexToBytes("03ce8080808080808080c080c0808080"), + name: "empty transaction", + tx: &TransactionBlob{}, + wantJSON: `{}`, }, { + name: "all fields set", tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, + {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, }, - }}, + }, + }, + }, + wantJSON: `{ + "chainId": "0x1", + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxFeePerBlobGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "blobVersionedHashes": [ + "0x6666666666666666666666666666666666666666666666666666666666666666", + "0x7777777777777777777777777777777777777777777777777777777777777777" + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + }`, + }, + { + name: "blobs with shortened zero fields", + tx: &TransactionBlob{ + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + newBlob("blob1"), + newBlob("blob2"), }, }, }, }, - want: hexutil.MustHexToBytes("03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + wantJSON: `{ + "chainId": "0x1", + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxFeePerBlobGas": "0xb2d05e00", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "blobVersionedHashes": [ + "0x01e951827dab35ecb4ce6e29ca6779ad0ac958f06ac1d54eb6e7523f3e3febeb", + "0x01c6f423eec4f5e9ebd79e6fb5eb9bce57dd102f2f0a6fdee0bf58c4e109e27a" + ], + "blobs": [ + "0x626c6f6231", + "0x626c6f6232" + ], + "commitments": [ + "0x832726ece34fb93100194291b75b7f5fa920d5b896e5edafeed46f3636fadc485f493490bd596c76171516024bcf7a00", + "0x896a515deb6c1ac23436f5de75186316b53851be3cb4225437e58c34e376bbd6dea13d7a39b8d5dd9f6cba1c052ab0cb" + ], + "proofs": [ + "0xacbe7bde870d1e7c239063368dbf62ce3bfaef1c08006e8e724da2837294e19d991ba5677a628e64b6c6906ff1786b3c", + "0x8fd7fb4172048b9d8deccb939eeb787c45d0bb00d5f238e13084bd3fbe8050215ce488999f86fccddc36d1a257a19513" + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.tx.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(remZerosRx.ReplaceAll(jsonBytes, []byte("")))) + + // Decode from JSON + tx := NewTransactionBlob() + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions + tx.From = tt.tx.From + tx.ChainID = tt.tx.ChainID + assertEqualTX(t, tx, tt.tx) + }) + } +} + +func TestTransactionBlob_RLP(t *testing.T) { + tests := []struct { + name string + tx *TransactionBlob + wantHex string + wantHash bool + }{ + { + name: "empty transaction", + tx: &TransactionBlob{}, + wantHex: "0x03ce8080808080808080c080c0808080", }, { + name: "all fields set", tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, + CallBlob: CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, + {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, + }, + }, }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), + }, + wantHex: "0x03f9011c0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00f842a06666666666666666666666666666666666666666666666666666666666666666a077777777777777777777777777777777777777777777777777777777777777776fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + }, + { + name: "hash output", + tx: &TransactionBlob{ + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + newBlob("blob1"), + newBlob("blob2"), }, - }}, - }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - newBlob("blob1"), - newBlob("blob2"), }, }, }, - want: hexutil.MustHexToBytes("0x848eb4e644a60e42df3b639eb40c0f3763d13ebc2a33aa06e9b2acc22c51f59e"), + wantHex: "0x848eb4e644a60e42df3b639eb40c0f3763d13ebc2a33aa06e9b2acc22c51f59e", wantHash: true, }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - // Encode: - rlp, err := tt.tx.EncodeRLP() - require.NoError(t1, err) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to RLP + rlpBytes, err := tt.tx.EncodeRLP() + require.NoError(t, err) if tt.wantHash { - hash := crypto.Keccak256(rlp) - assert.Equal(t1, tt.want, hash[:]) + hash := crypto.Keccak256(rlpBytes) + assert.Equal(t, tt.wantHex, hexutil.BytesToHex(hash[:])) } else { - assert.Equal(t1, tt.want, rlp) + assert.Equal(t, tt.wantHex, hexutil.BytesToHex(rlpBytes)) } - // Decode: + // Decode from RLP tx := NewTransactionBlob() - _, err = tx.DecodeRLP(rlp) + _, err = tx.DecodeRLP(rlpBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions tx.From = tt.tx.From - require.NoError(t1, err) - equalTX(t1, tx, tt.tx) + assertEqualTX(t, tx, tt.tx) }) } } func TestTransactionBlob_CalculateSigningHash(t *testing.T) { tests := []struct { - tx *TransactionBlob - want Hash + name string + tx *TransactionBlob + wantHex string }{ { - tx: &TransactionBlob{}, - want: MustHashFromHex("0x846c9b47f161837f5068b0ffb0c1a98785302f89d613338ccfa9a1c72c9f951d", PadNone), + name: "empty transaction", + tx: &TransactionBlob{}, + wantHex: "0x846c9b47f161837f5068b0ffb0c1a98785302f89d613338ccfa9a1c72c9f951d", }, { + name: "all fields set", tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), + CallBlob: CallBlob{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, }, }, - want: MustHashFromHex("0x0604b49731147cf745c666f1a67bf1b5e9fbee127085b3d4c4958191590e8bce", PadNone), + wantHex: "0x0604b49731147cf745c666f1a67bf1b5e9fbee127085b3d4c4958191590e8bce", }, { + name: "all fields set with access list", tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: AccessList{ - AccessTuple{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + AccessListField: AccessListField{ + AccessList: AccessList{ + AccessTuple{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, }, }, }, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, }, }, }, }, - want: MustHashFromHex("0x3faa63efab3e460606c31cd9a2e8791d87e91954137571eddb3b4b0abc69e2cd", PadNone), + wantHex: "0x3faa63efab3e460606c31cd9a2e8791d87e91954137571eddb3b4b0abc69e2cd", }, { + name: "with blobs and access list", tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + newBlob("blob1"), + newBlob("blob2"), }, - }}, - }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - newBlob("blob1"), - newBlob("blob2"), }, }, }, - want: MustHashFromHex("0x09f9204d83af238e1c0044bf22b4dd52ea5c25390b27bdbd38024212e238934d", PadNone), + wantHex: "0x09f9204d83af238e1c0044bf22b4dd52ea5c25390b27bdbd38024212e238934d", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { sh, err := tt.tx.CalculateSigningHash() - require.NoError(t1, err) - assert.Equal(t1, tt.want, sh) + require.NoError(t, err) + assert.Equal(t, tt.wantHex, sh.String()) }) } } -func newBlob(data string) Blob { - b, err := NewBlob([]byte(data)) +func newBlob(data string) BlobInfo { + d := new(kzg4844.Blob) + copy(d[:], data) + b, err := NewBlobInfo(d) if err != nil { panic(err) } diff --git a/types/tx_decoder.go b/types/tx_decoder.go index b9b9b63..6705431 100644 --- a/types/tx_decoder.go +++ b/types/tx_decoder.go @@ -29,6 +29,7 @@ type TypedTransactionDecoder struct { IgnoreUnknownTypes bool } +// DecodeRLP implements the RLPTransactionDecoder interface. func (e *TypedTransactionDecoder) DecodeRLP(data []byte) (Transaction, error) { if len(data) == 0 { return nil, fmt.Errorf("empty transaction data") @@ -51,6 +52,7 @@ func (e *TypedTransactionDecoder) DecodeRLP(data []byte) (Transaction, error) { return tx, nil } +// DecodeJSON implements the JSONTransactionDecoder interface. func (e *TypedTransactionDecoder) DecodeJSON(data []byte) (Transaction, error) { typ, err := jsonTXType(data) if err != nil { @@ -84,6 +86,22 @@ type TransactionUnknown struct { UnknownType TransactionType } +func (t *TransactionUnknown) TransactionData() *TransactionFields { return nil } + +func (t *TransactionUnknown) SetTransactionData(_ TransactionFields) {} + +func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } + +func (t *TransactionUnknown) Call() Call { return nil } + +func (t *TransactionUnknown) CalculateHash() (Hash, error) { + return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) +} + +func (t *TransactionUnknown) CalculateSigningHash() (Hash, error) { + return ZeroHash, fmt.Errorf("unable to calculate signing hash of unknown transaction type: %d", t.UnknownType) +} + func (t *TransactionUnknown) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unable to marshal unknown transaction type: %d", t.UnknownType) } @@ -100,22 +118,6 @@ func (t *TransactionUnknown) DecodeRLP(_ []byte) (int, error) { return 0, fmt.Errorf("unable to decode unknown transaction type: %d", t.UnknownType) } -func (t *TransactionUnknown) TransactionData() *EmbedTransactionData { return nil } - -func (t *TransactionUnknown) SetTransactionData(_ *EmbedTransactionData) {} - -func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } - -func (t *TransactionUnknown) Call() Call { return nil } - -func (t *TransactionUnknown) CalculateHash() (Hash, error) { - return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) -} - -func (t *TransactionUnknown) CalculateSigningHash() (Hash, error) { - return ZeroHash, fmt.Errorf("unable to calculate signing hash of unknown transaction type: %d", t.UnknownType) -} - // jsonTXType returns the type of the transaction encoded in JSON. // // If type is not specified, it tries to guess the type using the same rules as diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go index c6e3056..012c370 100644 --- a/types/tx_decoder_test.go +++ b/types/tx_decoder_test.go @@ -5,43 +5,44 @@ import ( "math/big" "testing" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/hexutil" ) -func TestTransaction_RLP(t *testing.T) { +func TestTransactionDecoder_DecodeRLP(t *testing.T) { tests := []struct { tx Transaction - rlp []byte + rlp string }{ { tx: &TransactionLegacy{}, - rlp: hexutil.MustHexToBytes("c9808080808080808080"), + rlp: "0xc9808080808080808080", }, { tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(38)), Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, - rlp: hexutil.MustHexToBytes("f87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + rlp: "0xf87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", }, { tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -59,134 +60,142 @@ func TestTransaction_RLP(t *testing.T) { }(), ), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(21000)), - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(20000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(20000000000), + }, }, }, - rlp: hexutil.MustHexToBytes("f86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"), + rlp: "0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83", }, { tx: &TransactionAccessList{}, - rlp: hexutil.MustHexToBytes("01cb80808080808080c0808080"), + rlp: "0x01cb80808080808080c0808080", }, { tx: &TransactionAccessList{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + CallAccessList: CallAccessList{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, - rlp: hexutil.MustHexToBytes("01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + rlp: "0x01f8ce0101843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", }, { tx: &TransactionDynamicFee{}, - rlp: hexutil.MustHexToBytes("02cc8080808080808080c0808080"), + rlp: "0x02cc8080808080808080c0808080", }, { tx: &TransactionDynamicFee{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, - rlp: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + rlp: "0x02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", }, { tx: &TransactionBlob{}, - rlp: hexutil.MustHexToBytes("03ce8080808080808080c080c0808080"), + rlp: "0x03ce8080808080808080c080c0808080", }, { tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, - }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, }, }, }, }, - rlp: hexutil.MustHexToBytes("03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + rlp: "0x03f8fa0101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a0555555555555555555555555555555555555555555555555555555555555555584b2d05e00e1a066666666666666666666666666666666666666666666666666666666666666666fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - tx, err := DefaultTransactionDecoder.DecodeRLP(tt.rlp) + tx, err := DefaultTransactionDecoder.DecodeRLP(hexutil.MustHexToBytes(tt.rlp)) require.NoError(t, err) - assert.Equal(t, tt.tx, tx) + assertEqualTX(t, tt.tx, tx) }) } } -func TestTransaction_JSON(t *testing.T) { +func TestTransactionDeocder_DecodeJSON(t *testing.T) { tests := []struct { tx Transaction json string @@ -197,18 +206,20 @@ func TestTransaction_JSON(t *testing.T) { }, { tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, json: ` @@ -227,7 +238,7 @@ func TestTransaction_JSON(t *testing.T) { }, { tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( func() *big.Int { @@ -244,13 +255,15 @@ func TestTransaction_JSON(t *testing.T) { }(), ), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(21000)), - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(20000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(20000000000), + }, }, }, json: ` @@ -276,28 +289,30 @@ func TestTransaction_JSON(t *testing.T) { }, { tx: &TransactionAccessList{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + CallAccessList: CallAccessList{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, json: ` @@ -334,29 +349,31 @@ func TestTransaction_JSON(t *testing.T) { }, { tx: &TransactionDynamicFee{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, json: ` @@ -394,35 +411,37 @@ func TestTransaction_JSON(t *testing.T) { }, { tx: &TransactionBlob{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, - }, - EmbedBlobData: EmbedBlobData{ - MaxFeePerBlobGas: big.NewInt(3000000000), - Blobs: []Blob{ - { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + CallBlob: CallBlob{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, + BlobFields: BlobFields{ + MaxFeePerBlobGas: big.NewInt(3000000000), + Blobs: []BlobInfo{ + { + Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, }, }, }, @@ -462,6 +481,9 @@ func TestTransaction_JSON(t *testing.T) { { "accessList": [], "maxFeePerGas": "0x0", + "blobVersionedHashes": [ + "0x6666666666666666666666666666666666666666666666666666666666666666" + ], "type": "0x0" } `, @@ -471,7 +493,7 @@ func TestTransaction_JSON(t *testing.T) { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { tx, err := DefaultTransactionDecoder.DecodeJSON([]byte(tt.json)) require.NoError(t, err) - assert.Equal(t, tt.tx, tx) + assertEqualTX(t, tt.tx, tx) }) } } diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index aed882f..489a664 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -3,36 +3,37 @@ package types import ( "encoding/json" "fmt" - "math/big" "github.com/defiweb/go-rlp" "github.com/defiweb/go-eth/crypto" ) +// TransactionDynamicFee is the dynamic fee transaction type (Type 2). +// +// Introduced by EIP-1559, this transaction type supports a new fee market +// mechanism with a base fee and a priority fee (tip). type TransactionDynamicFee struct { - EmbedCallData - EmbedTransactionData - EmbedAccessListData - EmbedDynamicFeeData + TransactionFields + CallDynamicFee } +// NewTransactionDynamicFee creates a new dynamic fee transaction. func NewTransactionDynamicFee() *TransactionDynamicFee { return &TransactionDynamicFee{} } +// Type implements the Transaction interface. func (t *TransactionDynamicFee) Type() TransactionType { return DynamicFeeTxType } +// Call implements the Transaction interface. func (t *TransactionDynamicFee) Call() Call { - return &CallDynamicFee{ - EmbedCallData: *t.EmbedCallData.Copy(), - EmbedAccessListData: *t.EmbedAccessListData.Copy(), - EmbedDynamicFeeData: *t.EmbedDynamicFeeData.Copy(), - } + return t.CallDynamicFee.Copy() } +// CalculateHash implements the Transaction interface. func (t *TransactionDynamicFee) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { @@ -41,38 +42,39 @@ func (t *TransactionDynamicFee) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } +// CalculateSigningHash implements the Transaction interface. func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasLimit = rlp.Uint(0) + maxPriorityFeePerGas = &rlp.BigInt{} + maxFeePerGas = &rlp.BigInt{} + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas + maxPriorityFeePerGas = (*rlp.BigInt)(t.MaxPriorityFeePerGas) } if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas + maxFeePerGas = (*rlp.BigInt)(t.MaxFeePerGas) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -81,59 +83,68 @@ func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { accessList = t.AccessList } bin, err := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(maxPriorityFeePerGas), - (*rlp.BigInt)(maxFeePerGas), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, &accessList, }.EncodeRLP() if err != nil { return ZeroHash, err } - bin = append([]byte{byte(DynamicFeeTxType)}, bin...) - return Hash(crypto.Keccak256(bin)), nil + return Hash(crypto.Keccak256(append([]byte{byte(DynamicFeeTxType)}, bin...))), nil +} + +// Copy creates a deep copy of the transaction. +func (t *TransactionDynamicFee) Copy() *TransactionDynamicFee { + return &TransactionDynamicFee{ + TransactionFields: *t.TransactionFields.Copy(), + CallDynamicFee: *t.CallDynamicFee.Copy(), + } } +// EncodeRLP implements the rlp.Encoder interface. +// //nolint:funlen func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasLimit = uint64(0) - maxPriorityFeePerGas = big.NewInt(0) - maxFeePerGas = big.NewInt(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasLimit = rlp.Uint(0) + maxPriorityFeePerGas = &rlp.BigInt{} + maxFeePerGas = &rlp.BigInt{} + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) - v = big.NewInt(0) - r = big.NewInt(0) - s = big.NewInt(0) + v = &rlp.BigInt{} + r = &rlp.BigInt{} + s = &rlp.BigInt{} ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.MaxPriorityFeePerGas != nil { - maxPriorityFeePerGas = t.MaxPriorityFeePerGas + maxPriorityFeePerGas = (*rlp.BigInt)(t.MaxPriorityFeePerGas) } if t.MaxFeePerGas != nil { - maxFeePerGas = t.MaxFeePerGas + maxFeePerGas = (*rlp.BigInt)(t.MaxFeePerGas) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input @@ -142,23 +153,23 @@ func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { accessList = t.AccessList } if t.Signature != nil { - v = t.Signature.V - r = t.Signature.R - s = t.Signature.S + v = (*rlp.BigInt)(t.Signature.V) + r = (*rlp.BigInt)(t.Signature.R) + s = (*rlp.BigInt)(t.Signature.S) } bin, err := rlp.List{ - rlp.Uint(chainID), - rlp.Uint(nonce), - (*rlp.BigInt)(maxPriorityFeePerGas), - (*rlp.BigInt)(maxFeePerGas), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + chainID, + nonce, + maxPriorityFeePerGas, + maxFeePerGas, + gasLimit, + to, + value, + input, &accessList, - (*rlp.BigInt)(v), - (*rlp.BigInt)(r), - (*rlp.BigInt)(s), + v, + r, + s, }.EncodeRLP() if err != nil { return nil, err @@ -166,9 +177,10 @@ func (t TransactionDynamicFee) EncodeRLP() ([]byte, error) { return append([]byte{byte(DynamicFeeTxType)}, bin...), nil } +// DecodeRLP implements the rlp.Decoder interface. +// //nolint:funlen func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { - *t = TransactionDynamicFee{} if len(data) == 0 { return 0, fmt.Errorf("empty data") } @@ -207,6 +219,7 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { if _, err := rlp.Decode(data, &list); err != nil { return 0, err } + *t = TransactionDynamicFee{} if chainID.Get() != 0 { t.ChainID = chainID.Ptr() } @@ -244,88 +257,27 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { return len(data), nil } +// MarshalJSON implements the json.Marshaler interface. func (t *TransactionDynamicFee) MarshalJSON() ([]byte, error) { - transaction := &jsonTransactionDynamicFee{} - if t.ChainID != nil { - transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) - } - transaction.To = t.To - transaction.From = t.From - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.MaxFeePerGas != nil { - transaction.MaxFeePerGas = NumberFromBigIntPtr(t.MaxFeePerGas) - } - if t.MaxPriorityFeePerGas != nil { - transaction.MaxPriorityFeePerGas = NumberFromBigIntPtr(t.MaxPriorityFeePerGas) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - transaction.AccessList = t.AccessList - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - return json.Marshal(transaction) + j := &jsonTransaction{} + t.TransactionFields.toJSON(j) + t.CallFields.toJSON(&j.jsonCall) + t.AccessListField.toJSON(&j.jsonCall) + t.DynamicFeeFields.toJSON(&j.jsonCall) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionDynamicFee) UnmarshalJSON(data []byte) error { - transaction := &jsonTransactionDynamicFee{} - if err := json.Unmarshal(data, transaction); err != nil { + j := &jsonTransaction{} + if err := json.Unmarshal(data, j); err != nil { return err } - if transaction.ChainID != nil { - chainID := transaction.ChainID.Big().Uint64() - t.ChainID = &chainID - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.MaxFeePerGas != nil { - t.MaxFeePerGas = transaction.MaxFeePerGas.Big() - } - if transaction.MaxPriorityFeePerGas != nil { - t.MaxPriorityFeePerGas = transaction.MaxPriorityFeePerGas.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - Nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &Nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - t.AccessList = transaction.AccessList - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } + t.TransactionFields.fromJSON(j) + t.CallFields.fromJSON(&j.jsonCall) + t.AccessListField.fromJSON(&j.jsonCall) + t.DynamicFeeFields.fromJSON(&j.jsonCall) return nil } -type jsonTransactionDynamicFee struct { - ChainID *Number `json:"chainId,omitempty"` - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - MaxFeePerGas *Number `json:"maxFeePerGas,omitempty"` - MaxPriorityFeePerGas *Number `json:"maxPriorityFeePerGas,omitempty"` - Input Bytes `json:"input,omitempty"` - Nonce *Number `json:"nonce,omitempty"` - Value *Number `json:"value,omitempty"` - AccessList AccessList `json:"accessList,omitempty"` - V *Number `json:"v,omitempty"` - R *Number `json:"r,omitempty"` - S *Number `json:"s,omitempty"` -} - var _ Transaction = (*TransactionDynamicFee)(nil) diff --git a/types/tx_dynamicfee_test.go b/types/tx_dynamicfee_test.go index 381428c..78b1f93 100644 --- a/types/tx_dynamicfee_test.go +++ b/types/tx_dynamicfee_test.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "math/big" "testing" @@ -11,127 +10,230 @@ import ( "github.com/defiweb/go-eth/hexutil" ) -func TestTransactionDynamicFee_RLP(t *testing.T) { +func TestTransactionDynamicFee_JSON(t *testing.T) { tests := []struct { - tx *TransactionDynamicFee - want []byte + name string + tx *TransactionDynamicFee + wantJSON string }{ { - tx: &TransactionDynamicFee{}, - want: hexutil.MustHexToBytes("02cc8080808080808080c0808080"), + name: "empty transaction", + tx: &TransactionDynamicFee{}, + wantJSON: `{}`, }, { + name: "all fields set", tx: &TransactionDynamicFee{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), + }, + wantJSON: `{ + "chainId": "0x1", + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "maxFeePerGas": "0x77359400", + "maxPriorityFeePerGas": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "accessList": [ + { + "address": "0x3333333333333333333333333333333333333333", + "storageKeys": [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + } + ], + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.tx.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Decode from JSON + tx := NewTransactionDynamicFee() + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions + tx.From = tt.tx.From + tx.ChainID = tt.tx.ChainID + assertEqualTX(t, tx, tt.tx) + }) + } +} + +func TestTransactionDynamicFee_RLP(t *testing.T) { + tests := []struct { + name string + tx *TransactionDynamicFee + wantHex string + }{ + { + name: "empty transaction", + tx: &TransactionDynamicFee{}, + wantHex: "0x02cc8080808080808080c0808080", + }, + { + name: "all fields set", + tx: &TransactionDynamicFee{ + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(1)), + ChainID: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: []AccessTuple{{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), - }, - }}, + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, + AccessListField: AccessListField{ + AccessList: []AccessTuple{{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }}, + }, }, }, - want: hexutil.MustHexToBytes("02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + wantHex: "0x02f8d30101843b9aca008477359400830186a0942222222222222222222222222222222222222222880de0b6b3a76400008401020304f85bf859943333333333333333333333333333333333333333f842a04444444444444444444444444444444444444444444444444444444444444444a055555555555555555555555555555555555555555555555555555555555555556fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - // Encode: - rlp, err := tt.tx.EncodeRLP() - require.NoError(t1, err) - assert.Equal(t1, tt.want, rlp) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to RLP + rlpBytes, err := tt.tx.EncodeRLP() + require.NoError(t, err) + assert.Equal(t, tt.wantHex, hexutil.BytesToHex(rlpBytes)) - // Decode: + // Decode from RLP tx := NewTransactionDynamicFee() - _, err = tx.DecodeRLP(rlp) + _, err = tx.DecodeRLP(rlpBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions tx.From = tt.tx.From - require.NoError(t1, err) - equalTX(t1, tx, tt.tx) + tx.ChainID = tt.tx.ChainID + assertEqualTX(t, tx, tt.tx) }) } } func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { tests := []struct { - tx *TransactionDynamicFee - want Hash + name string + tx *TransactionDynamicFee + wantHex string }{ { - tx: &TransactionDynamicFee{}, - want: MustHashFromHex("0x292edeba1be7c90f4dbaed50c44b7f6378633f933202ffe4f547e5a5c2ca3304", PadNone), + name: "empty transaction", + tx: &TransactionDynamicFee{}, + wantHex: "0x292edeba1be7c90f4dbaed50c44b7f6378633f933202ffe4f547e5a5c2ca3304", }, { + name: "all fields set", tx: &TransactionDynamicFee{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, }, }, - want: MustHashFromHex("0xc3266152306909bfe339f90fad4f73f958066860300b5a22b98ee6a1d629706c", PadNone), + wantHex: "0xc3266152306909bfe339f90fad4f73f958066860300b5a22b98ee6a1d629706c", }, { + name: "all fields set with access list", tx: &TransactionDynamicFee{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedAccessListData: EmbedAccessListData{ - AccessList: AccessList{ - AccessTuple{ - Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), - StorageKeys: []Hash{ - MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), - MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + CallDynamicFee: CallDynamicFee{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + AccessListField: AccessListField{ + AccessList: AccessList{ + AccessTuple{ + Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + StorageKeys: []Hash{ + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, }, }, }, - }, - EmbedDynamicFeeData: EmbedDynamicFeeData{ - MaxPriorityFeePerGas: big.NewInt(1000000000), - MaxFeePerGas: big.NewInt(2000000000), + DynamicFeeFields: DynamicFeeFields{ + MaxPriorityFeePerGas: big.NewInt(1000000000), + MaxFeePerGas: big.NewInt(2000000000), + }, }, }, - want: MustHashFromHex("0xa66ab756479bfd56f29658a8a199319094e84711e8a2de073ec136ef5179c4c9", PadNone), + wantHex: "0xa66ab756479bfd56f29658a8a199319094e84711e8a2de073ec136ef5179c4c9", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { sh, err := tt.tx.CalculateSigningHash() - require.NoError(t1, err) - assert.Equal(t1, tt.want, sh) + require.NoError(t, err) + assert.Equal(t, tt.wantHex, sh.String()) }) } } diff --git a/types/tx_legacy.go b/types/tx_legacy.go index 9efd99d..c7728fb 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -10,27 +10,30 @@ import ( "github.com/defiweb/go-eth/crypto" ) +// TransactionLegacy is the legacy transaction type (Type 0). +// +// This is the original transaction format used before EIP-2718. type TransactionLegacy struct { - EmbedCallData - EmbedTransactionData - EmbedLegacyPriceData + TransactionFields + CallLegacy } +// NewTransactionLegacy creates a new legacy transaction. func NewTransactionLegacy() *TransactionLegacy { return &TransactionLegacy{} } +// Type implements the Transaction interface. func (t *TransactionLegacy) Type() TransactionType { return LegacyTxType } +// Call implements the Transaction interface. func (t *TransactionLegacy) Call() Call { - return &CallLegacy{ - EmbedCallData: *t.EmbedCallData.Copy(), - EmbedLegacyPriceData: *t.EmbedLegacyPriceData.Copy(), - } + return t.CallLegacy.Copy() } +// CalculateHash implements the Transaction interface. func (t *TransactionLegacy) CalculateHash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { @@ -39,48 +42,49 @@ func (t *TransactionLegacy) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } +// CalculateSigningHash implements the Transaction interface. func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { var ( - chainID = uint64(0) - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) + chainID = rlp.Uint(0) + nonce = rlp.Uint(0) + gasPrice = &rlp.BigInt{} + gasLimit = rlp.Uint(0) + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) ) if t.ChainID != nil { - chainID = *t.ChainID + chainID = rlp.Uint(*t.ChainID) } if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasPrice != nil { - gasPrice = t.GasPrice + gasPrice = (*rlp.BigInt)(t.GasPrice) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input } list := rlp.List{ - rlp.Uint(nonce), - (*rlp.BigInt)(gasPrice), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), + nonce, + gasPrice, + gasLimit, + to, + value, + input, } if t.ChainID != nil && *t.ChainID != 0 { list.Add( - rlp.Uint(chainID), + chainID, rlp.Uint(0), rlp.Uint(0), ) @@ -92,58 +96,69 @@ func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { return Hash(crypto.Keccak256(bin)), nil } +// Copy creates a deep copy of the transaction. +func (t *TransactionLegacy) Copy() *TransactionLegacy { + return &TransactionLegacy{ + TransactionFields: *t.TransactionFields.Copy(), + CallLegacy: *t.CallLegacy.Copy(), + } +} + +// EncodeRLP implements the rlp.Encoder interface. +// //nolint:funlen func (t TransactionLegacy) EncodeRLP() ([]byte, error) { var ( - nonce = uint64(0) - gasPrice = big.NewInt(0) - gasLimit = uint64(0) - to = ([]byte)(nil) - value = big.NewInt(0) - input = ([]byte)(nil) - v = big.NewInt(0) - r = big.NewInt(0) - s = big.NewInt(0) + nonce = rlp.Uint(0) + gasPrice = &rlp.BigInt{} + gasLimit = rlp.Uint(0) + to = (rlp.Bytes)(nil) + value = &rlp.BigInt{} + input = (rlp.Bytes)(nil) + v = &rlp.BigInt{} + r = &rlp.BigInt{} + s = &rlp.BigInt{} ) if t.Nonce != nil { - nonce = *t.Nonce + nonce = rlp.Uint(*t.Nonce) } if t.GasPrice != nil { - gasPrice = t.GasPrice + gasPrice = (*rlp.BigInt)(t.GasPrice) } if t.GasLimit != nil { - gasLimit = *t.GasLimit + gasLimit = rlp.Uint(*t.GasLimit) } if t.To != nil { to = t.To[:] } if t.Value != nil { - value = t.Value + value = (*rlp.BigInt)(t.Value) } if t.Input != nil { input = t.Input } if t.Signature != nil { - v = t.Signature.V - r = t.Signature.R - s = t.Signature.S + v = (*rlp.BigInt)(t.Signature.V) + r = (*rlp.BigInt)(t.Signature.R) + s = (*rlp.BigInt)(t.Signature.S) } return rlp.List{ - rlp.Uint(nonce), - (*rlp.BigInt)(gasPrice), - rlp.Uint(gasLimit), - rlp.Bytes(to), - (*rlp.BigInt)(value), - rlp.Bytes(input), - (*rlp.BigInt)(v), - (*rlp.BigInt)(r), - (*rlp.BigInt)(s), + nonce, + gasPrice, + gasLimit, + to, + value, + input, + v, + r, + s, }.EncodeRLP() } +// DecodeRLP implements the rlp.Decoder interface. +// //nolint:funlen func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { - *t = TransactionLegacy{} if len(data) == 0 { return 0, fmt.Errorf("empty data") } @@ -172,6 +187,7 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { if _, err := rlp.Decode(data, &list); err != nil { return 0, err } + *t = TransactionLegacy{} if nonce.Get() != 0 { t.Nonce = nonce.Ptr() } @@ -207,78 +223,25 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { return len(data), nil } +// MarshalJSON implements the json.Marshaler interface. func (t *TransactionLegacy) MarshalJSON() ([]byte, error) { - transaction := &jsonTransactionLegacy{} - transaction.To = t.To - transaction.From = t.From - if t.ChainID != nil { - transaction.ChainID = NumberFromUint64Ptr(*t.ChainID) - } - if t.GasLimit != nil { - transaction.GasLimit = NumberFromUint64Ptr(*t.GasLimit) - } - if t.GasPrice != nil { - transaction.GasPrice = NumberFromBigIntPtr(t.GasPrice) - } - transaction.Input = t.Input - if t.Nonce != nil { - transaction.Nonce = NumberFromUint64Ptr(*t.Nonce) - } - if t.Value != nil { - transaction.Value = NumberFromBigIntPtr(t.Value) - } - if t.Signature != nil { - transaction.V = NumberFromBigIntPtr(t.Signature.V) - transaction.R = NumberFromBigIntPtr(t.Signature.R) - transaction.S = NumberFromBigIntPtr(t.Signature.S) - } - return json.Marshal(transaction) + j := &jsonTransaction{} + t.TransactionFields.toJSON(j) + t.CallFields.toJSON(&j.jsonCall) + t.LegacyPriceField.toJSON(&j.jsonCall) + return json.Marshal(j) } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *TransactionLegacy) UnmarshalJSON(data []byte) error { - transaction := &jsonTransactionLegacy{} - if err := json.Unmarshal(data, transaction); err != nil { + j := &jsonTransaction{} + if err := json.Unmarshal(data, &j); err != nil { return err } - if transaction.ChainID != nil { - chainID := transaction.ChainID.Big().Uint64() - t.ChainID = &chainID - } - t.To = transaction.To - t.From = transaction.From - if transaction.GasLimit != nil { - gas := transaction.GasLimit.Big().Uint64() - t.GasLimit = &gas - } - if transaction.GasPrice != nil { - t.GasPrice = transaction.GasPrice.Big() - } - t.Input = transaction.Input - if transaction.Nonce != nil { - nonce := transaction.Nonce.Big().Uint64() - t.Nonce = &nonce - } - if transaction.Value != nil { - t.Value = transaction.Value.Big() - } - if transaction.V != nil && transaction.R != nil && transaction.S != nil { - t.Signature = SignatureFromVRSPtr(transaction.V.Big(), transaction.R.Big(), transaction.S.Big()) - } + t.TransactionFields.fromJSON(j) + t.CallFields.fromJSON(&j.jsonCall) + t.LegacyPriceField.fromJSON(&j.jsonCall) return nil } -type jsonTransactionLegacy struct { - ChainID *Number `json:"chainId,omitempty"` - From *Address `json:"from,omitempty"` - To *Address `json:"to,omitempty"` - GasLimit *Number `json:"gas,omitempty"` - GasPrice *Number `json:"gasPrice,omitempty"` - Input Bytes `json:"input,omitempty"` - Nonce *Number `json:"nonce,omitempty"` - Value *Number `json:"value,omitempty"` - V *Number `json:"v,omitempty"` - R *Number `json:"r,omitempty"` - S *Number `json:"s,omitempty"` -} - var _ Transaction = (*TransactionLegacy)(nil) diff --git a/types/tx_legacy_test.go b/types/tx_legacy_test.go index 46c6a39..6593f91 100644 --- a/types/tx_legacy_test.go +++ b/types/tx_legacy_test.go @@ -1,7 +1,6 @@ package types import ( - "fmt" "math/big" "testing" @@ -11,38 +10,54 @@ import ( "github.com/defiweb/go-eth/hexutil" ) -func TestTransactionLegacy_RLP(t *testing.T) { +func TestTransactionLegacy_JSON(t *testing.T) { tests := []struct { - tx *TransactionLegacy - want []byte + name string + tx *TransactionLegacy + wantJSON string }{ { - tx: &TransactionLegacy{}, - want: hexutil.MustHexToBytes("c9808080808080808080"), + name: "empty transaction", + tx: &TransactionLegacy{}, + wantJSON: `{}`, }, { + name: "all fields set", tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, - want: hexutil.MustHexToBytes("f87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84"), + wantJSON: `{ + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "gasPrice": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84" + }`, }, - // Example from EIP-155: { + name: "example from EIP-155", tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -60,88 +75,197 @@ func TestTransactionLegacy_RLP(t *testing.T) { }(), ), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(21000)), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(20000000000), + }, }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(20000000000), + }, + wantJSON: `{ + "chainId": "0x1", + "to": "0x3535353535353535353535353535353535353535", + "gas": "0x5208", + "gasPrice": "0x4a817c800", + "nonce": "0x9", + "value": "0xde0b6b3a7640000", + "v": "0x25", + "r": "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276", + "s": "0x67cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83" + }`, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to JSON + jsonBytes, err := tt.tx.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) + + // Decode from JSON + tx := NewTransactionLegacy() + err = tx.UnmarshalJSON(jsonBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions + tx.From = tt.tx.From + tx.ChainID = tt.tx.ChainID + assertEqualTX(t, tx, tt.tx) + }) + } +} + +func TestTransactionLegacy_RLP(t *testing.T) { + tests := []struct { + name string + tx *TransactionLegacy + wantHex string + }{ + { + name: "empty transaction", + tx: &TransactionLegacy{}, + wantHex: "0xc9808080808080808080", + }, + { + name: "all fields set", + tx: &TransactionLegacy{ + TransactionFields: TransactionFields{ + Nonce: ptr(uint64(1)), + Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), + }, + CallLegacy: CallLegacy{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, - want: hexutil.MustHexToBytes("f86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"), + wantHex: "0xf87001843b9aca00830186a0942222222222222222222222222222222222222222880de0b6b3a764000084010203046fa0a3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490a08051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + }, + { + name: "example from EIP-155", + tx: &TransactionLegacy{ + TransactionFields: TransactionFields{ + ChainID: ptr(uint64(1)), + Nonce: ptr(uint64(9)), + Signature: SignatureFromVRSPtr( + func() *big.Int { + v, _ := new(big.Int).SetString("37", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) + return v + }(), + func() *big.Int { + v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) + return v + }(), + ), + }, + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(20000000000), + }, + }, + }, + wantHex: "0xf86c098504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a028ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276a067cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { - // Encode: - rlp, err := tt.tx.EncodeRLP() - require.NoError(t1, err) - assert.Equal(t1, tt.want, rlp) + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + // Encode to RLP + rlpBytes, err := tt.tx.EncodeRLP() + require.NoError(t, err) + assert.Equal(t, tt.wantHex, hexutil.BytesToHex(rlpBytes)) - // Decode: + // Decode from RLP tx := NewTransactionLegacy() - _, err = tx.DecodeRLP(rlp) + _, err = tx.DecodeRLP(rlpBytes) + require.NoError(t, err) + + // Compare the original and decoded transactions tx.From = tt.tx.From tx.ChainID = tt.tx.ChainID - require.NoError(t1, err) - equalTX(t1, tx, tt.tx) + assertEqualTX(t, tx, tt.tx) }) } } func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { tests := []struct { - tx *TransactionLegacy - want Hash + name string + tx *TransactionLegacy + wantHex string }{ { - tx: &TransactionLegacy{}, - want: MustHashFromHex("0x5460be86ce1e4ca0564b5761c6e7070d9f054b671f5404268335000806423d75", PadNone), + name: "empty transaction", + tx: &TransactionLegacy{}, + wantHex: "0x5460be86ce1e4ca0564b5761c6e7070d9f054b671f5404268335000806423d75", }, { + name: "all fields set", tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, - EmbedCallData: EmbedCallData{ - From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), - To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(100000)), - Input: []byte{1, 2, 3, 4}, - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(1000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), + To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(100000)), + Input: []byte{1, 2, 3, 4}, + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(1000000000), + }, }, }, - want: MustHashFromHex("0x1efbe489013ac8c0dad2202f68ac12657471df8d80f70e0683ec07b0564a32ca", PadNone), + wantHex: "0x1efbe489013ac8c0dad2202f68ac12657471df8d80f70e0683ec07b0564a32ca", }, - // Example from EIP-155: { + name: "example from EIP-155", tx: &TransactionLegacy{ - EmbedTransactionData: EmbedTransactionData{ + TransactionFields: TransactionFields{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), }, - EmbedCallData: EmbedCallData{ - To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), - Value: big.NewInt(1000000000000000000), - GasLimit: ptr(uint64(21000)), - }, - EmbedLegacyPriceData: EmbedLegacyPriceData{ - GasPrice: big.NewInt(20000000000), + CallLegacy: CallLegacy{ + CallFields: CallFields{ + To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), + Value: big.NewInt(1000000000000000000), + GasLimit: ptr(uint64(21000)), + }, + LegacyPriceField: LegacyPriceField{ + GasPrice: big.NewInt(20000000000), + }, }, }, - want: MustHashFromHex("0xdaf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53", PadNone), + wantHex: "0xdaf5a779ae972f972197303d7b574746c7ef83eadac0f2791ad23db92e4c8e53", }, } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t1 *testing.T) { + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { sh, err := tt.tx.CalculateSigningHash() - require.NoError(t1, err) - assert.Equal(t1, tt.want, sh) + require.NoError(t, err) + assert.Equal(t, tt.wantHex, sh.String()) }) } } diff --git a/types/tx_test.go b/types/tx_test.go deleted file mode 100644 index 21db2ed..0000000 --- a/types/tx_test.go +++ /dev/null @@ -1,35 +0,0 @@ -package types - -import ( - "reflect" - "testing" - - "github.com/stretchr/testify/assert" -) - -func equalTX(t *testing.T, actual, expected Transaction) { - assert.Equal(t, derefType(reflect.TypeOf(actual)), derefType(reflect.TypeOf(expected))) - assert.Equal(t, actual.TransactionData(), expected.TransactionData()) - if _, ok := expected.(HasCallData); ok { - assert.Equal(t, actual.(HasCallData).CallData(), actual.(HasCallData).CallData()) - } - if _, ok := actual.(HasLegacyPrice); ok { - assert.Equal(t, expected.(HasLegacyPrice).LegacyPriceData(), actual.(HasLegacyPrice).LegacyPriceData()) - } - if _, ok := actual.(HasAccessListData); ok { - assert.Equal(t, expected.(HasAccessListData).AccessListData(), actual.(HasAccessListData).AccessListData()) - } - if _, ok := actual.(HasDynamicFeeData); ok { - assert.Equal(t, expected.(HasDynamicFeeData).DynamicFeeData(), actual.(HasDynamicFeeData).DynamicFeeData()) - } - if _, ok := actual.(HasBlobData); ok { - assert.Equal(t, expected.(HasBlobData).BlobData(), actual.(HasBlobData).BlobData()) - } -} - -func derefType(t reflect.Type) reflect.Type { - for t.Kind() == reflect.Ptr || t.Kind() == reflect.Interface { - t = t.Elem() - } - return t -} diff --git a/types/types.go b/types/types.go index 8f27a90..5b18fea 100644 --- a/types/types.go +++ b/types/types.go @@ -137,43 +137,49 @@ func (t Address) IsZero() bool { return t == ZeroAddress } +// MarshalJSON implements the json.Marshaler interface. func (t Address) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *Address) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } +// MarshalText implements the encoding.TextMarshaler interface. func (t Address) MarshalText() ([]byte, error) { return bytesMarshalText(t[:]), nil } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (t *Address) UnmarshalText(input []byte) error { return fixedBytesUnmarshalText(input, t[:]) } +// EncodeRLP implements the rlp.Encoder interface. func (t Address) EncodeRLP() ([]byte, error) { return rlp.Encode(rlp.Bytes(t[:])) } +// DecodeRLP implements the rlp.Decoder interface. func (t *Address) DecodeRLP(data []byte) (int, error) { r, n, err := rlp.DecodeLazy(data) if err != nil { return 0, err } - a, err := r.Bytes() + b, err := r.Bytes() if err != nil { return 0, err } - if len(a) == 0 { + if len(b) == 0 { *t = ZeroAddress return n, nil } - if len(a) != AddressLength { - return 0, fmt.Errorf("invalid address length %d", len(a)) + if len(b) != AddressLength { + return 0, fmt.Errorf("invalid address length %d", len(b)) } - copy(t[:], a) + copy(t[:], b) return n, nil } @@ -291,11 +297,11 @@ func HashFromBigInt(i *big.Int) (Hash, error) { x := new(big.Int).Set(i).And(i, m) b = x.Bytes() if len(b) != HashLength || b[0]&0x80 == 0 { - return Hash{}, fmt.Errorf("number too large To convert To hash") + return Hash{}, fmt.Errorf("number too large to convert to hash") } } if len(b) > HashLength { - return Hash{}, fmt.Errorf("number too large To convert To hash") + return Hash{}, fmt.Errorf("number too large to convert to hash") } return HashFromBytes(b, PadLeft) } @@ -345,26 +351,32 @@ func (t Hash) IsZero() bool { return t == ZeroHash } +// MarshalJSON implements the json.Marshaler interface. func (t Hash) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *Hash) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } +// MarshalText implements the encoding.TextMarshaler interface. func (t Hash) MarshalText() ([]byte, error) { return bytesMarshalText(t[:]), nil } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (t *Hash) UnmarshalText(input []byte) error { return fixedBytesUnmarshalText(input, t[:]) } +// EncodeRLP implements the rlp.Encoder interface. func (t Hash) EncodeRLP() ([]byte, error) { return rlp.Encode(rlp.Bytes(t[:])) } +// DecodeRLP implements the rlp.Decoder interface. func (t *Hash) DecodeRLP(data []byte) (int, error) { r, n, err := rlp.DecodeLazy(data) if err != nil { @@ -374,6 +386,10 @@ func (t *Hash) DecodeRLP(data []byte) (int, error) { if err != nil { return 0, err } + if len(b) == 0 { + *t = ZeroHash + return n, nil + } if len(b) != HashLength { return 0, fmt.Errorf("invalid hash length %d", len(t)) } @@ -503,6 +519,12 @@ func (t *BlockNumber) IsTag() bool { } // Big returns the big.Int representation of the block number. +// It returns a negative number if the block tag is used: +// - earliest: -1 +// - latest: -2 +// - pending: -3 +// - safe: -4 +// - finalized: -5 func (t *BlockNumber) Big() *big.Int { return new(big.Int).Set(&t.x) } @@ -525,6 +547,7 @@ func (t *BlockNumber) String() string { } } +// MarshalJSON implements the json.Marshaler interface. func (t BlockNumber) MarshalJSON() ([]byte, error) { b, err := t.MarshalText() if err != nil { @@ -533,10 +556,16 @@ func (t BlockNumber) MarshalJSON() ([]byte, error) { return naiveQuote(b), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *BlockNumber) UnmarshalJSON(input []byte) error { - return t.UnmarshalText(naiveUnquote(input)) + input, ok := naiveUnquote(input) + if !ok { + return fmt.Errorf("invalid JSON string: %s", input) + } + return t.UnmarshalText(input) } +// MarshalText implements the encoding.TextMarshaler interface. func (t BlockNumber) MarshalText() ([]byte, error) { switch { case t.IsEarliest(): @@ -554,6 +583,7 @@ func (t BlockNumber) MarshalText() ([]byte, error) { } } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (t *BlockNumber) UnmarshalText(input []byte) error { switch strings.ToLower(strings.TrimSpace(string(input))) { case "earliest": @@ -770,6 +800,7 @@ func (s Signature) Equal(c Signature) bool { return sv.Cmp(cv) == 0 && sr.Cmp(cr) == 0 && ss.Cmp(cs) == 0 } +// Copy returns a deep copy of the signature. func (s Signature) Copy() *Signature { cpy := &Signature{} if s.V != nil { @@ -784,10 +815,12 @@ func (s Signature) Copy() *Signature { return cpy } +// MarshalJSON implements the json.Marshaler interface. func (s Signature) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(s.Bytes()), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (s *Signature) UnmarshalJSON(input []byte) error { var b []byte if err := bytesUnmarshalJSON(input, &b); err != nil { @@ -801,10 +834,12 @@ func (s *Signature) UnmarshalJSON(input []byte) error { return nil } +// MarshalText implements the encoding.TextMarshaler interface. func (s Signature) MarshalText() ([]byte, error) { return bytesMarshalText(s.Bytes()), nil } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (s *Signature) UnmarshalText(input []byte) error { var b []byte if err := bytesUnmarshalText(input, &b); err != nil { @@ -906,7 +941,7 @@ func (t *Number) Big() *big.Int { return new(big.Int).Set(&t.x) } -// Bytes returns the byte representation of the number. +// Bytes returns the absolute value of a number as a big-endian byte slice. func (t *Number) Bytes() []byte { return t.x.Bytes() } @@ -916,18 +951,22 @@ func (t *Number) String() string { return hexutil.BigIntToHex(&t.x) } +// MarshalJSON implements the json.Marshaler interface. func (t Number) MarshalJSON() ([]byte, error) { return numberMarshalJSON(t.Big()), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (t *Number) UnmarshalJSON(input []byte) error { return numberUnmarshalJSON(input, &t.x) } +// MarshalText implements the encoding.TextMarshaler interface. func (t Number) MarshalText() ([]byte, error) { return numberMarshalText(t.Big()), nil } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (t *Number) UnmarshalText(input []byte) error { return numberUnmarshalText(input, &t.x) } @@ -1018,18 +1057,22 @@ func (b *Bytes) String() string { return hexutil.BytesToHex(*b) } +// MarshalJSON implements the json.Marshaler interface. func (b Bytes) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(b), nil } +// UnmarshalJSON implements the json.Unmarshaler interface. func (b *Bytes) UnmarshalJSON(input []byte) error { return bytesUnmarshalJSON(input, (*[]byte)(b)) } +// MarshalText implements the encoding.TextMarshaler interface. func (b Bytes) MarshalText() ([]byte, error) { return bytesMarshalText(b), nil } +// UnmarshalText implements the encoding.TextUnmarshaler interface. func (b *Bytes) UnmarshalText(input []byte) error { return bytesUnmarshalText(input, (*[]byte)(b)) } @@ -1043,15 +1086,31 @@ const ( nonceLength = 8 ) -type ( - kzgBlob [kzg4844.BlobLength]byte - kzgCommitment [kzg4844.CommitmentLength]byte - kzgProof [kzg4844.ProofLength]byte - bloom [bloomLength]byte - nonce [nonceLength]byte - hashList []Hash - addressList []Address -) +// oneOrList is a type that can marshal and unmarshal a single element or a list +// of elements. +type oneOrList[T any] []T + +func (l oneOrList[T]) MarshalJSON() ([]byte, error) { + if len(l) == 1 { + return json.Marshal(l[0]) + } + return json.Marshal([]T(l)) +} + +func (l *oneOrList[T]) UnmarshalJSON(input []byte) error { + if len(input) >= 1 && input[0] == '[' || input[0] == '{' { + return json.Unmarshal(input, l) + } + var i T + if err := json.Unmarshal(input, &i); err != nil { + return err + } + *l = oneOrList[T]{i} + return nil +} + +// kzgBlob is a fixed-length byte array used for KZG blob. +type kzgBlob [kzg4844.BlobLength]byte func (t kzgBlob) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil @@ -1062,13 +1121,16 @@ func (t *kzgBlob) UnmarshalJSON(input []byte) error { } func (t kzgBlob) EncodeRLP() ([]byte, error) { - return fixedBytesEncodeRLP(t[:]) + return rlp.Encode(rlp.Bytes(t[:])) } func (t *kzgBlob) DecodeRLP(data []byte) (int, error) { return fixedBytesDecodeRLP(data, t[:]) } +// kzgCommitment is a fixed-length byte array used for KZG commitment. +type kzgCommitment [kzg4844.CommitmentLength]byte + func (t kzgCommitment) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } @@ -1078,13 +1140,16 @@ func (t *kzgCommitment) UnmarshalJSON(input []byte) error { } func (t kzgCommitment) EncodeRLP() ([]byte, error) { - return fixedBytesEncodeRLP(t[:]) + return rlp.Encode(rlp.Bytes(t[:])) } func (t *kzgCommitment) DecodeRLP(data []byte) (int, error) { return fixedBytesDecodeRLP(data, t[:]) } +// kzgProof is a fixed-length byte array used for KZG proof. +type kzgProof [kzg4844.ProofLength]byte + func (t kzgProof) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil } @@ -1094,13 +1159,16 @@ func (t *kzgProof) UnmarshalJSON(input []byte) error { } func (t kzgProof) EncodeRLP() ([]byte, error) { - return fixedBytesEncodeRLP(t[:]) + return rlp.Encode(rlp.Bytes(t[:])) } func (t *kzgProof) DecodeRLP(data []byte) (int, error) { return fixedBytesDecodeRLP(data, t[:]) } +// bloom is a fixed-length byte array used for bloom filter. +type bloom [bloomLength]byte + func bloomFromBytes(x []byte) bloom { var b [bloomLength]byte if len(x) > len(b) { @@ -1122,22 +1190,18 @@ func (t *bloom) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } -func nonceFromBigInt(x *big.Int) nonce { +func nonceFromBigInt(x *big.Int) (n nonce) { if x == nil { return nonce{} } - return nonceFromBytes(x.Bytes()) -} - -func nonceFromBytes(x []byte) nonce { - var n nonce - if len(x) > len(n) { - return n - } - copy(n[nonceLength-len(x):], x) + b := x.Bytes() + copy(n[nonceLength-len(b):], b) return n } +// nonce is a fixed-length byte array used for nonce. +type nonce [nonceLength]byte + func (t *nonce) Big() *big.Int { return new(big.Int).SetBytes(t[:]) } @@ -1149,54 +1213,3 @@ func (t nonce) MarshalJSON() ([]byte, error) { func (t *nonce) UnmarshalJSON(input []byte) error { return fixedBytesUnmarshalJSON(input, t[:]) } - -func (b hashList) MarshalJSON() ([]byte, error) { - if len(b) == 1 { - return json.Marshal(b[0]) - } - return json.Marshal([]Hash(b)) -} - -func (b *hashList) UnmarshalJSON(input []byte) error { - if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { - *b = hashList{{}} - return json.Unmarshal(input, &((*b)[0])) - } - return json.Unmarshal(input, (*[]Hash)(b)) -} - -func (b *hashList) EncodeRLP() ([]byte, error) { - l := make(rlp.TypedList[Hash], len(*b)) - for n, _ := range *b { - l[n] = &(*b)[n] - } - return rlp.Encode(l) -} - -func (b *hashList) DecodeRLP(data []byte) (int, error) { - l := make(rlp.TypedList[Hash], 0) - n, err := rlp.Decode(data, &l) - if err != nil { - return 0, err - } - *b = make(hashList, len(l)) - for n, hash := range l { - (*b)[n] = *hash - } - return n, nil -} - -func (t addressList) MarshalJSON() ([]byte, error) { - if len(t) == 1 { - return json.Marshal(t[0]) - } - return json.Marshal([]Address(t)) -} - -func (t *addressList) UnmarshalJSON(input []byte) error { - if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { - *t = addressList{{}} - return json.Unmarshal(input, &((*t)[0])) - } - return json.Unmarshal(input, (*[]Address)(t)) -} diff --git a/types/types_test.go b/types/types_test.go index 99a802e..10cb741 100644 --- a/types/types_test.go +++ b/types/types_test.go @@ -7,180 +7,181 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" ) -func Test_AddressType_Unmarshal(t *testing.T) { +func Test_AddressFromHex(t *testing.T) { tests := []struct { arg string want Address wantErr bool }{ { - arg: `"0x00112233445566778899aabbccddeeff00112233"`, + arg: "0x00112233445566778899aabbccddeeff00112233", want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `"00112233445566778899aabbccddeeff00112233"`, + arg: "00112233445566778899aabbccddeeff00112233", want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `"00112233445566778899aabbccddeeff0011223344"`, + arg: "0x00", wantErr: true, }, { - arg: `"0x00112233445566778899aabbccddeeff0011223344"`, + arg: "0x00112233445566778899aabbccddeeff0011223344", wantErr: true, }, { - arg: `"""`, + arg: "invalid", wantErr: true, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &Address{} - err := v.UnmarshalJSON([]byte(tt.arg)) + v, err := AddressFromHex(tt.arg) if tt.wantErr { assert.Error(t, err) } else { assert.NoError(t, err) - assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.want, v) } }) } } -func Test_AddressType_Marshal(t *testing.T) { +func Test_AddressFromBytes(t *testing.T) { tests := []struct { - arg Address - want string + arg []byte + want Address + wantErr bool }{ { - arg: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), - want: `"0x00112233445566778899aabbccddeeff00112233"`, + arg: []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: Address{}, - want: `"0x0000000000000000000000000000000000000000"`, + arg: []byte{}, + wantErr: true, + }, + { + arg: []byte{0x00}, + wantErr: true, + }, + { + arg: []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44}, + wantErr: true, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() - assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) + got, err := AddressFromBytes(tt.arg) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, got) + } }) } } -func Test_AddressType_Checksum(t *testing.T) { +func Test_AddressType_String(t *testing.T) { + addr := (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}) + assert.Equal(t, "0x00112233445566778899aabbccddeeff00112233", addr.String()) +} + +func Test_AddressType_Bytes(t *testing.T) { + addr := (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}) + expected := []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33} + assert.Equal(t, expected, addr.Bytes()) +} + +func Test_AddressType_IsZero(t *testing.T) { tests := []struct { - addr string + addr Address + isZero bool }{ - {addr: "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"}, - {addr: "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"}, - {addr: "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"}, - {addr: "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB"}, - {addr: "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb"}, + {addr: Address{}, isZero: true}, + {addr: (Address)([AddressLength]byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), isZero: false}, + {addr: (Address)([AddressLength]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}), isZero: false}, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - assert.Equal(t, tt.addr, MustAddressFromHex(tt.addr).Checksum()) + assert.Equal(t, tt.isZero, tt.addr.IsZero()) }) } } -func Test_hashType_Unmarshal(t *testing.T) { +func Test_AddressType_Checksum(t *testing.T) { tests := []struct { - arg string - want Hash - wantErr bool + addr string }{ - { - arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, - want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), - }, - { - arg: `"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, - want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), - }, - { - arg: `"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"`, - wantErr: true, - }, - { - arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"`, - wantErr: true, - }, - { - arg: `"""`, - wantErr: true, - }, + {addr: "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"}, + {addr: "0x5aAeb6053F3E94C9b9A09f33669435E7Ef1BeAed"}, + {addr: "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359"}, + {addr: "0xdbF03B407c01E7cD3CBea99509d93f8DDDC8C6FB"}, + {addr: "0xD1220A0cf47c7B9Be7A2E6BA89F429762e7b9aDb"}, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &Hash{} - err := v.UnmarshalJSON([]byte(tt.arg)) - if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, *v) - } + assert.Equal(t, tt.addr, MustAddressFromHex(tt.addr).Checksum()) }) } } -func Test_hashType_Marshal(t *testing.T) { +func Test_AddressType_MarshalJSON(t *testing.T) { tests := []struct { - arg Hash + arg Address want string }{ { - arg: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), - want: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, + arg: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), + want: `"0x00112233445566778899aabbccddeeff00112233"`, }, { - arg: Hash{}, - want: `"0x0000000000000000000000000000000000000000000000000000000000000000"`, + arg: Address{}, + want: `"0x0000000000000000000000000000000000000000"`, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() + jsonBytes, err := tt.arg.MarshalJSON() assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) + assert.Equal(t, tt.want, string(jsonBytes)) }) } } -func Test_hashesType_Unmarshal(t *testing.T) { +func Test_AddressType_UnmarshalJSON(t *testing.T) { tests := []struct { arg string - want hashList + want Address wantErr bool }{ { - arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, - want: (hashList)([]Hash{{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}}), + arg: `"0x00112233445566778899aabbccddeeff00112233"`, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, - want: (hashList)([]Hash{{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}}), + arg: `"00112233445566778899aabbccddeeff00112233"`, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `["0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", "0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"]`, - want: (hashList)([]Hash{ - {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, - {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, - }), + arg: `0x00112233445566778899aabbccddeeff00112233`, + wantErr: true, }, { - arg: `"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"`, + arg: `"0x00"`, wantErr: true, }, { - arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"`, + arg: `"0x00112233445566778899aabbccddeeff0011223344"`, + wantErr: true, + }, + { + arg: `"invalid"`, wantErr: true, }, { @@ -190,7 +191,7 @@ func Test_hashesType_Unmarshal(t *testing.T) { } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &hashList{} + v := &Address{} err := v.UnmarshalJSON([]byte(tt.arg)) if tt.wantErr { assert.Error(t, err) @@ -202,76 +203,64 @@ func Test_hashesType_Unmarshal(t *testing.T) { } } -func Test_hashesType_Marshal(t *testing.T) { +func Test_AddressType_MarshalText(t *testing.T) { tests := []struct { - arg hashList + arg Address want string }{ { - arg: (hashList)([]Hash{ - MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), - }), - want: `"0x1111111111111111111111111111111111111111111111111111111111111111"`, - }, - { - arg: (hashList)([]Hash{ - MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), - MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), - }), - want: `["0x1111111111111111111111111111111111111111111111111111111111111111","0x2222222222222222222222222222222222222222222222222222222222222222"]`, + arg: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), + want: `0x00112233445566778899aabbccddeeff00112233`, }, { - arg: hashList{}, - want: `[]`, + arg: Address{}, + want: `0x0000000000000000000000000000000000000000`, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() + textBytes, err := tt.arg.MarshalText() assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) + assert.Equal(t, tt.want, string(textBytes)) }) } } -func Test_AddressesType_Unmarshal(t *testing.T) { +func Test_AddressType_UnmarshalText(t *testing.T) { tests := []struct { arg string - want addressList + want Address wantErr bool }{ { - arg: `"0x00112233445566778899aabbccddeeff00112233"`, - want: (addressList)([]Address{{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}}), + arg: `0x00112233445566778899aabbccddeeff00112233`, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `"00112233445566778899aabbccddeeff00112233"`, - want: (addressList)([]Address{{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}}), + arg: `00112233445566778899aabbccddeeff00112233`, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `["0x00112233445566778899aabbccddeeff00112233", "0x00112233445566778899aabbccddeeff00112233"]`, - want: (addressList)([]Address{ - {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}, - {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}, - }), + arg: `"0x00112233445566778899aabbccddeeff00112233"`, + wantErr: true, }, { - arg: `"00112233445566778899aabbccddeeff0011223344"`, + arg: `0x00`, wantErr: true, }, { - arg: `"0x00112233445566778899aabbccddeeff0011223344"`, + arg: `0x00112233445566778899aabbccddeeff0011223344`, wantErr: true, }, { - arg: `"""`, + arg: `invalid`, wantErr: true, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &addressList{} - err := v.UnmarshalJSON([]byte(tt.arg)) + v := &Address{} + err := v.UnmarshalText([]byte(tt.arg)) if tt.wantErr { assert.Error(t, err) } else { @@ -282,296 +271,164 @@ func Test_AddressesType_Unmarshal(t *testing.T) { } } -func Test_AddressesType_Marshal(t *testing.T) { +func Test_AddressType_EncodeRLP(t *testing.T) { tests := []struct { - arg addressList - want string + addr Address + want []byte }{ { - arg: (addressList)([]Address{ - MustAddressFromHex("0x1111111111111111111111111111111111111111"), - }), - want: `"0x1111111111111111111111111111111111111111"`, + addr: Address{}, + want: []byte{0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, }, { - arg: (addressList)([]Address{ - MustAddressFromHex("0x1111111111111111111111111111111111111111"), - MustAddressFromHex("0x2222222222222222222222222222222222222222"), - }), - want: `["0x1111111111111111111111111111111111111111","0x2222222222222222222222222222222222222222"]`, + addr: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), + want: []byte{0x94, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}, }, - { - arg: addressList{}, - want: `[]`, - }, - } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() - assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) - }) - } -} - -func Test_BlockNumberType_Unmarshal(t *testing.T) { - tests := []struct { - arg string - want BlockNumber - wantErr bool - isTag bool - isEarliest bool - isLatest bool - isPending bool - isSafe bool - isFinalized bool - }{ - {arg: `"0x0"`, want: BlockNumberFromUint64(0)}, - {arg: `"0xF"`, want: BlockNumberFromUint64(15)}, - {arg: `"0"`, want: BlockNumberFromUint64(0)}, - {arg: `"F"`, want: BlockNumberFromUint64(15)}, - {arg: `"earliest"`, want: EarliestBlockNumber, isTag: true, isEarliest: true}, - {arg: `"latest"`, want: LatestBlockNumber, isTag: true, isLatest: true}, - {arg: `"pending"`, want: PendingBlockNumber, isTag: true, isPending: true}, - {arg: `"safe"`, want: SafeBlockNumber, isTag: true, isSafe: true}, - {arg: `"finalized"`, want: FinalizedBlockNumber, isTag: true, isFinalized: true}, - {arg: `"foo"`, wantErr: true}, - {arg: `"0xZ"`, wantErr: true}, - } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &BlockNumber{} - err := v.UnmarshalJSON([]byte(tt.arg)) - if tt.wantErr { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, tt.want, *v) - assert.Equal(t, tt.isTag, v.IsTag()) - assert.Equal(t, tt.isEarliest, v.IsEarliest()) - assert.Equal(t, tt.isLatest, v.IsLatest()) - assert.Equal(t, tt.isPending, v.IsPending()) - assert.Equal(t, tt.isSafe, v.IsSafe()) - assert.Equal(t, tt.isFinalized, v.IsFinalized()) - } - }) - } -} - -func Test_BlockNumberType_Marshal(t *testing.T) { - tests := []struct { - arg BlockNumber - want string - }{ - {arg: BlockNumberFromUint64(0), want: `"0x0"`}, - {arg: BlockNumberFromUint64(15), want: `"0xf"`}, - {arg: EarliestBlockNumber, want: `"earliest"`}, - {arg: LatestBlockNumber, want: `"latest"`}, - {arg: PendingBlockNumber, want: `"pending"`}, - {arg: SafeBlockNumber, want: `"safe"`}, - {arg: FinalizedBlockNumber, want: `"finalized"`}, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() + rlpBytes, err := tt.addr.EncodeRLP() assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) + assert.Equal(t, tt.want, rlpBytes) }) } } -func Test_SignatureType_Unmarshal(t *testing.T) { +func Test_AddressType_DecodeRLP(t *testing.T) { tests := []struct { - arg string - want Signature + data []byte + want Address wantErr bool }{ { - arg: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, - want: Signature{ - V: big.NewInt(0), - R: big.NewInt(0), - S: big.NewInt(0), - }, + data: []byte{0x80}, + want: Address{}, + }, + { + data: []byte{0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + want: Address{}, }, { - arg: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, - want: Signature{ - V: big.NewInt(0), - R: big.NewInt(0), - S: big.NewInt(0), - }, + data: []byte{0x94, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}, + want: (Address)([AddressLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33}), }, { - arg: `"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000021b"`, - want: Signature{ - V: big.NewInt(27), - R: big.NewInt(1), - S: big.NewInt(2), - }, + data: []byte{0x81}, + wantErr: true, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &Signature{} - err := v.UnmarshalJSON([]byte(tt.arg)) + var addr Address + _, err := addr.DecodeRLP(tt.data) if tt.wantErr { assert.Error(t, err) } else { assert.NoError(t, err) - assert.True(t, tt.want.Equal(*v)) + assert.Equal(t, tt.want, addr) } }) } } -func Test_SignatureType_Marshal(t *testing.T) { +func Test_HashFromHex(t *testing.T) { tests := []struct { - signature Signature - want string - wantErr bool + arg string + pad Pad + want Hash + wantErr bool }{ { - signature: Signature{}, - want: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, - }, - { - signature: Signature{ - V: big.NewInt(0), - R: big.NewInt(0), - S: big.NewInt(0), - }, - want: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, + arg: "0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", + pad: PadNone, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), }, { - signature: Signature{ - V: big.NewInt(27), - R: big.NewInt(1), - S: big.NewInt(2), - }, - want: `"0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000021b"`, + arg: "00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", + pad: PadNone, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), }, - } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.signature.MarshalJSON() - assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) - }) - } -} - -func Test_SignatureType_Equal(t *testing.T) { - tests := []struct { - a, b Signature - want bool - }{ { - a: Signature{}, - b: Signature{}, - want: true, + arg: "80ff", + pad: PadLeft, + want: (Hash)([HashLength]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff}), }, { - a: Signature{}, - b: Signature{ - V: big.NewInt(0), - R: big.NewInt(0), - S: big.NewInt(0), - }, - want: true, + arg: "80ff", + pad: PadRight, + want: (Hash)([HashLength]byte{0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), }, { - a: Signature{ - V: big.NewInt(0), - R: nil, - S: big.NewInt(0), - }, - b: Signature{ - V: nil, - R: big.NewInt(0), - S: big.NewInt(0), - }, - want: true, + arg: "0x00", + pad: PadNone, + wantErr: true, }, { - a: Signature{ - V: big.NewInt(27), - R: big.NewInt(1), - S: big.NewInt(2), - }, - b: Signature{ - V: big.NewInt(27), - R: big.NewInt(1), - S: big.NewInt(2), - }, - want: true, + arg: "0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00", + pad: PadNone, + wantErr: true, }, { - a: Signature{ - V: big.NewInt(27), - R: nil, - S: big.NewInt(2), - }, - b: Signature{ - V: nil, - R: big.NewInt(2), - S: big.NewInt(2), - }, - want: false, + arg: "invalid", + pad: PadLeft, + wantErr: true, }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - assert.Equal(t, tt.want, tt.a.Equal(tt.b)) + v, err := HashFromHex(tt.arg, tt.pad) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, v) + } }) } } -func Test_BytesType_Unmarshal(t *testing.T) { +func Test_HashFromBytes(t *testing.T) { tests := []struct { - arg string - want Bytes + arg []byte + pad Pad + want Hash wantErr bool }{ - {arg: `"0xDEADBEEF"`, want: (Bytes)([]byte{0xDE, 0xAD, 0xBE, 0xEF})}, - {arg: `"DEADBEEF"`, want: (Bytes)([]byte{0xDE, 0xAD, 0xBE, 0xEF})}, - {arg: `"0x"`, want: (Bytes)([]byte{})}, - {arg: `""`, want: (Bytes)([]byte{})}, - {arg: `"0x0"`, want: (Bytes)([]byte{0x0})}, - {arg: `"foo"`, wantErr: true}, - {arg: `"0xZZ"`, wantErr: true}, + { + arg: []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + pad: PadNone, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + wantErr: false, + }, + { + arg: []byte{0x80, 0xff}, + pad: PadLeft, + want: (Hash)([HashLength]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xff}), + }, + { + arg: []byte{0x80, 0xff}, + pad: PadRight, + want: (Hash)([HashLength]byte{0x80, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), + }, + { + arg: []byte{0x00, 0x11, 0x22}, + pad: PadNone, + wantErr: true, + }, } for n, tt := range tests { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - v := &Bytes{} - err := v.UnmarshalJSON([]byte(tt.arg)) + got, err := HashFromBytes(tt.arg, tt.pad) if tt.wantErr { assert.Error(t, err) } else { assert.NoError(t, err) - assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.want, got) } }) } } -func Test_BytesType_Marshal(t *testing.T) { - tests := []struct { - arg Bytes - want string - }{ - {arg: (Bytes)([]byte{0xDE, 0xAD, 0xBE, 0xEF}), want: `"0xdeadbeef"`}, - {arg: (Bytes)([]byte{}), want: `"0x"`}, - } - for n, tt := range tests { - t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - j, err := tt.arg.MarshalJSON() - assert.NoError(t, err) - assert.Equal(t, tt.want, string(j)) - }) - } -} - func Test_HashFromBigInt(t *testing.T) { tests := []struct { i *big.Int @@ -584,7 +441,7 @@ func Test_HashFromBigInt(t *testing.T) { }, { i: big.NewInt(1), - want: Hash{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1}, + want: Hash{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}, }, { i: big.NewInt(-1), @@ -598,7 +455,7 @@ func Test_HashFromBigInt(t *testing.T) { // min int256 { i: new(big.Int).Lsh(big.NewInt(-1), uint(255)), - want: Hash{0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, + want: Hash{0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, }, // max uint256 + 1 { @@ -622,3 +479,1170 @@ func Test_HashFromBigInt(t *testing.T) { }) } } + +func Test_HashType_String(t *testing.T) { + hash := (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}) + assert.Equal(t, "0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff", hash.String()) +} + +func Test_HashType_Bytes(t *testing.T) { + hash := (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}) + expected := []byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff} + assert.Equal(t, expected, hash.Bytes()) +} + +func Test_HashType_IsZero(t *testing.T) { + tests := []struct { + hash Hash + isZero bool + }{ + {hash: Hash{}, isZero: true}, + {hash: (Hash)([HashLength]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}), isZero: false}, + {hash: (Hash)([HashLength]byte{0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), isZero: false}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.isZero, tt.hash.IsZero()) + }) + } +} + +func Test_HashType_MarshalJSON(t *testing.T) { + tests := []struct { + arg Hash + want string + }{ + { + arg: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + want: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, + }, + { + arg: Hash{}, + want: `"0x0000000000000000000000000000000000000000000000000000000000000000"`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + jsonBytes, err := tt.arg.MarshalJSON() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(jsonBytes)) + }) + } +} + +func Test_HashType_UnmarshalJSON(t *testing.T) { + tests := []struct { + arg string + want Hash + wantErr bool + }{ + { + arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + }, + { + arg: `"00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + }, + { + arg: `0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff`, + wantErr: true, + }, + { + arg: `"0x00"`, + wantErr: true, + }, + { + arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00"`, + wantErr: true, + }, + { + arg: `"invalid"`, + wantErr: true, + }, + { + arg: `"""`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + v := &Hash{} + err := v.UnmarshalJSON([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, *v) + } + }) + } +} + +func Test_HashType_MarshalText(t *testing.T) { + tests := []struct { + arg Hash + want string + }{ + { + arg: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + want: `0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff`, + }, + { + arg: Hash{}, + want: `0x0000000000000000000000000000000000000000000000000000000000000000`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + textBytes, err := tt.arg.MarshalText() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(textBytes)) + }) + } +} + +func Test_HashType_UnmarshalText(t *testing.T) { + tests := []struct { + arg string + want Hash + wantErr bool + }{ + { + arg: `0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff`, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + }, + { + arg: `00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff`, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + }, + { + arg: `"0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff"`, + wantErr: true, + }, + { + arg: `0x00`, + wantErr: true, + }, + { + arg: `0x00112233445566778899aabbccddeeff00112233445566778899aabbccddeeff00`, + wantErr: true, + }, + { + arg: `invalid`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + v := &Hash{} + err := v.UnmarshalText([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, *v) + } + }) + } +} + +func Test_HashType_EncodeRLP(t *testing.T) { + tests := []struct { + hash Hash + want []byte + }{ + { + hash: Hash{}, + want: []byte{0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + }, + { + hash: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + want: []byte{0xa0, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + rlpBytes, err := tt.hash.EncodeRLP() + assert.NoError(t, err) + assert.Equal(t, tt.want, rlpBytes) + }) + } +} + +func Test_HashType_DecodeRLP(t *testing.T) { + tests := []struct { + data []byte + want Hash + wantErr bool + }{ + { + data: []byte{0x80}, + want: Hash{}, + }, + { + data: []byte{0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + want: Hash{}, + }, + { + data: []byte{0xa0, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}, + want: (Hash)([HashLength]byte{0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff}), + }, + { + data: []byte{0x81}, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var hash Hash + _, err := hash.DecodeRLP(tt.data) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, hash) + } + }) + } +} + +func Test_BlockNumberFromHex(t *testing.T) { + tests := []struct { + arg string + want BlockNumber + wantErr bool + }{ + {arg: "0x0", want: BlockNumberFromUint64(0)}, + {arg: "0xf", want: BlockNumberFromUint64(15)}, + {arg: "earliest", want: EarliestBlockNumber}, + {arg: "latest", want: LatestBlockNumber}, + {arg: "pending", want: PendingBlockNumber}, + {arg: "safe", want: SafeBlockNumber}, + {arg: "finalized", want: FinalizedBlockNumber}, + {arg: "foo", wantErr: true}, + {arg: "0xZZ", wantErr: true}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + bn, err := BlockNumberFromHex(tt.arg) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, bn) + } + }) + } +} + +func Test_BlockNumberType_Big(t *testing.T) { + tests := []struct { + arg BlockNumber + want *big.Int + }{ + {arg: BlockNumberFromUint64(0), want: big.NewInt(0)}, + {arg: BlockNumberFromUint64(15), want: big.NewInt(15)}, + {arg: EarliestBlockNumber, want: big.NewInt(-1)}, + {arg: LatestBlockNumber, want: big.NewInt(-2)}, + {arg: PendingBlockNumber, want: big.NewInt(-3)}, + {arg: SafeBlockNumber, want: big.NewInt(-4)}, + {arg: FinalizedBlockNumber, want: big.NewInt(-5)}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.True(t, tt.arg.Big().Cmp(tt.want) == 0) + }) + } +} + +func Test_BlockNumberType_String(t *testing.T) { + tests := []struct { + arg BlockNumber + want string + }{ + {arg: BlockNumberFromUint64(0), want: `0x0`}, + {arg: BlockNumberFromUint64(15), want: `0xf`}, + {arg: EarliestBlockNumber, want: `earliest`}, + {arg: LatestBlockNumber, want: `latest`}, + {arg: PendingBlockNumber, want: `pending`}, + {arg: SafeBlockNumber, want: `safe`}, + {arg: FinalizedBlockNumber, want: `finalized`}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.String()) + }) + } +} + +func Test_BlockNumberType_MarshalJSON(t *testing.T) { + tests := []struct { + arg BlockNumber + want string + }{ + {arg: BlockNumberFromUint64(0), want: `"0x0"`}, + {arg: BlockNumberFromUint64(15), want: `"0xf"`}, + {arg: EarliestBlockNumber, want: `"earliest"`}, + {arg: LatestBlockNumber, want: `"latest"`}, + {arg: PendingBlockNumber, want: `"pending"`}, + {arg: SafeBlockNumber, want: `"safe"`}, + {arg: FinalizedBlockNumber, want: `"finalized"`}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + jsonBytes, err := tt.arg.MarshalJSON() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(jsonBytes)) + }) + } +} + +func Test_BlockNumberType_UnmarshalJSON(t *testing.T) { + tests := []struct { + arg string + want BlockNumber + wantErr bool + isTag bool + isEarliest bool + isLatest bool + isPending bool + isSafe bool + isFinalized bool + }{ + {arg: `"0x0"`, want: BlockNumberFromUint64(0)}, + {arg: `"0xF"`, want: BlockNumberFromUint64(15)}, + {arg: `"0"`, want: BlockNumberFromUint64(0)}, + {arg: `"F"`, want: BlockNumberFromUint64(15)}, + {arg: `"earliest"`, want: EarliestBlockNumber, isTag: true, isEarliest: true}, + {arg: `"latest"`, want: LatestBlockNumber, isTag: true, isLatest: true}, + {arg: `"pending"`, want: PendingBlockNumber, isTag: true, isPending: true}, + {arg: `"safe"`, want: SafeBlockNumber, isTag: true, isSafe: true}, + {arg: `"finalized"`, want: FinalizedBlockNumber, isTag: true, isFinalized: true}, + {arg: `"foo"`, wantErr: true}, + {arg: `"0xZZ"`, wantErr: true}, + {arg: `0x0`, wantErr: true}, + {arg: `latest`, wantErr: true}, + {arg: `"""`, wantErr: true}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + v := &BlockNumber{} + err := v.UnmarshalJSON([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.isTag, v.IsTag()) + assert.Equal(t, tt.isEarliest, v.IsEarliest()) + assert.Equal(t, tt.isLatest, v.IsLatest()) + assert.Equal(t, tt.isPending, v.IsPending()) + assert.Equal(t, tt.isSafe, v.IsSafe()) + assert.Equal(t, tt.isFinalized, v.IsFinalized()) + } + }) + } +} + +func Test_BlockNumberType_MarshalText(t *testing.T) { + tests := []struct { + arg BlockNumber + want string + }{ + {arg: BlockNumberFromUint64(0), want: `0x0`}, + {arg: BlockNumberFromUint64(15), want: `0xf`}, + {arg: EarliestBlockNumber, want: `earliest`}, + {arg: LatestBlockNumber, want: `latest`}, + {arg: PendingBlockNumber, want: `pending`}, + {arg: SafeBlockNumber, want: `safe`}, + {arg: FinalizedBlockNumber, want: `finalized`}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + textBytes, err := tt.arg.MarshalText() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(textBytes)) + }) + } +} + +func Test_BlockNumberType_UnmarshalText(t *testing.T) { + tests := []struct { + arg string + want BlockNumber + wantErr bool + isTag bool + isEarliest bool + isLatest bool + isPending bool + isSafe bool + isFinalized bool + }{ + {arg: `0x0`, want: BlockNumberFromUint64(0)}, + {arg: `0xF`, want: BlockNumberFromUint64(15)}, + {arg: `0`, want: BlockNumberFromUint64(0)}, + {arg: `F`, want: BlockNumberFromUint64(15)}, + {arg: `earliest`, want: EarliestBlockNumber, isTag: true, isEarliest: true}, + {arg: `latest`, want: LatestBlockNumber, isTag: true, isLatest: true}, + {arg: `pending`, want: PendingBlockNumber, isTag: true, isPending: true}, + {arg: `safe`, want: SafeBlockNumber, isTag: true, isSafe: true}, + {arg: `finalized`, want: FinalizedBlockNumber, isTag: true, isFinalized: true}, + {arg: `foo`, wantErr: true}, + {arg: `0xZZ`, wantErr: true}, + {arg: `"0x0"`, wantErr: true}, + {arg: `"latest"`, wantErr: true}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + v := &BlockNumber{} + err := v.UnmarshalText([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.isTag, v.IsTag()) + assert.Equal(t, tt.isEarliest, v.IsEarliest()) + assert.Equal(t, tt.isLatest, v.IsLatest()) + assert.Equal(t, tt.isPending, v.IsPending()) + assert.Equal(t, tt.isSafe, v.IsSafe()) + assert.Equal(t, tt.isFinalized, v.IsFinalized()) + } + }) + } +} + +var testSignature = Signature{ + V: func() *big.Int { + v, _ := new(big.Int).SetString("37", 10) + return v + }(), + R: func() *big.Int { + v, _ := new(big.Int).SetString("18515461264373351373200002665853028612451056578545711640558177340181847433846", 10) + return v + }(), + S: func() *big.Int { + v, _ := new(big.Int).SetString("46948507304638947509940763649030358759909902576025900602547168820602576006531", 10) + return v + }(), +} + +func Test_SignatureFromHex(t *testing.T) { + tests := []struct { + arg string + want Signature + wantErr bool + }{ + { + arg: "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325", + want: testSignature, + }, + { + arg: "0x00", + wantErr: true, + }, + { + arg: "invalid", + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + got, err := SignatureFromHex(tt.arg) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_SignatureFromBytes(t *testing.T) { + tests := []struct { + arg string + want Signature + wantErr bool + }{ + { + arg: "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325", + want: testSignature, + }, + { + arg: "0x00", + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + got, err := SignatureFromBytes(hexutil.MustHexToBytes(tt.arg)) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_SignatureType_String(t *testing.T) { + assert.Equal(t, "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325", testSignature.String()) +} + +func Test_SignatureType_Bytes(t *testing.T) { + assert.Equal(t, "0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325", hexutil.BytesToHex(testSignature.Bytes())) +} + +func Test_SignatureType_IsZero(t *testing.T) { + tests := []struct { + arg Signature + want bool + }{ + {arg: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, want: true}, + {arg: Signature{V: nil, R: nil, S: nil}, want: true}, + {arg: Signature{V: nil, R: big.NewInt(0), S: big.NewInt(0)}, want: true}, + {arg: Signature{V: big.NewInt(0), R: nil, S: nil}, want: true}, + {arg: Signature{V: big.NewInt(0), R: big.NewInt(0), S: nil}, want: true}, + {arg: Signature{V: big.NewInt(1), R: big.NewInt(0), S: big.NewInt(0)}, want: false}, + {arg: Signature{V: big.NewInt(0), R: big.NewInt(1), S: big.NewInt(0)}, want: false}, + {arg: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(1)}, want: false}, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.IsZero()) + }) + } +} + +func Test_SignatureType_Equal(t *testing.T) { + tests := []struct { + arg1 Signature + arg2 Signature + want bool + }{ + { + arg1: Signature{V: big.NewInt(1), R: big.NewInt(2), S: big.NewInt(3)}, + arg2: Signature{V: big.NewInt(1), R: big.NewInt(2), S: big.NewInt(3)}, + want: true, + }, + { + arg1: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, + arg2: Signature{V: nil, R: nil, S: nil}, + want: true, + }, + { + arg1: Signature{V: big.NewInt(1), R: big.NewInt(2), S: big.NewInt(3)}, + arg2: Signature{V: big.NewInt(1), R: big.NewInt(2), S: big.NewInt(4)}, + want: false, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg1.Equal(tt.arg2)) + }) + } +} + +func Test_SignatureType_MarshalJSON(t *testing.T) { + tests := []struct { + arg Signature + want string + }{ + { + arg: testSignature, + want: `"0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325"`, + }, + { + arg: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, + want: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, + }, + { + arg: Signature{V: nil, R: nil, S: nil}, + want: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + jsonBytes, err := tt.arg.MarshalJSON() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(jsonBytes)) + }) + } +} + +func Test_SignatureType_UnmarshalJSON(t *testing.T) { + tests := []struct { + arg string + want Signature + wantErr bool + }{ + { + arg: `"0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325"`, + want: testSignature, + }, + { + arg: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, + want: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, + wantErr: false, + }, + { + arg: `0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`, + wantErr: true, + }, + { + arg: `"0x00"`, + wantErr: true, + }, + { + arg: `"invalid"`, + wantErr: true, + }, + { + arg: `"""`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var sig Signature + err := sig.UnmarshalJSON([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.True(t, tt.want.Equal(sig)) + } + }) + } +} + +func Test_SignatureType_MarshalText(t *testing.T) { + tests := []struct { + arg Signature + want string + }{ + { + arg: testSignature, + want: `0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325`, + }, + { + arg: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, + want: `0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + textBytes, err := tt.arg.MarshalText() + assert.NoError(t, err) + assert.Equal(t, tt.want, string(textBytes)) + }) + } +} + +func Test_SignatureType_UnmarshalText(t *testing.T) { + tests := []struct { + arg string + want Signature + wantErr bool + }{ + { + arg: `0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa63627667cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d8325`, + want: testSignature, + }, + { + arg: `0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000`, + want: Signature{V: big.NewInt(0), R: big.NewInt(0), S: big.NewInt(0)}, + wantErr: false, + }, + { + arg: `"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"`, + wantErr: true, + }, + { + arg: `0x00`, + wantErr: true, + }, + { + arg: `invalid`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var sig Signature + err := sig.UnmarshalText([]byte(tt.arg)) + if tt.wantErr { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.True(t, tt.want.Equal(sig)) + } + }) + } +} + +func Test_NumberFromHex(t *testing.T) { + tests := []struct { + arg string + want Number + wantErr bool + }{ + { + arg: "0x0", + want: Number{x: *big.NewInt(0)}, + }, + { + arg: "0x10", + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: "0", + want: Number{x: *big.NewInt(0)}, + }, + { + arg: "10", + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: "-0x10", + want: Number{x: *big.NewInt(-0x10)}, + }, + { + arg: "-10", + want: Number{x: *big.NewInt(-0x10)}, + }, + { + arg: "invalid", + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + got, err := NumberFromHex(tt.arg) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_NumberType_Big(t *testing.T) { + tests := []struct { + arg Number + want *big.Int + }{ + { + arg: Number{x: *big.NewInt(0)}, + want: big.NewInt(0), + }, + { + arg: Number{x: *big.NewInt(0x10)}, + want: big.NewInt(0x10), + }, + { + arg: Number{x: *big.NewInt(-0x10)}, + want: big.NewInt(-0x10), + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want.Cmp(tt.arg.Big()), 0) + }) + } +} + +func Test_NumberType_String(t *testing.T) { + tests := []struct { + arg Number + want string + }{ + { + arg: Number{x: *big.NewInt(0)}, + want: "0x0", + }, + { + arg: Number{x: *big.NewInt(0x10)}, + want: "0x10", + }, + { + arg: Number{x: *big.NewInt(-0x10)}, + want: "-0x10", + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.String()) + }) + } +} + +func Test_NumberType_Bytes(t *testing.T) { + tests := []struct { + arg Number + want []byte + }{ + { + arg: Number{x: *big.NewInt(0)}, + want: []byte{}, + }, + { + arg: Number{x: *big.NewInt(0x10)}, + want: []byte{0x10}, + }, + { + arg: Number{x: *big.NewInt(-0x10)}, + want: []byte{0x10}, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.Bytes()) + }) + } +} + +func Test_NumberType_MarshalJSON(t *testing.T) { + tests := []struct { + arg Number + want string + }{ + { + arg: Number{x: *big.NewInt(0)}, + want: `"0x0"`, + }, + { + arg: Number{x: *big.NewInt(0x10)}, + want: `"0x10"`, + }, + { + arg: Number{x: *big.NewInt(-0x10)}, + want: `"-0x10"`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + got, err := tt.arg.MarshalJSON() + require.NoError(t, err) + assert.Equal(t, tt.want, string(got)) + }) + } +} + +func Test_NumberType_UnmarshalJSON(t *testing.T) { + tests := []struct { + arg string + want Number + wantErr bool + }{ + { + arg: `"0x0"`, + want: Number{x: *big.NewInt(0)}, + }, + { + arg: `"0x10"`, + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: `"-10"`, + want: Number{x: *big.NewInt(-0x10)}, + }, + { + arg: `"10"`, + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: `0x10"`, + wantErr: true, + }, + { + arg: `10"`, + wantErr: true, + }, + { + arg: `"invalid"`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var got Number + err := got.UnmarshalJSON([]byte(tt.arg)) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_NumberType_MarshalText(t *testing.T) { + tests := []struct { + arg Number + want string + }{ + { + arg: Number{x: *big.NewInt(0)}, + want: `0x0`, + }, + { + arg: Number{x: *big.NewInt(0x10)}, + want: `0x10`, + }, + { + arg: Number{x: *big.NewInt(-0x10)}, + want: `-0x10`, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + textBytes, err := tt.arg.MarshalText() + require.NoError(t, err) + assert.Equal(t, tt.want, string(textBytes)) + }) + } +} + +func Test_NumberType_UnmarshalText(t *testing.T) { + tests := []struct { + arg string + want Number + wantErr bool + }{ + { + arg: `0x0`, + want: Number{x: *big.NewInt(0)}, + }, + { + arg: `0x10`, + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: `-10`, + want: Number{x: *big.NewInt(-0x10)}, + }, + { + arg: `10`, + want: Number{x: *big.NewInt(0x10)}, + }, + { + arg: `"0x10"`, + wantErr: true, + }, + { + arg: `"10"`, + wantErr: true, + }, + { + arg: `invalid`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var got Number + err := got.UnmarshalText([]byte(tt.arg)) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_BytesFromHex(t *testing.T) { + tests := []struct { + arg string + want Bytes + wantErr bool + }{ + { + arg: "0x00112233", + want: Bytes{0x00, 0x11, 0x22, 0x33}, + }, + { + arg: "0x00112233", + want: Bytes{0x00, 0x11, 0x22, 0x33}, + }, + { + arg: "invalid", + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + got, err := BytesFromHex(tt.arg) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, got) + } + }) + } +} + +func Test_Bytes_PadLeft(t *testing.T) { + tests := []struct { + arg Bytes + len int + want Bytes + }{ + { + arg: Bytes{0x01, 0x02}, + len: 0, + want: Bytes{}, + }, + { + arg: Bytes{0x01, 0x02}, + len: 1, + want: Bytes{0x02}, + }, + { + arg: Bytes{0x01, 0x02}, + len: 4, + want: Bytes{0x00, 0x00, 0x01, 0x02}, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.PadLeft(tt.len)) + }) + } +} + +func Test_Bytes_PadRight(t *testing.T) { + tests := []struct { + arg Bytes + len int + want Bytes + }{ + { + arg: Bytes{0x01, 0x02}, + len: 0, + want: Bytes{}, + }, + { + arg: Bytes{0x01, 0x02}, + len: 1, + want: Bytes{0x01}, + }, + { + arg: Bytes{0x01, 0x02}, + len: 4, + want: Bytes{0x01, 0x02, 0x00, 0x00}, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + assert.Equal(t, tt.want, tt.arg.PadRight(tt.len)) + }) + } +} + +func Test_Bytes_Bytes(t *testing.T) { + b := Bytes{0x01, 0x02, 0x03} + assert.Equal(t, []byte{0x01, 0x02, 0x03}, b.Bytes()) +} + +func Test_Bytes_String(t *testing.T) { + b := Bytes{0x01, 0x02, 0x03} + assert.Equal(t, "0x010203", b.String()) +} + +func Test_Bytes_MarshalJSON(t *testing.T) { + b := Bytes{0x01, 0x02, 0x03} + data, err := b.MarshalJSON() + require.NoError(t, err) + assert.Equal(t, `"0x010203"`, string(data)) +} + +func Test_Bytes_UnmarshalJSON(t *testing.T) { + tests := []struct { + arg string + want Bytes + wantErr bool + }{ + { + arg: `"0x010203"`, + want: Bytes{0x01, 0x02, 0x03}, + }, + { + arg: `"010203"`, + want: Bytes{0x01, 0x02, 0x03}, + }, + { + arg: `0x010203`, + wantErr: true, + }, + { + arg: `"invalid"`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var b Bytes + err := b.UnmarshalJSON([]byte(tt.arg)) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, b) + } + }) + } +} + +func Test_Bytes_MarshalText(t *testing.T) { + b := Bytes{0x01, 0x02, 0x03} + data, err := b.MarshalText() + require.NoError(t, err) + assert.Equal(t, "0x010203", string(data)) +} + +func Test_Bytes_UnmarshalText(t *testing.T) { + tests := []struct { + arg string + want Bytes + wantErr bool + }{ + { + arg: `0x010203`, + want: Bytes{0x01, 0x02, 0x03}, + }, + { + arg: `010203`, + want: Bytes{0x01, 0x02, 0x03}, + }, + { + arg: `"0x010203"`, + wantErr: true, + }, + { + arg: `invalid`, + wantErr: true, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + var b Bytes + err := b.UnmarshalText([]byte(tt.arg)) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + assert.Equal(t, tt.want, b) + } + }) + } +} diff --git a/types/util.go b/types/util.go index be4bc76..080577f 100644 --- a/types/util.go +++ b/types/util.go @@ -32,7 +32,11 @@ func bytesUnmarshalJSON(input []byte, output *[]byte) error { if bytes.Equal(input, []byte("null")) { return nil } - return bytesUnmarshalText(naiveUnquote(input), output) + input, ok := naiveUnquote(input) + if !ok { + return fmt.Errorf("invalid JSON string: %s", input) + } + return bytesUnmarshalText(input, output) } // bytesUnmarshalText decodes the given string where each byte is represented by @@ -51,7 +55,11 @@ func fixedBytesUnmarshalJSON(input, output []byte) error { if bytes.Equal(input, []byte("null")) { return nil } - return fixedBytesUnmarshalText(naiveUnquote(input), output) + input, ok := naiveUnquote(input) + if !ok { + return fmt.Errorf("invalid JSON string: %s", input) + } + return fixedBytesUnmarshalText(input, output) } // fixedBytesUnmarshalText works like bytesUnmarshalText, but it is designed to @@ -69,6 +77,24 @@ func fixedBytesUnmarshalText(input, output []byte) error { return nil } +// fixedBytesDecodeRLP decodes the given RLP encoded data into the given byte +// slice. The input data must be exactly the same length as the output slice. +func fixedBytesDecodeRLP(input []byte, output []byte) (int, error) { + r, n, err := rlp.DecodeLazy(input) + if err != nil { + return n, err + } + b, err := r.Bytes() + if err != nil { + return n, err + } + if len(b) != len(output) { + return n, fmt.Errorf("invalid length %d", len(b)) + } + copy(output, b) + return n, nil +} + // numberMarshalJSON encodes the given big integer as JSON string where number // is resented in hexadecimal format. The hex string is prefixed with "0x". // Negative numbers are prefixed with "-0x". @@ -87,7 +113,11 @@ func numberMarshalText(input *big.Int) []byte { // hexadecimal format. The hex string may be prefixed with "0x". Negative numbers // must start with minus sign. func numberUnmarshalJSON(input []byte, output *big.Int) error { - return numberUnmarshalText(naiveUnquote(input), output) + input, ok := naiveUnquote(input) + if !ok { + return fmt.Errorf("invalid JSON string: %s", input) + } + return numberUnmarshalText(input, output) } // numberUnmarshalText decodes the given string where number is resented in @@ -117,12 +147,9 @@ func marshalJSONInline(vs ...any) ([]byte, error) { if err != nil { return nil, err } - if len(b) > 0 && b[0] != '{' && b[len(b)-1] != '}' { + if len(b) < 2 || (b[0] != '{' && b[len(b)-1] != '}') { return nil, fmt.Errorf("expected JSON object, got %s", b) } - if len(b) <= 2 { - continue - } if comma { comma = false buf.WriteByte(',') @@ -145,33 +172,15 @@ func naiveQuote(i []byte) []byte { // naiveUnquote returns the string inside the quotes. It does not perform any // unescaping. -func naiveUnquote(i []byte) []byte { +func naiveUnquote(i []byte) ([]byte, bool) { if len(i) >= 2 && i[0] == '"' && i[len(i)-1] == '"' { - return i[1 : len(i)-1] - } - return i -} - -func fixedBytesEncodeRLP(input []byte) ([]byte, error) { - return rlp.Encode(rlp.Bytes(input)) -} - -func fixedBytesDecodeRLP(input []byte, output []byte) (int, error) { - r, n, err := rlp.DecodeLazy(input) - if err != nil { - return n, err + return i[1 : len(i)-1], true } - b, err := r.Bytes() - if err != nil { - return n, err - } - if len(b) != len(output) { - return n, fmt.Errorf("invalid length %d", len(b)) - } - copy(output, b) - return n, nil + return i, false } +// copyPtr copies the value of the given pointer and returns a new pointer to +// it. If the given pointer is nil, it returns nil. func copyPtr[T any](p *T) *T { if p == nil { return nil @@ -180,6 +189,8 @@ func copyPtr[T any](p *T) *T { return &c } +// copyBytes copies the given byte slice and returns a new slice. If the given +// slice is nil, it returns nil. func copyBytes(p []byte) []byte { if p == nil { return nil @@ -189,6 +200,8 @@ func copyBytes(p []byte) []byte { return c } +// copyBigInt copies the given big integer and returns a new big integer. If the +// given big integer is nil, it returns nil. func copyBigInt(p *big.Int) *big.Int { if p == nil { return nil diff --git a/types/util_test.go b/types/util_test.go index 580d1c8..983bbd5 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -1,5 +1,58 @@ package types +import ( + "reflect" + "testing" + + "github.com/stretchr/testify/assert" +) + +func assertEqualTX(t *testing.T, actual, expected Transaction) { + assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) + assert.Equal(t, actual.TransactionData(), expected.TransactionData()) + if _, ok := expected.(CallData); ok { + assert.Equal(t, actual.(CallData).CallData(), actual.(CallData).CallData()) + } + if _, ok := actual.(LegacyPriceData); ok { + assert.Equal(t, expected.(LegacyPriceData).LegacyPriceData(), actual.(LegacyPriceData).LegacyPriceData()) + } + if _, ok := actual.(AccessListData); ok { + assert.Equal(t, expected.(AccessListData).AccessListData(), actual.(AccessListData).AccessListData()) + } + if _, ok := actual.(DynamicFeeData); ok { + assert.Equal(t, expected.(DynamicFeeData).DynamicFeeData(), actual.(DynamicFeeData).DynamicFeeData()) + } + if _, ok := actual.(BlobData); ok { + assert.Equal(t, expected.(BlobData).BlobData(), actual.(BlobData).BlobData()) + } +} + +func assertEqualCall(t *testing.T, actual, expected Call) { + assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) + if _, ok := expected.(CallData); ok { + assert.Equal(t, actual.(CallData).CallData(), actual.(CallData).CallData()) + } + if _, ok := actual.(LegacyPriceData); ok { + assert.Equal(t, expected.(LegacyPriceData).LegacyPriceData(), actual.(LegacyPriceData).LegacyPriceData()) + } + if _, ok := actual.(AccessListData); ok { + assert.Equal(t, expected.(AccessListData).AccessListData(), actual.(AccessListData).AccessListData()) + } + if _, ok := actual.(DynamicFeeData); ok { + assert.Equal(t, expected.(DynamicFeeData).DynamicFeeData(), actual.(DynamicFeeData).DynamicFeeData()) + } + if _, ok := actual.(BlobData); ok { + assert.Equal(t, expected.(BlobData).BlobData(), actual.(BlobData).BlobData()) + } +} + +func deref(t reflect.Type) reflect.Type { + for t.Kind() == reflect.Ptr || t.Kind() == reflect.Interface { + t = t.Elem() + } + return t +} + func ptr[T any](x T) *T { return &x } diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index 708d24c..fecc204 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -21,7 +21,7 @@ type RPCSigningClient interface { type KeyRPC struct { client RPCSigningClient address types.Address - decoder types.RPCTransactionDecoder + decoder types.RLPTransactionDecoder } // NewKeyRPC returns a new KeyRPC. @@ -53,7 +53,7 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro if err != nil { return fmt.Errorf("failed to decode signed transaction: %w", err) } - tx.SetTransactionData(stx.TransactionData()) + tx.SetTransactionData(*stx.TransactionData()) addr, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("failed to verify signed transaction: %w", err) From df9a87b71ddacbc7c729d140db89cde94a5ff7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 5 Aug 2025 01:20:06 +0200 Subject: [PATCH 10/44] Refactor pkgs, add tests --- crypto/crypto.go | 29 +- crypto/ecdsa/ecdsa.go | 75 +++-- crypto/ecdsa/ecdsa_test.go | 245 ++------------ crypto/keccak/keccak.go | 7 +- crypto/keccak/keccak_test.go | 6 +- crypto/kzg4844/kzg4844.go | 26 +- crypto/kzg4844/kzg4844_test.go | 93 ++++++ crypto/txsign/txsign.go | 18 +- crypto/txsign/txsing_test.go | 96 ++++++ hexutil/hexutil.go | 24 +- hexutil/hexutil_test.go | 20 +- rpc/client.go | 8 +- rpc/hijack_address.go | 40 +-- rpc/hijack_address_test.go | 50 ++- rpc/hijack_chainid.go | 42 ++- rpc/hijack_chainid_test.go | 104 +++--- rpc/hijack_error.go | 1 + rpc/hijack_gasfee.go | 138 ++++---- rpc/hijack_gasfee_test.go | 67 ++-- rpc/hijack_gaslimit.go | 58 ++-- rpc/hijack_gaslimit_test.go | 20 +- rpc/hijack_nonce.go | 61 ++-- rpc/hijack_nonce_test.go | 48 +-- rpc/hijack_sign.go | 5 +- rpc/hijack_sign_test.go | 33 +- rpc/hijack_simulate.go | 54 ++-- rpc/hijack_simulate_test.go | 30 +- rpc/hijack_util.go | 108 ------- rpc/methods_client_test.go | 54 +++- rpc/methods_common_test.go | 408 +++++++++++++++--------- rpc/methods_filter_test.go | 253 ++++++++++++++- rpc/methods_privatetransactions_test.go | 94 ++++++ rpc/methods_wallet_test.go | 202 ++++++++++++ rpc/rpc.go | 3 + rpc/transport/combined.go | 14 +- rpc/transport/error_test.go | 50 --- rpc/transport/hijack.go | 99 +++--- rpc/transport/hijack_test.go | 169 ++++++++++ rpc/transport/http.go | 8 +- rpc/transport/http_test.go | 4 +- rpc/transport/ipc.go | 6 +- rpc/transport/multiplex.go | 71 ----- rpc/transport/retry.go | 42 +-- rpc/transport/retry_test.go | 128 +++----- rpc/transport/router.go | 45 --- rpc/transport/stream.go | 28 +- rpc/transport/transport.go | 12 +- rpc/transport/transport_test.go | 39 +++ rpc/transport/websocket.go | 28 +- rpc/transport/websocket_nowasm.go | 55 ---- rpc/transport/websocket_test.go | 6 +- rpc/util.go | 130 +++++++- types/call.go | 36 +-- types/call_accesslist.go | 24 +- types/call_accesslist_test.go | 6 +- types/call_basic.go | 40 +++ types/call_blob.go | 32 +- types/call_blob_test.go | 16 +- types/call_dynamicfee.go | 24 +- types/call_dynamicfee_test.go | 6 +- types/call_legacy.go | 16 +- types/call_legacy_test.go | 4 +- types/embed.go | 196 ++++++------ types/embed_test.go | 66 ++-- types/structs.go | 2 +- types/structs_test.go | 6 +- types/tx.go | 2 +- types/tx_accesslist.go | 28 +- types/tx_accesslist_test.go | 24 +- types/tx_blob.go | 28 +- types/tx_blob_test.go | 66 ++-- types/tx_decoder.go | 4 +- types/tx_decoder_test.go | 76 ++--- types/tx_dynamicfee.go | 20 +- types/tx_dynamicfee_test.go | 30 +- types/tx_legacy.go | 16 +- types/tx_legacy_test.go | 36 +-- types/types.go | 35 ++ types/util.go | 15 +- types/util_test.go | 42 +-- wallet/key_hd.go | 4 +- wallet/key_json_v3.go | 4 +- wallet/key_priv.go | 7 +- wallet/key_rpc.go | 2 +- 84 files changed, 2521 insertions(+), 1846 deletions(-) create mode 100644 crypto/kzg4844/kzg4844_test.go create mode 100644 crypto/txsign/txsing_test.go delete mode 100644 rpc/hijack_util.go create mode 100644 rpc/methods_privatetransactions_test.go create mode 100644 rpc/methods_wallet_test.go create mode 100644 rpc/rpc.go delete mode 100644 rpc/transport/error_test.go create mode 100644 rpc/transport/hijack_test.go delete mode 100644 rpc/transport/multiplex.go delete mode 100644 rpc/transport/router.go create mode 100644 rpc/transport/transport_test.go delete mode 100644 rpc/transport/websocket_nowasm.go create mode 100644 types/call_basic.go diff --git a/crypto/crypto.go b/crypto/crypto.go index 33e07d6..e40e334 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -1,3 +1,4 @@ +// Package crypto provides default implementations of cryptographic functions. package crypto import ( @@ -6,18 +7,20 @@ import ( "github.com/defiweb/go-eth/crypto/kzg4844" ) -// Default implementations of the crypto functions. +// Default implementations of the crypto functions. Can be overridden to use +// alternative implementations. var ( - Keccak256 = keccak.Hash256 - ECPublicKeyToAddress = ecdsa.PublicKeyToAddress - ECSignHash = ecdsa.SignHash - ECRecoverHash = ecdsa.RecoverHash - ECSignMessage = ecdsa.SignMessage - ECRecoverMessage = ecdsa.RecoverMessage - KZGBlobToCommitment = kzg4844.BlobToCommitment - KZGComputeProof = kzg4844.ComputeProof - KZGVerifyProof = kzg4844.VerifyProof - KZGComputeBlobProof = kzg4844.ComputeBlobProof - KZGVerifyBlobProof = kzg4844.VerifyBlobProof - KZGComputeBlobHashV1 = kzg4844.ComputeBlobHashV1 + Keccak256 = keccak.Keccak256 + ECPublicKeyToAddress = ecdsa.PublicKeyToAddress + ECPrivateKeyToPublicKey = ecdsa.PrivateKeyToPublicKey + ECSignHash = ecdsa.SignHash + ECRecoverHash = ecdsa.RecoverHash + ECSignMessage = ecdsa.SignMessage + ECRecoverMessage = ecdsa.RecoverMessage + KZGBlobToCommitment = kzg4844.BlobToCommitment + KZGComputeProof = kzg4844.ComputeProof + KZGVerifyProof = kzg4844.VerifyProof + KZGComputeBlobProof = kzg4844.ComputeBlobProof + KZGVerifyBlobProof = kzg4844.VerifyBlobProof + KZGComputeBlobHashV1 = kzg4844.ComputeBlobHashV1 ) diff --git a/crypto/ecdsa/ecdsa.go b/crypto/ecdsa/ecdsa.go index 245e805..aba0fe8 100644 --- a/crypto/ecdsa/ecdsa.go +++ b/crypto/ecdsa/ecdsa.go @@ -1,3 +1,4 @@ +// Package ecdsa provides ECDSA cryptographic functionality for Ethereum. package ecdsa import ( @@ -15,33 +16,35 @@ import ( ) // PublicKey is an ECDSA public key. -type PublicKey = ecdsa.PublicKey +type PublicKey struct { + X *big.Int + Y *big.Int +} // PrivateKey is an ECDSA private key. -type PrivateKey = ecdsa.PrivateKey - -// Hash is a 32-byte hash. -// -// This type is used in ECDSA cryptographic operations. For most use cases, the -// Hash type from the types package should be used instead. -type Hash [32]byte - -// Address is a 20-byte Ethereum address. -// -// This type is used in ECDSA cryptographic operations. For most use cases, the -// Address type from the types package should be used instead. -type Address [20]byte +type PrivateKey struct { + D *big.Int +} // Signature is an ECDSA signature. // -// This type is used in ECDSA cryptographic operations. For most use cases, the -// Signature type from the types package should be used instead. +// For most use cases, the [types.Signature] type should be used instead. type Signature struct { V *big.Int R *big.Int S *big.Int } +// Hash is a 32-byte hash. +// +// For most use cases, the [types.Hash] type should be used instead. +type Hash [32]byte + +// Address is a 20-byte Ethereum address. +// +// For most use cases, the [types.Address] type should be used instead. +type Address [20]byte + var s256 = btcec.S256() // AddMessagePrefix adds the Ethereum message prefix to the given data as @@ -52,16 +55,35 @@ func AddMessagePrefix(data []byte) []byte { // GenerateKey generates a new ECDSA private key. func GenerateKey() (*PrivateKey, error) { - return ecdsa.GenerateKey(s256, rand.Reader) + pk, err := ecdsa.GenerateKey(s256, rand.Reader) + if err != nil { + return nil, fmt.Errorf("failed to generate ECDSA key: %w", err) + } + return &PrivateKey{D: pk.D}, nil } -// PublicKeyToAddress returns the Ethereum address for the given ECDSA public key. +// PublicKeyToAddress returns the Ethereum address for the given ECDSA +// public key. func PublicKeyToAddress(publicKey *PublicKey) (addr Address) { - h := keccak.Hash256(elliptic.Marshal(s256, publicKey.X, publicKey.Y)[1:]) + h := keccak.Keccak256(elliptic.Marshal(s256, publicKey.X, publicKey.Y)[1:]) copy(addr[:], h[12:]) return } +// PrivateKeyToPublicKey converts a private key to a public key. +// If the private key is nil, it returns nil. +func PrivateKeyToPublicKey(privateKey *PrivateKey) *PublicKey { + if privateKey == nil { + return nil + } + privKey, _ := btcec.PrivKeyFromBytes(privateKey.D.Bytes()) + pubKey := privKey.PubKey() + return &PublicKey{ + X: pubKey.X(), + Y: pubKey.Y(), + } +} + // SignHash signs the given hash with the given private key. func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { if privateKey == nil { @@ -86,7 +108,8 @@ func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { }, nil } -// RecoverHash recovers the Ethereum address from the given hash and signature. +// RecoverHash recovers the Ethereum address from the given hash and +// signature. func RecoverHash(hash Hash, signature Signature) (*Address, error) { if signature.V.BitLen() > 8 { return nil, errors.New("invalid signature: V has more than 8 bits") @@ -112,7 +135,10 @@ func RecoverHash(hash Hash, signature Signature) (*Address, error) { if err != nil { return nil, err } - addr := PublicKeyToAddress(pub.ToECDSA()) + addr := PublicKeyToAddress(&PublicKey{ + X: pub.X(), + Y: pub.Y(), + }) return &addr, nil } @@ -121,7 +147,7 @@ func SignMessage(key *PrivateKey, data []byte) (*Signature, error) { if key == nil { return nil, fmt.Errorf("missing private key") } - sig, err := SignHash(key, Hash(keccak.Hash256(AddMessagePrefix(data)))) + sig, err := SignHash(key, Hash(keccak.Keccak256(AddMessagePrefix(data)))) if err != nil { return nil, err } @@ -129,8 +155,9 @@ func SignMessage(key *PrivateKey, data []byte) (*Signature, error) { return sig, nil } -// RecoverMessage recovers the Ethereum address from the given message and signature. +// RecoverMessage recovers the Ethereum address from the given message and +// signature. func RecoverMessage(data []byte, sig Signature) (*Address, error) { sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) - return RecoverHash(Hash(keccak.Hash256(AddMessagePrefix(data))), sig) + return RecoverHash(Hash(keccak.Keccak256(AddMessagePrefix(data))), sig) } diff --git a/crypto/ecdsa/ecdsa_test.go b/crypto/ecdsa/ecdsa_test.go index 0ab817c..0726578 100644 --- a/crypto/ecdsa/ecdsa_test.go +++ b/crypto/ecdsa/ecdsa_test.go @@ -2,7 +2,6 @@ package ecdsa import ( "bytes" - "math/big" "testing" "github.com/btcsuite/btcd/btcec/v2" @@ -10,12 +9,13 @@ import ( "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/hexutil" - "github.com/defiweb/go-eth/types" ) -func Test_ecSignHash(t *testing.T) { +func TestSignHash(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - signature, err := ecSignHash(key.ToECDSA(), types.MustHashFromBytes(bytes.Repeat([]byte{0x02}, 32), types.PadNone)) + hash := Hash{} + copy(hash[:], bytes.Repeat([]byte{0x02}, 32)) + signature, err := SignHash(&PrivateKey{D: key.ToECDSA().D}, hash) require.NoError(t, err) require.NotNil(t, signature) @@ -24,9 +24,9 @@ func Test_ecSignHash(t *testing.T) { assert.Equal(t, "4870ca05940199c113b4dc77866f001702691cde269f6835581e7aea1ead2660", signature.S.Text(16)) } -func Test_ecSignMessage(t *testing.T) { +func TestSignMessage(t *testing.T) { key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - signature, err := ecSignMessage(key.ToECDSA(), []byte("hello world")) + signature, err := SignMessage(&PrivateKey{D: key.ToECDSA().D}, []byte("hello world")) require.NoError(t, err) require.NotNil(t, signature) @@ -35,221 +35,38 @@ func Test_ecSignMessage(t *testing.T) { assert.Equal(t, "51601fe3219055482c45a14bf616c3e2bc7914c953f438627de2aa541eef61b5", signature.S.Text(16)) } -//nolint:funlen -func Test_ecSignTransaction(t *testing.T) { - t.Run("legacy", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := types.NewTransactionLegacy() - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - err := ecSignTransaction(key.ToECDSA(), tx) - - require.NoError(t, err) - assert.Equal(t, "1b", tx.Signature.V.Text(16)) - assert.Equal(t, "2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470", tx.Signature.R.Text(16)) - assert.Equal(t, "615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537", tx.Signature.S.Text(16)) - }) - t.Run("legacy-eip155", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := types.NewTransactionLegacy() - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - tx.SetChainID(1337) - err := ecSignTransaction(key.ToECDSA(), tx) - - require.NoError(t, err) - assert.Equal(t, "a95", tx.Signature.V.Text(16)) - assert.Equal(t, "14702a15dd7739397f25e3902a0c2bf6989e93888201139aac2c67a8f33a2f3f", tx.Signature.R.Text(16)) - assert.Equal(t, "4a10ba6cf47ace7e3c847e38583f5b1e1c7d8a862f4b43cd74480a03007363f7", tx.Signature.S.Text(16)) - }) - t.Run("access-list", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := types.NewTransactionAccessList() - tx.SetChainID(1) - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - err := ecSignTransaction(key.ToECDSA(), tx) - - require.NoError(t, err) - assert.Equal(t, "1", tx.Signature.V.Text(16)) - assert.Equal(t, "dc1fcd0c6f56eddc8dbe70635690cce521276b8a6e167f8e57e4064db8a5738e", tx.Signature.R.Text(16)) - assert.Equal(t, "2743f261c001ee472c9664258708eaf849fc85623ee337d2018d37fc6f397d8c", tx.Signature.S.Text(16)) - }) - t.Run("dynamic-fee", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - tx := types.NewTransactionDynamicFee() - tx.SetChainID(1) - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetMaxFeePerGas(big.NewInt(20000000000)) - tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - err := ecSignTransaction(key.ToECDSA(), tx) - - require.NoError(t, err) - assert.Equal(t, "0", tx.Signature.V.Text(16)) - assert.Equal(t, "62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152", tx.Signature.R.Text(16)) - assert.Equal(t, "57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572", tx.Signature.S.Text(16)) - }) -} - -func Test_ecRecoverHash(t *testing.T) { - addr, err := ecRecoverHash( - types.MustHashFromBytes(bytes.Repeat([]byte{0x02}, 32), types.PadNone), - types.SignatureFromVRS( - hexutil.MustHexToBigInt("1b"), - hexutil.MustHexToBigInt("97ef30233ead25d10f7bb2bf9eaf571a16f2deb33a75f20819284f0cb8ff3cc1"), - hexutil.MustHexToBigInt("4870ca05940199c113b4dc77866f001702691cde269f6835581e7aea1ead2660"), - ), - ) +func TestRecoverHash(t *testing.T) { + hash := Hash{} + copy(hash[:], bytes.Repeat([]byte{0x02}, 32)) + signature := Signature{ + V: hexutil.MustHexToBigInt("1b"), + R: hexutil.MustHexToBigInt("97ef30233ead25d10f7bb2bf9eaf571a16f2deb33a75f20819284f0cb8ff3cc1"), + S: hexutil.MustHexToBigInt("4870ca05940199c113b4dc77866f001702691cde269f6835581e7aea1ead2660"), + } + addr, err := RecoverHash(hash, signature) require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) + require.NotNil(t, addr) + assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", hexutil.BytesToHex(addr[:])) } -func Test_ecRecoverMessage(t *testing.T) { - addr, err := ecRecoverMessage( - []byte("hello world"), - types.SignatureFromVRS( - hexutil.MustHexToBigInt("1b"), - hexutil.MustHexToBigInt("f2b67e452d18ce781203f10380ea5a2726494162c49c495069cf99118bcf199"), - hexutil.MustHexToBigInt("51601fe3219055482c45a14bf616c3e2bc7914c953f438627de2aa541eef61b5"), - ), - ) +func TestRecoverMessage(t *testing.T) { + signature := Signature{ + V: hexutil.MustHexToBigInt("1b"), + R: hexutil.MustHexToBigInt("f2b67e452d18ce781203f10380ea5a2726494162c49c495069cf99118bcf199"), + S: hexutil.MustHexToBigInt("51601fe3219055482c45a14bf616c3e2bc7914c953f438627de2aa541eef61b5"), + } + addr, err := RecoverMessage([]byte("hello world"), signature) require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) -} - -func Test_ecRecoverTransaction(t *testing.T) { - t.Run("legacy", func(t *testing.T) { - tx := types.NewTransactionLegacy() - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - tx.SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("1b"), - hexutil.MustHexToBigInt("2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470"), - hexutil.MustHexToBigInt("615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537"), - )) - addr, err := ecRecoverTransaction(tx) - - require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) - }) - t.Run("legacy-eip155", func(t *testing.T) { - tx := types.NewTransactionLegacy() - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - tx.SetChainID(1337) - tx.SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("a95"), - hexutil.MustHexToBigInt("14702a15dd7739397f25e3902a0c2bf6989e93888201139aac2c67a8f33a2f3f"), - hexutil.MustHexToBigInt("4a10ba6cf47ace7e3c847e38583f5b1e1c7d8a862f4b43cd74480a03007363f7"), - )) - addr, err := ecRecoverTransaction(tx) - - require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) - }) - t.Run("access-list", func(t *testing.T) { - tx := types.NewTransactionAccessList() - tx.SetChainID(1) - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetGasPrice(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - tx.SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("1"), - hexutil.MustHexToBigInt("dc1fcd0c6f56eddc8dbe70635690cce521276b8a6e167f8e57e4064db8a5738e"), - hexutil.MustHexToBigInt("2743f261c001ee472c9664258708eaf849fc85623ee337d2018d37fc6f397d8c"), - )) - addr, err := ecRecoverTransaction(tx) - - require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) - }) - t.Run("dynamic-fee", func(t *testing.T) { - tx := types.NewTransactionDynamicFee() - tx.SetChainID(1) - tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) - tx.SetGasLimit(21000) - tx.SetMaxFeePerGas(big.NewInt(20000000000)) - tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) - tx.SetNonce(9) - tx.SetValue(big.NewInt(1000000000000000000)) - tx.SetSignature(types.SignatureFromVRS( - hexutil.MustHexToBigInt("0"), - hexutil.MustHexToBigInt("62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152"), - hexutil.MustHexToBigInt("57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572"), - )) - addr, err := ecRecoverTransaction(tx) - - require.NoError(t, err) - assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) - }) + require.NotNil(t, addr) + assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", hexutil.BytesToHex(addr[:])) } -func Test_fuzzECSignHash(t *testing.T) { - for i := int64(0); i < 1000; i++ { - // Generate a random key. - prv := make([]byte, 32) - new(big.Int).SetInt64(i + 1).FillBytes(prv) - key, _ := btcec.PrivKeyFromBytes(prv) - - // Generate a random hash. - msg := make([]byte, 32) - new(big.Int).SetInt64(i + 1).FillBytes(msg) - - // Sign the hash. - s, err := ecSignHash(key.ToECDSA(), types.MustHashFromBytes(msg, types.PadNone)) - require.NoError(t, err) - - // Recover the address. - addr, err := ecRecoverHash(types.MustHashFromBytes(msg, types.PadNone), *s) - require.NoError(t, err) - - // Check that the address is correct. - require.Equal(t, ECPublicKeyToAddress(key.PubKey().ToECDSA()), *addr) - } -} - -func Test_fuzzECSignMessage(t *testing.T) { - for i := int64(0); i < 1000; i++ { - // Generate a random key. - prv := make([]byte, 32) - new(big.Int).SetInt64(i + 1).FillBytes(prv) - key, _ := btcec.PrivKeyFromBytes(prv) - - // Generate a random hash. - msg := make([]byte, 32) - new(big.Int).SetInt64(i + 1).FillBytes(msg) - - // Sign the hash. - s, err := ecSignMessage(key.ToECDSA(), msg) - require.NoError(t, err) - - // Recover the address. - addr, err := ecRecoverMessage(msg, *s) - require.NoError(t, err) +func TestPublicKeyToAddress(t *testing.T) { + key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) + publicKey := key.PubKey() + addr := PublicKeyToAddress(&PublicKey{publicKey.X(), publicKey.Y()}) - // Check that the address is correct. - require.Equal(t, ECPublicKeyToAddress(key.PubKey().ToECDSA()), *addr) - } + assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", hexutil.BytesToHex(addr[:])) } diff --git a/crypto/keccak/keccak.go b/crypto/keccak/keccak.go index 7412787..7c96523 100644 --- a/crypto/keccak/keccak.go +++ b/crypto/keccak/keccak.go @@ -1,3 +1,4 @@ +// Package keccak provides Keccak-256 hashing functionality. package keccak import ( @@ -6,11 +7,11 @@ import ( // Hash is a 32-byte Keccak256 hash. // -// For most use cases, the Hash type from the types package should be used instead. +// For most use cases, the [types.Hash] type should be used instead. type Hash [32]byte -// Hash256 calculates the Keccak256 hash of the given data. -func Hash256(data ...[]byte) (h Hash) { +// Keccak256 calculates the Keccak256 hash of the given data. +func Keccak256(data ...[]byte) (h Hash) { k := sha3.NewLegacyKeccak256() for _, i := range data { k.Write(i) diff --git a/crypto/keccak/keccak_test.go b/crypto/keccak/keccak_test.go index 9b1052e..9fc307f 100644 --- a/crypto/keccak/keccak_test.go +++ b/crypto/keccak/keccak_test.go @@ -9,7 +9,7 @@ import ( ) func TestKeccak256(t *testing.T) { - tests := []struct { + tc := []struct { data [][]byte want string }{ @@ -26,9 +26,9 @@ func TestKeccak256(t *testing.T) { want: "67fad3bfa1e0321bd021ca805ce14876e50acac8ca8532eda8cbf924da565160", }, } - for n, tt := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - h := Hash256(tt.data...) + h := Keccak256(tt.data...) assert.Equal(t, tt.want, hex.EncodeToString(h[:])) }) } diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index d3652ba..5fa6b96 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -2,19 +2,24 @@ package kzg4844 import ( "crypto/sha256" + "math/big" "sync" kzg4844 "github.com/crate-crypto/go-kzg-4844" ) const ( - BlobLength = 131072 // 128 KiB + ScalarLength = 4096 + ScalarSize = 32 + BlobLength = ScalarLength * ScalarSize // 128 KiB CommitmentLength = 48 ProofLength = 48 PointLength = 32 - ClaimLength = 32 ) +// BLSModulus is the BLS12-381 scalar field modulus. +var BLSModulus = new(big.Int).SetBytes(kzg4844.BlsModulus[:]) + // Blob represents a 4844 data blob. type Blob [BlobLength]byte @@ -27,9 +32,7 @@ type Proof [ProofLength]byte // Point is a BLS field element. type Point [PointLength]byte -// Claim is a claimed evaluation value in a specific point. -type Claim [ClaimLength]byte - +// BlobToCommitment computes the KZG commitment for the given blob. func BlobToCommitment(blob *Blob) (Commitment, error) { initContext() commitment, err := context.BlobToKZGCommitment( @@ -42,7 +45,8 @@ func BlobToCommitment(blob *Blob) (Commitment, error) { return (Commitment)(commitment), nil } -func ComputeProof(blob *Blob, point Point) (Proof, Claim, error) { +// ComputeProof computes the KZG proof and claim for the given blob and point. +func ComputeProof(blob *Blob, point Point) (Proof, Point, error) { initContext() proof, claim, err := context.ComputeKZGProof( (*kzg4844.Blob)(blob), @@ -50,12 +54,14 @@ func ComputeProof(blob *Blob, point Point) (Proof, Claim, error) { 0, ) if err != nil { - return Proof{}, Claim{}, err + return Proof{}, Point{}, err } - return (Proof)(proof), (Claim)(claim), nil + return (Proof)(proof), (Point)(claim), nil } -func VerifyProof(commitment Commitment, point Point, claim Claim, proof Proof) error { +// VerifyProof verifies the KZG proof for the given commitment, point, claim, +// and proof. +func VerifyProof(commitment Commitment, point Point, claim Point, proof Proof) error { initContext() return context.VerifyKZGProof( (kzg4844.KZGCommitment)(commitment), @@ -65,6 +71,7 @@ func VerifyProof(commitment Commitment, point Point, claim Claim, proof Proof) e ) } +// ComputeBlobProof computes the KZG proof for the given blob and commitment. func ComputeBlobProof(blob *Blob, commitment Commitment) (Proof, error) { initContext() proof, err := context.ComputeBlobKZGProof( @@ -78,6 +85,7 @@ func ComputeBlobProof(blob *Blob, commitment Commitment) (Proof, error) { return (Proof)(proof), nil } +// VerifyBlobProof verifies the KZG proof for the given blob, commitment, and proof. func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error { initContext() return context.VerifyBlobKZGProof( diff --git a/crypto/kzg4844/kzg4844_test.go b/crypto/kzg4844/kzg4844_test.go new file mode 100644 index 0000000..d564cfd --- /dev/null +++ b/crypto/kzg4844/kzg4844_test.go @@ -0,0 +1,93 @@ +package kzg4844 + +import ( + "crypto/sha256" + "encoding/hex" + "math/big" + "testing" + + "github.com/defiweb/go-eth/hexutil" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func getRandBlob(seed int64) *Blob { + blob := Blob{} + for i := 0; i < BlobLength; i += ScalarSize { + h := sha256.Sum256([]byte{byte(seed + int64(i))}) + p := new(big.Int).SetBytes(h[:]) + p = p.Mod(p, BLSModulus) + p.FillBytes(blob[i : i+ScalarSize]) + } + return &blob +} + +func getPoint(blob *Blob) (p Point) { + h := sha256.Sum256(blob[:]) + i := new(big.Int).SetBytes(h[:]) + i = i.Mod(i, BLSModulus) + i.FillBytes(p[:]) + return p +} + +func TestVerifyProof(t *testing.T) { + blob := getRandBlob(0) + point := getPoint(blob) + + // Get commitment for the blob. + commitment, err := BlobToCommitment(blob) + require.NoError(t, err) + + // Compute proof and claim. + proof, claim, err := ComputeProof(blob, point) + require.NoError(t, err) + + // Verify the proof. + err = VerifyProof(commitment, point, claim, proof) + assert.NoError(t, err) +} + +func TestBlobVerifyProof(t *testing.T) { + // Create a test blob + blob := getRandBlob(0) + + // Get commitment for the blob. + commitment, err := BlobToCommitment(blob) + require.NoError(t, err) + + // Compute proof. + proof, err := ComputeBlobProof(blob, commitment) + require.NoError(t, err) + + // Verify the proof. + err = VerifyBlobProof(blob, commitment, proof) + assert.NoError(t, err) +} + +func TestComputeBlobHashV1(t *testing.T) { + tc := []struct { + name string + commitment string + wantHash string + }{ + { + name: "zero commitment", + commitment: "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + wantHash: "01b0761f87b081d5cf10757ccc89f12be355c70e2e29df288b65b30710dcbcd1", + }, + { + name: "test commitment", + commitment: "123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0", + wantHash: "012a8194ef18215aa6278923a1b143e6cf3a28087a3d26bcf6f887befc62cb47", + }, + } + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { + var commitment Commitment + copy(commitment[:], hexutil.MustHexToBytes(tt.commitment)) + + hash := ComputeBlobHashV1(commitment) + assert.Equal(t, tt.wantHash, hex.EncodeToString(hash[:])) + }) + } +} diff --git a/crypto/txsign/txsign.go b/crypto/txsign/txsign.go index 555300a..dce0699 100644 --- a/crypto/txsign/txsign.go +++ b/crypto/txsign/txsign.go @@ -1,9 +1,12 @@ +// Package txsign provides transaction signing and address recovery +// functionality for Ethereum transactions. package txsign import ( "fmt" "math/big" + "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/types" ) @@ -13,12 +16,12 @@ func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { if key == nil { return fmt.Errorf("missing private key") } - txd := tx.TransactionData() + txd := tx.GetTransactionData() hash, err := tx.CalculateSigningHash() if err != nil { return err } - sig, err := ecdsa.SignHash(key, ecdsa.Hash(hash)) + sig, err := crypto.ECSignHash(key, ecdsa.Hash(hash)) if err != nil { return err } @@ -32,15 +35,16 @@ func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { } } txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) - if cd, ok := tx.(types.CallData); ok { - cd.CallData().SetFrom(types.Address(ecdsa.PublicKeyToAddress(&key.PublicKey))) + if cd, ok := tx.(types.HasCallData); ok { + cd.GetCallData().SetFrom(types.Address(crypto.ECPublicKeyToAddress(crypto.ECPrivateKeyToPublicKey(key)))) } return nil } -// Recover recovers the Ethereum address from the given transaction. +// Recover recovers the Ethereum address from the given transaction's +// signature. func Recover(tx types.Transaction) (*types.Address, error) { - txd := tx.TransactionData() + txd := tx.GetTransactionData() if txd.Signature == nil { return nil, fmt.Errorf("signature is missing") } @@ -65,7 +69,7 @@ func Recover(tx types.Transaction) (*types.Address, error) { if err != nil { return nil, err } - addr, err := ecdsa.RecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) + addr, err := crypto.ECRecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) if err != nil { return nil, err } diff --git a/crypto/txsign/txsing_test.go b/crypto/txsign/txsing_test.go new file mode 100644 index 0000000..5b3ceec --- /dev/null +++ b/crypto/txsign/txsing_test.go @@ -0,0 +1,96 @@ +package txsign + +import ( + "bytes" + "math/big" + "testing" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestSign(t *testing.T) { + t.Run("legacy", func(t *testing.T) { + key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + + err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) + require.NoError(t, err) + txData := tx.GetTransactionData() + require.NotNil(t, txData.Signature) + assert.Equal(t, "1b", txData.Signature.V.Text(16)) + assert.Equal(t, "2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470", txData.Signature.R.Text(16)) + assert.Equal(t, "615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537", txData.Signature.S.Text(16)) + }) + t.Run("dynamic-fee", func(t *testing.T) { + key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) + tx := types.NewTransactionDynamicFee() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetMaxFeePerGas(big.NewInt(20000000000)) + tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + + err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) + require.NoError(t, err) + txData := tx.GetTransactionData() + require.NotNil(t, txData.Signature) + assert.Equal(t, "0", txData.Signature.V.Text(16)) + assert.Equal(t, "62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152", txData.Signature.R.Text(16)) + assert.Equal(t, "57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572", txData.Signature.S.Text(16)) + }) +} + +func TestRecover(t *testing.T) { + t.Run("legacy", func(t *testing.T) { + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetGasPrice(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + txData := tx.GetTransactionData() + txData.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("1b"), + hexutil.MustHexToBigInt("2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470"), + hexutil.MustHexToBigInt("615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537"), + )) + + addr, err := Recover(tx) + require.NoError(t, err) + require.NotNil(t, addr) + assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) + }) + t.Run("dynamic-fee", func(t *testing.T) { + tx := types.NewTransactionDynamicFee() + tx.SetChainID(1) + tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) + tx.SetGasLimit(21000) + tx.SetMaxFeePerGas(big.NewInt(20000000000)) + tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) + tx.SetNonce(9) + tx.SetValue(big.NewInt(1000000000000000000)) + txData := tx.GetTransactionData() + txData.SetSignature(types.SignatureFromVRS( + hexutil.MustHexToBigInt("0"), + hexutil.MustHexToBigInt("62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152"), + hexutil.MustHexToBigInt("57fd88df7c85076f5729493be7e87f51b618a78bc89441ed741bdfdb9d1d5572"), + )) + + addr, err := Recover(tx) + require.NoError(t, err) + require.NotNil(t, addr) + assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", addr.String()) + }) +} diff --git a/hexutil/hexutil.go b/hexutil/hexutil.go index 6475281..0ed833b 100644 --- a/hexutil/hexutil.go +++ b/hexutil/hexutil.go @@ -1,3 +1,5 @@ +// Package hexutil provides utilities for working with hexadecimal-encoded +// data. package hexutil import ( @@ -6,9 +8,9 @@ import ( "math/big" ) -// BigIntToHex returns the hex representation of the given big integer. -// The hex string is prefixed with "0x". Negative numbers are prefixed with -// "-0x". +// BigIntToHex returns the hex representation of the given [big.Int]. +// The hex string is prefixed with "0x". +// Negative numbers are prefixed with "-0x". func BigIntToHex(x *big.Int) string { if x == nil { return "0x0" @@ -24,7 +26,7 @@ func BigIntToHex(x *big.Int) string { } } -// HexToBigInt returns the big integer representation of the given hex string. +// HexToBigInt returns the [big.Int] representation of the given hex string. // The hex string may be prefixed with "0x". func HexToBigInt(h string) (*big.Int, error) { isNeg := len(h) > 1 && h[0] == '-' @@ -44,6 +46,7 @@ func HexToBigInt(h string) (*big.Int, error) { return x, nil } +// MustHexToBigInt works like [HexToBigInt] but panics on error. func MustHexToBigInt(h string) *big.Int { x, err := HexToBigInt(h) if err != nil { @@ -52,18 +55,18 @@ func MustHexToBigInt(h string) *big.Int { return x } -// BytesToHex returns the hex representation of the given bytes. The hex string -// is always even-length and prefixed with "0x". +// BytesToHex returns the hex representation of the given bytes. +// The hex string is always even-length and prefixed with "0x". func BytesToHex(b []byte) string { r := make([]byte, len(b)*2+2) - copy(r, `0x`) + copy(r, "0x") hex.Encode(r[2:], b) return string(r) } // HexToBytes returns the bytes representation of the given hex string. -// The number of hex digits must be even. The hex string may be prefixed with -// "0x". +// The number of hex digits must be even. +// The hex string may be prefixed with "0x". func HexToBytes(h string) ([]byte, error) { if len(h) == 0 { return []byte{}, nil @@ -83,6 +86,7 @@ func HexToBytes(h string) ([]byte, error) { return hex.DecodeString(h) } +// MustHexToBytes works like [HexToBytes] but panics on error. func MustHexToBytes(h string) []byte { b, err := HexToBytes(h) if err != nil { @@ -91,7 +95,7 @@ func MustHexToBytes(h string) []byte { return b } -// Has0xPrefix returns true if the given byte slice starts with "0x". +// Has0xPrefix returns true if the given string starts with "0x" or "0X". func Has0xPrefix(h string) bool { return len(h) >= 2 && h[0] == '0' && (h[1] == 'x' || h[1] == 'X') } diff --git a/hexutil/hexutil_test.go b/hexutil/hexutil_test.go index bbd4af1..a2ddbf8 100644 --- a/hexutil/hexutil_test.go +++ b/hexutil/hexutil_test.go @@ -9,7 +9,7 @@ import ( ) func TestBigIntToHex(t *testing.T) { - tests := []struct { + tc := []struct { name string input *big.Int expected string @@ -19,8 +19,7 @@ func TestBigIntToHex(t *testing.T) { {"positive value", big.NewInt(26), "0x1a"}, {"negative value", big.NewInt(-26), "-0x1a"}, } - - for _, tt := range tests { + for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { assert.Equal(t, tt.expected, BigIntToHex(tt.input)) }) @@ -28,7 +27,7 @@ func TestBigIntToHex(t *testing.T) { } func TestHexToBigInt(t *testing.T) { - tests := []struct { + tc := []struct { name string input string expected *big.Int @@ -45,8 +44,7 @@ func TestHexToBigInt(t *testing.T) { {"empty string", "", nil, fmt.Errorf("invalid hex string")}, {"invalid hex", "0x1g", nil, fmt.Errorf("invalid hex string")}, } - - for _, tt := range tests { + for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { result, err := HexToBigInt(tt.input) assert.Equal(t, tt.err, err) @@ -56,7 +54,7 @@ func TestHexToBigInt(t *testing.T) { } func TestBytesToHex(t *testing.T) { - tests := []struct { + tc := []struct { name string input []byte expected string @@ -65,8 +63,7 @@ func TestBytesToHex(t *testing.T) { {"non-empty bytes", []byte("abc"), "0x616263"}, {"bytes with zeros", []byte{0, 1, 2}, "0x000102"}, } - - for _, tt := range tests { + for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { assert.Equal(t, tt.expected, BytesToHex(tt.input)) }) @@ -74,7 +71,7 @@ func TestBytesToHex(t *testing.T) { } func TestHexToBytes(t *testing.T) { - tests := []struct { + tc := []struct { name string input string expected []byte @@ -87,8 +84,7 @@ func TestHexToBytes(t *testing.T) { {"single zero", "0", []byte{0}, nil}, {"invalid hex", "0x1", nil, fmt.Errorf("invalid hex string, length must be even")}, } - - for _, tt := range tests { + for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { result, err := HexToBytes(tt.input) assert.Equal(t, tt.err, err) diff --git a/rpc/client.go b/rpc/client.go index a23808a..2c39406 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -23,7 +23,7 @@ type Client struct { type ClientOptionsContext struct { Transport transport.Transport // Transport instance that will be passed to the client. Decoder types.TransactionDecoder // Transaction decoder that will be passed to the client. - Custom map[string]any // Custom data that may be used by client options. + Custom map[any]any // Custom data that may be used by client options. } type ClientOption interface { @@ -365,12 +365,12 @@ func setFields(ctx *ClientOptionsContext, r reflect.Value) { continue } t := f.Type() - switch { - case t == transportTy: + switch t { + case transportTy: if f.CanSet() { f.Set(reflect.ValueOf(ctx.Transport)) } - case t == decoderTy: + case decoderTy: if f.CanSet() { f.Set(reflect.ValueOf(ctx.Decoder)) } diff --git a/rpc/hijack_address.go b/rpc/hijack_address.go index 241c23c..06f1a97 100644 --- a/rpc/hijack_address.go +++ b/rpc/hijack_address.go @@ -2,70 +2,56 @@ package rpc import ( "context" - "fmt" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) -// hijackAddress hijacks "eth_sendTransaction" and "eth_call" methods and -// sets the "from" field. +// hijackAddress hijacks the "eth_sendTransaction", "eth_call" and +// "eth_estimateGas" methods sets the "from" field. type hijackAddress struct { address types.Address replace bool } +// Call implements the [transport.Hijacker] interface. func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { if len(args) == 0 { return next(ctx, t, result, method, args...) } - - var cd *types.CallFields + var cd *types.CallData switch method { case "eth_sendTransaction": - // Verify arguments: tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "address", err: fmt.Errorf("invalid transaction type: %T", args[0])} - } - - // Get transaction call data: - if tx, ok := tx.(types.CallData); ok { - cd = tx.CallData() + return next(ctx, t, result, method, args...) } + cd = getCallData(tx) case "eth_call", "eth_estimateGas": - // Verify arguments: - c, ok := args[0].(types.Call) + call, ok := args[0].(types.Call) if !ok { - return &ErrHijackFailed{name: "address", err: fmt.Errorf("invalid call type: %T", args[0])} - } - - // Get call data: - if c, ok := c.(types.CallData); ok { - cd = c.CallData() + return next(ctx, t, result, method, args...) } + cd = getCallData(call) default: return next(ctx, t, result, method, args...) } - - // If call data is nil or the "from" field is already set, continue: - if cd == nil || (h.replace && cd.From != nil) { - return next(ctx, t, result, method, args...) + if cd != nil && (h.replace || cd.From == nil) { + cd.From = &h.address } - - // Update the "from" field and continue: - cd.From = &h.address return next(ctx, t, result, method, args...) } } } +// Subscribe implements the [transport.Hijacker] interface. func (h *hijackAddress) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } +// Unsubscribe implements the [transport.Hijacker] interface. func (h *hijackAddress) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_address_test.go b/rpc/hijack_address_test.go index b1b8148..55e19cd 100644 --- a/rpc/hijack_address_test.go +++ b/rpc/hijack_address_test.go @@ -2,7 +2,6 @@ package rpc import ( "bytes" - "context" "fmt" "io" "net/http" @@ -16,22 +15,20 @@ import ( ) func TestHijackAddress(t *testing.T) { - tt := []struct { + tc := []struct { name string - chainID *hijackAddress + hijacker *hijackAddress method string args []any request []string response []string }{ { - name: "set address", - chainID: &hijackAddress{replace: false, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, - method: "eth_sendTransaction", + name: "set address", + hijacker: &hijackAddress{replace: false, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { - tx := types.NewTransactionAccessList() - tx.SetFrom(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")) - return tx + return types.NewTransactionAccessList() }()}, request: []string{ `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111"}]}`, @@ -41,48 +38,47 @@ func TestHijackAddress(t *testing.T) { }, }, { - name: "replace address", - chainID: &hijackAddress{replace: true, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, - method: "eth_sendTransaction", + name: "replace address", + hijacker: &hijackAddress{replace: true, address: types.MustAddressFromHex("0x1111111111111111111111111111111111111111")}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetFrom(types.MustAddressFromHex("0x2222222222222222222222222222222222222222")) return tx }()}, request: []string{ - `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x2222222222222222222222222222222222222222"}]}`, + `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"from": "0x1111111111111111111111111111111111111111"}]}`, }, response: []string{ `{"jsonrpc":"2.0","id":1,"result":"0x1111111111111111111111111111111111111111111111111111111111111111"}`, }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - hijacker := transport.NewHijacker(httpMock, tc.chainID) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + hijacker := transport.NewHijacker(httpMock, tt.hijacker) + + err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } diff --git a/rpc/hijack_chainid.go b/rpc/hijack_chainid.go index f5f5ed0..430faf1 100644 --- a/rpc/hijack_chainid.go +++ b/rpc/hijack_chainid.go @@ -8,52 +8,46 @@ import ( "github.com/defiweb/go-eth/types" ) -// hijackChainID hijacks "eth_sendTransaction" method and sets the "chainID" -// field. +// hijackChainID hijacks the "eth_sendTransaction" method and sets the +// "chainID" field. type hijackChainID struct { chainID uint64 replace bool } -func (c *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc { +// Call implements the [transport.Hijacker] interface. +func (h *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { - chainID := c.chainID + chainID := h.chainID return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { - if method != "eth_sendTransaction" || len(args) == 0 { + if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) } - - // Verify arguments: tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("invalid transaction type: %T", args[0])} - } - - // Get the transaction data: - txd := tx.TransactionData() - if !c.replace && txd.ChainID != nil { return next(ctx, t, result, method, args...) } - - // Get the chain ID from the RPC node: - if chainID == 0 { - chainID, err = (&MethodsCommon{Transport: t}).ChainID(ctx) - if err != nil { - return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("failed to get chain ID: %w", err)} + td := getTransactionData(tx) + if td != nil && (h.replace || td.ChainID == nil) { + if chainID == 0 { + chainID, err = (&MethodsCommon{Transport: t}).ChainID(ctx) + if err != nil { + return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("failed to get chain ID: %w", err)} + } } + td.ChainID = &chainID } - - // Update the "chainID" field and continue: - txd.ChainID = &chainID return next(ctx, t, result, method, args...) } } } -func (c *hijackChainID) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { +// Subscribe implements the [transport.Hijacker] interface. +func (h *hijackChainID) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } -func (c *hijackChainID) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { +// Unsubscribe implements the [transport.Hijacker] interface. +func (h *hijackChainID) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_chainid_test.go b/rpc/hijack_chainid_test.go index 4c85ff1..0205c80 100644 --- a/rpc/hijack_chainid_test.go +++ b/rpc/hijack_chainid_test.go @@ -15,55 +15,33 @@ import ( "github.com/defiweb/go-eth/types" ) -const mockHijackChainIDCallValidResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x01" - } -` - -const mockHijackChainIDSendTransactionValidResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1111111111111111111111111111111111111111111111111111111111111111" - } -` - func TestHijackChainID(t *testing.T) { - tt := []struct { + tc := []struct { name string - chainID *hijackChainID + hijacker *hijackChainID method string args []any request []string - response []*http.Response + response []string }{ { - name: "set chainID", - chainID: &hijackChainID{}, - method: "eth_sendTransaction", - args: []any{types.NewTransactionAccessList()}, + name: "set chainID", + hijacker: &hijackChainID{}, + method: "eth_sendTransaction", + args: []any{types.NewTransactionAccessList()}, request: []string{ `{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}`, `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId": "0x1"}]}`, }, - response: []*http.Response{ - { - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDCallValidResponse)), - }, - { - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), - }, + response: []string{ + `{"jsonrpc":"2.0","id": 1,"result": "0x01"}`, + `{"jsonrpc":"2.0","id": 1,"result": "0x1111111111111111111111111111111111111111111111111111111111111111"}`, }, }, { - name: "do not replace chainID", - chainID: &hijackChainID{replace: false}, - method: "eth_sendTransaction", + name: "do not replace chainID", + hijacker: &hijackChainID{replace: false}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetChainID(2) @@ -72,17 +50,14 @@ func TestHijackChainID(t *testing.T) { request: []string{ `{"jsonrpc":"2.0","id":1,"method":"eth_sendTransaction","params":[{"chainId": "0x2"}]}`, }, - response: []*http.Response{ - { - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), - }, + response: []string{ + `{"jsonrpc":"2.0","id": 1,"result": "0x1111111111111111111111111111111111111111111111111111111111111111"}`, }, }, { - name: "replace chainID", - chainID: &hijackChainID{replace: true}, - method: "eth_sendTransaction", + name: "replace chainID", + hijacker: &hijackChainID{replace: true}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetChainID(2) @@ -92,41 +67,38 @@ func TestHijackChainID(t *testing.T) { `{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}`, `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId": "0x1"}]}`, }, - response: []*http.Response{ - { - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDCallValidResponse)), - }, - { - StatusCode: http.StatusOK, - Body: io.NopCloser(bytes.NewBufferString(mockHijackChainIDSendTransactionValidResponse)), - }, + response: []string{ + `{"jsonrpc":"2.0","id": 1,"result": "0x01"}`, + `{"jsonrpc":"2.0","id": 1,"result": "0x1111111111111111111111111111111111111111111111111111111111111111"}`, }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { ctx := context.Background() httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] - return res, nil + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] + return &http.Response{ + StatusCode: http.StatusOK, + Body: io.NopCloser(bytes.NewBufferString(res)), + }, nil } - hijacker := transport.NewHijacker(httpMock, tc.chainID) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + hijacker := transport.NewHijacker(httpMock, tt.hijacker) + + err := hijacker.Call(ctx, nil, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } diff --git a/rpc/hijack_error.go b/rpc/hijack_error.go index 7484681..dad792d 100644 --- a/rpc/hijack_error.go +++ b/rpc/hijack_error.go @@ -2,6 +2,7 @@ package rpc import "fmt" +// ErrHijackFailed is returned when a hijacker fails to process a request. type ErrHijackFailed struct { name string err error diff --git a/rpc/hijack_gasfee.go b/rpc/hijack_gasfee.go index 7388bf2..9708970 100644 --- a/rpc/hijack_gasfee.go +++ b/rpc/hijack_gasfee.go @@ -9,7 +9,7 @@ import ( "github.com/defiweb/go-eth/types" ) -// hijackLegacyGasFee hijacks "eth_sendTransaction" method and sets the +// hijackLegacyGasFee hijacks the "eth_sendTransaction" method and sets the // "gasPrice" field using the estimate provided by the RPC node. type hijackLegacyGasFee struct { multiplier float64 @@ -19,67 +19,54 @@ type hijackLegacyGasFee struct { allowChangeType bool } +// Call implements the [transport.Hijacker] interface. func (h *hijackLegacyGasFee) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { - if method != "eth_sendTransaction" || len(args) == 0 { + if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) } - - // Verify arguments: tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("invalid transaction type: %T", args[0])} + return next(ctx, t, result, method, args...) } - - // Change transaction type if needed: if h.allowChangeType { tx = convertTXToLegacyPrice(tx) args[0] = tx } - - // Get legacy price data: lpd := getLegacyPriceData(tx) - if lpd == nil { - return next(ctx, t, result, method, args...) - } - - // Skip if already set: - if !h.replace && lpd.GasPrice != nil { - return next(ctx, t, result, method, args...) - } - - // Get gas price from RPC node: - gasPrice, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) - if err != nil { - return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("failed to get gas price: %w", err)} + if lpd != nil && (h.replace || lpd.GasPrice == nil) { + gasPrice, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + if err != nil { + return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("failed to get gas price: %w", err)} + } + gasPrice, _ = new(big.Float).Mul(new(big.Float).SetInt(gasPrice), big.NewFloat(h.multiplier)).Int(nil) + if h.minGasPrice != nil && gasPrice.Cmp(h.minGasPrice) < 0 { + gasPrice = h.minGasPrice + } + if h.maxGasPrice != nil && gasPrice.Cmp(h.maxGasPrice) > 0 { + gasPrice = h.maxGasPrice + } + lpd.GasPrice = gasPrice } - - // Update gas price and continue: - gasPrice, _ = new(big.Float).Mul(new(big.Float).SetInt(gasPrice), big.NewFloat(h.multiplier)).Int(nil) - if h.minGasPrice != nil && gasPrice.Cmp(h.minGasPrice) < 0 { - gasPrice = h.minGasPrice - } - if h.maxGasPrice != nil && gasPrice.Cmp(h.maxGasPrice) > 0 { - gasPrice = h.maxGasPrice - } - lpd.GasPrice = gasPrice return next(ctx, t, result, method, args...) } } } +// Subscribe implements the [transport.Hijacker] interface. func (h *hijackLegacyGasFee) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } +// Unsubscribe implements the [transport.Hijacker] interface. func (h *hijackLegacyGasFee) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } -// hijackDynamicGasFee hijacks "eth_sendTransaction" method and sets the -// "maxFeePerGas" and "maxPriorityFeePerGas" fields using the estimate provided -// by the RPC node. +// hijackDynamicGasFee hijacks the "eth_sendTransaction" method and sets the +// "maxFeePerGas" and "maxPriorityFeePerGas" fields using the estimates +// provided by the RPC node. type hijackDynamicGasFee struct { gasPriceMultiplier float64 priorityFeePerGasMultiplier float64 @@ -91,75 +78,70 @@ type hijackDynamicGasFee struct { allowChangeType bool } +// Call implements the [transport.Hijacker] interface. func (h *hijackDynamicGasFee) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { - if method != "eth_sendTransaction" || len(args) == 0 { + if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) } - // Verify arguments: + // Obtain the dynamic fee data. tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("invalid transaction type: %T", args[0])} + return next(ctx, t, result, method, args...) } - - // Change transaction type if needed: if h.allowChangeType { tx = convertTXToDynamicFee(tx) args[0] = tx } - - // Get dynamic fee data: dfd := getDynamicFeeData(tx) - if dfd == nil { - return next(ctx, t, result, method, args...) - } - // Skip if already set: - if !h.replace && dfd.MaxFeePerGas != nil && dfd.MaxPriorityFeePerGas != nil { - return next(ctx, t, result, method, args...) + // Set the dynamic fee fields if necessary. + if dfd != nil && (h.replace || dfd.MaxFeePerGas == nil || dfd.MaxPriorityFeePerGas == nil) { + // Fetch current gas prices from the RPC node. + maxFeePerGas, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + if err != nil { + return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get gas price: %w", err)} + } + priorityFeePerGas, err := (&MethodsCommon{Transport: t}).MaxPriorityFeePerGas(ctx) + if err != nil { + return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get priority fee per gas: %w", err)} + } + + // Apply multipliers and limits and set the fields. + maxFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(maxFeePerGas), big.NewFloat(h.gasPriceMultiplier)).Int(nil) + priorityFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(priorityFeePerGas), big.NewFloat(h.priorityFeePerGasMultiplier)).Int(nil) + if h.minGasPrice != nil && maxFeePerGas.Cmp(h.minGasPrice) < 0 { + maxFeePerGas = h.minGasPrice + } + if h.maxGasPrice != nil && maxFeePerGas.Cmp(h.maxGasPrice) > 0 { + maxFeePerGas = h.maxGasPrice + } + if h.minPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.minPriorityFeePerGas) < 0 { + priorityFeePerGas = h.minPriorityFeePerGas + } + if h.maxPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.maxPriorityFeePerGas) > 0 { + priorityFeePerGas = h.maxPriorityFeePerGas + } + if maxFeePerGas.Cmp(priorityFeePerGas) < 0 { + priorityFeePerGas = maxFeePerGas + } + dfd.MaxFeePerGas = maxFeePerGas + dfd.MaxPriorityFeePerGas = priorityFeePerGas } - // Get gas price from RPC node: - maxFeePerGas, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) - if err != nil { - return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get gas price: %w", err)} - } - priorityFeePerGas, err := (&MethodsCommon{Transport: t}).MaxPriorityFeePerGas(ctx) - if err != nil { - return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get priority fee per gas: %w", err)} - } - - // Update gas price and continue: - maxFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(maxFeePerGas), big.NewFloat(h.gasPriceMultiplier)).Int(nil) - priorityFeePerGas, _ = new(big.Float).Mul(new(big.Float).SetInt(priorityFeePerGas), big.NewFloat(h.priorityFeePerGasMultiplier)).Int(nil) - if h.minGasPrice != nil && maxFeePerGas.Cmp(h.minGasPrice) < 0 { - maxFeePerGas = h.minGasPrice - } - if h.maxGasPrice != nil && maxFeePerGas.Cmp(h.maxGasPrice) > 0 { - maxFeePerGas = h.maxGasPrice - } - if h.minPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.minPriorityFeePerGas) < 0 { - priorityFeePerGas = h.minPriorityFeePerGas - } - if h.maxPriorityFeePerGas != nil && priorityFeePerGas.Cmp(h.maxPriorityFeePerGas) > 0 { - priorityFeePerGas = h.maxPriorityFeePerGas - } - if maxFeePerGas.Cmp(priorityFeePerGas) < 0 { - priorityFeePerGas = maxFeePerGas - } - dfd.MaxFeePerGas = maxFeePerGas - dfd.MaxPriorityFeePerGas = priorityFeePerGas return next(ctx, t, result, method, args...) } } } +// Subscribe implements the [transport.Hijacker] interface. func (h *hijackDynamicGasFee) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } +// Unsubscribe implements the [transport.Hijacker] interface. func (h *hijackDynamicGasFee) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_gasfee_test.go b/rpc/hijack_gasfee_test.go index bcd1e12..6443afb 100644 --- a/rpc/hijack_gasfee_test.go +++ b/rpc/hijack_gasfee_test.go @@ -2,7 +2,6 @@ package rpc import ( "bytes" - "context" "fmt" "io" "net/http" @@ -16,9 +15,9 @@ import ( ) func TestHijackLegacyGasFee(t *testing.T) { - tt := []struct { + tc := []struct { name string - gasLimit *hijackLegacyGasFee + hijacker *hijackLegacyGasFee method string args []any request []string @@ -26,7 +25,7 @@ func TestHijackLegacyGasFee(t *testing.T) { }{ { name: "set gas price", - gasLimit: &hijackLegacyGasFee{multiplier: 1.0}, + hijacker: &hijackLegacyGasFee{multiplier: 1.0}, method: "eth_sendTransaction", args: []any{types.NewTransactionLegacy()}, request: []string{ @@ -39,41 +38,40 @@ func TestHijackLegacyGasFee(t *testing.T) { }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - hijacker := transport.NewHijacker(httpMock, tc.gasLimit) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + hijacker := transport.NewHijacker(httpMock, tt.hijacker) + + err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } } func TestHijackDynamicGasFee(t *testing.T) { - tt := []struct { + tc := []struct { name string - gasLimit *hijackDynamicGasFee + hijacker *hijackDynamicGasFee method string args []any request []string @@ -81,7 +79,7 @@ func TestHijackDynamicGasFee(t *testing.T) { }{ { name: "set gas price", - gasLimit: &hijackDynamicGasFee{gasPriceMultiplier: 1.0, priorityFeePerGasMultiplier: 1.0}, + hijacker: &hijackDynamicGasFee{gasPriceMultiplier: 1.0, priorityFeePerGasMultiplier: 1.0}, method: "eth_sendTransaction", args: []any{types.NewTransactionDynamicFee()}, request: []string{ @@ -96,32 +94,31 @@ func TestHijackDynamicGasFee(t *testing.T) { }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - hijacker := transport.NewHijacker(httpMock, tc.gasLimit) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + hijacker := transport.NewHijacker(httpMock, tt.hijacker) + + err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } diff --git a/rpc/hijack_gaslimit.go b/rpc/hijack_gaslimit.go index 52b6f90..fc58172 100644 --- a/rpc/hijack_gaslimit.go +++ b/rpc/hijack_gaslimit.go @@ -9,8 +9,8 @@ import ( "github.com/defiweb/go-eth/types" ) -// hijackGasLimit hijacks "eth_sendTransaction" method and sets the "gasLimit" -// field using the estimate provided by the RPC node. +// hijackGasLimit hijacks the "eth_sendTransaction" method and sets the +// "gasLimit" field using the estimate provided by the RPC node. type hijackGasLimit struct { multiplier float64 minGas uint64 @@ -18,54 +18,44 @@ type hijackGasLimit struct { replace bool } -func (c *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc { +// Call implements the [transport.Hijacker] interface. +func (h *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { - if method != "eth_sendTransaction" || len(args) == 0 { + if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) } - - // Verify arguments: tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("invalid transaction type: %T", args[0])} - } - - // Get transaction call data: - var txcd *types.CallFields - if tx, ok := tx.(types.CallData); ok { - txcd = tx.CallData() - } - - // If the gas limit is already set, continue: - if !c.replace && txcd.GasLimit != nil { return next(ctx, t, result, method, args...) } - - // Get the gas estimate from the RPC node: - gasLimit, err := (&MethodsCommon{Transport: t}).EstimateGas(ctx, tx.Call(), types.LatestBlockNumber) - if err != nil { - return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("failed to estimate gas: %w", err)} - } - - // Update the gas limit and continue: - gasLimit, _ = new(big.Float).Mul(new(big.Float).SetUint64(gasLimit), big.NewFloat(c.multiplier)).Uint64() - if c.minGas > 0 && gasLimit < c.minGas { - gasLimit = c.minGas - } - if c.maxGas > 0 && gasLimit > c.maxGas { - gasLimit = c.maxGas + tc := tx.Call() + cd := getCallData(tx) + if tc != nil && cd != nil && (h.replace || cd.GasLimit == nil) { + gasLimit, err := (&MethodsCommon{Transport: t}).EstimateGas(ctx, tc, types.LatestBlockNumber) + if err != nil { + return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("failed to estimate gas: %w", err)} + } + gasLimit, _ = new(big.Float).Mul(new(big.Float).SetUint64(gasLimit), big.NewFloat(h.multiplier)).Uint64() + if h.minGas > 0 && gasLimit < h.minGas { + gasLimit = h.minGas + } + if h.maxGas > 0 && gasLimit > h.maxGas { + gasLimit = h.maxGas + } + cd.GasLimit = &gasLimit } - txcd.GasLimit = &gasLimit return next(ctx, t, result, method, args...) } } } -func (c *hijackGasLimit) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { +// Subscribe implements the [transport.Hijacker] interface. +func (h *hijackGasLimit) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } -func (c *hijackGasLimit) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { +// Unsubscribe implements the [transport.Hijacker] interface. +func (h *hijackGasLimit) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_gaslimit_test.go b/rpc/hijack_gaslimit_test.go index a33a5c3..e180e18 100644 --- a/rpc/hijack_gaslimit_test.go +++ b/rpc/hijack_gaslimit_test.go @@ -2,7 +2,6 @@ package rpc import ( "bytes" - "context" "fmt" "io" "net/http" @@ -16,9 +15,9 @@ import ( ) func TestHijackGasLimit(t *testing.T) { - tt := []struct { + tc := []struct { name string - gasLimit *hijackGasLimit + hijacker *hijackGasLimit method string args []any request []string @@ -26,7 +25,7 @@ func TestHijackGasLimit(t *testing.T) { }{ { name: "set gas limit", - gasLimit: &hijackGasLimit{multiplier: 1.0}, + hijacker: &hijackGasLimit{multiplier: 1.0}, method: "eth_sendTransaction", args: []any{types.NewTransactionAccessList()}, request: []string{ @@ -40,7 +39,7 @@ func TestHijackGasLimit(t *testing.T) { }, { name: "do not replace gas limit", - gasLimit: &hijackGasLimit{multiplier: 1.0, replace: false}, + hijacker: &hijackGasLimit{multiplier: 1.0, replace: false}, method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() @@ -57,7 +56,7 @@ func TestHijackGasLimit(t *testing.T) { }, { name: "replace gas limit", - gasLimit: &hijackGasLimit{multiplier: 1.0, replace: true}, + hijacker: &hijackGasLimit{multiplier: 1.0, replace: true}, method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() @@ -75,9 +74,8 @@ func TestHijackGasLimit(t *testing.T) { }, }, } - for _, tc := range tt { + for _, tc := range tc { t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { require.NotEmpty(t, tc.request) @@ -95,10 +93,10 @@ func TestHijackGasLimit(t *testing.T) { Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - hijacker := transport.NewHijacker(httpMock, tc.gasLimit) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) + hijacker := transport.NewHijacker(httpMock, tc.hijacker) + + err := hijacker.Call(t.Context(), nil, tc.method, tc.args...) assert.Len(t, tc.request, 0) assert.Len(t, tc.response, 0) require.NoError(t, err) diff --git a/rpc/hijack_nonce.go b/rpc/hijack_nonce.go index be7881f..93bd8fc 100644 --- a/rpc/hijack_nonce.go +++ b/rpc/hijack_nonce.go @@ -8,69 +8,48 @@ import ( "github.com/defiweb/go-eth/types" ) -// hijackNonce hijacks "eth_sendTransaction" method and sets the "nonce" +// hijackNonce hijacks the "eth_sendTransaction" method and sets the "nonce" // field using the "eth_getTransactionCount" RPC method. type hijackNonce struct { usePendingBlock bool replace bool } -func (c *hijackNonce) Call() func(next transport.CallFunc) transport.CallFunc { +func (h *hijackNonce) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { - if method != "eth_sendTransaction" || len(args) == 0 { + if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) } - - // Verify arguments: tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("invalid transaction type: %T", args[0])} - } - - // If the nonce is already set, continue: - txd := tx.TransactionData() - if !c.replace && txd.Nonce != nil { return next(ctx, t, result, method, args...) } - - // Get transaction call data: - var txcd *types.CallFields - if tx, ok := tx.(types.CallData); ok { - txcd = tx.CallData() - } - - // It is some strange transaction type with no call data, continue: - if txcd == nil { - return next(ctx, t, result, method, args...) + td := getTransactionData(tx) // to set the nonce + cd := getCallData(tx) // to get the "from" address + if td != nil && cd != nil && (h.replace || td.Nonce == nil) { + if cd.From == nil { + return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("'from' field not set")} + } + block := types.LatestBlockNumber + if h.usePendingBlock { + block = types.PendingBlockNumber + } + nonce, err := (&MethodsCommon{Transport: t}).GetTransactionCount(ctx, *cd.From, block) + if err != nil { + return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("failed to get transaction count: %w", err)} + } + td.Nonce = &nonce } - - // The "from" field must be set to obtain the nonce: - if txcd.From == nil { - return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("'from' field not set")} - } - - // Get the latest nonce: - block := types.LatestBlockNumber - if c.usePendingBlock { - block = types.PendingBlockNumber - } - nonce, err := (&MethodsCommon{Transport: t}).GetTransactionCount(ctx, *txcd.From, block) - if err != nil { - return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("failed to get transaction count: %w", err)} - } - - // Update the nonce and continue: - txd.Nonce = &nonce return next(ctx, t, result, method, args...) } } } -func (c *hijackNonce) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { +func (h *hijackNonce) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } -func (c *hijackNonce) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { +func (h *hijackNonce) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_nonce_test.go b/rpc/hijack_nonce_test.go index 67d3d65..0d35760 100644 --- a/rpc/hijack_nonce_test.go +++ b/rpc/hijack_nonce_test.go @@ -16,18 +16,18 @@ import ( ) func TestHijackNonce(t *testing.T) { - tt := []struct { + tc := []struct { name string - nonce *hijackNonce + hijacker *hijackNonce method string args []any request []string response []string }{ { - name: "set nonce", - nonce: &hijackNonce{}, - method: "eth_sendTransaction", + name: "set nonce", + hijacker: &hijackNonce{}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetFrom(types.MustAddressFromHex("0x1111111111111111111111111111111111111111")) @@ -43,9 +43,9 @@ func TestHijackNonce(t *testing.T) { }, }, { - name: "do not replace nonce", - nonce: &hijackNonce{replace: false}, - method: "eth_sendTransaction", + name: "do not replace nonce", + hijacker: &hijackNonce{replace: false}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetNonce(2) @@ -60,9 +60,9 @@ func TestHijackNonce(t *testing.T) { }, }, { - name: "replace nonce", - nonce: &hijackNonce{replace: true}, - method: "eth_sendTransaction", + name: "replace nonce", + hijacker: &hijackNonce{replace: true}, + method: "eth_sendTransaction", args: []any{func() types.Transaction { tx := types.NewTransactionAccessList() tx.SetNonce(2) @@ -79,32 +79,32 @@ func TestHijackNonce(t *testing.T) { }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { ctx := context.Background() httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - hijacker := transport.NewHijacker(httpMock, tc.nonce) - var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + hijacker := transport.NewHijacker(httpMock, tt.hijacker) + + err := hijacker.Call(ctx, nil, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } diff --git a/rpc/hijack_sign.go b/rpc/hijack_sign.go index 93bc83b..93f83c8 100644 --- a/rpc/hijack_sign.go +++ b/rpc/hijack_sign.go @@ -9,12 +9,13 @@ import ( "github.com/defiweb/go-eth/wallet" ) -// hijackSign hijacks calls to the methods that require account access +// hijackSign hijacks calls to methods that require account access // and simulates their behavior using the provided keys. type hijackSign struct { keys []wallet.Key } +// Call implements the [transport.Hijacker] interface. func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) error { @@ -67,10 +68,12 @@ func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { } } +// Subscribe implements the [transport.Hijacker] interface. func (k *hijackSign) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } +// Unsubscribe implements the [transport.Hijacker] interface. func (k *hijackSign) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } diff --git a/rpc/hijack_sign_test.go b/rpc/hijack_sign_test.go index 00c7815..adc7250 100644 --- a/rpc/hijack_sign_test.go +++ b/rpc/hijack_sign_test.go @@ -21,8 +21,7 @@ import ( func TestHijackSign(t *testing.T) { key1 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x01")) // 0x7e5f4552091a69125d5dfcb7b8c2659029395bdf key2 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x02")) // 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf - - tt := []struct { + tc := []struct { name string sign *hijackSign method string @@ -86,34 +85,34 @@ func TestHijackSign(t *testing.T) { }, }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { ctx := context.Background() httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), }, nil } - tc.sign.keys = []wallet.Key{key1, key2} - hijacker := transport.NewHijacker(httpMock, tc.sign) + tt.sign.keys = []wallet.Key{key1, key2} + hijacker := transport.NewHijacker(httpMock, tt.sign) - result := reflect.New(reflect.TypeOf(tc.wantResult)) - err := hijacker.Call(ctx, result.Interface(), tc.method, tc.args...) - assert.Equal(t, tc.wantResult, result.Elem().Interface()) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + result := reflect.New(reflect.TypeOf(tt.wantResult)) + err := hijacker.Call(ctx, result.Interface(), tt.method, tt.args...) + assert.Equal(t, tt.wantResult, result.Elem().Interface()) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) require.NoError(t, err) }) } diff --git a/rpc/hijack_simulate.go b/rpc/hijack_simulate.go index d7c2551..bf4f117 100644 --- a/rpc/hijack_simulate.go +++ b/rpc/hijack_simulate.go @@ -2,7 +2,6 @@ package rpc import ( "context" - "errors" "fmt" "github.com/defiweb/go-eth/crypto/txsign" @@ -16,42 +15,31 @@ type hijackSimulate struct { decoder types.RLPTransactionDecoder } -// Call implements the transport.Hijacker interface. +// Call implements the [transport.Hijacker] interface. func (h *hijackSimulate) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { + if len(args) == 0 { + return next(ctx, t, result, method, args...) + } switch method { case "eth_sendTransaction": - // Verify arguments: - if len(args) == 0 { - return &ErrHijackFailed{name: "simulate", err: errors.New("missing transaction data")} - } tx, ok := args[0].(types.Transaction) if !ok { - return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("invalid transaction type: %T", args[0])} + return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("no transaction found")} } - - // Simulate transaction: if err := h.simulate(ctx, t, tx); err != nil { return &ErrHijackFailed{name: "simulate", err: err} } case "eth_sendRawTransaction", "eth_sendPrivateTransaction": - // Verify arguments: - if len(args) == 0 { - return &ErrHijackFailed{name: "simulate", err: errors.New("missing transaction data")} - } raw, ok := args[0].(types.Bytes) if !ok { - return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("invalid transaction data type: %T", args[0])} + return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("no raw transaction found")} } - - // Decode raw transaction: tx, err := h.decoder.DecodeRLP(raw) if err != nil { return &ErrHijackFailed{name: "simulate", err: fmt.Errorf("failed to decode transaction: %w", err)} } - - // Simulate transaction: if err := h.simulate(ctx, t, tx); err != nil { return &ErrHijackFailed{name: "simulate", err: err} } @@ -61,35 +49,41 @@ func (h *hijackSimulate) Call() func(next transport.CallFunc) transport.CallFunc } } -// Subscribe implements the transport.Hijacker interface. +// Subscribe implements the [transport.Hijacker] interface. func (h *hijackSimulate) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { return nil } -// Unsubscribe implements the transport.Hijacker interface. +// Unsubscribe implements the [transport.Hijacker] interface. func (h *hijackSimulate) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { return nil } func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx types.Transaction) error { - // Recover transaction sender if not present: - txd := tx.TransactionData() - if txc, ok := tx.(types.CallData); ok && txd.Signature != nil && txc.CallData().From == nil { + // If the transaction has not a corrseponding call, we cannot simulate it. + // This can happen for custom transactions types. + call := tx.Call() + if call == nil { + return nil + } + + // Recover the transaction sender if it is not present. + // This can happen if the transaction is encoded using RLP, as this format + // contains only the signature and not the sender address. + if td := tx.GetTransactionData(); td.Signature != nil && call.GetCallData().From == nil { from, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("unable to recover transaction sender: %w", err) } - txc.CallData().From = from + call.GetCallData().From = from + if cd := getCallData(tx); cd != nil { + cd.From = from + } } - // Get call data from transaction and execute it: - call := tx.Call() - if call == nil { - return errors.New("unable to create call data from transaction") - } + // Simulate the transaction. if _, err := (&MethodsCommon{Transport: t}).Call(ctx, call, types.LatestBlockNumber); err != nil { return err } - return nil } diff --git a/rpc/hijack_simulate_test.go b/rpc/hijack_simulate_test.go index 0a66c33..804f8c5 100644 --- a/rpc/hijack_simulate_test.go +++ b/rpc/hijack_simulate_test.go @@ -17,7 +17,7 @@ import ( ) func TestHijackSimulate(t *testing.T) { - tt := []struct { + tc := []struct { name string method string args []any @@ -95,21 +95,21 @@ func TestHijackSimulate(t *testing.T) { wantErr: "failed to decode transaction", }, } - for _, tc := range tt { - t.Run(tc.name, func(t *testing.T) { + for _, tt := range tc { + t.Run(tt.name, func(t *testing.T) { ctx := context.Background() httpMock := newHTTPMock() httpMock.Handler = func(req *http.Request) (*http.Response, error) { - require.NotEmpty(t, tc.request) - require.NotEmpty(t, tc.response) + require.NotEmpty(t, tt.request) + require.NotEmpty(t, tt.response) body, err := io.ReadAll(req.Body) require.NoError(t, err) - require.JSONEq(t, tc.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tc.request[0], string(body))) + require.JSONEq(t, tt.request[0], string(body), fmt.Sprintf("expected: %s, got: %s", tt.request[0], string(body))) - res := tc.response[0] - tc.request = tc.request[1:] - tc.response = tc.response[1:] + res := tt.response[0] + tt.request = tt.request[1:] + tt.response = tt.response[1:] return &http.Response{ StatusCode: http.StatusOK, Body: io.NopCloser(bytes.NewBufferString(res)), @@ -120,17 +120,17 @@ func TestHijackSimulate(t *testing.T) { }) var result any - err := hijacker.Call(ctx, &result, tc.method, tc.args...) - assert.Len(t, tc.request, 0) - assert.Len(t, tc.response, 0) + err := hijacker.Call(ctx, &result, tt.method, tt.args...) + assert.Len(t, tt.request, 0) + assert.Len(t, tt.response, 0) - if tc.wantErr != "" { + if tt.wantErr != "" { require.Error(t, err) - require.Contains(t, err.Error(), tc.wantErr) + require.Contains(t, err.Error(), tt.wantErr) return } require.NoError(t, err) - assert.Equal(t, tc.wantResult, result) + assert.Equal(t, tt.wantResult, result) }) } } diff --git a/rpc/hijack_util.go b/rpc/hijack_util.go deleted file mode 100644 index 0279612..0000000 --- a/rpc/hijack_util.go +++ /dev/null @@ -1,108 +0,0 @@ -package rpc - -import "github.com/defiweb/go-eth/types" - -func getCallData(tx types.Transaction) *types.CallFields { - if tx, ok := tx.(types.CallData); ok { - return tx.CallData() - } - return nil -} - -func getLegacyPriceData(tx types.Transaction) *types.LegacyPriceField { - if tx, ok := tx.(types.LegacyPriceData); ok { - return tx.LegacyPriceData() - } - return nil -} - -func getAccessListData(tx types.Transaction) *types.AccessListField { - if tx, ok := tx.(types.AccessListData); ok { - return tx.AccessListData() - } - return nil -} - -func getDynamicFeeData(tx types.Transaction) *types.DynamicFeeFields { - if tx, ok := tx.(types.DynamicFeeData); ok { - return tx.DynamicFeeData() - } - return nil -} - -func convertTXToLegacyPrice(tx types.Transaction) types.Transaction { - if getLegacyPriceData(tx) != nil { - return tx - } - typ := types.LegacyTxType - if getAccessListData(tx) != nil { - typ = types.AccessListTxType - } - return convertTX(tx, typ) -} - -func convertTXToDynamicFee(tx types.Transaction) types.Transaction { - if getDynamicFeeData(tx) != nil { - return tx - } - return convertTX(tx, types.DynamicFeeTxType) -} - -func convertTX(tx types.Transaction, typ types.TransactionType) types.Transaction { - switch typ { - case types.LegacyTxType: - ltx := types.NewTransactionLegacy() - ltx.SetTransactionData(*tx.TransactionData()) - if tx, ok := tx.(types.CallData); ok { - ltx.SetCallData(*tx.CallData()) - } - if tx, ok := tx.(types.LegacyPriceData); ok { - ltx.SetLegacyPriceData(*tx.LegacyPriceData()) - } - return ltx - case types.AccessListTxType: - altx := types.NewTransactionAccessList() - altx.SetTransactionData(*tx.TransactionData()) - if tx, ok := tx.(types.CallData); ok { - altx.SetCallData(*tx.CallData()) - } - if tx, ok := tx.(types.LegacyPriceData); ok { - altx.SetLegacyPriceData(*tx.LegacyPriceData()) - } - if tx, ok := tx.(types.AccessListData); ok { - altx.SetAccessListData(*tx.AccessListData()) - } - return altx - case types.DynamicFeeTxType: - dftx := types.NewTransactionDynamicFee() - dftx.SetTransactionData(*tx.TransactionData()) - if tx, ok := tx.(types.CallData); ok { - dftx.SetCallData(*tx.CallData()) - } - if tx, ok := tx.(types.AccessListData); ok { - dftx.SetAccessListData(*tx.AccessListData()) - } - if tx, ok := tx.(types.DynamicFeeData); ok { - dftx.SetDynamicFeeData(*tx.DynamicFeeData()) - } - return dftx - case types.BlobTxType: - btx := types.NewTransactionBlob() - btx.SetTransactionData(*tx.TransactionData()) - if tx, ok := tx.(types.CallData); ok { - btx.SetCallData(*tx.CallData()) - } - if tx, ok := tx.(types.AccessListData); ok { - btx.SetAccessListData(*tx.AccessListData()) - } - if tx, ok := tx.(types.DynamicFeeData); ok { - btx.SetDynamicFeeData(*tx.DynamicFeeData()) - } - if tx, ok := tx.(types.BlobData); ok { - btx.SetBlobData(*tx.BlobData()) - } - return btx - default: - return nil - } -} diff --git a/rpc/methods_client_test.go b/rpc/methods_client_test.go index dbba980..ca48c94 100644 --- a/rpc/methods_client_test.go +++ b/rpc/methods_client_test.go @@ -2,7 +2,6 @@ package rpc import ( "bytes" - "context" "io" "net/http" "testing" @@ -40,7 +39,8 @@ func TestBaseClient_ClientVersion(t *testing.T) { }, nil } - clientVersion, err := client.ClientVersion(context.Background()) + clientVersion, err := client.ClientVersion(t.Context()) + require.NoError(t, err) assert.Equal(t, "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2", clientVersion) } @@ -74,7 +74,8 @@ func TestBaseClient_NetworkID(t *testing.T) { }, nil } - networkID, err := client.NetworkID(context.Background()) + networkID, err := client.NetworkID(t.Context()) + require.NoError(t, err) assert.Equal(t, uint64(1), networkID) } @@ -108,7 +109,8 @@ func TestBaseClient_Listening(t *testing.T) { }, nil } - listening, err := client.Listening(context.Background()) + listening, err := client.Listening(t.Context()) + require.NoError(t, err) assert.True(t, listening) } @@ -142,7 +144,49 @@ func TestBaseClient_PeerCount(t *testing.T) { }, nil } - peerCount, err := client.PeerCount(context.Background()) + peerCount, err := client.PeerCount(t.Context()) + require.NoError(t, err) assert.Equal(t, uint64(1), peerCount) } + +const mockSyncingRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_syncing", + "params": [] + } +` + +const mockSyncingResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "startingBlock": "0x384", + "currentBlock": "0x386", + "highestBlock": "0x454" + } + } +` + +func TestBaseClient_Syncing(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsClient{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSyncingRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSyncingResponse)), + }, nil + } + + syncStatus, err := client.Syncing(t.Context()) + + require.NoError(t, err) + assert.Equal(t, uint64(0x384), syncStatus.StartingBlock.Big().Uint64()) + assert.Equal(t, uint64(0x386), syncStatus.CurrentBlock.Big().Uint64()) + assert.Equal(t, uint64(0x454), syncStatus.HighestBlock.Big().Uint64()) +} diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index e068319..a29f696 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -3,6 +3,7 @@ package rpc import ( "bytes" "context" + "encoding/json" "io" "math/big" "net/http" @@ -20,40 +21,40 @@ const mockBlockResponse = ` "jsonrpc": "2.0", "id": 1, "result": { - "number": "0x11", - "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", - "parentHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "nonce": "0x4444444444444444", - "sha3Uncles": "0x5555555555555555555555555555555555555555555555555555555555555555", - "logsBloom": "0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", - "transactionsRoot": "0x7777777777777777777777777777777777777777777777777777777777777777", - "stateRoot": "0x8888888888888888888888888888888888888888888888888888888888888888", - "receiptsRoot": "0x9999999999999999999999999999999999999999999999999999999999999999", - "miner": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "difficulty": "0xbbbbbb", - "totalDifficulty": "0xcccccc", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "size": "0xdddddd", - "gasLimit": "0xeeeeee", - "gasUsed": "0xffffff", - "timestamp": "0x54e34e8e", - "transactions": [ + "number": "0x11", + "hash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "parentHash": "0x3333333333333333333333333333333333333333333333333333333333333333", + "nonce": "0x4444444444444444", + "sha3Uncles": "0x5555555555555555555555555555555555555555555555555555555555555555", + "logsBloom": "0x66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666", + "transactionsRoot": "0x7777777777777777777777777777777777777777777777777777777777777777", + "stateRoot": "0x8888888888888888888888888888888888888888888888888888888888888888", + "receiptsRoot": "0x9999999999999999999999999999999999999999999999999999999999999999", + "miner": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "difficulty": "0xbbbbbb", + "totalDifficulty": "0xcccccc", + "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", + "size": "0xdddddd", + "gasLimit": "0xeeeeee", + "gasUsed": "0xffffff", + "timestamp": "0x54e34e8e", + "transactions": [ { - "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "nonce": "0x22", - "blockHash": "0x3333333333333333333333333333333333333333333333333333333333333333", - "blockNumber": "0x4444", - "transactionIndex": "0x01", - "from": "0x5555555555555555555555555555555555555555", - "to": "0x6666666666666666666666666666666666666666", - "value": "0x2540be400", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "input": "0x777777777777" + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "nonce": "0x22", + "blockHash": "0x3333333333333333333333333333333333333333333333333333333333333333", + "blockNumber": "0x4444", + "transactionIndex": "0x01", + "from": "0x5555555555555555555555555555555555555555", + "to": "0x6666666666666666666666666666666666666666", + "value": "0x2540be400", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "input": "0x777777777777" } ], - "uncles": [ - "0x8888888888888888888888888888888888888888888888888888888888888888" + "uncles": [ + "0x8888888888888888888888888888888888888888888888888888888888888888" ] } } @@ -64,20 +65,20 @@ const mockOnChainTransactionResponse = ` "jsonrpc": "2.0", "id": 1, "result": { - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x22", - "from": "0x3333333333333333333333333333333333333333", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "hash": "0x4444444444444444444444444444444444444444444444444444444444444444", - "input": "0x555555555555", - "nonce": "0x66", - "to": "0x7777777777777777777777777777777777777777", - "transactionIndex": "0x0", - "value": "0x2540be400", - "v": "0x88", - "r": "0x9999999999999999999999999999999999999999999999999999999999999999", - "s": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x22", + "from": "0x3333333333333333333333333333333333333333", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "hash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "input": "0x555555555555", + "nonce": "0x66", + "to": "0x7777777777777777777777777777777777777777", + "transactionIndex": "0x0", + "value": "0x2540be400", + "v": "0x88", + "r": "0x9999999999999999999999999999999999999999999999999999999999999999", + "s": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } } ` @@ -88,8 +89,8 @@ const mockGetBalanceRequest = ` "id": 1, "method": "eth_getBalance", "params": [ - "0x1111111111111111111111111111111111111111", - "latest" + "0x1111111111111111111111111111111111111111", + "latest" ] } ` @@ -115,7 +116,7 @@ func TestBaseClient_GetBalance(t *testing.T) { } balance, err := client.GetBalance( - context.Background(), + t.Context(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.LatestBlockNumber, ) @@ -130,8 +131,8 @@ const mockGetCodeRequest = ` "id": 1, "method": "eth_getCode", "params": [ - "0x1111111111111111111111111111111111111111", - "0x2" + "0x1111111111111111111111111111111111111111", + "0x2" ] } ` @@ -157,7 +158,7 @@ func TestBaseClient_GetCode(t *testing.T) { } code, err := client.GetCode( - context.Background(), + t.Context(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustBlockNumberFromHex("0x2"), ) @@ -172,9 +173,9 @@ const mockGetStorageAtRequest = ` "id": 1, "method": "eth_getStorageAt", "params": [ - "0x1111111111111111111111111111111111111111", - "0x2222222222222222222222222222222222222222222222222222222222222222", - "0x1" + "0x1111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222222222222222222222222222", + "0x1" ] } ` @@ -200,7 +201,7 @@ func TestBaseClient_GetStorageAt(t *testing.T) { } storage, err := client.GetStorageAt( - context.Background(), + t.Context(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), types.MustBlockNumberFromHex("0x1"), @@ -216,8 +217,8 @@ const mockGetTransactionCountRequest = ` "id": 1, "method": "eth_getTransactionCount", "params": [ - "0x1111111111111111111111111111111111111111", - "0x1" + "0x1111111111111111111111111111111111111111", + "0x1" ] } ` @@ -243,7 +244,7 @@ func TestBaseClient_GetTransactionCount(t *testing.T) { } transactionCount, err := client.GetTransactionCount( - context.Background(), + t.Context(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustBlockNumberFromHex("0x1"), ) @@ -258,7 +259,7 @@ const mockBlockByHashRequest = ` "id": 1, "method": "eth_getBlockByHash", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x1111111111111111111111111111111111111111111111111111111111111111", true ] } @@ -277,7 +278,7 @@ func TestBaseClient_BlockByHash(t *testing.T) { } block, err := client.BlockByHash( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), true, ) @@ -290,7 +291,7 @@ const mockBlockByNumberRequest = ` { "method": "eth_getBlockByNumber", "params": [ - "0x1", + "0x1", true ], "id": 1, @@ -311,7 +312,7 @@ func TestBaseClient_BlockByNumber(t *testing.T) { } block, err := client.BlockByNumber( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), true, ) @@ -355,7 +356,7 @@ const mockGetBlockTransactionCountByHashRequest = ` "id": 1, "method": "eth_getBlockTransactionCountByHash", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" + "0x1111111111111111111111111111111111111111111111111111111111111111" ] } ` @@ -381,7 +382,7 @@ func TestBaseClient_GetBlockTransactionCountByHash(t *testing.T) { } transactionCount, err := client.GetBlockTransactionCountByHash( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -395,7 +396,7 @@ const mockGetBlockTransactionCountByNumberRequest = ` "id": 1, "method": "eth_getBlockTransactionCountByNumber", "params": [ - "0x1" + "0x1" ] } ` @@ -421,7 +422,7 @@ func TestBaseClient_GetBlockTransactionCountByNumber(t *testing.T) { } transactionCount, err := client.GetBlockTransactionCountByNumber( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), ) @@ -435,8 +436,8 @@ const mockGetUncleByBlockHashAndIndexRequest = ` "id": 1, "method": "eth_getUncleByBlockHashAndIndex", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", - "0x0" + "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x0" ] } ` @@ -454,7 +455,7 @@ func TestBaseClient_GetUncleByBlockHashAndIndex(t *testing.T) { } block, err := client.GetUncleByBlockHashAndIndex( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), 0, ) @@ -469,8 +470,8 @@ const mockGetUncleByBlockNumberAndIndexRequest = ` "id": 1, "method": "eth_getUncleByBlockNumberAndIndex", "params": [ - "0x1", - "0x2" + "0x1", + "0x2" ] } ` @@ -488,7 +489,7 @@ func TestBaseClient_GetUncleByBlockNumberAndIndex(t *testing.T) { } block, err := client.GetUncleByBlockNumberAndIndex( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), 2, ) @@ -503,7 +504,7 @@ const mockGetUncleCountByBlockHashRequest = ` "id": 1, "method": "eth_getUncleCountByBlockHash", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" + "0x1111111111111111111111111111111111111111111111111111111111111111" ] } ` @@ -529,7 +530,7 @@ func TestBaseClient_GetUncleCountByBlockHash(t *testing.T) { } uncleCount, err := client.GetUncleCountByBlockHash( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -543,7 +544,7 @@ const mockGetUncleCountByBlockNumberRequest = ` "id": 1, "method": "eth_getUncleCountByBlockNumber", "params": [ - "0x1" + "0x1" ] } ` @@ -569,7 +570,7 @@ func TestBaseClient_GetUncleCountByBlockNumber(t *testing.T) { } uncleCount, err := client.GetUncleCountByBlockNumber( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), ) @@ -593,7 +594,7 @@ const mockCallRequest = ` "value": "0x2540be400", "input": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" }, - "0x1" + "0x1" ] } ` @@ -625,16 +626,16 @@ func TestBaseClient_Call(t *testing.T) { value := big.NewInt(10000000000) input := hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333") response, err := client.Call( - context.Background(), + t.Context(), &types.CallLegacy{ - CallFields: types.CallFields{ + CallData: types.CallData{ From: from, To: to, GasLimit: &gasLimit, Value: value, Input: input, }, - LegacyPriceField: types.LegacyPriceField{ + LegacyPriceData: types.LegacyPriceData{ GasPrice: gasPrice, }, }, @@ -651,15 +652,15 @@ const mockEstimateGasRequest = ` "jsonrpc": "2.0", "method": "eth_estimateGas", "params": [ - { - "from": "0x1111111111111111111111111111111111111111", - "to": "0x2222222222222222222222222222222222222222", - "gas": "0x76c0", - "gasPrice": "0x9184e72a000", - "value": "0x2540be400", - "input": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" - }, - "latest" + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "value": "0x2540be400", + "input": "0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333" + }, + "latest" ] } ` @@ -686,16 +687,16 @@ func TestBaseClient_EstimateGas(t *testing.T) { gasLimit := uint64(30400) gas, err := client.EstimateGas( - context.Background(), + t.Context(), &types.CallLegacy{ - CallFields: types.CallFields{ + CallData: types.CallData{ From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), GasLimit: &gasLimit, Value: big.NewInt(10000000000), Input: hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), }, - LegacyPriceField: types.LegacyPriceField{ + LegacyPriceData: types.LegacyPriceData{ GasPrice: big.NewInt(10000000000000), }, }, @@ -707,22 +708,22 @@ func TestBaseClient_EstimateGas(t *testing.T) { } const mockSendRawTransactionRequest = ` - { - "jsonrpc": "2.0", - "id": 1, - "method": "eth_sendRawTransaction", - "params": [ - "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" - ] - } + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_sendRawTransaction", + "params": [ + "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" + ] + } ` const mockSendRawTransactionResponse = ` - { - "jsonrpc": "2.0", - "id": 1, - "result": "0x1111111111111111111111111111111111111111111111111111111111111111" - } + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111111111111111111111111111" + } ` func TestBaseClient_SendRawTransaction(t *testing.T) { @@ -738,7 +739,7 @@ func TestBaseClient_SendRawTransaction(t *testing.T) { } txHash, err := client.SendRawTransaction( - context.Background(), + t.Context(), hexutil.MustHexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), ) @@ -752,7 +753,7 @@ const mockGetTransactionByHashRequest = ` "id": 1, "method": "eth_getTransactionByHash", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" + "0x1111111111111111111111111111111111111111111111111111111111111111" ] } ` @@ -770,7 +771,7 @@ func TestBaseClient_GetTransactionByHash(t *testing.T) { } onChainTX, err := client.GetTransactionByHash( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -799,8 +800,8 @@ const mockGetTransactionByBlockHashAndIndexRequest = ` "jsonrpc": "2.0", "method": "eth_getTransactionByBlockHashAndIndex", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111", - "0x0" + "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x0" ] } ` @@ -818,7 +819,7 @@ func TestBaseClient_GetTransactionByBlockHashAndIndex(t *testing.T) { } onChainTX, err := client.GetTransactionByBlockHashAndIndex( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), 0, ) @@ -836,8 +837,8 @@ const mockGetTransactionByBlockNumberAndIndexRequest = ` "jsonrpc": "2.0", "method": "eth_getTransactionByBlockNumberAndIndex", "params": [ - "0x1", - "0x2" + "0x1", + "0x2" ] } ` @@ -855,7 +856,7 @@ func TestBaseClient_GetTransactionByBlockNumberAndIndex(t *testing.T) { } onChainTX, err := client.GetTransactionByBlockNumberAndIndex( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), 2, ) @@ -873,7 +874,7 @@ const mockGetTransactionReceiptRequest = ` "jsonrpc": "2.0", "method": "eth_getTransactionReceipt", "params": [ - "0x1111111111111111111111111111111111111111111111111111111111111111" + "0x1111111111111111111111111111111111111111111111111111111111111111" ] } ` @@ -883,34 +884,34 @@ const mockGetTransactionReceiptResponse = ` "jsonrpc": "2.0", "id": 1, "result": { - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "contractAddress": null, - "cumulativeGasUsed": "0x33333", - "effectiveGasPrice":"0x4444444444", - "from": "0x5555555555555555555555555555555555555555", - "gasUsed": "0x66666", - "logs": [ + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "contractAddress": null, + "cumulativeGasUsed": "0x33333", + "effectiveGasPrice":"0x4444444444", + "from": "0x5555555555555555555555555555555555555555", + "gasUsed": "0x66666", + "logs": [ { - "address": "0x7777777777777777777777777777777777777777", - "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", - "blockNumber": "0x2222", - "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", - "logIndex": "0x8", - "removed": false, - "topics": [ + "address": "0x7777777777777777777777777777777777777777", + "blockHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockNumber": "0x2222", + "data": "0x000000000000000000000000398137383b3d25c92898c656696e41950e47316b00000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e100000000000000000000000000000000000000000000000000000000005baf35", + "logIndex": "0x8", + "removed": false, + "topics": [ "0x9999999999999999999999999999999999999999999999999999999999999999" ], - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11" + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11" } ], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", - "status": "0x1", - "to": "0x7777777777777777777777777777777777777777", - "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "transactionIndex": "0x11", - "type": "0x0" + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000200000000000000000000000000000", + "status": "0x1", + "to": "0x7777777777777777777777777777777777777777", + "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "transactionIndex": "0x11", + "type": "0x0" } } ` @@ -928,7 +929,7 @@ func TestBaseClient_GetTransactionReceipt(t *testing.T) { } receipt, err := client.GetTransactionReceipt( - context.Background(), + t.Context(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -964,7 +965,7 @@ const mockGetBlockReceiptsRequest = ` "id": 1, "method": "eth_getBlockReceipts", "params": [ - "0x1" + "0x1" ] } ` @@ -991,7 +992,7 @@ const mockGetBlockReceiptsResponse = ` "logIndex": "0x8", "removed": false, "topics": [ - "0x9999999999999999999999999999999999999999999999999999999999999999" + "0x9999999999999999999999999999999999999999999999999999999999999999" ], "transactionHash": "0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "transactionIndex": "0x11" @@ -1021,7 +1022,7 @@ func TestBaseClient_GetBlockReceipts(t *testing.T) { } receipts, err := client.GetBlockReceipts( - context.Background(), + t.Context(), types.MustBlockNumberFromHex("0x1"), ) @@ -1065,7 +1066,7 @@ const mockGetLogsRequest = ` "toBlock": "0x2", "address": "0x3333333333333333333333333333333333333333", "topics": [ - "0x4444444444444444444444444444444444444444444444444444444444444444" + "0x4444444444444444444444444444444444444444444444444444444444444444" ] } ] @@ -1080,7 +1081,7 @@ const mockGetLogsResponse = ` { "address": "0x3333333333333333333333333333333333333333", "topics": [ - "0x4444444444444444444444444444444444444444444444444444444444444444" + "0x4444444444444444444444444444444444444444444444444444444444444444" ], "data": "0x68656c6c6f21", "blockNumber": "0x1", @@ -1108,7 +1109,7 @@ func TestBaseClient_GetLogs(t *testing.T) { from := types.MustBlockNumberFromHex("0x1") to := types.MustBlockNumberFromHex("0x2") - logs, err := client.GetLogs(context.Background(), &types.FilterLogsQuery{ + logs, err := client.GetLogs(t.Context(), &types.FilterLogsQuery{ FromBlock: &from, ToBlock: &to, Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, @@ -1116,6 +1117,7 @@ func TestBaseClient_GetLogs(t *testing.T) { {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, }, }) + require.NoError(t, err) require.Len(t, logs, 1) assert.Equal(t, types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), logs[0].Address) @@ -1160,7 +1162,7 @@ func TestBaseClient_ChainID(t *testing.T) { }, nil } - chainID, err := client.ChainID(context.Background()) + chainID, err := client.ChainID(t.Context()) require.NoError(t, err) assert.Equal(t, uint64(1), chainID) } @@ -1194,7 +1196,7 @@ func TestBaseClient_BlockNumber(t *testing.T) { }, nil } - blockNumber, err := client.BlockNumber(context.Background()) + blockNumber, err := client.BlockNumber(t.Context()) require.NoError(t, err) assert.Equal(t, big.NewInt(1), blockNumber) @@ -1229,7 +1231,8 @@ func TestBaseClient_GasPrice(t *testing.T) { }, nil } - gasPrice, err := client.GasPrice(context.Background()) + gasPrice, err := client.GasPrice(t.Context()) + require.NoError(t, err) assert.Equal(t, big.NewInt(10000000000000), gasPrice) } @@ -1263,7 +1266,8 @@ func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { }, nil } - gasPrice, err := client.MaxPriorityFeePerGas(context.Background()) + gasPrice, err := client.MaxPriorityFeePerGas(t.Context()) + require.NoError(t, err) assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) } @@ -1297,7 +1301,111 @@ func TestBaseClient_BlobBaseFee(t *testing.T) { }, nil } - gasPrice, err := client.BlobBaseFee(context.Background()) + gasPrice, err := client.BlobBaseFee(t.Context()) + require.NoError(t, err) assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) } + +func TestBaseClient_SubscribeNewHeads(t *testing.T) { + // TODO: Veirify + + streamMock := newStreamMock(t) + client := &MethodsCommon{Transport: streamMock} + + ch := make(chan json.RawMessage) + streamMock.SubscribeMocks = []subscribeMock{ + { + ArgMethod: "newHeads", + ArgParams: []any{}, + RetCh: ch, + RetID: "0x1", + RetErr: nil, + }, + } + streamMock.UnsubscribeMocks = []unsubscribeMock{ + { + ArgID: "0x1", + ResultErr: nil, + }, + } + + ctx, cancel := context.WithCancel(t.Context()) + defer cancel() + + resultCh, err := client.SubscribeNewHeads(ctx) + require.NoError(t, err) + assert.NotNil(t, resultCh) +} + +func TestBaseClient_SubscribeNewPendingTransactions(t *testing.T) { + // TODO: Veirify + + streamMock := newStreamMock(t) + client := &MethodsCommon{Transport: streamMock} + + ch := make(chan json.RawMessage) + streamMock.SubscribeMocks = []subscribeMock{ + { + ArgMethod: "newPendingTransactions", + ArgParams: []any{}, + RetCh: ch, + RetID: "0x2", + RetErr: nil, + }, + } + streamMock.UnsubscribeMocks = []unsubscribeMock{ + { + ArgID: "0x2", + ResultErr: nil, + }, + } + + ctx, cancel := context.WithCancel(t.Context()) + defer cancel() + + resultCh, err := client.SubscribeNewPendingTransactions(ctx) + require.NoError(t, err) + assert.NotNil(t, resultCh) +} + +func TestBaseClient_SubscribeLogs(t *testing.T) { + // TODO: Veirify + + streamMock := newStreamMock(t) + client := &MethodsCommon{Transport: streamMock} + + ch := make(chan json.RawMessage) + from := types.MustBlockNumberFromHex("0x1") + to := types.MustBlockNumberFromHex("0x2") + query := &types.FilterLogsQuery{ + FromBlock: &from, + ToBlock: &to, + Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, + Topics: [][]types.Hash{ + {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, + }, + } + streamMock.SubscribeMocks = []subscribeMock{ + { + ArgMethod: "logs", + ArgParams: []any{query}, + RetCh: ch, + RetID: "0x3", + RetErr: nil, + }, + } + streamMock.UnsubscribeMocks = []unsubscribeMock{ + { + ArgID: "0x3", + ResultErr: nil, + }, + } + + ctx, cancel := context.WithCancel(t.Context()) + defer cancel() + + resultCh, err := client.SubscribeLogs(ctx, query) + require.NoError(t, err) + assert.NotNil(t, resultCh) +} diff --git a/rpc/methods_filter_test.go b/rpc/methods_filter_test.go index 7438166..1165e2d 100644 --- a/rpc/methods_filter_test.go +++ b/rpc/methods_filter_test.go @@ -2,8 +2,8 @@ package rpc import ( "bytes" - "context" "io" + "math/big" "net/http" "testing" @@ -51,7 +51,7 @@ func TestBaseClient_NewFilter(t *testing.T) { from := types.MustBlockNumberFromHex("0x1") to := types.MustBlockNumberFromHex("0x2") - id, err := client.NewFilter(context.Background(), &types.FilterLogsQuery{ + id, err := client.NewFilter(t.Context(), &types.FilterLogsQuery{ FromBlock: &from, ToBlock: &to, Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, @@ -59,6 +59,255 @@ func TestBaseClient_NewFilter(t *testing.T) { {types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone)}, }, }) + require.NoError(t, err) assert.Equal(t, "1", id.String()) } + +const mockNewBlockFilterRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_newBlockFilter", + "params": [] + } +` + +const mockNewBlockFilterResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x2" + } +` + +func TestBaseClient_NewBlockFilter(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockNewBlockFilterRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockNewBlockFilterResponse)), + }, nil + } + + id, err := client.NewBlockFilter(t.Context()) + + require.NoError(t, err) + assert.Equal(t, "2", id.String()) +} + +const mockNewPendingTransactionFilterRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_newPendingTransactionFilter", + "params": [] + } +` + +const mockNewPendingTransactionFilterResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x3" + } +` + +func TestBaseClient_NewPendingTransactionFilter(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockNewPendingTransactionFilterRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockNewPendingTransactionFilterResponse)), + }, nil + } + + id, err := client.NewPendingTransactionFilter(t.Context()) + + require.NoError(t, err) + assert.Equal(t, "3", id.String()) +} + +const mockUninstallFilterRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_uninstallFilter", + "params": ["0x1"] + } +` + +const mockUninstallFilterResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": true + } +` + +func TestBaseClient_UninstallFilter(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockUninstallFilterRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockUninstallFilterResponse)), + }, nil + } + + result, err := client.UninstallFilter(t.Context(), big.NewInt(1)) + + require.NoError(t, err) + assert.True(t, result) +} + +const mockGetFilterChangesRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getFilterChanges", + "params": ["0x1"] + } +` + +const mockGetFilterChangesResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "address": "0x3333333333333333333333333333333333333333", + "topics": [ + "0x4444444444444444444444444444444444444444444444444444444444444444" + ], + "data": "0x68656c6c6f21", + "blockNumber": "0x1", + "transactionHash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "transactionIndex": "0x0", + "blockHash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "logIndex": "0x0", + "removed": false + } + ] + } +` + +func TestBaseClient_GetFilterChanges(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetFilterChangesRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetFilterChangesResponse)), + }, nil + } + + logs, err := client.GetFilterChanges(t.Context(), big.NewInt(1)) + + require.NoError(t, err) + require.Len(t, logs, 1) + assert.Equal(t, types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), logs[0].Address) + assert.Equal(t, types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].Topics[0]) +} + +const mockGetFilterLogsRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getFilterLogs", + "params": ["0x1"] + } +` + +const mockGetFilterLogsResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "address": "0x3333333333333333333333333333333333333333", + "topics": [ + "0x4444444444444444444444444444444444444444444444444444444444444444" + ], + "data": "0x68656c6c6f21", + "blockNumber": "0x2", + "transactionHash": "0x5555555555555555555555555555555555555555555555555555555555555555", + "transactionIndex": "0x1", + "blockHash": "0x5555555555555555555555555555555555555555555555555555555555555555", + "logIndex": "0x1", + "removed": false + } + ] + } +` + +func TestBaseClient_GetFilterLogs(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetFilterLogsRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetFilterLogsResponse)), + }, nil + } + + logs, err := client.GetFilterLogs(t.Context(), big.NewInt(1)) + + require.NoError(t, err) + require.Len(t, logs, 1) + assert.Equal(t, types.MustAddressFromHex("0x3333333333333333333333333333333333333333"), logs[0].Address) + assert.Equal(t, types.MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", types.PadNone), logs[0].Topics[0]) + assert.Equal(t, big.NewInt(2), logs[0].BlockNumber) +} + +const mockGetBlockFilterChangesRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getFilterChanges", + "params": ["0x2"] + } +` + +const mockGetBlockFilterChangesResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + "0x1111111111111111111111111111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222222222222222222222222222" + ] + } +` + +func TestBaseClient_GetBlockFilterChanges(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsFilter{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetBlockFilterChangesRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetBlockFilterChangesResponse)), + }, nil + } + + hashes, err := client.GetBlockFilterChanges(t.Context(), big.NewInt(2)) + + require.NoError(t, err) + require.Len(t, hashes, 2) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), hashes[0]) + assert.Equal(t, types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), hashes[1]) +} diff --git a/rpc/methods_privatetransactions_test.go b/rpc/methods_privatetransactions_test.go new file mode 100644 index 0000000..cee3906 --- /dev/null +++ b/rpc/methods_privatetransactions_test.go @@ -0,0 +1,94 @@ +package rpc + +import ( + "bytes" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/types" +) + +const mockCancelPrivateTransactionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_cancelPrivateTransaction", + "params": [ + "0x1111111111111111111111111111111111111111111111111111111111111111" + ] + } +` + +const mockCancelPrivateTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": true + } +` + +func TestBaseClient_CancelPrivateTransaction(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsPrivateTransaction{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockCancelPrivateTransactionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockCancelPrivateTransactionResponse)), + }, nil + } + + result, err := client.CancelPrivateTransaction( + t.Context(), + types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), + ) + + require.NoError(t, err) + assert.True(t, result) +} + +const mockSendPrivateTransactionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_sendPrivateTransaction", + "params": [ + "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" + ] + } +` + +const mockSendPrivateTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111111111111111111111111111" + } +` + +func TestBaseClient_SendPrivateTransaction(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsPrivateTransaction{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSendPrivateTransactionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSendPrivateTransactionResponse)), + }, nil + } + + txHash, err := client.SendPrivateTransaction( + t.Context(), + hexutil.MustHexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), + ) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) +} diff --git a/rpc/methods_wallet_test.go b/rpc/methods_wallet_test.go new file mode 100644 index 0000000..a64a6ab --- /dev/null +++ b/rpc/methods_wallet_test.go @@ -0,0 +1,202 @@ +package rpc + +import ( + "bytes" + "io" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/types" +) + +const mockAccountsRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_accounts", + "params": [] + } +` + +const mockAccountsResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + "0x1111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222" + ] + } +` + +func TestBaseClient_Accounts(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsWallet{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockAccountsRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockAccountsResponse)), + }, nil + } + + accounts, err := client.Accounts(t.Context()) + + require.NoError(t, err) + require.Len(t, accounts, 2) + assert.Equal(t, types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), accounts[0]) + assert.Equal(t, types.MustAddressFromHex("0x2222222222222222222222222222222222222222"), accounts[1]) +} + +const mockSignRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_sign", + "params": [ + "0x1111111111111111111111111111111111111111", + "0x48656c6c6f20576f726c64" + ] + } +` + +const mockSignResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x3333333333333333333333333333333333333333333333333333333333333333444444444444444444444444444444444444444444444444444444444444444455" + } +` + +func TestBaseClient_Sign(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsWallet{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSignRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSignResponse)), + }, nil + } + + signature, err := client.Sign( + t.Context(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + []byte("Hello World"), + ) + + require.NoError(t, err) + assert.Equal(t, hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333"), signature.R.Bytes()) + assert.Equal(t, hexutil.MustHexToBytes("0x4444444444444444444444444444444444444444444444444444444444444444"), signature.S.Bytes()) + assert.Equal(t, uint64(0x55), signature.V.Uint64()) +} + +const mockSignTransactionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_signTransaction", + "params": [ + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x5208", + "gasPrice": "0x9184e72a000", + "value": "0x2540be400", + "input": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" + } + ] + } +` + +const mockSignTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "raw": "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333" + } + } +` + +func TestBaseClient_SignTransaction(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsWallet{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSignTransactionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSignTransactionResponse)), + }, nil + } + + tx := types.NewTransactionLegacy() + tx.SetFrom(*types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111")) + tx.SetTo(*types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222")) + tx.SetValue(hexutil.MustHexToBigInt("0x2540be400")) + tx.SetGasLimit(0x5208) + tx.SetGasPrice(hexutil.MustHexToBigInt("0x9184e72a000")) + tx.SetInput(hexutil.MustHexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675")) + rawTx, err := client.SignTransaction(t.Context(), tx) + + require.NoError(t, err) + assert.Equal(t, "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333", hexutil.BytesToHex(rawTx)) +} + +const mockSendTransactionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_sendTransaction", + "params": [ + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x5208", + "gasPrice": "0x9184e72a000", + "value": "0x2540be400", + "input": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675" + } + ] + } +` + +const mockSendTransactionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111111111111111111111111111" + } +` + +func TestBaseClient_SendTransaction(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockSendTransactionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockSendTransactionResponse)), + }, nil + } + + tx := types.NewTransactionLegacy() + tx.SetFrom(*types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111")) + tx.SetTo(*types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222")) + tx.SetValue(hexutil.MustHexToBigInt("0x2540be400")) + tx.SetGasLimit(0x5208) + tx.SetGasPrice(hexutil.MustHexToBigInt("0x9184e72a000")) + tx.SetInput(hexutil.MustHexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675")) + txHash, err := client.SendTransaction(t.Context(), tx) + + require.NoError(t, err) + assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) +} diff --git a/rpc/rpc.go b/rpc/rpc.go new file mode 100644 index 0000000..81c28f7 --- /dev/null +++ b/rpc/rpc.go @@ -0,0 +1,3 @@ +// Package rpc provides a client for interacting with the Ethereum JSON-RPC +// API. +package rpc diff --git a/rpc/transport/combined.go b/rpc/transport/combined.go index e5aa031..fbcdd26 100644 --- a/rpc/transport/combined.go +++ b/rpc/transport/combined.go @@ -5,17 +5,17 @@ import ( "encoding/json" ) -// Combined is transport that uses separate transports for regular calls and +// Combined is a transport that uses separate transports for regular calls and // subscriptions. // -// It is recommended by some RPC providers to use HTTP for regular calls and -// WebSockets for subscriptions. +// Some RPC providers recommend using HTTP for regular calls and WebSockets for +// subscriptions. type Combined struct { calls Transport subs SubscriptionTransport } -// NewCombined creates a new Combined transport. +// NewCombined creates a new [Combined] instance. func NewCombined(call Transport, subscriber SubscriptionTransport) *Combined { return &Combined{ calls: call, @@ -23,17 +23,17 @@ func NewCombined(call Transport, subscriber SubscriptionTransport) *Combined { } } -// Call implements the Transport interface. +// Call implements the [Transport] interface. func (c *Combined) Call(ctx context.Context, result any, method string, args ...any) error { return c.calls.Call(ctx, result, method, args...) } -// Subscribe implements the SubscriptionTransport interface. +// Subscribe implements the [SubscriptionTransport] interface. func (c *Combined) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { return c.subs.Subscribe(ctx, method, args...) } -// Unsubscribe implements the SubscriptionTransport interface. +// Unsubscribe implements the [SubscriptionTransport] interface. func (c *Combined) Unsubscribe(ctx context.Context, id string) error { return c.subs.Unsubscribe(ctx, id) } diff --git a/rpc/transport/error_test.go b/rpc/transport/error_test.go deleted file mode 100644 index 339d7ce..0000000 --- a/rpc/transport/error_test.go +++ /dev/null @@ -1,50 +0,0 @@ -package transport - -import ( - "testing" - - "github.com/stretchr/testify/assert" - - "github.com/defiweb/go-eth/hexutil" -) - -func TestNewRPCError(t *testing.T) { - tests := []struct { - name string - code int - message string - data any - expected *RPCError - }{ - { - name: "error with non-hex data", - code: ErrCodeGeneral, - message: "Unauthorized access", - data: "some data", - expected: &RPCError{ - Code: ErrCodeGeneral, - Message: "Unauthorized access", - Data: "some data", - }, - }, - { - name: "error with hex data", - code: ErrCodeGeneral, - message: "Invalid request", - data: "0x68656c6c6f", - expected: &RPCError{ - Code: ErrCodeGeneral, - Message: "Invalid request", - Data: hexutil.MustHexToBytes("0x68656c6c6f"), - }, - }, - // Add more test cases as needed - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - actual := NewRPCError(tt.code, tt.message, tt.data) - assert.Equal(t, tt.expected, actual) - }) - } -} diff --git a/rpc/transport/hijack.go b/rpc/transport/hijack.go index 0351894..9f2b982 100644 --- a/rpc/transport/hijack.go +++ b/rpc/transport/hijack.go @@ -5,45 +5,44 @@ import ( "encoding/json" ) -const hijackerKey = "goeth_transport_hijackers" +// Hijacker intercepts and modifies calls to the underlying [Transport] using +// the middleware pattern. +// +// The 'next' function should be called to continue the call chain. +// +// The transport provided to 'next' is the underlying [Transport] instance; +// using it will bypass any subsequent hijackers. +type Hijacker interface { + // Call returns a [CallFunc] that intercepts and modifies + // the 'Call' method. + // + // If nil is returned, no middleware is applied. + Call() func(next CallFunc) CallFunc + + // Subscribe returns a [SubscribeFunc] that intercepts and modifies + // the 'Subscribe' method. + // + // If nil is returned, no middleware is applied. + Subscribe() func(next SubscribeFunc) SubscribeFunc + + // Unsubscribe returns an [UnsubscribeFunc that intercepts and modifies + // the 'Unsubscribe' method. + // + // If nil is returned, no middleware is applied. + Unsubscribe() func(next UnsubscribeFunc) UnsubscribeFunc +} type ( - // Hijacker is used to intercept and modify calls to the underlying - // Transport. It employs the middleware pattern to facilitate the use of - // multiple hijackers. The 'next' function should be invoked to proceed - // with the call chain. The transport provided to the 'next' function is an - // instance of the underlying Transport. Using it will bypass any - // subsequent hijackers. - Hijacker interface { - // Call returns a CallFunc that intercepts and modifies the Call - // method. If nil is returned, the Call method is not modified. - Call() func(next CallFunc) CallFunc - - // Subscribe returns a SubscribeFunc that intercepts and modifies the - // Subscribe method. If nil is returned, the Subscribe method is not - // modified. - Subscribe() func(next SubscribeFunc) SubscribeFunc - - // Unsubscribe returns an UnsubscribeFunc that intercepts and modifies - // the Unsubscribe method. If nil is returned, the Unsubscribe method - // is not modified. - Unsubscribe() func(next UnsubscribeFunc) UnsubscribeFunc - } - CallFunc func(ctx context.Context, t Transport, result any, method string, args ...any) error SubscribeFunc func(ctx context.Context, t SubscriptionTransport, method string, args ...any) (ch chan json.RawMessage, id string, err error) UnsubscribeFunc func(ctx context.Context, t SubscriptionTransport, id string) error ) -// Hijack is a wrapper around another Transport that allows for hijacking -// and modifying the behavior of the underlying Transport. -// -// To use Hijack, create a new Hijack instance with the underlying Transport -// and then use the Use method to add any number of hijackers. The hijackers -// will be called in the order they are added. +// Hijack is a wrapper around another [Transport] that allows hijacking +// and modifying the behavior of the underlying [Transport] using the +// middleware pattern. // -// Hijackers must implement one or more of the Hijacker, SubscribeHijacker, -// and UnsubscribeHijacker interfaces. +// Hijackers must implement one or more of the Hijacker interface methods. type Hijack struct { transport Transport callFunc CallFunc @@ -51,6 +50,7 @@ type Hijack struct { unsubFunc UnsubscribeFunc } +// NewHijacker creates a new [Hijack] instance. func NewHijacker(t Transport, hs ...Hijacker) *Hijack { h := &Hijack{ transport: t, @@ -62,6 +62,7 @@ func NewHijacker(t Transport, hs ...Hijacker) *Hijack { return h } +// Use adds hijackers in the order they are provided. func (h *Hijack) Use(hs ...Hijacker) { for _, m := range hs { if m == nil { @@ -79,13 +80,11 @@ func (h *Hijack) Use(hs ...Hijacker) { } } +// Call implements the [Transport] interface. func (h *Hijack) Call(ctx context.Context, result any, method string, args ...any) error { hs := getHijackers(ctx) - if len(hs) == 0 { - return h.callFunc(ctx, h.transport, result, method, args...) - } fn := h.callFunc - for i := len(hs) - 1; i >= 0; i-- { + for i := 0; i < len(hs); i++ { if call := hs[i].Call(); call != nil { fn = call(fn) } @@ -93,26 +92,46 @@ func (h *Hijack) Call(ctx context.Context, result any, method string, args ...an return fn(ctx, h.transport, result, method, args...) } +// Subscribe implements the [SubscriptionTransport] interface. func (h *Hijack) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { if s, ok := h.transport.(SubscriptionTransport); ok { - return h.subFunc(ctx, s, method, args...) + hs := getHijackers(ctx) + fn := h.subFunc + for i := 0; i < len(hs); i++ { + if sub := hs[i].Subscribe(); sub != nil { + fn = sub(fn) + } + } + return fn(ctx, s, method, args...) } return nil, "", ErrNotSubscriptionTransport } +// Unsubscribe implements the [SubscriptionTransport] interface. func (h *Hijack) Unsubscribe(ctx context.Context, id string) error { if s, ok := h.transport.(SubscriptionTransport); ok { - return h.unsubFunc(ctx, s, id) + hs := getHijackers(ctx) + fn := h.unsubFunc + for i := 0; i < len(hs); i++ { + if unsub := hs[i].Unsubscribe(); unsub != nil { + fn = unsub(fn) + } + } + return fn(ctx, s, id) } return ErrNotSubscriptionTransport } +// WithHijackers returns a new context with the provided hijackers added to it. +// +// This allows you to pass hijackers down the call chain. The provided hijackers +// will be appended to any existing hijackers in the context. func WithHijackers(ctx context.Context, hs ...Hijacker) context.Context { - return context.WithValue(ctx, hijackerKey, append(getHijackers(ctx), hs...)) + return context.WithValue(ctx, hijackerContextKey{}, append(getHijackers(ctx), hs...)) } func getHijackers(ctx context.Context) []Hijacker { - if hs, ok := ctx.Value(hijackerKey).([]Hijacker); ok { + if hs, ok := ctx.Value(hijackerContextKey{}).([]Hijacker); ok { return hs } return nil @@ -129,3 +148,5 @@ func defSub(ctx context.Context, t SubscriptionTransport, method string, args .. func defUnsub(ctx context.Context, t SubscriptionTransport, id string) error { return t.Unsubscribe(ctx, id) } + +type hijackerContextKey struct{} diff --git a/rpc/transport/hijack_test.go b/rpc/transport/hijack_test.go new file mode 100644 index 0000000..c71fc47 --- /dev/null +++ b/rpc/transport/hijack_test.go @@ -0,0 +1,169 @@ +package transport + +import ( + "context" + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestHijacker(t *testing.T) { + tests := []struct { + transport *mockTransport + asserts func(t *testing.T, f *mockTransport, h *Hijack) + }{ + // Test with no hijackers. + { + transport: newMockTransport(), + asserts: func(t *testing.T, f *mockTransport, h *Hijack) { + go func() { + f.callResult <- nil + f.subResult <- nil + f.unsubResult <- nil + }() + err := h.Call(t.Context(), nil, "foo") + require.NoError(t, err) + + _, _, err = h.Subscribe(t.Context(), "bar") + require.NoError(t, err) + + err = h.Unsubscribe(t.Context(), "baz") + require.NoError(t, err) + + require.Equal(t, 1, f.callCount) + require.Equal(t, 1, f.subCount) + require.Equal(t, 1, f.unsubCount) + }, + }, + // Test the order of hijackers. + { + transport: newMockTransport(), + asserts: func(t *testing.T, f *mockTransport, h *Hijack) { + var order []string + + h.Use(&mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call1") + return next(ctx, t, result, method, args...) + } + }}) + + h.Use(&mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call2") + return next(ctx, t, result, method, args...) + } + }}) + + go func() { + f.callResult <- nil + }() + err := h.Call(t.Context(), nil, "foo") + require.NoError(t, err) + + assert.Equal(t, []string{"call2", "call1"}, order) + assert.Equal(t, 1, f.callCount) + }, + }, + // Test the order of context hijackers. + { + transport: newMockTransport(), + asserts: func(t *testing.T, f *mockTransport, h *Hijack) { + var order []string + + ctx := WithHijackers(t.Context(), &mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call1") + return next(ctx, t, result, method, args...) + } + }}) + + ctx = WithHijackers(ctx, &mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call2") + return next(ctx, t, result, method, args...) + } + }}) + + go func() { + f.callResult <- nil + }() + err := h.Call(ctx, nil, "foo") + require.NoError(t, err) + + assert.Equal(t, []string{"call2", "call1"}, order) + assert.Equal(t, 1, f.callCount) + }, + }, + // Test the order of hijackers in context mixed with the "Use" method. + { + transport: newMockTransport(), + asserts: func(t *testing.T, f *mockTransport, h *Hijack) { + var order []string + + h.Use(&mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call1") + return next(ctx, t, result, method, args...) + } + }}) + + h.Use(&mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call2") + return next(ctx, t, result, method, args...) + } + }}) + + ctx := WithHijackers(t.Context(), &mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call3") + return next(ctx, t, result, method, args...) + } + }}) + + ctx = WithHijackers(ctx, &mockHijacker{callFn: func(next CallFunc) CallFunc { + return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { + order = append(order, "call4") + return next(ctx, t, result, method, args...) + } + }}) + + go func() { + f.callResult <- nil + }() + err := h.Call(ctx, nil, "foo") + require.NoError(t, err) + + assert.Equal(t, []string{"call4", "call3", "call2", "call1"}, order) + assert.Equal(t, 1, f.callCount) + }, + }, + } + for n, test := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + h := NewHijacker(test.transport) + test.asserts(t, test.transport, h) + }) + } +} + +type mockHijacker struct { + callFn func(next CallFunc) CallFunc + subFn func(next SubscribeFunc) SubscribeFunc + unsubFn func(next UnsubscribeFunc) UnsubscribeFunc +} + +func (m *mockHijacker) Call() func(next CallFunc) CallFunc { + return m.callFn +} + +func (m *mockHijacker) Subscribe() func(next SubscribeFunc) SubscribeFunc { + return m.subFn +} + +func (m *mockHijacker) Unsubscribe() func(next UnsubscribeFunc) UnsubscribeFunc { + return m.unsubFn +} diff --git a/rpc/transport/http.go b/rpc/transport/http.go index dd04655..df2dc33 100644 --- a/rpc/transport/http.go +++ b/rpc/transport/http.go @@ -10,13 +10,13 @@ import ( "sync/atomic" ) -// HTTP is a Transport implementation that uses the HTTP protocol. +// HTTP is a [Transport] implementation that uses the HTTP protocol. type HTTP struct { opts HTTPOptions id uint64 } -// HTTPOptions contains options for the HTTP transport. +// HTTPOptions contains options for the [HTTP] transport. type HTTPOptions struct { // URL of the HTTP endpoint. URL string @@ -29,7 +29,7 @@ type HTTPOptions struct { HTTPHeader http.Header } -// NewHTTP creates a new HTTP instance. +// NewHTTP creates a new [HTTP] instance. func NewHTTP(opts HTTPOptions) (*HTTP, error) { if opts.URL == "" { return nil, errors.New("URL cannot be empty") @@ -40,7 +40,7 @@ func NewHTTP(opts HTTPOptions) (*HTTP, error) { return &HTTP{opts: opts}, nil } -// Call implements the Transport interface. +// Call implements the [Transport] interface. func (h *HTTP) Call(ctx context.Context, result any, method string, args ...any) error { id := atomic.AddUint64(&h.id, 1) rpcReq, err := newRPCRequest(&id, method, args) diff --git a/rpc/transport/http_test.go b/rpc/transport/http_test.go index 472680f..cb55daa 100644 --- a/rpc/transport/http_test.go +++ b/rpc/transport/http_test.go @@ -28,7 +28,7 @@ type httpMock struct { //nolint:funlen func TestHTTP(t *testing.T) { - tests := []struct { + tc := []struct { asserts func(t *testing.T, h *httpMock) }{ // Simple request: @@ -126,7 +126,7 @@ func TestHTTP(t *testing.T) { }, }, } - for n, tt := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { h := &httpMock{} h.HTTP, _ = NewHTTP(HTTPOptions{ diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 5f460e9..1b99568 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -10,13 +10,13 @@ import ( "time" ) -// IPC is a Transport implementation that uses the IPC protocol. +// IPC is a [Transport] implementation that uses the IPC protocol. type IPC struct { *stream conn net.Conn } -// IPCOptions contains options for the IPC transport. +// IPCOptions contains options for the [IPC] transport. type IPCOptions struct { // Context used to close the connection. Context context.Context @@ -31,7 +31,7 @@ type IPCOptions struct { ErrorCh chan error } -// NewIPC creates a new IPC instance. +// NewIPC creates a new [IPC] instance. func NewIPC(opts IPCOptions) (*IPC, error) { var d net.Dialer conn, err := d.DialContext(opts.Context, "unix", opts.Path) diff --git a/rpc/transport/multiplex.go b/rpc/transport/multiplex.go deleted file mode 100644 index f497603..0000000 --- a/rpc/transport/multiplex.go +++ /dev/null @@ -1,71 +0,0 @@ -package transport - -import ( - "context" - "encoding/json" -) - -type Multiplex struct { - baseTransport Transport - txMultiplexTransports []Transport -} - -func NewMultiplex(baseTransport Transport, txMultiplexTransports ...Transport) *Multiplex { - return &Multiplex{ - baseTransport: baseTransport, - txMultiplexTransports: txMultiplexTransports, - } -} - -// Call implements the Transport interface. -func (c *Multiplex) Call(ctx context.Context, result any, method string, args ...any) error { - if shouldMultiplex(method) { - var ( - ok bool // True if at least one call was successful. - err error // The error of the last unsuccessful call. - ) - for _, txTransport := range c.txMultiplexTransports { - if ok { - // If there was a successful call, we still need to call the - // other transports, but we don't need to handle the result. - _ = txTransport.Call(ctx, nil, method, args...) - continue - } - callErr := txTransport.Call(ctx, result, method, args...) - if callErr != nil { - err = callErr - continue - } - ok = true - } - if !ok { - return err - } - } - return c.baseTransport.Call(ctx, result, method, args...) -} - -// Subscribe implements the SubscriptionTransport interface. -func (c *Multiplex) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { - if s, ok := c.baseTransport.(SubscriptionTransport); ok { - return s.Subscribe(ctx, method, args...) - } - return nil, "", ErrNotSubscriptionTransport -} - -// Unsubscribe implements the SubscriptionTransport interface. -func (c *Multiplex) Unsubscribe(ctx context.Context, id string) error { - if s, ok := c.baseTransport.(SubscriptionTransport); ok { - return s.Unsubscribe(ctx, id) - } - return ErrNotSubscriptionTransport -} - -func shouldMultiplex(method string) bool { - switch method { - case "eth_sendTransaction", "eth_sendRawTransaction", "eth_sendPrivateTransaction": - return true - default: - return false - } -} diff --git a/rpc/transport/retry.go b/rpc/transport/retry.go index a85c5e9..3ff6306 100644 --- a/rpc/transport/retry.go +++ b/rpc/transport/retry.go @@ -12,13 +12,14 @@ import ( var ErrNotSubscriptionTransport = errors.New("transport does not implement SubscriptionTransport") var ( - // RetryOnAnyError retries on any error except for the following: + // RetryOnAnyError retries on any error except for the following cases, + // where retrying does not make sense: // 3: Execution error. // -32700: Parse error. // -32600: Invalid request. // -32601: Method not found. // -32602: Invalid params. - // -32000: If error message starts with "execution reverted". + // -32000: If the error message starts with "execution reverted". RetryOnAnyError = func(err error) bool { // List of errors that should not be retried: switch errorCode(err) { @@ -33,7 +34,7 @@ var ( case ErrCodeInvalidParams: return false case ErrCodeGeneral: - rpcErr := &RPCError{} + var rpcErr *RPCError if errors.As(err, &rpcErr) { if strings.HasPrefix(rpcErr.Message, "execution reverted") { return false @@ -45,10 +46,10 @@ var ( return err != nil } - // RetryOnLimitExceeded retries on the following errors: + // RetryOnLimitExceeded retries only on the following errors: // -32005: Limit exceeded. // -32097: Rate limit reached (Blast). - // 429: Too many requests + // 429: Too many requests. RetryOnLimitExceeded = func(err error) bool { switch errorCode(err) { case ErrCodeLimitExceeded: @@ -62,7 +63,8 @@ var ( } ) -// ExponentialBackoffOptions contains options for the ExponentialBackoff function. +// ExponentialBackoffOptions contains options for the [ExponentialBackoff] +// function. type ExponentialBackoffOptions struct { // BaseDelay is the base delay before the first retry. BaseDelay time.Duration @@ -70,20 +72,23 @@ type ExponentialBackoffOptions struct { // MaxDelay is the maximum delay between retries. MaxDelay time.Duration - // ExponentialFactor is the exponential factor to use for calculating the delay. + // ExponentialFactor is the exponential factor to use for calculating the + // delay. + // // The delay is calculated as BaseDelay * ExponentialFactor ^ retryCount. ExponentialFactor float64 } var ( - // LinearBackoff returns a BackoffFunc that returns a constant delay. + // LinearBackoff returns a [BackoffFunc] that returns a constant delay. LinearBackoff = func(delay time.Duration) func(int) time.Duration { return func(_ int) time.Duration { return delay } } - // ExponentialBackoff returns a BackoffFunc that returns an exponential delay. + // ExponentialBackoff returns a [BackoffFunc] that returns an exponential delay. + // // The delay is calculated as BaseDelay * ExponentialFactor ^ retryCount. ExponentialBackoff = func(opts ExponentialBackoffOptions) func(int) time.Duration { return func(retryCount int) time.Duration { @@ -96,30 +101,31 @@ var ( } ) -// Retry is a wrapper around another transport that retries requests. +// Retry wraps another [Transport] and retries requests on failure. type Retry struct { opts RetryOptions } -// RetryOptions contains options for the Retry transport. +// RetryOptions contains options for the [Retry] transport. type RetryOptions struct { // Transport is the underlying transport to use. Transport Transport // RetryFunc is a function that returns true if the request should be - // retried. The RetryOnAnyError and RetryOnLimitExceeded functions can be - // used or a custom function can be provided. + // retried. You can use [RetryOnAnyError], [RetryOnLimitExceeded], or + // provide a custom function. RetryFunc func(error) bool // BackoffFunc is a function that returns the delay before the next retry. // It takes the current retry count as an argument. BackoffFunc func(int) time.Duration - // MaxRetries is the maximum number of retries. If negative, there is no limit. + // MaxRetries is the maximum number of retries. + // If negative, there is no limit. MaxRetries int } -// NewRetry creates a new Retry instance. +// NewRetry creates a new [Retry] instance. func NewRetry(opts RetryOptions) (*Retry, error) { if opts.Transport == nil { return nil, errors.New("transport cannot be nil") @@ -136,7 +142,7 @@ func NewRetry(opts RetryOptions) (*Retry, error) { return &Retry{opts: opts}, nil } -// Call implements the Transport interface. +// Call implements the [Transport] interface. func (c *Retry) Call(ctx context.Context, result any, method string, args ...any) (err error) { var i int for { @@ -157,7 +163,7 @@ func (c *Retry) Call(ctx context.Context, result any, method string, args ...any return err } -// Subscribe implements the SubscriptionTransport interface. +// Subscribe implements the [SubscriptionTransport] interface. func (c *Retry) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { if s, ok := c.opts.Transport.(SubscriptionTransport); ok { var i int @@ -181,7 +187,7 @@ func (c *Retry) Subscribe(ctx context.Context, method string, args ...any) (ch c return nil, "", ErrNotSubscriptionTransport } -// Unsubscribe implements the SubscriptionTransport interface. +// Unsubscribe implements the [SubscriptionTransport] interface. func (c *Retry) Unsubscribe(ctx context.Context, id string) (err error) { if s, ok := c.opts.Transport.(SubscriptionTransport); ok { var i int diff --git a/rpc/transport/retry_test.go b/rpc/transport/retry_test.go index a8104df..95693aa 100644 --- a/rpc/transport/retry_test.go +++ b/rpc/transport/retry_test.go @@ -2,7 +2,6 @@ package transport import ( "context" - "encoding/json" "fmt" "testing" "time" @@ -10,54 +9,21 @@ import ( "github.com/stretchr/testify/require" ) -type fakeTransport struct { - callResult chan error - subResult chan error - unsubResult chan error - callCount int - subCount int - unsubCount int -} - -func newFakeTransport() *fakeTransport { - return &fakeTransport{ - callResult: make(chan error), - subResult: make(chan error), - unsubResult: make(chan error), - } -} - -func (f *fakeTransport) Call(ctx context.Context, result any, method string, args ...any) error { - f.callCount++ - return <-f.callResult -} - -func (f *fakeTransport) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { - f.subCount++ - err = <-f.subResult - return nil, "", err -} - -func (f *fakeTransport) Unsubscribe(ctx context.Context, id string) error { - f.unsubCount++ - return <-f.unsubResult -} - //nolint:funlen func TestRetry(t *testing.T) { - tests := []struct { + tc := []struct { retry RetryOptions - asserts func(t *testing.T, f *fakeTransport, r *Retry) + asserts func(t *testing.T, f *mockTransport, r *Retry) }{ // No retry on success (call). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.callResult <- nil }() @@ -71,12 +37,12 @@ func TestRetry(t *testing.T) { // No retry on success (subscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.subResult <- nil }() @@ -90,12 +56,12 @@ func TestRetry(t *testing.T) { // No retry on success (unsubscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.unsubResult <- nil }() @@ -109,12 +75,12 @@ func TestRetry(t *testing.T) { // Retry on error (call). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.callResult <- fmt.Errorf("foo") f.callResult <- nil @@ -129,12 +95,12 @@ func TestRetry(t *testing.T) { // Retry on error (subscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.subResult <- fmt.Errorf("foo") f.subResult <- nil @@ -149,12 +115,12 @@ func TestRetry(t *testing.T) { // Retry on error (unsubscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.unsubResult <- fmt.Errorf("foo") f.unsubResult <- nil @@ -169,12 +135,12 @@ func TestRetry(t *testing.T) { // Too many retries (call). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.callResult <- fmt.Errorf("foo") f.callResult <- fmt.Errorf("foo") @@ -189,12 +155,12 @@ func TestRetry(t *testing.T) { // Too many retries (subscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.subResult <- fmt.Errorf("foo") f.subResult <- fmt.Errorf("foo") @@ -209,12 +175,12 @@ func TestRetry(t *testing.T) { // Too many retries (unsubscribe). { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.unsubResult <- fmt.Errorf("foo") f.unsubResult <- fmt.Errorf("foo") @@ -229,12 +195,12 @@ func TestRetry(t *testing.T) { // Infinite retries until success { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: -1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.callResult <- fmt.Errorf("foo") f.callResult <- fmt.Errorf("foo") @@ -272,12 +238,12 @@ func TestRetry(t *testing.T) { // Infinite retries until context is canceled. { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: -1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { ctx, cancel := context.WithCancel(context.Background()) go func() { f.callResult <- fmt.Errorf("foo") @@ -306,12 +272,12 @@ func TestRetry(t *testing.T) { // Do not retry if RetryFunc returns false. { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: func(error) bool { return false }, BackoffFunc: LinearBackoff(0), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { go func() { f.callResult <- fmt.Errorf("foo") f.subResult <- fmt.Errorf("foo") @@ -334,12 +300,12 @@ func TestRetry(t *testing.T) { // Do not wait for backoff after the last retry. { retry: RetryOptions{ - Transport: newFakeTransport(), + Transport: newMockTransport(), MaxRetries: 1, RetryFunc: RetryOnAnyError, BackoffFunc: LinearBackoff(100 * time.Millisecond), }, - asserts: func(t *testing.T, f *fakeTransport, r *Retry) { + asserts: func(t *testing.T, f *mockTransport, r *Retry) { t0 := time.Now() go func() { f.callResult <- fmt.Errorf("foo") @@ -368,18 +334,18 @@ func TestRetry(t *testing.T) { }, }, } - for n, test := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - r, err := NewRetry(test.retry) + r, err := NewRetry(tt.retry) require.NoError(t, err) - test.asserts(t, r.opts.Transport.(*fakeTransport), r) + tt.asserts(t, r.opts.Transport.(*mockTransport), r) }) } } //nolint:dupl func TestRetryOnAnyError(t *testing.T) { - tests := []struct { + tc := []struct { err error want bool }{ @@ -444,17 +410,17 @@ func TestRetryOnAnyError(t *testing.T) { want: false, }, } - for n, test := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - got := RetryOnAnyError(test.err) - require.Equal(t, test.want, got) + got := RetryOnAnyError(tt.err) + require.Equal(t, tt.want, got) }) } } //nolint:dupl func TestRetryOnLimitExceeded(t *testing.T) { - tests := []struct { + tc := []struct { err error want bool }{ @@ -511,16 +477,16 @@ func TestRetryOnLimitExceeded(t *testing.T) { want: true, }, } - for n, test := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - got := RetryOnLimitExceeded(test.err) - require.Equal(t, test.want, got) + got := RetryOnLimitExceeded(tt.err) + require.Equal(t, tt.want, got) }) } } func TestLinearBackoff(t *testing.T) { - tests := []struct { + tc := []struct { delay time.Duration want []time.Duration }{ @@ -539,10 +505,10 @@ func TestLinearBackoff(t *testing.T) { }, }, } - for n, test := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - b := LinearBackoff(test.delay) - for i, want := range test.want { + b := LinearBackoff(tt.delay) + for i, want := range tt.want { got := b(i) require.Equal(t, want, got) } @@ -551,7 +517,7 @@ func TestLinearBackoff(t *testing.T) { } func TestExponentialBackoff(t *testing.T) { - tests := []struct { + tc := []struct { opts ExponentialBackoffOptions want []time.Duration }{ @@ -582,10 +548,10 @@ func TestExponentialBackoff(t *testing.T) { }, }, } - for n, test := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { - b := ExponentialBackoff(test.opts) - for i, want := range test.want { + b := ExponentialBackoff(tt.opts) + for i, want := range tt.want { got := b(i) require.Equal(t, want, got) } diff --git a/rpc/transport/router.go b/rpc/transport/router.go deleted file mode 100644 index 4e37ec1..0000000 --- a/rpc/transport/router.go +++ /dev/null @@ -1,45 +0,0 @@ -package transport - -/* -type Selector interface { - Select(ctx context.Context, count int, method string, args ...any) (Transport, error) -} - -type RoundRobinSelector struct { - selected int - transports []Transport -} - -func NewRoundRobinSelector(transports ...Transport) *RoundRobinSelector { - return &RoundRobinSelector{transports: transports} -} - -func (s *RoundRobinSelector) Select(_ context.Context, _ string, _ ...any) (Transport, error) { - s.selected = (s.selected + 1) % len(s.transports) - return s.transports[s.selected], nil -} - -type Router struct { - mu sync.Mutex - selector Selector -} - -func NewRouter(selector Selector) *Router { - return &Router{selector: selector} -} - -// Call implements the Transport interface. -func (c *Router) Call(ctx context.Context, result any, method string, args ...any) error { - transport, err := c.selectTransport(ctx, method, args...) - if err != nil { - return err - } - return transport.Call(ctx, result, method, args...) -} - -func (c *Router) selectTransport(ctx context.Context, method string, args ...any) (Transport, error) { - c.mu.Lock() - defer c.mu.Unlock() - return c.selector.Select(ctx, method, args...) -} -*/ diff --git a/rpc/transport/stream.go b/rpc/transport/stream.go index 79d67c6..165b7d3 100644 --- a/rpc/transport/stream.go +++ b/rpc/transport/stream.go @@ -30,7 +30,7 @@ type stream struct { } // initStream initializes the stream struct with default values and starts -// goroutines. +// the required goroutines. func (s *stream) initStream() *stream { s.writerCh = make(chan rpcRequest) s.readerCh = make(chan rpcResponse) @@ -41,7 +41,7 @@ func (s *stream) initStream() *stream { return s } -// Call implements the Transport interface. +// Call implements the [Transport] interface. func (s *stream) Call(ctx context.Context, result any, method string, args ...any) error { ctx, ctxCancel := context.WithTimeout(ctx, s.timeout) defer ctxCancel() @@ -62,7 +62,7 @@ func (s *stream) Call(ctx context.Context, result any, method string, args ...an s.writerCh <- req // Wait for the response. - // The response is handled by the streamRoutine. It will send the response + // The response is handled by streamRoutine, which sends the response // to the ch channel. select { case res := <-ch: @@ -84,7 +84,7 @@ func (s *stream) Call(ctx context.Context, result any, method string, args ...an return nil } -// Subscribe implements the SubscriptionTransport interface. +// Subscribe implements the [SubscriptionTransport] interface. func (s *stream) Subscribe(ctx context.Context, method string, args ...any) (chan json.RawMessage, string, error) { rawID := types.Number{} params := make([]any, 0, 2) @@ -101,7 +101,7 @@ func (s *stream) Subscribe(ctx context.Context, method string, args ...any) (cha return ch, id, nil } -// Unsubscribe implements the SubscriptionTransport interface. +// Unsubscribe implements the [SubscriptionTransport] interface. func (s *stream) Unsubscribe(ctx context.Context, id string) error { if !s.delSubCh(id) { return errors.New("unknown subscription") @@ -113,8 +113,8 @@ func (s *stream) Unsubscribe(ctx context.Context, id string) error { return s.Call(ctx, nil, "eth_unsubscribe", num) } -// readerRoutine reads messages from the stream connection and dispatches -// them to the appropriate channel. +// streamRoutine reads messages from the stream connection and dispatches +// them to the appropriate channels. func (s *stream) streamRoutine() { for { res, ok := <-s.readerCh @@ -157,17 +157,17 @@ func (s *stream) contextHandlerRoutine() { } } -// addCallCh adds a channel to the calls map. Incoming response that match the -// id will be sent to the given channel. Because message ids are unique, the -// channel must be deleted after the response is received using delCallCh. +// addCallCh adds a channel to the calls map. Incoming responses that match +// the id will be sent to the given channel. Because message ids are unique, +// the channel must be deleted after the response is received using delCallCh. func (s *stream) addCallCh(id uint64, ch chan rpcResponse) { s.mu.Lock() defer s.mu.Unlock() s.calls[id] = ch } -// addSubCh adds a channel to the subs map. Incoming subscription notifications -// that match the id will be sent to the given channel. +// addSubCh adds a channel to the subs map. Incoming subscription +// notifications that match the id will be sent to the given channel. func (s *stream) addSubCh(id string, ch chan json.RawMessage) { s.mu.Lock() defer s.mu.Unlock() @@ -207,8 +207,8 @@ func (s *stream) callChSend(id uint64, res rpcResponse) { } } -// subChSend sends a subscription notification to the channel that matches the -// id. +// subChSend sends a subscription notification to the channel that matches +// the id. func (s *stream) subChSend(id string, res json.RawMessage) { s.mu.RLock() defer s.mu.RUnlock() diff --git a/rpc/transport/transport.go b/rpc/transport/transport.go index ff49829..8fe6752 100644 --- a/rpc/transport/transport.go +++ b/rpc/transport/transport.go @@ -1,3 +1,5 @@ +// Package transport provides transport layer implementations for the Ethereum +// JSON-RPC API. package transport import ( @@ -13,7 +15,7 @@ type Transport interface { Call(ctx context.Context, result any, method string, args ...any) error } -// SubscriptionTransport is transport that supports subscriptions. +// SubscriptionTransport is a transport that supports subscriptions. type SubscriptionTransport interface { Transport @@ -26,12 +28,12 @@ type SubscriptionTransport interface { Unsubscribe(ctx context.Context, id string) error } -// New returns a new Transport instance based on the URL scheme. -// Supported schemes are: http, https, ws, wss. -// If scheme is empty, it will use IPC. +// New returns a new [Transport] instance based on the URL scheme. +// Supported schemes are: http, https, ws, and wss. +// If the scheme is empty, IPC will be used. // // The context is used to close the underlying connection when the transport -// uses a websocket or IPC. +// uses a WebSocket or IPC. func New(ctx context.Context, rpcURL string) (Transport, error) { url, err := netURL.Parse(rpcURL) if err != nil { diff --git a/rpc/transport/transport_test.go b/rpc/transport/transport_test.go new file mode 100644 index 0000000..5f3d929 --- /dev/null +++ b/rpc/transport/transport_test.go @@ -0,0 +1,39 @@ +package transport + +import ( + "context" + "encoding/json" +) + +type mockTransport struct { + callResult chan error + subResult chan error + unsubResult chan error + callCount int + subCount int + unsubCount int +} + +func newMockTransport() *mockTransport { + return &mockTransport{ + callResult: make(chan error), + subResult: make(chan error), + unsubResult: make(chan error), + } +} + +func (t *mockTransport) Call(ctx context.Context, result any, method string, args ...any) error { + t.callCount++ + return <-t.callResult +} + +func (t *mockTransport) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { + t.subCount++ + err = <-t.subResult + return nil, "", err +} + +func (t *mockTransport) Unsubscribe(ctx context.Context, id string) error { + t.unsubCount++ + return <-t.unsubResult +} diff --git a/rpc/transport/websocket.go b/rpc/transport/websocket.go index fb84b7e..bf27465 100644 --- a/rpc/transport/websocket.go +++ b/rpc/transport/websocket.go @@ -1,5 +1,3 @@ -//go:build !wasm && !tinygo - package transport import ( @@ -13,37 +11,35 @@ import ( "nhooyr.io/websocket/wsjson" ) -// Websocket is a Transport implementation that uses the websocket -// protocol. +// Websocket is a [Transport] implementation that uses the WebSocket protocol. type Websocket struct { *stream conn *websocket.Conn } -// WebsocketOptions contains options for the websocket transport. +// WebsocketOptions contains options for the [WebSocket] transport. type WebsocketOptions struct { - // Context used to close the connection. + // Context is used to close the connection. Context context.Context - // URL of the websocket endpoint. + // URL is the WebSocket endpoint. URL string - // HTTPClient is the HTTP client to use. If nil, http.DefaultClient is - // used. + // HTTPClient is the HTTP client to use. If nil, http.DefaultClient is used. HTTPClient *http.Client - // HTTPHeader specifies the HTTP headers to be included in the - // websocket handshake request. + // HTTPHeader specifies the HTTP headers to include in the WebSocket + // handshake request. HTTPHeader http.Header - // Timeout is the timeout for the websocket requests. Default is 60s. + // Timeout is the timeout for WebSocket requests. The default is 60s. Timout time.Duration // ErrorCh is an optional channel used to report errors. ErrorCh chan error } -// NewWebsocket creates a new Websocket instance. +// NewWebsocket creates a new [Websocket] instance. func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { if opts.URL == "" { return nil, errors.New("URL cannot be empty") @@ -77,9 +73,9 @@ func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { } func (ws *Websocket) readerRoutine() { - // The background context is used here because closing context will - // cause the nhooyr.io/websocket package to close a connection with - // a close code of 1008 (policy violation) which is not what we want. + // The background context is used here because closing the context will + // cause the nhooyr.io/websocket package to close the connection with a + // close code of 1008 (policy violation), which is not what we want. ctx := context.Background() for { res := rpcResponse{} diff --git a/rpc/transport/websocket_nowasm.go b/rpc/transport/websocket_nowasm.go deleted file mode 100644 index 5f9ff25..0000000 --- a/rpc/transport/websocket_nowasm.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build wasm || tinygo - -package transport - -import ( - "context" - "encoding/json" - "errors" - "net/http" - "time" -) - -// Websocket is a Transport implementation that uses the websocket -// protocol. -type Websocket struct{} - -// WebsocketOptions contains options for the websocket transport. -type WebsocketOptions struct { - // Context used to close the connection. - Context context.Context - - // URL of the websocket endpoint. - URL string - - // HTTPClient is the HTTP client to use. If nil, http.DefaultClient is - // used. - HTTPClient *http.Client - - // HTTPHeader specifies the HTTP headers to be included in the - // websocket handshake request. - HTTPHeader http.Header - - // Timeout is the timeout for the websocket requests. Default is 60s. - Timout time.Duration - - // ErrorCh is an optional channel used to report errors. - ErrorCh chan error -} - -// NewWebsocket creates a new Websocket instance. -func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { - return nil, errors.New("websocket transport is not supported in WASM") -} - -func (w *Websocket) Call(ctx context.Context, result any, method string, args ...any) error { - return errors.New("websocket transport is not supported in WASM") -} - -func (w *Websocket) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { - return nil, "", errors.New("websocket transport is not supported in WASM") -} - -func (w *Websocket) Unsubscribe(ctx context.Context, id string) error { - return errors.New("websocket transport is not supported in WASM") -} diff --git a/rpc/transport/websocket_test.go b/rpc/transport/websocket_test.go index dd2b424..92618d0 100644 --- a/rpc/transport/websocket_test.go +++ b/rpc/transport/websocket_test.go @@ -1,5 +1,3 @@ -//go:build !wasm && !tinygo - package transport import ( @@ -23,7 +21,7 @@ import ( //nolint:funlen func TestWebsocket(t *testing.T) { - tests := []struct { + tc := []struct { asserts func(t *testing.T, ws *Websocket, reqCh, resCh chan string) }{ // Simple case: @@ -123,7 +121,7 @@ func TestWebsocket(t *testing.T) { }, }, } - for n, tt := range tests { + for n, tt := range tc { t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { wg := sync.WaitGroup{} reqCh := make(chan string) // Received requests. diff --git a/rpc/util.go b/rpc/util.go index b75b480..d719aef 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -9,6 +9,133 @@ import ( "github.com/defiweb/go-eth/types" ) +// getTransactionData extracts the [types.TransactionData] from the given +// value. +func getTransactionData(v any) *types.TransactionData { + if td, ok := v.(types.HasTransactionData); ok { + return td.GetTransactionData() + } + return nil +} + +// getCallData extracts the [types.CallData] from the given value. +func getCallData(v any) *types.CallData { + if cd, ok := v.(types.HasCallData); ok { + return cd.GetCallData() + } + return nil +} + +// getLegacyPriceData extracts the [types.LegacyPriceData] from the given +// value. +func getLegacyPriceData(v any) *types.LegacyPriceData { + if lpc, ok := v.(types.HasLegacyPriceData); ok { + return lpc.GetLegacyPriceData() + } + return nil +} + +// getAccessListData extracts the [types.AccessListData] from the given value. +func getAccessListData(v any) *types.AccessListData { + if ald, ok := v.(types.HasAccessListData); ok { + return ald.GetAccessListData() + } + return nil +} + +// getDynamicFeeData extracts the [types.DynamicFeeData] from the given value. +func getDynamicFeeData(v any) *types.DynamicFeeData { + if dfd, ok := v.(types.HasDynamicFeeData); ok { + return dfd.GetDynamicFeeData() + } + return nil +} + +// convertTXToLegacyPrice converts a transaction to one that has legacy +// price data. +func convertTXToLegacyPrice(tx types.Transaction) types.Transaction { + if getLegacyPriceData(tx) != nil { + return tx + } + typ := types.LegacyTxType + if getAccessListData(tx) != nil { + typ = types.AccessListTxType + } + return convertTX(tx, typ) +} + +// convertTXToAccessList converts a transaction to one that has access list +// data. +func convertTXToDynamicFee(tx types.Transaction) types.Transaction { + if getDynamicFeeData(tx) != nil { + return tx + } + return convertTX(tx, types.DynamicFeeTxType) +} + +// convertTX converts a transaction to the specified type. +func convertTX(tx types.Transaction, typ types.TransactionType) types.Transaction { + if tx.Type() == typ { + return tx + } + switch typ { + case types.LegacyTxType: + ltx := types.NewTransactionLegacy() + ltx.SetTransactionData(*tx.GetTransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + ltx.SetCallData(*tx.GetCallData()) + } + if tx, ok := tx.(types.HasLegacyPriceData); ok { + ltx.SetLegacyPriceData(*tx.GetLegacyPriceData()) + } + return ltx + case types.AccessListTxType: + altx := types.NewTransactionAccessList() + altx.SetTransactionData(*tx.GetTransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + altx.SetCallData(*tx.GetCallData()) + } + if tx, ok := tx.(types.HasLegacyPriceData); ok { + altx.SetLegacyPriceData(*tx.GetLegacyPriceData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + altx.SetAccessListData(*tx.GetAccessListData()) + } + return altx + case types.DynamicFeeTxType: + dftx := types.NewTransactionDynamicFee() + dftx.SetTransactionData(*tx.GetTransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + dftx.SetCallData(*tx.GetCallData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + dftx.SetAccessListData(*tx.GetAccessListData()) + } + if tx, ok := tx.(types.HasDynamicFeeData); ok { + dftx.SetDynamicFeeData(*tx.GetDynamicFeeData()) + } + return dftx + case types.BlobTxType: + btx := types.NewTransactionBlob() + btx.SetTransactionData(*tx.GetTransactionData()) + if tx, ok := tx.(types.HasCallData); ok { + btx.SetCallData(*tx.GetCallData()) + } + if tx, ok := tx.(types.HasAccessListData); ok { + btx.SetAccessListData(*tx.GetAccessListData()) + } + if tx, ok := tx.(types.HasDynamicFeeData); ok { + btx.SetDynamicFeeData(*tx.GetDynamicFeeData()) + } + if tx, ok := tx.(types.HasBlobData); ok { + btx.SetBlobData(*tx.GetBlobData()) + } + return btx + default: + return nil + } +} + // subscribe creates a subscription to the given method and returns a channel // that will receive the subscription messages. The messages are unmarshalled // to the T type. The subscription is unsubscribed and channel closed when the @@ -53,10 +180,11 @@ type signTransactionResult struct { } func (s *signTransactionResult) UnmarshalJSON(input []byte) error { + type alias signTransactionResult if len(input) >= 2 && input[0] == '"' && input[len(input)-1] == '"' { return json.Unmarshal(input, &s.Raw) } - var dec signTransactionResult + var dec alias if err := json.Unmarshal(input, &dec); err != nil { return err } diff --git a/types/call.go b/types/call.go index c899d8d..f3642bb 100644 --- a/types/call.go +++ b/types/call.go @@ -7,41 +7,7 @@ type Call interface { json.Marshaler json.Unmarshaler - CallData -} - -// CallBasic represents a simplest Ethereum call. -type CallBasic struct { - CallFields -} - -// NewCall creates a new CallBasic. -func NewCall() *CallBasic { - return &CallBasic{} -} - -// Copy creates a deep copy of the CallBasic. -func (c *CallBasic) Copy() *CallBasic { - return &CallBasic{ - CallFields: *c.CallFields.Copy(), - } -} - -// MarshalJSON implements the json.Marshaler interface. -func (c CallBasic) MarshalJSON() ([]byte, error) { - j := &jsonCall{} - c.CallFields.toJSON(j) - return json.Marshal(j) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (c CallBasic) UnmarshalJSON(bytes []byte) error { - j := &jsonCall{} - if err := json.Unmarshal(bytes, &j); err != nil { - return err - } - c.CallFields.fromJSON(j) - return nil + HasCallData } type jsonCall struct { diff --git a/types/call_accesslist.go b/types/call_accesslist.go index d2c6914..0808680 100644 --- a/types/call_accesslist.go +++ b/types/call_accesslist.go @@ -9,9 +9,9 @@ import "encoding/json" // list that specifies a list of addresses and storage keys the transaction // plans to access. type CallAccessList struct { - CallFields - LegacyPriceField - AccessListField + CallData + LegacyPriceData + AccessListData } // NewCallAccessList creates a new CallAccessList. @@ -25,18 +25,18 @@ func (c *CallAccessList) Copy() *CallAccessList { return nil } return &CallAccessList{ - CallFields: *c.CallFields.Copy(), - LegacyPriceField: *c.LegacyPriceField.Copy(), - AccessListField: *c.AccessListField.Copy(), + CallData: *c.CallData.Copy(), + LegacyPriceData: *c.LegacyPriceData.Copy(), + AccessListData: *c.AccessListData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c *CallAccessList) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallFields.toJSON(j) - c.LegacyPriceField.toJSON(j) - c.AccessListField.toJSON(j) + c.CallData.toJSON(j) + c.LegacyPriceData.toJSON(j) + c.AccessListData.toJSON(j) return json.Marshal(j) } @@ -46,9 +46,9 @@ func (c *CallAccessList) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, j); err != nil { return err } - c.CallFields.fromJSON(j) - c.LegacyPriceField.fromJSON(j) - c.AccessListField.fromJSON(j) + c.CallData.fromJSON(j) + c.LegacyPriceData.fromJSON(j) + c.AccessListData.fromJSON(j) return nil } diff --git a/types/call_accesslist_test.go b/types/call_accesslist_test.go index c4e81ab..850c23f 100644 --- a/types/call_accesslist_test.go +++ b/types/call_accesslist_test.go @@ -22,17 +22,17 @@ func TestCallAccessList_JSON(t *testing.T) { { name: "all fields set", call: &CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ diff --git a/types/call_basic.go b/types/call_basic.go new file mode 100644 index 0000000..24258db --- /dev/null +++ b/types/call_basic.go @@ -0,0 +1,40 @@ +package types + +import "encoding/json" + +// CallBasic represents a simplest Ethereum call. +type CallBasic struct { + CallData +} + +// NewCall creates a new [CallBasic] instance. +func NewCall() *CallBasic { + // It is called NewCall instead of NewCallBasic because, most of the time, + // people do not care about the call type; they just want to execute a + // simple call without any special features. + return &CallBasic{} +} + +// Copy creates a deep copy of the CallBasic. +func (c *CallBasic) Copy() *CallBasic { + return &CallBasic{ + CallData: *c.CallData.Copy(), + } +} + +// MarshalJSON implements the json.Marshaler interface. +func (c CallBasic) MarshalJSON() ([]byte, error) { + j := &jsonCall{} + c.CallData.toJSON(j) + return json.Marshal(j) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (c CallBasic) UnmarshalJSON(bytes []byte) error { + j := &jsonCall{} + if err := json.Unmarshal(bytes, &j); err != nil { + return err + } + c.CallData.fromJSON(j) + return nil +} diff --git a/types/call_blob.go b/types/call_blob.go index af57b7f..ebc01e8 100644 --- a/types/call_blob.go +++ b/types/call_blob.go @@ -9,10 +9,10 @@ import ( // Introduced by EIP-4844, this transaction type adds support for blob-carrying // transactions. type CallBlob struct { - CallFields - AccessListField - DynamicFeeFields - BlobFields + CallData + AccessListData + DynamicFeeData + BlobData } // NewCallBlob creates a new CallBlob. @@ -26,20 +26,20 @@ func (c *CallBlob) Copy() *CallBlob { return nil } return &CallBlob{ - CallFields: *c.CallFields.Copy(), - AccessListField: *c.AccessListField.Copy(), - DynamicFeeFields: *c.DynamicFeeFields.Copy(), - BlobFields: *c.BlobFields.Copy(), + CallData: *c.CallData.Copy(), + AccessListData: *c.AccessListData.Copy(), + DynamicFeeData: *c.DynamicFeeData.Copy(), + BlobData: *c.BlobData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c *CallBlob) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallFields.toJSON(j) - c.AccessListField.toJSON(j) - c.DynamicFeeFields.toJSON(j) - c.BlobFields.toJSON(j) + c.CallData.toJSON(j) + c.AccessListData.toJSON(j) + c.DynamicFeeData.toJSON(j) + c.BlobData.toJSON(j) return json.Marshal(j) } @@ -49,10 +49,10 @@ func (c *CallBlob) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallFields.fromJSON(j) - c.AccessListField.fromJSON(j) - c.DynamicFeeFields.fromJSON(j) - c.BlobFields.fromJSON(j) + c.CallData.fromJSON(j) + c.AccessListData.fromJSON(j) + c.DynamicFeeData.fromJSON(j) + c.BlobData.fromJSON(j) return nil } diff --git a/types/call_blob_test.go b/types/call_blob_test.go index fe1cf7b..923f8c2 100644 --- a/types/call_blob_test.go +++ b/types/call_blob_test.go @@ -24,18 +24,18 @@ func TestCallBlob_JSON(t *testing.T) { { name: "all fields set", call: &CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -44,7 +44,7 @@ func TestCallBlob_JSON(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, @@ -79,18 +79,18 @@ func TestCallBlob_JSON(t *testing.T) { { name: "blobs with shortened zero fields", call: &CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -99,7 +99,7 @@ func TestCallBlob_JSON(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ newBlob("blob1"), diff --git a/types/call_dynamicfee.go b/types/call_dynamicfee.go index f9634d4..f2620f7 100644 --- a/types/call_dynamicfee.go +++ b/types/call_dynamicfee.go @@ -8,9 +8,9 @@ import "encoding/json" // Introduced by EIP-1559, this transaction type supports a new fee market // mechanism with a base fee and a priority fee (tip). type CallDynamicFee struct { - CallFields - DynamicFeeFields - AccessListField + CallData + DynamicFeeData + AccessListData } // NewCallDynamicFee creates a new CallDynamicFee. @@ -24,18 +24,18 @@ func (c *CallDynamicFee) Copy() *CallDynamicFee { return nil } return &CallDynamicFee{ - CallFields: *c.CallFields.Copy(), - DynamicFeeFields: *c.DynamicFeeFields.Copy(), - AccessListField: *c.AccessListField.Copy(), + CallData: *c.CallData.Copy(), + DynamicFeeData: *c.DynamicFeeData.Copy(), + AccessListData: *c.AccessListData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c *CallDynamicFee) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallFields.toJSON(j) - c.DynamicFeeFields.toJSON(j) - c.AccessListField.toJSON(j) + c.CallData.toJSON(j) + c.DynamicFeeData.toJSON(j) + c.AccessListData.toJSON(j) return json.Marshal(j) } @@ -45,9 +45,9 @@ func (c *CallDynamicFee) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallFields.fromJSON(j) - c.DynamicFeeFields.fromJSON(j) - c.AccessListField.fromJSON(j) + c.CallData.fromJSON(j) + c.DynamicFeeData.fromJSON(j) + c.AccessListData.fromJSON(j) return nil } diff --git a/types/call_dynamicfee_test.go b/types/call_dynamicfee_test.go index b071abb..3e31b4d 100644 --- a/types/call_dynamicfee_test.go +++ b/types/call_dynamicfee_test.go @@ -22,18 +22,18 @@ func TestCallDynamicFee_JSON(t *testing.T) { { name: "all fields set", call: &CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ diff --git a/types/call_legacy.go b/types/call_legacy.go index 8c504b6..ee3a2df 100644 --- a/types/call_legacy.go +++ b/types/call_legacy.go @@ -4,8 +4,8 @@ import "encoding/json" // CallLegacy represents a call corresponding to the legacy transaction type. type CallLegacy struct { - CallFields - LegacyPriceField + CallData + LegacyPriceData } // NewCallLegacy creates a new CallLegacy. @@ -19,16 +19,16 @@ func (c *CallLegacy) Copy() *CallLegacy { return nil } return &CallLegacy{ - CallFields: *c.CallFields.Copy(), - LegacyPriceField: *c.LegacyPriceField.Copy(), + CallData: *c.CallData.Copy(), + LegacyPriceData: *c.LegacyPriceData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c CallLegacy) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallFields.toJSON(j) - c.LegacyPriceField.toJSON(j) + c.CallData.toJSON(j) + c.LegacyPriceData.toJSON(j) return json.Marshal(j) } @@ -38,8 +38,8 @@ func (c *CallLegacy) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallFields.fromJSON(j) - c.LegacyPriceField.fromJSON(j) + c.CallData.fromJSON(j) + c.LegacyPriceData.fromJSON(j) return nil } diff --git a/types/call_legacy_test.go b/types/call_legacy_test.go index 9f350a4..0f6f09f 100644 --- a/types/call_legacy_test.go +++ b/types/call_legacy_test.go @@ -22,14 +22,14 @@ func TestCallLegacy_JSON(t *testing.T) { { name: "all fields set", call: &CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, diff --git a/types/embed.go b/types/embed.go index 0348ece..b4a09fd 100644 --- a/types/embed.go +++ b/types/embed.go @@ -6,95 +6,97 @@ import ( "github.com/defiweb/go-eth/crypto/kzg4844" ) -// Below types are used to embed common fields and methods into call and -// transaction types. You probably do not want to use them directly. -// -// Below interfaces are used to determine if a given call or transaction has -// specific capabilities. +// The following interfaces are used to determine if a given call or +// transaction has specific capabilities. -// TransactionData defines methods for accessing and setting transaction -// data. -type TransactionData interface { - TransactionData() *TransactionFields - SetTransactionData(data TransactionFields) +// HasTransactionData specifes that the type has basic transaction +// data fields like chain ID, nonce, and signature. +type HasTransactionData interface { + GetTransactionData() *TransactionData + SetTransactionData(data TransactionData) } -// CallData defines methods for accessing and setting call data. -type CallData interface { - CallData() *CallFields - SetCallData(data CallFields) +// HasCallData specifies that the type has basic call data fields +// like from, to, gas limit, value, and input. +type HasCallData interface { + GetCallData() *CallData + SetCallData(data CallData) } -// LegacyPriceData defines methods for accessing and setting legacy price data. -type LegacyPriceData interface { - LegacyPriceData() *LegacyPriceField - SetLegacyPriceData(data LegacyPriceField) +// HasLegacyPriceData specifies that the type uses legacy price data. +type HasLegacyPriceData interface { + GetLegacyPriceData() *LegacyPriceData + SetLegacyPriceData(data LegacyPriceData) } -// AccessListData defines methods for accessing and setting access list -// data. -type AccessListData interface { - AccessListData() *AccessListField - SetAccessListData(data AccessListField) +// HasAccessListData specifies that the type uses access list for EIP-2930 +// transactions. +type HasAccessListData interface { + GetAccessListData() *AccessListData + SetAccessListData(data AccessListData) } -// DynamicFeeData defines methods for accessing and setting dynamic fee`1 -// data. -type DynamicFeeData interface { - DynamicFeeData() *DynamicFeeFields - SetDynamicFeeData(data DynamicFeeFields) +// HasDynamicFeeData specifies that the type uses dynamic fee data for EIP-1559 +// transactions. +type HasDynamicFeeData interface { + GetDynamicFeeData() *DynamicFeeData + SetDynamicFeeData(data DynamicFeeData) } -// BlobData defines methods for accessing and setting blob data. -type BlobData interface { - BlobData() *BlobFields - SetBlobData(data BlobFields) +// HasBlobData specifies that the type uses blob data for EIP-4844 +// transactions. +type HasBlobData interface { + GetBlobData() *BlobData + SetBlobData(data BlobData) } -// TransactionFields contains common fields for transactions. +// The following types are used to embed common fields and methods into call +// and transaction types. You probably do not want to use them directly. + +// TransactionData contains common fields for transactions. // // This type is used to embed transaction data into other types. -type TransactionFields struct { +type TransactionData struct { ChainID *uint64 // ChainID is the chain ID. Nonce *uint64 // Nonce is the transaction nonce. Signature *Signature // Signature is the transaction signature. } -// TransactionData returns the embedded transaction data. -func (c *TransactionFields) TransactionData() *TransactionFields { +// GetTransactionData returns the embedded transaction data. +func (c *TransactionData) GetTransactionData() *TransactionData { return c } // SetTransactionData sets the embedded transaction data. -func (c *TransactionFields) SetTransactionData(data TransactionFields) { +func (c *TransactionData) SetTransactionData(data TransactionData) { *c = data } // SetChainID sets the chain ID. -func (c *TransactionFields) SetChainID(chainID uint64) { +func (c *TransactionData) SetChainID(chainID uint64) { c.ChainID = &chainID } // SetNonce sets the transaction nonce. -func (c *TransactionFields) SetNonce(nonce uint64) { +func (c *TransactionData) SetNonce(nonce uint64) { c.Nonce = &nonce } // SetSignature sets the transaction signature. -func (c *TransactionFields) SetSignature(signature Signature) { +func (c *TransactionData) SetSignature(signature Signature) { c.Signature = &signature } // Copy creates a deep copy of the TransactionFields. -func (c *TransactionFields) Copy() *TransactionFields { - return &TransactionFields{ +func (c *TransactionData) Copy() *TransactionData { + return &TransactionData{ ChainID: copyPtr(c.ChainID), Nonce: copyPtr(c.Nonce), Signature: c.Signature.Copy(), } } -func (c *TransactionFields) toJSON(j *jsonTransaction) { +func (c *TransactionData) toJSON(j *jsonTransaction) { if c.ChainID != nil { j.ChainID = NumberFromUint64Ptr(*c.ChainID) } @@ -108,7 +110,7 @@ func (c *TransactionFields) toJSON(j *jsonTransaction) { } } -func (c *TransactionFields) fromJSON(j *jsonTransaction) { +func (c *TransactionData) fromJSON(j *jsonTransaction) { if j.ChainID != nil { chainID := j.ChainID.Big().Uint64() c.ChainID = &chainID @@ -122,10 +124,10 @@ func (c *TransactionFields) fromJSON(j *jsonTransaction) { } } -// CallFields contains the basic fields for a call. +// CallData contains the basic fields for a call. // // This type is used to embed call data into other types. -type CallFields struct { +type CallData struct { From *Address // From is the sender address. To *Address // To is the recipient address. Nil means contract creation. GasLimit *uint64 // GasLimit is the gas limit; if 0, there is no limit. @@ -133,47 +135,47 @@ type CallFields struct { Input []byte // Input is the input data. } -// CallData returns the embedded call data. -func (c *CallFields) CallData() *CallFields { +// GetCallData returns the embedded call data. +func (c *CallData) GetCallData() *CallData { return c } // SetCallData sets the embedded call data. -func (c *CallFields) SetCallData(data CallFields) { +func (c *CallData) SetCallData(data CallData) { *c = data } // SetFrom sets the sender address. -func (c *CallFields) SetFrom(from Address) { +func (c *CallData) SetFrom(from Address) { c.From = &from } // SetTo sets the recipient address. -func (c *CallFields) SetTo(to Address) { +func (c *CallData) SetTo(to Address) { c.To = &to } // SetGasLimit sets the gas limit. -func (c *CallFields) SetGasLimit(gasLimit uint64) { +func (c *CallData) SetGasLimit(gasLimit uint64) { c.GasLimit = &gasLimit } // SetValue sets the amount of wei to send. -func (c *CallFields) SetValue(value *big.Int) { +func (c *CallData) SetValue(value *big.Int) { c.Value = value } // SetInput sets the input data. -func (c *CallFields) SetInput(input []byte) { +func (c *CallData) SetInput(input []byte) { c.Input = input } // Copy creates a deep copy of the CallFields. -func (c *CallFields) Copy() *CallFields { +func (c *CallData) Copy() *CallData { if c == nil { return nil } - return &CallFields{ + return &CallData{ From: copyPtr(c.From), To: copyPtr(c.To), GasLimit: copyPtr(c.GasLimit), @@ -182,7 +184,7 @@ func (c *CallFields) Copy() *CallFields { } } -func (c *CallFields) toJSON(j *jsonCall) { +func (c *CallData) toJSON(j *jsonCall) { j.From = c.From j.To = c.To if c.GasLimit != nil { @@ -194,7 +196,7 @@ func (c *CallFields) toJSON(j *jsonCall) { j.Input = c.Input } -func (c *CallFields) fromJSON(j *jsonCall) { +func (c *CallData) fromJSON(j *jsonCall) { c.From = j.From c.To = j.To if j.GasLimit != nil { @@ -207,130 +209,130 @@ func (c *CallFields) fromJSON(j *jsonCall) { c.Input = j.Input } -// LegacyPriceField contains the gas price for legacy transactions. +// LegacyPriceData contains the gas price for legacy transactions. // // This type is used to embed legacy price data into other types. -type LegacyPriceField struct { +type LegacyPriceData struct { GasPrice *big.Int // GasPrice is the gas price. } // LegacyPriceData returns the embedded legacy price data. -func (c *LegacyPriceField) LegacyPriceData() *LegacyPriceField { +func (c *LegacyPriceData) GetLegacyPriceData() *LegacyPriceData { return c } // SetLegacyPriceData sets the embedded legacy price data. -func (c *LegacyPriceField) SetLegacyPriceData(data LegacyPriceField) { +func (c *LegacyPriceData) SetLegacyPriceData(data LegacyPriceData) { *c = data } // SetGasPrice sets the gas price. -func (c *LegacyPriceField) SetGasPrice(gasPrice *big.Int) { +func (c *LegacyPriceData) SetGasPrice(gasPrice *big.Int) { c.GasPrice = gasPrice } // Copy creates a deep copy of the LegacyPriceField. -func (c *LegacyPriceField) Copy() *LegacyPriceField { +func (c *LegacyPriceData) Copy() *LegacyPriceData { if c == nil { return nil } - return &LegacyPriceField{ + return &LegacyPriceData{ GasPrice: copyBigInt(c.GasPrice), } } -func (c *LegacyPriceField) toJSON(j *jsonCall) { +func (c *LegacyPriceData) toJSON(j *jsonCall) { if c.GasPrice != nil { j.GasPrice = NumberFromBigIntPtr(c.GasPrice) } } -func (c *LegacyPriceField) fromJSON(j *jsonCall) { +func (c *LegacyPriceData) fromJSON(j *jsonCall) { if j.GasPrice != nil { c.GasPrice = j.GasPrice.Big() } } -// AccessListField contains the access list for EIP-2930 transactions. +// AccessListData contains the access list for EIP-2930 transactions. // // This type is used to embed access list data into other types. -type AccessListField struct { +type AccessListData struct { AccessList AccessList // AccessList is the EIP-2930 access list. } // AccessListData returns the embedded access list data. -func (c *AccessListField) AccessListData() *AccessListField { +func (c *AccessListData) GetAccessListData() *AccessListData { return c } // SetAccessListData sets the embedded access list data. -func (c *AccessListField) SetAccessListData(data AccessListField) { +func (c *AccessListData) SetAccessListData(data AccessListData) { *c = data } // SetAccessList sets the access list. -func (c *AccessListField) SetAccessList(accessList AccessList) { +func (c *AccessListData) SetAccessList(accessList AccessList) { c.AccessList = accessList } // Copy creates a deep copy of the AccessListField. -func (c *AccessListField) Copy() *AccessListField { +func (c *AccessListData) Copy() *AccessListData { if c == nil { return nil } - return &AccessListField{ + return &AccessListData{ AccessList: c.AccessList.Copy(), } } -func (c *AccessListField) toJSON(j *jsonCall) { +func (c *AccessListData) toJSON(j *jsonCall) { j.AccessList = c.AccessList } -func (c *AccessListField) fromJSON(j *jsonCall) { +func (c *AccessListData) fromJSON(j *jsonCall) { c.AccessList = j.AccessList } -// DynamicFeeFields contains fee data for EIP-1559 transactions. +// DynamicFeeData contains fee data for EIP-1559 transactions. // // This type is used to embed dynamic fee data into other types. -type DynamicFeeFields struct { +type DynamicFeeData struct { MaxFeePerGas *big.Int // MaxFeePerGas is the maximum total fee per gas. MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas. } // DynamicFeeData returns the embedded dynamic fee data. -func (c *DynamicFeeFields) DynamicFeeData() *DynamicFeeFields { +func (c *DynamicFeeData) GetDynamicFeeData() *DynamicFeeData { return c } // SetDynamicFeeData sets the embedded dynamic fee data. -func (c *DynamicFeeFields) SetDynamicFeeData(data DynamicFeeFields) { +func (c *DynamicFeeData) SetDynamicFeeData(data DynamicFeeData) { *c = data } // SetMaxFeePerGas sets the maximum total fee per gas. -func (c *DynamicFeeFields) SetMaxFeePerGas(maxFeePerGas *big.Int) { +func (c *DynamicFeeData) SetMaxFeePerGas(maxFeePerGas *big.Int) { c.MaxFeePerGas = maxFeePerGas } // SetMaxPriorityFeePerGas sets the maximum priority fee per gas. -func (c *DynamicFeeFields) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) { +func (c *DynamicFeeData) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) { c.MaxPriorityFeePerGas = maxPriorityFeePerGas } // Copy creates a deep copy of the DynamicFeeFields. -func (c *DynamicFeeFields) Copy() *DynamicFeeFields { +func (c *DynamicFeeData) Copy() *DynamicFeeData { if c == nil { return nil } - return &DynamicFeeFields{ + return &DynamicFeeData{ MaxFeePerGas: copyBigInt(c.MaxFeePerGas), MaxPriorityFeePerGas: copyBigInt(c.MaxPriorityFeePerGas), } } -func (c *DynamicFeeFields) toJSON(j *jsonCall) { +func (c *DynamicFeeData) toJSON(j *jsonCall) { if c.MaxFeePerGas != nil { j.MaxFeePerGas = NumberFromBigIntPtr(c.MaxFeePerGas) } @@ -339,7 +341,7 @@ func (c *DynamicFeeFields) toJSON(j *jsonCall) { } } -func (c *DynamicFeeFields) fromJSON(j *jsonCall) { +func (c *DynamicFeeData) fromJSON(j *jsonCall) { if j.MaxFeePerGas != nil { c.MaxFeePerGas = j.MaxFeePerGas.Big() } @@ -348,47 +350,47 @@ func (c *DynamicFeeFields) fromJSON(j *jsonCall) { } } -// BlobFields contains data for EIP-4844 blob transactions. +// BlobData contains data for EIP-4844 blob transactions. // // Use NewBlobInfo to create a BlobInfo. // // This type is used to embed blob data into other types. -type BlobFields struct { +type BlobData struct { MaxFeePerBlobGas *big.Int // MaxFeePerBlobGas is the maximum fee per blob gas. Blobs []BlobInfo // Blobs is the list of blobs. } // BlobData returns the embedded blob data. -func (c *BlobFields) BlobData() *BlobFields { +func (c *BlobData) GetBlobData() *BlobData { return c } // SetBlobData sets the embedded blob data. -func (c *BlobFields) SetBlobData(data BlobFields) { +func (c *BlobData) SetBlobData(data BlobData) { *c = data } // SetMaxFeePerBlobGas sets the maximum fee per blob gas. -func (c *BlobFields) SetMaxFeePerBlobGas(maxFeePerBlobGas *big.Int) { +func (c *BlobData) SetMaxFeePerBlobGas(maxFeePerBlobGas *big.Int) { c.MaxFeePerBlobGas = maxFeePerBlobGas } // SetBlobs sets the list of blobs. // // Use NewBlobInfo to create a BlobInfo. -func (c *BlobFields) SetBlobs(blobs []BlobInfo) { +func (c *BlobData) SetBlobs(blobs []BlobInfo) { c.Blobs = blobs } // AddBlob adds a blob to the list. // // Use NewBlobInfo to create a BlobInfo. -func (c *BlobFields) AddBlob(blob BlobInfo) { +func (c *BlobData) AddBlob(blob BlobInfo) { c.Blobs = append(c.Blobs, blob) } // Copy creates a deep copy of the BlobFields. -func (c *BlobFields) Copy() *BlobFields { +func (c *BlobData) Copy() *BlobData { if c == nil { return nil } @@ -397,13 +399,13 @@ func (c *BlobFields) Copy() *BlobFields { blobs[i].Hash = blob.Hash blobs[i].Sidecar = copyPtr(blob.Sidecar) } - return &BlobFields{ + return &BlobData{ MaxFeePerBlobGas: copyBigInt(c.MaxFeePerBlobGas), Blobs: blobs, } } -func (c *BlobFields) toJSON(j *jsonCall) { +func (c *BlobData) toJSON(j *jsonCall) { if c.MaxFeePerBlobGas != nil { j.MaxFeePerBlobGas = NumberFromBigIntPtr(c.MaxFeePerBlobGas) } @@ -425,7 +427,7 @@ func (c *BlobFields) toJSON(j *jsonCall) { } } -func (c *BlobFields) fromJSON(j *jsonCall) { +func (c *BlobData) fromJSON(j *jsonCall) { if j.MaxFeePerBlobGas != nil { c.MaxFeePerBlobGas = j.MaxFeePerBlobGas.Big() } diff --git a/types/embed_test.go b/types/embed_test.go index de6dd42..53339bc 100644 --- a/types/embed_test.go +++ b/types/embed_test.go @@ -14,19 +14,19 @@ import ( func TestTransactionData_JSON(t *testing.T) { tests := []struct { name string - data *TransactionFields + data *TransactionData want *jsonTransaction wantJSON string }{ { name: "all fields nil", - data: &TransactionFields{}, + data: &TransactionData{}, want: &jsonTransaction{}, wantJSON: `{}`, }, { name: "all fields set", - data: &TransactionFields{ + data: &TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(2)), Signature: &Signature{ @@ -52,7 +52,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "nil signature", - data: &TransactionFields{ + data: &TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(2)), Signature: nil, @@ -71,7 +71,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "max uint64 values", - data: &TransactionFields{ + data: &TransactionData{ ChainID: ptr(^uint64(0)), Nonce: ptr(^uint64(0)), }, @@ -86,7 +86,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "zero values", - data: &TransactionFields{ + data: &TransactionData{ ChainID: ptr(uint64(0)), Nonce: ptr(uint64(0)), Signature: &Signature{ @@ -128,7 +128,7 @@ func TestTransactionData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data TransactionFields + var data TransactionData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -149,19 +149,19 @@ func TestTransactionData_JSON(t *testing.T) { func TestCallData_JSON(t *testing.T) { tests := []struct { name string - data *CallFields + data *CallData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &CallFields{}, + data: &CallData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &CallFields{ + data: &CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), GasLimit: ptr(uint64(21000)), @@ -185,7 +185,7 @@ func TestCallData_JSON(t *testing.T) { }, { name: "max values", - data: &CallFields{ + data: &CallData{ From: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), To: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), GasLimit: ptr(^uint64(0)), @@ -209,7 +209,7 @@ func TestCallData_JSON(t *testing.T) { }, { name: "zero values", - data: &CallFields{ + data: &CallData{ From: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), To: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), GasLimit: ptr(uint64(0)), @@ -248,7 +248,7 @@ func TestCallData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data CallFields + var data CallData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -264,19 +264,19 @@ func TestCallData_JSON(t *testing.T) { func TestLegacyPriceData_JSON(t *testing.T) { tests := []struct { name string - data *LegacyPriceField + data *LegacyPriceData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &LegacyPriceField{}, + data: &LegacyPriceData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &LegacyPriceField{ + data: &LegacyPriceData{ GasPrice: big.NewInt(2000000000), }, want: &jsonCall{ @@ -288,7 +288,7 @@ func TestLegacyPriceData_JSON(t *testing.T) { }, { name: "zero value", - data: &LegacyPriceField{ + data: &LegacyPriceData{ GasPrice: big.NewInt(0), }, want: &jsonCall{ @@ -312,7 +312,7 @@ func TestLegacyPriceData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data LegacyPriceField + var data LegacyPriceData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -324,19 +324,19 @@ func TestLegacyPriceData_JSON(t *testing.T) { func TestAccessListData_JSON(t *testing.T) { tests := []struct { name string - data *AccessListField + data *AccessListData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &AccessListField{}, + data: &AccessListData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &AccessListField{ + data: &AccessListData{ AccessList: AccessList{ { Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), @@ -384,7 +384,7 @@ func TestAccessListData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data AccessListField + var data AccessListData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -396,19 +396,19 @@ func TestAccessListData_JSON(t *testing.T) { func TestDynamicFeeData_JSON(t *testing.T) { tests := []struct { name string - data *DynamicFeeFields + data *DynamicFeeData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &DynamicFeeFields{}, + data: &DynamicFeeData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &DynamicFeeFields{ + data: &DynamicFeeData{ MaxFeePerGas: big.NewInt(2000000000), MaxPriorityFeePerGas: big.NewInt(1000000000), }, @@ -423,7 +423,7 @@ func TestDynamicFeeData_JSON(t *testing.T) { }, { name: "zero values", - data: &DynamicFeeFields{ + data: &DynamicFeeData{ MaxFeePerGas: big.NewInt(0), MaxPriorityFeePerGas: big.NewInt(0), }, @@ -438,7 +438,7 @@ func TestDynamicFeeData_JSON(t *testing.T) { }, { name: "max values", - data: &DynamicFeeFields{ + data: &DynamicFeeData{ MaxFeePerGas: big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1)), MaxPriorityFeePerGas: big.NewInt(0).Sub(big.NewInt(0).SetBit(big.NewInt(0), 256, 1), big.NewInt(1)), }, @@ -466,7 +466,7 @@ func TestDynamicFeeData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data DynamicFeeFields + var data DynamicFeeData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -480,19 +480,19 @@ func TestBlobData_JSON(t *testing.T) { remZerosRx := regexp.MustCompile(`0{128,}`) tests := []struct { name string - data *BlobFields + data *BlobData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &BlobFields{}, + data: &BlobData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "blobs with sidecars", - data: &BlobFields{ + data: &BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { @@ -532,7 +532,7 @@ func TestBlobData_JSON(t *testing.T) { }, { name: "blobs without sidecars", - data: &BlobFields{ + data: &BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { @@ -570,7 +570,7 @@ func TestBlobData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(remZerosRx.ReplaceAll(jsonBytes, []byte("")))) // Test fromJSON - var data BlobFields + var data BlobData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) diff --git a/types/structs.go b/types/structs.go index 0eae31b..c622f26 100644 --- a/types/structs.go +++ b/types/structs.go @@ -204,7 +204,7 @@ func (t *TransactionOnChain) MarshalJSON() ([]byte, error) { if t.TransactionIndex != nil { ocd.TransactionIndex = NumberFromUint64Ptr(*t.TransactionIndex) } - return marshalJSONInline( + return marshalJSONMerge( t.Transaction, ocd, ) diff --git a/types/structs_test.go b/types/structs_test.go index a5038b6..b93d9fe 100644 --- a/types/structs_test.go +++ b/types/structs_test.go @@ -34,18 +34,18 @@ func TestTransactionOnChain_JSON(t *testing.T) { `, tx: &TransactionOnChain{ Transaction: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, diff --git a/types/tx.go b/types/tx.go index 264a0fb..e907172 100644 --- a/types/tx.go +++ b/types/tx.go @@ -42,7 +42,7 @@ type Transaction interface { rlp.Encoder rlp.Decoder - TransactionData + HasTransactionData // Type returns the type of the transaction. Type() TransactionType diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index 4e96ad4..fa213d2 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -15,7 +15,7 @@ import ( // list that specifies a list of addresses and storage keys the transaction // plans to access. type TransactionAccessList struct { - TransactionFields + TransactionData CallAccessList } @@ -32,9 +32,9 @@ func (t *TransactionAccessList) Type() TransactionType { // Call implements the Transaction interface. func (t *TransactionAccessList) Call() Call { return &CallAccessList{ - CallFields: *t.CallFields.Copy(), - LegacyPriceField: *t.LegacyPriceField.Copy(), - AccessListField: *t.AccessListField.Copy(), + CallData: *t.CallData.Copy(), + LegacyPriceData: *t.LegacyPriceData.Copy(), + AccessListData: *t.AccessListData.Copy(), } } @@ -167,8 +167,8 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { // Copy creates a deep copy of the transaction. func (t *TransactionAccessList) Copy() *TransactionAccessList { return &TransactionAccessList{ - TransactionFields: *t.TransactionFields.Copy(), - CallAccessList: *t.CallAccessList.Copy(), + TransactionData: *t.TransactionData.Copy(), + CallAccessList: *t.CallAccessList.Copy(), } } @@ -251,10 +251,10 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionAccessList) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionFields.toJSON(j) - t.CallFields.toJSON(&j.jsonCall) - t.LegacyPriceField.toJSON(&j.jsonCall) - t.AccessListField.toJSON(&j.jsonCall) + t.TransactionData.toJSON(j) + t.CallData.toJSON(&j.jsonCall) + t.LegacyPriceData.toJSON(&j.jsonCall) + t.AccessListData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -264,10 +264,10 @@ func (t *TransactionAccessList) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionFields.fromJSON(j) - t.CallFields.fromJSON(&j.jsonCall) - t.LegacyPriceField.fromJSON(&j.jsonCall) - t.AccessListField.fromJSON(&j.jsonCall) + t.TransactionData.fromJSON(j) + t.CallData.fromJSON(&j.jsonCall) + t.LegacyPriceData.fromJSON(&j.jsonCall) + t.AccessListData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_accesslist_test.go b/types/tx_accesslist_test.go index 77d3944..2e754ce 100644 --- a/types/tx_accesslist_test.go +++ b/types/tx_accesslist_test.go @@ -24,23 +24,23 @@ func TestTransactionAccessList_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -77,7 +77,7 @@ func TestTransactionAccessList_JSON(t *testing.T) { { name: "invalid negative nonce", tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(18446744073709551615)), // Max uint64 value to simulate negative when interpreted incorrectly }, }, @@ -120,23 +120,23 @@ func TestTransactionAccessList_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -183,18 +183,18 @@ func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallAccessList: CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, diff --git a/types/tx_blob.go b/types/tx_blob.go index 8659702..8bc550b 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -15,7 +15,7 @@ import ( // Introduced by EIP-4844, this transaction type adds support for blob-carrying // transactions. type TransactionBlob struct { - TransactionFields + TransactionData CallBlob } @@ -90,7 +90,7 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { } if len(t.Blobs) > 0 { blobHashes = make(rlp.TypedList[Hash], len(t.Blobs)) - for i, _ := range t.Blobs { + for i := range t.Blobs { blobHashes[i] = &t.Blobs[i].Hash } } @@ -116,7 +116,7 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionBlob) Copy() *TransactionBlob { return &TransactionBlob{ - TransactionFields: *t.TransactionFields.Copy(), + TransactionData: *t.TransactionData.Copy(), CallBlob: *t.CallBlob.Copy(), } } @@ -176,7 +176,7 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { } if len(t.Blobs) > 0 { blobHashes = make(rlp.TypedList[Hash], 0, len(t.Blobs)) - for i, _ := range t.Blobs { + for i := range t.Blobs { blob := t.Blobs[i] blobHashes = append(blobHashes, &blob.Hash) @@ -363,11 +363,11 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionBlob) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionFields.toJSON(j) - t.CallFields.toJSON(&j.jsonCall) - t.AccessListField.toJSON(&j.jsonCall) - t.DynamicFeeFields.toJSON(&j.jsonCall) - t.BlobFields.toJSON(&j.jsonCall) + t.TransactionData.toJSON(j) + t.CallData.toJSON(&j.jsonCall) + t.AccessListData.toJSON(&j.jsonCall) + t.DynamicFeeData.toJSON(&j.jsonCall) + t.BlobData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -377,11 +377,11 @@ func (t *TransactionBlob) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionFields.fromJSON(j) - t.CallFields.fromJSON(&j.jsonCall) - t.AccessListField.fromJSON(&j.jsonCall) - t.DynamicFeeFields.fromJSON(&j.jsonCall) - t.BlobFields.fromJSON(&j.jsonCall) + t.TransactionData.fromJSON(j) + t.CallData.fromJSON(&j.jsonCall) + t.AccessListData.fromJSON(&j.jsonCall) + t.DynamicFeeData.fromJSON(&j.jsonCall) + t.BlobData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index 10ae161..7495676 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -28,24 +28,24 @@ func TestTransactionBlob_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -54,7 +54,7 @@ func TestTransactionBlob_JSON(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, @@ -95,24 +95,24 @@ func TestTransactionBlob_JSON(t *testing.T) { { name: "blobs with shortened zero fields", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -121,7 +121,7 @@ func TestTransactionBlob_JSON(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ newBlob("blob1"), @@ -207,24 +207,24 @@ func TestTransactionBlob_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -233,7 +233,7 @@ func TestTransactionBlob_RLP(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, @@ -247,24 +247,24 @@ func TestTransactionBlob_RLP(t *testing.T) { { name: "hash output", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -273,7 +273,7 @@ func TestTransactionBlob_RLP(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ newBlob("blob1"), @@ -325,18 +325,18 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, @@ -347,18 +347,18 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "all fields set with access list", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: AccessList{ AccessTuple{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), @@ -369,11 +369,11 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { }, }, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { @@ -388,24 +388,24 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "with blobs and access list", tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -414,7 +414,7 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ newBlob("blob1"), diff --git a/types/tx_decoder.go b/types/tx_decoder.go index 6705431..540946d 100644 --- a/types/tx_decoder.go +++ b/types/tx_decoder.go @@ -86,9 +86,9 @@ type TransactionUnknown struct { UnknownType TransactionType } -func (t *TransactionUnknown) TransactionData() *TransactionFields { return nil } +func (t *TransactionUnknown) GetTransactionData() *TransactionData { return nil } -func (t *TransactionUnknown) SetTransactionData(_ TransactionFields) {} +func (t *TransactionUnknown) SetTransactionData(_ TransactionData) {} func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go index 012c370..028e240 100644 --- a/types/tx_decoder_test.go +++ b/types/tx_decoder_test.go @@ -21,19 +21,19 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(38)), Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, @@ -42,7 +42,7 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -61,12 +61,12 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(20000000000), }, }, @@ -79,22 +79,22 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -113,23 +113,23 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -148,23 +148,23 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -173,7 +173,7 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { @@ -206,18 +206,18 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, @@ -238,7 +238,7 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( func() *big.Int { @@ -256,12 +256,12 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(20000000000), }, }, @@ -289,22 +289,22 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionAccessList{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -349,23 +349,23 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -411,23 +411,23 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionBlob{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -436,7 +436,7 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, }}, }, - BlobFields: BlobFields{ + BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index 489a664..62fe1b7 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -14,7 +14,7 @@ import ( // Introduced by EIP-1559, this transaction type supports a new fee market // mechanism with a base fee and a priority fee (tip). type TransactionDynamicFee struct { - TransactionFields + TransactionData CallDynamicFee } @@ -102,7 +102,7 @@ func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionDynamicFee) Copy() *TransactionDynamicFee { return &TransactionDynamicFee{ - TransactionFields: *t.TransactionFields.Copy(), + TransactionData: *t.TransactionData.Copy(), CallDynamicFee: *t.CallDynamicFee.Copy(), } } @@ -260,10 +260,10 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionDynamicFee) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionFields.toJSON(j) - t.CallFields.toJSON(&j.jsonCall) - t.AccessListField.toJSON(&j.jsonCall) - t.DynamicFeeFields.toJSON(&j.jsonCall) + t.TransactionData.toJSON(j) + t.CallData.toJSON(&j.jsonCall) + t.AccessListData.toJSON(&j.jsonCall) + t.DynamicFeeData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -273,10 +273,10 @@ func (t *TransactionDynamicFee) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, j); err != nil { return err } - t.TransactionFields.fromJSON(j) - t.CallFields.fromJSON(&j.jsonCall) - t.AccessListField.fromJSON(&j.jsonCall) - t.DynamicFeeFields.fromJSON(&j.jsonCall) + t.TransactionData.fromJSON(j) + t.CallData.fromJSON(&j.jsonCall) + t.AccessListData.fromJSON(&j.jsonCall) + t.DynamicFeeData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_dynamicfee_test.go b/types/tx_dynamicfee_test.go index 78b1f93..c4029a3 100644 --- a/types/tx_dynamicfee_test.go +++ b/types/tx_dynamicfee_test.go @@ -24,24 +24,24 @@ func TestTransactionDynamicFee_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -111,24 +111,24 @@ func TestTransactionDynamicFee_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: []AccessTuple{{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), StorageKeys: []Hash{ @@ -176,18 +176,18 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, @@ -198,18 +198,18 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { { name: "all fields set with access list", tx: &TransactionDynamicFee{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallDynamicFee: CallDynamicFee{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - AccessListField: AccessListField{ + AccessListData: AccessListData{ AccessList: AccessList{ AccessTuple{ Address: MustAddressFromHex("0x3333333333333333333333333333333333333333"), @@ -220,7 +220,7 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { }, }, }, - DynamicFeeFields: DynamicFeeFields{ + DynamicFeeData: DynamicFeeData{ MaxPriorityFeePerGas: big.NewInt(1000000000), MaxFeePerGas: big.NewInt(2000000000), }, diff --git a/types/tx_legacy.go b/types/tx_legacy.go index c7728fb..ec26017 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -14,7 +14,7 @@ import ( // // This is the original transaction format used before EIP-2718. type TransactionLegacy struct { - TransactionFields + TransactionData CallLegacy } @@ -99,7 +99,7 @@ func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionLegacy) Copy() *TransactionLegacy { return &TransactionLegacy{ - TransactionFields: *t.TransactionFields.Copy(), + TransactionData: *t.TransactionData.Copy(), CallLegacy: *t.CallLegacy.Copy(), } } @@ -226,9 +226,9 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionLegacy) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionFields.toJSON(j) - t.CallFields.toJSON(&j.jsonCall) - t.LegacyPriceField.toJSON(&j.jsonCall) + t.TransactionData.toJSON(j) + t.CallData.toJSON(&j.jsonCall) + t.LegacyPriceData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -238,9 +238,9 @@ func (t *TransactionLegacy) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionFields.fromJSON(j) - t.CallFields.fromJSON(&j.jsonCall) - t.LegacyPriceField.fromJSON(&j.jsonCall) + t.TransactionData.fromJSON(j) + t.CallData.fromJSON(&j.jsonCall) + t.LegacyPriceData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_legacy_test.go b/types/tx_legacy_test.go index 6593f91..a812533 100644 --- a/types/tx_legacy_test.go +++ b/types/tx_legacy_test.go @@ -24,19 +24,19 @@ func TestTransactionLegacy_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, @@ -57,7 +57,7 @@ func TestTransactionLegacy_JSON(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -76,12 +76,12 @@ func TestTransactionLegacy_JSON(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(20000000000), }, }, @@ -133,19 +133,19 @@ func TestTransactionLegacy_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, @@ -155,7 +155,7 @@ func TestTransactionLegacy_RLP(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -174,12 +174,12 @@ func TestTransactionLegacy_RLP(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(20000000000), }, }, @@ -221,19 +221,19 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(1000000000), }, }, @@ -243,17 +243,17 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionFields: TransactionFields{ + TransactionData: TransactionData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), }, CallLegacy: CallLegacy{ - CallFields: CallFields{ + CallData: CallData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceField: LegacyPriceField{ + LegacyPriceData: LegacyPriceData{ GasPrice: big.NewInt(20000000000), }, }, diff --git a/types/types.go b/types/types.go index 5b18fea..79a8b28 100644 --- a/types/types.go +++ b/types/types.go @@ -14,6 +14,15 @@ import ( "github.com/defiweb/go-eth/hexutil" ) +var ( + // ForceAddressChecksum is a global flag that forces the use of checksummed + // addresses in text representations. + // + // Note: This is a global flag, so it affects all packages that use the + // Address type. + ForceAddressChecksum = false +) + // Pad is a padding type. type Pad uint8 @@ -39,6 +48,9 @@ var ZeroAddress = Address{} // AddressFromHex parses an address in hex format and returns an Address type. func AddressFromHex(h string) (a Address, err error) { err = a.UnmarshalText([]byte(h)) + if err != nil { + return ZeroAddress, err + } return a, err } @@ -106,6 +118,15 @@ func MustAddressFromBytesPtr(b []byte) *Address { return &a } +// VerifyAddressChecksum verifies if the given cheksummed address is valid. +func VerifyAddressChecksum(h string) bool { + a, err := AddressFromHex(h) + if err != nil { + return false + } + return a.Checksum() == h +} + // Bytes returns the byte representation of the address. func (t Address) Bytes() []byte { return t[:] @@ -113,6 +134,9 @@ func (t Address) Bytes() []byte { // String returns the hex representation of the address. func (t Address) String() string { + if ForceAddressChecksum { + return t.Checksum() + } return hexutil.BytesToHex(t[:]) } @@ -139,6 +163,9 @@ func (t Address) IsZero() bool { // MarshalJSON implements the json.Marshaler interface. func (t Address) MarshalJSON() ([]byte, error) { + if ForceAddressChecksum { + return naiveQuote([]byte(t.Checksum())), nil + } return bytesMarshalJSON(t[:]), nil } @@ -149,6 +176,9 @@ func (t *Address) UnmarshalJSON(input []byte) error { // MarshalText implements the encoding.TextMarshaler interface. func (t Address) MarshalText() ([]byte, error) { + if ForceAddressChecksum { + return []byte(t.Checksum()), nil + } return bytesMarshalText(t[:]), nil } @@ -195,6 +225,11 @@ type Hash [HashLength]byte // ZeroHash is a hash with all zeros. var ZeroHash = Hash{} +// HashKeccak256 calculates the Keccak256 hash of the given data. +func HashKeccak256(data ...[]byte) Hash { + return Hash(crypto.Keccak256(data...)) +} + // HashFromHex parses a hash in hex format and returns a Hash type. // If hash is longer than 32 bytes, it returns an error. func HashFromHex(h string, pad Pad) (Hash, error) { diff --git a/types/util.go b/types/util.go index 080577f..b85b4a2 100644 --- a/types/util.go +++ b/types/util.go @@ -132,17 +132,14 @@ func numberUnmarshalText(input []byte, output *big.Int) error { return nil } -// marshalJSONInline marshals given values into a single JSON object. +// marshalJSONMerge marshals given values into a single JSON object. // The given values must marshal into JSON objects. If same field is present in // multiple values, both are included in the result resulting in an invalid // JSON object. -func marshalJSONInline(vs ...any) ([]byte, error) { - var ( - buf bytes.Buffer - comma bool - ) +func marshalJSONMerge(vs ...any) ([]byte, error) { + var buf bytes.Buffer buf.WriteByte('{') - for _, v := range vs { + for n, v := range vs { b, err := json.Marshal(v) if err != nil { return nil, err @@ -150,11 +147,9 @@ func marshalJSONInline(vs ...any) ([]byte, error) { if len(b) < 2 || (b[0] != '{' && b[len(b)-1] != '}') { return nil, fmt.Errorf("expected JSON object, got %s", b) } - if comma { - comma = false + if n > 0 { buf.WriteByte(',') } - comma = true buf.Write(b[1 : len(b)-1]) } buf.WriteByte('}') diff --git a/types/util_test.go b/types/util_test.go index 983bbd5..a817116 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -9,40 +9,40 @@ import ( func assertEqualTX(t *testing.T, actual, expected Transaction) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) - assert.Equal(t, actual.TransactionData(), expected.TransactionData()) - if _, ok := expected.(CallData); ok { - assert.Equal(t, actual.(CallData).CallData(), actual.(CallData).CallData()) + assert.Equal(t, actual.GetTransactionData(), expected.GetTransactionData()) + if _, ok := expected.(HasCallData); ok { + assert.Equal(t, actual.(HasCallData).GetCallData(), actual.(HasCallData).GetCallData()) } - if _, ok := actual.(LegacyPriceData); ok { - assert.Equal(t, expected.(LegacyPriceData).LegacyPriceData(), actual.(LegacyPriceData).LegacyPriceData()) + if _, ok := actual.(HasLegacyPriceData); ok { + assert.Equal(t, expected.(HasLegacyPriceData).GetLegacyPriceData(), actual.(HasLegacyPriceData).GetLegacyPriceData()) } - if _, ok := actual.(AccessListData); ok { - assert.Equal(t, expected.(AccessListData).AccessListData(), actual.(AccessListData).AccessListData()) + if _, ok := actual.(HasAccessListData); ok { + assert.Equal(t, expected.(HasAccessListData).GetAccessListData(), actual.(HasAccessListData).GetAccessListData()) } - if _, ok := actual.(DynamicFeeData); ok { - assert.Equal(t, expected.(DynamicFeeData).DynamicFeeData(), actual.(DynamicFeeData).DynamicFeeData()) + if _, ok := actual.(HasDynamicFeeData); ok { + assert.Equal(t, expected.(HasDynamicFeeData).GetDynamicFeeData(), actual.(HasDynamicFeeData).GetDynamicFeeData()) } - if _, ok := actual.(BlobData); ok { - assert.Equal(t, expected.(BlobData).BlobData(), actual.(BlobData).BlobData()) + if _, ok := actual.(HasBlobData); ok { + assert.Equal(t, expected.(HasBlobData).GetBlobData(), actual.(HasBlobData).GetBlobData()) } } func assertEqualCall(t *testing.T, actual, expected Call) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) - if _, ok := expected.(CallData); ok { - assert.Equal(t, actual.(CallData).CallData(), actual.(CallData).CallData()) + if _, ok := expected.(HasCallData); ok { + assert.Equal(t, actual.(HasCallData).GetCallData(), actual.(HasCallData).GetCallData()) } - if _, ok := actual.(LegacyPriceData); ok { - assert.Equal(t, expected.(LegacyPriceData).LegacyPriceData(), actual.(LegacyPriceData).LegacyPriceData()) + if _, ok := actual.(HasLegacyPriceData); ok { + assert.Equal(t, expected.(HasLegacyPriceData).GetLegacyPriceData(), actual.(HasLegacyPriceData).GetLegacyPriceData()) } - if _, ok := actual.(AccessListData); ok { - assert.Equal(t, expected.(AccessListData).AccessListData(), actual.(AccessListData).AccessListData()) + if _, ok := actual.(HasAccessListData); ok { + assert.Equal(t, expected.(HasAccessListData).GetAccessListData(), actual.(HasAccessListData).GetAccessListData()) } - if _, ok := actual.(DynamicFeeData); ok { - assert.Equal(t, expected.(DynamicFeeData).DynamicFeeData(), actual.(DynamicFeeData).DynamicFeeData()) + if _, ok := actual.(HasDynamicFeeData); ok { + assert.Equal(t, expected.(HasDynamicFeeData).GetDynamicFeeData(), actual.(HasDynamicFeeData).GetDynamicFeeData()) } - if _, ok := actual.(BlobData); ok { - assert.Equal(t, expected.(BlobData).BlobData(), actual.(BlobData).BlobData()) + if _, ok := actual.(HasBlobData); ok { + assert.Equal(t, expected.(HasBlobData).GetBlobData(), actual.(HasBlobData).GetBlobData()) } } diff --git a/wallet/key_hd.go b/wallet/key_hd.go index f66c27c..4200601 100644 --- a/wallet/key_hd.go +++ b/wallet/key_hd.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/btcsuite/btcd/chaincfg" + "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/btcsuite/btcd/btcutil/hdkeychain" "github.com/tyler-smith/go-bip39" @@ -116,8 +117,7 @@ func (m Mnemonic) Derive(path DerivationPath) (*PrivateKey, error) { if err != nil { return nil, err } - privKeyECDSA := privKey.ToECDSA() - return NewKeyFromECDSA(privKeyECDSA), nil + return NewKeyFromECDSA(&ecdsa.PrivateKey{D: privKey.ToECDSA().D}), nil } // ParseDerivationPath converts a BIP-33 derivation path string into the diff --git a/wallet/key_json_v3.go b/wallet/key_json_v3.go index f6bf11d..2baa0c3 100644 --- a/wallet/key_json_v3.go +++ b/wallet/key_json_v3.go @@ -4,7 +4,6 @@ import ( "bytes" "crypto/aes" "crypto/cipher" - "crypto/ecdsa" "crypto/rand" "crypto/sha256" "encoding/hex" @@ -15,6 +14,7 @@ import ( "golang.org/x/crypto/scrypt" "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/types" ) @@ -71,7 +71,7 @@ func encryptV3Key(key *ecdsa.PrivateKey, passphrase string, scryptN, scryptP int return &jsonKey{ Version: 3, ID: id, - Address: types.Address(crypto.ECPublicKeyToAddress(&key.PublicKey)), + Address: types.Address(crypto.ECPublicKeyToAddress(crypto.ECPrivateKeyToPublicKey(key))), Crypto: jsonKeyCrypto{ Cipher: "aes-128-ctr", CipherParams: jsonKeyCipherParams{ diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 1d8e332..168245d 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -20,17 +20,18 @@ type PrivateKey struct { // NewKeyFromECDSA creates a new private key from an ecdsa.PrivateKey. func NewKeyFromECDSA(prv *ecdsa.PrivateKey) *PrivateKey { + pub := crypto.ECPrivateKeyToPublicKey(prv) return &PrivateKey{ private: prv, - public: &prv.PublicKey, - address: types.Address(crypto.ECPublicKeyToAddress(&prv.PublicKey)), + public: pub, + address: types.Address(crypto.ECPublicKeyToAddress(pub)), } } // NewKeyFromBytes creates a new private key from private key bytes. func NewKeyFromBytes(prv []byte) *PrivateKey { key, _ := btcec.PrivKeyFromBytes(prv) - return NewKeyFromECDSA(key.ToECDSA()) + return NewKeyFromECDSA(&ecdsa.PrivateKey{D: key.ToECDSA().D}) } // NewRandomKey creates a random private key. diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index fecc204..b4ce846 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -53,7 +53,7 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro if err != nil { return fmt.Errorf("failed to decode signed transaction: %w", err) } - tx.SetTransactionData(*stx.TransactionData()) + tx.SetTransactionData(*stx.GetTransactionData()) addr, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("failed to verify signed transaction: %w", err) From 4657c4c6dab3254e2401891231308869c04e0e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 5 Aug 2025 14:40:50 +0200 Subject: [PATCH 11/44] Revert the use of t.Context() --- rpc/hijack_address_test.go | 3 +- rpc/hijack_gasfee_test.go | 5 +- rpc/hijack_gaslimit_test.go | 3 +- rpc/methods_client_test.go | 11 +-- rpc/methods_common_test.go | 58 ++++++------- rpc/methods_filter_test.go | 15 ++-- rpc/methods_privatetransactions_test.go | 5 +- rpc/methods_wallet_test.go | 9 +- rpc/testutil/http.go | 34 -------- rpc/testutil/websocket.go | 109 ------------------------ rpc/transport/hijack_test.go | 12 +-- 11 files changed, 64 insertions(+), 200 deletions(-) delete mode 100644 rpc/testutil/http.go delete mode 100644 rpc/testutil/websocket.go diff --git a/rpc/hijack_address_test.go b/rpc/hijack_address_test.go index 55e19cd..d5a523a 100644 --- a/rpc/hijack_address_test.go +++ b/rpc/hijack_address_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "fmt" "io" "net/http" @@ -76,7 +77,7 @@ func TestHijackAddress(t *testing.T) { hijacker := transport.NewHijacker(httpMock, tt.hijacker) - err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + err := hijacker.Call(context.Background(), nil, tt.method, tt.args...) assert.Len(t, tt.request, 0) assert.Len(t, tt.response, 0) require.NoError(t, err) diff --git a/rpc/hijack_gasfee_test.go b/rpc/hijack_gasfee_test.go index 6443afb..1c93f2a 100644 --- a/rpc/hijack_gasfee_test.go +++ b/rpc/hijack_gasfee_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "fmt" "io" "net/http" @@ -60,7 +61,7 @@ func TestHijackLegacyGasFee(t *testing.T) { hijacker := transport.NewHijacker(httpMock, tt.hijacker) - err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + err := hijacker.Call(context.Background(), nil, tt.method, tt.args...) assert.Len(t, tt.request, 0) assert.Len(t, tt.response, 0) require.NoError(t, err) @@ -116,7 +117,7 @@ func TestHijackDynamicGasFee(t *testing.T) { hijacker := transport.NewHijacker(httpMock, tt.hijacker) - err := hijacker.Call(t.Context(), nil, tt.method, tt.args...) + err := hijacker.Call(context.Background(), nil, tt.method, tt.args...) assert.Len(t, tt.request, 0) assert.Len(t, tt.response, 0) require.NoError(t, err) diff --git a/rpc/hijack_gaslimit_test.go b/rpc/hijack_gaslimit_test.go index e180e18..238acfb 100644 --- a/rpc/hijack_gaslimit_test.go +++ b/rpc/hijack_gaslimit_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "fmt" "io" "net/http" @@ -96,7 +97,7 @@ func TestHijackGasLimit(t *testing.T) { hijacker := transport.NewHijacker(httpMock, tc.hijacker) - err := hijacker.Call(t.Context(), nil, tc.method, tc.args...) + err := hijacker.Call(context.Background(), nil, tc.method, tc.args...) assert.Len(t, tc.request, 0) assert.Len(t, tc.response, 0) require.NoError(t, err) diff --git a/rpc/methods_client_test.go b/rpc/methods_client_test.go index ca48c94..49aebf6 100644 --- a/rpc/methods_client_test.go +++ b/rpc/methods_client_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "io" "net/http" "testing" @@ -39,7 +40,7 @@ func TestBaseClient_ClientVersion(t *testing.T) { }, nil } - clientVersion, err := client.ClientVersion(t.Context()) + clientVersion, err := client.ClientVersion(context.Background()) require.NoError(t, err) assert.Equal(t, "Geth/v1.9.25-unstable-3f0b5e4e-20201014/linux-amd64/go1.15.2", clientVersion) @@ -74,7 +75,7 @@ func TestBaseClient_NetworkID(t *testing.T) { }, nil } - networkID, err := client.NetworkID(t.Context()) + networkID, err := client.NetworkID(context.Background()) require.NoError(t, err) assert.Equal(t, uint64(1), networkID) @@ -109,7 +110,7 @@ func TestBaseClient_Listening(t *testing.T) { }, nil } - listening, err := client.Listening(t.Context()) + listening, err := client.Listening(context.Background()) require.NoError(t, err) assert.True(t, listening) @@ -144,7 +145,7 @@ func TestBaseClient_PeerCount(t *testing.T) { }, nil } - peerCount, err := client.PeerCount(t.Context()) + peerCount, err := client.PeerCount(context.Background()) require.NoError(t, err) assert.Equal(t, uint64(1), peerCount) @@ -183,7 +184,7 @@ func TestBaseClient_Syncing(t *testing.T) { }, nil } - syncStatus, err := client.Syncing(t.Context()) + syncStatus, err := client.Syncing(context.Background()) require.NoError(t, err) assert.Equal(t, uint64(0x384), syncStatus.StartingBlock.Big().Uint64()) diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index a29f696..9543cc0 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -116,7 +116,7 @@ func TestBaseClient_GetBalance(t *testing.T) { } balance, err := client.GetBalance( - t.Context(), + context.Background(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.LatestBlockNumber, ) @@ -158,7 +158,7 @@ func TestBaseClient_GetCode(t *testing.T) { } code, err := client.GetCode( - t.Context(), + context.Background(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustBlockNumberFromHex("0x2"), ) @@ -201,7 +201,7 @@ func TestBaseClient_GetStorageAt(t *testing.T) { } storage, err := client.GetStorageAt( - t.Context(), + context.Background(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", types.PadNone), types.MustBlockNumberFromHex("0x1"), @@ -244,7 +244,7 @@ func TestBaseClient_GetTransactionCount(t *testing.T) { } transactionCount, err := client.GetTransactionCount( - t.Context(), + context.Background(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), types.MustBlockNumberFromHex("0x1"), ) @@ -278,7 +278,7 @@ func TestBaseClient_BlockByHash(t *testing.T) { } block, err := client.BlockByHash( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), true, ) @@ -312,7 +312,7 @@ func TestBaseClient_BlockByNumber(t *testing.T) { } block, err := client.BlockByNumber( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), true, ) @@ -382,7 +382,7 @@ func TestBaseClient_GetBlockTransactionCountByHash(t *testing.T) { } transactionCount, err := client.GetBlockTransactionCountByHash( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -422,7 +422,7 @@ func TestBaseClient_GetBlockTransactionCountByNumber(t *testing.T) { } transactionCount, err := client.GetBlockTransactionCountByNumber( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), ) @@ -455,7 +455,7 @@ func TestBaseClient_GetUncleByBlockHashAndIndex(t *testing.T) { } block, err := client.GetUncleByBlockHashAndIndex( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), 0, ) @@ -489,7 +489,7 @@ func TestBaseClient_GetUncleByBlockNumberAndIndex(t *testing.T) { } block, err := client.GetUncleByBlockNumberAndIndex( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), 2, ) @@ -530,7 +530,7 @@ func TestBaseClient_GetUncleCountByBlockHash(t *testing.T) { } uncleCount, err := client.GetUncleCountByBlockHash( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -570,7 +570,7 @@ func TestBaseClient_GetUncleCountByBlockNumber(t *testing.T) { } uncleCount, err := client.GetUncleCountByBlockNumber( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), ) @@ -626,7 +626,7 @@ func TestBaseClient_Call(t *testing.T) { value := big.NewInt(10000000000) input := hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333") response, err := client.Call( - t.Context(), + context.Background(), &types.CallLegacy{ CallData: types.CallData{ From: from, @@ -687,7 +687,7 @@ func TestBaseClient_EstimateGas(t *testing.T) { gasLimit := uint64(30400) gas, err := client.EstimateGas( - t.Context(), + context.Background(), &types.CallLegacy{ CallData: types.CallData{ From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), @@ -739,7 +739,7 @@ func TestBaseClient_SendRawTransaction(t *testing.T) { } txHash, err := client.SendRawTransaction( - t.Context(), + context.Background(), hexutil.MustHexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), ) @@ -771,7 +771,7 @@ func TestBaseClient_GetTransactionByHash(t *testing.T) { } onChainTX, err := client.GetTransactionByHash( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -819,7 +819,7 @@ func TestBaseClient_GetTransactionByBlockHashAndIndex(t *testing.T) { } onChainTX, err := client.GetTransactionByBlockHashAndIndex( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), 0, ) @@ -856,7 +856,7 @@ func TestBaseClient_GetTransactionByBlockNumberAndIndex(t *testing.T) { } onChainTX, err := client.GetTransactionByBlockNumberAndIndex( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), 2, ) @@ -929,7 +929,7 @@ func TestBaseClient_GetTransactionReceipt(t *testing.T) { } receipt, err := client.GetTransactionReceipt( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -1022,7 +1022,7 @@ func TestBaseClient_GetBlockReceipts(t *testing.T) { } receipts, err := client.GetBlockReceipts( - t.Context(), + context.Background(), types.MustBlockNumberFromHex("0x1"), ) @@ -1109,7 +1109,7 @@ func TestBaseClient_GetLogs(t *testing.T) { from := types.MustBlockNumberFromHex("0x1") to := types.MustBlockNumberFromHex("0x2") - logs, err := client.GetLogs(t.Context(), &types.FilterLogsQuery{ + logs, err := client.GetLogs(context.Background(), &types.FilterLogsQuery{ FromBlock: &from, ToBlock: &to, Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, @@ -1162,7 +1162,7 @@ func TestBaseClient_ChainID(t *testing.T) { }, nil } - chainID, err := client.ChainID(t.Context()) + chainID, err := client.ChainID(context.Background()) require.NoError(t, err) assert.Equal(t, uint64(1), chainID) } @@ -1196,7 +1196,7 @@ func TestBaseClient_BlockNumber(t *testing.T) { }, nil } - blockNumber, err := client.BlockNumber(t.Context()) + blockNumber, err := client.BlockNumber(context.Background()) require.NoError(t, err) assert.Equal(t, big.NewInt(1), blockNumber) @@ -1231,7 +1231,7 @@ func TestBaseClient_GasPrice(t *testing.T) { }, nil } - gasPrice, err := client.GasPrice(t.Context()) + gasPrice, err := client.GasPrice(context.Background()) require.NoError(t, err) assert.Equal(t, big.NewInt(10000000000000), gasPrice) @@ -1266,7 +1266,7 @@ func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { }, nil } - gasPrice, err := client.MaxPriorityFeePerGas(t.Context()) + gasPrice, err := client.MaxPriorityFeePerGas(context.Background()) require.NoError(t, err) assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) @@ -1301,7 +1301,7 @@ func TestBaseClient_BlobBaseFee(t *testing.T) { }, nil } - gasPrice, err := client.BlobBaseFee(t.Context()) + gasPrice, err := client.BlobBaseFee(context.Background()) require.NoError(t, err) assert.Equal(t, hexutil.MustHexToBigInt("0x1"), gasPrice) @@ -1330,7 +1330,7 @@ func TestBaseClient_SubscribeNewHeads(t *testing.T) { }, } - ctx, cancel := context.WithCancel(t.Context()) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() resultCh, err := client.SubscribeNewHeads(ctx) @@ -1361,7 +1361,7 @@ func TestBaseClient_SubscribeNewPendingTransactions(t *testing.T) { }, } - ctx, cancel := context.WithCancel(t.Context()) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() resultCh, err := client.SubscribeNewPendingTransactions(ctx) @@ -1402,7 +1402,7 @@ func TestBaseClient_SubscribeLogs(t *testing.T) { }, } - ctx, cancel := context.WithCancel(t.Context()) + ctx, cancel := context.WithCancel(context.Background()) defer cancel() resultCh, err := client.SubscribeLogs(ctx, query) diff --git a/rpc/methods_filter_test.go b/rpc/methods_filter_test.go index 1165e2d..1055bf3 100644 --- a/rpc/methods_filter_test.go +++ b/rpc/methods_filter_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "io" "math/big" "net/http" @@ -51,7 +52,7 @@ func TestBaseClient_NewFilter(t *testing.T) { from := types.MustBlockNumberFromHex("0x1") to := types.MustBlockNumberFromHex("0x2") - id, err := client.NewFilter(t.Context(), &types.FilterLogsQuery{ + id, err := client.NewFilter(context.Background(), &types.FilterLogsQuery{ FromBlock: &from, ToBlock: &to, Address: []types.Address{types.MustAddressFromHex("0x3333333333333333333333333333333333333333")}, @@ -93,7 +94,7 @@ func TestBaseClient_NewBlockFilter(t *testing.T) { }, nil } - id, err := client.NewBlockFilter(t.Context()) + id, err := client.NewBlockFilter(context.Background()) require.NoError(t, err) assert.Equal(t, "2", id.String()) @@ -128,7 +129,7 @@ func TestBaseClient_NewPendingTransactionFilter(t *testing.T) { }, nil } - id, err := client.NewPendingTransactionFilter(t.Context()) + id, err := client.NewPendingTransactionFilter(context.Background()) require.NoError(t, err) assert.Equal(t, "3", id.String()) @@ -163,7 +164,7 @@ func TestBaseClient_UninstallFilter(t *testing.T) { }, nil } - result, err := client.UninstallFilter(t.Context(), big.NewInt(1)) + result, err := client.UninstallFilter(context.Background(), big.NewInt(1)) require.NoError(t, err) assert.True(t, result) @@ -212,7 +213,7 @@ func TestBaseClient_GetFilterChanges(t *testing.T) { }, nil } - logs, err := client.GetFilterChanges(t.Context(), big.NewInt(1)) + logs, err := client.GetFilterChanges(context.Background(), big.NewInt(1)) require.NoError(t, err) require.Len(t, logs, 1) @@ -263,7 +264,7 @@ func TestBaseClient_GetFilterLogs(t *testing.T) { }, nil } - logs, err := client.GetFilterLogs(t.Context(), big.NewInt(1)) + logs, err := client.GetFilterLogs(context.Background(), big.NewInt(1)) require.NoError(t, err) require.Len(t, logs, 1) @@ -304,7 +305,7 @@ func TestBaseClient_GetBlockFilterChanges(t *testing.T) { }, nil } - hashes, err := client.GetBlockFilterChanges(t.Context(), big.NewInt(2)) + hashes, err := client.GetBlockFilterChanges(context.Background(), big.NewInt(2)) require.NoError(t, err) require.Len(t, hashes, 2) diff --git a/rpc/methods_privatetransactions_test.go b/rpc/methods_privatetransactions_test.go index cee3906..b125e7c 100644 --- a/rpc/methods_privatetransactions_test.go +++ b/rpc/methods_privatetransactions_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "io" "net/http" "testing" @@ -45,7 +46,7 @@ func TestBaseClient_CancelPrivateTransaction(t *testing.T) { } result, err := client.CancelPrivateTransaction( - t.Context(), + context.Background(), types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), ) @@ -85,7 +86,7 @@ func TestBaseClient_SendPrivateTransaction(t *testing.T) { } txHash, err := client.SendPrivateTransaction( - t.Context(), + context.Background(), hexutil.MustHexToBytes("0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333"), ) diff --git a/rpc/methods_wallet_test.go b/rpc/methods_wallet_test.go index a64a6ab..6a8ca1a 100644 --- a/rpc/methods_wallet_test.go +++ b/rpc/methods_wallet_test.go @@ -2,6 +2,7 @@ package rpc import ( "bytes" + "context" "io" "net/http" "testing" @@ -45,7 +46,7 @@ func TestBaseClient_Accounts(t *testing.T) { }, nil } - accounts, err := client.Accounts(t.Context()) + accounts, err := client.Accounts(context.Background()) require.NoError(t, err) require.Len(t, accounts, 2) @@ -86,7 +87,7 @@ func TestBaseClient_Sign(t *testing.T) { } signature, err := client.Sign( - t.Context(), + context.Background(), types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), []byte("Hello World"), ) @@ -144,7 +145,7 @@ func TestBaseClient_SignTransaction(t *testing.T) { tx.SetGasLimit(0x5208) tx.SetGasPrice(hexutil.MustHexToBigInt("0x9184e72a000")) tx.SetInput(hexutil.MustHexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675")) - rawTx, err := client.SignTransaction(t.Context(), tx) + rawTx, err := client.SignTransaction(context.Background(), tx) require.NoError(t, err) assert.Equal(t, "0xf893808609184e72a0008276c094d46e8dd67c5d32be8058bb8eb970870f072445678502540be400a9d46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f07244567511a02222222222222222222222222222222222222222222222222222222222222222a03333333333333333333333333333333333333333333333333333333333333333", hexutil.BytesToHex(rawTx)) @@ -195,7 +196,7 @@ func TestBaseClient_SendTransaction(t *testing.T) { tx.SetGasLimit(0x5208) tx.SetGasPrice(hexutil.MustHexToBigInt("0x9184e72a000")) tx.SetInput(hexutil.MustHexToBytes("0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675")) - txHash, err := client.SendTransaction(t.Context(), tx) + txHash, err := client.SendTransaction(context.Background(), tx) require.NoError(t, err) assert.Equal(t, types.MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", types.PadNone), *txHash) diff --git a/rpc/testutil/http.go b/rpc/testutil/http.go deleted file mode 100644 index 49c00a2..0000000 --- a/rpc/testutil/http.go +++ /dev/null @@ -1,34 +0,0 @@ -package testutil - -import ( - "net/http" - - "github.com/defiweb/go-eth/rpc/transport" -) - -type roundTripFunc func(req *http.Request) (*http.Response, error) - -func (f roundTripFunc) RoundTrip(req *http.Request) (*http.Response, error) { - return f(req) -} - -type HTTPMock struct { - *transport.HTTP - - Request *http.Request // Request that was sent. - Response *http.Response // Response that will be returned. -} - -func NewHTTPMock() *HTTPMock { - h := &HTTPMock{} - h.HTTP, _ = transport.NewHTTP(transport.HTTPOptions{ - URL: "http://localhost", - HTTPClient: &http.Client{ - Transport: roundTripFunc(func(req *http.Request) (*http.Response, error) { - h.Request = req - return h.Response, nil - }), - }, - }) - return h -} diff --git a/rpc/testutil/websocket.go b/rpc/testutil/websocket.go deleted file mode 100644 index b1f5fa6..0000000 --- a/rpc/testutil/websocket.go +++ /dev/null @@ -1,109 +0,0 @@ -package testutil - -import ( - "context" - "encoding/json" - "errors" - "net" - "net/http" - "sync" - "time" - - "nhooyr.io/websocket" - "nhooyr.io/websocket/wsjson" - - "github.com/defiweb/go-eth/rpc/transport" -) - -type WebsocketMock struct { - *transport.Websocket - wg sync.WaitGroup - - RequestCh chan string // Request that was sent. - ResponseCh chan string // Response that will be returned. -} - -func NewWebsocketMock(ctx context.Context) *WebsocketMock { - w := &WebsocketMock{ - RequestCh: make(chan string), - ResponseCh: make(chan string), - } - - // Websocket server. - server := &http.Server{Handler: http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - // Handle websocket requests. - conn, err := websocket.Accept(res, req, nil) - if err != nil { - panic(err) - } - - // Request reader. - w.wg.Add(1) - go func() { - defer w.wg.Done() - for { - var req json.RawMessage - if err := wsjson.Read(ctx, conn, &req); err != nil { - if errors.As(err, &websocket.CloseError{}) { - return - } - panic(err) - } - w.RequestCh <- string(req) - } - }() - - // Response writer. - w.wg.Add(1) - go func() { - defer w.wg.Done() - for { - select { - case <-ctx.Done(): - return - case res := <-w.ResponseCh: - if err := wsjson.Write(ctx, conn, json.RawMessage(res)); err != nil { - if errors.As(err, &websocket.CloseError{}) { - return - } - panic(err) - } - } - } - }() - - // Close the connection after the test. - <-ctx.Done() - _ = conn.Close(websocket.StatusNormalClosure, "") - })} - - // Close HTTP server after the test. - go func() { - <-ctx.Done() - _ = server.Close() - w.wg.Wait() - }() - - // Start HTTP server. - ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - panic(err) - } - w.wg.Add(1) - go func() { - defer w.wg.Done() - if err := server.Serve(ln); err != nil { - if !errors.Is(err, http.ErrServerClosed) { - panic(err) - } - } - }() - - w.Websocket, _ = transport.NewWebsocket(transport.WebsocketOptions{ - Context: ctx, - URL: "ws://" + ln.Addr().String(), - Timout: time.Second, - }) - - return w -} diff --git a/rpc/transport/hijack_test.go b/rpc/transport/hijack_test.go index c71fc47..eda42b5 100644 --- a/rpc/transport/hijack_test.go +++ b/rpc/transport/hijack_test.go @@ -23,13 +23,13 @@ func TestHijacker(t *testing.T) { f.subResult <- nil f.unsubResult <- nil }() - err := h.Call(t.Context(), nil, "foo") + err := h.Call(context.Background(), nil, "foo") require.NoError(t, err) - _, _, err = h.Subscribe(t.Context(), "bar") + _, _, err = h.Subscribe(context.Background(), "bar") require.NoError(t, err) - err = h.Unsubscribe(t.Context(), "baz") + err = h.Unsubscribe(context.Background(), "baz") require.NoError(t, err) require.Equal(t, 1, f.callCount) @@ -60,7 +60,7 @@ func TestHijacker(t *testing.T) { go func() { f.callResult <- nil }() - err := h.Call(t.Context(), nil, "foo") + err := h.Call(context.Background(), nil, "foo") require.NoError(t, err) assert.Equal(t, []string{"call2", "call1"}, order) @@ -73,7 +73,7 @@ func TestHijacker(t *testing.T) { asserts: func(t *testing.T, f *mockTransport, h *Hijack) { var order []string - ctx := WithHijackers(t.Context(), &mockHijacker{callFn: func(next CallFunc) CallFunc { + ctx := WithHijackers(context.Background(), &mockHijacker{callFn: func(next CallFunc) CallFunc { return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { order = append(order, "call1") return next(ctx, t, result, method, args...) @@ -117,7 +117,7 @@ func TestHijacker(t *testing.T) { } }}) - ctx := WithHijackers(t.Context(), &mockHijacker{callFn: func(next CallFunc) CallFunc { + ctx := WithHijackers(context.Background(), &mockHijacker{callFn: func(next CallFunc) CallFunc { return func(ctx context.Context, t Transport, result any, method string, args ...any) (err error) { order = append(order, "call3") return next(ctx, t, result, method, args...) From c64cadc476c76327b63850bba1e8f055939d5f05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 18 May 2026 05:43:44 +0200 Subject: [PATCH 12/44] Add missing RPC methods --- rpc/methods_common.go | 66 ++++++++++ rpc/methods_common_test.go | 251 +++++++++++++++++++++++++++++++++++++ rpc/methods_wallet.go | 2 +- rpc/methods_wallet_test.go | 2 +- types/embed.go | 6 +- types/structs.go | 120 ++++++++++++++++++ 6 files changed, 442 insertions(+), 5 deletions(-) diff --git a/rpc/methods_common.go b/rpc/methods_common.go index 0246787..cf3ca40 100644 --- a/rpc/methods_common.go +++ b/rpc/methods_common.go @@ -21,6 +21,18 @@ type MethodsCommon struct { // Account methods: // +// GetProof performs eth_getProof RPC call. +// +// It returns the account and storage values of the specified account including +// the Merkle-proof as defined in EIP-1186. +func (c *MethodsCommon) GetProof(ctx context.Context, address types.Address, storageKeys []types.Hash, block types.BlockNumber) (*types.AccountProof, error) { + var res types.AccountProof + if err := c.Transport.Call(ctx, &res, "eth_getProof", address, storageKeys, block); err != nil { + return nil, err + } + return &res, nil +} + // GetBalance performs eth_getBalance RPC call. // // It returns the balance of the account of given address in wei. @@ -206,6 +218,26 @@ func (c *MethodsCommon) Call(ctx context.Context, call types.Call, block types.B return res, nil } +// CreateAccessList performs eth_createAccessList RPC call. +// +// It creates an access list for a transaction as defined in EIP-2930. +// +// If call also implements types.Transaction, then a Call method of the +// transaction will be used to create a call. +func (c *MethodsCommon) CreateAccessList(ctx context.Context, call types.Call, block types.BlockNumber) (*types.AccessListResult, error) { + if call == nil { + return nil, errors.New("rpc client: call is nil") + } + if tx, ok := call.(types.Transaction); ok { + call = tx.Call() + } + var res types.AccessListResult + if err := c.Transport.Call(ctx, &res, "eth_createAccessList", call, block); err != nil { + return nil, err + } + return &res, nil +} + // EstimateGas performs eth_estimateGas RPC call. // // It estimates the gas necessary to execute a specific transaction. @@ -379,6 +411,18 @@ func (c *MethodsCommon) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, err return res.Big(), nil } +// FeeHistory performs eth_feeHistory RPC call. +// +// It returns historical gas information for the given block range, allowing +// fee estimation for EIP-1559 transactions. +func (c *MethodsCommon) FeeHistory(ctx context.Context, blockCount uint64, newestBlock types.BlockNumber, rewardPercentiles []float64) (*types.FeeHistory, error) { + var res types.FeeHistory + if err := c.Transport.Call(ctx, &res, "eth_feeHistory", types.NumberFromUint64(blockCount), newestBlock, rewardPercentiles); err != nil { + return nil, err + } + return &res, nil +} + // BlobBaseFee performs eth_blobBaseFee RPC call. // // It returns the expected base fee for blobs in the next block. @@ -389,3 +433,25 @@ func (c *MethodsCommon) BlobBaseFee(ctx context.Context) (*big.Int, error) { } return res.Big(), nil } + +// ProtocolVersion performs eth_protocolVersion RPC call. +// +// It returns the current Ethereum protocol version. +func (c *MethodsCommon) ProtocolVersion(ctx context.Context) (string, error) { + var res string + if err := c.Transport.Call(ctx, &res, "eth_protocolVersion"); err != nil { + return "", err + } + return res, nil +} + +// Coinbase performs eth_coinbase RPC call. +// +// It returns the client's coinbase address. +func (c *MethodsCommon) Coinbase(ctx context.Context) (types.Address, error) { + var res types.Address + if err := c.Transport.Call(ctx, &res, "eth_coinbase"); err != nil { + return types.ZeroAddress, err + } + return res, nil +} diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index 9543cc0..9721c7e 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -1409,3 +1409,254 @@ func TestBaseClient_SubscribeLogs(t *testing.T) { require.NoError(t, err) assert.NotNil(t, resultCh) } + +const mockGetProofRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getProof", + "params": [ + "0x1111111111111111111111111111111111111111", + ["0x0000000000000000000000000000000000000000000000000000000000000001"], + "latest" + ] + } +` + +const mockGetProofResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "address": "0x1111111111111111111111111111111111111111", + "accountProof": ["0xaabbcc"], + "balance": "0xde0b6b3a7640000", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "nonce": "0x1", + "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "storageProof": [ + { + "key": "0x0000000000000000000000000000000000000000000000000000000000000001", + "value": "0x2a", + "proof": ["0xddeeff"] + } + ] + } + } +` + +func TestBaseClient_GetProof(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockGetProofRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockGetProofResponse)), + }, nil + } + + storageKeys := []types.Hash{ + types.MustHashFromHex("0x0000000000000000000000000000000000000000000000000000000000000001", types.PadLeft), + } + proof, err := client.GetProof( + context.Background(), + types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), + storageKeys, + types.LatestBlockNumber, + ) + + require.NoError(t, err) + assert.Equal(t, types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), proof.Address) + assert.Equal(t, big.NewInt(1000000000000000000), proof.Balance) + assert.Equal(t, uint64(1), proof.Nonce) + assert.Equal(t, 1, len(proof.AccountProof)) + assert.Equal(t, 1, len(proof.StorageProof)) + assert.Equal(t, big.NewInt(42), proof.StorageProof[0].Value) +} + +const mockCreateAccessListRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_createAccessList", + "params": [ + { + "from": "0x1111111111111111111111111111111111111111", + "to": "0x2222222222222222222222222222222222222222" + }, + "latest" + ] + } +` + +const mockCreateAccessListResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "accessList": [ + { + "address": "0x2222222222222222222222222222222222222222", + "storageKeys": ["0x0000000000000000000000000000000000000000000000000000000000000001"] + } + ], + "gasUsed": "0x5208" + } + } +` + +func TestBaseClient_CreateAccessList(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockCreateAccessListRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockCreateAccessListResponse)), + }, nil + } + + from := types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111") + to := types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222") + result, err := client.CreateAccessList( + context.Background(), + &types.CallBasic{ + CallData: types.CallData{ + From: from, + To: to, + }, + }, + types.LatestBlockNumber, + ) + + require.NoError(t, err) + assert.Equal(t, uint64(21000), result.GasUsed) + assert.Equal(t, 1, len(result.AccessList)) + assert.Equal(t, types.MustAddressFromHex("0x2222222222222222222222222222222222222222"), result.AccessList[0].Address) +} + +const mockFeeHistoryRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_feeHistory", + "params": ["0x4", "latest", [25, 75]] + } +` + +const mockFeeHistoryResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "oldestBlock": "0x1", + "reward": [["0x1", "0x2"]], + "baseFeePerGas": ["0x3", "0x4"], + "gasUsedRatio": [0.5] + } + } +` + +func TestBaseClient_FeeHistory(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + // Unmarshal and compare to handle float serialization differences. + var got, want any + require.NoError(t, json.Unmarshal([]byte(readBody(req)), &got)) + require.NoError(t, json.Unmarshal([]byte(mockFeeHistoryRequest), &want)) + assert.Equal(t, want, got) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockFeeHistoryResponse)), + }, nil + } + + feeHistory, err := client.FeeHistory( + context.Background(), + 4, + types.LatestBlockNumber, + []float64{25, 75}, + ) + + require.NoError(t, err) + assert.Equal(t, uint64(1), feeHistory.OldestBlock) + assert.Equal(t, []*big.Int{big.NewInt(3), big.NewInt(4)}, feeHistory.BaseFeePerGas) + assert.Equal(t, []float64{0.5}, feeHistory.GasUsedRatio) + assert.Equal(t, 1, len(feeHistory.Reward)) + assert.Equal(t, []*big.Int{big.NewInt(1), big.NewInt(2)}, feeHistory.Reward[0]) +} + +const mockProtocolVersionRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_protocolVersion", + "params": [] + } +` + +const mockProtocolVersionResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x41" + } +` + +func TestBaseClient_ProtocolVersion(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockProtocolVersionRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockProtocolVersionResponse)), + }, nil + } + + version, err := client.ProtocolVersion(context.Background()) + + require.NoError(t, err) + assert.Equal(t, "0x41", version) +} + +const mockCoinbaseRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_coinbase", + "params": [] + } +` + +const mockCoinbaseResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": "0x1111111111111111111111111111111111111111" + } +` + +func TestBaseClient_Coinbase(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{Transport: httpMock} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + assert.JSONEq(t, mockCoinbaseRequest, readBody(req)) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockCoinbaseResponse)), + }, nil + } + + coinbase, err := client.Coinbase(context.Background()) + + require.NoError(t, err) + assert.Equal(t, types.MustAddressFromHex("0x1111111111111111111111111111111111111111"), coinbase) +} diff --git a/rpc/methods_wallet.go b/rpc/methods_wallet.go index f1339ef..859e0d8 100644 --- a/rpc/methods_wallet.go +++ b/rpc/methods_wallet.go @@ -55,7 +55,7 @@ func (c *MethodsWallet) SignTransaction(ctx context.Context, tx types.Transactio // SendTransaction performs eth_sendTransaction RPC call. // // It sends a transaction to the network. -func (c *MethodsCommon) SendTransaction(ctx context.Context, tx types.Transaction) (*types.Hash, error) { +func (c *MethodsWallet) SendTransaction(ctx context.Context, tx types.Transaction) (*types.Hash, error) { if tx == nil { return nil, errors.New("rpc client: transaction is nil") } diff --git a/rpc/methods_wallet_test.go b/rpc/methods_wallet_test.go index 6a8ca1a..bffe2ad 100644 --- a/rpc/methods_wallet_test.go +++ b/rpc/methods_wallet_test.go @@ -179,7 +179,7 @@ const mockSendTransactionResponse = ` func TestBaseClient_SendTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsWallet{Transport: httpMock} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSendTransactionRequest, readBody(req)) diff --git a/types/embed.go b/types/embed.go index b4a09fd..568a17f 100644 --- a/types/embed.go +++ b/types/embed.go @@ -260,7 +260,7 @@ type AccessListData struct { AccessList AccessList // AccessList is the EIP-2930 access list. } -// AccessListData returns the embedded access list data. +// GetAccessListData returns the embedded access list data. func (c *AccessListData) GetAccessListData() *AccessListData { return c } @@ -301,7 +301,7 @@ type DynamicFeeData struct { MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas. } -// DynamicFeeData returns the embedded dynamic fee data. +// GetDynamicFeeData returns the embedded dynamic fee data. func (c *DynamicFeeData) GetDynamicFeeData() *DynamicFeeData { return c } @@ -360,7 +360,7 @@ type BlobData struct { Blobs []BlobInfo // Blobs is the list of blobs. } -// BlobData returns the embedded blob data. +// GetBlobData returns the embedded blob data. func (c *BlobData) GetBlobData() *BlobData { return c } diff --git a/types/structs.go b/types/structs.go index c622f26..98b1ad7 100644 --- a/types/structs.go +++ b/types/structs.go @@ -522,6 +522,126 @@ type jsonFeeHistory struct { GasUsedRatio []float64 `json:"gasUsedRatio"` } +// AccessListResult represents the result of an eth_createAccessList call. +type AccessListResult struct { + AccessList AccessList // AccessList is the list of addresses and storage keys accessed by the transaction. + GasUsed uint64 // GasUsed is the gas used by the transaction with the given access list. + Error string // Error is an optional error message if the transaction would revert. +} + +// MarshalJSON implements the json.Marshaler interface. +func (a AccessListResult) MarshalJSON() ([]byte, error) { + return json.Marshal(&jsonAccessListResult{ + AccessList: a.AccessList, + GasUsed: NumberFromUint64(a.GasUsed), + Error: a.Error, + }) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (a *AccessListResult) UnmarshalJSON(data []byte) error { + j := &jsonAccessListResult{} + if err := json.Unmarshal(data, j); err != nil { + return err + } + a.AccessList = j.AccessList + a.GasUsed = j.GasUsed.Big().Uint64() + a.Error = j.Error + return nil +} + +type jsonAccessListResult struct { + AccessList AccessList `json:"accessList"` + GasUsed Number `json:"gasUsed"` + Error string `json:"error,omitempty"` +} + +// StorageProof represents a single storage proof entry returned by eth_getProof. +type StorageProof struct { + Key Hash // Key is the storage key. + Value *big.Int // Value is the storage value. + Proof []Bytes // Proof is the array of RLP-serialized MerkleTree-Nodes for this storage key. +} + +// MarshalJSON implements the json.Marshaler interface. +func (s StorageProof) MarshalJSON() ([]byte, error) { + return json.Marshal(&jsonStorageProof{ + Key: s.Key, + Value: NumberFromBigInt(s.Value), + Proof: s.Proof, + }) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (s *StorageProof) UnmarshalJSON(data []byte) error { + j := &jsonStorageProof{} + if err := json.Unmarshal(data, j); err != nil { + return err + } + s.Key = j.Key + s.Value = j.Value.Big() + s.Proof = j.Proof + return nil +} + +type jsonStorageProof struct { + Key Hash `json:"key"` + Value Number `json:"value"` + Proof []Bytes `json:"proof"` +} + +// AccountProof represents the result of an eth_getProof call as defined in EIP-1186. +// +// https://eips.ethereum.org/EIPS/eip-1186 +type AccountProof struct { + Address Address // Address is the account address. + AccountProof []Bytes // AccountProof is the array of RLP-serialized MerkleTree-Nodes from the stateRoot to the account leaf. + Balance *big.Int // Balance is the account balance. + CodeHash Hash // CodeHash is the hash of the account code, or the empty code hash. + Nonce uint64 // Nonce is the account nonce. + StorageHash Hash // StorageHash is the SHA3 of the StorageTrie root, or the empty storage hash. + StorageProof []StorageProof // StorageProof is the array of storage proofs for requested storage keys. +} + +// MarshalJSON implements the json.Marshaler interface. +func (a AccountProof) MarshalJSON() ([]byte, error) { + return json.Marshal(&jsonAccountProof{ + Address: a.Address, + AccountProof: a.AccountProof, + Balance: NumberFromBigInt(a.Balance), + CodeHash: a.CodeHash, + Nonce: NumberFromUint64(a.Nonce), + StorageHash: a.StorageHash, + StorageProof: a.StorageProof, + }) +} + +// UnmarshalJSON implements the json.Unmarshaler interface. +func (a *AccountProof) UnmarshalJSON(data []byte) error { + j := &jsonAccountProof{} + if err := json.Unmarshal(data, j); err != nil { + return err + } + a.Address = j.Address + a.AccountProof = j.AccountProof + a.Balance = j.Balance.Big() + a.CodeHash = j.CodeHash + a.Nonce = j.Nonce.Big().Uint64() + a.StorageHash = j.StorageHash + a.StorageProof = j.StorageProof + return nil +} + +type jsonAccountProof struct { + Address Address `json:"address"` + AccountProof []Bytes `json:"accountProof"` + Balance Number `json:"balance"` + CodeHash Hash `json:"codeHash"` + Nonce Number `json:"nonce"` + StorageHash Hash `json:"storageHash"` + StorageProof []StorageProof `json:"storageProof"` +} + // Log represents a contract log event. type Log struct { Address Address // Address of the contract that generated the event From a812cd2b8e140e6c8c5e17daac872fd092d08942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 13:02:37 +0200 Subject: [PATCH 13/44] Do not modify provided transport.Hijack instance --- rpc/client.go | 10 ++++++++-- rpc/transport/ipc.go | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rpc/client.go b/rpc/client.go index 2c39406..0169e19 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -400,11 +400,17 @@ func initPtr(r reflect.Value) bool { } func addHijacker(t transport.Transport, hijackers ...transport.Hijacker) transport.Transport { - if h, ok := t.(*transport.Hijack); ok { + if h, ok := t.(*optionTransportHijack); ok { h.Use(hijackers...) return h } - return transport.NewHijacker(t, hijackers...) + return optionTransportHijack{transport.NewHijacker(t, hijackers...)} +} + +// optionTransportHijack wraps a Hijack transport to ensure that hijackers +// added by the user won't be modified by the client. +type optionTransportHijack struct { + *transport.Hijack } var ( diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 1b99568..83b045a 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -25,7 +25,7 @@ type IPCOptions struct { Path string // Timeout is the timeout for the IPC requests. Default is 60s. - Timout time.Duration + Timeout time.Duration // ErrorCh is an optional channel used to report errors. ErrorCh chan error @@ -41,14 +41,14 @@ func NewIPC(opts IPCOptions) (*IPC, error) { if opts.Context == nil { return nil, errors.New("context cannot be nil") } - if opts.Timout == 0 { - opts.Timout = 60 * time.Second + if opts.Timeout == 0 { + opts.Timeout = 60 * time.Second } i := &IPC{ stream: &stream{ ctx: opts.Context, errCh: opts.ErrorCh, - timeout: opts.Timout, + timeout: opts.Timeout, }, conn: conn, } From 2b5d940d59bb8b3f6ae2dd7ba7b52c04a51bca0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 13:19:02 +0200 Subject: [PATCH 14/44] Fix WithSimulate with raw transactions --- rpc/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/client.go b/rpc/client.go index 0169e19..78932c0 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -87,7 +87,7 @@ func WithKeys(keys ...wallet.Key) ClientOption { } } -// WithSimulate simulates the transaction, by calling eth_call with the same +// WithSimulate simulates the transaction by calling eth_call with the same // parameters before sending the transaction. // // It works with eth_sendTransaction, eth_sendRawTransaction, and @@ -95,7 +95,7 @@ func WithKeys(keys ...wallet.Key) ClientOption { func WithSimulate() ClientOption { return &option{ apply: func(ctx *ClientOptionsContext, _ any) error { - ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{}) + ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{decoder: ctx.Decoder}) return nil }, order: 300, From 736b57ca9663867871a80bb210c3f0f661679a44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:31:50 +0200 Subject: [PATCH 15/44] Fix race condition in hijackChainID --- rpc/hijack_chainid.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/rpc/hijack_chainid.go b/rpc/hijack_chainid.go index 430faf1..3e067a3 100644 --- a/rpc/hijack_chainid.go +++ b/rpc/hijack_chainid.go @@ -3,6 +3,7 @@ package rpc import ( "context" "fmt" + "sync/atomic" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" @@ -18,7 +19,8 @@ type hijackChainID struct { // Call implements the [transport.Hijacker] interface. func (h *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc { return func(next transport.CallFunc) transport.CallFunc { - chainID := h.chainID + var chainID atomic.Uint64 + chainID.Store(h.chainID) return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) (err error) { if len(args) == 0 || method != "eth_sendTransaction" { return next(ctx, t, result, method, args...) @@ -29,13 +31,15 @@ func (h *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc } td := getTransactionData(tx) if td != nil && (h.replace || td.ChainID == nil) { - if chainID == 0 { - chainID, err = (&MethodsCommon{Transport: t}).ChainID(ctx) + if chainID.Load() == 0 { + id, err := (&MethodsCommon{Transport: t}).ChainID(ctx) if err != nil { return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("failed to get chain ID: %w", err)} } + chainID.Store(id) } - td.ChainID = &chainID + id := chainID.Load() + td.ChainID = &id } return next(ctx, t, result, method, args...) } From 119548fbc5af72655bd2a351e7759c027439c7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:41:25 +0200 Subject: [PATCH 16/44] Add constants for hijackers ordering --- rpc/client.go | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/rpc/client.go b/rpc/client.go index 78932c0..486498d 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -11,6 +11,19 @@ import ( "github.com/defiweb/go-eth/wallet" ) +const ( + OrderPost int = 100 * iota + OrderKeys + OrderSimulate + OrderNonce + OrderLegacyGasFee + OrderDynamicGasFee + OrderGasLimit + DefaultAddress + OrderChainID + OrderPre +) + // Client is a default RPC client that provides access to the standard Ethereum // JSON-RPC APIs. type Client struct { @@ -63,7 +76,7 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, - order: 100, + order: OrderPost, } } @@ -83,7 +96,7 @@ func WithKeys(keys ...wallet.Key) ClientOption { ctx.Transport = addHijacker(ctx.Transport, &hijackSign{keys: keys}) return nil }, - order: 200, + order: OrderKeys, } } @@ -98,7 +111,7 @@ func WithSimulate() ClientOption { ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{decoder: ctx.Decoder}) return nil }, - order: 300, + order: OrderSimulate, } } @@ -119,7 +132,7 @@ func WithNonce(opts NonceOptions) ClientOption { }) return nil }, - order: 400, + order: OrderNonce, } } @@ -151,7 +164,7 @@ func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { }) return nil }, - order: 500, + order: OrderLegacyGasFee, } } @@ -189,7 +202,7 @@ func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { }) return nil }, - order: 600, + order: OrderDynamicGasFee, } } @@ -217,7 +230,7 @@ func WithGasLimit(opts GasLimitOptions) ClientOption { }) return nil }, - order: 700, + order: OrderGasLimit, } } @@ -240,7 +253,7 @@ func WithDefaultAddress(opts AddressOptions) ClientOption { }) return nil }, - order: 800, + order: DefaultAddress, } } @@ -262,7 +275,7 @@ func WithChainID(opts ChainIDOptions) ClientOption { }) return nil }, - order: 900, + order: OrderChainID, } } @@ -274,7 +287,7 @@ func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, - order: 1000, + order: OrderPre, } } From d363bab43901c64a54677ba719cbb2dff220e9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:43:27 +0200 Subject: [PATCH 17/44] Fix nil context check in IPC transport --- rpc/transport/ipc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 83b045a..7decc0e 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -33,14 +33,14 @@ type IPCOptions struct { // NewIPC creates a new [IPC] instance. func NewIPC(opts IPCOptions) (*IPC, error) { + if opts.Context == nil { + return nil, errors.New("context cannot be nil") + } var d net.Dialer conn, err := d.DialContext(opts.Context, "unix", opts.Path) if err != nil { return nil, fmt.Errorf("failed to dial IPC: %w", err) } - if opts.Context == nil { - return nil, errors.New("context cannot be nil") - } if opts.Timeout == 0 { opts.Timeout = 60 * time.Second } From 989e9f0df8848fa47ebb4ac6c91b35d1d3a16582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:47:20 +0200 Subject: [PATCH 18/44] Add context done check in transport.stream --- rpc/transport/stream.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rpc/transport/stream.go b/rpc/transport/stream.go index 165b7d3..aadb715 100644 --- a/rpc/transport/stream.go +++ b/rpc/transport/stream.go @@ -203,7 +203,11 @@ func (s *stream) callChSend(id uint64, res rpcResponse) { s.mu.RLock() defer s.mu.RUnlock() if ch := s.calls[id]; ch != nil { - ch <- res + select { + case ch <- res: + case <-s.ctx.Done(): + return + } } } @@ -213,6 +217,10 @@ func (s *stream) subChSend(id string, res json.RawMessage) { s.mu.RLock() defer s.mu.RUnlock() if ch := s.subs[id]; ch != nil { - ch <- res + select { + case ch <- res: + case <-s.ctx.Done(): + return + } } } From f59f2eb0bfc0cca60c435a3f323af3af2b1d7f51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:50:20 +0200 Subject: [PATCH 19/44] Add context done check in transport.ipc --- rpc/transport/ipc.go | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 7decc0e..b5e1baa 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -52,7 +52,7 @@ func NewIPC(opts IPCOptions) (*IPC, error) { }, conn: conn, } - i.stream.initStream() + i.initStream() go i.readerRoutine() go i.writerRoutine() return i, nil @@ -71,7 +71,11 @@ func (i *IPC) readerRoutine() { } i.errCh <- err } - i.readerCh <- res + select { + case i.readerCh <- res: + case <-i.ctx.Done(): + return + } } } @@ -79,18 +83,25 @@ func (i *IPC) writerRoutine() { enc := json.NewEncoder(i.conn) for { select { - case <-i.ctx.Done(): - return - case req := <-i.stream.writerCh: + case req := <-i.writerCh: if err := enc.Encode(req); err != nil { + if i.errCh == nil { + return + } if errors.Is(err, context.Canceled) { return } if errors.Is(err, io.EOF) { return } - i.stream.errCh <- err + select { + case i.errCh <- err: + case <-i.ctx.Done(): + return + } } + case <-i.ctx.Done(): + return } } } From f76fb1558584f48bfb33a7ba7e9ce1e343fd792a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 15:51:45 +0200 Subject: [PATCH 20/44] Use pointer receiver in CallBasic --- types/call_basic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/call_basic.go b/types/call_basic.go index 24258db..57620b4 100644 --- a/types/call_basic.go +++ b/types/call_basic.go @@ -30,7 +30,7 @@ func (c CallBasic) MarshalJSON() ([]byte, error) { } // UnmarshalJSON implements the json.Unmarshaler interface. -func (c CallBasic) UnmarshalJSON(bytes []byte) error { +func (c *CallBasic) UnmarshalJSON(bytes []byte) error { j := &jsonCall{} if err := json.Unmarshal(bytes, &j); err != nil { return err From d167f56ca3d7307e82624c7319d2e1b4cfe24fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 16:08:53 +0200 Subject: [PATCH 21/44] Fix various small issues in types pkg --- types/structs.go | 48 ++++++++++++++++++++++++++++++++++-------------- types/types.go | 10 +++------- types/util.go | 5 ++--- 3 files changed, 39 insertions(+), 24 deletions(-) diff --git a/types/structs.go b/types/structs.go index 98b1ad7..b483016 100644 --- a/types/structs.go +++ b/types/structs.go @@ -218,7 +218,11 @@ func (t *TransactionOnChain) UnmarshalJSON(data []byte) error { } t.Hash = ocd.Hash t.BlockHash = ocd.BlockHash - t.BlockNumber = ocd.BlockNumber.Big() + if ocd.BlockNumber != nil { + t.BlockNumber = ocd.BlockNumber.Big() + } else { + t.BlockNumber = nil + } if ocd.TransactionIndex != nil { index := ocd.TransactionIndex.Big().Uint64() t.TransactionIndex = &index @@ -462,17 +466,20 @@ func (b *jsonBlockTransactions) UnmarshalJSON(data []byte) error { // FeeHistory contains information about the fee structure and gas usage // over a range of blocks. type FeeHistory struct { - OldestBlock uint64 // OldestBlock is the oldest block number for which the base fee and gas used are returned. - Reward [][]*big.Int // Reward is the reward for each block in the range [OldestBlock, LatestBlock]. - BaseFeePerGas []*big.Int // BaseFeePerGas is the base fee per gas for each block in the range [OldestBlock, LatestBlock]. - GasUsedRatio []float64 // GasUsedRatio is the gas used ratio for each block in the range [OldestBlock, LatestBlock]. + OldestBlock uint64 // OldestBlock is the oldest block number for which fees are returned. + Reward [][]*big.Int // Reward is the priority fee percentiles for each block. + BaseFeePerGas []*big.Int // BaseFeePerGas is the base fee per gas for each block (len = blockCount+1). + GasUsedRatio []float64 // GasUsedRatio is the gas used ratio for each block. + BaseFeePerBlobGas []*big.Int // BaseFeePerBlobGas is the base fee per blob gas for each block (EIP-4844, len = blockCount+1). + BlobGasUsedRatio []float64 // BlobGasUsedRatio is the blob gas used ratio for each block (EIP-4844). } // MarshalJSON implements the json.Marshaler interface. func (f FeeHistory) MarshalJSON() ([]byte, error) { feeHistory := &jsonFeeHistory{ - OldestBlock: NumberFromUint64(f.OldestBlock), - GasUsedRatio: f.GasUsedRatio, + OldestBlock: NumberFromUint64(f.OldestBlock), + GasUsedRatio: f.GasUsedRatio, + BlobGasUsedRatio: f.BlobGasUsedRatio, } if len(f.Reward) > 0 { feeHistory.Reward = make([][]Number, len(f.Reward)) @@ -489,6 +496,12 @@ func (f FeeHistory) MarshalJSON() ([]byte, error) { feeHistory.BaseFeePerGas[i] = NumberFromBigInt(b) } } + if len(f.BaseFeePerBlobGas) > 0 { + feeHistory.BaseFeePerBlobGas = make([]Number, len(f.BaseFeePerBlobGas)) + for i, b := range f.BaseFeePerBlobGas { + feeHistory.BaseFeePerBlobGas[i] = NumberFromBigInt(b) + } + } return json.Marshal(feeHistory) } @@ -511,15 +524,22 @@ func (f *FeeHistory) UnmarshalJSON(input []byte) error { f.BaseFeePerGas[i] = b.Big() } f.GasUsedRatio = feeHistory.GasUsedRatio + f.BaseFeePerBlobGas = make([]*big.Int, len(feeHistory.BaseFeePerBlobGas)) + for i, b := range feeHistory.BaseFeePerBlobGas { + f.BaseFeePerBlobGas[i] = b.Big() + } + f.BlobGasUsedRatio = feeHistory.BlobGasUsedRatio return nil } // jsonFeeHistory is the JSON representation of a fee history. type jsonFeeHistory struct { - OldestBlock Number `json:"oldestBlock"` - Reward [][]Number `json:"reward"` - BaseFeePerGas []Number `json:"baseFeePerGas"` - GasUsedRatio []float64 `json:"gasUsedRatio"` + OldestBlock Number `json:"oldestBlock"` + Reward [][]Number `json:"reward,omitempty"` + BaseFeePerGas []Number `json:"baseFeePerGas,omitempty"` + GasUsedRatio []float64 `json:"gasUsedRatio,omitempty"` + BaseFeePerBlobGas []Number `json:"baseFeePerBlobGas,omitempty"` + BlobGasUsedRatio []float64 `json:"blobGasUsedRatio,omitempty"` } // AccessListResult represents the result of an eth_createAccessList call. @@ -558,7 +578,7 @@ type jsonAccessListResult struct { // StorageProof represents a single storage proof entry returned by eth_getProof. type StorageProof struct { - Key Hash // Key is the storage key. + Key Hash // Key is the storage key. Value *big.Int // Value is the storage value. Proof []Bytes // Proof is the array of RLP-serialized MerkleTree-Nodes for this storage key. } @@ -585,8 +605,8 @@ func (s *StorageProof) UnmarshalJSON(data []byte) error { } type jsonStorageProof struct { - Key Hash `json:"key"` - Value Number `json:"value"` + Key Hash `json:"key"` + Value Number `json:"value"` Proof []Bytes `json:"proof"` } diff --git a/types/types.go b/types/types.go index 79a8b28..5221443 100644 --- a/types/types.go +++ b/types/types.go @@ -3,7 +3,6 @@ package types import ( "encoding/json" "fmt" - "math" "math/big" "strings" @@ -426,7 +425,7 @@ func (t *Hash) DecodeRLP(data []byte) (int, error) { return n, nil } if len(b) != HashLength { - return 0, fmt.Errorf("invalid hash length %d", len(t)) + return 0, fmt.Errorf("invalid hash length %d", len(b)) } copy(t[:], b) return n, nil @@ -641,9 +640,6 @@ func (t *BlockNumber) UnmarshalText(input []byte) error { if err != nil { return err } - if u.Cmp(big.NewInt(math.MaxInt64)) > 0 { - return fmt.Errorf("block number larger than int64") - } *t = BlockNumber{x: *u} return nil } @@ -962,7 +958,7 @@ func NumberFromBigInt(x *big.Int) Number { if x == nil { return Number{} } - return Number{x: *x} + return Number{x: *copyBigInt(x)} } // NumberFromBigIntPtr converts a big.Int to a *Number type. @@ -1133,7 +1129,7 @@ func (l oneOrList[T]) MarshalJSON() ([]byte, error) { } func (l *oneOrList[T]) UnmarshalJSON(input []byte) error { - if len(input) >= 1 && input[0] == '[' || input[0] == '{' { + if len(input) >= 1 && (input[0] == '[' || input[0] == '{') { return json.Unmarshal(input, l) } var i T diff --git a/types/util.go b/types/util.go index b85b4a2..6d06093 100644 --- a/types/util.go +++ b/types/util.go @@ -144,7 +144,7 @@ func marshalJSONMerge(vs ...any) ([]byte, error) { if err != nil { return nil, err } - if len(b) < 2 || (b[0] != '{' && b[len(b)-1] != '}') { + if len(b) < 2 || b[0] != '{' || b[len(b)-1] != '}' { return nil, fmt.Errorf("expected JSON object, got %s", b) } if n > 0 { @@ -201,6 +201,5 @@ func copyBigInt(p *big.Int) *big.Int { if p == nil { return nil } - c := new(big.Int).Set(p) - return c + return new(big.Int).Set(p) } From 65754861432004e9b295882e27ddd909c243dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 19 May 2026 16:14:32 +0200 Subject: [PATCH 22/44] Fix unit tests --- types/types_test.go | 8 ++++---- types/util_test.go | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/types/types_test.go b/types/types_test.go index 10cb741..95b34d4 100644 --- a/types/types_test.go +++ b/types/types_test.go @@ -730,7 +730,7 @@ func Test_BlockNumberFromHex(t *testing.T) { assert.Error(t, err) } else { assert.NoError(t, err) - assert.Equal(t, tt.want, bn) + assert.Equal(t, tt.want.String(), bn.String()) } }) } @@ -833,7 +833,7 @@ func Test_BlockNumberType_UnmarshalJSON(t *testing.T) { assert.Error(t, err) } else { assert.NoError(t, err) - assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.want.String(), (*v).String()) assert.Equal(t, tt.isTag, v.IsTag()) assert.Equal(t, tt.isEarliest, v.IsEarliest()) assert.Equal(t, tt.isLatest, v.IsLatest()) @@ -901,7 +901,7 @@ func Test_BlockNumberType_UnmarshalText(t *testing.T) { assert.Error(t, err) } else { assert.NoError(t, err) - assert.Equal(t, tt.want, *v) + assert.Equal(t, tt.want.String(), (*v).String()) assert.Equal(t, tt.isTag, v.IsTag()) assert.Equal(t, tt.isEarliest, v.IsEarliest()) assert.Equal(t, tt.isLatest, v.IsLatest()) @@ -1226,7 +1226,7 @@ func Test_NumberFromHex(t *testing.T) { require.Error(t, err) } else { require.NoError(t, err) - assert.Equal(t, tt.want, got) + assert.Equal(t, tt.want.String(), got.String()) } }) } diff --git a/types/util_test.go b/types/util_test.go index a817116..78c7834 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -9,7 +9,9 @@ import ( func assertEqualTX(t *testing.T, actual, expected Transaction) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) - assert.Equal(t, actual.GetTransactionData(), expected.GetTransactionData()) + if _, ok := expected.(HasTransactionData); ok { + assert.Equal(t, expected.(HasTransactionData).GetTransactionData(), actual.(HasTransactionData).GetTransactionData()) + } if _, ok := expected.(HasCallData); ok { assert.Equal(t, actual.(HasCallData).GetCallData(), actual.(HasCallData).GetCallData()) } From 21a3ce95b7ef4aaba622fa787691189bf9eec24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Wed, 27 May 2026 02:57:58 +0200 Subject: [PATCH 23/44] Refactor types and rpc pkgs --- crypto/txsign/txsign.go | 32 +- .../txsign/{txsing_test.go => txsign_test.go} | 13 +- rpc/client.go | 189 ++++++----- rpc/hijack_address.go | 10 +- rpc/hijack_chainid.go | 8 +- rpc/hijack_gasfee.go | 10 +- rpc/hijack_gaslimit.go | 8 +- rpc/hijack_nonce.go | 12 +- rpc/hijack_sign.go | 24 +- rpc/hijack_simulate.go | 15 +- rpc/hijack_simulate_test.go | 2 +- rpc/methods_client.go | 13 +- rpc/methods_client_test.go | 10 +- rpc/methods_common.go | 112 ++++--- rpc/methods_common_test.go | 136 +++++--- rpc/methods_filter.go | 17 +- rpc/methods_filter_test.go | 14 +- rpc/methods_privatetransactions.go | 10 +- rpc/methods_privatetransactions_test.go | 4 +- rpc/methods_wallet.go | 11 +- rpc/methods_wallet_test.go | 8 +- rpc/transport/ipc.go | 8 +- rpc/util.go | 94 ++---- types/call.go | 2 +- types/call_accesslist.go | 18 +- types/call_accesslist_test.go | 4 +- types/call_basic.go | 8 +- types/call_blob.go | 8 +- types/call_blob_test.go | 4 +- types/call_dynamicfee.go | 10 +- types/call_dynamicfee_test.go | 2 +- types/call_legacy.go | 16 +- types/call_legacy_test.go | 4 +- types/{embed.go => components.go} | 232 ++++++++----- types/{embed_test.go => components_test.go} | 36 +- types/structs.go | 310 +++++++++++++----- types/structs_test.go | 6 +- types/tx.go | 27 +- types/tx_accesslist.go | 32 +- types/tx_accesslist_test.go | 22 +- types/tx_blob.go | 22 +- types/tx_blob_test.go | 30 +- types/tx_decoder.go | 12 +- types/tx_decoder_test.go | 52 +-- types/tx_dynamicfee.go | 22 +- types/tx_dynamicfee_test.go | 18 +- types/tx_legacy.go | 26 +- types/tx_legacy_test.go | 38 +-- types/types.go | 31 +- types/util_test.go | 20 +- wallet/key.go | 2 +- wallet/key_priv.go | 2 +- wallet/key_rpc.go | 10 +- 53 files changed, 1060 insertions(+), 726 deletions(-) rename crypto/txsign/{txsing_test.go => txsign_test.go} (96%) rename types/{embed.go => components.go} (58%) rename types/{embed_test.go => components_test.go} (97%) diff --git a/crypto/txsign/txsign.go b/crypto/txsign/txsign.go index dce0699..3d27426 100644 --- a/crypto/txsign/txsign.go +++ b/crypto/txsign/txsign.go @@ -12,12 +12,16 @@ import ( ) // Sign signs the given transaction with the given private key. -func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { +func Sign(key *ecdsa.PrivateKey, tx types.SignableTransaction) error { if key == nil { return fmt.Errorf("missing private key") } - txd := tx.GetTransactionData() - hash, err := tx.CalculateSigningHash() + if tx == nil { + return fmt.Errorf("missing transaction") + } + sd := tx.GetSigningData() + ed := types.GetExecutionData(sd) + hash, err := tx.SigningHash() if err != nil { return err } @@ -27,35 +31,35 @@ func Sign(key *ecdsa.PrivateKey, tx types.Transaction) error { } sv, sr, ss := sig.V, sig.R, sig.S if tx.Type() == types.LegacyTxType { - if txd.ChainID != nil { - sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*txd.ChainID*2)) + if sd.ChainID != nil { + sv = new(big.Int).Add(sv, new(big.Int).SetUint64(*sd.ChainID*2)) sv = new(big.Int).Add(sv, big.NewInt(35)) } else { sv = new(big.Int).Add(sv, big.NewInt(27)) } } - txd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) - if cd, ok := tx.(types.HasCallData); ok { - cd.GetCallData().SetFrom(types.Address(crypto.ECPublicKeyToAddress(crypto.ECPrivateKeyToPublicKey(key)))) + sd.SetSignature(types.SignatureFromVRS(sv, sr, ss)) + if ed != nil { + ed.SetFrom(types.Address(crypto.ECPublicKeyToAddress(crypto.ECPrivateKeyToPublicKey(key)))) } return nil } // Recover recovers the Ethereum address from the given transaction's // signature. -func Recover(tx types.Transaction) (*types.Address, error) { - txd := tx.GetTransactionData() - if txd.Signature == nil { +func Recover(tx types.SignableTransaction) (*types.Address, error) { + std := tx.GetSigningData() + if std.Signature == nil { return nil, fmt.Errorf("signature is missing") } - sig := *txd.Signature + sig := *std.Signature if tx.Type() == types.LegacyTxType { if sig.V.Cmp(big.NewInt(35)) >= 0 { x := new(big.Int).Sub(sig.V, big.NewInt(35)) // Derive the chain ID from the signature. chainID := new(big.Int).Div(x, big.NewInt(2)) - if txd.ChainID != nil && *txd.ChainID != chainID.Uint64() { + if std.ChainID != nil && *std.ChainID != chainID.Uint64() { return nil, fmt.Errorf("invalid chain ID: %d", chainID) } @@ -65,7 +69,7 @@ func Recover(tx types.Transaction) (*types.Address, error) { sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) } } - hash, err := tx.CalculateSigningHash() + hash, err := tx.SigningHash() if err != nil { return nil, err } diff --git a/crypto/txsign/txsing_test.go b/crypto/txsign/txsign_test.go similarity index 96% rename from crypto/txsign/txsing_test.go rename to crypto/txsign/txsign_test.go index 5b3ceec..2aaae93 100644 --- a/crypto/txsign/txsing_test.go +++ b/crypto/txsign/txsign_test.go @@ -6,11 +6,12 @@ import ( "testing" "github.com/btcsuite/btcd/btcec/v2" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/hexutil" "github.com/defiweb/go-eth/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestSign(t *testing.T) { @@ -25,7 +26,7 @@ func TestSign(t *testing.T) { err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) require.NoError(t, err) - txData := tx.GetTransactionData() + txData := tx.GetSigningData() require.NotNil(t, txData.Signature) assert.Equal(t, "1b", txData.Signature.V.Text(16)) assert.Equal(t, "2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470", txData.Signature.R.Text(16)) @@ -44,7 +45,7 @@ func TestSign(t *testing.T) { err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) require.NoError(t, err) - txData := tx.GetTransactionData() + txData := tx.GetSigningData() require.NotNil(t, txData.Signature) assert.Equal(t, "0", txData.Signature.V.Text(16)) assert.Equal(t, "62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152", txData.Signature.R.Text(16)) @@ -60,7 +61,7 @@ func TestRecover(t *testing.T) { tx.SetGasPrice(big.NewInt(20000000000)) tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - txData := tx.GetTransactionData() + txData := tx.GetSigningData() txData.SetSignature(types.SignatureFromVRS( hexutil.MustHexToBigInt("1b"), hexutil.MustHexToBigInt("2bfad43ba1b40e7f3ffb6342b1a6eecc700dd344fb0aba543aed5c10fd1a9470"), @@ -81,7 +82,7 @@ func TestRecover(t *testing.T) { tx.SetMaxPriorityFeePerGas(big.NewInt(20000000000)) tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - txData := tx.GetTransactionData() + txData := tx.GetSigningData() txData.SetSignature(types.SignatureFromVRS( hexutil.MustHexToBigInt("0"), hexutil.MustHexToBigInt("62072d055f9ceb871a47f2d81aeb5aa34df50c625da16c6d0d57d232fa3cd152"), diff --git a/rpc/client.go b/rpc/client.go index 486498d..a29b7fc 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -33,21 +33,23 @@ type Client struct { MethodsClient } -type ClientOptionsContext struct { - Transport transport.Transport // Transport instance that will be passed to the client. - Decoder types.TransactionDecoder // Transaction decoder that will be passed to the client. - Custom map[any]any // Custom data that may be used by client options. +type ClientContext struct { + // Transport is the transport for the client. + Transport transport.Transport + + // Decoder is the transaction decoder for the client. + Decoder types.TransactionDecoder } type ClientOption interface { - Apply(cfg *ClientOptionsContext, client any) error + Apply(cfg *ClientContext, client any) error Order() int } // WithTransport sets the transport for the client. func WithTransport(t transport.Transport) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = t return nil }, @@ -57,11 +59,11 @@ func WithTransport(t transport.Transport) ClientOption { // WithTransactionDecoder sets the transaction decoder for the client. // The default decoder is types.DefaultTransactionDecoder. // -// Using custom decoder allows to decode custom transaction types that may be +// Using custom decoder allows decoding custom transaction types that may be // present in some L2 implementations. func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Decoder = decoder return nil }, @@ -72,7 +74,7 @@ func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { // applied by the client. func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, @@ -80,7 +82,7 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { } } -// WithKeys allows to emulate the behavior of the RPC methods that require +// WithKeys allows emulating the behavior of the RPC methods that require // a private key to sign the data. // // The following methods are affected: @@ -92,7 +94,7 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { // This option will modify the provided transaction instance. func WithKeys(keys ...wallet.Key) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, &hijackSign{keys: keys}) return nil }, @@ -107,7 +109,7 @@ func WithKeys(keys ...wallet.Key) ClientOption { // eth_sendPrivateTransaction methods. func WithSimulate() ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{decoder: ctx.Decoder}) return nil }, @@ -116,8 +118,11 @@ func WithSimulate() ClientOption { } type NonceOptions struct { - UsePendingBlock bool // UsePendingBlock indicates whether to use the pending block. - Replace bool // Replace is true if the nonce should be replaced even if it is already set. + // UsePendingBlock queries the nonce from the pending block. + UsePendingBlock bool + + // Replace overwrites the nonce even if already set. + Replace bool } // WithNonce sets the nonce in the transaction. @@ -125,7 +130,7 @@ type NonceOptions struct { // This option will modify the provided transaction instance. func WithNonce(opts NonceOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, &hijackNonce{ usePendingBlock: opts.UsePendingBlock, replace: opts.Replace, @@ -137,21 +142,31 @@ func WithNonce(opts NonceOptions) ClientOption { } type LegacyGasFeeOptions struct { - Multiplier float64 // Multiplier is applied to the gas price. - MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. - MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. - Replace bool // Replace is true if the gas price should be replaced even if it is already set. - AllowChangeType bool // AllowChangeType is true if the transaction type can be changed if it does not support legacy price data. + // Multiplier is applied to the fetched gas price. + Multiplier float64 + + // MinGasPrice is the lower bound; nil means no lower bound. + MinGasPrice *big.Int + + // MaxGasPrice is the upper bound; nil means no upper bound. + MaxGasPrice *big.Int + + // Replace overwrites the gas price even if already set. + Replace bool + + // AllowChangeType converts the transaction type when it does not + // support legacy fee data. + AllowChangeType bool } // WithLegacyGasFee estimates the gas price and sets it in the transaction. // -// It only works with eth_sendTransaction method, raw transactions are not supported. +// It only works with eth_sendTransaction; raw transactions are not supported. // // This option will modify the provided transaction instance. func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { if opts.Multiplier == 0 { return fmt.Errorf("rpc client: gas price multiplier must be greater than 0") } @@ -169,24 +184,40 @@ func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { } type DynamicGasFeeOptions struct { - GasPriceMultiplier float64 // GasPriceMultiplier is applied to the gas price. - PriorityFeePerGasMultiplier float64 // PriorityFeePerGasMultiplier is applied to the priority fee per gas. - MinGasPrice *big.Int // MinGasPrice is the minimum gas price, or nil if there is no lower bound. - MaxGasPrice *big.Int // MaxGasPrice is the maximum gas price, or nil if there is no upper bound. - MinPriorityFeePerGas *big.Int // MinPriorityFeePerGas is the minimum priority fee per gas, or nil if there is no lower bound. - MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas, or nil if there is no upper bound. - Replace bool // Replace is true if the gas price should be replaced even if it is already set. - AllowChangeType bool // AllowChangeType is true if the transaction type can be changed if it does not support dynamic price data. + // GasPriceMultiplier is applied to the base fee. + GasPriceMultiplier float64 + + // PriorityFeePerGasMultiplier is applied to the priority fee. + PriorityFeePerGasMultiplier float64 + + // MinGasPrice is the lower bound on maxFeePerGas; nil means none. + MinGasPrice *big.Int + + // MaxGasPrice is the upper bound on maxFeePerGas; nil means none. + MaxGasPrice *big.Int + + // MinPriorityFeePerGas is the lower bound; nil means no lower bound. + MinPriorityFeePerGas *big.Int + + // MaxPriorityFeePerGas is the upper bound; nil means no upper bound. + MaxPriorityFeePerGas *big.Int + + // Replace overwrites the fee fields even if already set. + Replace bool + + // AllowChangeType converts the transaction type when it does not + // support dynamic fee data. + AllowChangeType bool } // WithDynamicGasFee estimates the gas price and sets it in the transaction. // -// It only works with eth_sendTransaction method, raw transactions are not supported. +// It only works with eth_sendTransaction; raw transactions are not supported. // // This option will modify the provided transaction instance. func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { if opts.GasPriceMultiplier == 0 || opts.PriorityFeePerGasMultiplier == 0 { return fmt.Errorf("rpc client: gas price and priority fee multipliers must be greater than 0") } @@ -207,10 +238,17 @@ func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { } type GasLimitOptions struct { - Multiplier float64 // Multiplier is applied to the gas limit. - MinGas uint64 // MinGas is the minimum gas limit, or 0 if there is no lower bound. - MaxGas uint64 // MaxGas is the maximum gas limit, or 0 if there is no upper bound. - Replace bool // Replace is true if the gas limit should be replaced even if it is already set. + // Multiplier is applied to the estimated gas limit. + Multiplier float64 + + // MinGas is the lower bound on the gas limit. 0 means no lower bound. + MinGas uint64 + + // MaxGas is the upper bound on the gas limit. 0 means no upper bound. + MaxGas uint64 + + // Replace overwrites the gas limit even if already set. + Replace bool } // WithGasLimit estimates the gas limit and sets it in the transaction. @@ -218,7 +256,7 @@ type GasLimitOptions struct { // This option will modify the provided transaction instance. func WithGasLimit(opts GasLimitOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { if opts.Multiplier == 0 { return fmt.Errorf("rpc client: gas limit multiplier must be greater than 0") } @@ -235,8 +273,11 @@ func WithGasLimit(opts GasLimitOptions) ClientOption { } type AddressOptions struct { - Address types.Address // Address is the default address to use. - Replace bool // Replace is true if the address should be replaced even if it is already set. + // Address is the default sender address. + Address types.Address + + // Replace overwrites the address even if already set. + Replace bool } // WithDefaultAddress sets the default address for calls and transactions. @@ -246,7 +287,7 @@ type AddressOptions struct { // This option will modify the provided transaction and call instances. func WithDefaultAddress(opts AddressOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, &hijackAddress{ address: opts.Address, replace: opts.Replace, @@ -258,8 +299,11 @@ func WithDefaultAddress(opts AddressOptions) ClientOption { } type ChainIDOptions struct { - ChainID uint64 // ChainID is the chain ID to use. If 0, then value is fetched from the node. - Replace bool // Replace is true if the chain ID should be replaced even if it is already set. + // ChainID to set. If 0, the value is fetched from the node. + ChainID uint64 + + // Replace overwrites the chain ID even if already set. + Replace bool } // WithChainID sets the chain ID in the transaction. @@ -268,7 +312,7 @@ type ChainIDOptions struct { // This option will modify the provided transaction instance. func WithChainID(opts ChainIDOptions) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, &hijackChainID{ chainID: opts.ChainID, replace: opts.Replace, @@ -283,7 +327,7 @@ func WithChainID(opts ChainIDOptions) ClientOption { // applied by the client. func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ - apply: func(ctx *ClientOptionsContext, _ any) error { + apply: func(ctx *ClientContext, _ any) error { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, @@ -291,13 +335,13 @@ func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { } } -type ClientOptions func(c *ClientOptionsContext, client any) error +type ClientOptions func(c *ClientContext, client any) error // NewClient creates a new RPC client. // // The WithTransport option is required. func NewClient(opts ...ClientOption) (*Client, error) { - ctx := &ClientOptionsContext{} + ctx := &ClientContext{} client := &Client{} if err := applyOptions(ctx, opts); err != nil { return nil, fmt.Errorf("rpc client: option error: %w", err) @@ -308,11 +352,10 @@ func NewClient(opts ...ClientOption) (*Client, error) { if ctx.Transport == nil { return nil, fmt.Errorf("rpc client: transport is required") } - client.MethodsCommon.Transport = ctx.Transport - client.MethodsFilter.Transport = ctx.Transport - client.MethodsWallet.Transport = ctx.Transport - client.MethodsClient.Transport = ctx.Transport - client.MethodsCommon.Decoder = ctx.Decoder + client.MethodsCommon.Context = ctx + client.MethodsFilter.Context = ctx + client.MethodsWallet.Context = ctx + client.MethodsClient.Context = ctx return client, nil } @@ -321,11 +364,10 @@ func NewClient(opts ...ClientOption) (*Client, error) { // // The WithTransport option is required. // -// This method automatically initializes the client fields that are nil -// and recursively sets the all fields that are of the transport.Transport or -// types.TransactionDecoder types. +// This method automatically initializes nil client fields and recursively +// sets the [ClientContext] in all nested structs. func NewCustomClient[T any](opts ...ClientOption) (*T, error) { - ctx := &ClientOptionsContext{} + ctx := &ClientContext{} client := new(T) if err := applyOptions(ctx, opts); err != nil { return nil, fmt.Errorf("rpc client: option error: %w", err) @@ -341,11 +383,11 @@ func NewCustomClient[T any](opts ...ClientOption) (*T, error) { } type option struct { - apply func(*ClientOptionsContext, any) error + apply func(*ClientContext, any) error order int } -func (o *option) Apply(ctx *ClientOptionsContext, client any) error { +func (o *option) Apply(ctx *ClientContext, client any) error { return o.apply(ctx, client) } @@ -353,7 +395,7 @@ func (o *option) Order() int { return o.order } -func applyOptions(c *ClientOptionsContext, opts []ClientOption) error { +func applyOptions(c *ClientContext, opts []ClientOption) error { sort.Slice(opts, func(i, j int) bool { return opts[i].Order() < opts[j].Order() }) @@ -365,7 +407,7 @@ func applyOptions(c *ClientOptionsContext, opts []ClientOption) error { return nil } -func setFields(ctx *ClientOptionsContext, r reflect.Value) { +func setFields(ctx *ClientContext, r reflect.Value) { for r.Kind() == reflect.Ptr || r.Kind() == reflect.Interface { r = r.Elem() } @@ -377,20 +419,12 @@ func setFields(ctx *ClientOptionsContext, r reflect.Value) { if !f.CanInterface() { continue } - t := f.Type() - switch t { - case transportTy: - if f.CanSet() { - f.Set(reflect.ValueOf(ctx.Transport)) - } - case decoderTy: - if f.CanSet() { - f.Set(reflect.ValueOf(ctx.Decoder)) - } - default: - if initPtr(f) { - setFields(ctx, f) - } + if f.Type() == contextTy && f.CanSet() { + f.Set(reflect.ValueOf(ctx)) + continue + } + if initPtr(f) { + setFields(ctx, f) } } } @@ -420,13 +454,10 @@ func addHijacker(t transport.Transport, hijackers ...transport.Hijacker) transpo return optionTransportHijack{transport.NewHijacker(t, hijackers...)} } -// optionTransportHijack wraps a Hijack transport to ensure that hijackers -// added by the user won't be modified by the client. +// optionTransportHijack wraps a Hijack transport to distinguish user-provided +// hijackers from those used internally by the client. type optionTransportHijack struct { *transport.Hijack } -var ( - transportTy = reflect.TypeOf((*transport.Transport)(nil)).Elem() - decoderTy = reflect.TypeOf((*types.TransactionDecoder)(nil)).Elem() -) +var contextTy = reflect.TypeOf((*ClientContext)(nil)).Elem() diff --git a/rpc/hijack_address.go b/rpc/hijack_address.go index 06f1a97..befd51f 100644 --- a/rpc/hijack_address.go +++ b/rpc/hijack_address.go @@ -21,25 +21,25 @@ func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc if len(args) == 0 { return next(ctx, t, result, method, args...) } - var cd *types.CallData + var ed *types.ExecutionData switch method { case "eth_sendTransaction": tx, ok := args[0].(types.Transaction) if !ok { return next(ctx, t, result, method, args...) } - cd = getCallData(tx) + ed = types.GetExecutionData(tx) case "eth_call", "eth_estimateGas": call, ok := args[0].(types.Call) if !ok { return next(ctx, t, result, method, args...) } - cd = getCallData(call) + ed = types.GetExecutionData(call) default: return next(ctx, t, result, method, args...) } - if cd != nil && (h.replace || cd.From == nil) { - cd.From = &h.address + if ed != nil && (h.replace || ed.From == nil) { + ed.From = &h.address } return next(ctx, t, result, method, args...) } diff --git a/rpc/hijack_chainid.go b/rpc/hijack_chainid.go index 3e067a3..92cf3f9 100644 --- a/rpc/hijack_chainid.go +++ b/rpc/hijack_chainid.go @@ -29,17 +29,17 @@ func (h *hijackChainID) Call() func(next transport.CallFunc) transport.CallFunc if !ok { return next(ctx, t, result, method, args...) } - td := getTransactionData(tx) - if td != nil && (h.replace || td.ChainID == nil) { + sd := types.GetSigningData(tx) + if sd != nil && (h.replace || sd.ChainID == nil) { if chainID.Load() == 0 { - id, err := (&MethodsCommon{Transport: t}).ChainID(ctx) + id, err := (&MethodsCommon{&ClientContext{Transport: t}}).ChainID(ctx) if err != nil { return &ErrHijackFailed{name: "chain ID", err: fmt.Errorf("failed to get chain ID: %w", err)} } chainID.Store(id) } id := chainID.Load() - td.ChainID = &id + sd.ChainID = &id } return next(ctx, t, result, method, args...) } diff --git a/rpc/hijack_gasfee.go b/rpc/hijack_gasfee.go index 9708970..2c29db2 100644 --- a/rpc/hijack_gasfee.go +++ b/rpc/hijack_gasfee.go @@ -34,9 +34,9 @@ func (h *hijackLegacyGasFee) Call() func(next transport.CallFunc) transport.Call tx = convertTXToLegacyPrice(tx) args[0] = tx } - lpd := getLegacyPriceData(tx) + lpd := types.GetLegacyFeeData(tx) if lpd != nil && (h.replace || lpd.GasPrice == nil) { - gasPrice, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + gasPrice, err := (&MethodsCommon{&ClientContext{Transport: t}}).GasPrice(ctx) if err != nil { return &ErrHijackFailed{name: "legacy gas price", err: fmt.Errorf("failed to get gas price: %w", err)} } @@ -95,16 +95,16 @@ func (h *hijackDynamicGasFee) Call() func(next transport.CallFunc) transport.Cal tx = convertTXToDynamicFee(tx) args[0] = tx } - dfd := getDynamicFeeData(tx) + dfd := types.GetDynamicFeeData(tx) // Set the dynamic fee fields if necessary. if dfd != nil && (h.replace || dfd.MaxFeePerGas == nil || dfd.MaxPriorityFeePerGas == nil) { // Fetch current gas prices from the RPC node. - maxFeePerGas, err := (&MethodsCommon{Transport: t}).GasPrice(ctx) + maxFeePerGas, err := (&MethodsCommon{&ClientContext{Transport: t}}).GasPrice(ctx) if err != nil { return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get gas price: %w", err)} } - priorityFeePerGas, err := (&MethodsCommon{Transport: t}).MaxPriorityFeePerGas(ctx) + priorityFeePerGas, err := (&MethodsCommon{&ClientContext{Transport: t}}).MaxPriorityFeePerGas(ctx) if err != nil { return &ErrHijackFailed{name: "dynamic gas fee", err: fmt.Errorf("failed to get priority fee per gas: %w", err)} } diff --git a/rpc/hijack_gaslimit.go b/rpc/hijack_gaslimit.go index fc58172..1d4a494 100644 --- a/rpc/hijack_gaslimit.go +++ b/rpc/hijack_gaslimit.go @@ -30,9 +30,9 @@ func (h *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc return next(ctx, t, result, method, args...) } tc := tx.Call() - cd := getCallData(tx) - if tc != nil && cd != nil && (h.replace || cd.GasLimit == nil) { - gasLimit, err := (&MethodsCommon{Transport: t}).EstimateGas(ctx, tc, types.LatestBlockNumber) + ed := types.GetExecutionData(tx) + if tc != nil && ed != nil && (h.replace || ed.GasLimit == nil) { + gasLimit, err := (&MethodsCommon{&ClientContext{Transport: t}}).EstimateGas(ctx, tc, types.LatestBlockNumber) if err != nil { return &ErrHijackFailed{name: "gas limit", err: fmt.Errorf("failed to estimate gas: %w", err)} } @@ -43,7 +43,7 @@ func (h *hijackGasLimit) Call() func(next transport.CallFunc) transport.CallFunc if h.maxGas > 0 && gasLimit > h.maxGas { gasLimit = h.maxGas } - cd.GasLimit = &gasLimit + ed.GasLimit = &gasLimit } return next(ctx, t, result, method, args...) } diff --git a/rpc/hijack_nonce.go b/rpc/hijack_nonce.go index 93bd8fc..fd2d157 100644 --- a/rpc/hijack_nonce.go +++ b/rpc/hijack_nonce.go @@ -25,21 +25,21 @@ func (h *hijackNonce) Call() func(next transport.CallFunc) transport.CallFunc { if !ok { return next(ctx, t, result, method, args...) } - td := getTransactionData(tx) // to set the nonce - cd := getCallData(tx) // to get the "from" address - if td != nil && cd != nil && (h.replace || td.Nonce == nil) { - if cd.From == nil { + sd := types.GetSigningData(tx) // to set the nonce + ed := types.GetExecutionData(tx) // to get the "from" address + if sd != nil && ed != nil && (h.replace || sd.Nonce == nil) { + if ed.From == nil { return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("'from' field not set")} } block := types.LatestBlockNumber if h.usePendingBlock { block = types.PendingBlockNumber } - nonce, err := (&MethodsCommon{Transport: t}).GetTransactionCount(ctx, *cd.From, block) + nonce, err := (&MethodsCommon{&ClientContext{Transport: t}}).GetTransactionCount(ctx, *ed.From, block) if err != nil { return &ErrHijackFailed{name: "nonce", err: fmt.Errorf("failed to get transaction count: %w", err)} } - td.Nonce = &nonce + sd.Nonce = &nonce } return next(ctx, t, result, method, args...) } diff --git a/rpc/hijack_sign.go b/rpc/hijack_sign.go index 93f83c8..4a6d311 100644 --- a/rpc/hijack_sign.go +++ b/rpc/hijack_sign.go @@ -45,7 +45,7 @@ func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { if !ok { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", result)} } - tx, ok := args[0].(types.Transaction) + tx, ok := args[0].(types.SignableTransaction) if !ok { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid transaction type: %T", args[0])} } @@ -55,7 +55,7 @@ func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { if !ok { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", args[0])} } - tx, ok := args[0].(types.Transaction) + tx, ok := args[0].(types.SignableTransaction) if !ok { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid transaction type: %T", args[0])} } @@ -100,16 +100,16 @@ func (k *hijackSign) hijackSignCall(ctx context.Context, result *types.Signature return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", account)} } -func (k *hijackSign) hijackSignTransactionCall(ctx context.Context, result *[]byte, tx types.Transaction) error { +func (k *hijackSign) hijackSignTransactionCall(ctx context.Context, result *[]byte, tx types.SignableTransaction) error { if len(k.keys) == 0 { return fmt.Errorf("no keys found") } - txcd := getCallData(tx) - if txcd.From == nil { + ed := types.GetExecutionData(tx) + if ed == nil || ed.From == nil { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("'from' field not set")} } for _, key := range k.keys { - if key.Address() != *txcd.From { + if key.Address() != *ed.From { continue } if err := key.SignTransaction(ctx, tx); err != nil { @@ -122,19 +122,19 @@ func (k *hijackSign) hijackSignTransactionCall(ctx context.Context, result *[]by *result = raw return nil } - return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *txcd.From)} + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *ed.From)} } -func (k *hijackSign) hijackSendTransactionCall(ctx context.Context, t transport.Transport, next transport.CallFunc, result *types.Hash, tx types.Transaction) error { +func (k *hijackSign) hijackSendTransactionCall(ctx context.Context, t transport.Transport, next transport.CallFunc, result *types.Hash, tx types.SignableTransaction) error { if len(k.keys) == 0 { return fmt.Errorf("no keys found") } - txcd := getCallData(tx) - if txcd.From == nil { + ed := types.GetExecutionData(tx) + if ed == nil || ed.From == nil { return &ErrHijackFailed{name: "sign", err: fmt.Errorf("'from' field not set")} } for _, key := range k.keys { - if key.Address() != *txcd.From { + if key.Address() != *ed.From { continue } if err := key.SignTransaction(ctx, tx); err != nil { @@ -146,5 +146,5 @@ func (k *hijackSign) hijackSendTransactionCall(ctx context.Context, t transport. } return next(ctx, t, result, "eth_sendRawTransaction", types.Bytes(raw)) } - return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *txcd.From)} + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("no key found for address %s", *ed.From)} } diff --git a/rpc/hijack_simulate.go b/rpc/hijack_simulate.go index bf4f117..f496d84 100644 --- a/rpc/hijack_simulate.go +++ b/rpc/hijack_simulate.go @@ -60,8 +60,8 @@ func (h *hijackSimulate) Unsubscribe() func(next transport.UnsubscribeFunc) tran } func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx types.Transaction) error { - // If the transaction has not a corrseponding call, we cannot simulate it. - // This can happen for custom transactions types. + // If the transaction does not have a corresponding call, we cannot simulate it. + // This can happen for custom transaction types. call := tx.Call() if call == nil { return nil @@ -70,19 +70,16 @@ func (h *hijackSimulate) simulate(ctx context.Context, t transport.Transport, tx // Recover the transaction sender if it is not present. // This can happen if the transaction is encoded using RLP, as this format // contains only the signature and not the sender address. - if td := tx.GetTransactionData(); td.Signature != nil && call.GetCallData().From == nil { - from, err := txsign.Recover(tx) + if stx, ok := tx.(types.SignableTransaction); ok && stx.GetSigningData().Signature != nil && call.GetExecutionData().From == nil { + from, err := txsign.Recover(stx) if err != nil { return fmt.Errorf("unable to recover transaction sender: %w", err) } - call.GetCallData().From = from - if cd := getCallData(tx); cd != nil { - cd.From = from - } + call.GetExecutionData().From = from } // Simulate the transaction. - if _, err := (&MethodsCommon{Transport: t}).Call(ctx, call, types.LatestBlockNumber); err != nil { + if _, err := (&MethodsCommon{&ClientContext{Transport: t}}).Call(ctx, call, types.LatestBlockNumber); err != nil { return err } return nil diff --git a/rpc/hijack_simulate_test.go b/rpc/hijack_simulate_test.go index 804f8c5..0e741b4 100644 --- a/rpc/hijack_simulate_test.go +++ b/rpc/hijack_simulate_test.go @@ -38,7 +38,7 @@ func TestHijackSimulate(t *testing.T) { }, request: []string{ `{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"from":"0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","value":"0xde0b6b3a7640000"},"latest"]}`, - `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId":"0x1","from":"0x9d8a62f656a8d1615c1294fd71e9cfb3e4855a4f","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","nonce":"0x9","value":"0xde0b6b3a7640000","v":"0x25","r":"0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276","s":"0x67cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"}]}`, + `{"jsonrpc":"2.0","id":2,"method":"eth_sendTransaction","params":[{"chainId":"0x1","to":"0x3535353535353535353535353535353535353535","gas":"0x5208","gasPrice":"0x4a817c800","nonce":"0x9","value":"0xde0b6b3a7640000","v":"0x25","r":"0x28ef61340bd939bc2195fe537567866003e1a15d3c71ff63e1590620aa636276","s":"0x67cbe9d8997f761aecb703304b3800ccf555c9f3dc64214b297fb1966a3b6d83"}]}`, }, response: []string{ `{"jsonrpc": "2.0","id": 1,"result": "0x01"}`, diff --git a/rpc/methods_client.go b/rpc/methods_client.go index 774e40a..f3e7145 100644 --- a/rpc/methods_client.go +++ b/rpc/methods_client.go @@ -3,7 +3,6 @@ package rpc import ( "context" - "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) @@ -12,7 +11,7 @@ import ( // // Note: Some JSON-RPC APIs do not support these methods. type MethodsClient struct { - Transport transport.Transport + Context *ClientContext } // ClientVersion performs web3_clientVersion RPC call. @@ -20,7 +19,7 @@ type MethodsClient struct { // It returns the current client version. func (c *MethodsClient) ClientVersion(ctx context.Context) (string, error) { var res string - if err := c.Transport.Call(ctx, &res, "web3_clientVersion"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "web3_clientVersion"); err != nil { return "", err } return res, nil @@ -31,7 +30,7 @@ func (c *MethodsClient) ClientVersion(ctx context.Context) (string, error) { // It returns the current network ID. func (c *MethodsClient) NetworkID(ctx context.Context) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "net_version"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "net_version"); err != nil { return 0, err } return res.Big().Uint64(), nil @@ -42,7 +41,7 @@ func (c *MethodsClient) NetworkID(ctx context.Context) (uint64, error) { // It returns true if the client is actively listening for network. func (c *MethodsClient) Listening(ctx context.Context) (bool, error) { var res bool - if err := c.Transport.Call(ctx, &res, "net_listening"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "net_listening"); err != nil { return false, err } return res, nil @@ -53,7 +52,7 @@ func (c *MethodsClient) Listening(ctx context.Context) (bool, error) { // It returns the number of connected peers. func (c *MethodsClient) PeerCount(ctx context.Context) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "net_peerCount"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "net_peerCount"); err != nil { return 0, err } return res.Big().Uint64(), nil @@ -64,7 +63,7 @@ func (c *MethodsClient) PeerCount(ctx context.Context) (uint64, error) { // It returns an object with data about the sync status or false. func (c *MethodsClient) Syncing(ctx context.Context) (*types.SyncStatus, error) { var res types.SyncStatus - if err := c.Transport.Call(ctx, &res, "eth_syncing"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_syncing"); err != nil { return nil, err } return &res, nil diff --git a/rpc/methods_client_test.go b/rpc/methods_client_test.go index 49aebf6..8fcea38 100644 --- a/rpc/methods_client_test.go +++ b/rpc/methods_client_test.go @@ -30,7 +30,7 @@ const mockClientVersionResponse = ` func TestBaseClient_ClientVersion(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsClient{Transport: httpMock} + client := &MethodsClient{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockClientVersionRequest, readBody(req)) @@ -65,7 +65,7 @@ const mockNetworkIDResponse = ` func TestBaseClient_NetworkID(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsClient{Transport: httpMock} + client := &MethodsClient{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockNetworkIDRequest, readBody(req)) @@ -100,7 +100,7 @@ const mockListeningResponse = ` func TestBaseClient_Listening(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsClient{Transport: httpMock} + client := &MethodsClient{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockListeningRequest, readBody(req)) @@ -135,7 +135,7 @@ const mockPeerCountResponse = ` func TestBaseClient_PeerCount(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsClient{Transport: httpMock} + client := &MethodsClient{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockPeerCountRequest, readBody(req)) @@ -174,7 +174,7 @@ const mockSyncingResponse = ` func TestBaseClient_Syncing(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsClient{Transport: httpMock} + client := &MethodsClient{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSyncingRequest, readBody(req)) diff --git a/rpc/methods_common.go b/rpc/methods_common.go index cf3ca40..4f56db5 100644 --- a/rpc/methods_common.go +++ b/rpc/methods_common.go @@ -6,15 +6,13 @@ import ( "fmt" "math/big" - "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) // MethodsCommon is a collection of methods that are commonly supported by // Ethereum JSON-RPC APIs. type MethodsCommon struct { - Transport transport.Transport - Decoder types.TransactionDecoder + Context *ClientContext } // @@ -27,7 +25,7 @@ type MethodsCommon struct { // the Merkle-proof as defined in EIP-1186. func (c *MethodsCommon) GetProof(ctx context.Context, address types.Address, storageKeys []types.Hash, block types.BlockNumber) (*types.AccountProof, error) { var res types.AccountProof - if err := c.Transport.Call(ctx, &res, "eth_getProof", address, storageKeys, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getProof", address, storageKeys, block); err != nil { return nil, err } return &res, nil @@ -38,7 +36,7 @@ func (c *MethodsCommon) GetProof(ctx context.Context, address types.Address, sto // It returns the balance of the account of given address in wei. func (c *MethodsCommon) GetBalance(ctx context.Context, address types.Address, block types.BlockNumber) (*big.Int, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getBalance", address, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBalance", address, block); err != nil { return nil, err } return res.Big(), nil @@ -49,7 +47,7 @@ func (c *MethodsCommon) GetBalance(ctx context.Context, address types.Address, b // It returns the contract code at the given address. func (c *MethodsCommon) GetCode(ctx context.Context, account types.Address, block types.BlockNumber) ([]byte, error) { var res types.Bytes - if err := c.Transport.Call(ctx, &res, "eth_getCode", account, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getCode", account, block); err != nil { return nil, err } return res.Bytes(), nil @@ -61,7 +59,7 @@ func (c *MethodsCommon) GetCode(ctx context.Context, account types.Address, bloc // address. func (c *MethodsCommon) GetStorageAt(ctx context.Context, account types.Address, key types.Hash, block types.BlockNumber) (*types.Hash, error) { var res types.Hash - if err := c.Transport.Call(ctx, &res, "eth_getStorageAt", account, key, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getStorageAt", account, key, block); err != nil { return nil, err } return &res, nil @@ -72,7 +70,7 @@ func (c *MethodsCommon) GetStorageAt(ctx context.Context, account types.Address, // It returns the number of transactions sent from the given address. func (c *MethodsCommon) GetTransactionCount(ctx context.Context, account types.Address, block types.BlockNumber) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getTransactionCount", account, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getTransactionCount", account, block); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -90,7 +88,7 @@ func (c *MethodsCommon) GetTransactionCount(ctx context.Context, account types.A // It returns information about a block by hash. func (c *MethodsCommon) BlockByHash(ctx context.Context, hash types.Hash, full bool) (*types.Block, error) { var res types.Block - if err := c.Transport.Call(ctx, &res, "eth_getBlockByHash", hash, full); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBlockByHash", hash, full); err != nil { return nil, err } return &res, nil @@ -101,18 +99,19 @@ func (c *MethodsCommon) BlockByHash(ctx context.Context, hash types.Hash, full b // It returns the block with the given number. func (c *MethodsCommon) BlockByNumber(ctx context.Context, number types.BlockNumber, full bool) (*types.Block, error) { var res types.Block - if err := c.Transport.Call(ctx, &res, "eth_getBlockByNumber", number, full); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBlockByNumber", number, full); err != nil { return nil, err } return &res, nil } -// GetBlockTransactionCountByHash performs eth_getBlockTransactionCountByHash RPC call. +// GetBlockTransactionCountByHash performs +// eth_getBlockTransactionCountByHash RPC call. // // It returns the number of transactions in the block with the given hash. func (c *MethodsCommon) GetBlockTransactionCountByHash(ctx context.Context, hash types.Hash) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByHash", hash); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByHash", hash); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -121,10 +120,13 @@ func (c *MethodsCommon) GetBlockTransactionCountByHash(ctx context.Context, hash return res.Big().Uint64(), nil } -// GetBlockTransactionCountByNumber implements the RPC interface. +// GetBlockTransactionCountByNumber performs +// eth_getBlockTransactionCountByNumber RPC call. +// +// It returns the number of transactions in the block with the given number. func (c *MethodsCommon) GetBlockTransactionCountByNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByNumber", number); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBlockTransactionCountByNumber", number); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -133,23 +135,25 @@ func (c *MethodsCommon) GetBlockTransactionCountByNumber(ctx context.Context, nu return res.Big().Uint64(), nil } -// GetUncleByBlockHashAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. +// GetUncleByBlockHashAndIndex performs +// eth_getUncleByBlockHashAndIndex RPC call. // -// It returns information about an uncle of a block by number and uncle index position. +// It returns information about an uncle identified by block hash and index. func (c *MethodsCommon) GetUncleByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.Block, error) { var res types.Block - if err := c.Transport.Call(ctx, &res, "eth_getUncleByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getUncleByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { return nil, err } return &res, nil } -// GetUncleByBlockNumberAndIndex performs eth_getUncleByBlockNumberAndIndex RPC call. +// GetUncleByBlockNumberAndIndex performs +// eth_getUncleByBlockNumberAndIndex RPC call. // -// It returns information about an uncle of a block by hash and uncle index position. +// It returns information about an uncle identified by block number and index. func (c *MethodsCommon) GetUncleByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.Block, error) { var res types.Block - if err := c.Transport.Call(ctx, &res, "eth_getUncleByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getUncleByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { return nil, err } return &res, nil @@ -160,7 +164,7 @@ func (c *MethodsCommon) GetUncleByBlockNumberAndIndex(ctx context.Context, numbe // It returns the number of uncles in the block with the given hash. func (c *MethodsCommon) GetUncleCountByBlockHash(ctx context.Context, hash types.Hash) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getUncleCountByBlockHash", hash); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getUncleCountByBlockHash", hash); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -174,7 +178,7 @@ func (c *MethodsCommon) GetUncleCountByBlockHash(ctx context.Context, hash types // It returns the number of uncles in the block with the given block number. func (c *MethodsCommon) GetUncleCountByBlockNumber(ctx context.Context, number types.BlockNumber) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_getUncleCountByBlockNumber", number); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getUncleCountByBlockNumber", number); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -190,7 +194,7 @@ func (c *MethodsCommon) GetUncleCountByBlockNumber(ctx context.Context, number t // // Subscription channel will be closed when the context is canceled. func (c *MethodsCommon) SubscribeNewHeads(ctx context.Context) (<-chan types.Block, error) { - return subscribe[types.Block](ctx, c.Transport, "newHeads") + return subscribe[types.Block](ctx, c.Context.Transport, "newHeads") } // @@ -212,7 +216,7 @@ func (c *MethodsCommon) Call(ctx context.Context, call types.Call, block types.B call = tx.Call() } var res types.Bytes - if err := c.Transport.Call(ctx, &res, "eth_call", call, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_call", call, block); err != nil { return nil, err } return res, nil @@ -232,7 +236,7 @@ func (c *MethodsCommon) CreateAccessList(ctx context.Context, call types.Call, b call = tx.Call() } var res types.AccessListResult - if err := c.Transport.Call(ctx, &res, "eth_createAccessList", call, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_createAccessList", call, block); err != nil { return nil, err } return &res, nil @@ -252,7 +256,7 @@ func (c *MethodsCommon) EstimateGas(ctx context.Context, call types.Call, block call = tx.Call() } var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_estimateGas", call, block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_estimateGas", call, block); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -266,7 +270,7 @@ func (c *MethodsCommon) EstimateGas(ctx context.Context, call types.Call, block // It sends an encoded transaction to the network. func (c *MethodsCommon) SendRawTransaction(ctx context.Context, data []byte) (*types.Hash, error) { var res types.Hash - if err := c.Transport.Call(ctx, &res, "eth_sendRawTransaction", types.Bytes(data)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_sendRawTransaction", types.Bytes(data)); err != nil { return nil, err } return &res, nil @@ -274,32 +278,34 @@ func (c *MethodsCommon) SendRawTransaction(ctx context.Context, data []byte) (*t // GetTransactionByHash performs eth_getTransactionByHash RPC call. // -// It returns the information about a transaction requested by transaction. +// It returns information about the transaction with the given hash. func (c *MethodsCommon) GetTransactionByHash(ctx context.Context, hash types.Hash) (*types.TransactionOnChain, error) { - res := types.TransactionOnChain{Decoder: c.Decoder} - if err := c.Transport.Call(ctx, &res, "eth_getTransactionByHash", hash); err != nil { + res := types.TransactionOnChain{Decoder: c.Context.Decoder} + if err := c.Context.Transport.Call(ctx, &res, "eth_getTransactionByHash", hash); err != nil { return nil, err } return &res, nil } -// GetTransactionByBlockHashAndIndex performs eth_getTransactionByBlockHashAndIndex RPC call. +// GetTransactionByBlockHashAndIndex performs +// eth_getTransactionByBlockHashAndIndex RPC call. // -// It returns the information about a transaction requested by transaction. +// It returns the transaction at the given block hash and index. func (c *MethodsCommon) GetTransactionByBlockHashAndIndex(ctx context.Context, hash types.Hash, index uint64) (*types.TransactionOnChain, error) { - res := types.TransactionOnChain{Decoder: c.Decoder} - if err := c.Transport.Call(ctx, &res, "eth_getTransactionByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { + res := types.TransactionOnChain{Decoder: c.Context.Decoder} + if err := c.Context.Transport.Call(ctx, &res, "eth_getTransactionByBlockHashAndIndex", hash, types.NumberFromUint64(index)); err != nil { return nil, err } return &res, nil } -// GetTransactionByBlockNumberAndIndex performs eth_getTransactionByBlockNumberAndIndex RPC call. +// GetTransactionByBlockNumberAndIndex performs +// eth_getTransactionByBlockNumberAndIndex RPC call. // -// It returns the information about a transaction requested by transaction. +// It returns the transaction at the given block number and index. func (c *MethodsCommon) GetTransactionByBlockNumberAndIndex(ctx context.Context, number types.BlockNumber, index uint64) (*types.TransactionOnChain, error) { - res := types.TransactionOnChain{Decoder: c.Decoder} - if err := c.Transport.Call(ctx, &res, "eth_getTransactionByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { + res := types.TransactionOnChain{Decoder: c.Context.Decoder} + if err := c.Context.Transport.Call(ctx, &res, "eth_getTransactionByBlockNumberAndIndex", number, types.NumberFromUint64(index)); err != nil { return nil, err } return &res, nil @@ -310,7 +316,7 @@ func (c *MethodsCommon) GetTransactionByBlockNumberAndIndex(ctx context.Context, // It returns the receipt of a transaction by transaction hash. func (c *MethodsCommon) GetTransactionReceipt(ctx context.Context, hash types.Hash) (*types.TransactionReceipt, error) { var res types.TransactionReceipt - if err := c.Transport.Call(ctx, &res, "eth_getTransactionReceipt", hash); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getTransactionReceipt", hash); err != nil { return nil, err } return &res, nil @@ -321,7 +327,7 @@ func (c *MethodsCommon) GetTransactionReceipt(ctx context.Context, hash types.Ha // It returns all transaction receipts for a given block hash or number. func (c *MethodsCommon) GetBlockReceipts(ctx context.Context, block types.BlockNumber) ([]*types.TransactionReceipt, error) { var res []*types.TransactionReceipt - if err := c.Transport.Call(ctx, &res, "eth_getBlockReceipts", block); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getBlockReceipts", block); err != nil { return nil, err } return res, nil @@ -334,7 +340,7 @@ func (c *MethodsCommon) GetBlockReceipts(ctx context.Context, block types.BlockN // // Subscription channel will be closed when the context is canceled. func (c *MethodsCommon) SubscribeNewPendingTransactions(ctx context.Context) (<-chan types.Hash, error) { - return subscribe[types.Hash](ctx, c.Transport, "newPendingTransactions") + return subscribe[types.Hash](ctx, c.Context.Transport, "newPendingTransactions") } // @@ -346,7 +352,7 @@ func (c *MethodsCommon) SubscribeNewPendingTransactions(ctx context.Context) (<- // It returns logs that match the given query. func (c *MethodsCommon) GetLogs(ctx context.Context, query *types.FilterLogsQuery) ([]types.Log, error) { var res []types.Log - if err := c.Transport.Call(ctx, &res, "eth_getLogs", query); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getLogs", query); err != nil { return nil, err } return res, nil @@ -359,7 +365,7 @@ func (c *MethodsCommon) GetLogs(ctx context.Context, query *types.FilterLogsQuer // // Subscription channel will be closed when the context is canceled. func (c *MethodsCommon) SubscribeLogs(ctx context.Context, query *types.FilterLogsQuery) (<-chan types.Log, error) { - return subscribe[types.Log](ctx, c.Transport, "logs", query) + return subscribe[types.Log](ctx, c.Context.Transport, "logs", query) } // Network status methods: @@ -369,7 +375,7 @@ func (c *MethodsCommon) SubscribeLogs(ctx context.Context, query *types.FilterLo // It returns the current chain ID. func (c *MethodsCommon) ChainID(ctx context.Context) (uint64, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_chainId"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_chainId"); err != nil { return 0, err } if !res.Big().IsUint64() { @@ -381,12 +387,12 @@ func (c *MethodsCommon) ChainID(ctx context.Context) (uint64, error) { // BlockNumber performs eth_blockNumber RPC call. // // It returns the current block number. -func (c *MethodsCommon) BlockNumber(ctx context.Context) (*big.Int, error) { +func (c *MethodsCommon) BlockNumber(ctx context.Context) (*types.BlockNumber, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_blockNumber"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_blockNumber"); err != nil { return nil, err } - return res.Big(), nil + return types.BlockNumberFromBigIntPtr(res.Big()), nil } // GasPrice performs eth_gasPrice RPC call. @@ -394,7 +400,7 @@ func (c *MethodsCommon) BlockNumber(ctx context.Context) (*big.Int, error) { // It returns the current price per gas in wei. func (c *MethodsCommon) GasPrice(ctx context.Context) (*big.Int, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_gasPrice"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_gasPrice"); err != nil { return nil, err } return res.Big(), nil @@ -405,7 +411,7 @@ func (c *MethodsCommon) GasPrice(ctx context.Context) (*big.Int, error) { // It returns the estimated maximum priority fee per gas. func (c *MethodsCommon) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_maxPriorityFeePerGas"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_maxPriorityFeePerGas"); err != nil { return nil, err } return res.Big(), nil @@ -417,7 +423,7 @@ func (c *MethodsCommon) MaxPriorityFeePerGas(ctx context.Context) (*big.Int, err // fee estimation for EIP-1559 transactions. func (c *MethodsCommon) FeeHistory(ctx context.Context, blockCount uint64, newestBlock types.BlockNumber, rewardPercentiles []float64) (*types.FeeHistory, error) { var res types.FeeHistory - if err := c.Transport.Call(ctx, &res, "eth_feeHistory", types.NumberFromUint64(blockCount), newestBlock, rewardPercentiles); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_feeHistory", types.NumberFromUint64(blockCount), newestBlock, rewardPercentiles); err != nil { return nil, err } return &res, nil @@ -428,7 +434,7 @@ func (c *MethodsCommon) FeeHistory(ctx context.Context, blockCount uint64, newes // It returns the expected base fee for blobs in the next block. func (c *MethodsCommon) BlobBaseFee(ctx context.Context) (*big.Int, error) { var res types.Number - if err := c.Transport.Call(ctx, &res, "eth_blobBaseFee"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_blobBaseFee"); err != nil { return nil, err } return res.Big(), nil @@ -439,7 +445,7 @@ func (c *MethodsCommon) BlobBaseFee(ctx context.Context) (*big.Int, error) { // It returns the current Ethereum protocol version. func (c *MethodsCommon) ProtocolVersion(ctx context.Context) (string, error) { var res string - if err := c.Transport.Call(ctx, &res, "eth_protocolVersion"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_protocolVersion"); err != nil { return "", err } return res, nil @@ -450,7 +456,7 @@ func (c *MethodsCommon) ProtocolVersion(ctx context.Context) (string, error) { // It returns the client's coinbase address. func (c *MethodsCommon) Coinbase(ctx context.Context) (types.Address, error) { var res types.Address - if err := c.Transport.Call(ctx, &res, "eth_coinbase"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_coinbase"); err != nil { return types.ZeroAddress, err } return res, nil diff --git a/rpc/methods_common_test.go b/rpc/methods_common_test.go index 9721c7e..1b06aec 100644 --- a/rpc/methods_common_test.go +++ b/rpc/methods_common_test.go @@ -105,7 +105,7 @@ const mockGetBalanceResponse = ` func TestBaseClient_GetBalance(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetBalanceRequest, readBody(req)) @@ -147,7 +147,7 @@ const mockGetCodeResponse = ` func TestBaseClient_GetCode(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetCodeRequest, readBody(req)) @@ -190,7 +190,7 @@ const mockGetStorageAtResponse = ` func TestBaseClient_GetStorageAt(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetStorageAtRequest, readBody(req)) @@ -233,7 +233,7 @@ const mockGetTransactionCountResponse = ` func TestBaseClient_GetTransactionCount(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetTransactionCountRequest, readBody(req)) @@ -267,7 +267,7 @@ const mockBlockByHashRequest = ` func TestBaseClient_BlockByHash(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockBlockByHashRequest, readBody(req)) @@ -301,7 +301,7 @@ const mockBlockByNumberRequest = ` func TestBaseClient_BlockByNumber(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockBlockByNumberRequest, readBody(req)) @@ -371,7 +371,7 @@ const mockGetBlockTransactionCountByHashResponse = ` func TestBaseClient_GetBlockTransactionCountByHash(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetBlockTransactionCountByHashRequest, readBody(req)) @@ -411,7 +411,7 @@ const mockGetBlockTransactionCountByNumberResponse = ` func TestBaseClient_GetBlockTransactionCountByNumber(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetBlockTransactionCountByNumberRequest, readBody(req)) @@ -444,7 +444,7 @@ const mockGetUncleByBlockHashAndIndexRequest = ` func TestBaseClient_GetUncleByBlockHashAndIndex(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetUncleByBlockHashAndIndexRequest, readBody(req)) @@ -478,7 +478,7 @@ const mockGetUncleByBlockNumberAndIndexRequest = ` func TestBaseClient_GetUncleByBlockNumberAndIndex(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetUncleByBlockNumberAndIndexRequest, readBody(req)) @@ -519,7 +519,7 @@ const mockGetUncleCountByBlockHashResponse = ` func TestBaseClient_GetUncleCountByBlockHash(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetUncleCountByBlockHashRequest, readBody(req)) @@ -559,7 +559,7 @@ const mockGetUncleCountByBlockNumberResponse = ` func TestBaseClient_GetUncleCountByBlockNumber(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetUncleCountByBlockNumberRequest, readBody(req)) @@ -609,7 +609,7 @@ const mockCallResponse = ` func TestBaseClient_Call(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockCallRequest, readBody(req)) @@ -628,14 +628,14 @@ func TestBaseClient_Call(t *testing.T) { response, err := client.Call( context.Background(), &types.CallLegacy{ - CallData: types.CallData{ + ExecutionData: types.ExecutionData{ From: from, To: to, GasLimit: &gasLimit, Value: value, Input: input, }, - LegacyPriceData: types.LegacyPriceData{ + LegacyFeeData: types.LegacyFeeData{ GasPrice: gasPrice, }, }, @@ -675,7 +675,7 @@ const mockEstimateGasResponse = ` func TestBaseClient_EstimateGas(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockEstimateGasRequest, readBody(req)) @@ -689,14 +689,14 @@ func TestBaseClient_EstimateGas(t *testing.T) { gas, err := client.EstimateGas( context.Background(), &types.CallLegacy{ - CallData: types.CallData{ + ExecutionData: types.ExecutionData{ From: types.MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: types.MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), GasLimit: &gasLimit, Value: big.NewInt(10000000000), Input: hexutil.MustHexToBytes("0x3333333333333333333333333333333333333333333333333333333333333333333333333333333333"), }, - LegacyPriceData: types.LegacyPriceData{ + LegacyFeeData: types.LegacyFeeData{ GasPrice: big.NewInt(10000000000000), }, }, @@ -728,7 +728,7 @@ const mockSendRawTransactionResponse = ` func TestBaseClient_SendRawTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSendRawTransactionRequest, readBody(req)) @@ -760,7 +760,7 @@ const mockGetTransactionByHashRequest = ` func TestBaseClient_GetTransactionByHash(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetTransactionByHashRequest, readBody(req)) @@ -808,7 +808,7 @@ const mockGetTransactionByBlockHashAndIndexRequest = ` func TestBaseClient_GetTransactionByBlockHashAndIndex(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetTransactionByBlockHashAndIndexRequest, readBody(req)) @@ -845,7 +845,7 @@ const mockGetTransactionByBlockNumberAndIndexRequest = ` func TestBaseClient_GetTransactionByBlockNumberAndIndex(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetTransactionByBlockNumberAndIndexRequest, readBody(req)) @@ -918,7 +918,7 @@ const mockGetTransactionReceiptResponse = ` func TestBaseClient_GetTransactionReceipt(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetTransactionReceiptRequest, readBody(req)) @@ -1011,7 +1011,7 @@ const mockGetBlockReceiptsResponse = ` func TestBaseClient_GetBlockReceipts(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetBlockReceiptsRequest, readBody(req)) @@ -1097,7 +1097,7 @@ const mockGetLogsResponse = ` func TestBaseClient_GetLogs(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetLogsRequest, readBody(req)) @@ -1152,7 +1152,7 @@ const mockChanIDResponse = ` func TestBaseClient_ChainID(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockChanIDRequest, readBody(req)) @@ -1186,7 +1186,7 @@ const mockBlockNumberResponse = ` func TestBaseClient_BlockNumber(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockBlockNumberRequest, readBody(req)) @@ -1199,7 +1199,7 @@ func TestBaseClient_BlockNumber(t *testing.T) { blockNumber, err := client.BlockNumber(context.Background()) require.NoError(t, err) - assert.Equal(t, big.NewInt(1), blockNumber) + assert.Equal(t, big.NewInt(1), blockNumber.Big()) } const mockGasPriceRequest = ` @@ -1221,7 +1221,7 @@ const mockGasPriceResponse = ` func TestBaseClient_GasPrice(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGasPriceRequest, readBody(req)) @@ -1256,7 +1256,7 @@ const mockMaxPriorityFeePerGasResponse = ` func TestBaseClient_MaxPriorityFeePerGas(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockMaxPriorityFeePerGasRequest, readBody(req)) @@ -1291,7 +1291,7 @@ const mockBlobBaseFeeResponse = ` func TestBaseClient_BlobBaseFee(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockBlobBaseFeeRequest, readBody(req)) @@ -1311,7 +1311,7 @@ func TestBaseClient_SubscribeNewHeads(t *testing.T) { // TODO: Veirify streamMock := newStreamMock(t) - client := &MethodsCommon{Transport: streamMock} + client := &MethodsCommon{&ClientContext{Transport: streamMock}} ch := make(chan json.RawMessage) streamMock.SubscribeMocks = []subscribeMock{ @@ -1342,7 +1342,7 @@ func TestBaseClient_SubscribeNewPendingTransactions(t *testing.T) { // TODO: Veirify streamMock := newStreamMock(t) - client := &MethodsCommon{Transport: streamMock} + client := &MethodsCommon{&ClientContext{Transport: streamMock}} ch := make(chan json.RawMessage) streamMock.SubscribeMocks = []subscribeMock{ @@ -1373,7 +1373,7 @@ func TestBaseClient_SubscribeLogs(t *testing.T) { // TODO: Veirify streamMock := newStreamMock(t) - client := &MethodsCommon{Transport: streamMock} + client := &MethodsCommon{&ClientContext{Transport: streamMock}} ch := make(chan json.RawMessage) from := types.MustBlockNumberFromHex("0x1") @@ -1447,7 +1447,7 @@ const mockGetProofResponse = ` func TestBaseClient_GetProof(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetProofRequest, readBody(req)) @@ -1509,7 +1509,7 @@ const mockCreateAccessListResponse = ` func TestBaseClient_CreateAccessList(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockCreateAccessListRequest, readBody(req)) @@ -1524,7 +1524,7 @@ func TestBaseClient_CreateAccessList(t *testing.T) { result, err := client.CreateAccessList( context.Background(), &types.CallBasic{ - CallData: types.CallData{ + ExecutionData: types.ExecutionData{ From: from, To: to, }, @@ -1562,7 +1562,7 @@ const mockFeeHistoryResponse = ` func TestBaseClient_FeeHistory(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { // Unmarshal and compare to handle float serialization differences. @@ -1589,6 +1589,62 @@ func TestBaseClient_FeeHistory(t *testing.T) { assert.Equal(t, []float64{0.5}, feeHistory.GasUsedRatio) assert.Equal(t, 1, len(feeHistory.Reward)) assert.Equal(t, []*big.Int{big.NewInt(1), big.NewInt(2)}, feeHistory.Reward[0]) + assert.Empty(t, feeHistory.BaseFeePerBlobGas) + assert.Empty(t, feeHistory.BlobGasUsedRatio) +} + +const mockFeeHistoryWithBlobFeesRequest = ` + { + "jsonrpc": "2.0", + "id": 1, + "method": "eth_feeHistory", + "params": ["0x2", "latest", []] + } +` + +const mockFeeHistoryWithBlobFeesResponse = ` + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "oldestBlock": "0x1", + "baseFeePerGas": ["0x5", "0x6", "0x7"], + "gasUsedRatio": [0.1, 0.2], + "baseFeePerBlobGas": ["0x8", "0x9", "0xa"], + "blobGasUsedRatio": [0.3, 0.4] + } + } +` + +func TestBaseClient_FeeHistoryWithBlobFees(t *testing.T) { + httpMock := newHTTPMock() + client := &MethodsCommon{&ClientContext{Transport: httpMock}} + + httpMock.Handler = func(req *http.Request) (*http.Response, error) { + var got, want any + require.NoError(t, json.Unmarshal([]byte(readBody(req)), &got)) + require.NoError(t, json.Unmarshal([]byte(mockFeeHistoryWithBlobFeesRequest), &want)) + assert.Equal(t, want, got) + return &http.Response{ + StatusCode: 200, + Body: io.NopCloser(bytes.NewBufferString(mockFeeHistoryWithBlobFeesResponse)), + }, nil + } + + feeHistory, err := client.FeeHistory( + context.Background(), + 2, + types.LatestBlockNumber, + []float64{}, + ) + + require.NoError(t, err) + assert.Equal(t, uint64(1), feeHistory.OldestBlock) + assert.Equal(t, []*big.Int{big.NewInt(5), big.NewInt(6), big.NewInt(7)}, feeHistory.BaseFeePerGas) + assert.Equal(t, []float64{0.1, 0.2}, feeHistory.GasUsedRatio) + assert.Equal(t, []*big.Int{big.NewInt(8), big.NewInt(9), big.NewInt(10)}, feeHistory.BaseFeePerBlobGas) + assert.Equal(t, []float64{0.3, 0.4}, feeHistory.BlobGasUsedRatio) + assert.Empty(t, feeHistory.Reward) } const mockProtocolVersionRequest = ` @@ -1610,7 +1666,7 @@ const mockProtocolVersionResponse = ` func TestBaseClient_ProtocolVersion(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockProtocolVersionRequest, readBody(req)) @@ -1645,7 +1701,7 @@ const mockCoinbaseResponse = ` func TestBaseClient_Coinbase(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsCommon{Transport: httpMock} + client := &MethodsCommon{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockCoinbaseRequest, readBody(req)) diff --git a/rpc/methods_filter.go b/rpc/methods_filter.go index 2f525b9..2fe2e55 100644 --- a/rpc/methods_filter.go +++ b/rpc/methods_filter.go @@ -4,7 +4,6 @@ import ( "context" "math/big" - "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) @@ -12,13 +11,13 @@ import ( // // Note: Some JSON-RPC APIs do not support these methods. type MethodsFilter struct { - Transport transport.Transport + Context *ClientContext } // NewFilter implements the RPC interface. func (c *MethodsFilter) NewFilter(ctx context.Context, query *types.FilterLogsQuery) (*big.Int, error) { var res *types.Number - if err := c.Transport.Call(ctx, &res, "eth_newFilter", query); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_newFilter", query); err != nil { return nil, err } return res.Big(), nil @@ -27,7 +26,7 @@ func (c *MethodsFilter) NewFilter(ctx context.Context, query *types.FilterLogsQu // NewBlockFilter implements the RPC interface. func (c *MethodsFilter) NewBlockFilter(ctx context.Context) (*big.Int, error) { var res *types.Number - if err := c.Transport.Call(ctx, &res, "eth_newBlockFilter"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_newBlockFilter"); err != nil { return nil, err } return res.Big(), nil @@ -37,7 +36,7 @@ func (c *MethodsFilter) NewBlockFilter(ctx context.Context) (*big.Int, error) { // NewPendingTransactionFilter implements the RPC interface. func (c *MethodsFilter) NewPendingTransactionFilter(ctx context.Context) (*big.Int, error) { var res *types.Number - if err := c.Transport.Call(ctx, &res, "eth_newPendingTransactionFilter"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_newPendingTransactionFilter"); err != nil { return nil, err } return res.Big(), nil @@ -46,7 +45,7 @@ func (c *MethodsFilter) NewPendingTransactionFilter(ctx context.Context) (*big.I // UninstallFilter implements the RPC interface. func (c *MethodsFilter) UninstallFilter(ctx context.Context, id *big.Int) (bool, error) { var res bool - if err := c.Transport.Call(ctx, &res, "eth_uninstallFilter", types.NumberFromBigInt(id)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_uninstallFilter", types.NumberFromBigInt(id)); err != nil { return false, err } return res, nil @@ -55,7 +54,7 @@ func (c *MethodsFilter) UninstallFilter(ctx context.Context, id *big.Int) (bool, // GetFilterChanges implements the RPC interface. func (c *MethodsFilter) GetFilterChanges(ctx context.Context, id *big.Int) ([]types.Log, error) { var res []types.Log - if err := c.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { return nil, err } return res, nil @@ -64,7 +63,7 @@ func (c *MethodsFilter) GetFilterChanges(ctx context.Context, id *big.Int) ([]ty // GetFilterLogs implements the RPC interface. func (c *MethodsFilter) GetFilterLogs(ctx context.Context, id *big.Int) ([]types.Log, error) { var res []types.Log - if err := c.Transport.Call(ctx, &res, "eth_getFilterLogs", types.NumberFromBigInt(id)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getFilterLogs", types.NumberFromBigInt(id)); err != nil { return nil, err } return res, nil @@ -73,7 +72,7 @@ func (c *MethodsFilter) GetFilterLogs(ctx context.Context, id *big.Int) ([]types // GetBlockFilterChanges implements the RPC interface. func (c *MethodsFilter) GetBlockFilterChanges(ctx context.Context, id *big.Int) ([]types.Hash, error) { var res []types.Hash - if err := c.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_getFilterChanges", types.NumberFromBigInt(id)); err != nil { return nil, err } return res, nil diff --git a/rpc/methods_filter_test.go b/rpc/methods_filter_test.go index 1055bf3..e3d8d83 100644 --- a/rpc/methods_filter_test.go +++ b/rpc/methods_filter_test.go @@ -40,7 +40,7 @@ const mockNewFilterResponse = ` func TestBaseClient_NewFilter(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockNewFilterRequest, readBody(req)) @@ -84,7 +84,7 @@ const mockNewBlockFilterResponse = ` func TestBaseClient_NewBlockFilter(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockNewBlockFilterRequest, readBody(req)) @@ -119,7 +119,7 @@ const mockNewPendingTransactionFilterResponse = ` func TestBaseClient_NewPendingTransactionFilter(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockNewPendingTransactionFilterRequest, readBody(req)) @@ -154,7 +154,7 @@ const mockUninstallFilterResponse = ` func TestBaseClient_UninstallFilter(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockUninstallFilterRequest, readBody(req)) @@ -203,7 +203,7 @@ const mockGetFilterChangesResponse = ` func TestBaseClient_GetFilterChanges(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetFilterChangesRequest, readBody(req)) @@ -254,7 +254,7 @@ const mockGetFilterLogsResponse = ` func TestBaseClient_GetFilterLogs(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetFilterLogsRequest, readBody(req)) @@ -295,7 +295,7 @@ const mockGetBlockFilterChangesResponse = ` func TestBaseClient_GetBlockFilterChanges(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsFilter{Transport: httpMock} + client := &MethodsFilter{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockGetBlockFilterChangesRequest, readBody(req)) diff --git a/rpc/methods_privatetransactions.go b/rpc/methods_privatetransactions.go index 4905b65..ed5f620 100644 --- a/rpc/methods_privatetransactions.go +++ b/rpc/methods_privatetransactions.go @@ -3,18 +3,18 @@ package rpc import ( "context" - "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) -// MethodsPrivateTransaction implements unofficial RPC methods for private transactions. +// MethodsPrivateTransaction provides unofficial RPC methods for private +// transactions. type MethodsPrivateTransaction struct { - Transport transport.Transport + Context *ClientContext } func (c *MethodsPrivateTransaction) CancelPrivateTransaction(ctx context.Context, hash types.Hash) (bool, error) { var res bool - if err := c.Transport.Call(ctx, &res, "eth_cancelPrivateTransaction", hash); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_cancelPrivateTransaction", hash); err != nil { return false, err } return res, nil @@ -22,7 +22,7 @@ func (c *MethodsPrivateTransaction) CancelPrivateTransaction(ctx context.Context func (c *MethodsPrivateTransaction) SendPrivateTransaction(ctx context.Context, data []byte) (*types.Hash, error) { var res types.Hash - if err := c.Transport.Call(ctx, &res, "eth_sendPrivateTransaction", types.Bytes(data)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_sendPrivateTransaction", types.Bytes(data)); err != nil { return nil, err } return &res, nil diff --git a/rpc/methods_privatetransactions_test.go b/rpc/methods_privatetransactions_test.go index b125e7c..437b43a 100644 --- a/rpc/methods_privatetransactions_test.go +++ b/rpc/methods_privatetransactions_test.go @@ -35,7 +35,7 @@ const mockCancelPrivateTransactionResponse = ` func TestBaseClient_CancelPrivateTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsPrivateTransaction{Transport: httpMock} + client := &MethodsPrivateTransaction{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockCancelPrivateTransactionRequest, readBody(req)) @@ -75,7 +75,7 @@ const mockSendPrivateTransactionResponse = ` func TestBaseClient_SendPrivateTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsPrivateTransaction{Transport: httpMock} + client := &MethodsPrivateTransaction{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSendPrivateTransactionRequest, readBody(req)) diff --git a/rpc/methods_wallet.go b/rpc/methods_wallet.go index 859e0d8..f925e98 100644 --- a/rpc/methods_wallet.go +++ b/rpc/methods_wallet.go @@ -4,7 +4,6 @@ import ( "context" "errors" - "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" ) @@ -13,7 +12,7 @@ import ( // // Note: Public JSON-RPC APIs do not support these methods. type MethodsWallet struct { - Transport transport.Transport + Context *ClientContext } // Accounts performs eth_accounts RPC call. @@ -21,7 +20,7 @@ type MethodsWallet struct { // It returns the list of addresses owned by the client. func (c *MethodsWallet) Accounts(ctx context.Context) ([]types.Address, error) { var res []types.Address - if err := c.Transport.Call(ctx, &res, "eth_accounts"); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_accounts"); err != nil { return nil, err } return res, nil @@ -32,7 +31,7 @@ func (c *MethodsWallet) Accounts(ctx context.Context) ([]types.Address, error) { // It signs the given data with the given address. func (c *MethodsWallet) Sign(ctx context.Context, account types.Address, data []byte) (*types.Signature, error) { var res types.Signature - if err := c.Transport.Call(ctx, &res, "eth_sign", account, types.Bytes(data)); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_sign", account, types.Bytes(data)); err != nil { return nil, err } return &res, nil @@ -46,7 +45,7 @@ func (c *MethodsWallet) SignTransaction(ctx context.Context, tx types.Transactio return nil, errors.New("rpc client: transaction is nil") } var res signTransactionResult - if err := c.Transport.Call(ctx, &res, "eth_signTransaction", tx); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_signTransaction", tx); err != nil { return nil, err } return res.Raw, nil @@ -60,7 +59,7 @@ func (c *MethodsWallet) SendTransaction(ctx context.Context, tx types.Transactio return nil, errors.New("rpc client: transaction is nil") } var res types.Hash - if err := c.Transport.Call(ctx, &res, "eth_sendTransaction", tx); err != nil { + if err := c.Context.Transport.Call(ctx, &res, "eth_sendTransaction", tx); err != nil { return nil, err } return &res, nil diff --git a/rpc/methods_wallet_test.go b/rpc/methods_wallet_test.go index bffe2ad..71d9576 100644 --- a/rpc/methods_wallet_test.go +++ b/rpc/methods_wallet_test.go @@ -36,7 +36,7 @@ const mockAccountsResponse = ` func TestBaseClient_Accounts(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsWallet{Transport: httpMock} + client := &MethodsWallet{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockAccountsRequest, readBody(req)) @@ -76,7 +76,7 @@ const mockSignResponse = ` func TestBaseClient_Sign(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsWallet{Transport: httpMock} + client := &MethodsWallet{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSignRequest, readBody(req)) @@ -128,7 +128,7 @@ const mockSignTransactionResponse = ` func TestBaseClient_SignTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsWallet{Transport: httpMock} + client := &MethodsWallet{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSignTransactionRequest, readBody(req)) @@ -179,7 +179,7 @@ const mockSendTransactionResponse = ` func TestBaseClient_SendTransaction(t *testing.T) { httpMock := newHTTPMock() - client := &MethodsWallet{Transport: httpMock} + client := &MethodsWallet{&ClientContext{Transport: httpMock}} httpMock.Handler = func(req *http.Request) (*http.Response, error) { assert.JSONEq(t, mockSendTransactionRequest, readBody(req)) diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index b5e1baa..4c78c75 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -69,7 +69,13 @@ func (i *IPC) readerRoutine() { if errors.Is(err, io.EOF) { return } - i.errCh <- err + if i.errCh != nil { + select { + case i.errCh <- err: + case <-i.ctx.Done(): + return + } + } } select { case i.readerCh <- res: diff --git a/rpc/util.go b/rpc/util.go index d719aef..57e7ab1 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -9,56 +9,14 @@ import ( "github.com/defiweb/go-eth/types" ) -// getTransactionData extracts the [types.TransactionData] from the given -// value. -func getTransactionData(v any) *types.TransactionData { - if td, ok := v.(types.HasTransactionData); ok { - return td.GetTransactionData() - } - return nil -} - -// getCallData extracts the [types.CallData] from the given value. -func getCallData(v any) *types.CallData { - if cd, ok := v.(types.HasCallData); ok { - return cd.GetCallData() - } - return nil -} - -// getLegacyPriceData extracts the [types.LegacyPriceData] from the given -// value. -func getLegacyPriceData(v any) *types.LegacyPriceData { - if lpc, ok := v.(types.HasLegacyPriceData); ok { - return lpc.GetLegacyPriceData() - } - return nil -} - -// getAccessListData extracts the [types.AccessListData] from the given value. -func getAccessListData(v any) *types.AccessListData { - if ald, ok := v.(types.HasAccessListData); ok { - return ald.GetAccessListData() - } - return nil -} - -// getDynamicFeeData extracts the [types.DynamicFeeData] from the given value. -func getDynamicFeeData(v any) *types.DynamicFeeData { - if dfd, ok := v.(types.HasDynamicFeeData); ok { - return dfd.GetDynamicFeeData() - } - return nil -} - // convertTXToLegacyPrice converts a transaction to one that has legacy // price data. func convertTXToLegacyPrice(tx types.Transaction) types.Transaction { - if getLegacyPriceData(tx) != nil { + if types.GetLegacyFeeData(tx) != nil { return tx } typ := types.LegacyTxType - if getAccessListData(tx) != nil { + if types.GetAccessListData(tx) != nil { typ = types.AccessListTxType } return convertTX(tx, typ) @@ -67,7 +25,7 @@ func convertTXToLegacyPrice(tx types.Transaction) types.Transaction { // convertTXToAccessList converts a transaction to one that has access list // data. func convertTXToDynamicFee(tx types.Transaction) types.Transaction { - if getDynamicFeeData(tx) != nil { + if types.GetDynamicFeeData(tx) != nil { return tx } return convertTX(tx, types.DynamicFeeTxType) @@ -81,22 +39,26 @@ func convertTX(tx types.Transaction, typ types.TransactionType) types.Transactio switch typ { case types.LegacyTxType: ltx := types.NewTransactionLegacy() - ltx.SetTransactionData(*tx.GetTransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - ltx.SetCallData(*tx.GetCallData()) + if tx, ok := tx.(types.HasSigningData); ok { + ltx.SetSigningData(*tx.GetSigningData()) } - if tx, ok := tx.(types.HasLegacyPriceData); ok { - ltx.SetLegacyPriceData(*tx.GetLegacyPriceData()) + if tx, ok := tx.(types.HasExecutionData); ok { + ltx.SetExecutionData(*tx.GetExecutionData()) + } + if tx, ok := tx.(types.HasLegacyFeeData); ok { + ltx.SetLegacyFeeData(*tx.GetLegacyFeeData()) } return ltx case types.AccessListTxType: altx := types.NewTransactionAccessList() - altx.SetTransactionData(*tx.GetTransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - altx.SetCallData(*tx.GetCallData()) + if tx, ok := tx.(types.HasSigningData); ok { + altx.SetSigningData(*tx.GetSigningData()) + } + if tx, ok := tx.(types.HasExecutionData); ok { + altx.SetExecutionData(*tx.GetExecutionData()) } - if tx, ok := tx.(types.HasLegacyPriceData); ok { - altx.SetLegacyPriceData(*tx.GetLegacyPriceData()) + if tx, ok := tx.(types.HasLegacyFeeData); ok { + altx.SetLegacyFeeData(*tx.GetLegacyFeeData()) } if tx, ok := tx.(types.HasAccessListData); ok { altx.SetAccessListData(*tx.GetAccessListData()) @@ -104,9 +66,11 @@ func convertTX(tx types.Transaction, typ types.TransactionType) types.Transactio return altx case types.DynamicFeeTxType: dftx := types.NewTransactionDynamicFee() - dftx.SetTransactionData(*tx.GetTransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - dftx.SetCallData(*tx.GetCallData()) + if tx, ok := tx.(types.HasSigningData); ok { + dftx.SetSigningData(*tx.GetSigningData()) + } + if tx, ok := tx.(types.HasExecutionData); ok { + dftx.SetExecutionData(*tx.GetExecutionData()) } if tx, ok := tx.(types.HasAccessListData); ok { dftx.SetAccessListData(*tx.GetAccessListData()) @@ -117,9 +81,11 @@ func convertTX(tx types.Transaction, typ types.TransactionType) types.Transactio return dftx case types.BlobTxType: btx := types.NewTransactionBlob() - btx.SetTransactionData(*tx.GetTransactionData()) - if tx, ok := tx.(types.HasCallData); ok { - btx.SetCallData(*tx.GetCallData()) + if tx, ok := tx.(types.HasSigningData); ok { + btx.SetSigningData(*tx.GetSigningData()) + } + if tx, ok := tx.(types.HasExecutionData); ok { + btx.SetExecutionData(*tx.GetExecutionData()) } if tx, ok := tx.(types.HasAccessListData); ok { btx.SetAccessListData(*tx.GetAccessListData()) @@ -165,7 +131,11 @@ func subscribe[T any](ctx context.Context, t transport.Transport, method string, if err := json.Unmarshal(raw, &msg); err != nil { continue } - msgCh <- msg + select { + case msgCh <- msg: + case <-ctx.Done(): + return + } } } }() diff --git a/types/call.go b/types/call.go index f3642bb..6dcae5b 100644 --- a/types/call.go +++ b/types/call.go @@ -7,7 +7,7 @@ type Call interface { json.Marshaler json.Unmarshaler - HasCallData + HasExecutionData } type jsonCall struct { diff --git a/types/call_accesslist.go b/types/call_accesslist.go index 0808680..4d3e77d 100644 --- a/types/call_accesslist.go +++ b/types/call_accesslist.go @@ -9,8 +9,8 @@ import "encoding/json" // list that specifies a list of addresses and storage keys the transaction // plans to access. type CallAccessList struct { - CallData - LegacyPriceData + ExecutionData + LegacyFeeData AccessListData } @@ -25,17 +25,17 @@ func (c *CallAccessList) Copy() *CallAccessList { return nil } return &CallAccessList{ - CallData: *c.CallData.Copy(), - LegacyPriceData: *c.LegacyPriceData.Copy(), - AccessListData: *c.AccessListData.Copy(), + ExecutionData: *c.ExecutionData.Copy(), + LegacyFeeData: *c.LegacyFeeData.Copy(), + AccessListData: *c.AccessListData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c *CallAccessList) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallData.toJSON(j) - c.LegacyPriceData.toJSON(j) + c.ExecutionData.toJSON(j) + c.LegacyFeeData.toJSON(j) c.AccessListData.toJSON(j) return json.Marshal(j) } @@ -46,8 +46,8 @@ func (c *CallAccessList) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, j); err != nil { return err } - c.CallData.fromJSON(j) - c.LegacyPriceData.fromJSON(j) + c.ExecutionData.fromJSON(j) + c.LegacyFeeData.fromJSON(j) c.AccessListData.fromJSON(j) return nil } diff --git a/types/call_accesslist_test.go b/types/call_accesslist_test.go index 850c23f..e6217be 100644 --- a/types/call_accesslist_test.go +++ b/types/call_accesslist_test.go @@ -22,14 +22,14 @@ func TestCallAccessList_JSON(t *testing.T) { { name: "all fields set", call: &CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, AccessListData: AccessListData{ diff --git a/types/call_basic.go b/types/call_basic.go index 57620b4..e0aea29 100644 --- a/types/call_basic.go +++ b/types/call_basic.go @@ -4,7 +4,7 @@ import "encoding/json" // CallBasic represents a simplest Ethereum call. type CallBasic struct { - CallData + ExecutionData } // NewCall creates a new [CallBasic] instance. @@ -18,14 +18,14 @@ func NewCall() *CallBasic { // Copy creates a deep copy of the CallBasic. func (c *CallBasic) Copy() *CallBasic { return &CallBasic{ - CallData: *c.CallData.Copy(), + ExecutionData: *c.ExecutionData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c CallBasic) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallData.toJSON(j) + c.ExecutionData.toJSON(j) return json.Marshal(j) } @@ -35,6 +35,6 @@ func (c *CallBasic) UnmarshalJSON(bytes []byte) error { if err := json.Unmarshal(bytes, &j); err != nil { return err } - c.CallData.fromJSON(j) + c.ExecutionData.fromJSON(j) return nil } diff --git a/types/call_blob.go b/types/call_blob.go index ebc01e8..8bb7c9d 100644 --- a/types/call_blob.go +++ b/types/call_blob.go @@ -9,7 +9,7 @@ import ( // Introduced by EIP-4844, this transaction type adds support for blob-carrying // transactions. type CallBlob struct { - CallData + ExecutionData AccessListData DynamicFeeData BlobData @@ -26,7 +26,7 @@ func (c *CallBlob) Copy() *CallBlob { return nil } return &CallBlob{ - CallData: *c.CallData.Copy(), + ExecutionData: *c.ExecutionData.Copy(), AccessListData: *c.AccessListData.Copy(), DynamicFeeData: *c.DynamicFeeData.Copy(), BlobData: *c.BlobData.Copy(), @@ -36,7 +36,7 @@ func (c *CallBlob) Copy() *CallBlob { // MarshalJSON implements the json.Marshaler interface. func (c *CallBlob) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallData.toJSON(j) + c.ExecutionData.toJSON(j) c.AccessListData.toJSON(j) c.DynamicFeeData.toJSON(j) c.BlobData.toJSON(j) @@ -49,7 +49,7 @@ func (c *CallBlob) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallData.fromJSON(j) + c.ExecutionData.fromJSON(j) c.AccessListData.fromJSON(j) c.DynamicFeeData.fromJSON(j) c.BlobData.fromJSON(j) diff --git a/types/call_blob_test.go b/types/call_blob_test.go index 923f8c2..a238835 100644 --- a/types/call_blob_test.go +++ b/types/call_blob_test.go @@ -24,7 +24,7 @@ func TestCallBlob_JSON(t *testing.T) { { name: "all fields set", call: &CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -79,7 +79,7 @@ func TestCallBlob_JSON(t *testing.T) { { name: "blobs with shortened zero fields", call: &CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), diff --git a/types/call_dynamicfee.go b/types/call_dynamicfee.go index f2620f7..ef7c955 100644 --- a/types/call_dynamicfee.go +++ b/types/call_dynamicfee.go @@ -8,7 +8,7 @@ import "encoding/json" // Introduced by EIP-1559, this transaction type supports a new fee market // mechanism with a base fee and a priority fee (tip). type CallDynamicFee struct { - CallData + ExecutionData DynamicFeeData AccessListData } @@ -24,16 +24,16 @@ func (c *CallDynamicFee) Copy() *CallDynamicFee { return nil } return &CallDynamicFee{ - CallData: *c.CallData.Copy(), + ExecutionData: *c.ExecutionData.Copy(), DynamicFeeData: *c.DynamicFeeData.Copy(), - AccessListData: *c.AccessListData.Copy(), + AccessListData: *c.AccessListData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c *CallDynamicFee) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallData.toJSON(j) + c.ExecutionData.toJSON(j) c.DynamicFeeData.toJSON(j) c.AccessListData.toJSON(j) return json.Marshal(j) @@ -45,7 +45,7 @@ func (c *CallDynamicFee) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallData.fromJSON(j) + c.ExecutionData.fromJSON(j) c.DynamicFeeData.fromJSON(j) c.AccessListData.fromJSON(j) return nil diff --git a/types/call_dynamicfee_test.go b/types/call_dynamicfee_test.go index 3e31b4d..b398362 100644 --- a/types/call_dynamicfee_test.go +++ b/types/call_dynamicfee_test.go @@ -22,7 +22,7 @@ func TestCallDynamicFee_JSON(t *testing.T) { { name: "all fields set", call: &CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), diff --git a/types/call_legacy.go b/types/call_legacy.go index ee3a2df..36a90a4 100644 --- a/types/call_legacy.go +++ b/types/call_legacy.go @@ -4,8 +4,8 @@ import "encoding/json" // CallLegacy represents a call corresponding to the legacy transaction type. type CallLegacy struct { - CallData - LegacyPriceData + ExecutionData + LegacyFeeData } // NewCallLegacy creates a new CallLegacy. @@ -19,16 +19,16 @@ func (c *CallLegacy) Copy() *CallLegacy { return nil } return &CallLegacy{ - CallData: *c.CallData.Copy(), - LegacyPriceData: *c.LegacyPriceData.Copy(), + ExecutionData: *c.ExecutionData.Copy(), + LegacyFeeData: *c.LegacyFeeData.Copy(), } } // MarshalJSON implements the json.Marshaler interface. func (c CallLegacy) MarshalJSON() ([]byte, error) { j := &jsonCall{} - c.CallData.toJSON(j) - c.LegacyPriceData.toJSON(j) + c.ExecutionData.toJSON(j) + c.LegacyFeeData.toJSON(j) return json.Marshal(j) } @@ -38,8 +38,8 @@ func (c *CallLegacy) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - c.CallData.fromJSON(j) - c.LegacyPriceData.fromJSON(j) + c.ExecutionData.fromJSON(j) + c.LegacyFeeData.fromJSON(j) return nil } diff --git a/types/call_legacy_test.go b/types/call_legacy_test.go index 0f6f09f..ea93b9b 100644 --- a/types/call_legacy_test.go +++ b/types/call_legacy_test.go @@ -22,14 +22,14 @@ func TestCallLegacy_JSON(t *testing.T) { { name: "all fields set", call: &CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, diff --git a/types/embed.go b/types/components.go similarity index 58% rename from types/embed.go rename to types/components.go index 568a17f..be0bd4c 100644 --- a/types/embed.go +++ b/types/components.go @@ -9,27 +9,27 @@ import ( // The following interfaces are used to determine if a given call or // transaction has specific capabilities. -// HasTransactionData specifes that the type has basic transaction -// data fields like chain ID, nonce, and signature. -type HasTransactionData interface { - GetTransactionData() *TransactionData - SetTransactionData(data TransactionData) +// HasSigningData specifies that a type has data required by +// signed transactions. +type HasSigningData interface { + GetSigningData() *SigningData + SetSigningData(data SigningData) } -// HasCallData specifies that the type has basic call data fields +// HasExecutionData specifies that the type has basic call execution data // like from, to, gas limit, value, and input. -type HasCallData interface { - GetCallData() *CallData - SetCallData(data CallData) +type HasExecutionData interface { + GetExecutionData() *ExecutionData + SetExecutionData(data ExecutionData) } -// HasLegacyPriceData specifies that the type uses legacy price data. -type HasLegacyPriceData interface { - GetLegacyPriceData() *LegacyPriceData - SetLegacyPriceData(data LegacyPriceData) +// HasLegacyFeeData specifies that the type uses legacy price data. +type HasLegacyFeeData interface { + GetLegacyFeeData() *LegacyFeeData + SetLegacyFeeData(data LegacyFeeData) } -// HasAccessListData specifies that the type uses access list for EIP-2930 +// HasAccessListData specifies that the type uses an access list for EIP-2930 // transactions. type HasAccessListData interface { GetAccessListData() *AccessListData @@ -50,53 +50,112 @@ type HasBlobData interface { SetBlobData(data BlobData) } +// GetSigningData is a helper function to get the [SigningData] from call +// or transaction types. +func GetSigningData(v any) *SigningData { + if s, ok := v.(HasSigningData); ok { + return s.GetSigningData() + } + return nil +} + +// GetExecutionData is a helper function to get the [ExecutionData] from call +// or transaction types. +func GetExecutionData(v any) *ExecutionData { + if s, ok := v.(HasExecutionData); ok { + return s.GetExecutionData() + } + return nil +} + +// GetLegacyFeeData is a helper function to get the [LegacyFeeData] from call +// or transaction types. +func GetLegacyFeeData(v any) *LegacyFeeData { + if s, ok := v.(HasLegacyFeeData); ok { + return s.GetLegacyFeeData() + } + return nil +} + +// GetAccessListData is a helper function to get the [AccessListData] from call +// or transaction types. +func GetAccessListData(v any) *AccessListData { + if s, ok := v.(HasAccessListData); ok { + return s.GetAccessListData() + } + return nil +} + +// GetDynamicFeeData is a helper function to get the [DynamicFeeData] from call +// or transaction types. +func GetDynamicFeeData(v any) *DynamicFeeData { + if s, ok := v.(HasDynamicFeeData); ok { + return s.GetDynamicFeeData() + } + return nil +} + +// GetBlobData is a helper function to get the [BlobData] from call +// or transaction types. +func GetBlobData(v any) *BlobData { + if s, ok := v.(HasBlobData); ok { + return s.GetBlobData() + } + return nil +} + // The following types are used to embed common fields and methods into call // and transaction types. You probably do not want to use them directly. -// TransactionData contains common fields for transactions. +// SigningData contains common fields for signed transactions. // -// This type is used to embed transaction data into other types. -type TransactionData struct { - ChainID *uint64 // ChainID is the chain ID. - Nonce *uint64 // Nonce is the transaction nonce. - Signature *Signature // Signature is the transaction signature. +// This type is used to embed signing data into other types. +type SigningData struct { + // ChainID is the chain ID. + ChainID *uint64 + + // Nonce is the transaction nonce. + Nonce *uint64 + + // Signature is the transaction signature. + Signature *Signature } -// GetTransactionData returns the embedded transaction data. -func (c *TransactionData) GetTransactionData() *TransactionData { +// GetSigningData returns the embedded signing data. +func (c *SigningData) GetSigningData() *SigningData { return c } -// SetTransactionData sets the embedded transaction data. -func (c *TransactionData) SetTransactionData(data TransactionData) { +// SetSigningData sets the embedded signing data. +func (c *SigningData) SetSigningData(data SigningData) { *c = data } // SetChainID sets the chain ID. -func (c *TransactionData) SetChainID(chainID uint64) { +func (c *SigningData) SetChainID(chainID uint64) { c.ChainID = &chainID } // SetNonce sets the transaction nonce. -func (c *TransactionData) SetNonce(nonce uint64) { +func (c *SigningData) SetNonce(nonce uint64) { c.Nonce = &nonce } // SetSignature sets the transaction signature. -func (c *TransactionData) SetSignature(signature Signature) { +func (c *SigningData) SetSignature(signature Signature) { c.Signature = &signature } -// Copy creates a deep copy of the TransactionFields. -func (c *TransactionData) Copy() *TransactionData { - return &TransactionData{ +// Copy creates a deep copy of the SigningData. +func (c *SigningData) Copy() *SigningData { + return &SigningData{ ChainID: copyPtr(c.ChainID), Nonce: copyPtr(c.Nonce), Signature: c.Signature.Copy(), } } -func (c *TransactionData) toJSON(j *jsonTransaction) { +func (c *SigningData) toJSON(j *jsonTransaction) { if c.ChainID != nil { j.ChainID = NumberFromUint64Ptr(*c.ChainID) } @@ -110,7 +169,7 @@ func (c *TransactionData) toJSON(j *jsonTransaction) { } } -func (c *TransactionData) fromJSON(j *jsonTransaction) { +func (c *SigningData) fromJSON(j *jsonTransaction) { if j.ChainID != nil { chainID := j.ChainID.Big().Uint64() c.ChainID = &chainID @@ -124,58 +183,73 @@ func (c *TransactionData) fromJSON(j *jsonTransaction) { } } -// CallData contains the basic fields for a call. +// ExecutionData contains the basic fields for a call. +// +// The From field is the sender address. It is used by the JSON-RPC client for +// key selection (eth_sendTransaction), as an explicit execution context +// (eth_call, eth_estimateGas). For signed transactions, the authoritative +// sender is recovered from the signature via txsign.Recover. // // This type is used to embed call data into other types. -type CallData struct { - From *Address // From is the sender address. - To *Address // To is the recipient address. Nil means contract creation. - GasLimit *uint64 // GasLimit is the gas limit; if 0, there is no limit. - Value *big.Int // Value is the amount of wei to send. - Input []byte // Input is the input data. +type ExecutionData struct { + // From is the sender address. Not part of the Ethereum wire protocol; + // used for key selection and as an execution context by the RPC client. + From *Address + + // To is the recipient address. Nil means contract creation. + To *Address + + // GasLimit is the gas limit. Nil means not specified. + GasLimit *uint64 + + // Value is the amount of wei to send. + Value *big.Int + + // Input is the call input data. + Input []byte } -// GetCallData returns the embedded call data. -func (c *CallData) GetCallData() *CallData { +// GetExecutionData returns the embedded execution data. +func (c *ExecutionData) GetExecutionData() *ExecutionData { return c } -// SetCallData sets the embedded call data. -func (c *CallData) SetCallData(data CallData) { +// SetExecutionData sets the embedded execution data. +func (c *ExecutionData) SetExecutionData(data ExecutionData) { *c = data } // SetFrom sets the sender address. -func (c *CallData) SetFrom(from Address) { +func (c *ExecutionData) SetFrom(from Address) { c.From = &from } // SetTo sets the recipient address. -func (c *CallData) SetTo(to Address) { +func (c *ExecutionData) SetTo(to Address) { c.To = &to } // SetGasLimit sets the gas limit. -func (c *CallData) SetGasLimit(gasLimit uint64) { +func (c *ExecutionData) SetGasLimit(gasLimit uint64) { c.GasLimit = &gasLimit } // SetValue sets the amount of wei to send. -func (c *CallData) SetValue(value *big.Int) { +func (c *ExecutionData) SetValue(value *big.Int) { c.Value = value } // SetInput sets the input data. -func (c *CallData) SetInput(input []byte) { +func (c *ExecutionData) SetInput(input []byte) { c.Input = input } -// Copy creates a deep copy of the CallFields. -func (c *CallData) Copy() *CallData { +// Copy creates a deep copy of the ExecutionData. +func (c *ExecutionData) Copy() *ExecutionData { if c == nil { return nil } - return &CallData{ + return &ExecutionData{ From: copyPtr(c.From), To: copyPtr(c.To), GasLimit: copyPtr(c.GasLimit), @@ -184,7 +258,7 @@ func (c *CallData) Copy() *CallData { } } -func (c *CallData) toJSON(j *jsonCall) { +func (c *ExecutionData) toJSON(j *jsonCall) { j.From = c.From j.To = c.To if c.GasLimit != nil { @@ -196,7 +270,7 @@ func (c *CallData) toJSON(j *jsonCall) { j.Input = c.Input } -func (c *CallData) fromJSON(j *jsonCall) { +func (c *ExecutionData) fromJSON(j *jsonCall) { c.From = j.From c.To = j.To if j.GasLimit != nil { @@ -209,45 +283,46 @@ func (c *CallData) fromJSON(j *jsonCall) { c.Input = j.Input } -// LegacyPriceData contains the gas price for legacy transactions. +// LegacyFeeData contains the gas price for legacy transactions. // -// This type is used to embed legacy price data into other types. -type LegacyPriceData struct { - GasPrice *big.Int // GasPrice is the gas price. +// This type is used to embed legacy fee data into other types. +type LegacyFeeData struct { + // GasPrice is the gas price. + GasPrice *big.Int } -// LegacyPriceData returns the embedded legacy price data. -func (c *LegacyPriceData) GetLegacyPriceData() *LegacyPriceData { +// GetLegacyFeeData returns the embedded legacy fee data. +func (c *LegacyFeeData) GetLegacyFeeData() *LegacyFeeData { return c } -// SetLegacyPriceData sets the embedded legacy price data. -func (c *LegacyPriceData) SetLegacyPriceData(data LegacyPriceData) { +// SetLegacyFeeData sets the embedded legacy fee data. +func (c *LegacyFeeData) SetLegacyFeeData(data LegacyFeeData) { *c = data } // SetGasPrice sets the gas price. -func (c *LegacyPriceData) SetGasPrice(gasPrice *big.Int) { +func (c *LegacyFeeData) SetGasPrice(gasPrice *big.Int) { c.GasPrice = gasPrice } -// Copy creates a deep copy of the LegacyPriceField. -func (c *LegacyPriceData) Copy() *LegacyPriceData { +// Copy creates a deep copy of the LegacyFeeData. +func (c *LegacyFeeData) Copy() *LegacyFeeData { if c == nil { return nil } - return &LegacyPriceData{ + return &LegacyFeeData{ GasPrice: copyBigInt(c.GasPrice), } } -func (c *LegacyPriceData) toJSON(j *jsonCall) { +func (c *LegacyFeeData) toJSON(j *jsonCall) { if c.GasPrice != nil { j.GasPrice = NumberFromBigIntPtr(c.GasPrice) } } -func (c *LegacyPriceData) fromJSON(j *jsonCall) { +func (c *LegacyFeeData) fromJSON(j *jsonCall) { if j.GasPrice != nil { c.GasPrice = j.GasPrice.Big() } @@ -257,7 +332,8 @@ func (c *LegacyPriceData) fromJSON(j *jsonCall) { // // This type is used to embed access list data into other types. type AccessListData struct { - AccessList AccessList // AccessList is the EIP-2930 access list. + // AccessList is the EIP-2930 access list. + AccessList AccessList } // GetAccessListData returns the embedded access list data. @@ -275,7 +351,7 @@ func (c *AccessListData) SetAccessList(accessList AccessList) { c.AccessList = accessList } -// Copy creates a deep copy of the AccessListField. +// Copy creates a deep copy of the AccessListData. func (c *AccessListData) Copy() *AccessListData { if c == nil { return nil @@ -297,8 +373,11 @@ func (c *AccessListData) fromJSON(j *jsonCall) { // // This type is used to embed dynamic fee data into other types. type DynamicFeeData struct { - MaxFeePerGas *big.Int // MaxFeePerGas is the maximum total fee per gas. - MaxPriorityFeePerGas *big.Int // MaxPriorityFeePerGas is the maximum priority fee per gas. + // MaxFeePerGas is the maximum total fee per gas. + MaxFeePerGas *big.Int + + // MaxPriorityFeePerGas is the maximum priority fee per gas. + MaxPriorityFeePerGas *big.Int } // GetDynamicFeeData returns the embedded dynamic fee data. @@ -321,7 +400,7 @@ func (c *DynamicFeeData) SetMaxPriorityFeePerGas(maxPriorityFeePerGas *big.Int) c.MaxPriorityFeePerGas = maxPriorityFeePerGas } -// Copy creates a deep copy of the DynamicFeeFields. +// Copy creates a deep copy of the DynamicFeeData. func (c *DynamicFeeData) Copy() *DynamicFeeData { if c == nil { return nil @@ -356,8 +435,11 @@ func (c *DynamicFeeData) fromJSON(j *jsonCall) { // // This type is used to embed blob data into other types. type BlobData struct { - MaxFeePerBlobGas *big.Int // MaxFeePerBlobGas is the maximum fee per blob gas. - Blobs []BlobInfo // Blobs is the list of blobs. + // MaxFeePerBlobGas is the maximum fee per blob gas. + MaxFeePerBlobGas *big.Int + + // Blobs is the list of blobs. + Blobs []BlobInfo } // GetBlobData returns the embedded blob data. @@ -389,7 +471,7 @@ func (c *BlobData) AddBlob(blob BlobInfo) { c.Blobs = append(c.Blobs, blob) } -// Copy creates a deep copy of the BlobFields. +// Copy creates a deep copy of the BlobData. func (c *BlobData) Copy() *BlobData { if c == nil { return nil diff --git a/types/embed_test.go b/types/components_test.go similarity index 97% rename from types/embed_test.go rename to types/components_test.go index 53339bc..3129ff1 100644 --- a/types/embed_test.go +++ b/types/components_test.go @@ -14,19 +14,19 @@ import ( func TestTransactionData_JSON(t *testing.T) { tests := []struct { name string - data *TransactionData + data *SigningData want *jsonTransaction wantJSON string }{ { name: "all fields nil", - data: &TransactionData{}, + data: &SigningData{}, want: &jsonTransaction{}, wantJSON: `{}`, }, { name: "all fields set", - data: &TransactionData{ + data: &SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(2)), Signature: &Signature{ @@ -52,7 +52,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "nil signature", - data: &TransactionData{ + data: &SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(2)), Signature: nil, @@ -71,7 +71,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "max uint64 values", - data: &TransactionData{ + data: &SigningData{ ChainID: ptr(^uint64(0)), Nonce: ptr(^uint64(0)), }, @@ -86,7 +86,7 @@ func TestTransactionData_JSON(t *testing.T) { }, { name: "zero values", - data: &TransactionData{ + data: &SigningData{ ChainID: ptr(uint64(0)), Nonce: ptr(uint64(0)), Signature: &Signature{ @@ -128,7 +128,7 @@ func TestTransactionData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data TransactionData + var data SigningData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -149,19 +149,19 @@ func TestTransactionData_JSON(t *testing.T) { func TestCallData_JSON(t *testing.T) { tests := []struct { name string - data *CallData + data *ExecutionData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &CallData{}, + data: &ExecutionData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &CallData{ + data: &ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), GasLimit: ptr(uint64(21000)), @@ -185,7 +185,7 @@ func TestCallData_JSON(t *testing.T) { }, { name: "max values", - data: &CallData{ + data: &ExecutionData{ From: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), To: MustAddressFromHexPtr("0xffffffffffffffffffffffffffffffffffffffff"), GasLimit: ptr(^uint64(0)), @@ -209,7 +209,7 @@ func TestCallData_JSON(t *testing.T) { }, { name: "zero values", - data: &CallData{ + data: &ExecutionData{ From: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), To: MustAddressFromHexPtr("0x0000000000000000000000000000000000000000"), GasLimit: ptr(uint64(0)), @@ -248,7 +248,7 @@ func TestCallData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data CallData + var data ExecutionData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) @@ -264,19 +264,19 @@ func TestCallData_JSON(t *testing.T) { func TestLegacyPriceData_JSON(t *testing.T) { tests := []struct { name string - data *LegacyPriceData + data *LegacyFeeData want *jsonCall wantJSON string }{ { name: "all fields nil", - data: &LegacyPriceData{}, + data: &LegacyFeeData{}, want: &jsonCall{}, wantJSON: `{}`, }, { name: "all fields set", - data: &LegacyPriceData{ + data: &LegacyFeeData{ GasPrice: big.NewInt(2000000000), }, want: &jsonCall{ @@ -288,7 +288,7 @@ func TestLegacyPriceData_JSON(t *testing.T) { }, { name: "zero value", - data: &LegacyPriceData{ + data: &LegacyFeeData{ GasPrice: big.NewInt(0), }, want: &jsonCall{ @@ -312,7 +312,7 @@ func TestLegacyPriceData_JSON(t *testing.T) { assert.JSONEq(t, tt.wantJSON, string(jsonBytes)) // Test fromJSON - var data LegacyPriceData + var data LegacyFeeData err = json.Unmarshal(jsonBytes, &j) assert.NoError(t, err) data.fromJSON(&j) diff --git a/types/structs.go b/types/structs.go index b483016..e5f2b4b 100644 --- a/types/structs.go +++ b/types/structs.go @@ -133,16 +133,24 @@ func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { // // https://eips.ethereum.org/EIPS/eip-4844 type BlobInfo struct { - Hash Hash // Hash of the blob. - Sidecar *BlobSidecar // Optional sidecar containing blob components. + // Hash is the blob's versioned hash. + Hash Hash + + // Sidecar contains the blob components. Nil when the sidecar is not available. + Sidecar *BlobSidecar } // BlobSidecar contains the components of the blob stored by the consensus // layer. type BlobSidecar struct { - Blob kzg4844.Blob // The actual blob data. - Commitment kzg4844.Commitment // Commitment for the blob. - Proof kzg4844.Proof // Proof for the blob. + // Blob is the blob data. + Blob kzg4844.Blob + + // Commitment is the KZG commitment for the blob. + Commitment kzg4844.Commitment + + // Proof is the KZG proof for the blob. + Proof kzg4844.Proof } // ComputeHash computes the blob hash of the given blob sidecar. @@ -187,12 +195,24 @@ func NewBlobInfo(b *kzg4844.Blob) (BlobInfo, error) { // TransactionOnChain represents a transaction on the blockchain. type TransactionOnChain struct { - Decoder JSONTransactionDecoder // Decoder is an optional transaction decoder, if nil, the default decoder is used. - Transaction Transaction // Transaction is the transaction data. - Hash *Hash // Hash of the transaction. - BlockHash *Hash // BlockHash is the hash of the block where this transaction was in. - BlockNumber *big.Int // BlockNumber is the block number where this transaction was in. - TransactionIndex *uint64 // TransactionIndex is the index of the transaction in the block. + // Decoder is an optional transaction decoder. If nil, the default + // decoder is used. + Decoder JSONTransactionDecoder + + // Transaction is the decoded transaction data. + Transaction Transaction + + // Hash is the transaction hash. + Hash *Hash + + // BlockHash is the hash of the block containing this transaction. + BlockHash *Hash + + // BlockNumber is the number of the block containing this transaction. + BlockNumber *big.Int + + // TransactionIndex is the index of the transaction within the block. + TransactionIndex *uint64 } // MarshalJSON implements the json.Marshaler interface. @@ -248,20 +268,49 @@ type jsonOnChainTransaction struct { // TransactionReceipt represents transaction receipt. type TransactionReceipt struct { - TransactionHash Hash // TransactionHash is the hash of the transaction. - TransactionIndex uint64 // TransactionIndex is the index of the transaction in the block. - BlockHash Hash // BlockHash is the hash of the block. - BlockNumber *big.Int // BlockNumber is the number of the block. - From Address // From is the sender of the transaction. - To Address // To is the recipient of the transaction. - CumulativeGasUsed uint64 // CumulativeGasUsed is the total amount of gas used when this transaction was executed in the block. - EffectiveGasPrice *big.Int // EffectiveGasPrice is the effective gas price of the transaction. - GasUsed uint64 // GasUsed is the amount of gas used by this specific transaction alone. - ContractAddress *Address // ContractAddress is the contract address created, if the transaction was a contract creation, otherwise nil. - Logs []Log // Logs is the list of logs generated by the transaction. - LogsBloom []byte // LogsBloom is the bloom filter for the logs of the transaction. - Root *Hash // Root is the root of the state trie after the transaction. - Status *uint64 // Status is the status of the transaction. + // TransactionHash is the hash of the transaction. + TransactionHash Hash + + // TransactionIndex is the index of the transaction within the block. + TransactionIndex uint64 + + // BlockHash is the hash of the block containing the transaction. + BlockHash Hash + + // BlockNumber is the number of the block containing the transaction. + BlockNumber *big.Int + + // From is the sender of the transaction. + From Address + + // To is the recipient of the transaction. + To Address + + // CumulativeGasUsed is the total gas used in the block up to and including + // this transaction. + CumulativeGasUsed uint64 + + // EffectiveGasPrice is the actual gas price paid for this transaction. + EffectiveGasPrice *big.Int + + // GasUsed is the gas used by this transaction. + GasUsed uint64 + + // ContractAddress is the address of the created contract, or nil if the + // transaction was not a contract creation. + ContractAddress *Address + + // Logs is the list of logs generated by the transaction. + Logs []Log + + // LogsBloom is the bloom filter for the transaction's logs. + LogsBloom []byte + + // Root is the post-transaction state root (pre-Byzantium only). + Root *Hash + + // Status is 1 if the transaction succeeded, 0 if it reverted. + Status *uint64 } // MarshalJSON implements the json.Marshaler interface. @@ -333,27 +382,70 @@ type jsonTransactionReceipt struct { // Block represents a block on the blockchain. type Block struct { - Number *big.Int // Block is the block number. - Hash Hash // Hash is the hash of the block. - ParentHash Hash // ParentHash is the hash of the parent block. - StateRoot Hash // StateRoot is the root hash of the state trie. - ReceiptsRoot Hash // ReceiptsRoot is the root hash of the receipts trie. - TransactionsRoot Hash // TransactionsRoot is the root hash of the transactions trie. - MixHash Hash // MixHash is the hash of the seed used for the DAG. - Sha3Uncles Hash // Sha3Uncles is the SHA3 hash of the uncles data in the block. - Nonce *big.Int // Nonce is the block's nonce. - Miner Address // Miner is the address of the beneficiary to whom the mining rewards were given. - LogsBloom []byte // LogsBloom is the bloom filter for the logs of the block. - Difficulty *big.Int // Difficulty is the difficulty for this block. - TotalDifficulty *big.Int // TotalDifficulty is the total difficulty of the chain until this block. - Size uint64 // Size is the size of the block in bytes. - GasLimit uint64 // GasLimit is the maximum gas allowed in this block. - GasUsed uint64 // GasUsed is the total used gas by all transactions in this block. - Timestamp time.Time // Timestamp is the time at which the block was collated. - Uncles []Hash // Uncles is the list of uncle hashes. - Transactions []TransactionOnChain // Transactions is the list of transactions in the block. - TransactionHashes []Hash // TransactionHashes is the list of transaction hashes in the block. - ExtraData []byte // ExtraData is the "extra data" field of this block. + // Number is the block number. + Number *big.Int + + // Hash is the hash of the block. + Hash Hash + + // ParentHash is the hash of the parent block. + ParentHash Hash + + // StateRoot is the root hash of the state trie. + StateRoot Hash + + // ReceiptsRoot is the root hash of the receipts trie. + ReceiptsRoot Hash + + // TransactionsRoot is the root hash of the transactions trie. + TransactionsRoot Hash + + // MixHash is the hash mixed with the nonce to prove proof-of-work. + MixHash Hash + + // Sha3Uncles is the SHA3 hash of the uncle block headers. + Sha3Uncles Hash + + // Nonce is the proof-of-work nonce. + Nonce *big.Int + + // Miner is the address of the block's fee recipient. + Miner Address + + // LogsBloom is the bloom filter for the block's logs. + LogsBloom []byte + + // Difficulty is the proof-of-work difficulty for this block. + Difficulty *big.Int + + // TotalDifficulty is the cumulative chain difficulty up to this block. + TotalDifficulty *big.Int + + // Size is the size of the block in bytes. + Size uint64 + + // GasLimit is the maximum gas allowed in this block. + GasLimit uint64 + + // GasUsed is the total gas used by all transactions in this block. + GasUsed uint64 + + // Timestamp is the time at which the block was produced. + Timestamp time.Time + + // Uncles is the list of uncle block hashes. + Uncles []Hash + + // Transactions is the list of full transactions in the block. + // Populated when the block was requested with full transaction objects. + Transactions []TransactionOnChain + + // TransactionHashes is the list of transaction hashes in the block. + // Populated when the block was requested with transaction hashes only. + TransactionHashes []Hash + + // ExtraData is the arbitrary extra data field of this block. + ExtraData []byte } // MarshalJSON implements the json.Marshaler interface. @@ -466,12 +558,26 @@ func (b *jsonBlockTransactions) UnmarshalJSON(data []byte) error { // FeeHistory contains information about the fee structure and gas usage // over a range of blocks. type FeeHistory struct { - OldestBlock uint64 // OldestBlock is the oldest block number for which fees are returned. - Reward [][]*big.Int // Reward is the priority fee percentiles for each block. - BaseFeePerGas []*big.Int // BaseFeePerGas is the base fee per gas for each block (len = blockCount+1). - GasUsedRatio []float64 // GasUsedRatio is the gas used ratio for each block. - BaseFeePerBlobGas []*big.Int // BaseFeePerBlobGas is the base fee per blob gas for each block (EIP-4844, len = blockCount+1). - BlobGasUsedRatio []float64 // BlobGasUsedRatio is the blob gas used ratio for each block (EIP-4844). + // OldestBlock is the oldest block number in the returned range. + OldestBlock uint64 + + // Reward contains the requested priority fee percentiles for each block. + Reward [][]*big.Int + + // BaseFeePerGas is the base fee per gas for each block. The array has + // blockCount+1 entries; the last entry is the next block's predicted fee. + BaseFeePerGas []*big.Int + + // GasUsedRatio is the ratio of gas used to gas limit for each block. + GasUsedRatio []float64 + + // BaseFeePerBlobGas is the base fee per blob gas for each block (EIP-4844). + // The array has blockCount+1 entries. + BaseFeePerBlobGas []*big.Int + + // BlobGasUsedRatio is the ratio of blob gas used to the blob gas limit + // for each block (EIP-4844). + BlobGasUsedRatio []float64 } // MarshalJSON implements the json.Marshaler interface. @@ -544,9 +650,17 @@ type jsonFeeHistory struct { // AccessListResult represents the result of an eth_createAccessList call. type AccessListResult struct { - AccessList AccessList // AccessList is the list of addresses and storage keys accessed by the transaction. - GasUsed uint64 // GasUsed is the gas used by the transaction with the given access list. - Error string // Error is an optional error message if the transaction would revert. + // AccessList is the list of addresses and storage keys accessed by + // the transaction. + AccessList AccessList + + // GasUsed is the gas used by the transaction with the given access list. + GasUsed uint64 + + // Error is a revert message if the transaction would revert. + // Empty when the transaction succeeds. + + Error string } // MarshalJSON implements the json.Marshaler interface. @@ -576,11 +690,18 @@ type jsonAccessListResult struct { Error string `json:"error,omitempty"` } -// StorageProof represents a single storage proof entry returned by eth_getProof. +// StorageProof represents a single storage proof entry returned by +// eth_getProof. type StorageProof struct { - Key Hash // Key is the storage key. - Value *big.Int // Value is the storage value. - Proof []Bytes // Proof is the array of RLP-serialized MerkleTree-Nodes for this storage key. + // Key is the storage slot key. + Key Hash + + // Value is the storage slot value. + Value *big.Int + + // Proof is the array of RLP-serialized Merkle-Patricia trie nodes + // proving the storage slot value. + Proof []Bytes } // MarshalJSON implements the json.Marshaler interface. @@ -610,17 +731,32 @@ type jsonStorageProof struct { Proof []Bytes `json:"proof"` } -// AccountProof represents the result of an eth_getProof call as defined in EIP-1186. +// AccountProof represents the result of an eth_getProof call as defined in +// EIP-1186. // // https://eips.ethereum.org/EIPS/eip-1186 type AccountProof struct { - Address Address // Address is the account address. - AccountProof []Bytes // AccountProof is the array of RLP-serialized MerkleTree-Nodes from the stateRoot to the account leaf. - Balance *big.Int // Balance is the account balance. - CodeHash Hash // CodeHash is the hash of the account code, or the empty code hash. - Nonce uint64 // Nonce is the account nonce. - StorageHash Hash // StorageHash is the SHA3 of the StorageTrie root, or the empty storage hash. - StorageProof []StorageProof // StorageProof is the array of storage proofs for requested storage keys. + // Address is the account address. + Address Address + + // AccountProof is the array of RLP-serialized Merkle-Patricia trie nodes + // from the state root to the account leaf. + AccountProof []Bytes + + // Balance is the account balance in wei. + Balance *big.Int + + // CodeHash is the Keccak-256 hash of the account's code. + CodeHash Hash + + // Nonce is the account nonce. + Nonce uint64 + + // StorageHash is the Keccak-256 hash of the account's storage trie root. + StorageHash Hash + + // StorageProof contains the proofs for each requested storage key. + StorageProof []StorageProof } // MarshalJSON implements the json.Marshaler interface. @@ -664,15 +800,37 @@ type jsonAccountProof struct { // Log represents a contract log event. type Log struct { - Address Address // Address of the contract that generated the event - Topics []Hash // Topics provide information about the event type. - Data []byte // Data contains the non-indexed arguments of the event. - BlockHash *Hash // BlockHash is the hash of the block where this log was in. Nil when pending. - BlockNumber *big.Int // BlockNumber is the block number where this log was in. Nil when pending. - TransactionHash *Hash // TransactionHash is the hash of the transaction that generated this log. Nil when pending. - TransactionIndex *uint64 // TransactionIndex is the index of the transaction in the block. Nil when pending. - LogIndex *uint64 // LogIndex is the index of the log in the block. Nil when pending. - Removed bool // Removed is true if the log was reverted due to a chain reorganization. False if unknown. + // Address is the address of the contract that emitted the event. + Address Address + + // Topics are the indexed event parameters. + Topics []Hash + + // Data contains the non-indexed event parameters. + Data []byte + + // BlockHash is the hash of the block containing this log. + // Nil when the log is pending. + BlockHash *Hash + + // BlockNumber is the number of the block containing this log. + // Nil when the log is pending. + BlockNumber *big.Int + + // TransactionHash is the hash of the transaction that emitted this log. + // Nil when the log is pending. + TransactionHash *Hash + + // TransactionIndex is the index of the transaction within the block. + // Nil when the log is pending. + TransactionIndex *uint64 + + // LogIndex is the index of the log within the block. + // Nil when the log is pending. + LogIndex *uint64 + + // Removed is true if this log was reverted by a chain reorganisation. + Removed bool } // MarshalJSON implements the json.Marshaler interface. diff --git a/types/structs_test.go b/types/structs_test.go index b93d9fe..614145a 100644 --- a/types/structs_test.go +++ b/types/structs_test.go @@ -34,18 +34,18 @@ func TestTransactionOnChain_JSON(t *testing.T) { `, tx: &TransactionOnChain{ Transaction: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, diff --git a/types/tx.go b/types/tx.go index e907172..019a5df 100644 --- a/types/tx.go +++ b/types/tx.go @@ -36,35 +36,46 @@ const ( ) // Transaction is an interface that represents a generic Ethereum transaction. +// +// Use NewTransaction* functions to create transactions of specific types. type Transaction interface { json.Marshaler json.Unmarshaler rlp.Encoder rlp.Decoder - HasTransactionData - // Type returns the type of the transaction. Type() TransactionType // Call returns the call associated with the transaction. The call is a // copy and can be modified. It may return nil if it is impossible to // create a call. + // + // Always prefer using the [Call], even if the transaction already implements + // the [Call] interface. Call() Call - // CalculateHash computes and returns the hash of the transaction. - CalculateHash() (Hash, error) + // Hash returns the hash of the transaction. + Hash() (Hash, error) +} + +// SignableTransaction is an interface that represents a transaction that can +// be signed. +// +// Use NewTransaction* functions to create transactions of specific types. +type SignableTransaction interface { + Transaction + HasSigningData - // CalculateSigningHash computes and returns the hash used for signing - // the transaction. - CalculateSigningHash() (Hash, error) + // SigningHash returns the hash used for signing the transaction. + SigningHash() (Hash, error) } // TransactionDecoder is an interface for decoding transactions from JSON or // RLP encoded data. // // Decoder may not set the From field of the transaction. -// To get signer of the transaction, use txsign.Recover function. +// To get a signer of the transaction, use txsign.Recover function. type TransactionDecoder interface { RLPTransactionDecoder JSONTransactionDecoder diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index fa213d2..e7cd3af 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -15,7 +15,7 @@ import ( // list that specifies a list of addresses and storage keys the transaction // plans to access. type TransactionAccessList struct { - TransactionData + SigningData CallAccessList } @@ -31,15 +31,11 @@ func (t *TransactionAccessList) Type() TransactionType { // Call implements the Transaction interface. func (t *TransactionAccessList) Call() Call { - return &CallAccessList{ - CallData: *t.CallData.Copy(), - LegacyPriceData: *t.LegacyPriceData.Copy(), - AccessListData: *t.AccessListData.Copy(), - } + return t.CallAccessList.Copy() } -// CalculateHash implements the Transaction interface. -func (t *TransactionAccessList) CalculateHash() (Hash, error) { +// Hash implements the Transaction interface. +func (t *TransactionAccessList) Hash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err @@ -47,8 +43,8 @@ func (t *TransactionAccessList) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } -// CalculateSigningHash implements the Transaction interface. -func (t *TransactionAccessList) CalculateSigningHash() (Hash, error) { +// SigningHash implements the Transaction interface. +func (t *TransactionAccessList) SigningHash() (Hash, error) { var ( chainID = rlp.Uint(0) nonce = rlp.Uint(0) @@ -167,8 +163,8 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { // Copy creates a deep copy of the transaction. func (t *TransactionAccessList) Copy() *TransactionAccessList { return &TransactionAccessList{ - TransactionData: *t.TransactionData.Copy(), - CallAccessList: *t.CallAccessList.Copy(), + SigningData: *t.SigningData.Copy(), + CallAccessList: *t.CallAccessList.Copy(), } } @@ -251,9 +247,9 @@ func (t *TransactionAccessList) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionAccessList) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionData.toJSON(j) - t.CallData.toJSON(&j.jsonCall) - t.LegacyPriceData.toJSON(&j.jsonCall) + t.SigningData.toJSON(j) + t.ExecutionData.toJSON(&j.jsonCall) + t.LegacyFeeData.toJSON(&j.jsonCall) t.AccessListData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -264,9 +260,9 @@ func (t *TransactionAccessList) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionData.fromJSON(j) - t.CallData.fromJSON(&j.jsonCall) - t.LegacyPriceData.fromJSON(&j.jsonCall) + t.SigningData.fromJSON(j) + t.ExecutionData.fromJSON(&j.jsonCall) + t.LegacyFeeData.fromJSON(&j.jsonCall) t.AccessListData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_accesslist_test.go b/types/tx_accesslist_test.go index 2e754ce..8f66323 100644 --- a/types/tx_accesslist_test.go +++ b/types/tx_accesslist_test.go @@ -24,20 +24,20 @@ func TestTransactionAccessList_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, AccessListData: AccessListData{ @@ -77,7 +77,7 @@ func TestTransactionAccessList_JSON(t *testing.T) { { name: "invalid negative nonce", tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(18446744073709551615)), // Max uint64 value to simulate negative when interpreted incorrectly }, }, @@ -120,20 +120,20 @@ func TestTransactionAccessList_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, AccessListData: AccessListData{ @@ -183,18 +183,18 @@ func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallAccessList: CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -204,7 +204,7 @@ func TestTransactionAccessList_CalculateSigningHash(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - sh, err := tt.tx.CalculateSigningHash() + sh, err := tt.tx.SigningHash() require.NoError(t, err) assert.Equal(t, tt.wantHex, sh.String()) }) diff --git a/types/tx_blob.go b/types/tx_blob.go index 8bc550b..5da537c 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -15,7 +15,7 @@ import ( // Introduced by EIP-4844, this transaction type adds support for blob-carrying // transactions. type TransactionBlob struct { - TransactionData + SigningData CallBlob } @@ -34,8 +34,8 @@ func (t *TransactionBlob) Call() Call { return t.CallBlob.Copy() } -// CalculateHash implements the Transaction interface. -func (t *TransactionBlob) CalculateHash() (Hash, error) { +// Hash implements the Transaction interface. +func (t *TransactionBlob) Hash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err @@ -43,8 +43,8 @@ func (t *TransactionBlob) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } -// CalculateSigningHash implements the Transaction interface. -func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { +// SigningHash implements the Transaction interface. +func (t *TransactionBlob) SigningHash() (Hash, error) { var ( chainID = rlp.Uint(0) nonce = rlp.Uint(0) @@ -116,8 +116,8 @@ func (t *TransactionBlob) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionBlob) Copy() *TransactionBlob { return &TransactionBlob{ - TransactionData: *t.TransactionData.Copy(), - CallBlob: *t.CallBlob.Copy(), + SigningData: *t.SigningData.Copy(), + CallBlob: *t.CallBlob.Copy(), } } @@ -363,8 +363,8 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionBlob) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionData.toJSON(j) - t.CallData.toJSON(&j.jsonCall) + t.SigningData.toJSON(j) + t.ExecutionData.toJSON(&j.jsonCall) t.AccessListData.toJSON(&j.jsonCall) t.DynamicFeeData.toJSON(&j.jsonCall) t.BlobData.toJSON(&j.jsonCall) @@ -377,8 +377,8 @@ func (t *TransactionBlob) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionData.fromJSON(j) - t.CallData.fromJSON(&j.jsonCall) + t.SigningData.fromJSON(j) + t.ExecutionData.fromJSON(&j.jsonCall) t.AccessListData.fromJSON(&j.jsonCall) t.DynamicFeeData.fromJSON(&j.jsonCall) t.BlobData.fromJSON(&j.jsonCall) diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index 7495676..60c0e64 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -28,13 +28,13 @@ func TestTransactionBlob_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -95,13 +95,13 @@ func TestTransactionBlob_JSON(t *testing.T) { { name: "blobs with shortened zero fields", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -207,13 +207,13 @@ func TestTransactionBlob_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -247,13 +247,13 @@ func TestTransactionBlob_RLP(t *testing.T) { { name: "hash output", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -325,12 +325,12 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -347,12 +347,12 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "all fields set with access list", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -388,13 +388,13 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { { name: "with blobs and access list", tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -428,7 +428,7 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - sh, err := tt.tx.CalculateSigningHash() + sh, err := tt.tx.SigningHash() require.NoError(t, err) assert.Equal(t, tt.wantHex, sh.String()) }) diff --git a/types/tx_decoder.go b/types/tx_decoder.go index 540946d..22e4f60 100644 --- a/types/tx_decoder.go +++ b/types/tx_decoder.go @@ -86,22 +86,14 @@ type TransactionUnknown struct { UnknownType TransactionType } -func (t *TransactionUnknown) GetTransactionData() *TransactionData { return nil } - -func (t *TransactionUnknown) SetTransactionData(_ TransactionData) {} - func (t *TransactionUnknown) Type() TransactionType { return t.UnknownType } func (t *TransactionUnknown) Call() Call { return nil } -func (t *TransactionUnknown) CalculateHash() (Hash, error) { +func (t *TransactionUnknown) Hash() (Hash, error) { return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) } -func (t *TransactionUnknown) CalculateSigningHash() (Hash, error) { - return ZeroHash, fmt.Errorf("unable to calculate signing hash of unknown transaction type: %d", t.UnknownType) -} - func (t *TransactionUnknown) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unable to marshal unknown transaction type: %d", t.UnknownType) } @@ -120,7 +112,7 @@ func (t *TransactionUnknown) DecodeRLP(_ []byte) (int, error) { // jsonTXType returns the type of the transaction encoded in JSON. // -// If type is not specified, it tries to guess the type using the same rules as +// If the type is not specified, it tries to guess the type using the same rules as // in go-ethereum code: // https://github.com/ethereum/go-ethereum/blob/5b3e3cd2bee284db7d7deaa5986544d356410dcb/internal/ethapi/transaction_args.go#L472 func jsonTXType(data []byte) (TransactionType, error) { diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go index 028e240..2973ea9 100644 --- a/types/tx_decoder_test.go +++ b/types/tx_decoder_test.go @@ -21,19 +21,19 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(38)), Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -42,7 +42,7 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -61,12 +61,12 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(20000000000), }, }, @@ -79,19 +79,19 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, AccessListData: AccessListData{ @@ -113,13 +113,13 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -148,13 +148,13 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { }, { tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -206,18 +206,18 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -238,7 +238,7 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( func() *big.Int { @@ -256,12 +256,12 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(20000000000), }, }, @@ -289,19 +289,19 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionAccessList{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallAccessList: CallAccessList{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, AccessListData: AccessListData{ @@ -349,13 +349,13 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -411,13 +411,13 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { }, { tx: &TransactionBlob{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallBlob: CallBlob{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index 62fe1b7..3fb9566 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -14,7 +14,7 @@ import ( // Introduced by EIP-1559, this transaction type supports a new fee market // mechanism with a base fee and a priority fee (tip). type TransactionDynamicFee struct { - TransactionData + SigningData CallDynamicFee } @@ -33,8 +33,8 @@ func (t *TransactionDynamicFee) Call() Call { return t.CallDynamicFee.Copy() } -// CalculateHash implements the Transaction interface. -func (t *TransactionDynamicFee) CalculateHash() (Hash, error) { +// Hash implements the Transaction interface. +func (t *TransactionDynamicFee) Hash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err @@ -42,8 +42,8 @@ func (t *TransactionDynamicFee) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } -// CalculateSigningHash implements the Transaction interface. -func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { +// SigningHash implements the Transaction interface. +func (t *TransactionDynamicFee) SigningHash() (Hash, error) { var ( chainID = rlp.Uint(0) nonce = rlp.Uint(0) @@ -102,8 +102,8 @@ func (t *TransactionDynamicFee) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionDynamicFee) Copy() *TransactionDynamicFee { return &TransactionDynamicFee{ - TransactionData: *t.TransactionData.Copy(), - CallDynamicFee: *t.CallDynamicFee.Copy(), + SigningData: *t.SigningData.Copy(), + CallDynamicFee: *t.CallDynamicFee.Copy(), } } @@ -260,8 +260,8 @@ func (t *TransactionDynamicFee) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionDynamicFee) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionData.toJSON(j) - t.CallData.toJSON(&j.jsonCall) + t.SigningData.toJSON(j) + t.ExecutionData.toJSON(&j.jsonCall) t.AccessListData.toJSON(&j.jsonCall) t.DynamicFeeData.toJSON(&j.jsonCall) return json.Marshal(j) @@ -273,8 +273,8 @@ func (t *TransactionDynamicFee) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, j); err != nil { return err } - t.TransactionData.fromJSON(j) - t.CallData.fromJSON(&j.jsonCall) + t.SigningData.fromJSON(j) + t.ExecutionData.fromJSON(&j.jsonCall) t.AccessListData.fromJSON(&j.jsonCall) t.DynamicFeeData.fromJSON(&j.jsonCall) return nil diff --git a/types/tx_dynamicfee_test.go b/types/tx_dynamicfee_test.go index c4029a3..05f0b25 100644 --- a/types/tx_dynamicfee_test.go +++ b/types/tx_dynamicfee_test.go @@ -24,13 +24,13 @@ func TestTransactionDynamicFee_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -111,13 +111,13 @@ func TestTransactionDynamicFee_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), ChainID: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), @@ -176,12 +176,12 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -198,12 +198,12 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { { name: "all fields set with access list", tx: &TransactionDynamicFee{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallDynamicFee: CallDynamicFee{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), @@ -231,7 +231,7 @@ func TestTransactionDynamicFee_CalculateSigningHash(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - sh, err := tt.tx.CalculateSigningHash() + sh, err := tt.tx.SigningHash() require.NoError(t, err) assert.Equal(t, tt.wantHex, sh.String()) }) diff --git a/types/tx_legacy.go b/types/tx_legacy.go index ec26017..63df7e4 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -14,7 +14,7 @@ import ( // // This is the original transaction format used before EIP-2718. type TransactionLegacy struct { - TransactionData + SigningData CallLegacy } @@ -33,8 +33,8 @@ func (t *TransactionLegacy) Call() Call { return t.CallLegacy.Copy() } -// CalculateHash implements the Transaction interface. -func (t *TransactionLegacy) CalculateHash() (Hash, error) { +// Hash implements the Transaction interface. +func (t *TransactionLegacy) Hash() (Hash, error) { raw, err := t.EncodeRLP() if err != nil { return ZeroHash, err @@ -42,8 +42,8 @@ func (t *TransactionLegacy) CalculateHash() (Hash, error) { return Hash(crypto.Keccak256(raw)), nil } -// CalculateSigningHash implements the Transaction interface. -func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { +// SigningHash implements the Transaction interface. +func (t *TransactionLegacy) SigningHash() (Hash, error) { var ( chainID = rlp.Uint(0) nonce = rlp.Uint(0) @@ -99,8 +99,8 @@ func (t *TransactionLegacy) CalculateSigningHash() (Hash, error) { // Copy creates a deep copy of the transaction. func (t *TransactionLegacy) Copy() *TransactionLegacy { return &TransactionLegacy{ - TransactionData: *t.TransactionData.Copy(), - CallLegacy: *t.CallLegacy.Copy(), + SigningData: *t.SigningData.Copy(), + CallLegacy: *t.CallLegacy.Copy(), } } @@ -226,9 +226,9 @@ func (t *TransactionLegacy) DecodeRLP(data []byte) (int, error) { // MarshalJSON implements the json.Marshaler interface. func (t *TransactionLegacy) MarshalJSON() ([]byte, error) { j := &jsonTransaction{} - t.TransactionData.toJSON(j) - t.CallData.toJSON(&j.jsonCall) - t.LegacyPriceData.toJSON(&j.jsonCall) + t.SigningData.toJSON(j) + t.ExecutionData.toJSON(&j.jsonCall) + t.LegacyFeeData.toJSON(&j.jsonCall) return json.Marshal(j) } @@ -238,9 +238,9 @@ func (t *TransactionLegacy) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &j); err != nil { return err } - t.TransactionData.fromJSON(j) - t.CallData.fromJSON(&j.jsonCall) - t.LegacyPriceData.fromJSON(&j.jsonCall) + t.SigningData.fromJSON(j) + t.ExecutionData.fromJSON(&j.jsonCall) + t.LegacyFeeData.fromJSON(&j.jsonCall) return nil } diff --git a/types/tx_legacy_test.go b/types/tx_legacy_test.go index a812533..66c7808 100644 --- a/types/tx_legacy_test.go +++ b/types/tx_legacy_test.go @@ -24,19 +24,19 @@ func TestTransactionLegacy_JSON(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -57,7 +57,7 @@ func TestTransactionLegacy_JSON(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -76,12 +76,12 @@ func TestTransactionLegacy_JSON(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(20000000000), }, }, @@ -133,19 +133,19 @@ func TestTransactionLegacy_RLP(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ Nonce: ptr(uint64(1)), Signature: MustSignatureFromHexPtr("0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad914908051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd846f"), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -155,7 +155,7 @@ func TestTransactionLegacy_RLP(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), Signature: SignatureFromVRSPtr( @@ -174,12 +174,12 @@ func TestTransactionLegacy_RLP(t *testing.T) { ), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(20000000000), }, }, @@ -221,19 +221,19 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { { name: "all fields set", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(1)), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ From: MustAddressFromHexPtr("0x1111111111111111111111111111111111111111"), To: MustAddressFromHexPtr("0x2222222222222222222222222222222222222222"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(100000)), Input: []byte{1, 2, 3, 4}, }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(1000000000), }, }, @@ -243,17 +243,17 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { { name: "example from EIP-155", tx: &TransactionLegacy{ - TransactionData: TransactionData{ + SigningData: SigningData{ ChainID: ptr(uint64(1)), Nonce: ptr(uint64(9)), }, CallLegacy: CallLegacy{ - CallData: CallData{ + ExecutionData: ExecutionData{ To: MustAddressFromHexPtr("0x3535353535353535353535353535353535353535"), Value: big.NewInt(1000000000000000000), GasLimit: ptr(uint64(21000)), }, - LegacyPriceData: LegacyPriceData{ + LegacyFeeData: LegacyFeeData{ GasPrice: big.NewInt(20000000000), }, }, @@ -263,7 +263,7 @@ func TestTransactionLegacy_CalculateSigningHash(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - sh, err := tt.tx.CalculateSigningHash() + sh, err := tt.tx.SigningHash() require.NoError(t, err) assert.Equal(t, tt.wantHex, sh.String()) }) diff --git a/types/types.go b/types/types.go index 5221443..5744251 100644 --- a/types/types.go +++ b/types/types.go @@ -117,13 +117,36 @@ func MustAddressFromBytesPtr(b []byte) *Address { return &a } -// VerifyAddressChecksum verifies if the given cheksummed address is valid. -func VerifyAddressChecksum(h string) bool { +// AddressFromChecksum parses a checksummed address and returns an Address type. +func AddressFromChecksum(h string) (Address, error) { a, err := AddressFromHex(h) if err != nil { - return false + return ZeroAddress, err + } + if a.Checksum() != h { + return ZeroAddress, fmt.Errorf("invalid checksum: expected %s, got %s", a.Checksum(), h) + } + return a, nil +} + +// MustAddressFromChecksum parses a checksummed address and returns an Address type. +// It panics if the address is invalid. +func MustAddressFromChecksum(h string) Address { + a, err := AddressFromChecksum(h) + if err != nil { + panic(err) } - return a.Checksum() == h + return a +} + +// AddressFromChecksumPtr parses a checksummed address and returns an Address type. +// It returns nil if the address is invalid. +func AddressFromChecksumPtr(h string) *Address { + a, err := AddressFromChecksum(h) + if err != nil { + return nil + } + return &a } // Bytes returns the byte representation of the address. diff --git a/types/util_test.go b/types/util_test.go index 78c7834..090059f 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -9,14 +9,14 @@ import ( func assertEqualTX(t *testing.T, actual, expected Transaction) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) - if _, ok := expected.(HasTransactionData); ok { - assert.Equal(t, expected.(HasTransactionData).GetTransactionData(), actual.(HasTransactionData).GetTransactionData()) + if _, ok := expected.(HasSigningData); ok { + assert.Equal(t, expected.(HasSigningData).GetSigningData(), actual.(HasSigningData).GetSigningData()) } - if _, ok := expected.(HasCallData); ok { - assert.Equal(t, actual.(HasCallData).GetCallData(), actual.(HasCallData).GetCallData()) + if _, ok := expected.(HasExecutionData); ok { + assert.Equal(t, actual.(HasExecutionData).GetExecutionData(), actual.(HasExecutionData).GetExecutionData()) } - if _, ok := actual.(HasLegacyPriceData); ok { - assert.Equal(t, expected.(HasLegacyPriceData).GetLegacyPriceData(), actual.(HasLegacyPriceData).GetLegacyPriceData()) + if _, ok := actual.(HasLegacyFeeData); ok { + assert.Equal(t, expected.(HasLegacyFeeData).GetLegacyFeeData(), actual.(HasLegacyFeeData).GetLegacyFeeData()) } if _, ok := actual.(HasAccessListData); ok { assert.Equal(t, expected.(HasAccessListData).GetAccessListData(), actual.(HasAccessListData).GetAccessListData()) @@ -31,11 +31,11 @@ func assertEqualTX(t *testing.T, actual, expected Transaction) { func assertEqualCall(t *testing.T, actual, expected Call) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) - if _, ok := expected.(HasCallData); ok { - assert.Equal(t, actual.(HasCallData).GetCallData(), actual.(HasCallData).GetCallData()) + if _, ok := expected.(HasExecutionData); ok { + assert.Equal(t, actual.(HasExecutionData).GetExecutionData(), actual.(HasExecutionData).GetExecutionData()) } - if _, ok := actual.(HasLegacyPriceData); ok { - assert.Equal(t, expected.(HasLegacyPriceData).GetLegacyPriceData(), actual.(HasLegacyPriceData).GetLegacyPriceData()) + if _, ok := actual.(HasLegacyFeeData); ok { + assert.Equal(t, expected.(HasLegacyFeeData).GetLegacyFeeData(), actual.(HasLegacyFeeData).GetLegacyFeeData()) } if _, ok := actual.(HasAccessListData); ok { assert.Equal(t, expected.(HasAccessListData).GetAccessListData(), actual.(HasAccessListData).GetAccessListData()) diff --git a/wallet/key.go b/wallet/key.go index e67af44..d1484d5 100644 --- a/wallet/key.go +++ b/wallet/key.go @@ -15,7 +15,7 @@ type Key interface { SignMessage(ctx context.Context, data []byte) (*types.Signature, error) // SignTransaction signs the given transaction. - SignTransaction(ctx context.Context, tx types.Transaction) error + SignTransaction(ctx context.Context, tx types.SignableTransaction) error // VerifyMessage verifies whether the given data is signed by the key. VerifyMessage(ctx context.Context, data []byte, sig types.Signature) bool diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 168245d..c0b945e 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -86,7 +86,7 @@ func (k *PrivateKey) SignMessage(_ context.Context, data []byte) (*types.Signatu } // SignTransaction implements the Key interface. -func (k *PrivateKey) SignTransaction(_ context.Context, tx types.Transaction) error { +func (k *PrivateKey) SignTransaction(_ context.Context, tx types.SignableTransaction) error { return txsign.Sign(k.private, tx) } diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index b4ce846..660c75a 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -44,7 +44,7 @@ func (k *KeyRPC) SignMessage(ctx context.Context, data []byte) (*types.Signature } // SignTransaction implements the Key interface. -func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) error { +func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.SignableTransaction) error { raw, err := k.client.SignTransaction(ctx, tx) if err != nil { return err @@ -53,7 +53,11 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro if err != nil { return fmt.Errorf("failed to decode signed transaction: %w", err) } - tx.SetTransactionData(*stx.GetTransactionData()) + sd := types.GetSigningData(stx) + if sd == nil { + return fmt.Errorf("failed to get signed transaction data") + } + tx.SetSigningData(*sd) addr, err := txsign.Recover(tx) if err != nil { return fmt.Errorf("failed to verify signed transaction: %w", err) @@ -61,7 +65,7 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.Transaction) erro if *addr != k.address { return fmt.Errorf("failed to verify signed transaction: recovered address does not match key address") } - return err + return nil } // VerifyMessage implements the Key interface. From 3c446e169bf88f21f9a1e64292d2635fbaf18f77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Wed, 27 May 2026 03:36:17 +0200 Subject: [PATCH 24/44] Add support of eth_createAccessList in hijackAddress --- rpc/hijack_address.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc/hijack_address.go b/rpc/hijack_address.go index befd51f..7e0e95f 100644 --- a/rpc/hijack_address.go +++ b/rpc/hijack_address.go @@ -7,8 +7,8 @@ import ( "github.com/defiweb/go-eth/types" ) -// hijackAddress hijacks the "eth_sendTransaction", "eth_call" and -// "eth_estimateGas" methods sets the "from" field. +// hijackAddress hijacks "eth_sendTransaction", "eth_call", +// "eth_estimateGas", and "eth_createAccessList" to set the "from" field. type hijackAddress struct { address types.Address replace bool @@ -29,7 +29,7 @@ func (h *hijackAddress) Call() func(next transport.CallFunc) transport.CallFunc return next(ctx, t, result, method, args...) } ed = types.GetExecutionData(tx) - case "eth_call", "eth_estimateGas": + case "eth_call", "eth_estimateGas", "eth_createAccessList": call, ok := args[0].(types.Call) if !ok { return next(ctx, t, result, method, args...) From 8c23c5c75ba17bb6e742ceeffcba2a4c609b8269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Wed, 27 May 2026 03:36:58 +0200 Subject: [PATCH 25/44] Fix wrong error messages in hijackSign --- rpc/hijack_sign.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/hijack_sign.go b/rpc/hijack_sign.go index 4a6d311..e445862 100644 --- a/rpc/hijack_sign.go +++ b/rpc/hijack_sign.go @@ -23,7 +23,7 @@ func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { case method == "eth_accounts": accounts, ok := result.(*[]types.Address) if !ok { - return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", args[0])} + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid result type: %T", result)} } k.hijackAccountsCall(accounts) case method == "eth_sign" && len(args) == 2: @@ -37,7 +37,7 @@ func (k *hijackSign) Call() func(next transport.CallFunc) transport.CallFunc { } data, ok := args[1].([]byte) if !ok { - return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid data type: %T", args[0])} + return &ErrHijackFailed{name: "sign", err: fmt.Errorf("invalid data type: %T", args[1])} } return k.hijackSignCall(ctx, signature, account, data) case method == "eth_signTransaction" && len(args) == 1: From 47df4bf2f056f28818dc51969aa4a74163f1408f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Thu, 28 May 2026 01:39:25 +0200 Subject: [PATCH 26/44] Ensure that the client never modifies the arguments --- rpc/client.go | 50 +++++++++++++++++++++++----------------- rpc/hijack_copy.go | 49 +++++++++++++++++++++++++++++++++++++++ rpc/methods_common.go | 15 ------------ rpc/transport/hijack.go | 15 ++++++------ types/call.go | 3 ++- types/call_accesslist.go | 2 +- types/call_basic.go | 2 +- types/call_blob.go | 2 +- types/call_dynamicfee.go | 2 +- types/call_legacy.go | 2 +- types/components.go | 6 ++++- types/tx.go | 6 ++--- types/tx_accesslist.go | 4 ++-- types/tx_blob.go | 4 ++-- types/tx_decoder.go | 4 ++++ types/tx_dynamicfee.go | 4 ++-- types/tx_legacy.go | 4 ++-- 17 files changed, 113 insertions(+), 61 deletions(-) create mode 100644 rpc/hijack_copy.go diff --git a/rpc/client.go b/rpc/client.go index a29b7fc..df40f6c 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -27,6 +27,8 @@ const ( // Client is a default RPC client that provides access to the standard Ethereum // JSON-RPC APIs. type Client struct { + Context *ClientContext + MethodsCommon MethodsFilter MethodsWallet @@ -82,14 +84,16 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { } } -// WithKeys allows emulating the behavior of the RPC methods that require -// a private key to sign the data. +// WithKeys intercepts account and signing RPC methods and handles them +// locally using the provided keys instead of delegating to the node. // -// The following methods are affected: -// - Accounts - returns the addresses of the provided keys -// - Sign - signs the data with the provided key -// - SignTransaction - signs transaction -// - SendTransaction - signs transaction and sends it using SendRawTransaction +// The following methods are intercepted: +// - eth_accounts - returns the addresses of the provided keys +// - eth_sign - signs data with the matching key +// - eth_signTransaction - signs the transaction and returns raw bytes +// - eth_sendTransaction - signs the transaction and re-issues it as +// eth_sendRawTransaction; downstream hijackers observe the substituted +// method name, not the original // // This option will modify the provided transaction instance. func WithKeys(keys ...wallet.Key) ClientOption { @@ -341,21 +345,20 @@ type ClientOptions func(c *ClientContext, client any) error // // The WithTransport option is required. func NewClient(opts ...ClientOption) (*Client, error) { - ctx := &ClientContext{} - client := &Client{} - if err := applyOptions(ctx, opts); err != nil { + client := &Client{Context: &ClientContext{}} + if err := applyOptions(client.Context, opts); err != nil { return nil, fmt.Errorf("rpc client: option error: %w", err) } - if ctx.Decoder == nil { - ctx.Decoder = types.DefaultTransactionDecoder + if client.Context.Decoder == nil { + client.Context.Decoder = types.DefaultTransactionDecoder } - if ctx.Transport == nil { + if client.Context.Transport == nil { return nil, fmt.Errorf("rpc client: transport is required") } - client.MethodsCommon.Context = ctx - client.MethodsFilter.Context = ctx - client.MethodsWallet.Context = ctx - client.MethodsClient.Context = ctx + client.MethodsCommon.Context = client.Context + client.MethodsFilter.Context = client.Context + client.MethodsWallet.Context = client.Context + client.MethodsClient.Context = client.Context return client, nil } @@ -404,6 +407,11 @@ func applyOptions(c *ClientContext, opts []ClientOption) error { return err } } + if h, ok := c.Transport.(clientTransportHijacker); ok { + // If any hijackers were added, add a copy hijacker to ensure that + // method arguments are not modified. + h.Use(&hijackCopy{}) + } return nil } @@ -447,16 +455,16 @@ func initPtr(r reflect.Value) bool { } func addHijacker(t transport.Transport, hijackers ...transport.Hijacker) transport.Transport { - if h, ok := t.(*optionTransportHijack); ok { + if h, ok := t.(clientTransportHijacker); ok { h.Use(hijackers...) return h } - return optionTransportHijack{transport.NewHijacker(t, hijackers...)} + return clientTransportHijacker{transport.NewHijacker(t, hijackers...)} } -// optionTransportHijack wraps a Hijack transport to distinguish user-provided +// clientTransportHijacker wraps a Hijack transport to distinguish user-provided // hijackers from those used internally by the client. -type optionTransportHijack struct { +type clientTransportHijacker struct { *transport.Hijack } diff --git a/rpc/hijack_copy.go b/rpc/hijack_copy.go new file mode 100644 index 0000000..be10f12 --- /dev/null +++ b/rpc/hijack_copy.go @@ -0,0 +1,49 @@ +package rpc + +import ( + "context" + + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" +) + +// hijackCopy creates deep copies of arguments that may be modified by other +// hijackers. +// +// Each hijacker could create its own copy, but to avoid duplicating work and +// making multiple copies of the same argument, this hijacker creates a single +// copy and shares it among hijackers. +type hijackCopy struct{} + +// Call implements the [transport.Hijacker] interface. +func (k *hijackCopy) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) error { + switch method { + case "eth_sendTransaction": + tx, ok := args[0].(types.Transaction) + if !ok { + return next(ctx, t, result, method, args...) + } + args[0] = tx.Copy() + case "eth_call", "eth_estimateGas", "eth_createAccessList": + call, ok := args[0].(types.Call) + if !ok { + return next(ctx, t, result, method, args...) + } + args[0] = call.Copy() + } + return next(ctx, t, result, method, args...) + } + } +} + +// Subscribe implements the [transport.Hijacker] interface. +func (k *hijackCopy) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +// Unsubscribe implements the [transport.Hijacker] interface. +func (k *hijackCopy) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} diff --git a/rpc/methods_common.go b/rpc/methods_common.go index 4f56db5..e34e11e 100644 --- a/rpc/methods_common.go +++ b/rpc/methods_common.go @@ -212,9 +212,6 @@ func (c *MethodsCommon) Call(ctx context.Context, call types.Call, block types.B if call == nil { return nil, errors.New("rpc client: call is nil") } - if tx, ok := call.(types.Transaction); ok { - call = tx.Call() - } var res types.Bytes if err := c.Context.Transport.Call(ctx, &res, "eth_call", call, block); err != nil { return nil, err @@ -225,16 +222,10 @@ func (c *MethodsCommon) Call(ctx context.Context, call types.Call, block types.B // CreateAccessList performs eth_createAccessList RPC call. // // It creates an access list for a transaction as defined in EIP-2930. -// -// If call also implements types.Transaction, then a Call method of the -// transaction will be used to create a call. func (c *MethodsCommon) CreateAccessList(ctx context.Context, call types.Call, block types.BlockNumber) (*types.AccessListResult, error) { if call == nil { return nil, errors.New("rpc client: call is nil") } - if tx, ok := call.(types.Transaction); ok { - call = tx.Call() - } var res types.AccessListResult if err := c.Context.Transport.Call(ctx, &res, "eth_createAccessList", call, block); err != nil { return nil, err @@ -245,16 +236,10 @@ func (c *MethodsCommon) CreateAccessList(ctx context.Context, call types.Call, b // EstimateGas performs eth_estimateGas RPC call. // // It estimates the gas necessary to execute a specific transaction. -// -// If call also implements types.Transaction, then a Call method of the -// transaction will be used to create a call. func (c *MethodsCommon) EstimateGas(ctx context.Context, call types.Call, block types.BlockNumber) (uint64, error) { if call == nil { return 0, errors.New("rpc client: call is nil") } - if tx, ok := call.(types.Transaction); ok { - call = tx.Call() - } var res types.Number if err := c.Context.Transport.Call(ctx, &res, "eth_estimateGas", call, block); err != nil { return 0, err diff --git a/rpc/transport/hijack.go b/rpc/transport/hijack.go index 9f2b982..9ed3e47 100644 --- a/rpc/transport/hijack.go +++ b/rpc/transport/hijack.go @@ -5,13 +5,16 @@ import ( "encoding/json" ) -// Hijacker intercepts and modifies calls to the underlying [Transport] using -// the middleware pattern. +// Hijacker intercepts and modifies calls to an underlying [Transport] +// using the middleware pattern. // -// The 'next' function should be called to continue the call chain. +// The 'next' function must be called to continue the call chain. // -// The transport provided to 'next' is the underlying [Transport] instance; -// using it will bypass any subsequent hijackers. +// The transport passed to 'next' is the underlying [Transport] instance; +// calling it will bypass any subsequent hijackers. +// +// Hijackers must not modify received arguments; instead, they should create +// and modify copies if necessary. type Hijacker interface { // Call returns a [CallFunc] that intercepts and modifies // the 'Call' method. @@ -41,8 +44,6 @@ type ( // Hijack is a wrapper around another [Transport] that allows hijacking // and modifying the behavior of the underlying [Transport] using the // middleware pattern. -// -// Hijackers must implement one or more of the Hijacker interface methods. type Hijack struct { transport Transport callFunc CallFunc diff --git a/types/call.go b/types/call.go index 6dcae5b..a4eb8ef 100644 --- a/types/call.go +++ b/types/call.go @@ -6,8 +6,9 @@ import "encoding/json" type Call interface { json.Marshaler json.Unmarshaler - HasExecutionData + + Copy() Call } type jsonCall struct { diff --git a/types/call_accesslist.go b/types/call_accesslist.go index 4d3e77d..9f9b347 100644 --- a/types/call_accesslist.go +++ b/types/call_accesslist.go @@ -20,7 +20,7 @@ func NewCallAccessList() *CallAccessList { } // Copy creates a deep copy of the CallAccessList. -func (c *CallAccessList) Copy() *CallAccessList { +func (c *CallAccessList) Copy() Call { if c == nil { return nil } diff --git a/types/call_basic.go b/types/call_basic.go index e0aea29..abf9b21 100644 --- a/types/call_basic.go +++ b/types/call_basic.go @@ -16,7 +16,7 @@ func NewCall() *CallBasic { } // Copy creates a deep copy of the CallBasic. -func (c *CallBasic) Copy() *CallBasic { +func (c *CallBasic) Copy() Call { return &CallBasic{ ExecutionData: *c.ExecutionData.Copy(), } diff --git a/types/call_blob.go b/types/call_blob.go index 8bb7c9d..d1fa494 100644 --- a/types/call_blob.go +++ b/types/call_blob.go @@ -21,7 +21,7 @@ func NewCallBlob() *CallBlob { } // Copy creates a deep copy of the CallBlob. -func (c *CallBlob) Copy() *CallBlob { +func (c *CallBlob) Copy() Call { if c == nil { return nil } diff --git a/types/call_dynamicfee.go b/types/call_dynamicfee.go index ef7c955..fde882d 100644 --- a/types/call_dynamicfee.go +++ b/types/call_dynamicfee.go @@ -19,7 +19,7 @@ func NewCallDynamicFee() *CallDynamicFee { } // Copy creates a deep copy of the CallDynamicFee. -func (c *CallDynamicFee) Copy() *CallDynamicFee { +func (c *CallDynamicFee) Copy() Call { if c == nil { return nil } diff --git a/types/call_legacy.go b/types/call_legacy.go index 36a90a4..5c8cc14 100644 --- a/types/call_legacy.go +++ b/types/call_legacy.go @@ -14,7 +14,7 @@ func NewCallLegacy() *CallLegacy { } // Copy creates a deep copy of the CallLegacy. -func (c *CallLegacy) Copy() *CallLegacy { +func (c *CallLegacy) Copy() Call { if c == nil { return nil } diff --git a/types/components.go b/types/components.go index be0bd4c..1f2d09e 100644 --- a/types/components.go +++ b/types/components.go @@ -148,10 +148,14 @@ func (c *SigningData) SetSignature(signature Signature) { // Copy creates a deep copy of the SigningData. func (c *SigningData) Copy() *SigningData { + var s *Signature + if c.Signature != nil { + s = c.Signature.Copy() + } return &SigningData{ ChainID: copyPtr(c.ChainID), Nonce: copyPtr(c.Nonce), - Signature: c.Signature.Copy(), + Signature: s, } } diff --git a/types/tx.go b/types/tx.go index 019a5df..4180871 100644 --- a/types/tx.go +++ b/types/tx.go @@ -50,13 +50,13 @@ type Transaction interface { // Call returns the call associated with the transaction. The call is a // copy and can be modified. It may return nil if it is impossible to // create a call. - // - // Always prefer using the [Call], even if the transaction already implements - // the [Call] interface. Call() Call // Hash returns the hash of the transaction. Hash() (Hash, error) + + // Copy returns a deep copy of the transaction. + Copy() Transaction } // SignableTransaction is an interface that represents a transaction that can diff --git a/types/tx_accesslist.go b/types/tx_accesslist.go index e7cd3af..3b77e3e 100644 --- a/types/tx_accesslist.go +++ b/types/tx_accesslist.go @@ -161,10 +161,10 @@ func (t TransactionAccessList) EncodeRLP() ([]byte, error) { } // Copy creates a deep copy of the transaction. -func (t *TransactionAccessList) Copy() *TransactionAccessList { +func (t *TransactionAccessList) Copy() Transaction { return &TransactionAccessList{ SigningData: *t.SigningData.Copy(), - CallAccessList: *t.CallAccessList.Copy(), + CallAccessList: *t.CallAccessList.Copy().(*CallAccessList), } } diff --git a/types/tx_blob.go b/types/tx_blob.go index 5da537c..3627ba2 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -114,10 +114,10 @@ func (t *TransactionBlob) SigningHash() (Hash, error) { } // Copy creates a deep copy of the transaction. -func (t *TransactionBlob) Copy() *TransactionBlob { +func (t *TransactionBlob) Copy() Transaction { return &TransactionBlob{ SigningData: *t.SigningData.Copy(), - CallBlob: *t.CallBlob.Copy(), + CallBlob: *t.CallBlob.Copy().(*CallBlob), } } diff --git a/types/tx_decoder.go b/types/tx_decoder.go index 22e4f60..5560439 100644 --- a/types/tx_decoder.go +++ b/types/tx_decoder.go @@ -94,6 +94,10 @@ func (t *TransactionUnknown) Hash() (Hash, error) { return ZeroHash, fmt.Errorf("unable to calculate hash of unknown transaction type: %d", t.UnknownType) } +func (t *TransactionUnknown) Copy() Transaction { + return &TransactionUnknown{UnknownType: t.UnknownType} +} + func (t *TransactionUnknown) MarshalJSON() ([]byte, error) { return nil, fmt.Errorf("unable to marshal unknown transaction type: %d", t.UnknownType) } diff --git a/types/tx_dynamicfee.go b/types/tx_dynamicfee.go index 3fb9566..0a7599f 100644 --- a/types/tx_dynamicfee.go +++ b/types/tx_dynamicfee.go @@ -100,10 +100,10 @@ func (t *TransactionDynamicFee) SigningHash() (Hash, error) { } // Copy creates a deep copy of the transaction. -func (t *TransactionDynamicFee) Copy() *TransactionDynamicFee { +func (t *TransactionDynamicFee) Copy() Transaction { return &TransactionDynamicFee{ SigningData: *t.SigningData.Copy(), - CallDynamicFee: *t.CallDynamicFee.Copy(), + CallDynamicFee: *t.CallDynamicFee.Copy().(*CallDynamicFee), } } diff --git a/types/tx_legacy.go b/types/tx_legacy.go index 63df7e4..4e6f433 100644 --- a/types/tx_legacy.go +++ b/types/tx_legacy.go @@ -97,10 +97,10 @@ func (t *TransactionLegacy) SigningHash() (Hash, error) { } // Copy creates a deep copy of the transaction. -func (t *TransactionLegacy) Copy() *TransactionLegacy { +func (t *TransactionLegacy) Copy() Transaction { return &TransactionLegacy{ SigningData: *t.SigningData.Copy(), - CallLegacy: *t.CallLegacy.Copy(), + CallLegacy: *t.CallLegacy.Copy().(*CallLegacy), } } From e40fa362c501911b378e235d4594dbbc823543ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Thu, 28 May 2026 02:02:24 +0200 Subject: [PATCH 27/44] Simplify NewCustomClient implementation --- rpc/client.go | 74 +++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/rpc/client.go b/rpc/client.go index df40f6c..ab2b740 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -44,14 +44,14 @@ type ClientContext struct { } type ClientOption interface { - Apply(cfg *ClientContext, client any) error + Apply(cfg *ClientContext) error Order() int } // WithTransport sets the transport for the client. func WithTransport(t transport.Transport) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = t return nil }, @@ -65,7 +65,7 @@ func WithTransport(t transport.Transport) ClientOption { // present in some L2 implementations. func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Decoder = decoder return nil }, @@ -76,7 +76,7 @@ func WithTransactionDecoder(decoder types.TransactionDecoder) ClientOption { // applied by the client. func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, @@ -98,7 +98,7 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { // This option will modify the provided transaction instance. func WithKeys(keys ...wallet.Key) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, &hijackSign{keys: keys}) return nil }, @@ -113,7 +113,7 @@ func WithKeys(keys ...wallet.Key) ClientOption { // eth_sendPrivateTransaction methods. func WithSimulate() ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, &hijackSimulate{decoder: ctx.Decoder}) return nil }, @@ -134,7 +134,7 @@ type NonceOptions struct { // This option will modify the provided transaction instance. func WithNonce(opts NonceOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, &hijackNonce{ usePendingBlock: opts.UsePendingBlock, replace: opts.Replace, @@ -170,7 +170,7 @@ type LegacyGasFeeOptions struct { // This option will modify the provided transaction instance. func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { if opts.Multiplier == 0 { return fmt.Errorf("rpc client: gas price multiplier must be greater than 0") } @@ -221,7 +221,7 @@ type DynamicGasFeeOptions struct { // This option will modify the provided transaction instance. func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { if opts.GasPriceMultiplier == 0 || opts.PriorityFeePerGasMultiplier == 0 { return fmt.Errorf("rpc client: gas price and priority fee multipliers must be greater than 0") } @@ -260,7 +260,7 @@ type GasLimitOptions struct { // This option will modify the provided transaction instance. func WithGasLimit(opts GasLimitOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { if opts.Multiplier == 0 { return fmt.Errorf("rpc client: gas limit multiplier must be greater than 0") } @@ -291,7 +291,7 @@ type AddressOptions struct { // This option will modify the provided transaction and call instances. func WithDefaultAddress(opts AddressOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, &hijackAddress{ address: opts.Address, replace: opts.Replace, @@ -316,7 +316,7 @@ type ChainIDOptions struct { // This option will modify the provided transaction instance. func WithChainID(opts ChainIDOptions) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, &hijackChainID{ chainID: opts.ChainID, replace: opts.Replace, @@ -331,7 +331,7 @@ func WithChainID(opts ChainIDOptions) ClientOption { // applied by the client. func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { return &option{ - apply: func(ctx *ClientContext, _ any) error { + apply: func(ctx *ClientContext) error { ctx.Transport = addHijacker(ctx.Transport, hijackers...) return nil }, @@ -339,8 +339,6 @@ func WithPreHijackers(hijackers ...transport.Hijacker) ClientOption { } } -type ClientOptions func(c *ClientContext, client any) error - // NewClient creates a new RPC client. // // The WithTransport option is required. @@ -367,8 +365,9 @@ func NewClient(opts ...ClientOption) (*Client, error) { // // The WithTransport option is required. // -// This method automatically initializes nil client fields and recursively -// sets the [ClientContext] in all nested structs. +// NewCustomClient sets the ClientContext field in the provided struct and in +// its directly nested structs. Nested structs must be either embedded or +// exported fields; if they are pointer fields, they must be non-nil. func NewCustomClient[T any](opts ...ClientOption) (*T, error) { ctx := &ClientContext{} client := new(T) @@ -381,17 +380,17 @@ func NewCustomClient[T any](opts ...ClientOption) (*T, error) { if ctx.Transport == nil { return nil, fmt.Errorf("rpc client: transport is required") } - setFields(ctx, reflect.ValueOf(client)) + setClientContext(ctx, reflect.ValueOf(client), 2) return client, nil } type option struct { - apply func(*ClientContext, any) error + apply func(*ClientContext) error order int } -func (o *option) Apply(ctx *ClientContext, client any) error { - return o.apply(ctx, client) +func (o *option) Apply(ctx *ClientContext) error { + return o.apply(ctx) } func (o *option) Order() int { @@ -403,7 +402,7 @@ func applyOptions(c *ClientContext, opts []ClientOption) error { return opts[i].Order() < opts[j].Order() }) for _, opt := range opts { - if err := opt.Apply(c, nil); err != nil { + if err := opt.Apply(c); err != nil { return err } } @@ -415,8 +414,14 @@ func applyOptions(c *ClientContext, opts []ClientOption) error { return nil } -func setFields(ctx *ClientContext, r reflect.Value) { - for r.Kind() == reflect.Ptr || r.Kind() == reflect.Interface { +func setClientContext(ctx *ClientContext, r reflect.Value, maxDepth int) { + if maxDepth <= 0 { + return + } + for r.Kind() == reflect.Ptr { + if r.IsNil() { + return + } r = r.Elem() } if r.Kind() != reflect.Struct { @@ -431,29 +436,12 @@ func setFields(ctx *ClientContext, r reflect.Value) { f.Set(reflect.ValueOf(ctx)) continue } - if initPtr(f) { - setFields(ctx, f) + if f.Kind() == reflect.Struct || f.Kind() == reflect.Ptr { + setClientContext(ctx, f, maxDepth-1) } } } -func initPtr(r reflect.Value) bool { - if !r.CanInterface() { - return false - } - if r.Kind() != reflect.Ptr { - return true - } - if !r.IsNil() { - return true - } - if r.CanSet() { - r.Set(reflect.New(r.Type().Elem())) - return true - } - return false -} - func addHijacker(t transport.Transport, hijackers ...transport.Hijacker) transport.Transport { if h, ok := t.(clientTransportHijacker); ok { h.Use(hijackers...) From 148e62d27ec80e0a3aa5b6964b5e9ed372d8efa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 20 Jul 2026 03:06:25 +0200 Subject: [PATCH 28/44] For abi error decoding --- abi/error.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abi/error.go b/abi/error.go index 1aad25c..15eed0f 100644 --- a/abi/error.go +++ b/abi/error.go @@ -120,7 +120,7 @@ func (e *Error) Is(data []byte) bool { // DecodeValue decodes the error into a map or structure. If a structure is // given, it must have fields with the same names as error arguments. func (e *Error) DecodeValue(data []byte, val any) error { - if e.fourBytes.Match(data) { + if !e.fourBytes.Match(data) { return fmt.Errorf("abi: selector mismatch for error %s", e.name) } return e.abi.DecodeValue(e.inputs, data[4:], val) @@ -137,7 +137,7 @@ func (e *Error) MustDecodeValue(data []byte, val any) { // DecodeValues decodes the error into a map or structure. If a structure is // given, it must have fields with the same names as error arguments. func (e *Error) DecodeValues(data []byte, vals ...any) error { - if e.fourBytes.Match(data) { + if !e.fourBytes.Match(data) { return fmt.Errorf("abi: selector mismatch for error %s", e.name) } return e.abi.DecodeValues(e.inputs, data[4:], vals...) From bfcd6b144eef8c922bbb82edd5380168f67aef20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 21 Jul 2026 01:59:28 +0200 Subject: [PATCH 29/44] Update transport implementations --- go.mod | 2 +- go.sum | 6 +- rpc/transport/error.go | 3 + rpc/transport/hijack.go | 13 +- rpc/transport/ipc.go | 80 +++++------ rpc/transport/retry.go | 10 +- rpc/transport/retry_test.go | 51 +++++++ rpc/transport/stream.go | 227 +++++++++++++++++++++----------- rpc/transport/websocket.go | 157 ++++++++++++++++------ rpc/transport/websocket_test.go | 73 ++++++---- 10 files changed, 409 insertions(+), 213 deletions(-) diff --git a/go.mod b/go.mod index 893407c..6d6b2a1 100644 --- a/go.mod +++ b/go.mod @@ -12,10 +12,10 @@ require ( github.com/defiweb/go-anymapper v0.3.0 github.com/defiweb/go-rlp v0.4.0 github.com/defiweb/go-sigparser v0.6.0 + github.com/gorilla/websocket v1.5.3 github.com/stretchr/testify v1.8.4 github.com/tyler-smith/go-bip39 v1.1.0 golang.org/x/crypto v0.18.0 - nhooyr.io/websocket v1.8.10 ) require ( diff --git a/go.sum b/go.sum index c33e353..13df787 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,6 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3 github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/defiweb/go-anymapper v0.3.0 h1:sWbTvhpdBaCHQGn+kuKYDnb+mPmeDNzzEXnC+CPhe6k= github.com/defiweb/go-anymapper v0.3.0/go.mod h1:EeQDyOsFd63Pt2uu9Yb8NFrChuZ9JBChjGKbDhRPHAQ= -github.com/defiweb/go-rlp v0.3.0 h1:0q+EuR5SdSDu7XLx5Cu68EwVSaNA+CkRCFcE+17HNxA= -github.com/defiweb/go-rlp v0.3.0/go.mod h1:nLGzk10jAgynPvN2hL+tLnnyZ5Fcshv0wmpWDRtV0PA= github.com/defiweb/go-rlp v0.4.0 h1:IheGseUX+kDlykSiADAWYo4J5kSaJPlBraLOfzAsSlI= github.com/defiweb/go-rlp v0.4.0/go.mod h1:nLGzk10jAgynPvN2hL+tLnnyZ5Fcshv0wmpWDRtV0PA= github.com/defiweb/go-sigparser v0.6.0 h1:HSNAZSUl8xyV+nKfWNKYVAPWLwTuASas6ohtarBbOT4= @@ -66,6 +64,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -143,7 +143,5 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= -nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= diff --git a/rpc/transport/error.go b/rpc/transport/error.go index df36888..1ce2727 100644 --- a/rpc/transport/error.go +++ b/rpc/transport/error.go @@ -1,6 +1,7 @@ package transport import ( + "errors" "fmt" "net/http" @@ -55,6 +56,8 @@ const ( BlastErrRateLimitReached = -32097 ) +var ErrNotSubscriptionTransport = errors.New("transport does not implement SubscriptionTransport") + type HTTPErrorCode interface { // HTTPErrorCode returns the HTTP status code. HTTPErrorCode() int diff --git a/rpc/transport/hijack.go b/rpc/transport/hijack.go index 9ed3e47..5921061 100644 --- a/rpc/transport/hijack.go +++ b/rpc/transport/hijack.go @@ -28,7 +28,7 @@ type Hijacker interface { // If nil is returned, no middleware is applied. Subscribe() func(next SubscribeFunc) SubscribeFunc - // Unsubscribe returns an [UnsubscribeFunc that intercepts and modifies + // Unsubscribe returns an [UnsubscribeFunc] that intercepts and modifies // the 'Unsubscribe' method. // // If nil is returned, no middleware is applied. @@ -63,7 +63,9 @@ func NewHijacker(t Transport, hs ...Hijacker) *Hijack { return h } -// Use adds hijackers in the order they are provided. +// Use wraps the hijacker chain with the provided hijackers. Hijackers +// are applied left to right - each one becomes the new outermost layer, +// so the last hijacker in the slice executes first on every call. func (h *Hijack) Use(hs ...Hijacker) { for _, m := range hs { if m == nil { @@ -123,10 +125,9 @@ func (h *Hijack) Unsubscribe(ctx context.Context, id string) error { return ErrNotSubscriptionTransport } -// WithHijackers returns a new context with the provided hijackers added to it. -// -// This allows you to pass hijackers down the call chain. The provided hijackers -// will be appended to any existing hijackers in the context. +// WithHijackers returns a new context with the provided hijackers added. +// These hijackers supplement those registered via [Hijack.Use] and are +// applied on every call that uses this context. func WithHijackers(ctx context.Context, hs ...Hijacker) context.Context { return context.WithValue(ctx, hijackerContextKey{}, append(getHijackers(ctx), hs...)) } diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 4c78c75..1915e55 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -12,7 +12,7 @@ import ( // IPC is a [Transport] implementation that uses the IPC protocol. type IPC struct { - *stream + stream conn net.Conn } @@ -36,26 +36,23 @@ func NewIPC(opts IPCOptions) (*IPC, error) { if opts.Context == nil { return nil, errors.New("context cannot be nil") } + if opts.Timeout == 0 { + opts.Timeout = time.Minute + } var d net.Dialer conn, err := d.DialContext(opts.Context, "unix", opts.Path) if err != nil { return nil, fmt.Errorf("failed to dial IPC: %w", err) } - if opts.Timeout == 0 { - opts.Timeout = 60 * time.Second - } - i := &IPC{ - stream: &stream{ - ctx: opts.Context, - errCh: opts.ErrorCh, - timeout: opts.Timeout, - }, - conn: conn, - } - i.initStream() - go i.readerRoutine() - go i.writerRoutine() - return i, nil + ipc := &IPC{conn: conn} + ipc.stream.initStream( + opts.Context, + withStreamTimeout(opts.Timeout), + withStreamErrorCh(opts.ErrorCh), + ) + go ipc.readerRoutine() + go ipc.writerRoutine() + return ipc, nil } func (i *IPC) readerRoutine() { @@ -63,51 +60,40 @@ func (i *IPC) readerRoutine() { for { var res rpcResponse if err := dec.Decode(&res); err != nil { - if errors.Is(err, context.Canceled) { + if i.ctx.Err() != nil { return } if errors.Is(err, io.EOF) { return } - if i.errCh != nil { - select { - case i.errCh <- err: - case <-i.ctx.Done(): - return - } - } - } - select { - case i.readerCh <- res: - case <-i.ctx.Done(): + i.error(fmt.Errorf("ipc reading error: %w", err)) return } + i.read(res) } } func (i *IPC) writerRoutine() { + defer i.close() enc := json.NewEncoder(i.conn) for { - select { - case req := <-i.writerCh: - if err := enc.Encode(req); err != nil { - if i.errCh == nil { - return - } - if errors.Is(err, context.Canceled) { - return - } - if errors.Is(err, io.EOF) { - return - } - select { - case i.errCh <- err: - case <-i.ctx.Done(): - return - } - } - case <-i.ctx.Done(): + req, ok := i.write() + if !ok { return } + if err := i.conn.SetWriteDeadline(time.Now().Add(i.timeout)); err != nil { + i.error(fmt.Errorf("ipc writing error: %w", err)) + continue + } + if err := enc.Encode(req); err != nil { + i.error(fmt.Errorf("ipc writing error: %w", err)) + continue + } + } +} + +func (i *IPC) close() { + if err := i.conn.Close(); err != nil { + i.error(fmt.Errorf("ipc close error: %w", err)) } } diff --git a/rpc/transport/retry.go b/rpc/transport/retry.go index 3ff6306..4e6f2df 100644 --- a/rpc/transport/retry.go +++ b/rpc/transport/retry.go @@ -9,8 +9,6 @@ import ( "time" ) -var ErrNotSubscriptionTransport = errors.New("transport does not implement SubscriptionTransport") - var ( // RetryOnAnyError retries on any error except for the following cases, // where retrying does not make sense: @@ -120,8 +118,9 @@ type RetryOptions struct { // It takes the current retry count as an argument. BackoffFunc func(int) time.Duration - // MaxRetries is the maximum number of retries. - // If negative, there is no limit. + // MaxRetries is the maximum number of retries after the initial + // attempt. 0 means no retries (one attempt total). Negative means + // unlimited retries. MaxRetries int } @@ -136,9 +135,6 @@ func NewRetry(opts RetryOptions) (*Retry, error) { if opts.BackoffFunc == nil { return nil, errors.New("backoff function cannot be nil") } - if opts.MaxRetries == 0 { - return nil, errors.New("max retries cannot be zero") - } return &Retry{opts: opts}, nil } diff --git a/rpc/transport/retry_test.go b/rpc/transport/retry_test.go index 95693aa..068aae4 100644 --- a/rpc/transport/retry_test.go +++ b/rpc/transport/retry_test.go @@ -192,6 +192,57 @@ func TestRetry(t *testing.T) { require.Equal(t, 2, f.unsubCount) }, }, + // Zero retries - single attempt, no retry on error (call). + { + retry: RetryOptions{ + Transport: newMockTransport(), + MaxRetries: 0, + RetryFunc: RetryOnAnyError, + BackoffFunc: LinearBackoff(0), + }, + asserts: func(t *testing.T, f *mockTransport, r *Retry) { + go func() { + f.callResult <- fmt.Errorf("foo") + }() + err := r.Call(context.Background(), nil, "foo") + require.Error(t, err) + require.Equal(t, 1, f.callCount) + }, + }, + // Zero retries - single attempt, no retry on error (subscribe). + { + retry: RetryOptions{ + Transport: newMockTransport(), + MaxRetries: 0, + RetryFunc: RetryOnAnyError, + BackoffFunc: LinearBackoff(0), + }, + asserts: func(t *testing.T, f *mockTransport, r *Retry) { + go func() { + f.subResult <- fmt.Errorf("foo") + }() + _, _, err := r.Subscribe(context.Background(), "foo") + require.Error(t, err) + require.Equal(t, 1, f.subCount) + }, + }, + // Zero retries - single attempt, no retry on error (unsubscribe). + { + retry: RetryOptions{ + Transport: newMockTransport(), + MaxRetries: 0, + RetryFunc: RetryOnAnyError, + BackoffFunc: LinearBackoff(0), + }, + asserts: func(t *testing.T, f *mockTransport, r *Retry) { + go func() { + f.unsubResult <- fmt.Errorf("foo") + }() + err := r.Unsubscribe(context.Background(), "foo") + require.Error(t, err) + require.Equal(t, 1, f.unsubCount) + }, + }, // Infinite retries until success { retry: RetryOptions{ diff --git a/rpc/transport/stream.go b/rpc/transport/stream.go index aadb715..6876297 100644 --- a/rpc/transport/stream.go +++ b/rpc/transport/stream.go @@ -12,32 +12,53 @@ import ( "github.com/defiweb/go-eth/types" ) +type streamOption func(*stream) + +func withStreamTimeout(timeout time.Duration) streamOption { + return func(s *stream) { + s.timeout = timeout + } +} + +func withStreamCloseFunc(fn func()) streamOption { + return func(s *stream) { + s.closeFunc = fn + } +} + +func withStreamErrorCh(errCh chan error) streamOption { + return func(s *stream) { + s.errCh = errCh + } +} + // stream is a helper for handling JSON-RPC streams. type stream struct { - mu sync.RWMutex ctx context.Context - writerCh chan rpcRequest // Channel for sending requests used by structs that embed stream. - readerCh chan rpcResponse // Channel for receiving responses used by structs that embed stream. - errCh chan error // Channel to which errors are sent. - timeout time.Duration // Timeout for requests. - onClose func() // Callback that is called when the stream is closed. + writeCh chan rpcRequest // Channel for sending requests used by structs that embed stream. + readCh chan rpcResponse // Channel for receiving responses used by structs that embed stream. + errCh chan error // Channel to which errors are sent. + timeout time.Duration // Timeout for requests. + closeFunc func() // Callback that is called when the stream is closed. // State fields. Should not be accessed by structs that embed stream. - id uint64 // Request ID counter. - calls map[uint64]chan rpcResponse // Map of request IDs to channels. - subs map[string]chan json.RawMessage // Map of subscription IDs to channels. + id uint64 // Request ID counter. + chs *streamChannels // Channels for handling requests and subscriptions. } // initStream initializes the stream struct with default values and starts // the required goroutines. -func (s *stream) initStream() *stream { - s.writerCh = make(chan rpcRequest) - s.readerCh = make(chan rpcResponse) - s.calls = make(map[uint64]chan rpcResponse) - s.subs = make(map[string]chan json.RawMessage) +func (s *stream) initStream(ctx context.Context, opts ...streamOption) *stream { + s.ctx = ctx + s.writeCh = make(chan rpcRequest) + s.readCh = make(chan rpcResponse) + s.timeout = time.Minute + s.chs = newStreamChannels() + for _, opt := range opts { + opt(s) + } go s.streamRoutine() - go s.contextHandlerRoutine() return s } @@ -54,12 +75,20 @@ func (s *stream) Call(ctx context.Context, result any, method string, args ...an } // Prepare the channel for the response. - ch := make(chan rpcResponse) - s.addCallCh(id, ch) - defer s.delCallCh(id) + ch, ok := s.chs.addCallCh(id) + if !ok { + return errors.New("stream closed") + } + defer s.chs.delCallCh(id) // Send the request. - s.writerCh <- req + select { + case s.writeCh <- req: + case <-s.ctx.Done(): + return s.ctx.Err() + case <-ctx.Done(): + return ctx.Err() + } // Wait for the response. // The response is handled by streamRoutine, which sends the response @@ -78,6 +107,8 @@ func (s *stream) Call(ctx context.Context, result any, method string, args ...an return fmt.Errorf("failed to unmarshal RPC result: %w", err) } } + case <-s.ctx.Done(): + return s.ctx.Err() case <-ctx.Done(): return ctx.Err() } @@ -97,13 +128,15 @@ func (s *stream) Subscribe(ctx context.Context, method string, args ...any) (cha } id := rawID.String() ch := make(chan json.RawMessage) - s.addSubCh(id, ch) + if !s.chs.addSubCh(id, ch) { + return nil, "", errors.New("stream closed") + } return ch, id, nil } // Unsubscribe implements the [SubscriptionTransport] interface. func (s *stream) Unsubscribe(ctx context.Context, id string) error { - if !s.delSubCh(id) { + if !s.chs.delSubCh(id) { return errors.New("unknown subscription") } num, err := types.NumberFromHex(id) @@ -113,81 +146,113 @@ func (s *stream) Unsubscribe(ctx context.Context, id string) error { return s.Call(ctx, nil, "eth_unsubscribe", num) } -// streamRoutine reads messages from the stream connection and dispatches -// them to the appropriate channels. func (s *stream) streamRoutine() { - for { - res, ok := <-s.readerCh - if !ok { - return + defer func() { + s.chs.close() + if s.closeFunc != nil { + s.closeFunc() } - switch { - case res.ID == nil: - // If the ID is nil, it is a subscription notification. - sub := &rpcSubscription{} - if err := json.Unmarshal(res.Params, sub); err != nil { - if s.errCh != nil { - s.errCh <- fmt.Errorf("failed to unmarshal subscription: %w", err) + }() + for { + select { + case res, ok := <-s.readCh: + if !ok { + return + } + switch { + case res.ID == nil: + // If the ID is nil, it is a subscription notification. + sub := &rpcSubscription{} + if err := json.Unmarshal(res.Params, sub); err != nil { + s.error(fmt.Errorf("failed to unmarshal subscription: %w", err)) + continue } - continue + s.chs.subChSend(s.ctx, sub.Subscription.String(), sub.Result) + default: + // If the ID is not nil, it is a response to a request. + s.chs.callChSend(s.ctx, *res.ID, res) } - s.subChSend(sub.Subscription.String(), sub.Result) - default: - // If the ID is not nil, it is a response to a request. - s.callChSend(*res.ID, res) + case <-s.ctx.Done(): + return } } } -// contextHandlerRoutine closes the connection when the context is canceled. -func (s *stream) contextHandlerRoutine() { - <-s.ctx.Done() - s.mu.Lock() - defer s.mu.Unlock() - for _, ch := range s.calls { - close(ch) +func (s *stream) read(res rpcResponse) { + select { + case s.readCh <- res: + case <-s.ctx.Done(): } - for _, ch := range s.subs { - close(ch) +} + +func (s *stream) write() (rpcRequest, bool) { + select { + case req, ok := <-s.writeCh: + return req, ok + case <-s.ctx.Done(): + return rpcRequest{}, false } - s.calls = nil - s.subs = nil - if s.onClose != nil { - s.onClose() +} + +func (s *stream) error(err error) { + if s.errCh != nil { + select { + case s.errCh <- err: + case <-s.ctx.Done(): + } } } -// addCallCh adds a channel to the calls map. Incoming responses that match -// the id will be sent to the given channel. Because message ids are unique, -// the channel must be deleted after the response is received using delCallCh. -func (s *stream) addCallCh(id uint64, ch chan rpcResponse) { +var callChPool = sync.Pool{New: func() any { return make(chan rpcResponse) }} + +type streamChannels struct { + mu sync.RWMutex + + calls map[uint64]chan rpcResponse // Map of request IDs to channels. + subs map[string]chan json.RawMessage // Map of subscription IDs to channels. +} + +func newStreamChannels() *streamChannels { + return &streamChannels{ + calls: make(map[uint64]chan rpcResponse), + subs: make(map[string]chan json.RawMessage), + } +} + +func (s *streamChannels) addCallCh(id uint64) (chan rpcResponse, bool) { s.mu.Lock() defer s.mu.Unlock() + if s.calls == nil { + return nil, false + } + ch := callChPool.Get().(chan rpcResponse) s.calls[id] = ch + return ch, true } -// addSubCh adds a channel to the subs map. Incoming subscription -// notifications that match the id will be sent to the given channel. -func (s *stream) addSubCh(id string, ch chan json.RawMessage) { +func (s *streamChannels) addSubCh(id string, ch chan json.RawMessage) bool { s.mu.Lock() defer s.mu.Unlock() + if s.subs == nil { + return false + } s.subs[id] = ch + return true } -// delCallCh deletes a channel from the calls map. -func (s *stream) delCallCh(id uint64) bool { +func (s *streamChannels) delCallCh(id uint64) { s.mu.Lock() - defer s.mu.Unlock() - if ch, ok := s.calls[id]; ok { - close(ch) + ch, ok := s.calls[id] + if ok { delete(s.calls, id) - return true } - return false + s.mu.Unlock() + if ok { + callChPool.Put(ch) + } } -// delSubCh deletes a channel from the subs map. -func (s *stream) delSubCh(id string) bool { +func (s *streamChannels) delSubCh(id string) bool { s.mu.Lock() defer s.mu.Unlock() if ch, ok := s.subs[id]; ok { @@ -198,29 +263,37 @@ func (s *stream) delSubCh(id string) bool { return false } -// callChSend sends a response to the channel that matches the id. -func (s *stream) callChSend(id uint64, res rpcResponse) { +func (s *streamChannels) callChSend(ctx context.Context, id uint64, res rpcResponse) { s.mu.RLock() defer s.mu.RUnlock() if ch := s.calls[id]; ch != nil { select { case ch <- res: - case <-s.ctx.Done(): - return + case <-ctx.Done(): } } } -// subChSend sends a subscription notification to the channel that matches -// the id. -func (s *stream) subChSend(id string, res json.RawMessage) { +func (s *streamChannels) subChSend(ctx context.Context, id string, res json.RawMessage) { s.mu.RLock() defer s.mu.RUnlock() if ch := s.subs[id]; ch != nil { select { case ch <- res: - case <-s.ctx.Done(): - return + case <-ctx.Done(): } } } + +func (s *streamChannels) close() { + s.mu.Lock() + defer s.mu.Unlock() + for _, ch := range s.calls { + callChPool.Put(ch) + } + for _, ch := range s.subs { + close(ch) + } + s.calls = nil + s.subs = nil +} diff --git a/rpc/transport/websocket.go b/rpc/transport/websocket.go index bf27465..c9e05dd 100644 --- a/rpc/transport/websocket.go +++ b/rpc/transport/websocket.go @@ -2,19 +2,23 @@ package transport import ( "context" + "encoding/json" "errors" "fmt" "net/http" "time" - "nhooyr.io/websocket" - "nhooyr.io/websocket/wsjson" + "github.com/gorilla/websocket" ) +// defaultPingInterval is the default interval between WebSocket ping messages. +const defaultPingInterval = 30 * time.Second + // Websocket is a [Transport] implementation that uses the WebSocket protocol. type Websocket struct { - *stream + stream conn *websocket.Conn + ping time.Duration } // WebsocketOptions contains options for the [WebSocket] transport. @@ -25,7 +29,12 @@ type WebsocketOptions struct { // URL is the WebSocket endpoint. URL string - // HTTPClient is the HTTP client to use. If nil, http.DefaultClient is used. + // HTTPClient is an optional HTTP client used to configure the WebSocket + // handshake. Because the underlying WebSocket library does not accept an + // *http.Client directly, only a subset of its settings are applied: the + // client's cookie Jar, and—when its Transport is an *http.Transport—the + // Proxy, TLSClientConfig and DialContext settings. Other settings (custom + // RoundTrippers, redirect policy, the client Timeout, etc.) are ignored. HTTPClient *http.Client // HTTPHeader specifies the HTTP headers to include in the WebSocket @@ -33,7 +42,12 @@ type WebsocketOptions struct { HTTPHeader http.Header // Timeout is the timeout for WebSocket requests. The default is 60s. - Timout time.Duration + Timeout time.Duration + + // PingInterval is the interval between WebSocket ping messages used to + // keep the connection alive and detect dead peers. The default is 30s. + // A negative value disables pings. + PingInterval time.Duration // ErrorCh is an optional channel used to report errors. ErrorCh chan error @@ -47,70 +61,129 @@ func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { if opts.Context == nil { return nil, errors.New("context cannot be nil") } - if opts.Timout == 0 { - opts.Timout = 60 * time.Second + if opts.Timeout == 0 { + opts.Timeout = time.Minute + } + if opts.PingInterval == 0 { + opts.PingInterval = defaultPingInterval + } + dialer := websocket.Dialer{ + Proxy: http.ProxyFromEnvironment, + HandshakeTimeout: opts.Timeout, } - conn, _, err := websocket.Dial(opts.Context, opts.URL, &websocket.DialOptions{ //nolint:bodyclose - HTTPClient: opts.HTTPClient, - HTTPHeader: opts.HTTPHeader, - }) + if c := opts.HTTPClient; c != nil { + dialer.Jar = c.Jar + if t, ok := c.Transport.(*http.Transport); ok { + dialer.Proxy = t.Proxy + dialer.TLSClientConfig = t.TLSClientConfig + dialer.NetDialContext = t.DialContext + } + } + conn, _, err := dialer.DialContext(opts.Context, opts.URL, opts.HTTPHeader) if err != nil { return nil, fmt.Errorf("failed to dial websocket: %w", err) } - i := &Websocket{ - stream: &stream{ - ctx: opts.Context, - errCh: opts.ErrorCh, - timeout: opts.Timout, - }, + ws := &Websocket{ conn: conn, + ping: opts.PingInterval, + } + ws.stream.initStream(opts.Context, + withStreamErrorCh(opts.ErrorCh), + withStreamTimeout(opts.Timeout), + ) + if ws.ping > 0 { + ws.conn.SetPongHandler(func(string) error { + ws.resetReadDeadline() + return nil + }) + } + go ws.readerRoutine() + go ws.writerRoutine() + if ws.ping > 0 { + go ws.pingRoutine() } - i.onClose = i.close - i.stream.initStream() - go i.readerRoutine() - go i.writerRoutine() - return i, nil + return ws, nil } func (ws *Websocket) readerRoutine() { - // The background context is used here because closing the context will - // cause the nhooyr.io/websocket package to close the connection with a - // close code of 1008 (policy violation), which is not what we want. - ctx := context.Background() + ws.resetReadDeadline() for { - res := rpcResponse{} - if err := wsjson.Read(ctx, ws.conn, &res); err != nil { - if ws.ctx.Err() != nil || errors.As(err, &websocket.CloseError{}) { + _, msg, err := ws.conn.ReadMessage() + if err != nil { + if ws.ctx.Err() != nil { return } - if ws.errCh != nil { - ws.errCh <- fmt.Errorf("websocket reading error: %w", err) + if websocket.IsCloseError( + err, + websocket.CloseNormalClosure, + websocket.CloseGoingAway, + ) { + return } + ws.error(fmt.Errorf("websocket reading error: %w", err)) + return + } + ws.resetReadDeadline() + var res rpcResponse + if err := json.Unmarshal(msg, &res); err != nil { + ws.error(fmt.Errorf("websocket json error: %w", err)) continue } - ws.readerCh <- res + ws.read(res) } } func (ws *Websocket) writerRoutine() { + defer ws.close() + for { + req, ok := ws.write() + if !ok { + return + } + if err := ws.conn.SetWriteDeadline(time.Now().Add(ws.timeout)); err != nil { + ws.error(fmt.Errorf("websocket writing error: %w", err)) + continue + } + if err := ws.conn.WriteJSON(req); err != nil { + ws.error(fmt.Errorf("websocket writing error: %w", err)) + continue + } + } +} + +func (ws *Websocket) pingRoutine() { + t := time.NewTicker(ws.ping) + defer t.Stop() for { select { + case <-t.C: + if err := ws.conn.WriteControl(websocket.PingMessage, nil, time.Now().Add(ws.timeout)); err != nil { + ws.error(fmt.Errorf("websocket ping error: %w", err)) + return + } case <-ws.ctx.Done(): return - case req := <-ws.writerCh: - if err := wsjson.Write(ws.ctx, ws.conn, req); err != nil { - if ws.errCh != nil { - ws.errCh <- fmt.Errorf("websocket writing error: %w", err) - } - continue - } + } + } +} + +func (ws *Websocket) resetReadDeadline() { + if ws.ping > 0 { + if err := ws.conn.SetReadDeadline(time.Now().Add(2 * ws.ping)); err != nil { + ws.error(fmt.Errorf("websocket reset read deadline error: %w", err)) } } } func (ws *Websocket) close() { - err := ws.conn.Close(websocket.StatusNormalClosure, "") - if err != nil && ws.errCh != nil { - ws.errCh <- fmt.Errorf("websocket closing error: %w", err) + if err := ws.conn.SetWriteDeadline(time.Now().Add(time.Second)); err != nil { + ws.error(fmt.Errorf("websocket close error: %w", err)) + } + msg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "") + if err := ws.conn.WriteMessage(websocket.CloseMessage, msg); err != nil { + ws.error(fmt.Errorf("websocket close error: %w", err)) + } + if err := ws.conn.Close(); err != nil { + ws.error(fmt.Errorf("websocket close error: %w", err)) } } diff --git a/rpc/transport/websocket_test.go b/rpc/transport/websocket_test.go index 92618d0..8b9490c 100644 --- a/rpc/transport/websocket_test.go +++ b/rpc/transport/websocket_test.go @@ -11,14 +11,17 @@ import ( "testing" "time" + "github.com/gorilla/websocket" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "nhooyr.io/websocket" - "nhooyr.io/websocket/wsjson" "github.com/defiweb/go-eth/types" ) +var testUpgrader = websocket.Upgrader{ + CheckOrigin: func(r *http.Request) bool { return true }, +} + //nolint:funlen func TestWebsocket(t *testing.T) { tc := []struct { @@ -72,11 +75,7 @@ func TestWebsocket(t *testing.T) { ctx := context.Background() res := &types.Number{} - err := ws.Call( - ctx, - res, - "eth_call", - ) + err := ws.Call(ctx, res, "eth_call") assert.Error(t, err) }, }, @@ -128,13 +127,12 @@ func TestWebsocket(t *testing.T) { resCh := make(chan string) // Responses from server. closeCh := make(chan struct{}) // Stops the server. - // Websocket server. + // WebSocket server. server := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Handle websocket requests. - ctx := context.Background() - conn, err := websocket.Accept(w, r, nil) + conn, err := testUpgrader.Upgrade(w, r, nil) if err != nil { require.NoError(t, err) + return } // Request reader. @@ -142,46 +140,63 @@ func TestWebsocket(t *testing.T) { go func() { defer wg.Done() for { - var req json.RawMessage - if err := wsjson.Read(ctx, conn, &req); err != nil { - if errors.As(err, &websocket.CloseError{}) { + _, msg, err := conn.ReadMessage() + if err != nil { + if websocket.IsCloseError(err, + websocket.CloseNormalClosure, + websocket.CloseGoingAway, + ) { return } - require.NoError(t, err) + if !errors.Is(err, net.ErrClosed) { + require.NoError(t, err) + } + return } - reqCh <- string(req) + reqCh <- string(msg) } }() - // Response writer. + // Response writer. All writes to the connection, including the + // closing handshake, happen in this single goroutine, because + // gorilla does not allow concurrent writers. + writerDone := make(chan struct{}) wg.Add(1) go func() { defer wg.Done() + defer close(writerDone) for { select { case <-closeCh: + msg := websocket.FormatCloseMessage(websocket.CloseNormalClosure, "") + conn.WriteMessage(websocket.CloseMessage, msg) //nolint:errcheck return case res := <-resCh: - if err := wsjson.Write(ctx, conn, json.RawMessage(res)); err != nil { - if errors.As(err, &websocket.CloseError{}) { - return + if err := conn.WriteMessage( + websocket.TextMessage, + []byte(res), + ); err != nil { + if !websocket.IsCloseError(err, + websocket.CloseNormalClosure, + websocket.CloseGoingAway, + ) { + require.NoError(t, err) } - require.NoError(t, err) + return } } } }() - // Close the connection after the test. - <-closeCh - conn.Close(websocket.StatusNormalClosure, "") + // Close the connection after the writer goroutine has stopped, + // so that Close does not race with an in-flight write. + <-writerDone + conn.Close() //nolint:errcheck })} // Start HTTP server. ln, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - require.NoError(t, err) - } + require.NoError(t, err) wg.Add(1) go func() { defer wg.Done() @@ -192,13 +207,13 @@ func TestWebsocket(t *testing.T) { } }() - // Create a websocket client. + // Create a WebSocket client. ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) defer cancel() ws, err := NewWebsocket(WebsocketOptions{ Context: ctx, URL: "ws://" + ln.Addr().String(), - Timout: time.Second, + Timeout: time.Second, }) require.NoError(t, err) From d946d2a668105c3e196d38ff589c255733720231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sat, 25 Jul 2026 20:48:44 +0200 Subject: [PATCH 30/44] Fix bytes decoding --- abi/decode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abi/decode.go b/abi/decode.go index fc22988..51ed98b 100644 --- a/abi/decode.go +++ b/abi/decode.go @@ -172,7 +172,7 @@ func decodeBytes(b *[]byte, w Words) (int, error) { return 0, fmt.Errorf("abi: cannot decode bytes, size exceeds data length") } *b = w[1 : l+1].Bytes()[0:size] - return size + 1, nil + return l + 1, nil } // decodeFixedBytes decodes a fixed byte of the given size from the given words From b4fc0cd914cfd9e0403c9668f4cdec3bf75b99ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Sat, 25 Jul 2026 20:53:45 +0200 Subject: [PATCH 31/44] Allow events without inputs --- abi/error.go | 2 +- abi/sigparser.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/abi/error.go b/abi/error.go index 15eed0f..afc6a64 100644 --- a/abi/error.go +++ b/abi/error.go @@ -164,7 +164,7 @@ func (e *Error) ToError(data []byte) error { } // HandleError converts an error returned by a contract call to a custom error -// if possible. If provider error is nil, it returns nil. +// if possible. If the provided error is nil, it returns nil. func (e *Error) HandleError(err error) error { if err == nil { return nil diff --git a/abi/sigparser.go b/abi/sigparser.go index c591451..10e5ed1 100644 --- a/abi/sigparser.go +++ b/abi/sigparser.go @@ -113,9 +113,6 @@ func newErrorFromSig(abi *ABI, extraTypes map[string]Type, s sigparser.Signature // The extraTypes map is used to resolve types that are not part of the ABI. func newEventFromSig(abi *ABI, extraTypes map[string]Type, s sigparser.Signature) (*Event, error) { var in []EventTupleElem - if len(s.Inputs) == 0 { - return nil, fmt.Errorf("abi: event %q has no inputs", s.Name) - } for _, param := range s.Inputs { typ, err := newTypeFromSig(abi, extraTypes, param) if err != nil { From 8886ea758c77ff33380548cf2e89d51d2e51758d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 27 Jul 2026 00:29:56 +0200 Subject: [PATCH 32/44] Update crypto pkgs --- crypto/ecdsa/ecdsa.go | 75 +++++++++++----------- crypto/ecdsa/ecdsa_test.go | 18 +++--- crypto/keccak/keccak.go | 13 +++- crypto/txsign/txsign_test.go | 9 ++- go.mod | 14 ++--- go.sum | 118 +++++------------------------------ wallet/bip32.go | 96 ++++++++++++++++++++++++++++ wallet/key_hd.go | 24 ++++--- wallet/key_priv.go | 7 ++- 9 files changed, 197 insertions(+), 177 deletions(-) create mode 100644 wallet/bip32.go diff --git a/crypto/ecdsa/ecdsa.go b/crypto/ecdsa/ecdsa.go index aba0fe8..5422e0c 100644 --- a/crypto/ecdsa/ecdsa.go +++ b/crypto/ecdsa/ecdsa.go @@ -2,15 +2,12 @@ package ecdsa import ( - "crypto/ecdsa" - "crypto/elliptic" - "crypto/rand" "errors" "fmt" "math/big" - "github.com/btcsuite/btcd/btcec/v2" - btcececdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa" + "github.com/decred/dcrd/dcrec/secp256k1/v4" + secpecdsa "github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa" "github.com/defiweb/go-eth/crypto/keccak" ) @@ -45,8 +42,6 @@ type Hash [32]byte // For most use cases, the [types.Address] type should be used instead. type Address [20]byte -var s256 = btcec.S256() - // AddMessagePrefix adds the Ethereum message prefix to the given data as // defined in EIP-191. func AddMessagePrefix(data []byte) []byte { @@ -55,17 +50,22 @@ func AddMessagePrefix(data []byte) []byte { // GenerateKey generates a new ECDSA private key. func GenerateKey() (*PrivateKey, error) { - pk, err := ecdsa.GenerateKey(s256, rand.Reader) + pk, err := secp256k1.GeneratePrivateKey() if err != nil { return nil, fmt.Errorf("failed to generate ECDSA key: %w", err) } - return &PrivateKey{D: pk.D}, nil + return &PrivateKey{D: new(big.Int).SetBytes(pk.Serialize())}, nil } // PublicKeyToAddress returns the Ethereum address for the given ECDSA // public key. func PublicKeyToAddress(publicKey *PublicKey) (addr Address) { - h := keccak.Keccak256(elliptic.Marshal(s256, publicKey.X, publicKey.Y)[1:]) + // The address is the last 20 bytes of the Keccak-256 hash of the 64-byte + // public key: X and Y, each left-padded to 32 bytes. + var b [64]byte + publicKey.X.FillBytes(b[:32]) + publicKey.Y.FillBytes(b[32:]) + h := keccak.Keccak256(b[:]) copy(addr[:], h[12:]) return } @@ -76,12 +76,8 @@ func PrivateKeyToPublicKey(privateKey *PrivateKey) *PublicKey { if privateKey == nil { return nil } - privKey, _ := btcec.PrivKeyFromBytes(privateKey.D.Bytes()) - pubKey := privKey.PubKey() - return &PublicKey{ - X: pubKey.X(), - Y: pubKey.Y(), - } + priv := secp256k1.PrivKeyFromBytes(privateKey.D.Bytes()) + return newPublicKey(priv.PubKey()) } // SignHash signs the given hash with the given private key. @@ -89,16 +85,9 @@ func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { if privateKey == nil { return nil, fmt.Errorf("missing private key") } - privKey, _ := btcec.PrivKeyFromBytes(privateKey.D.Bytes()) - sig, err := btcececdsa.SignCompact(privKey, hash[:], false) - if err != nil { - return nil, err - } - v := sig[0] - switch v { - case 27, 28: - v -= 27 - } + priv := secp256k1.PrivKeyFromBytes(privateKey.D.Bytes()) + sig := secpecdsa.SignCompact(priv, hash[:], false) + v := sig[0] - 27 copy(sig, sig[1:]) sig[64] = v return &Signature{ @@ -120,10 +109,9 @@ func RecoverHash(hash Hash, signature Signature) (*Address, error) { if signature.S.BitLen() > 256 { return nil, errors.New("invalid signature: S has more than 256 bits") } - v := byte(signature.V.Uint64()) - switch v { - case 0, 1: - v += 27 + v, err := recoveryByte(byte(signature.V.Uint64())) + if err != nil { + return nil, err } rb := signature.R.Bytes() sb := signature.S.Bytes() @@ -131,14 +119,11 @@ func RecoverHash(hash Hash, signature Signature) (*Address, error) { bin[0] = v copy(bin[1+(32-len(rb)):], rb) copy(bin[33+(32-len(sb)):], sb) - pub, _, err := btcececdsa.RecoverCompact(bin, hash[:]) + pub, _, err := secpecdsa.RecoverCompact(bin, hash[:]) if err != nil { return nil, err } - addr := PublicKeyToAddress(&PublicKey{ - X: pub.X(), - Y: pub.Y(), - }) + addr := PublicKeyToAddress(newPublicKey(pub)) return &addr, nil } @@ -161,3 +146,23 @@ func RecoverMessage(data []byte, sig Signature) (*Address, error) { sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) return RecoverHash(Hash(keccak.Keccak256(AddMessagePrefix(data))), sig) } + +func newPublicKey(pub *secp256k1.PublicKey) *PublicKey { + // SerializeUncompressed returns 0x04 || X (32 bytes) || Y (32 bytes). + b := pub.SerializeUncompressed() + return &PublicKey{ + X: new(big.Int).SetBytes(b[1:33]), + Y: new(big.Int).SetBytes(b[33:65]), + } +} + +func recoveryByte(v byte) (byte, error) { + switch v { + case 0, 27: + return 27, nil + case 1, 28: + return 28, nil + default: + return 0, fmt.Errorf("invalid signature: V must be 0, 1, 27, or 28, got %d", v) + } +} diff --git a/crypto/ecdsa/ecdsa_test.go b/crypto/ecdsa/ecdsa_test.go index 0726578..afb3c69 100644 --- a/crypto/ecdsa/ecdsa_test.go +++ b/crypto/ecdsa/ecdsa_test.go @@ -2,20 +2,25 @@ package ecdsa import ( "bytes" + "math/big" "testing" - "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/hexutil" ) +// testPrivateKey returns a deterministic private key (32 bytes of 0x01) used +// across the tests. +func testPrivateKey() *PrivateKey { + return &PrivateKey{D: new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32))} +} + func TestSignHash(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) hash := Hash{} copy(hash[:], bytes.Repeat([]byte{0x02}, 32)) - signature, err := SignHash(&PrivateKey{D: key.ToECDSA().D}, hash) + signature, err := SignHash(testPrivateKey(), hash) require.NoError(t, err) require.NotNil(t, signature) @@ -25,8 +30,7 @@ func TestSignHash(t *testing.T) { } func TestSignMessage(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - signature, err := SignMessage(&PrivateKey{D: key.ToECDSA().D}, []byte("hello world")) + signature, err := SignMessage(testPrivateKey(), []byte("hello world")) require.NoError(t, err) require.NotNil(t, signature) @@ -64,9 +68,7 @@ func TestRecoverMessage(t *testing.T) { } func TestPublicKeyToAddress(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) - publicKey := key.PubKey() - addr := PublicKeyToAddress(&PublicKey{publicKey.X(), publicKey.Y()}) + addr := PublicKeyToAddress(PrivateKeyToPublicKey(testPrivateKey())) assert.Equal(t, "0x1a642f0e3c3af545e7acbd38b07251b3990914f1", hexutil.BytesToHex(addr[:])) } diff --git a/crypto/keccak/keccak.go b/crypto/keccak/keccak.go index 7c96523..b5b3088 100644 --- a/crypto/keccak/keccak.go +++ b/crypto/keccak/keccak.go @@ -2,6 +2,9 @@ package keccak import ( + "hash" + "sync" + "golang.org/x/crypto/sha3" ) @@ -12,10 +15,16 @@ type Hash [32]byte // Keccak256 calculates the Keccak256 hash of the given data. func Keccak256(data ...[]byte) (h Hash) { - k := sha3.NewLegacyKeccak256() + k := keccakPool.Get().(hash.Hash) + k.Reset() for _, i := range data { k.Write(i) } - copy(h[:], k.Sum(nil)) + k.Sum(h[:0]) + keccakPool.Put(k) return } + +var keccakPool = sync.Pool{ + New: func() any { return sha3.NewLegacyKeccak256() }, +} diff --git a/crypto/txsign/txsign_test.go b/crypto/txsign/txsign_test.go index 2aaae93..9fe68a6 100644 --- a/crypto/txsign/txsign_test.go +++ b/crypto/txsign/txsign_test.go @@ -5,7 +5,6 @@ import ( "math/big" "testing" - "github.com/btcsuite/btcd/btcec/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -16,7 +15,7 @@ import ( func TestSign(t *testing.T) { t.Run("legacy", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) + key := new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32)) tx := types.NewTransactionLegacy() tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) tx.SetGasLimit(21000) @@ -24,7 +23,7 @@ func TestSign(t *testing.T) { tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) + err := Sign(&ecdsa.PrivateKey{D: key}, tx) require.NoError(t, err) txData := tx.GetSigningData() require.NotNil(t, txData.Signature) @@ -33,7 +32,7 @@ func TestSign(t *testing.T) { assert.Equal(t, "615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537", txData.Signature.S.Text(16)) }) t.Run("dynamic-fee", func(t *testing.T) { - key, _ := btcec.PrivKeyFromBytes(bytes.Repeat([]byte{0x01}, 32)) + key := new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32)) tx := types.NewTransactionDynamicFee() tx.SetChainID(1) tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) @@ -43,7 +42,7 @@ func TestSign(t *testing.T) { tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - err := Sign(&ecdsa.PrivateKey{D: key.ToECDSA().D}, tx) + err := Sign(&ecdsa.PrivateKey{D: key}, tx) require.NoError(t, err) txData := tx.GetSigningData() require.NotNil(t, txData.Signature) diff --git a/go.mod b/go.mod index 6d6b2a1..5b572c4 100644 --- a/go.mod +++ b/go.mod @@ -2,33 +2,29 @@ module github.com/defiweb/go-eth retract v0.4.0 -go 1.18 +go 1.25.0 require ( - github.com/btcsuite/btcd v0.24.0 - github.com/btcsuite/btcd/btcec/v2 v2.3.2 - github.com/btcsuite/btcd/btcutil v1.1.5 github.com/crate-crypto/go-kzg-4844 v1.1.0 + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 github.com/defiweb/go-anymapper v0.3.0 github.com/defiweb/go-rlp v0.4.0 github.com/defiweb/go-sigparser v0.6.0 github.com/gorilla/websocket v1.5.3 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.11.1 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/crypto v0.18.0 + golang.org/x/crypto v0.54.0 ) require ( github.com/bits-and-blooms/bitset v1.7.0 // indirect - github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/consensys/bavard v0.1.13 // indirect github.com/consensys/gnark-crypto v0.13.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.16.0 // indirect + golang.org/x/sys v0.47.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index 13df787..4ca0452 100644 --- a/go.sum +++ b/go.sum @@ -1,146 +1,60 @@ -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= -github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= -github.com/btcsuite/btcd v0.23.5-0.20231215221805-96c9fd8078fd/go.mod h1:nm3Bko6zh6bWP60UxwoT5LzdGJsQJaPo6HjduXq9p6A= -github.com/btcsuite/btcd v0.24.0 h1:gL3uHE/IaFj6fcZSu03SvqPMSx7s/dPzfpG/atRwWdo= -github.com/btcsuite/btcd v0.24.0/go.mod h1:K4IDc1593s8jKXIF7yS7yCTSxrknB9z0STzc2j6XgE4= -github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= -github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= -github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= -github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= -github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8= -github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ= -github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= github.com/consensys/gnark-crypto v0.13.0 h1:VPULb/v6bbYELAPTDFINEVaMTTybV5GLxDdcjnS+4oc= github.com/consensys/gnark-crypto v0.13.0/go.mod h1:wKqwsieaKPThcFkHe0d0zMsbHEUWFmZcG7KBCse210o= github.com/crate-crypto/go-kzg-4844 v1.1.0 h1:EN/u9k2TF6OWSHrCCDBBU6GLNMq88OspHHlMnHfoyU4= github.com/crate-crypto/go-kzg-4844 v1.1.0/go.mod h1:JolLjpSff1tCCJKaJx4psrlEdlXuJEC996PL3tTAFks= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= -github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= -github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8= +github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1 h1:5RVFMOWjMyRy8cARdy79nAmgYw3hK/4HUq48LQ6Wwqo= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.1/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= github.com/defiweb/go-anymapper v0.3.0 h1:sWbTvhpdBaCHQGn+kuKYDnb+mPmeDNzzEXnC+CPhe6k= github.com/defiweb/go-anymapper v0.3.0/go.mod h1:EeQDyOsFd63Pt2uu9Yb8NFrChuZ9JBChjGKbDhRPHAQ= github.com/defiweb/go-rlp v0.4.0 h1:IheGseUX+kDlykSiADAWYo4J5kSaJPlBraLOfzAsSlI= github.com/defiweb/go-rlp v0.4.0/go.mod h1:nLGzk10jAgynPvN2hL+tLnnyZ5Fcshv0wmpWDRtV0PA= github.com/defiweb/go-sigparser v0.6.0 h1:HSNAZSUl8xyV+nKfWNKYVAPWLwTuASas6ohtarBbOT4= github.com/defiweb/go-sigparser v0.6.0/go.mod h1:R1wkfsnASR2M38ZupKHoqqIfv+8HgRbZaFQI9Inr4k8= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= -golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= diff --git a/wallet/bip32.go b/wallet/bip32.go new file mode 100644 index 0000000..ec7e298 --- /dev/null +++ b/wallet/bip32.go @@ -0,0 +1,96 @@ +package wallet + +import ( + "crypto/hmac" + "crypto/sha512" + "encoding/binary" + "errors" + + "github.com/decred/dcrd/dcrec/secp256k1/v4" +) + +// hardenedKeyStart is the index at and above which BIP-32 child derivation is +// hardened. +const hardenedKeyStart uint32 = 0x80000000 + +// bip32MasterKey is the HMAC key used to derive the BIP-32 master key from a +// seed, as defined by BIP-32. +var bip32MasterKey = []byte("Bitcoin seed") + +// hdKey is a minimal BIP-32 private extended key. It supports only private +// (CKDpriv) child derivation, which is all that is needed to derive Ethereum +// keys from a seed; it deliberately omits public derivation and the xprv/xpub +// serialization (and therefore any network parameters such as chaincfg). +// +// Reference: BIP-32 +// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki +type hdKey struct { + key [32]byte // secp256k1 private scalar, big-endian. + chainCode [32]byte +} + +// newMasterKey derives the BIP-32 master key from the given seed. +func newMasterKey(seed []byte) (*hdKey, error) { + // I = HMAC-SHA512(Key = "Bitcoin seed", Data = seed); IL is the master + // key and IR is the master chain code. + sum := hmacSHA512(bip32MasterKey, seed) + + // The master key must be a valid, non-zero secp256k1 scalar. + var scalar secp256k1.ModNScalar + if scalar.SetByteSlice(sum[:32]) { + return nil, errors.New("bip32: invalid master key (>= curve order)") + } + if scalar.IsZero() { + return nil, errors.New("bip32: invalid master key (zero)") + } + + k := &hdKey{} + copy(k.key[:], sum[:32]) + copy(k.chainCode[:], sum[32:]) + return k, nil +} + +// derive derives the child key for the given index (BIP-32 CKDpriv). Indices +// at or above hardenedKeyStart perform hardened derivation. +func (k *hdKey) derive(index uint32) (*hdKey, error) { + // Assemble the HMAC data. + data := make([]byte, 0, 37) + if index >= hardenedKeyStart { + // Hardened: 0x00 || ser256(k_par) || ser32(index). + data = append(data, 0x00) + data = append(data, k.key[:]...) + } else { + // Normal: serP(point(k_par)) || ser32(index), i.e. the compressed + // public key of the parent. + priv := secp256k1.PrivKeyFromBytes(k.key[:]) + data = append(data, priv.PubKey().SerializeCompressed()...) + } + var idx [4]byte + binary.BigEndian.PutUint32(idx[:], index) + data = append(data, idx[:]...) + + // I = HMAC-SHA512(Key = c_par, Data = data); split into IL and IR. + sum := hmacSHA512(k.chainCode[:], data) + + // child_key = (parse256(IL) + k_par) mod n. Per BIP-32 the key is invalid + // if IL >= n or the result is zero (probability ~2^-127). + var il, par secp256k1.ModNScalar + if il.SetByteSlice(sum[:32]) { + return nil, errors.New("bip32: invalid derived key (IL >= curve order)") + } + par.SetByteSlice(k.key[:]) + il.Add(&par) + if il.IsZero() { + return nil, errors.New("bip32: invalid derived key (zero)") + } + + child := &hdKey{key: il.Bytes()} + copy(child.chainCode[:], sum[32:]) + return child, nil +} + +func hmacSHA512(key, data []byte) []byte { + mac := hmac.New(sha512.New, key) + mac.Write(data) + return mac.Sum(nil) +} diff --git a/wallet/key_hd.go b/wallet/key_hd.go index 4200601..7fee86a 100644 --- a/wallet/key_hd.go +++ b/wallet/key_hd.go @@ -3,13 +3,12 @@ package wallet import ( "errors" "fmt" + "math/big" "strconv" - "github.com/btcsuite/btcd/chaincfg" - "github.com/defiweb/go-eth/crypto/ecdsa" - - "github.com/btcsuite/btcd/btcutil/hdkeychain" "github.com/tyler-smith/go-bip39" + + "github.com/defiweb/go-eth/crypto/ecdsa" ) // The code below is based on: @@ -21,7 +20,7 @@ type Mnemonic struct { // Internally, we only need a master key to derive private keys, but to // keep package API easier to understand, the whole structure is called // mnemonic because it is the name that users are familiar with. - masterKey *hdkeychain.ExtendedKey + masterKey *hdKey } // DerivationPath represents derivation path as internal binary format. @@ -96,28 +95,27 @@ func NewMnemonic(mnemonic, password string) (Mnemonic, error) { if err != nil { return Mnemonic{}, err } - masterKey, err := hdkeychain.NewMaster(seed, &chaincfg.MainNetParams) + masterKey, err := newMasterKey(seed) if err != nil { return Mnemonic{}, err } return Mnemonic{masterKey: masterKey}, nil } -// Derive derives a private key from the mnemonic using given derivation path. +// Derive derives a private key from the mnemonic using a given derivation path. func (m Mnemonic) Derive(path DerivationPath) (*PrivateKey, error) { + if m.masterKey == nil { + return nil, errors.New("mnemonic is not initialized") + } var err error key := m.masterKey for _, n := range path { - key, err = key.Derive(n) + key, err = key.derive(n) if err != nil { return nil, err } } - privKey, err := key.ECPrivKey() - if err != nil { - return nil, err - } - return NewKeyFromECDSA(&ecdsa.PrivateKey{D: privKey.ToECDSA().D}), nil + return NewKeyFromECDSA(&ecdsa.PrivateKey{D: new(big.Int).SetBytes(key.key[:])}), nil } // ParseDerivationPath converts a BIP-33 derivation path string into the diff --git a/wallet/key_priv.go b/wallet/key_priv.go index c0b945e..46d3bb8 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -3,8 +3,9 @@ package wallet import ( "context" "encoding/json" + "math/big" - "github.com/btcsuite/btcd/btcec/v2" + "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/crypto/ecdsa" @@ -30,8 +31,8 @@ func NewKeyFromECDSA(prv *ecdsa.PrivateKey) *PrivateKey { // NewKeyFromBytes creates a new private key from private key bytes. func NewKeyFromBytes(prv []byte) *PrivateKey { - key, _ := btcec.PrivKeyFromBytes(prv) - return NewKeyFromECDSA(&ecdsa.PrivateKey{D: key.ToECDSA().D}) + key := secp256k1.PrivKeyFromBytes(prv) + return NewKeyFromECDSA(&ecdsa.PrivateKey{D: new(big.Int).SetBytes(key.Serialize())}) } // NewRandomKey creates a random private key. From 3fc804b5ddf5a2d6d37685583a3b3ae04bb003ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 27 Jul 2026 02:05:41 +0200 Subject: [PATCH 33/44] Refactor crypto pkg --- crypto/crypto.go | 25 ++++ crypto/ecdsa/ecdsa.go | 89 +++++--------- crypto/ecdsa/ecdsa_test.go | 14 +-- crypto/keccak/keccak.go | 9 +- crypto/kzg4844/kzg4844.go | 45 +++---- crypto/kzg4844/kzg4844_test.go | 13 ++- crypto/primitives/primitives.go | 168 +++++++++++++++++++++++++++ crypto/primitives/primitives_test.go | 103 ++++++++++++++++ crypto/txsign/txsign.go | 11 +- crypto/txsign/txsign_test.go | 10 +- types/components.go | 8 +- types/components_test.go | 8 +- types/structs.go | 9 +- types/tx_blob.go | 7 +- types/tx_blob_test.go | 3 +- types/types.go | 9 +- wallet/key_hd.go | 5 +- wallet/key_json_v3.go | 8 +- wallet/key_priv.go | 25 ++-- wallet/key_rpc.go | 3 +- 20 files changed, 403 insertions(+), 169 deletions(-) create mode 100644 crypto/primitives/primitives.go create mode 100644 crypto/primitives/primitives_test.go diff --git a/crypto/crypto.go b/crypto/crypto.go index e40e334..7018e93 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -5,12 +5,37 @@ import ( "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/crypto/keccak" "github.com/defiweb/go-eth/crypto/kzg4844" + "github.com/defiweb/go-eth/crypto/primitives" +) + +const ( + PrivateKeySize = primitives.PrivateKeySize + PublicKeySize = primitives.PublicKeySize + KZGScalarsPerBlob = primitives.KZGScalarsPerBlob + KZGScalarSize = primitives.KZGScalarSize + KZGBlobSize = primitives.KZGBlobSize + KZGCommitmentSize = primitives.KZGCommitmentSize + KZGProofSize = primitives.KZGProofSize + KZGPointSize = primitives.KZGPointSize +) + +type ( + Hash = primitives.Hash + Address = primitives.Address + PublicKey = primitives.PublicKey + PrivateKey = primitives.PrivateKey + Signature = primitives.Signature + KZGBlob = primitives.KZGBlob + KZGCommitment = primitives.KZGCommitment + KZGProof = primitives.KZGProof + KZGPoint = primitives.KZGPoint ) // Default implementations of the crypto functions. Can be overridden to use // alternative implementations. var ( Keccak256 = keccak.Keccak256 + ECGenerateKey = ecdsa.GenerateKey ECPublicKeyToAddress = ecdsa.PublicKeyToAddress ECPrivateKeyToPublicKey = ecdsa.PrivateKeyToPublicKey ECSignHash = ecdsa.SignHash diff --git a/crypto/ecdsa/ecdsa.go b/crypto/ecdsa/ecdsa.go index 5422e0c..d5e21b0 100644 --- a/crypto/ecdsa/ecdsa.go +++ b/crypto/ecdsa/ecdsa.go @@ -10,38 +10,9 @@ import ( secpecdsa "github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa" "github.com/defiweb/go-eth/crypto/keccak" + "github.com/defiweb/go-eth/crypto/primitives" ) -// PublicKey is an ECDSA public key. -type PublicKey struct { - X *big.Int - Y *big.Int -} - -// PrivateKey is an ECDSA private key. -type PrivateKey struct { - D *big.Int -} - -// Signature is an ECDSA signature. -// -// For most use cases, the [types.Signature] type should be used instead. -type Signature struct { - V *big.Int - R *big.Int - S *big.Int -} - -// Hash is a 32-byte hash. -// -// For most use cases, the [types.Hash] type should be used instead. -type Hash [32]byte - -// Address is a 20-byte Ethereum address. -// -// For most use cases, the [types.Address] type should be used instead. -type Address [20]byte - // AddMessagePrefix adds the Ethereum message prefix to the given data as // defined in EIP-191. func AddMessagePrefix(data []byte) []byte { @@ -49,48 +20,48 @@ func AddMessagePrefix(data []byte) []byte { } // GenerateKey generates a new ECDSA private key. -func GenerateKey() (*PrivateKey, error) { +func GenerateKey() (primitives.PrivateKey, error) { pk, err := secp256k1.GeneratePrivateKey() if err != nil { - return nil, fmt.Errorf("failed to generate ECDSA key: %w", err) + return primitives.PrivateKey{}, fmt.Errorf("failed to generate ECDSA key: %w", err) } - return &PrivateKey{D: new(big.Int).SetBytes(pk.Serialize())}, nil + defer pk.Zero() + return primitives.PrivateKey(pk.Serialize()), nil } // PublicKeyToAddress returns the Ethereum address for the given ECDSA // public key. -func PublicKeyToAddress(publicKey *PublicKey) (addr Address) { +func PublicKeyToAddress(publicKey primitives.PublicKey) (addr primitives.Address) { // The address is the last 20 bytes of the Keccak-256 hash of the 64-byte // public key: X and Y, each left-padded to 32 bytes. - var b [64]byte - publicKey.X.FillBytes(b[:32]) - publicKey.Y.FillBytes(b[32:]) - h := keccak.Keccak256(b[:]) + h := keccak.Keccak256(publicKey[:]) copy(addr[:], h[12:]) return } // PrivateKeyToPublicKey converts a private key to a public key. -// If the private key is nil, it returns nil. -func PrivateKeyToPublicKey(privateKey *PrivateKey) *PublicKey { - if privateKey == nil { - return nil +// If the private key is the zero value, it returns the zero public key. +func PrivateKeyToPublicKey(privateKey primitives.PrivateKey) primitives.PublicKey { + if privateKey.IsZero() { + return primitives.PublicKey{} } - priv := secp256k1.PrivKeyFromBytes(privateKey.D.Bytes()) + priv := secp256k1.PrivKeyFromBytes(privateKey[:]) + defer priv.Zero() return newPublicKey(priv.PubKey()) } // SignHash signs the given hash with the given private key. -func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { - if privateKey == nil { - return nil, fmt.Errorf("missing private key") +func SignHash(privateKey primitives.PrivateKey, hash primitives.Hash) (*primitives.Signature, error) { + if privateKey.IsZero() { + return nil, fmt.Errorf("invalid private key") } - priv := secp256k1.PrivKeyFromBytes(privateKey.D.Bytes()) + priv := secp256k1.PrivKeyFromBytes(privateKey[:]) + defer priv.Zero() sig := secpecdsa.SignCompact(priv, hash[:], false) v := sig[0] - 27 copy(sig, sig[1:]) sig[64] = v - return &Signature{ + return &primitives.Signature{ V: new(big.Int).SetBytes(sig[64:]), R: new(big.Int).SetBytes(sig[:32]), S: new(big.Int).SetBytes(sig[32:64]), @@ -99,7 +70,7 @@ func SignHash(privateKey *PrivateKey, hash Hash) (*Signature, error) { // RecoverHash recovers the Ethereum address from the given hash and // signature. -func RecoverHash(hash Hash, signature Signature) (*Address, error) { +func RecoverHash(hash primitives.Hash, signature primitives.Signature) (*primitives.Address, error) { if signature.V.BitLen() > 8 { return nil, errors.New("invalid signature: V has more than 8 bits") } @@ -128,11 +99,11 @@ func RecoverHash(hash Hash, signature Signature) (*Address, error) { } // SignMessage signs the given message with the given private key. -func SignMessage(key *PrivateKey, data []byte) (*Signature, error) { - if key == nil { - return nil, fmt.Errorf("missing private key") +func SignMessage(key primitives.PrivateKey, data []byte) (*primitives.Signature, error) { + if key.IsZero() { + return nil, fmt.Errorf("invalid private key") } - sig, err := SignHash(key, Hash(keccak.Keccak256(AddMessagePrefix(data)))) + sig, err := SignHash(key, keccak.Keccak256(AddMessagePrefix(data))) if err != nil { return nil, err } @@ -142,18 +113,16 @@ func SignMessage(key *PrivateKey, data []byte) (*Signature, error) { // RecoverMessage recovers the Ethereum address from the given message and // signature. -func RecoverMessage(data []byte, sig Signature) (*Address, error) { +func RecoverMessage(data []byte, sig primitives.Signature) (*primitives.Address, error) { sig.V = new(big.Int).Sub(sig.V, big.NewInt(27)) - return RecoverHash(Hash(keccak.Keccak256(AddMessagePrefix(data))), sig) + return RecoverHash(keccak.Keccak256(AddMessagePrefix(data)), sig) } -func newPublicKey(pub *secp256k1.PublicKey) *PublicKey { +func newPublicKey(pub *secp256k1.PublicKey) (key primitives.PublicKey) { // SerializeUncompressed returns 0x04 || X (32 bytes) || Y (32 bytes). b := pub.SerializeUncompressed() - return &PublicKey{ - X: new(big.Int).SetBytes(b[1:33]), - Y: new(big.Int).SetBytes(b[33:65]), - } + copy(key[:], b[1:]) + return } func recoveryByte(v byte) (byte, error) { diff --git a/crypto/ecdsa/ecdsa_test.go b/crypto/ecdsa/ecdsa_test.go index afb3c69..462e40b 100644 --- a/crypto/ecdsa/ecdsa_test.go +++ b/crypto/ecdsa/ecdsa_test.go @@ -2,23 +2,23 @@ package ecdsa import ( "bytes" - "math/big" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/defiweb/go-eth/crypto/primitives" "github.com/defiweb/go-eth/hexutil" ) // testPrivateKey returns a deterministic private key (32 bytes of 0x01) used // across the tests. -func testPrivateKey() *PrivateKey { - return &PrivateKey{D: new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32))} +func testPrivateKey() primitives.PrivateKey { + return primitives.PrivateKey([32]byte(bytes.Repeat([]byte{0x01}, 32))) } func TestSignHash(t *testing.T) { - hash := Hash{} + hash := primitives.Hash{} copy(hash[:], bytes.Repeat([]byte{0x02}, 32)) signature, err := SignHash(testPrivateKey(), hash) @@ -40,9 +40,9 @@ func TestSignMessage(t *testing.T) { } func TestRecoverHash(t *testing.T) { - hash := Hash{} + hash := primitives.Hash{} copy(hash[:], bytes.Repeat([]byte{0x02}, 32)) - signature := Signature{ + signature := primitives.Signature{ V: hexutil.MustHexToBigInt("1b"), R: hexutil.MustHexToBigInt("97ef30233ead25d10f7bb2bf9eaf571a16f2deb33a75f20819284f0cb8ff3cc1"), S: hexutil.MustHexToBigInt("4870ca05940199c113b4dc77866f001702691cde269f6835581e7aea1ead2660"), @@ -55,7 +55,7 @@ func TestRecoverHash(t *testing.T) { } func TestRecoverMessage(t *testing.T) { - signature := Signature{ + signature := primitives.Signature{ V: hexutil.MustHexToBigInt("1b"), R: hexutil.MustHexToBigInt("f2b67e452d18ce781203f10380ea5a2726494162c49c495069cf99118bcf199"), S: hexutil.MustHexToBigInt("51601fe3219055482c45a14bf616c3e2bc7914c953f438627de2aa541eef61b5"), diff --git a/crypto/keccak/keccak.go b/crypto/keccak/keccak.go index b5b3088..50861d8 100644 --- a/crypto/keccak/keccak.go +++ b/crypto/keccak/keccak.go @@ -6,15 +6,12 @@ import ( "sync" "golang.org/x/crypto/sha3" -) -// Hash is a 32-byte Keccak256 hash. -// -// For most use cases, the [types.Hash] type should be used instead. -type Hash [32]byte + "github.com/defiweb/go-eth/crypto/primitives" +) // Keccak256 calculates the Keccak256 hash of the given data. -func Keccak256(data ...[]byte) (h Hash) { +func Keccak256(data ...[]byte) (h primitives.Hash) { k := keccakPool.Get().(hash.Hash) k.Reset() for _, i := range data { diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index 5fa6b96..780ddba 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -6,47 +6,28 @@ import ( "sync" kzg4844 "github.com/crate-crypto/go-kzg-4844" -) -const ( - ScalarLength = 4096 - ScalarSize = 32 - BlobLength = ScalarLength * ScalarSize // 128 KiB - CommitmentLength = 48 - ProofLength = 48 - PointLength = 32 + "github.com/defiweb/go-eth/crypto/primitives" ) // BLSModulus is the BLS12-381 scalar field modulus. var BLSModulus = new(big.Int).SetBytes(kzg4844.BlsModulus[:]) -// Blob represents a 4844 data blob. -type Blob [BlobLength]byte - -// Commitment is a serialized commitment to a polynomial. -type Commitment [CommitmentLength]byte - -// Proof is a serialized commitment to the quotient polynomial. -type Proof [ProofLength]byte - -// Point is a BLS field element. -type Point [PointLength]byte - // BlobToCommitment computes the KZG commitment for the given blob. -func BlobToCommitment(blob *Blob) (Commitment, error) { +func BlobToCommitment(blob *primitives.KZGBlob) (primitives.KZGCommitment, error) { initContext() commitment, err := context.BlobToKZGCommitment( (*kzg4844.Blob)(blob), 0, ) if err != nil { - return Commitment{}, err + return primitives.KZGCommitment{}, err } - return (Commitment)(commitment), nil + return (primitives.KZGCommitment)(commitment), nil } // ComputeProof computes the KZG proof and claim for the given blob and point. -func ComputeProof(blob *Blob, point Point) (Proof, Point, error) { +func ComputeProof(blob *primitives.KZGBlob, point primitives.KZGPoint) (primitives.KZGProof, primitives.KZGPoint, error) { initContext() proof, claim, err := context.ComputeKZGProof( (*kzg4844.Blob)(blob), @@ -54,14 +35,14 @@ func ComputeProof(blob *Blob, point Point) (Proof, Point, error) { 0, ) if err != nil { - return Proof{}, Point{}, err + return primitives.KZGProof{}, primitives.KZGPoint{}, err } - return (Proof)(proof), (Point)(claim), nil + return (primitives.KZGProof)(proof), (primitives.KZGPoint)(claim), nil } // VerifyProof verifies the KZG proof for the given commitment, point, claim, // and proof. -func VerifyProof(commitment Commitment, point Point, claim Point, proof Proof) error { +func VerifyProof(commitment primitives.KZGCommitment, point primitives.KZGPoint, claim primitives.KZGPoint, proof primitives.KZGProof) error { initContext() return context.VerifyKZGProof( (kzg4844.KZGCommitment)(commitment), @@ -72,7 +53,7 @@ func VerifyProof(commitment Commitment, point Point, claim Point, proof Proof) e } // ComputeBlobProof computes the KZG proof for the given blob and commitment. -func ComputeBlobProof(blob *Blob, commitment Commitment) (Proof, error) { +func ComputeBlobProof(blob *primitives.KZGBlob, commitment primitives.KZGCommitment) (primitives.KZGProof, error) { initContext() proof, err := context.ComputeBlobKZGProof( (*kzg4844.Blob)(blob), @@ -80,13 +61,13 @@ func ComputeBlobProof(blob *Blob, commitment Commitment) (Proof, error) { 0, ) if err != nil { - return Proof{}, err + return primitives.KZGProof{}, err } - return (Proof)(proof), nil + return (primitives.KZGProof)(proof), nil } // VerifyBlobProof verifies the KZG proof for the given blob, commitment, and proof. -func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error { +func VerifyBlobProof(blob *primitives.KZGBlob, commitment primitives.KZGCommitment, proof primitives.KZGProof) error { initContext() return context.VerifyBlobKZGProof( (*kzg4844.Blob)(blob), @@ -96,7 +77,7 @@ func VerifyBlobProof(blob *Blob, commitment Commitment, proof Proof) error { } // ComputeBlobHashV1 calculates the 'versioned blob hash' of a commitment. -func ComputeBlobHashV1(commit Commitment) (h [32]byte) { +func ComputeBlobHashV1(commit primitives.KZGCommitment) (h [32]byte) { k := sha256.New() k.Write(commit[:]) k.Sum(h[:0]) diff --git a/crypto/kzg4844/kzg4844_test.go b/crypto/kzg4844/kzg4844_test.go index d564cfd..fd18a8a 100644 --- a/crypto/kzg4844/kzg4844_test.go +++ b/crypto/kzg4844/kzg4844_test.go @@ -6,23 +6,24 @@ import ( "math/big" "testing" + "github.com/defiweb/go-eth/crypto/primitives" "github.com/defiweb/go-eth/hexutil" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func getRandBlob(seed int64) *Blob { - blob := Blob{} - for i := 0; i < BlobLength; i += ScalarSize { +func getRandBlob(seed int64) *primitives.KZGBlob { + blob := primitives.KZGBlob{} + for i := 0; i < primitives.KZGBlobSize; i += primitives.KZGScalarSize { h := sha256.Sum256([]byte{byte(seed + int64(i))}) p := new(big.Int).SetBytes(h[:]) p = p.Mod(p, BLSModulus) - p.FillBytes(blob[i : i+ScalarSize]) + p.FillBytes(blob[i : i+primitives.KZGScalarSize]) } return &blob } -func getPoint(blob *Blob) (p Point) { +func getPoint(blob *primitives.KZGBlob) (p primitives.KZGPoint) { h := sha256.Sum256(blob[:]) i := new(big.Int).SetBytes(h[:]) i = i.Mod(i, BLSModulus) @@ -83,7 +84,7 @@ func TestComputeBlobHashV1(t *testing.T) { } for _, tt := range tc { t.Run(tt.name, func(t *testing.T) { - var commitment Commitment + var commitment primitives.KZGCommitment copy(commitment[:], hexutil.MustHexToBytes(tt.commitment)) hash := ComputeBlobHashV1(commitment) diff --git a/crypto/primitives/primitives.go b/crypto/primitives/primitives.go new file mode 100644 index 0000000..a820206 --- /dev/null +++ b/crypto/primitives/primitives.go @@ -0,0 +1,168 @@ +// Package primitives provides the basic data types used by the cryptographic +// functions in the crypto package and its implementation packages. +// +// DO NOT USE THIS PACKAGE DIRECTLY. Use the crypto package instead. +// +// This package is intended to be used by implementations of the functions in +// the crypto package. +package primitives + +import ( + "errors" + "math/big" +) + +const ( + // HashSize is the size of a hash in bytes. + HashSize = 32 + + // AddressSize is the size of an Ethereum address in bytes. + AddressSize = 20 + // PrivateKeySize is the size of an ECDSA private key in bytes. + + PrivateKeySize = 32 + // PublicKeySize is the size of an ECDSA public key in bytes. + + PublicKeySize = 64 + + // KZGScalarsPerBlob is the number of field elements in a blob. + KZGScalarsPerBlob = 4096 + + // KZGScalarSize is the size of a single field element in bytes. + KZGScalarSize = 32 + + // KZGBlobSize is the size of a blob in bytes. + KZGBlobSize = KZGScalarsPerBlob * KZGScalarSize // 128 KiB + + // KZGCommitmentSize is the size of a KZG commitment in bytes. + KZGCommitmentSize = 48 + + // KZGProofSize is the size of a KZG proof in bytes. + KZGProofSize = 48 + + // KZGPointSize is the size of a BLS field element in bytes. + KZGPointSize = 32 +) + +// Hash is a 32-byte hash. +type Hash [HashSize]byte + +// Address is a 20-byte Ethereum address. +type Address [AddressSize]byte + +// PrivateKey is an ECDSA private key, stored as a big-endian 32-byte scalar. +type PrivateKey [PrivateKeySize]byte + +// PublicKey is an ECDSA public key, stored as the 64-byte uncompressed +// representation: the X and Y coordinates, each big-endian and left-padded to +// 32 bytes, without the 0x04 prefix. +type PublicKey [PublicKeySize]byte + +// Signature is an ECDSA signature. +type Signature struct { + V *big.Int + R *big.Int + S *big.Int +} + +// KZGBlob represents a 4844 data blob. +type KZGBlob [KZGBlobSize]byte + +// KZGCommitment is a serialized commitment to a polynomial. +type KZGCommitment [KZGCommitmentSize]byte + +// KZGProof is a serialized commitment to the quotient polynomial. +type KZGProof [KZGProofSize]byte + +// KZGPoint is a BLS field element. +type KZGPoint [KZGPointSize]byte + +// errNoDisclose is returned by the marshalers of PrivateKey to prevent the +// key material from being serialized by accident. +var errNoDisclose = errors.New("crypto: refusing to serialize a private key") + +// IsZero reports whether the key is the zero value, which is not a valid key. +func (k PrivateKey) IsZero() bool { + return k == PrivateKey{} +} + +// Bytes returns a copy of the key as a byte slice. +func (k PrivateKey) Bytes() []byte { + b := make([]byte, PrivateKeySize) + copy(b, k[:]) + return b +} + +// Scalar returns the key as a big integer. +func (k PrivateKey) Scalar() *big.Int { + return new(big.Int).SetBytes(k[:]) +} + +// PrivateKeyFromScalar returns the private key for the given big integer. +// +// It returns false if the integer does not fit in 32 bytes. +func PrivateKeyFromScalar(d *big.Int) (k PrivateKey, ok bool) { + if d == nil || d.Sign() < 0 || d.BitLen() > PrivateKeySize*8 { + return PrivateKey{}, false + } + d.FillBytes(k[:]) + return k, true +} + +// Zero wipes the key material. +func (k *PrivateKey) Zero() { + clear(k[:]) +} + +// String implements the [fmt.Stringer] interface. +// +// It does not disclose the key material. +func (k PrivateKey) String() string { + return "PrivateKey(redacted)" +} + +// GoString implements the [fmt.GoStringer] interface. +// +// It does not disclose the key material. +func (k PrivateKey) GoString() string { + return "PrivateKey(redacted)" +} + +// MarshalText implements the [encoding.TextMarshaler] interface. +// +// It always returns an error, to prevent the key material from being +// serialized by accident. +func (k PrivateKey) MarshalText() ([]byte, error) { + return nil, errNoDisclose +} + +// MarshalJSON implements the [json.Marshaler] interface. +// +// It always returns an error, to prevent the key material from being +// serialized by accident. +func (k PrivateKey) MarshalJSON() ([]byte, error) { + return nil, errNoDisclose +} + +// IsZero reports whether the key is the zero value, which is not a valid key. +func (k PublicKey) IsZero() bool { + return k == PublicKey{} +} + +// Bytes returns a copy of the key as a byte slice, in the 64-byte +// uncompressed representation without the 0x04 prefix. +func (k PublicKey) Bytes() []byte { + b := make([]byte, PublicKeySize) + copy(b, k[:]) + return b +} + +// X returns the X coordinate of the key. +func (k PublicKey) X() *big.Int { + return new(big.Int).SetBytes(k[:32]) +} + +// Y returns the Y coordinate of the key. +func (k PublicKey) Y() *big.Int { + return new(big.Int).SetBytes(k[32:]) +} diff --git a/crypto/primitives/primitives_test.go b/crypto/primitives/primitives_test.go new file mode 100644 index 0000000..75e0781 --- /dev/null +++ b/crypto/primitives/primitives_test.go @@ -0,0 +1,103 @@ +package primitives + +import ( + "encoding/json" + "fmt" + "math/big" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestPrivateKey_IsZero(t *testing.T) { + assert.True(t, PrivateKey{}.IsZero()) + assert.False(t, PrivateKey{31: 1}.IsZero()) +} + +func TestPrivateKey_Zero(t *testing.T) { + k := PrivateKey{0: 1, 31: 2} + k.Zero() + assert.True(t, k.IsZero()) +} + +func TestPrivateKey_Bytes(t *testing.T) { + k := PrivateKey{0: 1, 31: 2} + b := k.Bytes() + require.Len(t, b, PrivateKeySize) + assert.Equal(t, k[:], b) + + // The returned slice must not alias the key. + b[0] = 0xff + assert.Equal(t, byte(1), k[0]) +} + +func TestPrivateKey_Scalar(t *testing.T) { + k := PrivateKey{31: 5} + assert.Equal(t, int64(5), k.Scalar().Int64()) +} + +func TestPrivateKeyFromScalar(t *testing.T) { + t.Run("valid", func(t *testing.T) { + k, ok := PrivateKeyFromScalar(big.NewInt(5)) + require.True(t, ok) + assert.Equal(t, PrivateKey{31: 5}, k) + }) + t.Run("nil", func(t *testing.T) { + _, ok := PrivateKeyFromScalar(nil) + assert.False(t, ok) + }) + t.Run("negative", func(t *testing.T) { + _, ok := PrivateKeyFromScalar(big.NewInt(-1)) + assert.False(t, ok) + }) + t.Run("too-large", func(t *testing.T) { + _, ok := PrivateKeyFromScalar(new(big.Int).Lsh(big.NewInt(1), 256)) + assert.False(t, ok) + }) +} + +// TestPrivateKey_NoDisclose verifies that the key material is not disclosed by +// the formatting and marshaling methods. +func TestPrivateKey_NoDisclose(t *testing.T) { + k := PrivateKey{0: 0xde, 1: 0xad, 30: 0xbe, 31: 0xef} + + assert.Equal(t, "PrivateKey(redacted)", k.String()) + assert.NotContains(t, fmt.Sprintf("%v", k), "de") + assert.NotContains(t, fmt.Sprintf("%s", k), "de") + assert.NotContains(t, fmt.Sprintf("%#v", k), "de") + + _, err := k.MarshalText() + assert.Error(t, err) + + _, err = k.MarshalJSON() + assert.Error(t, err) + + _, err = json.Marshal(k) + assert.Error(t, err) + + _, err = json.Marshal(struct{ Key PrivateKey }{k}) + assert.Error(t, err) +} + +func TestPublicKey_IsZero(t *testing.T) { + assert.True(t, PublicKey{}.IsZero()) + assert.False(t, PublicKey{63: 1}.IsZero()) +} + +func TestPublicKey_Bytes(t *testing.T) { + k := PublicKey{0: 1, 63: 2} + b := k.Bytes() + require.Len(t, b, PublicKeySize) + assert.Equal(t, k[:], b) + + // The returned slice must not alias the key. + b[0] = 0xff + assert.Equal(t, byte(1), k[0]) +} + +func TestPublicKey_XY(t *testing.T) { + k := PublicKey{31: 7, 63: 9} + assert.Equal(t, int64(7), k.X().Int64()) + assert.Equal(t, int64(9), k.Y().Int64()) +} diff --git a/crypto/txsign/txsign.go b/crypto/txsign/txsign.go index 3d27426..4f31e49 100644 --- a/crypto/txsign/txsign.go +++ b/crypto/txsign/txsign.go @@ -7,14 +7,13 @@ import ( "math/big" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/types" ) // Sign signs the given transaction with the given private key. -func Sign(key *ecdsa.PrivateKey, tx types.SignableTransaction) error { - if key == nil { - return fmt.Errorf("missing private key") +func Sign(key crypto.PrivateKey, tx types.SignableTransaction) error { + if key.IsZero() { + return fmt.Errorf("invalid private key") } if tx == nil { return fmt.Errorf("missing transaction") @@ -25,7 +24,7 @@ func Sign(key *ecdsa.PrivateKey, tx types.SignableTransaction) error { if err != nil { return err } - sig, err := crypto.ECSignHash(key, ecdsa.Hash(hash)) + sig, err := crypto.ECSignHash(key, crypto.Hash(hash)) if err != nil { return err } @@ -73,7 +72,7 @@ func Recover(tx types.SignableTransaction) (*types.Address, error) { if err != nil { return nil, err } - addr, err := crypto.ECRecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) + addr, err := crypto.ECRecoverHash(crypto.Hash(hash), crypto.Signature(sig)) if err != nil { return nil, err } diff --git a/crypto/txsign/txsign_test.go b/crypto/txsign/txsign_test.go index 9fe68a6..210451f 100644 --- a/crypto/txsign/txsign_test.go +++ b/crypto/txsign/txsign_test.go @@ -8,14 +8,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/crypto" "github.com/defiweb/go-eth/hexutil" "github.com/defiweb/go-eth/types" ) func TestSign(t *testing.T) { t.Run("legacy", func(t *testing.T) { - key := new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32)) + key := crypto.PrivateKey([32]byte(bytes.Repeat([]byte{0x01}, 32))) tx := types.NewTransactionLegacy() tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) tx.SetGasLimit(21000) @@ -23,7 +23,7 @@ func TestSign(t *testing.T) { tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - err := Sign(&ecdsa.PrivateKey{D: key}, tx) + err := Sign(key, tx) require.NoError(t, err) txData := tx.GetSigningData() require.NotNil(t, txData.Signature) @@ -32,7 +32,7 @@ func TestSign(t *testing.T) { assert.Equal(t, "615bff48c483d368ed4f6e327a6ddd8831e544d0ca08f1345433e4ed204f8537", txData.Signature.S.Text(16)) }) t.Run("dynamic-fee", func(t *testing.T) { - key := new(big.Int).SetBytes(bytes.Repeat([]byte{0x01}, 32)) + key := crypto.PrivateKey([32]byte(bytes.Repeat([]byte{0x01}, 32))) tx := types.NewTransactionDynamicFee() tx.SetChainID(1) tx.SetTo(types.MustAddressFromHex("0x3535353535353535353535353535353535353535")) @@ -42,7 +42,7 @@ func TestSign(t *testing.T) { tx.SetNonce(9) tx.SetValue(big.NewInt(1000000000000000000)) - err := Sign(&ecdsa.PrivateKey{D: key}, tx) + err := Sign(key, tx) require.NoError(t, err) txData := tx.GetSigningData() require.NotNil(t, txData.Signature) diff --git a/types/components.go b/types/components.go index 1f2d09e..e633961 100644 --- a/types/components.go +++ b/types/components.go @@ -3,7 +3,7 @@ package types import ( "math/big" - "github.com/defiweb/go-eth/crypto/kzg4844" + "github.com/defiweb/go-eth/crypto" ) // The following interfaces are used to determine if a given call or @@ -523,9 +523,9 @@ func (c *BlobData) fromJSON(j *jsonCall) { b := BlobInfo{Hash: h} if i < len(j.Blobs) && i < len(j.Commitments) && i < len(j.Proofs) { b.Sidecar = &BlobSidecar{ - Blob: kzg4844.Blob(j.Blobs[i]), - Commitment: kzg4844.Commitment(j.Commitments[i]), - Proof: kzg4844.Proof(j.Proofs[i]), + Blob: crypto.KZGBlob(j.Blobs[i]), + Commitment: crypto.KZGCommitment(j.Commitments[i]), + Proof: crypto.KZGProof(j.Proofs[i]), } } c.Blobs[i] = b diff --git a/types/components_test.go b/types/components_test.go index 3129ff1..c08e415 100644 --- a/types/components_test.go +++ b/types/components_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/defiweb/go-eth/crypto/kzg4844" + "github.com/defiweb/go-eth/crypto" ) func TestTransactionData_JSON(t *testing.T) { @@ -498,9 +498,9 @@ func TestBlobData_JSON(t *testing.T) { { Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), Sidecar: &BlobSidecar{ - Blob: kzg4844.Blob{0x01, 0x02, 0x03}, - Commitment: kzg4844.Commitment{0x04, 0x05, 0x06}, - Proof: kzg4844.Proof{0x07, 0x08, 0x09}, + Blob: crypto.KZGBlob{0x01, 0x02, 0x03}, + Commitment: crypto.KZGCommitment{0x04, 0x05, 0x06}, + Proof: crypto.KZGProof{0x07, 0x08, 0x09}, }, }, }, diff --git a/types/structs.go b/types/structs.go index e5f2b4b..0f9141d 100644 --- a/types/structs.go +++ b/types/structs.go @@ -11,7 +11,6 @@ import ( "github.com/defiweb/go-rlp" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/kzg4844" ) // AccessList represents an Ethereum access list as defined in EIP-2930. @@ -144,13 +143,13 @@ type BlobInfo struct { // layer. type BlobSidecar struct { // Blob is the blob data. - Blob kzg4844.Blob + Blob crypto.KZGBlob // Commitment is the KZG commitment for the blob. - Commitment kzg4844.Commitment + Commitment crypto.KZGCommitment // Proof is the KZG proof for the blob. - Proof kzg4844.Proof + Proof crypto.KZGProof } // ComputeHash computes the blob hash of the given blob sidecar. @@ -170,7 +169,7 @@ func (sc *BlobSidecar) ComputeHash() Hash { // // Returns an error if the blob is nil or if the commitment/proof computation // fails. -func NewBlobInfo(b *kzg4844.Blob) (BlobInfo, error) { +func NewBlobInfo(b *crypto.KZGBlob) (BlobInfo, error) { if b == nil { return BlobInfo{}, errors.New("blob is nil") } diff --git a/types/tx_blob.go b/types/tx_blob.go index 3627ba2..57fa389 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -7,7 +7,6 @@ import ( "github.com/defiweb/go-rlp" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/kzg4844" ) // TransactionBlob is the blob transaction type (Type 3). @@ -342,9 +341,9 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { blob := BlobInfo{Hash: *hash} if i < len(*blobs) && i < len(*commitments) && i < len(*proofs) { blob.Sidecar = &BlobSidecar{ - Blob: kzg4844.Blob(*(*blobs)[i]), - Commitment: kzg4844.Commitment(*(*commitments)[i]), - Proof: kzg4844.Proof(*(*proofs)[i]), + Blob: crypto.KZGBlob(*(*blobs)[i]), + Commitment: crypto.KZGCommitment(*(*commitments)[i]), + Proof: crypto.KZGProof(*(*proofs)[i]), } } t.Blobs[i] = blob diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index 60c0e64..1b82913 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -9,7 +9,6 @@ import ( "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/kzg4844" "github.com/defiweb/go-eth/hexutil" ) @@ -436,7 +435,7 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { } func newBlob(data string) BlobInfo { - d := new(kzg4844.Blob) + d := new(crypto.KZGBlob) copy(d[:], data) b, err := NewBlobInfo(d) if err != nil { diff --git a/types/types.go b/types/types.go index 5744251..2c73f1a 100644 --- a/types/types.go +++ b/types/types.go @@ -9,7 +9,6 @@ import ( "github.com/defiweb/go-rlp" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/kzg4844" "github.com/defiweb/go-eth/hexutil" ) @@ -679,6 +678,8 @@ type Signature struct { S *big.Int } +var _ = crypto.Signature(Signature{}) + // SignatureFromHex parses a hex string into a Signature. // Hex representation of the signature is hex([R || S || V]). func SignatureFromHex(h string) (Signature, error) { @@ -1164,7 +1165,7 @@ func (l *oneOrList[T]) UnmarshalJSON(input []byte) error { } // kzgBlob is a fixed-length byte array used for KZG blob. -type kzgBlob [kzg4844.BlobLength]byte +type kzgBlob [crypto.KZGBlobSize]byte func (t kzgBlob) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil @@ -1183,7 +1184,7 @@ func (t *kzgBlob) DecodeRLP(data []byte) (int, error) { } // kzgCommitment is a fixed-length byte array used for KZG commitment. -type kzgCommitment [kzg4844.CommitmentLength]byte +type kzgCommitment [crypto.KZGCommitmentSize]byte func (t kzgCommitment) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil @@ -1202,7 +1203,7 @@ func (t *kzgCommitment) DecodeRLP(data []byte) (int, error) { } // kzgProof is a fixed-length byte array used for KZG proof. -type kzgProof [kzg4844.ProofLength]byte +type kzgProof [crypto.KZGProofSize]byte func (t kzgProof) MarshalJSON() ([]byte, error) { return bytesMarshalJSON(t[:]), nil diff --git a/wallet/key_hd.go b/wallet/key_hd.go index 7fee86a..919480d 100644 --- a/wallet/key_hd.go +++ b/wallet/key_hd.go @@ -3,12 +3,11 @@ package wallet import ( "errors" "fmt" - "math/big" "strconv" "github.com/tyler-smith/go-bip39" - "github.com/defiweb/go-eth/crypto/ecdsa" + "github.com/defiweb/go-eth/crypto" ) // The code below is based on: @@ -115,7 +114,7 @@ func (m Mnemonic) Derive(path DerivationPath) (*PrivateKey, error) { return nil, err } } - return NewKeyFromECDSA(&ecdsa.PrivateKey{D: new(big.Int).SetBytes(key.key[:])}), nil + return NewKeyFromECDSA(crypto.PrivateKey(key.key)), nil } // ParseDerivationPath converts a BIP-33 derivation path string into the diff --git a/wallet/key_json_v3.go b/wallet/key_json_v3.go index 2baa0c3..cd1aa44 100644 --- a/wallet/key_json_v3.go +++ b/wallet/key_json_v3.go @@ -14,7 +14,6 @@ import ( "golang.org/x/crypto/scrypt" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/types" ) @@ -30,7 +29,7 @@ const ( scryptDKLen = 32 ) -func encryptV3Key(key *ecdsa.PrivateKey, passphrase string, scryptN, scryptP int) (*jsonKey, error) { +func encryptV3Key(key crypto.PrivateKey, passphrase string, scryptN, scryptP int) (*jsonKey, error) { // Generate a random salt. salt := make([]byte, 32) if _, err := rand.Read(salt); err != nil { @@ -50,10 +49,7 @@ func encryptV3Key(key *ecdsa.PrivateKey, passphrase string, scryptN, scryptP int } // Encrypt the key with AES-128-CTR. - d := key.D.Bytes() - data := make([]byte, 32) - copy(data[32-len(d):], d) - cipherText, err := aesCTRXOR(derivedKey[:16], data, iv) + cipherText, err := aesCTRXOR(derivedKey[:16], key.Bytes(), iv) if err != nil { return nil, err } diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 46d3bb8..00bf93e 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -3,24 +3,22 @@ package wallet import ( "context" "encoding/json" - "math/big" "github.com/decred/dcrd/dcrec/secp256k1/v4" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/crypto/txsign" "github.com/defiweb/go-eth/types" ) type PrivateKey struct { - private *ecdsa.PrivateKey - public *ecdsa.PublicKey + private crypto.PrivateKey + public crypto.PublicKey address types.Address } -// NewKeyFromECDSA creates a new private key from an ecdsa.PrivateKey. -func NewKeyFromECDSA(prv *ecdsa.PrivateKey) *PrivateKey { +// NewKeyFromECDSA creates a new private key from a [crypto.PrivateKey]. +func NewKeyFromECDSA(prv crypto.PrivateKey) *PrivateKey { pub := crypto.ECPrivateKeyToPublicKey(prv) return &PrivateKey{ private: prv, @@ -32,12 +30,13 @@ func NewKeyFromECDSA(prv *ecdsa.PrivateKey) *PrivateKey { // NewKeyFromBytes creates a new private key from private key bytes. func NewKeyFromBytes(prv []byte) *PrivateKey { key := secp256k1.PrivKeyFromBytes(prv) - return NewKeyFromECDSA(&ecdsa.PrivateKey{D: new(big.Int).SetBytes(key.Serialize())}) + defer key.Zero() + return NewKeyFromECDSA(crypto.PrivateKey(key.Serialize())) } // NewRandomKey creates a random private key. func NewRandomKey() *PrivateKey { - key, err := ecdsa.GenerateKey() + key, err := crypto.ECGenerateKey() if err != nil { panic(err) } @@ -45,12 +44,12 @@ func NewRandomKey() *PrivateKey { } // PublicKey returns the ECDSA public key. -func (k *PrivateKey) PublicKey() *ecdsa.PublicKey { +func (k *PrivateKey) PublicKey() crypto.PublicKey { return k.public } // PrivateKey returns the ECDSA private key. -func (k *PrivateKey) PrivateKey() *ecdsa.PrivateKey { +func (k *PrivateKey) PrivateKey() crypto.PrivateKey { return k.private } @@ -70,7 +69,7 @@ func (k *PrivateKey) Address() types.Address { // SignHash implements the KeyWithHashSigner interface. func (k *PrivateKey) SignHash(_ context.Context, hash types.Hash) (*types.Signature, error) { - s, err := crypto.ECSignHash(k.private, ecdsa.Hash(hash)) + s, err := crypto.ECSignHash(k.private, crypto.Hash(hash)) if err != nil { return nil, err } @@ -93,7 +92,7 @@ func (k *PrivateKey) SignTransaction(_ context.Context, tx types.SignableTransac // VerifyHash implements the KeyWithHashSigner interface. func (k *PrivateKey) VerifyHash(_ context.Context, hash types.Hash, sig types.Signature) bool { - addr, err := crypto.ECRecoverHash(ecdsa.Hash(hash), ecdsa.Signature(sig)) + addr, err := crypto.ECRecoverHash(crypto.Hash(hash), crypto.Signature(sig)) if err != nil { return false } @@ -102,7 +101,7 @@ func (k *PrivateKey) VerifyHash(_ context.Context, hash types.Hash, sig types.Si // VerifyMessage implements the Key interface. func (k *PrivateKey) VerifyMessage(_ context.Context, data []byte, sig types.Signature) bool { - addr, err := crypto.ECRecoverMessage(data, ecdsa.Signature(sig)) + addr, err := crypto.ECRecoverMessage(data, crypto.Signature(sig)) if err != nil { return false } diff --git a/wallet/key_rpc.go b/wallet/key_rpc.go index 660c75a..07d5873 100644 --- a/wallet/key_rpc.go +++ b/wallet/key_rpc.go @@ -5,7 +5,6 @@ import ( "fmt" "github.com/defiweb/go-eth/crypto" - "github.com/defiweb/go-eth/crypto/ecdsa" "github.com/defiweb/go-eth/crypto/txsign" "github.com/defiweb/go-eth/types" ) @@ -70,7 +69,7 @@ func (k *KeyRPC) SignTransaction(ctx context.Context, tx types.SignableTransacti // VerifyMessage implements the Key interface. func (k *KeyRPC) VerifyMessage(_ context.Context, data []byte, sig types.Signature) bool { - addr, err := crypto.ECRecoverMessage(data, ecdsa.Signature(sig)) + addr, err := crypto.ECRecoverMessage(data, crypto.Signature(sig)) if err != nil { return false } From 14b271ba6a1f3b3a73fc723074dff6b45585ae21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 27 Jul 2026 02:05:53 +0200 Subject: [PATCH 34/44] Fix hexutil tests --- hexutil/hexutil_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hexutil/hexutil_test.go b/hexutil/hexutil_test.go index a2ddbf8..74ff884 100644 --- a/hexutil/hexutil_test.go +++ b/hexutil/hexutil_test.go @@ -48,7 +48,7 @@ func TestHexToBigInt(t *testing.T) { t.Run(tt.name, func(t *testing.T) { result, err := HexToBigInt(tt.input) assert.Equal(t, tt.err, err) - assert.Equal(t, tt.expected, result) + assertBigIntEqual(t, tt.expected, result) }) } } @@ -92,3 +92,15 @@ func TestHexToBytes(t *testing.T) { }) } } + +func assertBigIntEqual(t *testing.T, expected, actual *big.Int) { + t.Helper() + if expected == nil { + assert.Nil(t, actual) + return + } + if !assert.NotNil(t, actual) { + return + } + assert.Zerof(t, expected.Cmp(actual), "expected %s, got %s", expected, actual) +} From f80c4b27d04b541c9ef3272ca043b2abf0cd985a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 27 Jul 2026 02:39:58 +0200 Subject: [PATCH 35/44] Update README and examples --- README.md | 473 +++++++++++------- examples/call-abi/main.go | 2 +- examples/call/main.go | 2 +- examples/contract-json-abi/main.go | 2 +- .../main.go | 8 +- .../key-mnemonic/{key-mnemonic.go => main.go} | 0 examples/subscription/main.go | 6 +- 7 files changed, 312 insertions(+), 181 deletions(-) rename examples/{custom-type-advenced => custom-type-advanced}/main.go (90%) rename examples/key-mnemonic/{key-mnemonic.go => main.go} (100%) diff --git a/README.md b/README.md index 654e211..bf78885 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,56 @@ [![Run Tests](https://github.com/defiweb/go-eth/actions/workflows/test.yml/badge.svg)](https://github.com/defiweb/go-eth/actions/workflows/test.yml) -**README IS OUTDATED ON THIS BRANCH** - # go-eth -This library is a Go package designed to interact with the Ethereum blockchain. This package provides robust tools for +This library is a comprehensive Go package designed to interact with the Ethereum blockchain. It provides robust tools for connecting to Ethereum nodes, sending transactions, and handling smart contract events. Whether you're developing a -decentralized application or conducting blockchain analysis. +decentralized application or conducting blockchain analysis, this package offers everything you need. -Some of key features include: +Key features include: -* An RPC client that supports HTTP, WebSocket and IPC transports. -* An ABI package allowing developers to easily interact with smart contracts. -* An extendable and easy to use ABI encoder and decoder. -* Support for JSON and HD wallets. +- **RPC Client**: Supports HTTP, WebSocket, and IPC transports with advanced middleware capabilities +- **ABI Package**: Comprehensive ABI encoder/decoder with Human-Readable ABI support +- **Transaction Support**: All transaction types including Legacy, EIP-1559, EIP-2930, and EIP-4844 (blob transactions) +- **Wallet Management**: Support for JSON keystore, HD wallets, and mnemonic phrases +- **Cryptographic Functions**: Built-in support for ECDSA signing, Keccak hashing, and KZG4844 proofs +- **Extensible Design**: Modular architecture with customizable transport hijackers and middleware -* [go-eth](#go-eth) - * [Installation](#installation) - * [Quick start](#quick-start) - * [Connecting to a node](#connecting-to-a-node) - * [Calling a contract method](#calling-a-contract-method) - * [Calling a contract method using a Human-Readable ABI](#calling-a-contract-method-using-a-human-readable-abi) - * [Sending a transaction](#sending-a-transaction) - * [Subscribing to events](#subscribing-to-events) - * [Transports](#transports) - * [Wallets](#wallets) - * [Working with ABI](#working-with-abi) - * [Mapping rules](#mapping-rules) - * [Encoding and Decoding Methods](#encoding-and-decoding-methods) - * [Encoding method arguments](#encoding-method-arguments) - * [Decoding method return values](#decoding-method-return-values) - * [Events / Logs](#events--logs) - * [Decoding events](#decoding-events) - * [Contract ABI](#contract-abi) - * [JSON-ABI](#json-abi) - * [Human-Readable ABI](#human-readable-abi) - * [Errors](#errors) - * [Reverts](#reverts) - * [Panics](#panics) - * [Signature parser syntax](#signature-parser-syntax) - * [Custom types](#custom-types) - * [Simple types](#simple-types) - * [Advanced types](#advanced-types) - * [Additional tools](#additional-tools) - * [Documentation](#documentation) +- [go-eth](#go-eth) + - [Installation](#installation) + - [Quick start](#quick-start) + - [Connecting to a node](#connecting-to-a-node) + - [Calling a contract method](#calling-a-contract-method) + - [Calling a contract method using a Human-Readable ABI](#calling-a-contract-method-using-a-human-readable-abi) + - [Sending a transaction](#sending-a-transaction) + - [Subscribing to events](#subscribing-to-events) + - [Transports](#transports) + - [Wallets](#wallets) + - [Working with ABI](#working-with-abi) + - [Mapping rules](#mapping-rules) + - [Encoding and Decoding Methods](#encoding-and-decoding-methods) + - [Encoding method arguments](#encoding-method-arguments) + - [Decoding method return values](#decoding-method-return-values) + - [Events / Logs](#events--logs) + - [Decoding events](#decoding-events) + - [Contract ABI](#contract-abi) + - [JSON-ABI](#json-abi) + - [Human-Readable ABI](#human-readable-abi) + - [Errors](#errors) + - [Reverts](#reverts) + - [Panics](#panics) + - [Signature parser syntax](#signature-parser-syntax) + - [Custom types](#custom-types) + - [Simple types](#simple-types) + - [Advanced types](#advanced-types) + - [Client Configuration](#client-configuration) + - [Available Options](#available-options) + - [Transport Hijacking](#transport-hijacking) + - [Cryptographic Functions](#cryptographic-functions) + - [Utility Packages](#utility-packages) + - [Additional tools](#additional-tools) + - [Documentation](#documentation) @@ -57,12 +62,12 @@ go get -u github.com/defiweb/go-eth ## Quick start -The examples below provide a glimpse into the usage of the `go-eth` package. +The examples below provide a comprehensive overview of the `go-eth` package capabilities. ### Connecting to a node -The `go-eth` package offers a JSON-RPC client that can be used to establish a connection with a node. The example below -demonstrates how to connect to a node using HTTP transport method. +The `go-eth` package offers a JSON-RPC client that can connect to Ethereum nodes using various transport methods. The example below +demonstrates how to connect using HTTP transport. @@ -106,7 +111,7 @@ func main() { ### Calling a contract method -The example demonstrates how to call the `balanceOf` method on a contract. +The following example demonstrates how to call the `balanceOf` method on an ERC-20 contract. @@ -144,12 +149,12 @@ func main() { calldata := balanceOf.MustEncodeArgs("0xd8da6bf26964af9d7eed9e03e53415d37aa96045") // Prepare a call. - call := types.NewCall(). - SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")). - SetInput(calldata) + call := types.NewCall() + call.SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")) + call.SetInput(calldata) // Call balanceOf. - b, _, err := c.Call(context.Background(), call, types.LatestBlockNumber) + b, err := c.Call(context.Background(), call, types.LatestBlockNumber) if err != nil { panic(err) } @@ -165,7 +170,7 @@ func main() { ### Calling a contract method using a Human-Readable ABI -Following example shows how to call a contract method using a Human-Readable ABI. It uses popular +The following example shows how to call a contract method using a Human-Readable ABI. It uses the popular [Multicall3](https://www.multicall3.com) contract as an example. @@ -246,12 +251,12 @@ func main() { }) // Prepare a call. - call := types.NewCall(). - SetTo(types.MustAddressFromHex("0xcA11bde05977b3631167028862bE2a173976CA11")). - SetInput(calldata) + call := types.NewCall() + call.SetTo(types.MustAddressFromHex("0xcA11bde05977b3631167028862bE2a173976CA11")) + call.SetInput(calldata) // Call the contract. - b, _, err := c.Call(context.Background(), call, types.LatestBlockNumber) + b, err := c.Call(context.Background(), call, types.LatestBlockNumber) if err != nil { panic(err) } @@ -274,8 +279,8 @@ func main() { ### Sending a transaction -The following example demonstrates how to execute an ERC20 token transfer transaction. Additionally, it illustrates the -use of TX modifiers to simplify the transaction creation process. +The following example demonstrates how to execute an ERC-20 token transfer transaction. It also illustrates the +use of client options to automatically set gas, nonce, and other transaction parameters. @@ -286,18 +291,18 @@ import ( "context" "fmt" "math/big" + "os" "github.com/defiweb/go-eth/abi" "github.com/defiweb/go-eth/rpc" "github.com/defiweb/go-eth/rpc/transport" - "github.com/defiweb/go-eth/txmodifier" "github.com/defiweb/go-eth/types" "github.com/defiweb/go-eth/wallet" ) func main() { // Load the private key. - key, err := wallet.NewKeyFromJSON("./key.json", "test123") + k, err := wallet.NewKeyFromJSON(keyPath(), "test123") if err != nil { panic(err) } @@ -314,42 +319,33 @@ func main() { rpc.WithTransport(t), // Specify a key for signing transactions. If provided, the client - // uses it with SignTransaction, SendTransaction, and Sign methods - // instead of relying on the node for signing. - rpc.WithKeys(key), - - // Specify a default address for SendTransaction when the transaction - // does not have a 'From' field set. - rpc.WithDefaultAddress(key.Address()), - - // TX modifiers enable modifications to the transaction before signing - // and sending to the node. While not mandatory, without them, transaction - // parameters like gas limit, gas price, and nonce must be set manually. - rpc.WithTXModifiers( - // GasLimitEstimator automatically estimates the gas limit for the - // transaction. - txmodifier.NewGasLimitEstimator(txmodifier.GasLimitEstimatorOptions{ - Multiplier: 1.25, - }), - - // GasFeeEstimator automatically estimates the gas price for the - // transaction based on the current market conditions. - txmodifier.NewEIP1559GasFeeEstimator(txmodifier.EIP1559GasFeeEstimatorOptions{ - GasPriceMultiplier: 1.25, - PriorityFeePerGasMultiplier: 1.25, - }), - - // NonceProvider automatically sets the nonce for the transaction. - txmodifier.NewNonceProvider(txmodifier.NonceProviderOptions{ - UsePendingBlock: false, - }), - - // ChainIDProvider automatically sets the chain ID for the transaction. - txmodifier.NewChainIDProvider(txmodifier.ChainIDProviderOptions{ - Replace: false, - Cache: true, - }), - ), + // will sign transactions before sending them to the node. + rpc.WithKeys(k), + + // Specify the default "from" address for transactions. + rpc.WithDefaultAddress(rpc.AddressOptions{ + Address: k.Address(), + }), + + // Estimate gas limit for transactions if not provided explicitly. + rpc.WithGasLimit(rpc.GasLimitOptions{ + Multiplier: 1.25, + }), + + // Estimate gas price for transactions if not provided explicitly. + rpc.WithDynamicGasFee(rpc.DynamicGasFeeOptions{ + GasPriceMultiplier: 1.25, + PriorityFeePerGasMultiplier: 1.25, + }), + + // Automatically set the chain ID for transactions. + rpc.WithChainID(rpc.ChainIDOptions{}), + + // Automatically set the nonce for transactions. + rpc.WithNonce(rpc.NonceOptions{}), + + // Simulate transactions before sending them to the node. + rpc.WithSimulate(), ) if err != nil { panic(err) @@ -362,11 +358,11 @@ func main() { calldata := transfer.MustEncodeArgs("0xd8da6bf26964af9d7eed9e03e53415d37aa96045", new(big.Int).Mul(big.NewInt(100), big.NewInt(1e6))) // Prepare a transaction. - tx := types.NewTransaction(). - SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")). - SetInput(calldata) + tx := types.NewTransactionLegacy() + tx.SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")) + tx.SetInput(calldata) - txHash, _, err := c.SendTransaction(context.Background(), tx) + txHash, err := c.SendTransaction(context.Background(), tx) if err != nil { panic(err) } @@ -374,11 +370,18 @@ func main() { // Print the transaction hash. fmt.Printf("Transaction hash: %s\n", txHash.String()) } + +func keyPath() string { + if _, err := os.Stat("./key.json"); err == nil { + return "./key.json" + } + return "./examples/send-tx/key.json" +} ``` ### Subscribing to events -Following example shows how to subscribe to WETH transfer events. +The following example shows how to subscribe to WETH transfer events. @@ -421,9 +424,9 @@ func main() { transfer := abi.MustParseEvent("event Transfer(address indexed src, address indexed dst, uint256 wad)") // Create a filter query. - query := types.NewFilterLogsQuery(). - SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")). - SetTopics([]types.Hash{transfer.Topic0()}) + query := types.NewFilterLogsQuery() + query.SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")) + query.SetTopics([]types.Hash{transfer.Topic0()}) // Fetch logs for WETH transfer events. logs, err := c.SubscribeLogs(ctx, query) @@ -446,39 +449,39 @@ func main() { ## Transports -To connect to a node, it is necessary to choose a suitable transport method. The transport is responsible for executing -a low-level communication protocol with the node. The `go-eth` package offers the following transport options: +To connect to a node, you need to choose an appropriate transport method. The transport handles low-level communication +with the node. The `go-eth` package offers the following transport options: | Transport | Description | Subscriptions | -|-----------|--------------------------------------------------------------------------------------------|-----------------| -| HTTP | Connects to a node using the HTTP protocol. | No | -| WebSocket | Connects to a node using the WebSocket protocol. | Yes | -| IPC | Connects to a node using the IPC protocol. | Yes | -| Retry | Wraps a transport and retries requests in case of an error. | Yes2 | +| --------- | ------------------------------------------------------------------------------------------ | --------------- | +| HTTP | Connects to a node using the HTTP protocol. Most widely supported. | No | +| WebSocket | Connects to a node using the WebSocket protocol. Supports real-time subscriptions. | Yes | +| IPC | Connects to a node using Inter-Process Communication (Unix sockets/named pipes). | Yes | +| Retry | Wraps a transport and retries requests in case of errors with exponential backoff. | Yes2 | | Combined | Wraps two transports and uses one for methods and the other for subscriptions.1 | Yes | -1. It is recommended by some RPC providers to use HTTP for methods and WebSocket for subscriptions. +1. Recommended by some RPC providers to use HTTP for methods and WebSocket for subscriptions for better performance. 2. Only if the underlying transport supports subscriptions. -Transports can be created using the `transport.New*` functions. It is also possible to create custom transport by -implementing the `transport.Transport` interface or `transport.SubscriptionTransport` interface. +Transports can be created using the `transport.New*` functions. You can also create custom transports by +implementing the `transport.Transport` interface or the `transport.SubscriptionTransport` interface for subscription support. ## Wallets -The `go-eth` package provides support for the following wallet types: +The `go-eth` package provides comprehensive support for various wallet types and key management: -| Description | Example | -|------------------------------|-----------------------------------------------------------------------------| -| A random key | `key := wallet.NewRandomKey()` | -| Private key | `key, err := wallet.NewKeyFromBytes(privateKey)` | -| JSON key file1 | `key, err := wallet.NewKeyFromJSON(path, password)` | -| JSON key content1 | `key, err := wallet.NewKeyFromJSONContent(jsonContent, password)` | -| Mnemonic | `key, err := wallet.NewKeyFromMnemonic(mnemonic, password, account, index)` | -| Remote RPC | `key := wallet.NewKeyRPC(client, address)` | +| Description | Example | +| --------------------------------- | --------------------------------------------------------------------------- | +| Random key generation | `key := wallet.NewRandomKey()` | +| Private key from bytes | `key, err := wallet.NewKeyFromBytes(privateKey)` | +| JSON keystore file1 | `key, err := wallet.NewKeyFromJSON(path, password)` | +| JSON keystore content1 | `key, err := wallet.NewKeyFromJSONContent(jsonContent, password)` | +| HD wallet from mnemonic | `key, err := wallet.NewKeyFromMnemonic(mnemonic, password, account, index)` | +| Remote RPC wallet | `key := wallet.NewKeyRPC(client, address)` | -1. Only V3 JSON keys are supported. +1. Only Ethereum JSON V3 keystores are supported. -Wallets can be also created using custom derivation paths. For example, the following code creates a wallet using the +You can also create wallets using custom derivation paths. For example, the following code creates a wallet using the `m/44'/60'/0'/10/10` derivation path: @@ -516,10 +519,29 @@ func main() { } ``` +## Client Configuration + +The RPC client can be configured with various options to automatically handle transaction parameters, implement middleware, and customize behavior. + +### Available Options + +| Option | Description | +| ------------------------ | ----------------------------------------- | +| `WithTransport` | Sets the transport for communication | +| `WithKeys` | Adds private keys for transaction signing | +| `WithDefaultAddress` | Sets default sender address | +| `WithChainID` | Auto-sets chain ID for transactions | +| `WithNonce` | Auto-manages transaction nonces | +| `WithGasLimit` | Auto-estimates gas limits | +| `WithLegacyGasFee` | Auto-estimates legacy gas prices | +| `WithDynamicGasFee` | Auto-estimates EIP-1559 gas fees | +| `WithSimulate` | Simulates transactions before sending | +| `WithTransactionDecoder` | Custom transaction decoder | + ## Working with ABI -The `go-eth` package offers an ABI encoder and decoder for working with ABI data. The package also includes a signature -parser for parsing method, event, and error signatures, as well as custom types and structs. +The `go-eth` package offers a comprehensive ABI encoder and decoder for working with smart contract data. The package includes a signature +parser for parsing method, event, and error signatures, as well as support for custom types and structs. The following example shows how to encode and decode data: @@ -569,7 +591,7 @@ In the example above, data is encoded and decoded using a struct. The `abi` tags corresponding tuple or struct fields. These tags are optional. If absent, fields are mapped by name, with the first consecutive uppercase letters converted to lowercase. -It is also possible to encode and decode values to a separate variables: +It is also possible to encode and decode values to separate variables: @@ -606,12 +628,12 @@ func main() { } ``` -**Note that in both examples above, similarly named functions are used to encode and decode data. The only difference is -that the second example uses the plural form of the function.** The plural form is used to encode and decode data from -separate variables, while the singular form is used for structs or maps. This is a common pattern in the `go-eth` +**Note: In both examples above, similarly named functions are used to encode and decode data. The only difference is +that the second example uses the plural form of the function names.** The plural form encodes/decodes data from +separate variables, while the singular form works with structs or maps. This is a consistent pattern throughout the `go-eth` package. -Finally, instead of using signature parser, it is possible to create types manually which may be useful to create +Finally, instead of using the signature parser, you can create types manually, which may be useful for creating custom types programmatically: @@ -667,7 +689,7 @@ func main() { When mapping between Go and Solidity types, the following rules apply: | Go type \ Solidity type | `intX` | `uintX` | `bool` | `string` | `bytes` | `bytesX` | `address` | -|-------------------------|------------------|--------------------|--------|----------|---------------|------------------|-----------------| +| ----------------------- | ---------------- | ------------------ | ------ | -------- | ------------- | ---------------- | --------------- | | `intX` | ✓1 | ✓1,2 | ✗ | ✗ | ✗ | ✓3,6 | ✗ | | `uintX` | ✓1,2 | ✓1 | ✗ | ✗ | ✗ | ✓3,6 | ✗ | | `bool` | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✗ | @@ -681,8 +703,8 @@ When mapping between Go and Solidity types, the following rules apply: | `types.Number` | ✓1 | ✓1,2 | ✗ | ✗ | ✗ | ✓3,6 | ✗ | | `types.BlockNumber` | ✓1,10 | ✓1,2,10 | ✗ | ✗ | ✗ | ✓3,10 | ✗ | -* ✓ - Supported -* ✗ - Not supported +- ✓ - Supported +- ✗ - Not supported 1. Destination type must be able to hold the value of the source type. Otherwise, the mapping will result in an error. For example, `uint16` can be mapped to `uint8`, but only if the value is less than 256. @@ -693,21 +715,21 @@ When mapping between Go and Solidity types, the following rules apply: the "0x" prefix is optional. Negative values are prefixed with a minus sign, e.g. "-0x123". 6. Negative values are not supported. 7. String representation is assumed to be in hexadecimal format. -8. When mapping to `bytesX`, length of the data must the same as the length of the destination type. +8. When mapping to `bytesX`, the length of the data must be the same as the length of the destination type. 9. When mapping to `address`, length of the data must be 20 bytes. -10. Mapping latest, earliest and pending block numbers is not supported. +10. Mapping of latest, earliest, and pending block numbers is not supported. -Note: Go type `[X]byte` represents a fixed-size byte array, such as `[20]byte`. Solidity types `intX`, `uintX`, -and `bytesX` are also fixed-size types, such as, `uint32`. +Note: The Go type `[X]byte` represents a fixed-size byte array, such as `[20]byte`. Solidity types `intX`, `uintX`, +and `bytesX` are also fixed-size types, such as `uint32`. -The general rule for mapping types is that the destination type must be capable of holding the value of the source type, +The general rule for type mapping is that the destination type must be capable of holding the value of the source type, the conversion must be unambiguous, and the mapping must be reversible. Mapping from larger to smaller types is -supported because often Solidity contracts use `uint256` for all numbers, even when the value is known to be much less +supported because Solidity contracts often use `uint256` for all numbers, even when the value is known to be much smaller than 256 bits. ### Encoding and Decoding Methods -To work with methods, the `abi.Method` structure needs to be created. Methods may be created using different methods: +To work with methods, an `abi.Method` structure needs to be created. Methods can be created using different approaches: - `abi.ParseMethod` / `abi.MustParseMethod` - creates a new method by parsing a method signature. - `abi.NewMethod(name, inputs, outputs, mutability)` - creates a new method using provided arguments. @@ -750,7 +772,7 @@ func main() { #### Decoding method return values -To decode method arguments, the `abi.Method.DecodeArg` or `abi.Method.DecodeArgs` functions can be used. The first +To decode method return values, the `abi.Method.DecodeValue` or `abi.Method.DecodeValues` functions can be used. The first function decodes returned values to a struct, the second function decodes returned values to consecutive variables. ```go @@ -770,7 +792,7 @@ func main() { // Parse method signature. balanceOf := abi.MustParseMethod("balanceOf(address) returns (uint256)") - // Encode method arguments. + // Decode method return values. var balance big.Int err := balanceOf.DecodeValues(abiData, &balance) if err != nil { @@ -784,10 +806,10 @@ func main() { ### Events / Logs -To decode contract events, the `abi.Event` structure needs to be created. Events may be created using different methods: +To decode contract events, an `abi.Event` structure needs to be created. Events can be created using different approaches: - `abi.ParseEvent` / `abi.MustParseEvent` - creates a new event by parsing an event signature. -- `abi.NewEvent(name, inputs)` - creates a new event using provided arguments. +- `abi.NewEvent(name, inputs, anonymous)` - creates a new event using provided arguments. - Using the `abi.Contract` struct (see [Contract ABI](#contract-abi) section). #### Decoding events @@ -824,11 +846,11 @@ func main() { transfer := abi.MustParseEvent("Transfer(address indexed src, address indexed dst, uint256 wad)") // Create filter query. - query := types.NewFilterLogsQuery(). - SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")). - SetFromBlock(types.BlockNumberFromUint64Ptr(16492400)). - SetToBlock(types.BlockNumberFromUint64Ptr(16492400)). - SetTopics([]types.Hash{transfer.Topic0()}) + query := types.NewFilterLogsQuery() + query.SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")) + query.SetFromBlock(types.BlockNumberFromUint64Ptr(16492400)) + query.SetToBlock(types.BlockNumberFromUint64Ptr(16492400)) + query.SetTopics([]types.Hash{transfer.Topic0()}) // Fetch logs for WETH transfer events. logs, err := c.GetLogs(context.Background(), query) @@ -851,7 +873,7 @@ func main() { The `abi.Contract` structure is a utility that provides an interface to a contract. It can be created using a JSON-ABI file or by supplying a list of signatures (also known as a Human-Readable ABI). -To create a contract struct, the following methods may be used: +To create a contract struct, the following methods can be used: - `abi.LoadJSON` / `abi.MustLoadJSON` - creates a new contract by loading a JSON-ABI file. - `abi.ParseJSON` / `abi.MustParseJSON` - creates a new contract by parsing a JSON-ABI string. @@ -868,12 +890,13 @@ package main import ( "fmt" "math/big" + "os" "github.com/defiweb/go-eth/abi" ) func main() { - erc20, err := abi.LoadJSON("erc20.json") + erc20, err := abi.LoadJSON(abiPath()) if err != nil { panic(err) } @@ -889,6 +912,13 @@ func main() { fmt.Printf("Transfer calldata: 0x%x\n", calldata) } + +func abiPath() string { + if _, err := os.Stat("./erc20.json"); err == nil { + return "./erc20.json" + } + return "./examples/contract-json-abi/erc20.json" +} ``` #### Human-Readable ABI @@ -938,8 +968,7 @@ func main() { ### Errors -To decode custom contract errors, first a `abi.Error` struct must be created. Errors may be created using different -methods: +To decode custom contract errors, first an `abi.Error` struct must be created. Errors can be created using different approaches: - `abi.ParseError` / `abi.MustParseError` - creates a new error by parsing an error signature. - `abi.NewError(name, inputs)` - creates a new error using provided arguments. @@ -947,39 +976,39 @@ methods: Custom errors may be decoded from errors returned by the `Call` function using the `abi.Error.HandleError` method. -When using a `abi.Contract`, errors may be decoded from call errors using the `abi.Contract.HandleError` method. This -method will try to decode the error using all errors defined in the contract, also including reverts and panics. +When using an `abi.Contract`, errors can be decoded from call errors using the `abi.Contract.HandleError` method. This +method will attempt to decode the error using all errors defined in the contract, including reverts and panics. ### Reverts Reverts are special errors returned by the EVM when a contract call fails. Reverts are ABI-encoded errors with -the `Error(string)` signature. The `abi.DecodeRevert` function can be used to decode reverts. Optionally, the `abi` -package provides `abi.Revert`, a predefined error type that can be used to decode reverts. +the `Error(string)` signature. The `abi.DecodeRevert` function can be used to decode reverts. The `abi` +package also provides `abi.Revert`, a predefined error type for decoding reverts. To verify if an error is a revert, use the `abi.IsRevert` function. ### Panics Similar to reverts, panics are special errors returned by the EVM when a contract call fails. Panics are ABI-encoded -errors with the `Panic(uint256)` signature. The `abi.DecodePanic` function can be used to decode panics. Optionally, the -`abi` package also provides `abi.Panic`, a predefined error type that can be used to decode panics. +errors with the `Panic(uint256)` signature. The `abi.DecodePanic` function can be used to decode panics. The +`abi` package also provides `abi.Panic`, a predefined error type for decoding panics. To verify if an error is a panic, use the `abi.IsPanic` function. ### Signature parser syntax -The parser is based on Solidity grammar, but it allows for the omission of argument names, as well as the `returns` +The parser is based on Solidity grammar but allows for the omission of argument names, as well as the `returns` and `function` keywords. This means it can parse full Solidity signatures as well as short signatures, such as `bar(uint256,bytes32)`. Tuples are represented as a list of parameters, for example, `(uint256,bytes32)`. The list -can be optionally prefixed with the `tuple` keyword, for example, `tuple(uint256,bytes32)`. +can optionally be prefixed with the `tuple` keyword, for example, `tuple(uint256,bytes32)`. -Examples of signatures that are accepted by the parser: +Examples of signatures accepted by the parser: - `getPrice(string)` -- `getPrice(string)((uint256,unit256))` -- `getPrice(string symbol) returns ((uint256 price, unit256 timestamp) result)` +- `getPrice(string)((uint256,uint256))` +- `getPrice(string symbol) returns ((uint256 price, uint256 timestamp) result)` - `function getPrice(string calldata symbol) external view returns (tuple(uint256 price, uint256 timestamp) result)` -- `event PriceUpated(string indexed symbol, uint256 price)` +- `event PriceUpdated(string indexed symbol, uint256 price)` - `error PriceExpired(string symbol, uint256 timestamp)` ### Custom types @@ -989,8 +1018,8 @@ the signature parser. #### Simple types -The simplest way to create a custom type is to use the `abi.ParseType`, `abi.ParseStruct`, `abi.MustParseType`, -`abi.MustParseStruct` functions, which parses a type signature and returns a `Type` struct. This method can be used to +The simplest way to create a custom type is to use the `abi.ParseType`, `abi.ParseStruct`, `abi.MustParseType`, or +`abi.MustParseStruct` functions, which parse a type signature and return a `Type` struct. This method can be used to create custom types for commonly used structs. @@ -1034,7 +1063,7 @@ provides basic information about the type, while the `abi.Value` interface inclu values and holds the value itself. Optionally, the `abi.MapTo` and `abi.MapFrom` methods can be implemented to support advanced mapping logic. -The example below demonstrates how to create a custom type that represents a 32-byte boolean array stored in a +The example below demonstrates how to create a custom type that represents a 256-bit boolean array stored in a single `bytes32` value. @@ -1100,7 +1129,7 @@ func (b BoolFlagsValue) EncodeABI() (abi.Words, error) { // DecodeABI decodes the value from the ABI format. func (b *BoolFlagsValue) DecodeABI(words abi.Words) (int, error) { if len(words) == 0 { - return 0, fmt.Errorf("abi: cannot decode BytesFlags from empty data") + return 0, fmt.Errorf("abi: cannot decode BoolFlags from empty data") } for i, v := range words[0] { for j := 0; j < 8; j++ { @@ -1115,6 +1144,9 @@ func (b *BoolFlagsValue) DecodeABI(words abi.Words) (int, error) { // // The abi.Mapper is the instance of the internal mapper that is used to // perform the mapping. It can be used to map nested types. +// +// Note that you may want to use reflection to implement the following methods, +// as it would let you write more generic mapping code. // MapFrom maps value from a different type. func (b *BoolFlagsValue) MapFrom(_ abi.Mapper, src any) error { @@ -1123,7 +1155,7 @@ func (b *BoolFlagsValue) MapFrom(_ abi.Mapper, src any) error { *b = src case []bool: if len(src) > 256 { - return fmt.Errorf("abi: cannot map []bool of length %d to BytesFlags", len(src)) + return fmt.Errorf("abi: cannot map []bool of length %d to BoolFlags", len(src)) } for i, v := range src { b[i] = v @@ -1165,13 +1197,112 @@ Please note that adding a custom type to the `abi.Default.Types` map will affect the current process. If you want to add a custom type to a single `abi` instance, you can create a new instance using the `abi.NewABI` function. +## Cryptographic Functions + +The `go-eth` package includes a comprehensive crypto module with support for various cryptographic operations: + +### ECDSA Operations + +- **Key Recovery**: `crypto.ECRecoverHash()` and `crypto.ECRecoverMessage()` +- **Digital Signatures**: `crypto.ECSignHash()` and `crypto.ECSignMessage()` +- **Address Generation**: `crypto.ECPublicKeyToAddress()` + +### Hashing + +- **Keccak-256**: `crypto.Keccak256()` - The primary hash function used in Ethereum + +### KZG4844 (EIP-4844 Blob Transactions) + +The package includes full support for KZG commitments and proofs used in blob transactions: + +- **Blob to Commitment**: `crypto.KZGBlobToCommitment()` +- **Proof Generation**: `crypto.KZGComputeProof()` and `crypto.KZGComputeBlobProof()` +- **Proof Verification**: `crypto.KZGVerifyProof()` and `crypto.KZGVerifyBlobProof()` +- **Blob Hash Computation**: `crypto.KZGComputeBlobHashV1()` + +Example KZG usage: + +```go +import "github.com/defiweb/go-eth/crypto/kzg4844" + +// Create a blob (128KB of data) +var blob kzg4844.Blob +copy(blob[:], "your data here...") + +// Generate commitment +commitment, err := kzg4844.BlobToCommitment(&blob) +if err != nil { + panic(err) +} + +// Generate proof for a specific point +var point kzg4844.Point +proof, claim, err := kzg4844.ComputeProof(&blob, point) +``` + +### Transaction Signing + +The crypto module also provides transaction signing capabilities through the `txsign` subpackage, supporting all Ethereum transaction types including legacy, EIP-1559, EIP-2930, and EIP-4844. + +## Utility Packages + +### HexUtil Package + +The `hexutil` package provides convenient functions for working with hexadecimal data: + +```go +import "github.com/defiweb/go-eth/hexutil" + +// Convert between big integers and hex strings +hexStr := hexutil.BigIntToHex(big.NewInt(12345)) // "0x3039" +bigInt := hexutil.MustHexToBigInt("0x3039") // 12345 + +// Convert between byte slices and hex strings +hexStr = hexutil.BytesToHex([]byte{0x12, 0x34}) // "0x1234" +bytes := hexutil.MustHexToBytes("0x1234") // []byte{0x12, 0x34} + +// Utility functions +hasPrefix := hexutil.Has0xPrefix("0x1234") // true +``` + +### Types Package + +The `types` package provides Ethereum-specific data types: + +- **Address**: 20-byte Ethereum addresses with validation +- **Hash**: 32-byte hashes with utilities +- **BlockNumber**: Special handling for latest/earliest/pending blocks +- **Transaction Types**: Support for all transaction types (Legacy, AccessList, DynamicFee, Blob) +- **Call Types**: Various call structures for different use cases +- **Filter Queries**: For event log filtering + +Example: + +```go +import "github.com/defiweb/go-eth/types" + +// Create address from hex string +addr := types.MustAddressFromHex("0x742d35Cc6606e7d8123456789012345678901234") + +// Create various transaction types +legacyTx := types.NewTransactionLegacy() +eip1559Tx := types.NewTransactionDynamicFee() +eip2930Tx := types.NewTransactionAccessList() +blobTx := types.NewTransactionBlob() + +// Create call for contract interaction +call := types.NewCall() +call.SetTo(addr) +call.SetInput(calldata) +``` + ## Additional tools -You may be also find the following tools interesting: +You may also find the following related tools interesting: -* [go-rlp](https://github.com/defiweb/go-rlp) - RLP serialization/deserialization library. -* [go-sigparser](https://github.com/defiweb/go-sigparser) - Solidity-compatible signature parser. -* [go-anymapper](https://github.com/defiweb/go-anymapper) - Data mapper used by this package. +- [go-rlp](https://github.com/defiweb/go-rlp) - RLP serialization/deserialization library. +- [go-sigparser](https://github.com/defiweb/go-sigparser) - Solidity-compatible signature parser. +- [go-anymapper](https://github.com/defiweb/go-anymapper) - Data mapper used by this package. ## Documentation diff --git a/examples/call-abi/main.go b/examples/call-abi/main.go index 31b6f0e..587383e 100644 --- a/examples/call-abi/main.go +++ b/examples/call-abi/main.go @@ -73,7 +73,7 @@ func main() { }) // Prepare a call. - call := types.NewCallLegacy() + call := types.NewCall() call.SetTo(types.MustAddressFromHex("0xcA11bde05977b3631167028862bE2a173976CA11")) call.SetInput(calldata) diff --git a/examples/call/main.go b/examples/call/main.go index c1928b2..11b6e99 100644 --- a/examples/call/main.go +++ b/examples/call/main.go @@ -31,7 +31,7 @@ func main() { calldata := balanceOf.MustEncodeArgs("0xd8da6bf26964af9d7eed9e03e53415d37aa96045") // Prepare a call. - call := types.NewCallLegacy() + call := types.NewCall() call.SetTo(types.MustAddressFromHex("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48")) call.SetInput(calldata) diff --git a/examples/contract-json-abi/main.go b/examples/contract-json-abi/main.go index 685df92..796354b 100644 --- a/examples/contract-json-abi/main.go +++ b/examples/contract-json-abi/main.go @@ -28,7 +28,7 @@ func main() { func abiPath() string { if _, err := os.Stat("./erc20.json"); err == nil { - return "./key.json" + return "./erc20.json" } return "./examples/contract-json-abi/erc20.json" } diff --git a/examples/custom-type-advenced/main.go b/examples/custom-type-advanced/main.go similarity index 90% rename from examples/custom-type-advenced/main.go rename to examples/custom-type-advanced/main.go index 8109113..0b0f209 100644 --- a/examples/custom-type-advenced/main.go +++ b/examples/custom-type-advanced/main.go @@ -58,7 +58,7 @@ func (b BoolFlagsValue) EncodeABI() (abi.Words, error) { // DecodeABI decodes the value from the ABI format. func (b *BoolFlagsValue) DecodeABI(words abi.Words) (int, error) { if len(words) == 0 { - return 0, fmt.Errorf("abi: cannot decode BytesFlags from empty data") + return 0, fmt.Errorf("abi: cannot decode BoolFlags from empty data") } for i, v := range words[0] { for j := 0; j < 8; j++ { @@ -74,8 +74,8 @@ func (b *BoolFlagsValue) DecodeABI(words abi.Words) (int, error) { // The abi.Mapper is the instance of the internal mapper that is used to // perform the mapping. It can be used to map nested types. // -// Note, that you want to use reflection to implement following methods because -// it would allow to write more generic code mapping functions. +// Note that you may want to use reflection to implement the following methods, +// as it would let you write more generic mapping code. // MapFrom maps value from a different type. func (b *BoolFlagsValue) MapFrom(_ abi.Mapper, src any) error { @@ -84,7 +84,7 @@ func (b *BoolFlagsValue) MapFrom(_ abi.Mapper, src any) error { *b = src case []bool: if len(src) > 256 { - return fmt.Errorf("abi: cannot map []bool of length %d to BytesFlags", len(src)) + return fmt.Errorf("abi: cannot map []bool of length %d to BoolFlags", len(src)) } for i, v := range src { b[i] = v diff --git a/examples/key-mnemonic/key-mnemonic.go b/examples/key-mnemonic/main.go similarity index 100% rename from examples/key-mnemonic/key-mnemonic.go rename to examples/key-mnemonic/main.go diff --git a/examples/subscription/main.go b/examples/subscription/main.go index 82f32a9..92cc032 100644 --- a/examples/subscription/main.go +++ b/examples/subscription/main.go @@ -36,9 +36,9 @@ func main() { transfer := abi.MustParseEvent("event Transfer(address indexed src, address indexed dst, uint256 wad)") // Create a filter query. - query := types.NewFilterLogsQuery(). - SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")). - SetTopics([]types.Hash{transfer.Topic0()}) + query := types.NewFilterLogsQuery() + query.SetAddresses(types.MustAddressFromHex("0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2")) + query.SetTopics([]types.Hash{transfer.Topic0()}) // Fetch logs for WETH transfer events. logs, err := c.SubscribeLogs(ctx, query) From 0c2c9f44242e3e557405ffde20979735a164ed84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 3 Aug 2026 23:35:28 +0200 Subject: [PATCH 36/44] Fix bytes decoding --- abi/num.go | 5 ++++- abi/value.go | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/abi/num.go b/abi/num.go index 0aba0c5..ec2186a 100644 --- a/abi/num.go +++ b/abi/num.go @@ -252,8 +252,11 @@ func (i *uintX) SetBigInt(x *big.Int) error { i.val = big.NewInt(0) return nil } + if x.Sign() < 0 { + return fmt.Errorf("abi: cannot set negative integer to %d-bit unsigned int", i.size) + } if x.BitLen() > i.size { - return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit signed int", signedBitLen(x), i.size) + return fmt.Errorf("abi: cannot set %d-bit integer to %d-bit unsigned int", x.BitLen(), i.size) } i.val.Set(x) return nil diff --git a/abi/value.go b/abi/value.go index cce27d5..4b5dee1 100644 --- a/abi/value.go +++ b/abi/value.go @@ -304,11 +304,12 @@ func (s *StringValue) EncodeABI() (Words, error) { // DecodeABI implements the Value interface. func (s *StringValue) DecodeABI(data Words) (int, error) { var b []byte - if _, err := decodeBytes(&b, data); err != nil { + n, err := decodeBytes(&b, data) + if err != nil { return 0, err } *s = StringValue(b) - return 1, nil + return n, nil } // MapFrom implements the anymapper.MapFrom interface. From 65ad8a0ae024c3446e326a56899a377abe184930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Mon, 3 Aug 2026 23:36:25 +0200 Subject: [PATCH 37/44] Update crypto pkg --- crypto/crypto.go | 4 + crypto/kzg4844/kzg4844.go | 2 +- crypto/primitives/primitives.go | 21 +- crypto/primitives/primitives_test.go | 21 - types/call.go | 2 +- types/call_blob_test.go | 4 +- types/components.go | 6 +- types/components_test.go | 12 +- types/structs.go | 4 +- types/structs_test.go | 557 +++++++++++++++++++++++++++ types/tx_blob.go | 15 +- types/tx_blob_test.go | 10 +- types/tx_decoder_test.go | 4 +- types/types.go | 28 +- types/util_test.go | 12 + wallet/key_hd.go | 4 +- wallet/key_json.go | 5 +- wallet/key_json_v3.go | 28 +- wallet/key_priv.go | 52 ++- 19 files changed, 712 insertions(+), 79 deletions(-) diff --git a/crypto/crypto.go b/crypto/crypto.go index 7018e93..7cf7236 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -9,8 +9,11 @@ import ( ) const ( + HashSize = primitives.HashSize + AddressSize = primitives.AddressSize PrivateKeySize = primitives.PrivateKeySize PublicKeySize = primitives.PublicKeySize + KZGHashSize = primitives.KZGHashSize KZGScalarsPerBlob = primitives.KZGScalarsPerBlob KZGScalarSize = primitives.KZGScalarSize KZGBlobSize = primitives.KZGBlobSize @@ -25,6 +28,7 @@ type ( PublicKey = primitives.PublicKey PrivateKey = primitives.PrivateKey Signature = primitives.Signature + KZGHash = primitives.KZGHash KZGBlob = primitives.KZGBlob KZGCommitment = primitives.KZGCommitment KZGProof = primitives.KZGProof diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index 780ddba..b8ec0f5 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -77,7 +77,7 @@ func VerifyBlobProof(blob *primitives.KZGBlob, commitment primitives.KZGCommitme } // ComputeBlobHashV1 calculates the 'versioned blob hash' of a commitment. -func ComputeBlobHashV1(commit primitives.KZGCommitment) (h [32]byte) { +func ComputeBlobHashV1(commit primitives.KZGCommitment) (h primitives.KZGHash) { k := sha256.New() k.Write(commit[:]) k.Sum(h[:0]) diff --git a/crypto/primitives/primitives.go b/crypto/primitives/primitives.go index a820206..d5e43c4 100644 --- a/crypto/primitives/primitives.go +++ b/crypto/primitives/primitives.go @@ -18,13 +18,16 @@ const ( // AddressSize is the size of an Ethereum address in bytes. AddressSize = 20 - // PrivateKeySize is the size of an ECDSA private key in bytes. + // PrivateKeySize is the size of an ECDSA private key in bytes. PrivateKeySize = 32 - // PublicKeySize is the size of an ECDSA public key in bytes. + // PublicKeySize is the size of an ECDSA public key in bytes. PublicKeySize = 64 + // KZGHashSize is the size of a blob hash in bytes. + KZGHashSize = 32 + // KZGScalarsPerBlob is the number of field elements in a blob. KZGScalarsPerBlob = 4096 @@ -65,6 +68,9 @@ type Signature struct { S *big.Int } +// KZGHash is a blob hash. +type KZGHash [KZGHashSize]byte + // KZGBlob represents a 4844 data blob. type KZGBlob [KZGBlobSize]byte @@ -98,17 +104,6 @@ func (k PrivateKey) Scalar() *big.Int { return new(big.Int).SetBytes(k[:]) } -// PrivateKeyFromScalar returns the private key for the given big integer. -// -// It returns false if the integer does not fit in 32 bytes. -func PrivateKeyFromScalar(d *big.Int) (k PrivateKey, ok bool) { - if d == nil || d.Sign() < 0 || d.BitLen() > PrivateKeySize*8 { - return PrivateKey{}, false - } - d.FillBytes(k[:]) - return k, true -} - // Zero wipes the key material. func (k *PrivateKey) Zero() { clear(k[:]) diff --git a/crypto/primitives/primitives_test.go b/crypto/primitives/primitives_test.go index 75e0781..0fe3c0d 100644 --- a/crypto/primitives/primitives_test.go +++ b/crypto/primitives/primitives_test.go @@ -3,7 +3,6 @@ package primitives import ( "encoding/json" "fmt" - "math/big" "testing" "github.com/stretchr/testify/assert" @@ -37,26 +36,6 @@ func TestPrivateKey_Scalar(t *testing.T) { assert.Equal(t, int64(5), k.Scalar().Int64()) } -func TestPrivateKeyFromScalar(t *testing.T) { - t.Run("valid", func(t *testing.T) { - k, ok := PrivateKeyFromScalar(big.NewInt(5)) - require.True(t, ok) - assert.Equal(t, PrivateKey{31: 5}, k) - }) - t.Run("nil", func(t *testing.T) { - _, ok := PrivateKeyFromScalar(nil) - assert.False(t, ok) - }) - t.Run("negative", func(t *testing.T) { - _, ok := PrivateKeyFromScalar(big.NewInt(-1)) - assert.False(t, ok) - }) - t.Run("too-large", func(t *testing.T) { - _, ok := PrivateKeyFromScalar(new(big.Int).Lsh(big.NewInt(1), 256)) - assert.False(t, ok) - }) -} - // TestPrivateKey_NoDisclose verifies that the key material is not disclosed by // the formatting and marshaling methods. func TestPrivateKey_NoDisclose(t *testing.T) { diff --git a/types/call.go b/types/call.go index a4eb8ef..bdd781a 100644 --- a/types/call.go +++ b/types/call.go @@ -22,7 +22,7 @@ type jsonCall struct { Input Bytes `json:"input,omitempty"` Value *Number `json:"value,omitempty"` AccessList AccessList `json:"accessList,omitempty"` - BlobHashes []Hash `json:"blobVersionedHashes,omitempty"` + BlobHashes []kzgHash `json:"blobVersionedHashes,omitempty"` Blobs []kzgBlob `json:"blobs,omitempty"` Commitments []kzgCommitment `json:"commitments,omitempty"` Proofs []kzgProof `json:"proofs,omitempty"` diff --git a/types/call_blob_test.go b/types/call_blob_test.go index a238835..69c4a57 100644 --- a/types/call_blob_test.go +++ b/types/call_blob_test.go @@ -47,8 +47,8 @@ func TestCallBlob_JSON(t *testing.T) { BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ - {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, - {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, + {Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666")}, + {Hash: mustKZGHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777")}, }, }, }, diff --git a/types/components.go b/types/components.go index e633961..8368571 100644 --- a/types/components.go +++ b/types/components.go @@ -498,13 +498,13 @@ func (c *BlobData) toJSON(j *jsonCall) { if len(c.Blobs) > 0 && c.Blobs[0].Sidecar != nil { // If the first blob has a sidecar, then all blobs should have // sidecars, so we can allocate memory for them. - j.BlobHashes = make([]Hash, 0, len(c.Blobs)) + j.BlobHashes = make([]kzgHash, 0, len(c.Blobs)) j.Blobs = make([]kzgBlob, 0, len(c.Blobs)) j.Commitments = make([]kzgCommitment, 0, len(c.Blobs)) j.Proofs = make([]kzgProof, 0, len(c.Blobs)) } for _, b := range c.Blobs { - j.BlobHashes = append(j.BlobHashes, b.Hash) + j.BlobHashes = append(j.BlobHashes, kzgHash(b.Hash)) if b.Sidecar != nil { j.Blobs = append(j.Blobs, kzgBlob(b.Sidecar.Blob)) j.Commitments = append(j.Commitments, kzgCommitment(b.Sidecar.Commitment)) @@ -520,7 +520,7 @@ func (c *BlobData) fromJSON(j *jsonCall) { if len(j.BlobHashes) > 0 { c.Blobs = make([]BlobInfo, len(j.BlobHashes)) for i, h := range j.BlobHashes { - b := BlobInfo{Hash: h} + b := BlobInfo{Hash: crypto.KZGHash(h)} if i < len(j.Blobs) && i < len(j.Commitments) && i < len(j.Proofs) { b.Sidecar = &BlobSidecar{ Blob: crypto.KZGBlob(j.Blobs[i]), diff --git a/types/components_test.go b/types/components_test.go index c08e415..3d9f1f0 100644 --- a/types/components_test.go +++ b/types/components_test.go @@ -496,7 +496,7 @@ func TestBlobData_JSON(t *testing.T) { MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666"), Sidecar: &BlobSidecar{ Blob: crypto.KZGBlob{0x01, 0x02, 0x03}, Commitment: crypto.KZGCommitment{0x04, 0x05, 0x06}, @@ -507,8 +507,8 @@ func TestBlobData_JSON(t *testing.T) { }, want: &jsonCall{ MaxFeePerBlobGas: NumberFromBigIntPtr(big.NewInt(3000000000)), - BlobHashes: []Hash{ - MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + BlobHashes: []kzgHash{ + kzgHash(mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666")), }, Blobs: []kzgBlob{ {0x01, 0x02, 0x03}, @@ -536,15 +536,15 @@ func TestBlobData_JSON(t *testing.T) { MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { - Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone), + Hash: mustKZGHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777"), Sidecar: nil, }, }, }, want: &jsonCall{ MaxFeePerBlobGas: NumberFromBigIntPtr(big.NewInt(3000000000)), - BlobHashes: []Hash{ - MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone), + BlobHashes: []kzgHash{ + kzgHash(mustKZGHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777")), }, }, wantJSON: `{ diff --git a/types/structs.go b/types/structs.go index 0f9141d..71e8982 100644 --- a/types/structs.go +++ b/types/structs.go @@ -133,7 +133,7 @@ func (a *AccessTuple) DecodeRLP(data []byte) (int, error) { // https://eips.ethereum.org/EIPS/eip-4844 type BlobInfo struct { // Hash is the blob's versioned hash. - Hash Hash + Hash crypto.KZGHash // Sidecar contains the blob components. Nil when the sidecar is not available. Sidecar *BlobSidecar @@ -153,7 +153,7 @@ type BlobSidecar struct { } // ComputeHash computes the blob hash of the given blob sidecar. -func (sc *BlobSidecar) ComputeHash() Hash { +func (sc *BlobSidecar) ComputeHash() crypto.KZGHash { return crypto.KZGComputeBlobHashV1(sc.Commitment) } diff --git a/types/structs_test.go b/types/structs_test.go index 614145a..179d548 100644 --- a/types/structs_test.go +++ b/types/structs_test.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "testing" + "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -71,3 +72,559 @@ func TestTransactionOnChain_JSON(t *testing.T) { }) } } + +func TestTransactionReceipt_JSON(t *testing.T) { + tests := []struct { + receipt *TransactionReceipt + wantJSON string + }{ + { + wantJSON: ` + { + "transactionHash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "transactionIndex": "0x4", + "blockHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "blockNumber": "0x3", + "from": "0x3333333333333333333333333333333333333333", + "to": "0x4444444444444444444444444444444444444444", + "cumulativeGasUsed": "0x186a0", + "effectiveGasPrice": "0x3b9aca00", + "gasUsed": "0x5208", + "contractAddress": "0x5555555555555555555555555555555555555555", + "logs": [], + "logsBloom": "0x01020304", + "root": "0x6666666666666666666666666666666666666666666666666666666666666666", + "status": "0x1" + } + `, + receipt: &TransactionReceipt{ + TransactionHash: MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), + TransactionIndex: 4, + BlockHash: MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + BlockNumber: big.NewInt(3), + From: MustAddressFromHex("0x3333333333333333333333333333333333333333"), + To: MustAddressFromHex("0x4444444444444444444444444444444444444444"), + CumulativeGasUsed: 100000, + EffectiveGasPrice: big.NewInt(1000000000), + GasUsed: 21000, + ContractAddress: MustAddressFromHexPtr("0x5555555555555555555555555555555555555555"), + Logs: []Log{}, + LogsBloom: []byte{1, 2, 3, 4}, + Root: MustHashFromHexPtr("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Status: ptr(uint64(1)), + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + receipt := &TransactionReceipt{} + + err := receipt.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.receipt, receipt) + + j, err := receipt.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestBlock_JSON(t *testing.T) { + tests := []struct { + block *Block + wantJSON string + }{ + { + wantJSON: ` + { + "number": "0x1", + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "parentHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "stateRoot": "0x3333333333333333333333333333333333333333333333333333333333333333", + "receiptsRoot": "0x4444444444444444444444444444444444444444444444444444444444444444", + "transactionsRoot": "0x5555555555555555555555555555555555555555555555555555555555555555", + "mixHash": "0x6666666666666666666666666666666666666666666666666666666666666666", + "sha3Uncles": "0x7777777777777777777777777777777777777777777777777777777777777777", + "nonce": "0x0000000000000042", + "miner": "0x8888888888888888888888888888888888888888", + "logsBloom": "` + testBloomHex + `", + "difficulty": "0x2", + "totalDifficulty": "0x3", + "size": "0x220", + "gasLimit": "0x1c9c380", + "gasUsed": "0x5208", + "timestamp": "0x64000000", + "uncles": ["0x9999999999999999999999999999999999999999999999999999999999999999"], + "extraData": "0x01020304", + "transactions": ["0xaaaa000000000000000000000000000000000000000000000000000000000000"] + } + `, + block: &Block{ + Number: big.NewInt(1), + Hash: MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), + ParentHash: MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + StateRoot: MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", PadNone), + ReceiptsRoot: MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + TransactionsRoot: MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + MixHash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Sha3Uncles: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone), + Nonce: big.NewInt(0x42), + Miner: MustAddressFromHex("0x8888888888888888888888888888888888888888"), + LogsBloom: testBloom(), + Difficulty: big.NewInt(2), + TotalDifficulty: big.NewInt(3), + Size: 544, + GasLimit: 30000000, + GasUsed: 21000, + Timestamp: time.Unix(0x64000000, 0), + Uncles: []Hash{MustHashFromHex("0x9999999999999999999999999999999999999999999999999999999999999999", PadNone)}, + TransactionHashes: []Hash{ + MustHashFromHex("0xaaaa000000000000000000000000000000000000000000000000000000000000", PadNone), + }, + ExtraData: []byte{1, 2, 3, 4}, + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + block := &Block{} + + err := block.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.block, block) + + j, err := block.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestBlock_JSON_FullTransactions(t *testing.T) { + wantJSON := ` + { + "number": "0x1", + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "parentHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "stateRoot": "0x3333333333333333333333333333333333333333333333333333333333333333", + "receiptsRoot": "0x4444444444444444444444444444444444444444444444444444444444444444", + "transactionsRoot": "0x5555555555555555555555555555555555555555555555555555555555555555", + "mixHash": "0x6666666666666666666666666666666666666666666666666666666666666666", + "sha3Uncles": "0x7777777777777777777777777777777777777777777777777777777777777777", + "nonce": "0x0000000000000042", + "miner": "0x8888888888888888888888888888888888888888", + "logsBloom": "` + testBloomHex + `", + "difficulty": "0x2", + "totalDifficulty": "0x3", + "size": "0x220", + "gasLimit": "0x1c9c380", + "gasUsed": "0x5208", + "timestamp": "0x64000000", + "uncles": [], + "extraData": "0x01020304", + "transactions": [ + { + "to": "0x2222222222222222222222222222222222222222", + "gas": "0x186a0", + "gasPrice": "0x3b9aca00", + "input": "0x01020304", + "nonce": "0x1", + "value": "0xde0b6b3a7640000", + "v": "0x6f", + "r": "0xa3a7b12762dbc5df6cfbedbecdf8a821929c6112d2634abbb0d99dc63ad91490", + "s": "0x8051b2c8c7d159db49ad19bd01026156eedab2f3d8c1dfdd07d21c07a4bbdd84", + "hash": "0x1111111111111111111111111111111111111111111111111111111111111111", + "blockHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "blockNumber": "0x3", + "transactionIndex": "0x4" + } + ] + } + ` + block := &Block{} + + err := block.UnmarshalJSON([]byte(wantJSON)) + require.NoError(t, err) + require.Len(t, block.Transactions, 1) + assert.Empty(t, block.TransactionHashes) + + j, err := block.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, wantJSON, string(j)) +} + +func TestFeeHistory_JSON(t *testing.T) { + tests := []struct { + feeHistory *FeeHistory + wantJSON string + }{ + { + wantJSON: ` + { + "oldestBlock": "0x10", + "reward": [["0x1", "0x2"], ["0x3", "0x4"]], + "baseFeePerGas": ["0x5", "0x6", "0x7"], + "gasUsedRatio": [0.25, 0.5], + "baseFeePerBlobGas": ["0x8", "0x9", "0xa"], + "blobGasUsedRatio": [0.75, 1] + } + `, + feeHistory: &FeeHistory{ + OldestBlock: 16, + Reward: [][]*big.Int{ + {big.NewInt(1), big.NewInt(2)}, + {big.NewInt(3), big.NewInt(4)}, + }, + BaseFeePerGas: []*big.Int{big.NewInt(5), big.NewInt(6), big.NewInt(7)}, + GasUsedRatio: []float64{0.25, 0.5}, + BaseFeePerBlobGas: []*big.Int{big.NewInt(8), big.NewInt(9), big.NewInt(10)}, + BlobGasUsedRatio: []float64{0.75, 1}, + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + feeHistory := &FeeHistory{} + + err := feeHistory.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.feeHistory, feeHistory) + + j, err := feeHistory.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestAccessListResult_JSON(t *testing.T) { + tests := []struct { + result *AccessListResult + wantJSON string + }{ + { + wantJSON: ` + { + "accessList": [ + { + "address": "0x1111111111111111111111111111111111111111", + "storageKeys": [ + "0x2222222222222222222222222222222222222222222222222222222222222222" + ] + } + ], + "gasUsed": "0x5208", + "error": "execution reverted" + } + `, + result: &AccessListResult{ + AccessList: AccessList{ + { + Address: MustAddressFromHex("0x1111111111111111111111111111111111111111"), + StorageKeys: []Hash{ + MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + }, + }, + }, + GasUsed: 21000, + Error: "execution reverted", + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + result := &AccessListResult{} + + err := result.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.result, result) + + j, err := result.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestStorageProof_JSON(t *testing.T) { + tests := []struct { + proof *StorageProof + wantJSON string + }{ + { + wantJSON: ` + { + "key": "0x1111111111111111111111111111111111111111111111111111111111111111", + "value": "0x2a", + "proof": ["0x01020304", "0x05060708"] + } + `, + proof: &StorageProof{ + Key: MustHashFromHex("0x1111111111111111111111111111111111111111111111111111111111111111", PadNone), + Value: big.NewInt(42), + Proof: []Bytes{{1, 2, 3, 4}, {5, 6, 7, 8}}, + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + proof := &StorageProof{} + + err := proof.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.proof, proof) + + j, err := proof.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestAccountProof_JSON(t *testing.T) { + tests := []struct { + proof *AccountProof + wantJSON string + }{ + { + wantJSON: ` + { + "address": "0x1111111111111111111111111111111111111111", + "accountProof": ["0x01020304"], + "balance": "0xde0b6b3a7640000", + "codeHash": "0x2222222222222222222222222222222222222222222222222222222222222222", + "nonce": "0x7", + "storageHash": "0x3333333333333333333333333333333333333333333333333333333333333333", + "storageProof": [ + { + "key": "0x4444444444444444444444444444444444444444444444444444444444444444", + "value": "0x2a", + "proof": ["0x05060708"] + } + ] + } + `, + proof: &AccountProof{ + Address: MustAddressFromHex("0x1111111111111111111111111111111111111111"), + AccountProof: []Bytes{{1, 2, 3, 4}}, + Balance: big.NewInt(1000000000000000000), + CodeHash: MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + Nonce: 7, + StorageHash: MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", PadNone), + StorageProof: []StorageProof{ + { + Key: MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + Value: big.NewInt(42), + Proof: []Bytes{{5, 6, 7, 8}}, + }, + }, + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + proof := &AccountProof{} + + err := proof.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.proof, proof) + + j, err := proof.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestLog_JSON(t *testing.T) { + tests := []struct { + log *Log + wantJSON string + }{ + { + wantJSON: ` + { + "address": "0x1111111111111111111111111111111111111111", + "topics": [ + "0x2222222222222222222222222222222222222222222222222222222222222222", + "0x3333333333333333333333333333333333333333333333333333333333333333" + ], + "data": "0x01020304", + "blockHash": "0x4444444444444444444444444444444444444444444444444444444444444444", + "blockNumber": "0x5", + "transactionHash": "0x6666666666666666666666666666666666666666666666666666666666666666", + "transactionIndex": "0x7", + "logIndex": "0x8", + "removed": true + } + `, + log: &Log{ + Address: MustAddressFromHex("0x1111111111111111111111111111111111111111"), + Topics: []Hash{ + MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone), + MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", PadNone), + }, + Data: []byte{1, 2, 3, 4}, + BlockHash: MustHashFromHexPtr("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + BlockNumber: big.NewInt(5), + TransactionHash: MustHashFromHexPtr("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + TransactionIndex: ptr(uint64(7)), + LogIndex: ptr(uint64(8)), + Removed: true, + }, + }, + { + // A pending log: every nullable field is absent. + wantJSON: ` + { + "address": "0x1111111111111111111111111111111111111111", + "topics": [], + "data": "0x", + "blockHash": null, + "blockNumber": null, + "transactionHash": null, + "transactionIndex": null, + "logIndex": null, + "removed": false + } + `, + log: &Log{ + Address: MustAddressFromHex("0x1111111111111111111111111111111111111111"), + Topics: []Hash{}, + Data: []byte{}, + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + log := &Log{} + + err := log.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.log, log) + + j, err := log.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestFilterLogsQuery_JSON(t *testing.T) { + tests := []struct { + query *FilterLogsQuery + wantJSON string + }{ + { + // oneOrList collapses a single-element list to a bare value on + // output, so wantJSON is written in that canonical form. See + // TestFilterLogsQuery_JSON_OneOrList for the equivalence of the + // two input spellings. + wantJSON: ` + { + "address": [ + "0x1111111111111111111111111111111111111111", + "0x2222222222222222222222222222222222222222" + ], + "fromBlock": "0x1", + "toBlock": "latest", + "topics": [ + "0x3333333333333333333333333333333333333333333333333333333333333333", + [ + "0x4444444444444444444444444444444444444444444444444444444444444444", + "0x5555555555555555555555555555555555555555555555555555555555555555" + ] + ], + "blockhash": "0x6666666666666666666666666666666666666666666666666666666666666666" + } + `, + query: &FilterLogsQuery{ + Address: []Address{ + MustAddressFromHex("0x1111111111111111111111111111111111111111"), + MustAddressFromHex("0x2222222222222222222222222222222222222222"), + }, + FromBlock: ptr(BlockNumberFromUint64(1)), + ToBlock: ptr(LatestBlockNumber), + Topics: [][]Hash{ + {MustHashFromHex("0x3333333333333333333333333333333333333333333333333333333333333333", PadNone)}, + { + MustHashFromHex("0x4444444444444444444444444444444444444444444444444444444444444444", PadNone), + MustHashFromHex("0x5555555555555555555555555555555555555555555555555555555555555555", PadNone), + }, + }, + BlockHash: MustHashFromHexPtr("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + }, + }, + } + for n, tt := range tests { + t.Run(fmt.Sprintf("case-%d", n+1), func(t *testing.T) { + query := &FilterLogsQuery{} + + err := query.UnmarshalJSON([]byte(tt.wantJSON)) + require.NoError(t, err) + assert.Equal(t, tt.query, query) + + j, err := query.MarshalJSON() + require.NoError(t, err) + assert.JSONEq(t, tt.wantJSON, string(j)) + }) + } +} + +func TestFilterLogsQuery_JSON_OneOrList(t *testing.T) { + tests := []struct { + name string + json string + }{ + { + name: "bare values", + json: ` + { + "address": "0x1111111111111111111111111111111111111111", + "topics": ["0x2222222222222222222222222222222222222222222222222222222222222222"] + } + `, + }, + { + name: "lists", + json: ` + { + "address": ["0x1111111111111111111111111111111111111111"], + "topics": [["0x2222222222222222222222222222222222222222222222222222222222222222"]] + } + `, + }, + } + want := &FilterLogsQuery{ + Address: []Address{MustAddressFromHex("0x1111111111111111111111111111111111111111")}, + Topics: [][]Hash{ + {MustHashFromHex("0x2222222222222222222222222222222222222222222222222222222222222222", PadNone)}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + query := &FilterLogsQuery{} + + err := query.UnmarshalJSON([]byte(tt.json)) + require.NoError(t, err) + assert.Equal(t, want, query) + }) + } +} + +func testBloom() []byte { + b := make([]byte, bloomLength) + b[bloomLength-3] = 1 + b[bloomLength-2] = 2 + b[bloomLength-1] = 3 + return b +} + +var testBloomHex = func() string { + s := "0x" + for _, b := range testBloom() { + s += fmt.Sprintf("%02x", b) + } + return s +}() diff --git a/types/tx_blob.go b/types/tx_blob.go index 57fa389..db4cc15 100644 --- a/types/tx_blob.go +++ b/types/tx_blob.go @@ -55,7 +55,7 @@ func (t *TransactionBlob) SigningHash() (Hash, error) { input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) maxFeePerBlobGas = &rlp.BigInt{} - blobHashes = (rlp.TypedList[Hash])(nil) + blobHashes = (rlp.TypedList[kzgHash])(nil) ) if t.ChainID != nil { chainID = rlp.Uint(*t.ChainID) @@ -88,9 +88,9 @@ func (t *TransactionBlob) SigningHash() (Hash, error) { maxFeePerBlobGas = (*rlp.BigInt)(t.MaxFeePerBlobGas) } if len(t.Blobs) > 0 { - blobHashes = make(rlp.TypedList[Hash], len(t.Blobs)) + blobHashes = make(rlp.TypedList[kzgHash], len(t.Blobs)) for i := range t.Blobs { - blobHashes[i] = &t.Blobs[i].Hash + blobHashes[i] = (*kzgHash)(&t.Blobs[i].Hash) } } bin, err := rlp.List{ @@ -135,7 +135,7 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { input = (rlp.Bytes)(nil) accessList = (AccessList)(nil) maxFeePerBlobGas = &rlp.BigInt{} - blobHashes = (rlp.TypedList[Hash])(nil) + blobHashes = (rlp.TypedList[kzgHash])(nil) blobs = (rlp.TypedList[kzgBlob])(nil) commitments = (rlp.TypedList[kzgCommitment])(nil) proofs = (rlp.TypedList[kzgProof])(nil) @@ -174,11 +174,10 @@ func (t TransactionBlob) EncodeRLP() ([]byte, error) { maxFeePerBlobGas = (*rlp.BigInt)(t.MaxFeePerBlobGas) } if len(t.Blobs) > 0 { - blobHashes = make(rlp.TypedList[Hash], 0, len(t.Blobs)) + blobHashes = make(rlp.TypedList[kzgHash], 0, len(t.Blobs)) for i := range t.Blobs { blob := t.Blobs[i] - - blobHashes = append(blobHashes, &blob.Hash) + blobHashes = append(blobHashes, (*kzgHash)(&blob.Hash)) if blob.Sidecar != nil { blobs.Add((*kzgBlob)(&blob.Sidecar.Blob)) commitments.Add((*kzgCommitment)(&blob.Sidecar.Commitment)) @@ -338,7 +337,7 @@ func (t *TransactionBlob) DecodeRLP(data []byte) (int, error) { if len(*blobHashes) > 0 { t.Blobs = make([]BlobInfo, len(*blobHashes)) for i, hash := range *blobHashes { - blob := BlobInfo{Hash: *hash} + blob := BlobInfo{Hash: crypto.KZGHash(*hash)} if i < len(*blobs) && i < len(*commitments) && i < len(*proofs) { blob.Sidecar = &BlobSidecar{ Blob: crypto.KZGBlob(*(*blobs)[i]), diff --git a/types/tx_blob_test.go b/types/tx_blob_test.go index 1b82913..a0b5d19 100644 --- a/types/tx_blob_test.go +++ b/types/tx_blob_test.go @@ -56,8 +56,8 @@ func TestTransactionBlob_JSON(t *testing.T) { BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ - {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, - {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, + {Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666")}, + {Hash: mustKZGHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777")}, }, }, }, @@ -235,8 +235,8 @@ func TestTransactionBlob_RLP(t *testing.T) { BlobData: BlobData{ MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ - {Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone)}, - {Hash: MustHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777", PadNone)}, + {Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666")}, + {Hash: mustKZGHashFromHex("0x7777777777777777777777777777777777777777777777777777777777777777")}, }, }, }, @@ -376,7 +376,7 @@ func TestTransactionBlob_CalculateSigningHash(t *testing.T) { MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666"), }, }, }, diff --git a/types/tx_decoder_test.go b/types/tx_decoder_test.go index 2973ea9..5570ab5 100644 --- a/types/tx_decoder_test.go +++ b/types/tx_decoder_test.go @@ -177,7 +177,7 @@ func TestTransactionDecoder_DecodeRLP(t *testing.T) { MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666"), }, }, }, @@ -440,7 +440,7 @@ func TestTransactionDeocder_DecodeJSON(t *testing.T) { MaxFeePerBlobGas: big.NewInt(3000000000), Blobs: []BlobInfo{ { - Hash: MustHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666", PadNone), + Hash: mustKZGHashFromHex("0x6666666666666666666666666666666666666666666666666666666666666666"), }, }, }, diff --git a/types/types.go b/types/types.go index 2c73f1a..298685c 100644 --- a/types/types.go +++ b/types/types.go @@ -1153,8 +1153,13 @@ func (l oneOrList[T]) MarshalJSON() ([]byte, error) { } func (l *oneOrList[T]) UnmarshalJSON(input []byte) error { - if len(input) >= 1 && (input[0] == '[' || input[0] == '{') { - return json.Unmarshal(input, l) + if len(input) >= 1 && input[0] == '[' { + var list []T + if err := json.Unmarshal(input, &list); err != nil { + return err + } + *l = list + return nil } var i T if err := json.Unmarshal(input, &i); err != nil { @@ -1164,6 +1169,25 @@ func (l *oneOrList[T]) UnmarshalJSON(input []byte) error { return nil } +// kzgHash is a fixed-length byte array used for KZG hash. +type kzgHash [crypto.KZGHashSize]byte + +func (t kzgHash) MarshalJSON() ([]byte, error) { + return bytesMarshalJSON(t[:]), nil +} + +func (t *kzgHash) UnmarshalJSON(input []byte) error { + return fixedBytesUnmarshalJSON(input, t[:]) +} + +func (t kzgHash) EncodeRLP() ([]byte, error) { + return rlp.Encode(rlp.Bytes(t[:])) +} + +func (t *kzgHash) DecodeRLP(data []byte) (int, error) { + return fixedBytesDecodeRLP(data, t[:]) +} + // kzgBlob is a fixed-length byte array used for KZG blob. type kzgBlob [crypto.KZGBlobSize]byte diff --git a/types/util_test.go b/types/util_test.go index 090059f..37e3ef0 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -5,8 +5,20 @@ import ( "testing" "github.com/stretchr/testify/assert" + + "github.com/defiweb/go-eth/crypto/primitives" + "github.com/defiweb/go-eth/hexutil" ) +func mustKZGHashFromHex(h string) (k primitives.KZGHash) { + b, err := hexutil.HexToBytes(h) + if err != nil { + return primitives.KZGHash{} + } + copy(k[:], b) + return k +} + func assertEqualTX(t *testing.T, actual, expected Transaction) { assert.Equal(t, deref(reflect.TypeOf(actual)), deref(reflect.TypeOf(expected))) if _, ok := expected.(HasSigningData); ok { diff --git a/wallet/key_hd.go b/wallet/key_hd.go index 919480d..41e0e99 100644 --- a/wallet/key_hd.go +++ b/wallet/key_hd.go @@ -6,8 +6,6 @@ import ( "strconv" "github.com/tyler-smith/go-bip39" - - "github.com/defiweb/go-eth/crypto" ) // The code below is based on: @@ -114,7 +112,7 @@ func (m Mnemonic) Derive(path DerivationPath) (*PrivateKey, error) { return nil, err } } - return NewKeyFromECDSA(crypto.PrivateKey(key.key)), nil + return NewKeyFromECDSA(key.key) } // ParseDerivationPath converts a BIP-33 derivation path string into the diff --git a/wallet/key_json.go b/wallet/key_json.go index 7c0b077..458e68f 100644 --- a/wallet/key_json.go +++ b/wallet/key_json.go @@ -34,7 +34,10 @@ func NewKeyFromJSONContent(content []byte, passphrase string) (*PrivateKey, erro if err != nil { return nil, err } - key := NewKeyFromBytes(prv) + key, err := NewKeyFromBytes(prv) + if err != nil { + return nil, err + } if !jKey.Address.IsZero() && jKey.Address != key.Address() { return nil, errors.New("decrypted key address does not match address in file") } diff --git a/wallet/key_json_v3.go b/wallet/key_json_v3.go index cd1aa44..eb0b475 100644 --- a/wallet/key_json_v3.go +++ b/wallet/key_json_v3.go @@ -1,11 +1,11 @@ package wallet import ( - "bytes" "crypto/aes" "crypto/cipher" "crypto/rand" "crypto/sha256" + "crypto/subtle" "encoding/hex" "fmt" "io" @@ -29,6 +29,14 @@ const ( scryptDKLen = 32 ) +// Upper bounds on the KDF parameters accepted from a keystore file. +const ( + maxScryptN = 1 << 22 + maxScryptR = 32 + maxScryptP = 16 + maxPBKDF2Count = 10_000_000 +) + func encryptV3Key(key crypto.PrivateKey, passphrase string, scryptN, scryptP int) (*jsonKey, error) { // Generate a random salt. salt := make([]byte, 32) @@ -99,10 +107,10 @@ func decryptV3Key(cryptoJson jsonKeyCrypto, passphrase []byte) ([]byte, error) { return nil, err } - // VerifyHash the derived key matches the key in the JSON. If not, the + // Verify that the derived key matches the key in the JSON. If not, the // passphrase is incorrect. calculatedMAC := crypto.Keccak256(derivedKey[16:32], cryptoJson.CipherText) - if !bytes.Equal(calculatedMAC[:], cryptoJson.MAC) { + if subtle.ConstantTimeCompare(calculatedMAC[:], cryptoJson.MAC) != 1 { return nil, fmt.Errorf("invalid passphrase or keyfile") } @@ -117,8 +125,19 @@ func decryptV3Key(cryptoJson jsonKeyCrypto, passphrase []byte) ([]byte, error) { // deriveKey returns the derived key from the JSON keyfile. func deriveKey(cryptoJSON jsonKeyCrypto, passphrase []byte) ([]byte, error) { + if cryptoJSON.KDFParams.DKLen != scryptDKLen { + return nil, fmt.Errorf("invalid KDF key length: got %d, want %d", cryptoJSON.KDFParams.DKLen, scryptDKLen) + } switch cryptoJSON.KDF { case "scrypt": + switch { + case cryptoJSON.KDFParams.N <= 1 || cryptoJSON.KDFParams.N > maxScryptN: + return nil, fmt.Errorf("invalid scrypt N: %d", cryptoJSON.KDFParams.N) + case cryptoJSON.KDFParams.R <= 0 || cryptoJSON.KDFParams.R > maxScryptR: + return nil, fmt.Errorf("invalid scrypt r: %d", cryptoJSON.KDFParams.R) + case cryptoJSON.KDFParams.P <= 0 || cryptoJSON.KDFParams.P > maxScryptP: + return nil, fmt.Errorf("invalid scrypt p: %d", cryptoJSON.KDFParams.P) + } return scrypt.Key( passphrase, cryptoJSON.KDFParams.Salt, @@ -131,6 +150,9 @@ func deriveKey(cryptoJSON jsonKeyCrypto, passphrase []byte) ([]byte, error) { if cryptoJSON.KDFParams.PRF != "hmac-sha256" { return nil, fmt.Errorf("unsupported PBKDF2 PRF: %s", cryptoJSON.KDFParams.PRF) } + if cryptoJSON.KDFParams.C <= 0 || cryptoJSON.KDFParams.C > maxPBKDF2Count { + return nil, fmt.Errorf("invalid PBKDF2 iteration count: %d", cryptoJSON.KDFParams.C) + } key := pbkdf2.Key( passphrase, cryptoJSON.KDFParams.Salt, diff --git a/wallet/key_priv.go b/wallet/key_priv.go index 00bf93e..4218872 100644 --- a/wallet/key_priv.go +++ b/wallet/key_priv.go @@ -3,6 +3,8 @@ package wallet import ( "context" "encoding/json" + "errors" + "fmt" "github.com/decred/dcrd/dcrec/secp256k1/v4" @@ -18,20 +20,47 @@ type PrivateKey struct { } // NewKeyFromECDSA creates a new private key from a [crypto.PrivateKey]. -func NewKeyFromECDSA(prv crypto.PrivateKey) *PrivateKey { +// +// It key must be a valid secp256k1 scalar. +func NewKeyFromECDSA(prv crypto.PrivateKey) (*PrivateKey, error) { + if err := validateScalar(prv); err != nil { + return nil, err + } pub := crypto.ECPrivateKeyToPublicKey(prv) return &PrivateKey{ private: prv, public: pub, address: types.Address(crypto.ECPublicKeyToAddress(pub)), + }, nil +} + +// MustNewKeyFromECDSA works like [NewKeyFromECDSA] but panics on error. +func MustNewKeyFromECDSA(prv crypto.PrivateKey) *PrivateKey { + key, err := NewKeyFromECDSA(prv) + if err != nil { + panic(err) } + return key } // NewKeyFromBytes creates a new private key from private key bytes. -func NewKeyFromBytes(prv []byte) *PrivateKey { - key := secp256k1.PrivKeyFromBytes(prv) - defer key.Zero() - return NewKeyFromECDSA(crypto.PrivateKey(key.Serialize())) +// +// The input must be exactly [crypto.PrivateKeySize] bytes, big-endian, and a +// valid secp256k1 scalar. +func NewKeyFromBytes(prv []byte) (*PrivateKey, error) { + if len(prv) != crypto.PrivateKeySize { + return nil, fmt.Errorf("invalid private key length: got %d, want %d", len(prv), crypto.PrivateKeySize) + } + return NewKeyFromECDSA(crypto.PrivateKey(prv)) +} + +// MustNewKeyFromBytes works like [NewKeyFromBytes] but panics on error. +func MustNewKeyFromBytes(prv []byte) *PrivateKey { + key, err := NewKeyFromBytes(prv) + if err != nil { + panic(err) + } + return key } // NewRandomKey creates a random private key. @@ -40,7 +69,7 @@ func NewRandomKey() *PrivateKey { if err != nil { panic(err) } - return NewKeyFromECDSA(key) + return MustNewKeyFromECDSA(key) } // PublicKey returns the ECDSA public key. @@ -107,3 +136,14 @@ func (k *PrivateKey) VerifyMessage(_ context.Context, data []byte, sig types.Sig } return types.Address(*addr) == k.address } + +func validateScalar(prv crypto.PrivateKey) error { + var s secp256k1.ModNScalar + overflow := s.SetBytes((*[crypto.PrivateKeySize]byte)(&prv)) + zeroBit := s.IsZeroBit() + s.Zero() + if overflow|zeroBit != 0 { + return errors.New("invalid private key: scalar must be in the range [1, N-1]") + } + return nil +} From 1075a5582c55cb82b45d2148bf5dd095bddf2523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 02:46:03 +0200 Subject: [PATCH 38/44] Update stream transports --- rpc/transport/ipc.go | 35 ++++++++++++-- rpc/transport/stream.go | 84 ++++++++++++++++++++------------- rpc/transport/transport_test.go | 22 +++++++-- rpc/transport/websocket.go | 34 ++++++++++++- 4 files changed, 132 insertions(+), 43 deletions(-) diff --git a/rpc/transport/ipc.go b/rpc/transport/ipc.go index 1915e55..e82d555 100644 --- a/rpc/transport/ipc.go +++ b/rpc/transport/ipc.go @@ -27,6 +27,26 @@ type IPCOptions struct { // Timeout is the timeout for the IPC requests. Default is 60s. Timeout time.Duration + // ReadBufferSize is the buffer size for incoming messages. The default + // is 1. + // + // Once the buffer is full, the transport stops reading from the + // connection until it drains. + ReadBufferSize int + + // WriteBufferSize is the buffer size for outgoing requests. The default + // is 1. + WriteBufferSize int + + // SubscriptionBufferSize is the buffer size of the message queue of each + // subscription. The default is 32. + // + // Once the buffer of any subscription is full, the transport stops reading + // from the connection, which stalls every other subscription and call + // sharing it. No message is dropped, but nothing else progresses either, + // so this should be sized for the slowest consumer. + SubscriptionBufferSize int + // ErrorCh is an optional channel used to report errors. ErrorCh chan error } @@ -45,11 +65,20 @@ func NewIPC(opts IPCOptions) (*IPC, error) { return nil, fmt.Errorf("failed to dial IPC: %w", err) } ipc := &IPC{conn: conn} - ipc.stream.initStream( - opts.Context, + streamOpts := []streamOption{ withStreamTimeout(opts.Timeout), withStreamErrorCh(opts.ErrorCh), - ) + } + if opts.ReadBufferSize > 0 { + streamOpts = append(streamOpts, withReadBufferSize(opts.ReadBufferSize)) + } + if opts.WriteBufferSize > 0 { + streamOpts = append(streamOpts, withWriteBufferSize(opts.WriteBufferSize)) + } + if opts.SubscriptionBufferSize > 0 { + streamOpts = append(streamOpts, withSubscriptionBufferSize(opts.SubscriptionBufferSize)) + } + ipc.stream.initStream(opts.Context, streamOpts...) go ipc.readerRoutine() go ipc.writerRoutine() return ipc, nil diff --git a/rpc/transport/stream.go b/rpc/transport/stream.go index 6876297..0b55a2d 100644 --- a/rpc/transport/stream.go +++ b/rpc/transport/stream.go @@ -12,8 +12,33 @@ import ( "github.com/defiweb/go-eth/types" ) +const ( + defaultStreamTimeout = time.Minute + defaultStreamReadBufferSize = 1 + defaultStreamWriteBufferSize = 1 + defaultStreamSubscriptionBufferSize = 32 +) + type streamOption func(*stream) +func withWriteBufferSize(size int) streamOption { + return func(s *stream) { + s.writeCh = make(chan rpcRequest, size) + } +} + +func withReadBufferSize(size int) streamOption { + return func(s *stream) { + s.readCh = make(chan rpcResponse, size) + } +} + +func withSubscriptionBufferSize(size int) streamOption { + return func(s *stream) { + s.bufSize = size + } +} + func withStreamTimeout(timeout time.Duration) streamOption { return func(s *stream) { s.timeout = timeout @@ -40,6 +65,7 @@ type stream struct { readCh chan rpcResponse // Channel for receiving responses used by structs that embed stream. errCh chan error // Channel to which errors are sent. timeout time.Duration // Timeout for requests. + bufSize int // Buffer size for the subscription channels. closeFunc func() // Callback that is called when the stream is closed. // State fields. Should not be accessed by structs that embed stream. @@ -51,13 +77,18 @@ type stream struct { // the required goroutines. func (s *stream) initStream(ctx context.Context, opts ...streamOption) *stream { s.ctx = ctx - s.writeCh = make(chan rpcRequest) - s.readCh = make(chan rpcResponse) - s.timeout = time.Minute + s.timeout = defaultStreamTimeout + s.bufSize = defaultStreamSubscriptionBufferSize s.chs = newStreamChannels() for _, opt := range opts { opt(s) } + if s.writeCh == nil { + s.writeCh = make(chan rpcRequest, defaultStreamWriteBufferSize) + } + if s.readCh == nil { + s.readCh = make(chan rpcResponse, defaultStreamReadBufferSize) + } go s.streamRoutine() return s } @@ -79,7 +110,6 @@ func (s *stream) Call(ctx context.Context, result any, method string, args ...an if !ok { return errors.New("stream closed") } - defer s.chs.delCallCh(id) // Send the request. select { @@ -127,7 +157,7 @@ func (s *stream) Subscribe(ctx context.Context, method string, args ...any) (cha return nil, "", err } id := rawID.String() - ch := make(chan json.RawMessage) + ch := make(chan json.RawMessage, s.bufSize) if !s.chs.addSubCh(id, ch) { return nil, "", errors.New("stream closed") } @@ -167,10 +197,10 @@ func (s *stream) streamRoutine() { s.error(fmt.Errorf("failed to unmarshal subscription: %w", err)) continue } - s.chs.subChSend(s.ctx, sub.Subscription.String(), sub.Result) + s.chs.sendSubCh(s.ctx, sub.Subscription.String(), sub.Result) default: // If the ID is not nil, it is a response to a request. - s.chs.callChSend(s.ctx, *res.ID, res) + s.chs.sendCallCh(s.ctx, *res.ID, res) } case <-s.ctx.Done(): return @@ -203,8 +233,6 @@ func (s *stream) error(err error) { } } -var callChPool = sync.Pool{New: func() any { return make(chan rpcResponse) }} - type streamChannels struct { mu sync.RWMutex @@ -225,7 +253,7 @@ func (s *streamChannels) addCallCh(id uint64) (chan rpcResponse, bool) { if s.calls == nil { return nil, false } - ch := callChPool.Get().(chan rpcResponse) + ch := make(chan rpcResponse, 1) s.calls[id] = ch return ch, true } @@ -240,18 +268,6 @@ func (s *streamChannels) addSubCh(id string, ch chan json.RawMessage) bool { return true } -func (s *streamChannels) delCallCh(id uint64) { - s.mu.Lock() - ch, ok := s.calls[id] - if ok { - delete(s.calls, id) - } - s.mu.Unlock() - if ok { - callChPool.Put(ch) - } -} - func (s *streamChannels) delSubCh(id string) bool { s.mu.Lock() defer s.mu.Unlock() @@ -263,18 +279,21 @@ func (s *streamChannels) delSubCh(id string) bool { return false } -func (s *streamChannels) callChSend(ctx context.Context, id uint64, res rpcResponse) { - s.mu.RLock() - defer s.mu.RUnlock() - if ch := s.calls[id]; ch != nil { - select { - case ch <- res: - case <-ctx.Done(): - } +func (s *streamChannels) sendCallCh(ctx context.Context, id uint64, res rpcResponse) { + s.mu.Lock() + defer s.mu.Unlock() + ch := s.calls[id] + if ch == nil { + return + } + delete(s.calls, id) + select { + case ch <- res: + case <-ctx.Done(): } } -func (s *streamChannels) subChSend(ctx context.Context, id string, res json.RawMessage) { +func (s *streamChannels) sendSubCh(ctx context.Context, id string, res json.RawMessage) { s.mu.RLock() defer s.mu.RUnlock() if ch := s.subs[id]; ch != nil { @@ -288,9 +307,6 @@ func (s *streamChannels) subChSend(ctx context.Context, id string, res json.RawM func (s *streamChannels) close() { s.mu.Lock() defer s.mu.Unlock() - for _, ch := range s.calls { - callChPool.Put(ch) - } for _, ch := range s.subs { close(ch) } diff --git a/rpc/transport/transport_test.go b/rpc/transport/transport_test.go index 5f3d929..cbbac08 100644 --- a/rpc/transport/transport_test.go +++ b/rpc/transport/transport_test.go @@ -24,16 +24,30 @@ func newMockTransport() *mockTransport { func (t *mockTransport) Call(ctx context.Context, result any, method string, args ...any) error { t.callCount++ - return <-t.callResult + select { + case <-ctx.Done(): + return ctx.Err() + case err := <-t.callResult: + return err + } } func (t *mockTransport) Subscribe(ctx context.Context, method string, args ...any) (ch chan json.RawMessage, id string, err error) { t.subCount++ - err = <-t.subResult - return nil, "", err + select { + case <-ctx.Done(): + return nil, "", ctx.Err() + case err := <-t.subResult: + return nil, "", err + } } func (t *mockTransport) Unsubscribe(ctx context.Context, id string) error { t.unsubCount++ - return <-t.unsubResult + select { + case <-ctx.Done(): + return ctx.Err() + case err := <-t.unsubResult: + return err + } } diff --git a/rpc/transport/websocket.go b/rpc/transport/websocket.go index c9e05dd..f0a7e6c 100644 --- a/rpc/transport/websocket.go +++ b/rpc/transport/websocket.go @@ -49,6 +49,26 @@ type WebsocketOptions struct { // A negative value disables pings. PingInterval time.Duration + // ReadBufferSize is the buffer size for incoming messages. The default + // is 1. + // + // Once the buffer is full, the transport stops reading from the + // connection until it drains. + ReadBufferSize int + + // WriteBufferSize is the buffer size for outgoing requests. The default + // is 1. + WriteBufferSize int + + // SubscriptionBufferSize is the buffer size of the message queue of each + // subscription. The default is 32. + // + // Once the buffer of any subscription is full, the transport stops reading + // from the connection, which stalls every other subscription and call + // sharing it. No message is dropped, but nothing else progresses either, + // so this should be sized for the slowest consumer. + SubscriptionBufferSize int + // ErrorCh is an optional channel used to report errors. ErrorCh chan error } @@ -87,10 +107,20 @@ func NewWebsocket(opts WebsocketOptions) (*Websocket, error) { conn: conn, ping: opts.PingInterval, } - ws.stream.initStream(opts.Context, + streamOpts := []streamOption{ withStreamErrorCh(opts.ErrorCh), withStreamTimeout(opts.Timeout), - ) + } + if opts.ReadBufferSize > 0 { + streamOpts = append(streamOpts, withReadBufferSize(opts.ReadBufferSize)) + } + if opts.WriteBufferSize > 0 { + streamOpts = append(streamOpts, withWriteBufferSize(opts.WriteBufferSize)) + } + if opts.SubscriptionBufferSize > 0 { + streamOpts = append(streamOpts, withSubscriptionBufferSize(opts.SubscriptionBufferSize)) + } + ws.stream.initStream(opts.Context, streamOpts...) if ws.ping > 0 { ws.conn.SetPongHandler(func(string) error { ws.resetReadDeadline() From 50cf6d532e2234db40d7773ac7f5d16eb87b9af1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 02:46:21 +0200 Subject: [PATCH 39/44] Fix hijack sign test --- rpc/hijack_sign_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpc/hijack_sign_test.go b/rpc/hijack_sign_test.go index adc7250..dfa84be 100644 --- a/rpc/hijack_sign_test.go +++ b/rpc/hijack_sign_test.go @@ -19,8 +19,8 @@ import ( ) func TestHijackSign(t *testing.T) { - key1 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x01")) // 0x7e5f4552091a69125d5dfcb7b8c2659029395bdf - key2 := wallet.NewKeyFromBytes(hexutil.MustHexToBytes("0x02")) // 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf + key1 := wallet.MustNewKeyFromBytes(hexutil.MustHexToBytes("0x0000000000000000000000000000000000000000000000000000000000000001")) // 0x7e5f4552091a69125d5dfcb7b8c2659029395bdf + key2 := wallet.MustNewKeyFromBytes(hexutil.MustHexToBytes("0x0000000000000000000000000000000000000000000000000000000000000002")) // 0x2b5ad5c4795c026514f8317c7a215e218dccd6cf tc := []struct { name string sign *hijackSign From 503d812d40af852443465c941153bf5c839aa452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 02:46:47 +0200 Subject: [PATCH 40/44] Fix options ordering, doc fixes --- rpc/client.go | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/rpc/client.go b/rpc/client.go index ab2b740..bfde87d 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -1,10 +1,11 @@ package rpc import ( + "cmp" "fmt" "math/big" "reflect" - "sort" + "slices" "github.com/defiweb/go-eth/rpc/transport" "github.com/defiweb/go-eth/types" @@ -94,8 +95,6 @@ func WithPostHijackers(hijackers ...transport.Hijacker) ClientOption { // - eth_sendTransaction - signs the transaction and re-issues it as // eth_sendRawTransaction; downstream hijackers observe the substituted // method name, not the original -// -// This option will modify the provided transaction instance. func WithKeys(keys ...wallet.Key) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -130,8 +129,6 @@ type NonceOptions struct { } // WithNonce sets the nonce in the transaction. -// -// This option will modify the provided transaction instance. func WithNonce(opts NonceOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -166,8 +163,6 @@ type LegacyGasFeeOptions struct { // WithLegacyGasFee estimates the gas price and sets it in the transaction. // // It only works with eth_sendTransaction; raw transactions are not supported. -// -// This option will modify the provided transaction instance. func WithLegacyGasFee(opts LegacyGasFeeOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -217,8 +212,6 @@ type DynamicGasFeeOptions struct { // WithDynamicGasFee estimates the gas price and sets it in the transaction. // // It only works with eth_sendTransaction; raw transactions are not supported. -// -// This option will modify the provided transaction instance. func WithDynamicGasFee(opts DynamicGasFeeOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -256,8 +249,6 @@ type GasLimitOptions struct { } // WithGasLimit estimates the gas limit and sets it in the transaction. -// -// This option will modify the provided transaction instance. func WithGasLimit(opts GasLimitOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -287,8 +278,6 @@ type AddressOptions struct { // WithDefaultAddress sets the default address for calls and transactions. // // To send a call with to a zero address, it must be set explicitly in the call. -// -// This option will modify the provided transaction and call instances. func WithDefaultAddress(opts AddressOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -312,8 +301,6 @@ type ChainIDOptions struct { // WithChainID sets the chain ID in the transaction. // It only works with eth_sendTransaction method. -// -// This option will modify the provided transaction instance. func WithChainID(opts ChainIDOptions) ClientOption { return &option{ apply: func(ctx *ClientContext) error { @@ -398,10 +385,11 @@ func (o *option) Order() int { } func applyOptions(c *ClientContext, opts []ClientOption) error { - sort.Slice(opts, func(i, j int) bool { - return opts[i].Order() < opts[j].Order() + sorted := slices.Clone(opts) + slices.SortStableFunc(sorted, func(a, b ClientOption) int { + return cmp.Compare(a.Order(), b.Order()) }) - for _, opt := range opts { + for _, opt := range sorted { if err := opt.Apply(c); err != nil { return err } From e5a68b36d7c82b5e91db2035aa9b7c3457b6cf83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 02:46:58 +0200 Subject: [PATCH 41/44] Update README --- README.md | 334 +++++++++++++++++++++++++++------ examples/send-tx-blob/key.json | 21 +++ examples/send-tx-blob/main.go | 116 ++++++++++++ examples/subscription/main.go | 6 + 4 files changed, 422 insertions(+), 55 deletions(-) create mode 100644 examples/send-tx-blob/key.json create mode 100644 examples/send-tx-blob/main.go diff --git a/README.md b/README.md index bf78885..8fcf99e 100644 --- a/README.md +++ b/README.md @@ -16,42 +16,49 @@ Key features include: - **Extensible Design**: Modular architecture with customizable transport hijackers and middleware - -- [go-eth](#go-eth) - - [Installation](#installation) - - [Quick start](#quick-start) - - [Connecting to a node](#connecting-to-a-node) - - [Calling a contract method](#calling-a-contract-method) - - [Calling a contract method using a Human-Readable ABI](#calling-a-contract-method-using-a-human-readable-abi) - - [Sending a transaction](#sending-a-transaction) - - [Subscribing to events](#subscribing-to-events) - - [Transports](#transports) - - [Wallets](#wallets) - - [Working with ABI](#working-with-abi) - - [Mapping rules](#mapping-rules) - - [Encoding and Decoding Methods](#encoding-and-decoding-methods) - - [Encoding method arguments](#encoding-method-arguments) - - [Decoding method return values](#decoding-method-return-values) - - [Events / Logs](#events--logs) - - [Decoding events](#decoding-events) - - [Contract ABI](#contract-abi) - - [JSON-ABI](#json-abi) - - [Human-Readable ABI](#human-readable-abi) - - [Errors](#errors) - - [Reverts](#reverts) - - [Panics](#panics) - - [Signature parser syntax](#signature-parser-syntax) - - [Custom types](#custom-types) - - [Simple types](#simple-types) - - [Advanced types](#advanced-types) - - [Client Configuration](#client-configuration) - - [Available Options](#available-options) - - [Transport Hijacking](#transport-hijacking) - - [Cryptographic Functions](#cryptographic-functions) - - [Utility Packages](#utility-packages) - - [Additional tools](#additional-tools) - - [Documentation](#documentation) - +* [go-eth](#go-eth) + * [Installation](#installation) + * [Quick start](#quick-start) + * [Connecting to a node](#connecting-to-a-node) + * [Calling a contract method](#calling-a-contract-method) + * [Calling a contract method using a Human-Readable ABI](#calling-a-contract-method-using-a-human-readable-abi) + * [Sending a transaction](#sending-a-transaction) + * [Sending a blob transaction](#sending-a-blob-transaction) + * [Subscribing to events](#subscribing-to-events) + * [Transports](#transports) + * [Wallets](#wallets) + * [Client Configuration](#client-configuration) + * [Available Options](#available-options) + * [Transport Hijacking](#transport-hijacking) + * [Ordering](#ordering) + * [Argument copying](#argument-copying) + * [Working with ABI](#working-with-abi) + * [Mapping rules](#mapping-rules) + * [Encoding and Decoding Methods](#encoding-and-decoding-methods) + * [Encoding method arguments](#encoding-method-arguments) + * [Decoding method return values](#decoding-method-return-values) + * [Events / Logs](#events--logs) + * [Decoding events](#decoding-events) + * [Contract ABI](#contract-abi) + * [JSON-ABI](#json-abi) + * [Human-Readable ABI](#human-readable-abi) + * [Errors](#errors) + * [Reverts](#reverts) + * [Panics](#panics) + * [Signature parser syntax](#signature-parser-syntax) + * [Custom types](#custom-types) + * [Simple types](#simple-types) + * [Advanced types](#advanced-types) + * [Cryptographic Functions](#cryptographic-functions) + * [ECDSA Operations](#ecdsa-operations) + * [Hashing](#hashing) + * [KZG4844 (EIP-4844 Blob Transactions)](#kzg4844-eip-4844-blob-transactions) + * [Transaction Signing](#transaction-signing) + * [Utility Packages](#utility-packages) + * [HexUtil Package](#hexutil-package) + * [Types Package](#types-package) + * [Additional tools](#additional-tools) + * [Documentation](#documentation) ## Installation @@ -379,6 +386,136 @@ func keyPath() string { } ``` +### Sending a blob transaction + +EIP-4844 blob transactions carry large data payloads that the EVM cannot read +but that remain available to the network for a limited time. The example below +posts two blobs and prints their versioned hashes. + +Note that the blob gas price is not covered by any of the client options — it +has to be set explicitly with `SetMaxFeePerBlobGas`. + + + +```go +package main + +import ( + "context" + "fmt" + "math/big" + "os" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/rpc" + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" + "github.com/defiweb/go-eth/wallet" +) + +func main() { + // Load the private key. + k, err := wallet.NewKeyFromJSON(keyPath(), "test123") + if err != nil { + panic(err) + } + + // Create transport. + t, err := transport.NewHTTP(transport.HTTPOptions{URL: "https://ethereum.publicnode.com"}) + if err != nil { + panic(err) + } + + // Create a JSON-RPC client. + c, err := rpc.NewClient( + // Transport is always required. + rpc.WithTransport(t), + + // Specify a key for signing transactions. If provided, the client + // will sign transactions before sending them to the node. + rpc.WithKeys(k), + + // Specify the default "from" address for transactions. + rpc.WithDefaultAddress(rpc.AddressOptions{ + Address: k.Address(), + }), + + // Estimate gas limit for transactions if not provided explicitly. + rpc.WithGasLimit(rpc.GasLimitOptions{ + Multiplier: 1.25, + }), + + // Estimate gas price for transactions if not provided explicitly. + rpc.WithDynamicGasFee(rpc.DynamicGasFeeOptions{ + GasPriceMultiplier: 1.25, + PriorityFeePerGasMultiplier: 1.25, + }), + + // Automatically set the chain ID for transactions. + rpc.WithChainID(rpc.ChainIDOptions{}), + + // Automatically set the nonce for transactions. + rpc.WithNonce(rpc.NonceOptions{}), + ) + if err != nil { + panic(err) + } + + // Prepare the blobs. + // + // A blob is a fixed 128 KiB, so it is allocated on the heap rather than + // as a local variable. + // + // The data is used verbatim. EIP-4844 requires every 32-byte field + // element of a blob to be smaller than the BLS12-381 modulus, so + // arbitrary bytes must be encoded before being placed in a blob. + var blobs []types.BlobInfo + for _, data := range []string{"hello world 1", "hello world 2"} { + blob := new(crypto.KZGBlob) + copy(blob[:], data) + + // NewBlobInfo computes the KZG commitment, the KZG proof, and the + // versioned hash for the blob. + info, err := types.NewBlobInfo(blob) + if err != nil { + panic(err) + } + blobs = append(blobs, info) + } + + // Prepare a transaction. + tx := types.NewTransactionBlob() + tx.SetTo(types.MustAddressFromHex("0x69B352cbE6Fc5C130b6F62cc8f30b9d7B0DC27d0")) + tx.SetBlobs(blobs) + + // The blob gas price is not estimated by any of the client options above, + // so it has to be set explicitly. + tx.SetMaxFeePerBlobGas(big.NewInt(1e10)) + + txHash, err := c.SendTransaction(context.Background(), tx) + if err != nil { + panic(err) + } + + // Print the transaction hash and the versioned hash of each blob. The + // versioned hashes are what the EVM sees; the blobs themselves are not + // accessible to contracts and are discarded by the network after a few + // weeks. + fmt.Printf("Transaction hash: %s\n", txHash.String()) + for i, b := range blobs { + fmt.Printf("Blob %d versioned hash: %s\n", i, hexutil.BytesToHex(b.Hash[:])) + } +} + +func keyPath() string { + if _, err := os.Stat("./key.json"); err == nil { + return "./key.json" + } + return "./examples/send-tx-blob/key.json" +} +``` + ### Subscribing to events The following example shows how to subscribe to WETH transfer events. @@ -409,6 +546,12 @@ func main() { t, err := transport.NewWebsocket(transport.WebsocketOptions{ Context: ctx, URL: "wss://ethereum.publicnode.com", + + // Size the per-subscription queue for the slowest consumer. Once the + // buffer of any subscription fills up, the transport stops reading + // from the connection, stalling every other subscription and call + // sharing it. + SubscriptionBufferSize: 64, }) if err != nil { panic(err) @@ -525,18 +668,99 @@ The RPC client can be configured with various options to automatically handle tr ### Available Options -| Option | Description | -| ------------------------ | ----------------------------------------- | -| `WithTransport` | Sets the transport for communication | -| `WithKeys` | Adds private keys for transaction signing | -| `WithDefaultAddress` | Sets default sender address | -| `WithChainID` | Auto-sets chain ID for transactions | -| `WithNonce` | Auto-manages transaction nonces | -| `WithGasLimit` | Auto-estimates gas limits | -| `WithLegacyGasFee` | Auto-estimates legacy gas prices | -| `WithDynamicGasFee` | Auto-estimates EIP-1559 gas fees | -| `WithSimulate` | Simulates transactions before sending | -| `WithTransactionDecoder` | Custom transaction decoder | +| Option | Description | +| ------------------------ | ---------------------------------------------------- | +| `WithTransport` | Sets the transport for communication | +| `WithKeys` | Adds private keys for transaction signing | +| `WithDefaultAddress` | Sets default sender address | +| `WithChainID` | Auto-sets chain ID for transactions | +| `WithNonce` | Auto-manages transaction nonces | +| `WithGasLimit` | Auto-estimates gas limits | +| `WithLegacyGasFee` | Auto-estimates legacy gas prices | +| `WithDynamicGasFee` | Auto-estimates EIP-1559 gas fees | +| `WithSimulate` | Simulates transactions before sending | +| `WithTransactionDecoder` | Custom transaction decoder | +| `WithPreHijackers` | Custom middleware, run before the built-in hijackers | +| `WithPostHijackers` | Custom middleware, run after the built-in hijackers | + +Options are order-independent: the client sorts them by a fixed priority before +applying them, so the sequence in which they are passed to `NewClient` does not +matter. + +### Transport Hijacking + +Every option above except `WithTransport` and `WithTransactionDecoder` is +implemented as a *hijacker*: middleware wrapped around the transport that can +inspect and modify a call before it reaches the node. The same mechanism is +available for custom middleware through `WithPreHijackers` and +`WithPostHijackers`. + +A hijacker implements `transport.Hijacker`, which has one method per transport +operation. Returning `nil` from any of them leaves that operation untouched: + +```go +type Hijacker interface { + Call() func(next CallFunc) CallFunc + Subscribe() func(next SubscribeFunc) SubscribeFunc + Unsubscribe() func(next UnsubscribeFunc) UnsubscribeFunc +} +``` + +The example below logs every RPC call and its duration: + +```go +package main + +import ( + "context" + "log" + "time" + + "github.com/defiweb/go-eth/rpc" + "github.com/defiweb/go-eth/rpc/transport" +) + +type logHijacker struct{} + +func (l *logHijacker) Call() func(next transport.CallFunc) transport.CallFunc { + return func(next transport.CallFunc) transport.CallFunc { + return func(ctx context.Context, t transport.Transport, result any, method string, args ...any) error { + start := time.Now() + err := next(ctx, t, result, method, args...) + log.Printf("%s took %s (err: %v)", method, time.Since(start), err) + return err + } + } +} + +// Returning nil leaves subscriptions untouched. +func (l *logHijacker) Subscribe() func(next transport.SubscribeFunc) transport.SubscribeFunc { + return nil +} + +func (l *logHijacker) Unsubscribe() func(next transport.UnsubscribeFunc) transport.UnsubscribeFunc { + return nil +} + +func main() { + t, err := transport.NewHTTP(transport.HTTPOptions{URL: "https://ethereum.publicnode.com"}) + if err != nil { + panic(err) + } + + c, err := rpc.NewClient( + rpc.WithTransport(t), + rpc.WithPreHijackers(&logHijacker{}), + ) + if err != nil { + panic(err) + } + + if _, err := c.BlockNumber(context.Background()); err != nil { + panic(err) + } +} +``` ## Working with ABI @@ -787,7 +1011,7 @@ import ( ) func main() { - abiData := hexutil.MustHexToBytes("0x00000000000000000000000000000000000000000000000002b5e3af16b1880000") + abiData := hexutil.MustHexToBytes("0x000000000000000000000000000000000000000000000002b5e3af16b1880000") // Parse method signature. balanceOf := abi.MustParseMethod("balanceOf(address) returns (uint256)") @@ -1223,21 +1447,21 @@ The package includes full support for KZG commitments and proofs used in blob tr Example KZG usage: ```go -import "github.com/defiweb/go-eth/crypto/kzg4844" +import "github.com/defiweb/go-eth/crypto" -// Create a blob (128KB of data) -var blob kzg4844.Blob +// Create a blob (128 KiB of data) +var blob crypto.KZGBlob copy(blob[:], "your data here...") // Generate commitment -commitment, err := kzg4844.BlobToCommitment(&blob) +commitment, err := crypto.KZGBlobToCommitment(&blob) if err != nil { panic(err) } // Generate proof for a specific point -var point kzg4844.Point -proof, claim, err := kzg4844.ComputeProof(&blob, point) +var point crypto.KZGPoint +proof, claim, err := crypto.KZGComputeProof(&blob, point) ``` ### Transaction Signing diff --git a/examples/send-tx-blob/key.json b/examples/send-tx-blob/key.json new file mode 100644 index 0000000..3a82700 --- /dev/null +++ b/examples/send-tx-blob/key.json @@ -0,0 +1,21 @@ +{ + "address": "2d800d93b065ce011af83f316cef9f0d005b0aa4", + "crypto": { + "cipher": "aes-128-ctr", + "ciphertext": "8051dbab2d2415613751ee755d3b9a1f191c2fa15b4de9349848dcf44e656331", + "cipherparams": { + "iv": "4eb5e582782f64d18c58ddc56692fe91" + }, + "kdf": "scrypt", + "kdfparams": { + "dklen": 32, + "n": 262144, + "p": 1, + "r": 8, + "salt": "8b819d893ebda23c4b31e96dfd1a7f4514a5483840f28fb679197f0fa315ade4" + }, + "mac": "5ea8c70945a1c07f1121ab2798392158bf51eb356854040c8a8bfcb2a23ca5c7" + }, + "id": "53697e14-f0e4-4f87-b300-4163a61bc5ef", + "version": 3 +} diff --git a/examples/send-tx-blob/main.go b/examples/send-tx-blob/main.go new file mode 100644 index 0000000..d1a198a --- /dev/null +++ b/examples/send-tx-blob/main.go @@ -0,0 +1,116 @@ +package main + +import ( + "context" + "fmt" + "math/big" + "os" + + "github.com/defiweb/go-eth/crypto" + "github.com/defiweb/go-eth/hexutil" + "github.com/defiweb/go-eth/rpc" + "github.com/defiweb/go-eth/rpc/transport" + "github.com/defiweb/go-eth/types" + "github.com/defiweb/go-eth/wallet" +) + +func main() { + // Load the private key. + k, err := wallet.NewKeyFromJSON(keyPath(), "test123") + if err != nil { + panic(err) + } + + // Create transport. + t, err := transport.NewHTTP(transport.HTTPOptions{URL: "https://ethereum.publicnode.com"}) + if err != nil { + panic(err) + } + + // Create a JSON-RPC client. + c, err := rpc.NewClient( + // Transport is always required. + rpc.WithTransport(t), + + // Specify a key for signing transactions. If provided, the client + // will sign transactions before sending them to the node. + rpc.WithKeys(k), + + // Specify the default "from" address for transactions. + rpc.WithDefaultAddress(rpc.AddressOptions{ + Address: k.Address(), + }), + + // Estimate gas limit for transactions if not provided explicitly. + rpc.WithGasLimit(rpc.GasLimitOptions{ + Multiplier: 1.25, + }), + + // Estimate gas price for transactions if not provided explicitly. + rpc.WithDynamicGasFee(rpc.DynamicGasFeeOptions{ + GasPriceMultiplier: 1.25, + PriorityFeePerGasMultiplier: 1.25, + }), + + // Automatically set the chain ID for transactions. + rpc.WithChainID(rpc.ChainIDOptions{}), + + // Automatically set the nonce for transactions. + rpc.WithNonce(rpc.NonceOptions{}), + ) + if err != nil { + panic(err) + } + + // Prepare the blobs. + // + // A blob is a fixed 128 KiB, so it is allocated on the heap rather than + // as a local variable. + // + // The data is used verbatim. EIP-4844 requires every 32-byte field + // element of a blob to be smaller than the BLS12-381 modulus, so + // arbitrary bytes must be encoded before being placed in a blob. + var blobs []types.BlobInfo + for _, data := range []string{"hello world 1", "hello world 2"} { + blob := new(crypto.KZGBlob) + copy(blob[:], data) + + // NewBlobInfo computes the KZG commitment, the KZG proof, and the + // versioned hash for the blob. + info, err := types.NewBlobInfo(blob) + if err != nil { + panic(err) + } + blobs = append(blobs, info) + } + + // Prepare a transaction. + tx := types.NewTransactionBlob() + tx.SetTo(types.MustAddressFromHex("0x69B352cbE6Fc5C130b6F62cc8f30b9d7B0DC27d0")) + tx.SetBlobs(blobs) + + // The blob gas price is not estimated by any of the client options above, + // so it has to be set explicitly. + tx.SetMaxFeePerBlobGas(big.NewInt(1e10)) + + txHash, err := c.SendTransaction(context.Background(), tx) + if err != nil { + panic(err) + } + + // Print the transaction hash and the versioned hash of each blob. The + // versioned hashes are what the EVM sees; the blobs themselves are not + // accessible to contracts and are discarded by the network after a few + // weeks. + fmt.Printf("Transaction hash: %s\n", txHash.String()) + for i, b := range blobs { + fmt.Printf("Blob %d versioned hash: %s\n", i, hexutil.BytesToHex(b.Hash[:])) + } +} + +func keyPath() string { + if _, err := os.Stat("./key.json"); err == nil { + return "./key.json" + } + return "./examples/send-tx-blob/key.json" +} diff --git a/examples/subscription/main.go b/examples/subscription/main.go index 92cc032..201801d 100644 --- a/examples/subscription/main.go +++ b/examples/subscription/main.go @@ -21,6 +21,12 @@ func main() { t, err := transport.NewWebsocket(transport.WebsocketOptions{ Context: ctx, URL: "wss://ethereum.publicnode.com", + + // Size the per-subscription queue for the slowest consumer. Once the + // buffer of any subscription fills up, the transport stops reading + // from the connection, stalling every other subscription and call + // sharing it. + SubscriptionBufferSize: 64, }) if err != nil { panic(err) From 704c5e01209d3159bf81a5758bc4550a918bd880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 02:58:15 +0200 Subject: [PATCH 42/44] Update GitHub actions --- .github/workflows/test.yml | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb23ccb..4137e9f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,22 +15,22 @@ jobs: name: Code Linting & Unit Tests strategy: matrix: - go-version: [ 1.21.x ] + go-version: [ 1.25.x ] os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: '0' - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: - version: v1.55 + version: latest - name: Build run: go build -v ./... - name: Test @@ -40,20 +40,28 @@ jobs: needs: test name: Analyze with CodeQL runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false matrix: language: [ 'go' ] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 1.25.x - name: Init - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Analyze - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 From 99717b5a275b5f54b8071fa8656d1c9dae76a048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 03:26:29 +0200 Subject: [PATCH 43/44] Fix linter warnings --- .github/workflows/test.yml | 2 +- .golangci.yml | 21 ++++++++++++++++++ abi/abi.go | 8 +++---- examples/custom-type-advanced/main.go | 8 ++----- rpc/client.go | 6 ++--- rpc/mocks_test.go | 32 --------------------------- rpc/transport/http.go | 2 +- rpc/transport/stream.go | 28 +++++++---------------- rpc/util.go | 2 +- types/util_test.go | 2 +- 10 files changed, 42 insertions(+), 69 deletions(-) create mode 100644 .golangci.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4137e9f..9399e54 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v8 with: - version: latest + version: v2.12.2 - name: Build run: go build -v ./... - name: Test diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 0000000..a8038e6 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,21 @@ +version: "2" + +run: + tests: false + +linters: + settings: + staticcheck: + checks: + - all + + # Defaults. + - -ST1000 + - -ST1003 + - -ST1016 + - -ST1020 + - -ST1021 + - -ST1022 + + # "could remove embedded field from selector". + - -QF1008 diff --git a/abi/abi.go b/abi/abi.go index 88e9f27..d5de670 100644 --- a/abi/abi.go +++ b/abi/abi.go @@ -114,7 +114,7 @@ func NewABI() *ABI { // empty value will cause the default mapping function to // be used. Otherwise, dereference the source and continue // the loop. - if v.Kind() != reflect.Interface && v.Kind() != reflect.Ptr { + if v.Kind() != reflect.Interface && v.Kind() != reflect.Pointer { break } v = v.Elem() @@ -128,7 +128,7 @@ func NewABI() *ABI { return v } // If the destination is a nil pointer, then initialize it. - if v.Kind() == reflect.Ptr && v.IsNil() { + if v.Kind() == reflect.Pointer && v.IsNil() { if !v.CanSet() { return reflect.Value{} } @@ -147,7 +147,7 @@ func NewABI() *ABI { // empty value will cause the anymapper package to ignore // this hook. Otherwise, dereference the destination and // continue the loop. - if v.Kind() != reflect.Interface && v.Kind() != reflect.Ptr { + if v.Kind() != reflect.Interface && v.Kind() != reflect.Pointer { break } v = v.Elem() @@ -200,7 +200,7 @@ var fieldMapper = func(field string) string { } func addr(v reflect.Value) reflect.Value { - if v.Kind() == reflect.Ptr { + if v.Kind() == reflect.Pointer { return v } if v.CanAddr() { diff --git a/examples/custom-type-advanced/main.go b/examples/custom-type-advanced/main.go index 0b0f209..6050959 100644 --- a/examples/custom-type-advanced/main.go +++ b/examples/custom-type-advanced/main.go @@ -86,9 +86,7 @@ func (b *BoolFlagsValue) MapFrom(_ abi.Mapper, src any) error { if len(src) > 256 { return fmt.Errorf("abi: cannot map []bool of length %d to BoolFlags", len(src)) } - for i, v := range src { - b[i] = v - } + copy(b[:], src) } return nil } @@ -100,9 +98,7 @@ func (b *BoolFlagsValue) MapTo(_ abi.Mapper, dst any) error { *dst = *b case *[]bool: *dst = make([]bool, 256) - for i, v := range b { - (*dst)[i] = v - } + copy(*dst, b[:]) } return nil } diff --git a/rpc/client.go b/rpc/client.go index bfde87d..58938d0 100644 --- a/rpc/client.go +++ b/rpc/client.go @@ -406,7 +406,7 @@ func setClientContext(ctx *ClientContext, r reflect.Value, maxDepth int) { if maxDepth <= 0 { return } - for r.Kind() == reflect.Ptr { + for r.Kind() == reflect.Pointer { if r.IsNil() { return } @@ -424,7 +424,7 @@ func setClientContext(ctx *ClientContext, r reflect.Value, maxDepth int) { f.Set(reflect.ValueOf(ctx)) continue } - if f.Kind() == reflect.Struct || f.Kind() == reflect.Ptr { + if f.Kind() == reflect.Struct || f.Kind() == reflect.Pointer { setClientContext(ctx, f, maxDepth-1) } } @@ -444,4 +444,4 @@ type clientTransportHijacker struct { *transport.Hijack } -var contextTy = reflect.TypeOf((*ClientContext)(nil)).Elem() +var contextTy = reflect.TypeFor[ClientContext]() diff --git a/rpc/mocks_test.go b/rpc/mocks_test.go index 97d6382..5b85650 100644 --- a/rpc/mocks_test.go +++ b/rpc/mocks_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" "github.com/defiweb/go-eth/rpc/transport" - "github.com/defiweb/go-eth/types" ) type roundTripFunc func(req *http.Request) (*http.Response, error) @@ -87,37 +86,6 @@ func (s *streamMock) Unsubscribe(_ context.Context, id string) error { return m.ResultErr } -type keyMock struct { - addressCallback func() types.Address - signHashCallback func(hash types.Hash) (*types.Signature, error) - signMessageCallback func(data []byte) (*types.Signature, error) - signTransactionCallback func(tx *types.Transaction) error -} - -func (k *keyMock) Address() types.Address { - return k.addressCallback() -} - -func (k *keyMock) SignHash(ctx context.Context, hash types.Hash) (*types.Signature, error) { - return k.signHashCallback(hash) -} - -func (k *keyMock) SignMessage(ctx context.Context, data []byte) (*types.Signature, error) { - return k.signMessageCallback(data) -} - -func (k *keyMock) SignTransaction(ctx context.Context, tx *types.Transaction) error { - return k.signTransactionCallback(tx) -} - -func (k *keyMock) VerifyHash(ctx context.Context, hash types.Hash, sig types.Signature) bool { - return false -} - -func (k keyMock) VerifyMessage(ctx context.Context, data []byte, sig types.Signature) bool { - return false -} - func readBody(r *http.Request) string { body, _ := io.ReadAll(r.Body) return string(body) diff --git a/rpc/transport/http.go b/rpc/transport/http.go index df2dc33..376ecb9 100644 --- a/rpc/transport/http.go +++ b/rpc/transport/http.go @@ -63,7 +63,7 @@ func (h *HTTP) Call(ctx context.Context, result any, method string, args ...any) if err != nil { return fmt.Errorf("failed to send HTTP request: %w", err) } - defer httpRes.Body.Close() + defer httpRes.Body.Close() //nolint:errcheck rpcRes := &rpcResponse{} if err := json.NewDecoder(httpRes.Body).Decode(rpcRes); err != nil { // If the response is not a valid JSON-RPC response, return the HTTP diff --git a/rpc/transport/stream.go b/rpc/transport/stream.go index 0b55a2d..a72872c 100644 --- a/rpc/transport/stream.go +++ b/rpc/transport/stream.go @@ -45,12 +45,6 @@ func withStreamTimeout(timeout time.Duration) streamOption { } } -func withStreamCloseFunc(fn func()) streamOption { - return func(s *stream) { - s.closeFunc = fn - } -} - func withStreamErrorCh(errCh chan error) streamOption { return func(s *stream) { s.errCh = errCh @@ -61,12 +55,11 @@ func withStreamErrorCh(errCh chan error) streamOption { type stream struct { ctx context.Context - writeCh chan rpcRequest // Channel for sending requests used by structs that embed stream. - readCh chan rpcResponse // Channel for receiving responses used by structs that embed stream. - errCh chan error // Channel to which errors are sent. - timeout time.Duration // Timeout for requests. - bufSize int // Buffer size for the subscription channels. - closeFunc func() // Callback that is called when the stream is closed. + writeCh chan rpcRequest // Channel for sending requests used by structs that embed stream. + readCh chan rpcResponse // Channel for receiving responses used by structs that embed stream. + errCh chan error // Channel to which errors are sent. + timeout time.Duration // Timeout for requests. + bufSize int // Buffer size for the subscription channels. // State fields. Should not be accessed by structs that embed stream. id uint64 // Request ID counter. @@ -177,20 +170,15 @@ func (s *stream) Unsubscribe(ctx context.Context, id string) error { } func (s *stream) streamRoutine() { - defer func() { - s.chs.close() - if s.closeFunc != nil { - s.closeFunc() - } - }() + defer s.chs.close() for { select { case res, ok := <-s.readCh: if !ok { return } - switch { - case res.ID == nil: + switch res.ID { + case nil: // If the ID is nil, it is a subscription notification. sub := &rpcSubscription{} if err := json.Unmarshal(res.Params, sub); err != nil { diff --git a/rpc/util.go b/rpc/util.go index 57e7ab1..0a1b941 100644 --- a/rpc/util.go +++ b/rpc/util.go @@ -118,7 +118,7 @@ func subscribe[T any](ctx context.Context, t transport.Transport, method string, msgCh := make(chan T) go func() { defer close(msgCh) - defer st.Unsubscribe(ctx, subID) + defer st.Unsubscribe(ctx, subID) //nolint:errcheck for { select { case <-ctx.Done(): diff --git a/types/util_test.go b/types/util_test.go index 37e3ef0..7653ab2 100644 --- a/types/util_test.go +++ b/types/util_test.go @@ -61,7 +61,7 @@ func assertEqualCall(t *testing.T, actual, expected Call) { } func deref(t reflect.Type) reflect.Type { - for t.Kind() == reflect.Ptr || t.Kind() == reflect.Interface { + for t.Kind() == reflect.Pointer || t.Kind() == reflect.Interface { t = t.Elem() } return t From 79e09919094d04d1652ecadca345aec644f13818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dobaczewski?= Date: Tue, 4 Aug 2026 03:41:11 +0200 Subject: [PATCH 44/44] Fix retry transport tests --- rpc/transport/retry.go | 30 ++++++++++++++++++------------ rpc/transport/retry_test.go | 15 +++++---------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/rpc/transport/retry.go b/rpc/transport/retry.go index 4e6f2df..ceeac7d 100644 --- a/rpc/transport/retry.go +++ b/rpc/transport/retry.go @@ -149,10 +149,8 @@ func (c *Retry) Call(ctx context.Context, result any, method string, args ...any if c.opts.MaxRetries >= 0 && i >= c.opts.MaxRetries { break } - select { - case <-ctx.Done(): - return ctx.Err() - case <-time.After(c.opts.BackoffFunc(i)): + if err := wait(ctx, c.opts.BackoffFunc(i)); err != nil { + return err } i++ } @@ -171,10 +169,8 @@ func (c *Retry) Subscribe(ctx context.Context, method string, args ...any) (ch c if c.opts.MaxRetries >= 0 && i >= c.opts.MaxRetries { break } - select { - case <-ctx.Done(): - return nil, "", ctx.Err() - case <-time.After(c.opts.BackoffFunc(i)): + if err := wait(ctx, c.opts.BackoffFunc(i)); err != nil { + return nil, "", err } i++ } @@ -195,10 +191,8 @@ func (c *Retry) Unsubscribe(ctx context.Context, id string) (err error) { if c.opts.MaxRetries >= 0 && i >= c.opts.MaxRetries { break } - select { - case <-ctx.Done(): - return ctx.Err() - case <-time.After(c.opts.BackoffFunc(i)): + if err := wait(ctx, c.opts.BackoffFunc(i)); err != nil { + return err } i++ } @@ -220,3 +214,15 @@ func errorCode(err error) int { } return 0 } + +func wait(ctx context.Context, d time.Duration) error { + if err := ctx.Err(); err != nil { + return err + } + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(d): + return nil + } +} diff --git a/rpc/transport/retry_test.go b/rpc/transport/retry_test.go index 068aae4..a6ac573 100644 --- a/rpc/transport/retry_test.go +++ b/rpc/transport/retry_test.go @@ -300,18 +300,13 @@ func TestRetry(t *testing.T) { f.callResult <- fmt.Errorf("foo") // Wait a bit to make sure the retry passes the select statement - // and blocks on the Call() call. + // and blocks on the second Call(). time.Sleep(100 * time.Millisecond) - cancel() - // The retry function is blocked on the Call() call, so we need to - // send a result to unblock it. Then no more retries will be made - // because the context is canceled. - // - // In practice, this is not a problem because the transport will - // return an error when the context is canceled so the retry - // function will not be blocked on the Call() call. - f.callResult <- fmt.Errorf("foo") + // Canceling is enough to unblock it: the transport returns the + // context error rather than waiting for a result. No further + // retry is made, so the call count stays at two. + cancel() }() err := r.Call(ctx, nil, "foo") require.Error(t, err)