Skip to content

Commit

Permalink
feat: check for deposit event
Browse files Browse the repository at this point in the history
  • Loading branch information
bennettyong committed Aug 19, 2024
1 parent 8fea967 commit 904c8d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
12 changes: 11 additions & 1 deletion adapters/projects/izumi/transfer_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (

var (
logTransferSigHash = crypto.Keccak256Hash([]byte("Transfer(address,address,uint256)"))
logDepositSigHash = crypto.Keccak256Hash([]byte("Deposit(address,uint256,uint256)"))
)

// TransferIndexer is an implementation of LogsIndexer for ERC20 transfer logs.
Expand Down Expand Up @@ -68,7 +69,16 @@ func (indexer *TransferIndexer) ProcessLog(ctx context.Context, chainID *big.Int
if !exists {
return nil, nil
}
from := common.BytesToAddress(vLog.Topics[1].Bytes()[12:])
txReceipt, err := client.TransactionReceipt(ctx, vLog.TxHash)
if err != nil {
return nil, err
}
from := adapters.ZeroAddress
for _, log := range txReceipt.Logs {
if log.Topics[0].Hex() == logDepositSigHash.Hex() {
from = common.BytesToAddress(log.Topics[1].Bytes()[12:])
}
}
tokenID := vLog.Topics[3].Big()

// Fetch the block details
Expand Down
3 changes: 2 additions & 1 deletion cmd/lp.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ func processRitsuLPIndexer(client *ethclient.Client, blockNumber int64) error {

func processIziLPIndexer(client *ethclient.Client, blockNumber int64) error {
whitelist := map[string]struct{}{
common.HexToAddress("0x88867BF3bB3321d8c7Da71a8eAb70680037068E4").Hex(): {},
common.HexToAddress("0xE2380f4Cc37027B4bF23bBb3b6c092470dB4975f").Hex(): {},
common.HexToAddress("0x5264F77F8af8550cDa8e81Fee0360c0De6b52432").Hex(): {},
}
tokens := []common.Address{
common.HexToAddress("0x33531bDBFE34fa6Fd5963D0423f7699775AacaaF"),
Expand Down

0 comments on commit 904c8d4

Please sign in to comment.