Skip to content

Commit

Permalink
chore(constants): applies diffs from Jesse's subgraph PR
Browse files Browse the repository at this point in the history
Source: Jesse-Sawa#1

I'm applying all changes made in this PR "v3-subgraph for celo changes
Uniswap#1" (Jesse-Sawa#1).

In this commit, I had to modify the original diff from Jesse a little, because the source code has changed slightly since he made the change.
  • Loading branch information
arthurgousset committed Apr 1, 2024
1 parent ee2b36b commit da65fe7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mappings/position-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@ export function handleCollect(event: Collect): void {
}

let token0 = Token.load(position.token0)
let token1 = Token.load(position.token1)

if (token0) {
if (token0 && token1) {
let amount0 = convertTokenToDecimal(event.params.amount0, token0.decimals)
let amount1 = convertTokenToDecimal(event.params.amount1, token1.decimals)
position.collectedFeesToken0 = position.collectedFeesToken0.plus(amount0)
position.collectedFeesToken1 = position.collectedFeesToken1.plus(amount0)
position.collectedFeesToken1 = position.collectedFeesToken1.plus(amount1)
}

position = updateFeeVars(position, event, event.params.tokenId)
Expand Down

0 comments on commit da65fe7

Please sign in to comment.