Skip to content

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 ever 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 contarct. Thus this ensures that contract A always has the latest B and C contracts.

Source: contracts/AddressResolver.sol

Architecture

Inheritance Graph

graph TD AddressResolver[AddressResolver] --> Owned[Owned]

Variables

repository

Source

The mapping of contract name to address

Type: mapping(bytes32 => address)

Constructor

constructor

Source

Details

Signature

(address _owner)

Visibility

public

State Mutability

nonpayable

Views

getAddress

Source

Returns a single address by it's bytes32 key.

Details

Signature

getAddress(bytes32 name) returns (address)

Visibility

external

State Mutability

view

getSynth

Source

Not yet on mainnet

This view, while in source, is not yet on mainnet. It is planned in the v2.23 Acrux release. As a workaround you can use IAddressResolver.getAddress("Synthetix").synths(key)

Details

Signature

getSynth(bytes32 key) returns (address)

Visibility

external

State Mutability

view

Requires

requireAndGetAddress

Source

Details

Signature

requireAndGetAddress(bytes32 name, string reason) returns (address)

Visibility

external

State Mutability

view

Requires

Restricted Functions

importAddresses

Source

Import one or more addresses into the system for the given keys. Note: this function will overrwite any previous entries with the same key names, allowing for inline updates.

Details

Signature

importAddresses(bytes32[] names, address[] destinations)

Visibility

external

State Mutability

nonpayable

Requires

Modifiers