• © Goverland Inc. 2026
  • v1.0.5
  • Privacy Policy
  • Terms of Use
The Graph CouncilThe Graph Councilby0x7EbE5983FDA73749f94E39A215Cc80263A2803850x7EbE…0385

GGP 0009: Save gas when initializing a subgraph deployment

Voting ended about 4 years agoSucceeded

GGP: 0009 Scope: Smart Contracts Created: 2021-12-01 GIPs-Repo-Latest-Commit: 2e84093ed32024530e77a5e862eea46f491a322f

GIPs

GIP: 0019 Title: Save gas when initializing a subgraph deployment Authors: Ariel Barmat ariel@edgeandnode.com Created: 2021-09-25 Stage: Candidate Discussions-To: https://forum.thegraph.com/t/gip-0019-save-gas-when-initializing-a-subgraph-deployment/2590

Motivation

Reduce the gas cost for anyone initializing a subgraph deployment. This update is particularly beneficial for subgraph/app developers who do the first signal.

Implementation

Use a Minimal Proxy to clone the Graph Curation Token (ERC20) based on an implementation contract deployed just once. The implementation bytecode is also called master copy.

The benefit of this solution is that the token interface remain the same, making it backwards compatible.

This solution involves the following changes:

  • Modify the initializer of Curation to accept the master copy contract address to use when cloning.
  • Expose a function in Curation contract so that governance can change the implementation in the future.
  • Leverage "@openzeppelin/contracts/proxy/Clones.sol" to spawn the Minimal Proxies.
  • Update the current Graph Curation Token contract code and make it upgradeable so it can be used from the context of a Minimal Proxy.

References

Implementations: https://github.com/graphprotocol/contracts/pull/505

Audit: https://github.com/graphprotocol/contracts/blob/a24f6a140ad170cfc11572136e309c70975b8a2a/audits/OpenZeppelin/2021-11-graph-curation-minimal-proxy.pdf


Graph Governance Proposal-0009

Save gas when initializing a subgraph deployment

This proposal is to upgrade The Graph's protocol smart contracts running on Ethereum mainnet with the changes described in Graph Improvement Proposal (GIP) 0019, including the motivation and scope of the changes described in this proposal.

The code deployed that implements GIP-0019 must correspond to the commit hash included in the front matter of this governance proposal.

Following a successful "yes" vote, the protocol upgrade should be carried out at the earliest convenience using The Graph Council's Gnosis Multisig.

Off-Chain Vote

Yes
6 100%
No
0 0%
Download mobile app to vote

Timeline

Dec 02, 2021Proposal created
Dec 02, 2021Proposal vote started
Dec 07, 2021Proposal vote ended
Oct 26, 2023Proposal updated