-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial skeleton logic for including CMARK credit issuance and tr…
…ansfers
- Loading branch information
1 parent
3594fb6
commit b8605ba
Showing
4 changed files
with
86 additions
and
19 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
polygon-digital-carbon/src/templates/CarbonmarkCreditTokenFactory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { CarbonmarkCreditToken } from '../../generated/templates' | ||
import { | ||
NewTokenProject | ||
} from '../../generated/C3ProjectTokenFactory/C3ProjectTokenFactory' | ||
import { loadOrCreateCarbonCredit, updateCarbonCreditWithCall } from '../utils/CarbonCredit' | ||
import { createTokenWithCall } from '../utils/Token' | ||
|
||
|
||
export function handleNewCarbonmarkCredit(event: NewTokenProject): void { | ||
// Start indexing the C3T tokens; `event.params.tokenAddress` is the | ||
// address of the new token contract | ||
CarbonmarkCreditToken.create(event.params.tokenAddress) | ||
loadOrCreateCarbonCredit(event.params.tokenAddress, 'CMARK', null) | ||
createTokenWithCall(event.params.tokenAddress, event.block) | ||
updateCarbonCreditWithCall(event.params.tokenAddress, '') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters