Skip to content

Instantly share code, notes, and snippets.

@harsh-98
Last active March 9, 2024 14:31
Show Gist options
  • Save harsh-98/25997b0222bfd9c87168d0fc321c6b7d to your computer and use it in GitHub Desktop.
Save harsh-98/25997b0222bfd9c87168d0fc321c6b7d to your computer and use it in GitHub Desktop.
package main

import (
	"math/big"

	"github.com/Gearbox-protocol/go-liquidator/config"
	"github.com/Gearbox-protocol/go-liquidator/ethclient"
	"github.com/Gearbox-protocol/sdk-go/core"
	"github.com/Gearbox-protocol/sdk-go/log"
	"github.com/Gearbox-protocol/sdk-go/pkg"
	"github.com/ethereum/go-ethereum/common"
)

func main() {
	client := ethclient.NewEthClient(&config.CommonConfig{EthProvider: "http://localhost:8545"})

	// ap, err := addressProviderv3.NewAddressProviderv3(common.HexToAddress("0x7d04ecdb892ae074f03b5d0aba03796f90f3f2af"), client)
	// log.CheckFatal(err)
	node := pkg.Node{Client: client}
	logs, err := node.GetLogs(0, node.GetLatestBlockNumber(), []common.Address{
		common.HexToAddress("0x8dBCF531D07255cD8a2Ea967e9fCeC25Fc5e620e"), //on  cm 0x6dc0EB1980fa6b3fa89F5b29937b9baab5865B3E
	}, [][]common.Hash{
		{core.Topic("SetTokenLiquidationThreshold(address,uint16)")},
	})
	log.CheckFatal(err)
	for _, txLog := range logs {
		log.Info(
			common.BytesToAddress(txLog.Topics[1][:]),
			new(big.Int).SetBytes(txLog.Data[:]),
			txLog.BlockNumber,
		)
	}
}
Screenshot 2024-03-09 at 7 50 55 PM

returned data from data compressor has lt as 1.

Screenshot 2024-03-09 at 7 42 36 PM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment