Skip to content

Commit

Permalink
Exclude MCO2 from Provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
cujowolf committed Aug 3, 2023
1 parent c2a756d commit f59f8da
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions polygon-digital-carbon/src/TransferHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,19 @@ export function handleCreditTransfer(event: Transfer): void {
event.block.timestamp
)

recordProvenance(
event.transaction.hash,
event.address,
event.params.from,
event.params.to,
'ORIGINATION',
event.params.value,
event.block.timestamp
)

credit.provenanceCount += 1
if (event.address != MCO2_ERC20_CONTRACT) {
recordProvenance(
event.transaction.hash,
event.address,
event.params.from,
event.params.to,
'ORIGINATION',
event.params.value,
event.block.timestamp
)

credit.provenanceCount += 1
}
}
} else {
loadOrCreateAccount(event.params.from)
Expand All @@ -72,7 +74,7 @@ export function handleCreditTransfer(event: Transfer): void {
toHolding.lastUpdated = event.block.timestamp
toHolding.save()

if (event.params.from != ZERO_ADDRESS) {
if (event.params.from != ZERO_ADDRESS && event.address != MCO2_ERC20_CONTRACT) {
recordProvenance(
event.transaction.hash,
event.address,
Expand Down

0 comments on commit f59f8da

Please sign in to comment.