Implements delegation of calls to other contracts, with proper forwarding of return values and bubbling of failures. It defines a fallback function that delegates all calls to the address returned by the abstract _implementation() internal function.
Delegates execution to an implementation contract. This is a low level function that doesn’t return to its internal call site. It will return to the external caller whatever the implementation returns.
Function that is run as the first thing in the fallback function. Can be redefined in derived contracts to add functionality. Redefinitions must call super._willFallback().
Extends BaseUpgradeabilityProxy with a constructor for initializing implementation and init data.
Extends from BaseAdminUpgradeabilityProxy with a constructor for initializing the implementation, admin, and init data.
This contract combines an upgradeability proxy with an authorization
mechanism for administrative tasks.
All external functions in this contract must be guarded by the
ifAdmin modifier. See ethereum/solidity#3864 for a Solidity
feature proposal that would enable this to be done automatically.
Modifier to check whether the
msg.sender is the admin.
If it is, it will run the function. Otherwise, it will delegate the call
to the implementation.
Changes the admin of the proxy. Only the current admin can call this function.
Upgrade the backing implementation of the proxy. Only the admin can call this function.
Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.
This contract implements a proxy that allows to change the implementation address to which it will delegate. Such a change is called an implementation upgrade.
Extends from BaseAdminUpgradeabilityProxy with an initializer for initializing the implementation, admin, and init data.
Extends BaseUpgradeabilityProxy with an initializer for initializing implementation and init data.
This contract is the admin of a proxy, and is in charge of upgrading it as well as transferring it to another admin.
Returns the current implementation of a proxy. This is needed because only the proxy admin can query it.
Returns the admin of a proxy. Only the admin can query it.
Changes the admin of a proxy.
Upgrades a proxy to the newest implementation of a contract.
Contract for upgradeable applications. It handles the creation of proxies.
Returns the provider for a given package name, or zero if not set.
Returns information on a package given its name.
Sets a package in a specific version as a dependency for this application. Requires the version to be present in the package.
Unsets a package given its name. Reverts if the package is not set in the application.
Returns the implementation address for a given contract name, provided by the
create(string packageName, string contractName, address admin, bytes data) → contract AdminUpgradeabilityProxy
Creates a new proxy for the given contract and forwards a function call to it. This is useful to initialize the proxied contract.
Implementation provider that stores contract implementations in a mapping.
Sets the address of the implementation of a contract in the directory.
Removes the address of a contract implementation from the directory.
Emitted when the implementation of a contract is changed.
Abstract contract for providing implementation addresses for other contracts by name.
A package is composed by a set of versions, identified via semantic versioning, where each version has a contract address that refers to a reusable implementation, plus an optional content URI with metadata. Note that the semver identifier is restricted to major, minor, and patch, as prerelease tags are not supported.
Returns a version given its semver identifier.
Returns a contract for a version given its semver identifier.
This method is equivalent to
getVersion, but returns only the contract address.
Adds a new version to the package. Only the Owner can add new versions.
Reverts if the specified semver identifier already exists.
VersionAdded event if successful.
Returns the version with the highest semver identifier registered in the package.
For instance, if
2.0.0 are present, will always return
of the order in which they were registered. Returns zero if no versions are registered.
getLatestByMajor(uint64 major) → uint64 semanticVersion, address contractAddress, bytes contentURI
Returns the version with the highest semver identifier for the given major.
For instance, if
2.0.0 are present, will return
1.3.0 for major
regardless of the order in which they were registered. Returns zero if no versions are registered
for the specified major.
Helper contract to support initializer functions. To use it, replace
the constructor with a function that has the
WARNING: Unlike constructors, initializer functions must be manually
invoked. This applies both to deploying an Initializable contract, as well
as extending an Initializable contract via inheritance.
WARNING: When used with inheritance, manual care must be taken to not invoke
a parent initializer twice, or ensure that all initializers are idempotent,
because this is not dealt with automatically as with constructors.