diff --git a/package.json b/package.json index 7de1dc9..5e81091 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "subgraphs", "private": true, "scripts": { + "prepare": "husky", "postinstall": "yarn run --silent prepare:arbitrum && yarn run --silent codegen", "codegen": "rm -Rf generated && graph codegen", "build": "graph build", @@ -27,7 +28,7 @@ "@graphprotocol/graph-cli": "^0.69.2", "@graphprotocol/graph-ts": "^0.34.0", "assemblyscript-prettier": "^3.0.1", - "husky": ">=7", + "husky": "^9.0.11", "lint-staged": ">=10", "matchstick-as": "^0.6.0", "mustache": "^4.2.0", diff --git a/src/vault-interaction.ts b/src/vault-interaction.ts index b033555..34d7fba 100644 --- a/src/vault-interaction.ts +++ b/src/vault-interaction.ts @@ -1,7 +1,5 @@ import { Address, BigInt, ethereum } from "@graphprotocol/graph-ts" -import { - Transfer as TransferEvent, -} from "../generated/templates/BeefyCLVault/BeefyVaultConcLiq" +import { Transfer as TransferEvent } from "../generated/templates/BeefyCLVault/BeefyVaultConcLiq" import { getBeefyCLStrategy, getBeefyCLVault, getBeefyCLVaultSnapshot, isVaultInitialized } from "./entity/vault" import { getTransaction } from "./entity/transaction" import { getInvestor } from "./entity/investor" @@ -14,7 +12,6 @@ import { InvestorPositionInteraction } from "../generated/schema" import { getEventIdentifier } from "./utils/event" import { SHARE_TOKEN_MINT_ADDRESS } from "./config" - export function handleVaultTransfer(event: TransferEvent): void { // sending to self if (event.params.from.equals(event.params.to)) { @@ -29,18 +26,14 @@ export function handleVaultTransfer(event: TransferEvent): void { // don't duplicate processing between Transfer and Deposit/Withdraw if (!event.params.from.equals(SHARE_TOKEN_MINT_ADDRESS)) { updateUserPosition(event, event.params.from, event.params.value.neg()) - } - + } + if (!event.params.to.equals(SHARE_TOKEN_MINT_ADDRESS)) { updateUserPosition(event, event.params.to, event.params.value) } } -function updateUserPosition( - event: ethereum.Event, - investorAddress: Address, - sharesDelta: BigInt, -): void { +function updateUserPosition(event: ethereum.Event, investorAddress: Address, sharesDelta: BigInt): void { let vault = getBeefyCLVault(event.address) if (!isVaultInitialized(vault)) { return diff --git a/yarn.lock b/yarn.lock index b44a315..232a294 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1974,9 +1974,9 @@ human-signals@^5.0.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz" integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== -husky@>=7: +husky@^9.0.11: version "9.0.11" - resolved "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz" + resolved "https://registry.yarnpkg.com/husky/-/husky-9.0.11.tgz#fc91df4c756050de41b3e478b2158b87c1e79af9" integrity sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw== hyperlinker@^1.0.0: