Upgradeability

Contains interfaces/contracts linked to contract upgradeability.

Contracts

IVersionable

import "@etherisc/gif-next/contracts/upgradeability/IVersionable.sol";
Functions
  • [initializeVersionable(activatedBy, activationData)]

  • [upgradeVersionable(upgradeData)]

  • [getVersion()]

initializeVersionable(address activatedBy, bytes activationData) external

IMPORTANT implementation MUST be guarded by initializer modifier new version MUST inherit from previous version

upgradeVersionable(bytes upgradeData) external

getVersion() → Version external

returns version of this contract each new implementation MUST implement this function version number MUST increase

ProxyManager

import "@etherisc/gif-next/contracts/upgradeability/ProxyManager.sol";

manages proxy deployments for upgradable contracs of type IVersionable

Functions
  • [initialize(registry, implementation, data, salt)]

  • [deploy(registry, initialImplementation, initializationData)]

  • [deployDetermenistic(registry, initialImplementation, initializationData, salt)]

  • [upgrade(newImplementation)]

  • [upgrade(newImplementation, upgradeData)]

  • [linkToProxy()]

  • [getDeployData(proxyOwner, deployData)]

  • [getUpgradeData(upgradeData)]

  • [getProxy()]

  • [getVersion()]

  • [getVersionCount()]

  • [getVersion(idx)]

  • [getVersionInfo(_version)]

NftOwnable
  • [_checkNftType(nftId, expectedObjectType)]

  • [__NftOwnable_init(registry, initialOwner)]

  • [linkToRegisteredNftId()]

  • [getNftId()]

  • [getOwner()]

  • [_linkToNftOwnable(nftOwnableAddress)]

RegistryLinked
  • [__RegistryLinked_init(registry)]

  • [getRegistry()]

InitializableERC165
  • [__ERC165_init()]

  • [_initializeERC165()]

  • [_registerInterface(interfaceId)]

  • [_registerInterfaceNotInitializing(interfaceId)]

  • [supportsInterface(interfaceId)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
  • [LogProxyManagerVersionableDeployed(proxy, initialImplementation)]

  • [LogProxyManagerVersionableUpgraded(proxy, upgradedImplementation)]

INftOwnable
  • [LogNftOwnableNftLinkedToAddress(nftId, owner)]

Initializable
  • [Initialized(version)]

initialize(address registry, address implementation, bytes data, bytes32 salt) → contract IVersionable versionable public

convencience initializer

deploy(address registry, address initialImplementation, bytes initializationData) → contract IVersionable versionable public

deploy initial contract

deployDetermenistic(address registry, address initialImplementation, bytes initializationData, bytes32 salt) → contract IVersionable versionable public

upgrade(address newImplementation) → contract IVersionable versionable public

upgrade existing contract. convenience method using empty data

upgrade(address newImplementation, bytes upgradeData) → contract IVersionable versionable public

upgrade existing contract

linkToProxy() → NftId public

getDeployData(address proxyOwner, bytes deployData) → bytes data public

getUpgradeData(bytes upgradeData) → bytes data public

getProxy() → contract UpgradableProxyWithAdmin public

getVersion() → Version external

getVersionCount() → uint256 external

getVersion(uint256 idx) → Version external

getVersionInfo(Version _version) → struct ProxyManager.VersionInfo external

LogProxyManagerVersionableDeployed(address indexed proxy, address initialImplementation) event

LogProxyManagerVersionableUpgraded(address indexed proxy, address upgradedImplementation) event

UpgradableProxyWithAdmin

import "@etherisc/gif-next/contracts/upgradeability/UpgradableProxyWithAdmin.sol";
Functions
  • [constructor(implementation, initialProxyAdminOwner, data)]

  • [getProxyAdmin()]

  • [getInitializationData()]

TransparentUpgradeableProxy
  • [_proxyAdmin()]

  • [_fallback()]

ERC1967Proxy
  • [_implementation()]

Proxy
  • [_delegate(implementation)]

  • [fallback()]

constructor(address implementation, address initialProxyAdminOwner, bytes data) public

getProxyAdmin() → contract ProxyAdmin external

getInitializationData() → bytes external

Versionable

import "@etherisc/gif-next/contracts/upgradeability/Versionable.sol";
Functions
  • [constructor()]

  • [initializeVersionable(activatedBy, data)]

  • [upgradeVersionable(data)]

  • [getVersion()]

  • [_initialize(, )]

  • [_upgrade(data)]

Initializable
  • [_checkInitializing()]

  • [_disableInitializers()]

  • [_getInitializedVersion()]

  • [_isInitializing()]

Events
Initializable
  • [Initialized(version)]

constructor() internal

initializeVersionable(address activatedBy, bytes data) public

upgradeVersionable(bytes data) external

getVersion() → Version public

returns version of this contract each new implementation MUST implement this function version number MUST increase

_initialize(address, bytes) internal

_upgrade(bytes data) internal