Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallRequest ¶
CallRequest is a packed call to be executed with multicall. ABI Definition: Call3
Parameters:
- Target: The address of the contract to call
- AllowFailure: Whether the call is allowed to fail
- CallData: packed calldata to the target contract with abi.Pack
func NewCallRequest ¶
func NewCallRequest( target common.Address, packedCallData []byte, allowFailure bool, ) CallRequest
type CallResult ¶
CallResult is the packedresult of a packed call executed with multicall. ABI Definition: Call3Value
Parameters:
- Data: Packed result of the call. Unpacked with abi.Unpack
- Success: Whether the call was successful
func MulticallRaw ¶
func MulticallRaw( cfg *MulticallConfig, calls []CallRequest, ) ([]CallResult, error)
MulticallRaw allows you to multicall directly with abi packed calls. Allows various functions on various contracts. Recommended function for most control and best performance.
Parameters:
- cfg: The multicall config to use
- calls: The calls to execute.
Returns:
- []CallResult: Packed results and success status of the calls
- error: An error if the multicall fails
type MulticallConfig ¶
type MulticallConfig struct { Client *ethclient.Client MulticallAddress common.Address BatchSize int Timeout time.Duration }
MulticallConfig is a reusable multicall config.
Parameters:
- Client: The Ethereum client to use
- MulticallAddress: The address of the multicall contract for the chain. You can find the deployment address for your chain at https://www.multicall3.com/deployments
- BatchSize: The maximum number of calls to include in a single multicall Generally it's cheaper and faster to pack as many calls as possible in a single multicall. Default: 100
- Timeout: The timeout for the multicall. Default: 30 seconds
func NewDefaultMulticallConfig ¶
func NewDefaultMulticallConfig(client *ethclient.Client, multicallAddress common.Address) *MulticallConfig
Create a new reusable multicall config
Parameters:
- client: The Ethereum client to use
- multicallAddress: The address of the multicall contract for the chain. You can find the deployment address for your chain at https://www.multicall3.com/deployments
func NewMulticallConfig ¶
func NewMulticallConfig( client *ethclient.Client, multicallAddress common.Address, batchSize int, timeout time.Duration, ) *MulticallConfig
Create a new reusable multicall config
Parameters:
- client: The Ethereum client to use
- multicallAddress: The address of the multicall contract for the chain. You can find the deployment address for your chain at https://www.multicall3.com/deployments
- batchSize: The maximum number of calls to include in a single multicall Generally it's cheaper and faster to pack as many calls as possible in a single multicall. Default: 100
Click to show internal directories.
Click to hide internal directories.