AddressResolver
Description
This contract is a type of Service Locator pattern that allows for easier interaction between multiple contracts. Instead of contract A needing references to contracts B and C (and updating every release), contract A can refer to an AddressResolver and query for B and C at transaction time. Then, during a release, the AddressResolver is updated with the latest B and C contract. Thus this ensures that contract A always has the latest B and C contracts.
Source: contracts/AddressResolver.sol
Variables
repository
repositoryThe mapping of contract name to address
Type: mapping(bytes32 => address)
Constructor
constructor
constructorSignature
constructor(address _owner)
Visibility
public
State Mutability
Views
areAddressesImported
areAddressesImportedSignature
areAddressesImported(bytes32[] names, address[] destinations) view returns (bool)
Visibility
external
State Mutability
view
getAddress
getAddressReturns a single address by it's bytes32 key.Details
getPynth
getPynthReturns Issuer address
Signature
getSynth(bytes32 key) view returns (address)
Visibility
external
State Mutability
view
Requires
require(..., "Cannot find Issuer address")
requireAndGetAddress
requireAndGetAddressSignature
requireAndGetAddress(bytes32 name, string reason) view returns (address)
Visibility
external
State Mutability
view
Requires
Restricted Functions
importAddresses
importAddressesImport one or more addresses into the system for the given keys. Note: this function will overwrite any previous entries with the same key names, allowing for inline updates.
Signature
importAddresses(bytes32[] names, address[] destinations)
Visibility
external
State Mutability
Requires
Modifiers
onlyOwner
External Functions
rebuildCaches
rebuildCachesSignature
rebuildCaches(contract MixinResolver[] destinations)
Visibility
external
State Mutability
Events
AddressImported
AddressImportedSignature: AddressImported(bytes32 name, address destination)
Last updated