Versions in this module Expand all Collapse all v1 v1.2.1 Sep 10, 2024 v1.2.0 Sep 10, 2024 Changes in this version + const ANVIL + const CONFIG_FILE_ENV_VAR + const CommentMissingABI + const CongestionStrategy_NewestFirst + const CongestionStrategy_Simple + const Congestion_High + const Congestion_Low + const Congestion_Medium + const Congestion_VeryHigh + const ContractMapFilePattern + const DefaultDialTimeout + const DefaultGasFeeCap + const DefaultGasPrice + const DefaultGasTipCap + const DefaultNetworkName + const DefaultTransferGasFee + const ErrContractDeploymentFailed + const ErrCreateABIStore + const ErrCreateNonceManager + const ErrCreateTracer + const ErrDecodeILogIndexed + const ErrDecodeInput + const ErrDecodeLog + const ErrDecodeOutput + const ErrDecodedLogNonIndexed + const ErrEmptyConfigPath + const ErrEmptyRootPrivateKey + const ErrInsufficientRootKeyBalance + const ErrInvalidMethodSignature + const ErrKeySync + const ErrKeySyncTimeout + const ErrNoABIMethod + const ErrNoAbiFound + const ErrNoFourByteFound + const ErrNoKeyLoaded + const ErrNoTrace + const ErrNoTxData + const ErrNonce + const ErrOpenABIFile + const ErrOpenBINFile + const ErrParseABI + const ErrRPCConnectionRefused + const ErrRPCJSONCastError + const ErrReadContractMap + const ErrReadSethConfig + const ErrReadingKeys + const ErrRetryTimeout + const ErrRpcHealthCheckFailed + const ErrUnmarshalSethConfig + const Experiment_Eip1559FeeEqualier + const Experiment_SlowFundsReturn + const FAILED_TO_DECODE + const FailedToDecodeMetadataErr + const GETH + const InvalidMetadataLengthErr + const LogLevelEnvVar + const MetadataNotFoundErr + const NETWORK_ENV_VAR + const NO_DATA + const NotCompiledWithSolcErr + const Priority_Degen + const Priority_Fast + const Priority_Slow + const Priority_Standard + const ROOT_PRIVATE_KEY_ENV_VAR + const RevertedTransactionsFilePattern + const TimeoutKeyNum + const UNKNOWN + const URL_ENV_VAR + const WarnNoContractStore + const WrnMissingCallTrace + var BlockFetchingErr = "failed to fetch enough block headers for congestion calculation" + var L zerolog.Logger + var NoOpGasBumpStrategyFn = func(previousGasPrice *big.Int) *big.Int + var PriorityBasedGasBumpingStrategyFn = func(priority string) GasBumpStrategyFn + var TraceOutput_Console = "console" + var TraceOutput_DOT = "dot" + var TraceOutput_JSON = "json" + var TracingLevel_All = "ALL" + var TracingLevel_None = "NONE" + var TracingLevel_Reverted = "REVERTED" + var ZeroGasSuggestedErr = "either base fee or suggested tip is 0" + var ZeroInt64 int64 = 0 + func CreateOrAppendToJsonArray(filePath string, newItem any) error + func DoesPragmaSupportCustomRevert(pragma Pragma) bool + func EtherToWei(eth *big.Float) *big.Int + func LoadDeployedContracts(filename string) (map[string]string, error) + func NewAddress() (string, string, error) + func NewEphemeralKeys(addrs int64) ([]string, error) + func NewLoggingTransport() http.RoundTripper + func OpenJsonFileAsStruct(path string, v any) error + func ReturnFunds(c *Client, toAddr string) error + func SaveDeployedContract(filename, contractName, address string) error + func ValidateConfig(cfg *Config) error + func WeiToEther(wei *big.Int) *big.Float + type ABIFinder struct + ContractMap ContractMap + ContractStore *ContractStore + func NewABIFinder(contractMap ContractMap, contractStore *ContractStore) ABIFinder + func (a *ABIFinder) FindABIByMethod(address string, signature []byte) (ABIFinderResult, error) + type ABIFinderResult struct + ABI abi.ABI + DuplicateCount int + Method *abi.Method + func (a *ABIFinderResult) ContractName() string + type ABIStore map[string]abi.ABI + type BlockStats struct + Client *Client + Limiter ratelimit.Limiter + func NewBlockStats(c *Client) (*BlockStats, error) + func (cs *BlockStats) CalculateBlockDurations(blocks []*types.Block) error + func (cs *BlockStats) Stats(startBlock *big.Int, endBlock *big.Int) error + type BlockStatsConfig struct + RPCRateLimit int + func (cfg *BlockStatsConfig) Validate() error + type Call struct + Calls []Call + Error string + From string + Gas string + GasUsed string + Input string + Logs []TraceLog + Output string + To string + Type string + Value string + type CallOpt func(o *bind.CallOpts) + func WithBlockNumber(bn uint64) CallOpt + func WithPending(pending bool) CallOpt + type Client struct + ABIFinder *ABIFinder + Addresses []common.Address + CancelFunc context.CancelFunc + Cfg *Config + ChainID int64 + Client *ethclient.Client + Context context.Context + ContractAddressToNameMap ContractMap + ContractStore *ContractStore + Errors []error + HeaderCache *LFUHeaderCache + NonceManager *NonceManager + PrivateKeys []*ecdsa.PrivateKey + Tracer *Tracer + URL string + func DefaultClient(rpcUrl string, privateKeys []string) (*Client, error) + func NewClient() (*Client, error) + func NewClientRaw(cfg *Config, addrs []common.Address, pkeys []*ecdsa.PrivateKey, ...) (*Client, error) + func NewClientWithConfig(cfg *Config) (*Client, error) + func (m *Client) AnySyncedKey() int + func (m *Client) CalculateGasEstimations(request GasEstimationRequest) GasEstimations + func (m *Client) CalculateNetworkCongestionMetric(blocksNumber uint64, strategy string) (float64, error) + func (m *Client) CalculateSubKeyFunding(addrs, gasPrice, rooKeyBuffer int64) (*FundingDetails, error) + func (m *Client) CallMsgFromTx(tx *types.Transaction) (ethereum.CallMsg, error) + func (m *Client) Decode(tx *types.Transaction, txErr error) (*DecodedTransaction, error) + func (m *Client) DecodeCustomABIErr(txErr error) (string, error) + func (m *Client) DeployContract(auth *bind.TransactOpts, name string, abi abi.ABI, bytecode []byte, ...) (DeploymentData, error) + func (m *Client) DeployContractFromContractStore(auth *bind.TransactOpts, name string, params ...interface{}) (DeploymentData, error) + func (m *Client) DeployDebugContract(subDbgAddr common.Address) (*network_debug_contract.NetworkDebugContract, common.Address, error) + func (m *Client) DeployDebugSubContract() (*network_sub_debug_contract.NetworkDebugSubContract, common.Address, error) + func (m *Client) DownloadContractAndGetPragma(address common.Address, block *big.Int) (Pragma, error) + func (m *Client) EstimateGasLimitForFundTransfer(from, to common.Address, amount *big.Int) (uint64, error) + func (m *Client) GetRootKeyAddress() (common.Address, error) + func (m *Client) GetRootPrivateKey() (*ecdsa.PrivateKey, error) + func (m *Client) GetSuggestedEIP1559Fees(ctx context.Context, priority string) (maxFeeCap *big.Int, adjustedTipCap *big.Int, err error) + func (m *Client) GetSuggestedLegacyFees(ctx context.Context, priority string) (adjustedGasPrice *big.Int, err error) + func (m *Client) HistoricalFeeData(priority string) (baseFee float64, historicalGasTipCap float64, err error) + func (m *Client) MustGetRootKeyAddress() common.Address + func (m *Client) MustGetRootPrivateKey() *ecdsa.PrivateKey + func (m *Client) NewCallKeyOpts(keyNum int, o ...CallOpt) *bind.CallOpts + func (m *Client) NewCallOpts(o ...CallOpt) *bind.CallOpts + func (m *Client) NewDefaultGasEstimationRequest() GasEstimationRequest + func (m *Client) NewTXKeyOpts(keyNum int, o ...TransactOpt) *bind.TransactOpts + func (m *Client) NewTXOpts(o ...TransactOpt) *bind.TransactOpts + func (m *Client) RetryTxAndDecode(f func() (*types.Transaction, error)) (*DecodedTransaction, error) + func (m *Client) SaveDecodedCallsAsJson(dirname string) error + func (m *Client) TransferETHFromKey(ctx context.Context, fromKeyNum int, to string, value *big.Int, ...) error + func (m *Client) WaitMined(ctx context.Context, l zerolog.Logger, b bind.DeployBackend, ...) (*types.Receipt, error) + func (m *Client) WaitUntilNoPendingTx(address common.Address, timeout time.Duration) error + func (m *Client) WaitUntilNoPendingTxFoKeyNum(keyNum int, timeout time.Duration) error + func (m *Client) WaitUntilNoPendingTxForRootKey(timeout time.Duration) error + type ClientBuilder struct + func NewClientBuilder() *ClientBuilder + func (c *ClientBuilder) Build() (*Client, error) + func (c *ClientBuilder) WithArtifactsFolder(folder string) *ClientBuilder + func (c *ClientBuilder) WithDynamicGasPrices(gasFeeCap, gasTipCap int64) *ClientBuilder + func (c *ClientBuilder) WithEIP1559DynamicFees(enabled bool) *ClientBuilder + func (c *ClientBuilder) WithEphemeralAddresses(ephemeralAddressCount, rootKeyBufferAmount int64) *ClientBuilder + func (c *ClientBuilder) WithGasBumping(retries uint, maxGasPrice int64, customBumpingStrategy GasBumpStrategyFn) *ClientBuilder + func (c *ClientBuilder) WithGasPriceEstimations(enabled bool, estimationBlocks uint64, txPriority string) *ClientBuilder + func (c *ClientBuilder) WithLegacyGasPrice(gasPrice int64) *ClientBuilder + func (c *ClientBuilder) WithNetworkName(name string) *ClientBuilder + func (c *ClientBuilder) WithNonceManager(rateLimitSec int, retries uint, timeout, retryDelay time.Duration) *ClientBuilder + func (c *ClientBuilder) WithPrivateKeys(pks []string) *ClientBuilder + func (c *ClientBuilder) WithProtections(pendingNonceProtectionEnabled, nodeHealthStartupCheck bool) *ClientBuilder + func (c *ClientBuilder) WithRpcDialTimeout(timeout time.Duration) *ClientBuilder + func (c *ClientBuilder) WithRpcUrl(url string) *ClientBuilder + func (c *ClientBuilder) WithTracing(level string, outputs []string) *ClientBuilder + func (c *ClientBuilder) WithTransactionTimeout(timeout time.Duration) *ClientBuilder + func (c *ClientBuilder) WithTransferGasFee(gasFee int64) *ClientBuilder + type ClientOpt func(c *Client) + func WithABIFinder(abiFinder *ABIFinder) ClientOpt + func WithContractMap(contractAddressToNameMap ContractMap) ClientOpt + func WithContractStore(as *ContractStore) ClientOpt + func WithNonceManager(nm *NonceManager) ClientOpt + func WithTracer(t *Tracer) ClientOpt + type CommonData struct + CallType string + Error string + Input map[string]interface{} + Method string + NestingLevel int + Output map[string]interface{} + ParentSignature string + Signature string + type Config struct + ABIDir string + ArtifactsDir string + BINDir string + BlockStatsConfig *BlockStatsConfig + CheckRpcHealthOnStart bool + ConfigDir string + ContractMapFile string + EphemeralAddrs *int64 + ExperimentsEnabled []string + GasBump *GasBumpConfig + Network *Network + Networks []*Network + NonceManager *NonceManagerCfg + PendingNonceProtectionEnabled bool + RPCHeaders http.Header + RootKeyFundsBuffer *int64 + SaveDeployedContractsMap bool + TraceOutputs []string + TracingLevel string + func ReadConfig() (*Config, error) + func (c *Config) AppendPksToNetwork(pks []string, name string) bool + func (c *Config) FirstNetworkURL() string + func (c *Config) GasBumpRetries() uint + func (c *Config) GenerateContractMapFileName() string + func (c *Config) GetMaxConcurrency() int + func (c *Config) HasMaxBumpGasPrice() bool + func (c *Config) IsExperimentEnabled(experiment string) bool + func (c *Config) IsSimulatedNetwork() bool + func (c *Config) ParseKeys() ([]common.Address, []*ecdsa.PrivateKey, error) + func (c *Config) ShouldSaveDeployedContractMap() bool + type ContextErrorKey struct + type ContractLoader struct + Client *Client + func NewContractLoader[T any](client *Client) *ContractLoader[T] + func (cl *ContractLoader[T]) LoadContract(name string, address common.Address, abiLoadFn func() (*abi.ABI, error), ...) (*T, error) + type ContractMap struct + func NewContractMap(contracts map[string]string) ContractMap + func NewEmptyContractMap() ContractMap + func (c ContractMap) AddContract(addr, name string) + func (c ContractMap) GetContractAddress(addr string) string + func (c ContractMap) GetContractMap() map[string]string + func (c ContractMap) GetContractName(addr string) string + func (c ContractMap) IsKnownAddress(addr string) bool + func (c ContractMap) Size() int + type ContractStore struct + ABIs ABIStore + BINs map[string][]byte + func NewContractStore(abiPath, binPath string) (*ContractStore, error) + func (c *ContractStore) AddABI(name string, abi abi.ABI) + func (c *ContractStore) AddBIN(name string, bin []byte) + func (c *ContractStore) GetABI(name string) (*abi.ABI, bool) + func (c *ContractStore) GetBIN(name string) ([]byte, bool) + type DecodableLog interface + GetData func() []byte + GetTopics func() []common.Hash + type DecodedCall struct + Comment string + Events []DecodedCommonLog + From string + FromAddress string + GasLimit uint64 + GasUsed uint64 + To string + ToAddress string + Value int64 + type DecodedCommonLog struct + Address common.Address + EventData map[string]interface{} + Signature string + Topics []string + func (d *DecodedCommonLog) MergeEventData(newEventData map[string]interface{}) + type DecodedTransaction struct + Events []DecodedTransactionLog + Hash string + Index uint + Protected bool + Receipt *types.Receipt + Transaction *types.Transaction + type DecodedTransactionLog struct + BlockNumber uint64 + FileTag string + Index uint + Removed bool + TXHash string + TXIndex uint + func (d *DecodedTransactionLog) MergeEventData(newEventData map[string]interface{}) + type DeploymentData struct + Address common.Address + BoundContract *bind.BoundContract + Transaction *types.Transaction + type Duration struct + D time.Duration + func MakeDuration(d time.Duration) (Duration, error) + func MustMakeDuration(d time.Duration) *Duration + func ParseDuration(s string) (Duration, error) + func (d *Duration) Scan(v interface{}) (err error) + func (d *Duration) UnmarshalJSON(input []byte) error + func (d *Duration) UnmarshalText(input []byte) error + func (d Duration) Before(t time.Time) time.Time + func (d Duration) Duration() time.Duration + func (d Duration) IsInstant() bool + func (d Duration) MarshalJSON() ([]byte, error) + func (d Duration) MarshalText() ([]byte, error) + func (d Duration) Shorter(od Duration) bool + func (d Duration) String() string + func (d Duration) Value() (driver.Value, error) + type FundingDetails struct + AddrFunding *big.Int + FreeBalance *big.Int + NetworkTransferFee int64 + RootBalance *big.Int + TotalFee *big.Int + type GasBumpConfig struct + MaxGasPrice int64 + Retries uint + StrategyFn GasBumpStrategyFn + type GasBumpStrategyFn = func(previousGasPrice *big.Int) *big.Int + type GasEstimationRequest struct + FallbackGasFeeCap int64 + FallbackGasPrice int64 + FallbackGasTipCap int64 + GasEstimationEnabled bool + Priority string + type GasEstimations struct + GasFeeCap *big.Int + GasPrice *big.Int + GasTipCap *big.Int + type GasEstimator struct + BlockGasLimits []uint64 + Client *Client + TransactionGasPrice []uint64 + func NewGasEstimator(c *Client) *GasEstimator + func (m *GasEstimator) Stats(fromNumber uint64, priorityPerc float64) (GasSuggestions, error) + type GasPercentiles struct + Max float64 + Perc25 float64 + Perc50 float64 + Perc75 float64 + Perc99 float64 + type GasSuggestions struct + GasPrice *GasPercentiles + SuggestedGasPrice *big.Int + SuggestedGasTipCap *big.Int + TipCap *GasPercentiles + type KeyNonce struct + KeyNum int + Nonce uint64 + type LFUHeaderCache struct + func NewLFUBlockCache(capacity uint64) *LFUHeaderCache + func (c *LFUHeaderCache) Get(blockNumber int64) (*types.Header, bool) + func (c *LFUHeaderCache) Set(header *types.Header) error + type LogWithEventData interface + MergeEventData func(map[string]interface{}) + type LoggingTransport struct + Transport http.RoundTripper + func (t *LoggingTransport) RoundTrip(req *http.Request) (*http.Response, error) + type Network struct + ChainID string + DialTimeout *Duration + EIP1559DynamicFees bool + GasFeeCap int64 + GasLimit uint64 + GasPrice int64 + GasPriceEstimationBlocks uint64 + GasPriceEstimationEnabled bool + GasPriceEstimationTxPriority string + GasTipCap int64 + Name string + PrivateKeys []string + TransferGasFee int64 + TxnTimeout *Duration + URLs []string + type NonceManager struct + Addresses []common.Address + Client *Client + Nonces map[common.Address]int64 + PrivateKeys []*ecdsa.PrivateKey + SyncTimeout time.Duration + SyncedKeys chan *KeyNonce + func NewNonceManager(cfg *Config, addrs []common.Address, privKeys []*ecdsa.PrivateKey) (*NonceManager, error) + func (m *NonceManager) NextNonce(addr common.Address) *big.Int + func (m *NonceManager) UpdateNonces() error + type NonceManagerCfg struct + KeySyncRateLimitSec int + KeySyncRetries uint + KeySyncRetryDelay *Duration + KeySyncTimeout *Duration + type NonceStatus struct + LastNonce uint64 + PendingNonce uint64 + type Pragma struct + Major uint64 + Minor uint64 + Patch uint64 + func DecodePragmaVersion(bytecode string) (Pragma, error) + func (p Pragma) String() string + type TXCallTraceOutput struct + Calls []Call + func (t *TXCallTraceOutput) AsCall() Call + type TXFourByteMetadataOutput struct + CallSize int + Times int + type Trace struct + CallTrace *TXCallTraceOutput + FourByte map[string]*TXFourByteMetadataOutput + OpCodesTrace map[string]interface{} + TxHash string + type TraceLog struct + Address string + Data string + Topics []string + func (t TraceLog) GetData() []byte + func (t TraceLog) GetTopics() []common.Hash + type Tracer struct + ABIFinder *ABIFinder + Addresses []common.Address + Cfg *Config + ContractAddressToNameMap ContractMap + ContractStore *ContractStore + func NewTracer(cs *ContractStore, abiFinder *ABIFinder, cfg *Config, ...) (*Tracer, error) + func (t *Tracer) AddDecodedCalls(txHash string, calls []*DecodedCall) + func (t *Tracer) DecodeTrace(l zerolog.Logger, trace Trace) ([]*DecodedCall, error) + func (t *Tracer) GetAllDecodedCalls() map[string][]*DecodedCall + func (t *Tracer) GetDecodedCalls(txHash string) []*DecodedCall + func (t *Tracer) PrintTXTrace(txHash string) error + func (t *Tracer) SaveDecodedCallsAsJson(dirname string) error + func (t *Tracer) TraceGethTX(txHash string, revertErr error) error + type TransactOpt func(o *bind.TransactOpts) + func WithGasFeeCap(gasFeeCap *big.Int) TransactOpt + func WithGasLimit(gasLimit uint64) TransactOpt + func WithGasPrice(gasPrice *big.Int) TransactOpt + func WithGasTipCap(gasTipCap *big.Int) TransactOpt + func WithNoSend(noSend bool) TransactOpt + func WithNonce(nonce *big.Int) TransactOpt + func WithValue(value *big.Int) TransactOpt + type TransactionLog struct + Data []byte + Topics []common.Hash + func (t TransactionLog) GetData() []byte + func (t TransactionLog) GetTopics() []common.Hash