bumi 6cbfc88159 Refactor to support multiple contracts in the registry
This allows to manage different contracts (Token, Collaborator, etc.)
with one registry.
The registry serves as main source for all contracts and versions.
Versions are independently deployed and added to the registry. From
there the proxy contract's implementation can be upgraded to the new
version.
Currently no access control is implemented.
2018-03-14 19:12:03 +01:00

46 lines
1.7 KiB
Solidity

pragma solidity ^0.4.18;
/**
* @title IRegistry
* @dev This contract represents the interface of a registry contract
*/
interface IRegistry {
/**
* @dev This event will be emitted every time a new proxy is created
* @param name of the contract, as specified in the registry
* @param proxy representing the address of the proxy created
*/
event ProxyCreated(bytes32 name, address proxy);
/**
* @dev This event will be emitted every time a new implementation is registered
* @param name of the contract, as specified in the registry
* @param version representing the version name of the registered implementation
* @param implementation representing the address of the registered implementation
*/
event VersionAdded(bytes32 name, uint version, address implementation);
/**
* @dev Registers a new version with its implementation address
* @param name of the contract, as specified in the registry
* @param implementation representing the address of the new implementation to be registered
*/
function addVersion(bytes32 name, address implementation) public;
/**
* @dev Tells the address of the implementation for a given version
* @param name of the contract, as specified in the registry
* @param version to query the implementation of
* @return address of the implementation registered for the given version
*/
function getVersion(bytes32 name, uint version) public view returns (address);
/**
* @dev Tells the latest address of the implementation
* @param name of the contract, as specified in the registry
* @return address of the implementation registered for the latest version
*/
function getLatestVersion(bytes32 name) public view returns (address);
}