Skip to content

Added support for new GNS contract

Compare
Choose a tag to compare
@juanmardefago juanmardefago released this 23 Feb 17:33
· 150 commits to master since this release

This release adds support for the new transfer ownership feature for Subgraphs (GNS upgrade), while still remaining backwards compatible via entity duplication.
The GNS upgrade changes the ID of the subgraphs, so we reflect this on the Subgraph entity, but we keep a duplicate entity for Subgraph, SubgraphVersion and NameSignal entities that were created before the upgrade, so that anyone using the old IDs will still keep working.

Entity changes:

  • Subgraph, SubgraphVersion and NameSignal:
    • Added entityVersion field. Denotes the entity version, currently only 1 and 2 are the possible values. A value of 1 denotes that the entity is represented with the OLD ID format for subgraphs, a value of 2 denotes that the entity is represented with the NEW ID format for subgraphs.
    • Added linkedEntity field. Denotes the duplicate entity (if one exists). All entities that were created before the upgrade will have both a entityVersion: 1 and entityVersion: 2 representation of the same entity, and both will be linked through this field.
  • Sugraph
    • Added migrated field that denotes whether the subgraph has been migrated to the new GNS representation. Once it's migrated it will be represented in the contracts as an NFT that can be transferred, otherwise it won't be possible to transfer ownership yet.
    • Added nftID field. Denotes the BigInt (decimal base) representation of the Subgraph ID (ERC721 compatible), since the id field uses the same bytes but in a base58 representation.
    • Added oldID field. Denotes the id of the entity represented using the old format.
    • Added creatorAddress field. Denotes the address of the GraphAccount that created the subgraph. It's used as the first part for the ID for the Subgraph
    • Added subgraphNumber field. Denotes the sequential number (autoincremental id) used as the second part for the ID of the Subgraph.
    • Added nftImage field. Denotes the IPFS file used as the image for the NFT for the Subgraph
    • Added ipfsMetadataHash field. Denotes the metadataHash as an valid IPFS hash (base58 IPFS multihash)