From dc2e364485e714313a62e65c4949fb0d6a9f741e Mon Sep 17 00:00:00 2001 From: Dan Oved Date: Wed, 10 Jan 2024 17:24:32 -0800 Subject: [PATCH] Adding the 721 and 1155 contract impl to the Upgrade --- schema.graphql | 1 + src/ERC1155Mappings/factoryMappings.ts | 3 +++ src/ERC721Mappings/ERC721FactoryMappings.ts | 1 + 3 files changed, 5 insertions(+) diff --git a/schema.graphql b/schema.graphql index 59728b6..57f5197 100644 --- a/schema.graphql +++ b/schema.graphql @@ -101,6 +101,7 @@ type Upgrade @entity { impl: Bytes version: String! + creatorContractImpl: Bytes type: String } diff --git a/src/ERC1155Mappings/factoryMappings.ts b/src/ERC1155Mappings/factoryMappings.ts index ef87cd4..ab8300c 100644 --- a/src/ERC1155Mappings/factoryMappings.ts +++ b/src/ERC1155Mappings/factoryMappings.ts @@ -114,6 +114,9 @@ export function handle1155FactoryUpgraded(event: Upgraded): void { upgrade.timestamp = event.block.timestamp; upgrade.impl = event.params.implementation; upgrade.version = creator.contractVersion(); + // zora1155Impl didn't exist on all versions of the contract, so this + // handles the case it doesnt exist. + upgrade.creatorContractImpl = creator.try_zora1155Impl().value; upgrade.address = event.address; upgrade.type = "1155Factory"; diff --git a/src/ERC721Mappings/ERC721FactoryMappings.ts b/src/ERC721Mappings/ERC721FactoryMappings.ts index 16668a8..a6790ac 100644 --- a/src/ERC721Mappings/ERC721FactoryMappings.ts +++ b/src/ERC721Mappings/ERC721FactoryMappings.ts @@ -87,6 +87,7 @@ export function handleFactoryUpgraded(event: Upgraded): void { upgrade.timestamp = event.block.timestamp; upgrade.impl = event.params.implementation; upgrade.version = creator.contractVersion().toString(); + upgrade.creatorContractImpl = creator.implementation(); upgrade.address = event.address; upgrade.type = "721Factory";