ERC-897 - DelegateProxy

Created 2018-02-21
Status Stagnant
Category ERC
Type Standards Track
Authors
  • Manuel Araoz <manuel at zeppelin.solutions>

  • Jorge Izquierdo <jorge at aragon.one>

Simple Summary

Proxy contracts are being increasingly used as both as an upgradeability mechanism and a way to save gas when deploying many instances of a particular contract. This standard proposes a set of interfaces for proxies to signal how they work and what their main implementation is.

Abstract

Using proxies that delegate their own logic to another contract is becoming an increasingly popular technique for both smart contract upgradeability and creating cheap clone contracts.

We don't believe there is value in standardizing any particular implementation of a DelegateProxy, given its simplicity, but we believe there is a lot of value in agreeing on an interface all proxies use that allows for a standard way to operate with proxies.

Implementations

Standardized interface

interface ERCProxy {
  function proxyType() public pure returns (uint256 proxyTypeId);
  function implementation() public view returns (address codeAddr);
}

Code address (implementation())

The returned code address is the address the proxy would delegate calls to at that moment in time, for that message.

Proxy Type (proxyType())

Checking the proxy type is the way to check whether a contract is a proxy at all. When a contract fails to return to this method or it returns 0, it can be assumed that the contract is not a proxy.

It also allows for communicating a bit more of information about how the proxy operates. It is a pure function, therefore making it effectively constant as it cannot return a different value depending on state changes.

Benefits

Copyright

Copyright and related rights waived via CC0.