Skip to content

Commit

Permalink
extract registry
Browse files Browse the repository at this point in the history
  • Loading branch information
psparacino committed Oct 18, 2023
1 parent 2a29164 commit e5b60b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion carbonmark/src/Entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export function loadOrCreateProject(token: Address): Project {
// Find the project + vintage ID from token address
let tokenAddress = token.toHexString()
let id = ''
let registry = ''
let projectIndex = 0
for (let i = 0; i < PROJECT_INFO.length; i++) {
if (tokenAddress == PROJECT_INFO[i][0]) {
id = PROJECT_INFO[i][1] + '-' + PROJECT_INFO[i][2]
registry = PROJECT_INFO[i][1].split('-')[0]
projectIndex = i
break
}
Expand All @@ -29,7 +31,7 @@ export function loadOrCreateProject(token: Address): Project {
project.methodology = PROJECT_INFO[projectIndex][4]
project.vintage = BigInt.fromString(PROJECT_INFO[projectIndex][2])
project.projectAddress = token
// project.registry = 'VCS'
project.registry = registry
project.category = PROJECT_INFO[projectIndex][5]
project.country = PROJECT_INFO[projectIndex][6]
project.save()
Expand Down

0 comments on commit e5b60b7

Please sign in to comment.