Indexed Finance
  • README
  • Introduction
    • Product FAQs
      • Index Pools
      • Yield Aggregator Vaults
    • Fees
    • Who We Are
  • Day-To-Day Operations
    • Using Your Vote
    • The Sigma Program
  • Index Pool Protocol
    • Terminology
    • Governance
    • Security
    • Index Controller
    • Index Pools
    • Rebalancing
      • Bootstrapping New Tokens
      • Removing Tokens
  • Index Pool Smart Contracts
    • Deployments
    • IndexPool.sol
    • PoolInitializer.sol
    • UnboundTokenSeller.sol
    • MarketCapSqrtController.sol
    • @indexed-finance/proxies
      • DelegateCallProxyManager.sol
      • DelegateCallProxyManyToOne.sol
      • DelegateCallProxyOneToOne.sol
      • ManyToOneImplementationHolder.sol
      • SaltyLib.sol
    • @indexed-finance/uniswap-v2-oracle
    • Interfaces
      • IIndexPool.sol
      • IFlashLoanRecipient.sol
  • Yield Aggregator Protocol
    • Supported Assets
  • Yield Aggregator Smart Contracts
    • Deployments
Powered by GitBook
On this page
  • DelegateCallProxyOneToOne
  • Notes
  • Functions
  • _implementation
  • _beforeFallback

Was this helpful?

  1. Index Pool Smart Contracts
  2. @indexed-finance/proxies

DelegateCallProxyOneToOne.sol

PreviousDelegateCallProxyManyToOne.solNextManyToOneImplementationHolder.sol

Last updated 4 years ago

Was this helpful?

DelegateCallProxyOneToOne

Upgradeable delegatecall proxy for a single contract.

This proxy stores an implementation address which can be upgraded by the proxy manager.

To upgrade the implementation, the manager calls the proxy with the abi encoded implementation address.

If any other account calls the proxy, it will delegatecall the implementation address with the received calldata and ether.

If the call succeeds, it will return with the received returndata. If it reverts, it will revert with the received revert data.

Notes

The storage slot for the implementation address is: bytes32(uint256(keccak256("IMPLEMENTATION_ADDRESS")) + 1). This slot must not be used by the implementation contract.

This contract does not verify that the implementation address is a valid delegation target. The manager must perform this safety check.

Functions

_implementation

function _implementation() returns (address)

Reads the implementation address from storage.

_beforeFallback

function _beforeFallback()

Hook that is called before falling back to the implementation. Checks if the call is from the owner. If it is, reads the abi-encoded implementation address from calldata and stores it at the slot bytes32(uint256(keccak256("IMPLEMENTATION_ADDRESS")) + 1), then returns with no data. If it is not, continues execution with the fallback function.

_implementation
_beforeFallback