Enzyme General Spec (v4)
User Docs (v4)
  • Intro
  • GitHub repo
  • Architecture
    • Persistent
    • Release
  • Users
    • End users
    • Administrators
    • Access Control Handoff
  • Topics
    • Fund Lifecycle
    • Holdings and Shares
    • External Positions
    • Position Pricing
    • Protocol Access
    • Gas Relayer
    • Policies
    • Known Risks & Mitigations
  • Fee formulas
    • ManagementFee
    • Performance Fee
  • Peripheral Features
    • Shares Wrappers
Powered by GitBook
On this page
  • Architecture
  • Usage
  • Allowed calls

Was this helpful?

  1. Topics

Gas Relayer

This release supports relayed transactions via Open GSN.

Fund managers can leverage this support to pay for gas costs of allowed transactions with the VaultProxy 's WETH balance.

From a high level, this works by deploying a GSN-compliant "paymaster" contract per-fund that is allowed to withdraw WETH from its associated VaultProxy to top up a deposit balance for that fund.

Architecture

The gas relayer architecture is specific to this release (i.e., it is not "persistent" between releases).

The main contracts involved are:

  • GasRelayPaymasterLib - the canonical library contract for all "paymaster" instances, providing the logic for interacting with GSN contracts, maintaining a healthy WETH deposit, and defining the rules for calls that can be relayed

  • GasRelayPaymasterFactory - deploys new "paymaster" (BeaconProxy) instances, and is the reference for the current beacon library (i.e., GasRelayPaymasterLib)

  • GasRelayRecipientMixin - shared logic that is inherited by all gateway contracts for relayable transactions

Usage

To use gas relaying:

  1. There must be enough WETH in the VaultProxy to cover the deposit amount specified by the current GasRelayPaymasterLib .

  2. The fund owner calls deployGasRelayPaymaster() on the ComptrollerProxy

  3. The ComptrollerProxy deploys a new "paymaster" ( BeaconProxy instance) via the GasRelayPaymasterFactory and deposits WETH into the newly-deployed paymaster.

  4. The fund should maintain enough WETH balance in the VaultProxy to top up the deposit before it runs out.

To turn off the gas relayer, the fund owner can call shutdownGasRelayPaymaster() on the ComptrollerProxy, which withdraws the WETH deposit back to the VaultProxy.

When a fund migrates to a new release, the fund owner can call withdrawBalance() on the "paymaster" to withdraw the WETH deposit back to the VaultProxy.

Allowed calls

Any account with a permissioned role (owner, migrator, or asset manager) on the fund can use the internal gas relayer architecture. Additionally, the fund owner can specify additional arbitrary users (e.g., the executors of deposit and redemption queues).

Any calls by these users is allowed to be relayed. The fund owner is responsible for monitoring for any abuse.

PreviousProtocol AccessNextPolicies

Last updated 1 month ago

Was this helpful?