Skip to content

Commit

Permalink
Refactoring (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHathaway authored Sep 19, 2023
1 parent 98d6bba commit c9da759
Show file tree
Hide file tree
Showing 3 changed files with 351 additions and 343 deletions.
21 changes: 20 additions & 1 deletion src/mappings/base/base-pool.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Address, BigInt, Bytes, ethereum, log } from "@graphprotocol/graph-ts"
import { Account, AddQuoteToken, Bucket, BucketBankruptcy, Flashloan, Lend, LoanStamped, MoveQuoteToken, Pool, PositionLend, RemoveQuoteToken, ReserveAuctionKick, ReserveAuctionTake, Token, TransferLP, UpdateInterestRate } from "../../../generated/schema"
import { Account, AddQuoteToken, BondWithdrawn, Bucket, BucketBankruptcy, Flashloan, Lend, LoanStamped, MoveQuoteToken, Pool, PositionLend, RemoveQuoteToken, ReserveAuctionKick, ReserveAuctionTake, Token, TransferLP, UpdateInterestRate } from "../../../generated/schema"
import {
AddQuoteToken as AddQuoteTokenERC20Event,
MoveQuoteToken as MoveQuoteTokenERC20Event,
Expand Down Expand Up @@ -572,6 +572,25 @@ export function _handleRevokeLPTransferors(event: ethereum.Event, lender: Addres
entity.save()
}

/**********************************/
/*** Liquidation Event Handlers ***/
/**********************************/

export function _handleBondWithdrawn(event: ethereum.Event, kicker: Address, reciever: Address, amount: BigInt): void {
const entity = new BondWithdrawn(
event.transaction.hash.concatI32(event.logIndex.toI32())
)
entity.kicker = kicker
entity.reciever = reciever
entity.amount = wadToDecimal(amount)

entity.blockNumber = event.block.number
entity.blockTimestamp = event.block.timestamp
entity.transactionHash = event.transaction.hash

entity.save()
}

/*******************************/
/*** Reserves Event Handlers ***/
/*******************************/
Expand Down
Loading

0 comments on commit c9da759

Please sign in to comment.