diff --git a/DaoPools/schema.graphql b/DaoPools/schema.graphql index f2443a7..2484eaa 100644 --- a/DaoPools/schema.graphql +++ b/DaoPools/schema.graphql @@ -209,6 +209,8 @@ type Proposal @entity { executor: Bytes! "The timestamp of execution" executionTimestamp: BigInt! + "The hash of proposal execution tx" + executionHash: Bytes! "The timestamp of reaching quorum" quorumReachedTimestamp: BigInt! @@ -449,6 +451,9 @@ type TokenSaleTier @entity { "id forms from token sale address + tier id" id: Bytes! + "The hash of tier creation tx" + creationHash: Bytes! + "The sale token contract address" saleToken: Bytes! diff --git a/DaoPools/src/entities/Proposal.ts b/DaoPools/src/entities/Proposal.ts index 22658e3..59b5b85 100644 --- a/DaoPools/src/entities/Proposal.ts +++ b/DaoPools/src/entities/Proposal.ts @@ -22,6 +22,7 @@ export function getProposal( proposal.isFor = false; proposal.executor = Bytes.empty(); proposal.executionTimestamp = BigInt.zero(); + proposal.executionHash = Bytes.empty(); proposal.quorumReachedTimestamp = BigInt.zero(); proposal.rewardToken = rewardToken; diff --git a/DaoPools/src/entities/TokenSaleTier.ts b/DaoPools/src/entities/TokenSaleTier.ts index a9a9a2f..5c829e7 100644 --- a/DaoPools/src/entities/TokenSaleTier.ts +++ b/DaoPools/src/entities/TokenSaleTier.ts @@ -14,6 +14,8 @@ export function getTokenSaleTier( tier.saleToken = saleToken; + tier.creationHash = Bytes.empty(); + tier.totalBuyersCount = BigInt.zero(); tier.buyers = new Array(); diff --git a/DaoPools/src/mappings/DaoPool.ts b/DaoPools/src/mappings/DaoPool.ts index 51a2378..2f50ceb 100644 --- a/DaoPools/src/mappings/DaoPool.ts +++ b/DaoPools/src/mappings/DaoPool.ts @@ -335,6 +335,7 @@ export function onProposalExecuted(event: ProposalExecuted): void { proposal.isFor = event.params.isFor; proposal.executor = event.params.sender; proposal.executionTimestamp = event.block.timestamp; + proposal.executionHash = event.transaction.hash; proposal.save(); pool.save(); diff --git a/DaoPools/src/mappings/TokenSale.ts b/DaoPools/src/mappings/TokenSale.ts index fea2edd..70af7aa 100644 --- a/DaoPools/src/mappings/TokenSale.ts +++ b/DaoPools/src/mappings/TokenSale.ts @@ -11,6 +11,9 @@ import { push } from "../helpers/ArrayHelper"; export function onTierCreated(event: TierCreated): void { let tokenSale = getTokenSale(event.address); let tier = getTokenSaleTier(tokenSale, event.params.tierId, event.params.saleToken); + + tier.creationHash = event.transaction.hash; + let participationDetails = event.params.participationDetails; for (let i = 0; i < participationDetails.length; i++) { tier.whitelistTypes = push(tier.whitelistTypes, BigInt.fromI32(participationDetails[i].participationType)); diff --git a/DaoPools/tests/DaoPool.test.ts b/DaoPools/tests/DaoPool.test.ts index d5fa62e..48d95e2 100644 --- a/DaoPools/tests/DaoPool.test.ts +++ b/DaoPools/tests/DaoPool.test.ts @@ -1205,6 +1205,12 @@ describe("DaoPool", () => { "executionTimestamp", block.timestamp.toString() ); + assert.fieldEquals( + "Proposal", + contractSender.concatI32(proposalId.toI32()).toHexString(), + "executionHash", + tx.hash.toHexString() + ); proposalId = BigInt.fromI32(2); isFor = false; diff --git a/DaoPools/tests/TokenSale.test.ts b/DaoPools/tests/TokenSale.test.ts index 04b022d..5c72f04 100644 --- a/DaoPools/tests/TokenSale.test.ts +++ b/DaoPools/tests/TokenSale.test.ts @@ -115,6 +115,12 @@ describe("TokenSale", () => { "tokenSale", contractSender.toHexString() ); + assert.fieldEquals( + "TokenSaleTier", + contractSender.concatI32(tierId.toI32()).toHexString(), + "creationHash", + tx.hash.toHexString() + ); assert.fieldEquals( "TokenSaleTier", contractSender.concatI32(tierId.toI32()).toHexString(),