Skip to main content

ERC20LookthroughUpgradable

ERC20Lookthrough is an ERC-20 whose total supply is tied to a function in an external contract

There is no IERC20LookthroughUpgradable since all functions override IERC20 or are private

Functions#

__ERC20Lookthrough_init#

  function __ERC20Lookthrough_init(    string name,    string symbol,    address underlyingContractAddress,    string underlyingBalanceFunction  ) internal

The initialization function i.e., a proxy contract's equivalent of a constructor

Parameters:#

NameTypeDescription
namestringStandard ERC-20 name
symbolstringStandard ERC-20 symbol
underlyingContractAddressaddressThe underlying contract
underlyingBalanceFunctionstringThe function name of the underlying contract that's called to determine total supply

totalSupply#

  function totalSupply(  ) public returns (uint256)

ERC20 totalSupply function that references another contract based on _underlyingContractAddress & arbitrary function _underlyingBalanceFunction

balanceOf#

  function balanceOf(  ) public returns (uint256)

ERC-20 balanceOf function that references another contract based on _underlyingContractAddress & arbitrary function _underlyingBalanceFunction

_transfer#

  function _transfer(  ) internal

Based on Open Zeppelin's ERC-20 implementation

_mint#

  function _mint(  ) internal

Based on Open Zeppelin's ERC-20 implementation

_burn#

  function _burn(  ) internal

Based on Open Zeppelin's ERC-20 implementation