Documentation ¶
Index ¶
- Variables
- func BigIntFromHex(s string) (*misc.BigInt, error)
- func BigIntFromUint64(x uint64) (int *big.Int)
- func BigPow(left *big.Rat, count int) *big.Rat
- func CalculateEffectiveGasPrice(baseFeePerGas, maxFeePerGas, maxPriorityFeePerGas *big.Rat) *big.Rat
- func CoerceBoundContractResultsToAddress(results []interface{}) (ethCommon.Address, error)
- func CoerceBoundContractResultsToAddresses(results []interface{}) ([]ethCommon.Address, error)
- func CoerceBoundContractResultsToBool(results []interface{}) (bool, error)
- func CoerceBoundContractResultsToBytes32(results []interface{}) ([32]byte, error)
- func CoerceBoundContractResultsToInt(results []interface{}) (*big.Int, error)
- func CoerceBoundContractResultsToInt32Pair(results []interface{}) (int32, int32, error)
- func CoerceBoundContractResultsToRat(results []interface{}) (*big.Rat, error)
- func CoerceBoundContractResultsToRats(results []interface{}) ([]*big.Rat, error)
- func CoerceBoundContractResultsToUInt16(results []interface{}) (uint16, error)
- func CoerceBoundContractResultsToUint8(results []interface{}) (uint8, error)
- func ConvertGethAddress(address ethCommon.Address) ethereum.Address
- func ConvertGethHash(hash ethCommon.Hash) ethereum.Hash
- func ConvertGethHeader(oldHeader *ethTypes.Header) ethereum.BlockHeader
- func ConvertGethLog(log ethTypes.Log) ethereum.Log
- func ConvertGethLogs(logs []*ethTypes.Log) []ethereum.Log
- func ConvertGethReceipt(receipt ethTypes.Receipt) ethereum.Receipt
- func ConvertInternalAddress(address ethereum.Address) ethCommon.Address
- func ConvertInternalHash(hash ethereum.Hash) ethCommon.Hash
- func EstimateGas(client *ethclient.Client, contractAbi *abi.ABI, opts *ethAbiBind.TransactOpts, ...) (uint64, error)
- func GetApplicationTransfers(logs []ethereum.Log, transactions []ethereum.Transaction, ...) map[ethereum.Hash][]worker.EthereumApplicationTransfer
- func GetGasPriceTipHardhat(ctx context.Context, client *ethclient.Client) (*big.Int, error)
- func GetReceipt(gethClient *ethClient.Client, transactionHash ethereum.Hash) (*ethereum.Receipt, error)
- func GetTransfers(logs []ethereum.Log, transactions []ethereum.Transaction, ...) []worker.EthereumDecoratedTransfer
- func IsTransferLogTopic(topic string) bool
- func MakeTransaction(contract *ethAbiBind.BoundContract, opts *ethAbiBind.TransactOpts, ...) (*ethTypes.Transaction, error)
- func NewTransactionOptions(client *ethclient.Client, privateKey *ecdsa.PrivateKey) (*ethAbiBind.TransactOpts, error)
- func StaticCall(client *ethClient.Client, address ethCommon.Address, abi ethAbi.ABI, ...) ([]interface{}, error)
- func UpdateGasAmounts(ctx context.Context, client *ethclient.Client, ...) error
- func UpdateValue(options *ethAbiBind.TransactOpts)
- type TokenDetailsEthereum
Constants ¶
This section is empty.
Variables ¶
var TransferLogTopic = strings.ToLower(
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
)
TransferLogTopic is the signature of token transfers
Functions ¶
func BigIntFromUint64 ¶
func CalculateEffectiveGasPrice ¶
func CalculateEffectiveGasPrice(baseFeePerGas, maxFeePerGas, maxPriorityFeePerGas *big.Rat) *big.Rat
CalculateEffectiveGasPrice with baseFeePerGas + min(maxFeePerGas - baseFeePerGas, maxPriorityFeePerGas)
func CoerceBoundContractResultsToAddresses ¶
Wrap CoerceBoundContractResultsToRat to handle an array of results
func CoerceBoundContractResultsToRats ¶
Wrap CoerceBoundContractResultsToRat to handle an array of results
func ConvertGethAddress ¶
ConvertGethAddress from the ethereum definition into its internal type equivalent
func ConvertGethHash ¶
ConvertGethHash from the ethereum definition into its internal type equivalent
func ConvertGethHeader ¶
func ConvertGethHeader(oldHeader *ethTypes.Header) ethereum.BlockHeader
ConvertGethHeader from the ethereum definition into its internal type equivalent
func ConvertGethLog ¶
ConvertGethLog from the ethereum definition into its internal type equivalent
func ConvertGethLogs ¶
ConvertGethLogs converts an array of geth logs to its internal type equivalent
func ConvertInternalAddress ¶
ConvertInternalAddress from the internal definition into its geth type equivalent
func ConvertInternalHash ¶
ConvertInternalHash from the internal definition into its geth type equivalent
func EstimateGas ¶
func GetApplicationTransfers ¶
func GetApplicationTransfers(logs []ethereum.Log, transactions []ethereum.Transaction, blockHash ethereum.Hash, applicationContracts map[ethereum.Address]applications.Application) map[ethereum.Hash][]worker.EthereumApplicationTransfer
GetApplicationTransfers to use the passed function to classify individual logs and their respective transactions as generated by an application we support, to be processed later
func GetGasPriceTipHardhat ¶
GetGasPriceTipHardhat to accomodate hardhat's bug with the gas price
func GetReceipt ¶
func GetTransfers ¶
func GetTransfers(logs []ethereum.Log, transactions []ethereum.Transaction, blockHash ethereum.Hash, fluidContractAddress ethCommon.Address, utilities map[ethereum.Address]applications.UtilityName) []worker.EthereumDecoratedTransfer
Get transfer receipts
func IsTransferLogTopic ¶
IsTransferLogTopic returns whether given string matches signature of the fluid transfer ABI
func MakeTransaction ¶
func MakeTransaction(contract *ethAbiBind.BoundContract, opts *ethAbiBind.TransactOpts, method string, args ...interface{}) (*ethTypes.Transaction, error)
Calls a method on a bound contract, first simulating it to see if it reverts
func NewTransactionOptions ¶
func NewTransactionOptions(client *ethclient.Client, privateKey *ecdsa.PrivateKey) (*ethAbiBind.TransactOpts, error)
NewTransactionOptions created using the user's private key, figuring out the chain id using the client.
func StaticCall ¶
func UpdateGasAmounts ¶
func UpdateGasAmounts(ctx context.Context, client *ethclient.Client, options *ethAbiBind.TransactOpts) error
UpdateGasAmounts by suggesting the gas tip cap then setting the gas limit to a fixed amount
func UpdateValue ¶
func UpdateValue(options *ethAbiBind.TransactOpts)
UpdateValue sets the Value field in the transaction options to 0
Types ¶
type TokenDetailsEthereum ¶
type TokenDetailsEthereum struct { FluidAddress ethCommon.Address TokenName string TokenDecimals *big.Rat Amount float64 // address is the optional parameter for the underlying token address // (required for AAVE lookup) OR the flux oracle address (for Aurora) Address ethCommon.Address Backend string }
TokenDetailsEthereum containing information about tokens that we unpacked using the environment variables
func GetTokensListEthereum ¶
func GetTokensListEthereum(tokensList_ string) []TokenDetailsEthereum
GetTokensListEthereum to parse a string list into separated token information