Gelato Network Contracts

Intro to Gelato's use of the Diamond Proxy pattern

Gelato Network is designed to handle the rapidly evolving multi-chain landscape with its diversity of L1, L2 and sidechain designs. Significant differences can be found across aspects such as consensus mechanisms, block times, likelihood of block re-orgs and transaction fee models.

To handle the nuances that each blockchain design entails, GelatoV2 smart contracts follow a modular upgradeability standard: EIP-2535 Diamond Proxy.

Diamond Proxy Pattern

A Diamond contains:

  • Proxy contract that holds all state variables.

  • Facets which are smart contracts that implement any desired functionality and can be replaced at any time.

  • Libraries, which can be used to share state variables and utility functions across all Facets.

Benefits of Diamond Proxy Pattern

  • Having a single smart contract holding all the state, while not running into issues of exceeding bytecode size.

  • Ability to share state variables and functions between multiple Facets.

  • Fine-grained control in terms of which components of the protocol to upgrade. This means that protocol upgrades are gas-efficient.

  • Optionality of changing GelatoV2 from upgradeable to immutable at any time, simply by revoking rights to upgrade Facets.

Implementing GelatoV2 as a Diamond means that we can easily accommodate new use cases by eliminating integration friction with users and developers, adapt to lower level changes such as a chain changing from the legacy transaction fee model to EIP-1559, and simply adding or removing features as needed without enforcing strong opinions at the application interface level.

GelatoV2 on Ethereum mainnet can be found here: https://louper.dev/diamond/0x3CACa7b48D0573D793d3b0279b5F0029180E83b6

Facets of GelatoV2

Brief guide to the facets that make up GelatoV2 on Ethereum mainnet:

Implementations of GelatoV2 on other chains can also be found on Louper.

Last updated

#334: 1Balance-update

Change request updated