Skip to content

Commit

Permalink
Merge branch 'master' into symbiotic
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-chauhan authored Jul 5, 2024
2 parents c85d084 + 032220a commit a00060e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
18 changes: 9 additions & 9 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
"status": "prod",
"versions": {
"schema": "3.1.0",
"subgraph": "2.4.2",
"subgraph": "2.4.3",
"methodology": "1.1.0"
},
"files": {
Expand Down Expand Up @@ -4598,7 +4598,7 @@
"status": "prod",
"versions": {
"schema": "4.0.1",
"subgraph": "1.3.1",
"subgraph": "1.3.2",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5109,7 +5109,7 @@
},
"decentralized-network": {
"slug": "qidao-base",
"query-id": "TODO"
"query-id": "9NHJ9k31qaGCYXppm9isJTiEoiB6v3tJDnR6SrQrxcjw"
}
}
},
Expand Down Expand Up @@ -6697,7 +6697,7 @@
},
"decentralized-network": {
"slug": "ens-governance",
"query-id": "F7MznC87sv5y5jNUaBSrKFgCqTqP9Vgc11xcreZQpX7e"
"query-id": "GyijYxW9yiSRcEd5u2gfquSvneQKi5QuvU3WZgFyfFSn"
}
}
}
Expand All @@ -6714,7 +6714,7 @@
"status": "prod",
"versions": {
"schema": "1.0.0",
"subgraph": "1.0.0",
"subgraph": "1.0.2",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -6731,7 +6731,7 @@
},
"decentralized-network": {
"slug": "euler-governance",
"query-id": "4xyasjQeREe7PxnF6wVdobZvCw5mhoHZq3T7guRpuNPf"
"query-id": "F94CS4mephx6noem4KsXxeGDSufCGUH5fXrqUX5ZiFk2"
}
}
}
Expand Down Expand Up @@ -8134,7 +8134,7 @@
},
"decentralized-network": {
"slug": "the-graph-arbitrum",
"query-id": "UNKNOWN"
"query-id": "EExUE3FayKraaTteewjxaUpZW4M33j4bsD6pgxNCHnGd"
}
},
"files": {
Expand Down Expand Up @@ -11369,7 +11369,7 @@
},
"decentralized-network": {
"slug": "ring-few-blast",
"query-id": "TODO"
"query-id": "FfTNTmfsJAz1gUqnc3RxGEqyaeMTRdaS4C5bYHAHbzsC"
}
}
}
Expand Down Expand Up @@ -11403,7 +11403,7 @@
},
"decentralized-network": {
"slug": "cygnus-finance-base",
"query-id": "TODO"
"query-id": "ELqNv3KbLggc6kN6uoeKvrbfBpbkQbAorZo3FABZJb6A"
}
}
}
Expand Down
17 changes: 5 additions & 12 deletions subgraphs/erc20/src/mappings/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,20 +320,15 @@ function handleTransferEvent(
if (isNewAccount(destination)) {
// It means the receiver is a new holder
toAddressIsNewHolderNum = BIGINT_ONE;
} else {
balance = getOrCreateAccountBalance(
getOrCreateAccount(destination),
token
);
if (balance.amount == BIGINT_ONE) {
// It means the receiver's token balance is 0 before transferal.
toBalanceIsZeroNum = BIGINT_ONE;
}
}
balance = getOrCreateAccountBalance(getOrCreateAccount(destination), token);
if (balance.amount == BIGINT_ZERO) {
// It means the receiver's token balance is 0 before transferal.
toBalanceIsZeroNum = BIGINT_ONE;
}

token.currentHolderCount = token.currentHolderCount
.minus(FromBalanceToZeroNum)
.plus(toAddressIsNewHolderNum)
.plus(toBalanceIsZeroNum);
token.cumulativeHolderCount = token.cumulativeHolderCount.plus(
toAddressIsNewHolderNum
Expand All @@ -343,7 +338,6 @@ function handleTransferEvent(
let dailySnapshot = getOrCreateTokenDailySnapshot(token, event.block);
dailySnapshot.currentHolderCount = dailySnapshot.currentHolderCount
.minus(FromBalanceToZeroNum)
.plus(toAddressIsNewHolderNum)
.plus(toBalanceIsZeroNum);
dailySnapshot.cumulativeHolderCount =
dailySnapshot.cumulativeHolderCount.plus(toAddressIsNewHolderNum);
Expand All @@ -357,7 +351,6 @@ function handleTransferEvent(
let hourlySnapshot = getOrCreateTokenHourlySnapshot(token, event.block);
hourlySnapshot.currentHolderCount = hourlySnapshot.currentHolderCount
.minus(FromBalanceToZeroNum)
.plus(toAddressIsNewHolderNum)
.plus(toBalanceIsZeroNum);
hourlySnapshot.cumulativeHolderCount =
hourlySnapshot.cumulativeHolderCount.plus(toAddressIsNewHolderNum);
Expand Down

0 comments on commit a00060e

Please sign in to comment.