diff --git a/subgraph/networks.json b/subgraph/networks.json index bb396c92..76532a9c 100644 --- a/subgraph/networks.json +++ b/subgraph/networks.json @@ -16,17 +16,17 @@ "address": "0x8cA737E2cdaE1Ceb332bEf7ba9eA711a3a2f8037", "startBlock": 5300777 }, - "LockingCrowdSale": { - "address": "0xaf7358576C9F7cD84696D28702fC5ADe33cce0e9", - "startBlock": 7306191 - }, "StakedLockingCrowdSale": { "address": "0xd1cE2EA7d3b0C9cAB025A4aD762FC00315141ad7", "startBlock": 5300777 }, + "LockingCrowdSale": { + "address": "0x0Da77f361bB56f065Aa21647d885685eb7cAE10F", + "startBlock": 7339034 + }, "StakedLockingCrowdSale2": { - "address": "0xbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d", - "startBlock": 7306191 + "address": "0x2d309CF13dC3872f9c9B1B06Ebf6F60caDe08d55", + "startBlock": 7339082 }, "TermsAcceptedPermissioner": { "address": "0xC05D649368d8A5e2E98CAa205d47795de5fCB599", @@ -50,14 +50,14 @@ "address": "0xf0a8d23f38e9cbbe01c4ed37f23bd519b65bc6c2", "startBlock": 18490640 }, - "LockingCrowdSale": { - "address": "0xbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d", - "startBlock": 21431344 - }, "StakedLockingCrowdSale": { "address": "0x35Bce29F52f51f547998717CD598068Afa2B29B7", "startBlock": 17481804 }, + "LockingCrowdSale": { + "address": "0xbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d", + "startBlock": 21431344 + }, "StakedLockingCrowdSale2": { "address": "0xbaadf00dbaadf00dbaadf00dbaadf00dbaadf00d", "startBlock": 21431344 diff --git a/subgraph/schema.graphql b/subgraph/schema.graphql index 1987904e..8f5c72b8 100644 --- a/subgraph/schema.graphql +++ b/subgraph/schema.graphql @@ -147,6 +147,7 @@ type CrowdSale @entity { contributions: [Contribution!] @derivedFrom(field: "crowdSale") feeBp: Int # the percentage fee that will be cut from the crowdsale upon its success type: SaleType! + contract: Bytes! # the address of the crowdsale contract } type Contribution @entity { diff --git a/subgraph/src/crowdSaleMapping.ts b/subgraph/src/crowdSaleMapping.ts index 0c5bdfcb..00cbbfb6 100644 --- a/subgraph/src/crowdSaleMapping.ts +++ b/subgraph/src/crowdSaleMapping.ts @@ -24,7 +24,8 @@ export function handleStarted(event: StartedEvent): void { ]) return } - + + crowdSale.contract = event.address crowdSale.ipt = ipt.id crowdSale.issuer = event.params.issuer crowdSale.feeBp = event.params.feeBp diff --git a/subgraph/src/stakedLockingCrowdSaleMapping.ts b/subgraph/src/stakedLockingCrowdSaleMapping.ts index 2a83b226..fd60e367 100644 --- a/subgraph/src/stakedLockingCrowdSaleMapping.ts +++ b/subgraph/src/stakedLockingCrowdSaleMapping.ts @@ -1,9 +1,7 @@ import { BigInt, - Bytes, - DataSourceContext, - log, - ethereum + ethereum, + log } from '@graphprotocol/graph-ts' import { IERC20Metadata } from '../generated/CrowdSale/IERC20Metadata' import { @@ -13,25 +11,25 @@ import { ClaimedFundingGoal as ClaimedFundingGoalEvent, ClaimedStakes as ClaimedStakesEvent, Failed as FailedEvent, + Started3 as LegacyStartedEvent, LockingContractCreated as LockingContractCreatedEvent, Settled as SettledEvent, Staked as StakedEvent, - Started3 as LegacyStartedEvent, Started as StartedEvent } from '../generated/StakedLockingCrowdSale/StakedLockingCrowdSale' +import { LockingContractCreated as LockedLockingContractCreatedEvent } from '../generated/LockingCrowdSale/LockingCrowdSale' import { Started as PlainStartedEvent } from '../generated/CrowdSale/CrowdSale' import { Started as LockingStartedEvent } from '../generated/LockingCrowdSale/LockingCrowdSale' import { handleStarted as plainHandleStarted } from './crowdSaleMapping' -import { lockingHandleStarted, handleLockingContractCreated as lockedHandleLockingContractCreated } from './lockingCrowdSaleMapping' +import { handleLockingContractCreated as lockedHandleLockingContractCreated, lockingHandleStarted } from './lockingCrowdSaleMapping' import * as GenericCrowdSale from './genericCrowdSale' -import { Contribution, CrowdSale, ERC20Token, IPT } from '../generated/schema' +import { Contribution, CrowdSale } from '../generated/schema' -import { TimelockedToken as TimelockedTokenTemplate } from '../generated/templates' -import { makeERC20Token, makeTimelockedToken } from './common' +import { makeERC20Token } from './common' /** * there are contracts that emit the started event without fees @@ -153,7 +151,8 @@ export function handleClaimed(event: ClaimedEvent): void { export function handleLockingContractCreated( event: LockingContractCreatedEvent ): void { - lockedHandleLockingContractCreated(event) + //xing fingers that this works! + lockedHandleLockingContractCreated(changetype(event)) } export function handleStaked(event: StakedEvent): void {