Skip to content

AddressUpdater#

Source | Inherits from IIAddressUpdater, Governed

Keeps track of the current address for all unique and special platform contracts.

This contract keeps a list of addresses that gets updated by governance every time any of the tracked contracts is redeployed. This list is then used by the FlareContractRegistry, and also by AddressUpdatable to inform all dependent contracts of any address change.

Functions#

addOrUpdateContractNamesAndAddresses#

Defined in AddressUpdater (Docs, Source).

function addOrUpdateContractNamesAndAddresses(
    string[] _contractNames,
    address[] _contractAddresses
) external;

Add or update contract names and addresses that are later used in updateContractAddresses calls.

Can only be called by governance.

Parameters Type Description
_contractNames string[] Contracts names.
_contractAddresses address[] Addresses of corresponding contracts names.

cancelGovernanceCall#

Defined in GovernedBase (Docs, Source).

function cancelGovernanceCall(
    bytes4 _selector
) external;

Cancel a timelocked governance call before it has been executed.

Only governance can call this method.

Parameters Type Description
_selector bytes4 The method selector.

constructor#

Defined in AddressUpdater (Docs, Source).

constructor(
    address _governance
) public;

constructor#

Defined in Governed (Docs, Source).

constructor(
    address _governance
) public;
Parameters Type Description
_governance address Governance contract. Must not be zero.

executeGovernanceCall#

Defined in GovernedBase (Docs, Source).

function executeGovernanceCall(
    bytes4 _selector
) external;

Execute the timelocked governance calls once the timelock period expires.

Only executor can call this method.

Parameters Type Description
_selector bytes4 The method selector (only one timelocked call per method is stored).

getContractAddress#

Defined in AddressUpdater (Docs, Source).

function getContractAddress(
    string _name
) external view returns (
    address);

Returns contract address for the given name, which might be address(0).

Parameters Type Description
_name string Name of the contract to query.
Returns Type Description
[0] address Current address for the queried contract.

getContractAddressByHash#

Defined in AddressUpdater (Docs, Source).

function getContractAddressByHash(
    bytes32 _nameHash
) external view returns (
    address);

Returns contract address for the given name hash, which might be address(0).

Parameters Type Description
_nameHash bytes32 Hash of the contract name: keccak256(abi.encode(name))
Returns Type Description
[0] address Current address for the queried contract.

getContractAddresses#

Defined in AddressUpdater (Docs, Source).

function getContractAddresses(
    string[] _names
) external view returns (
    address[]);

Returns contract addresses for the given names, which might be address(0).

Parameters Type Description
_names string[] Names of the contracts to query.
Returns Type Description
[0] address[] Current addresses for the queried contracts.

getContractAddressesByHash#

Defined in AddressUpdater (Docs, Source).

function getContractAddressesByHash(
    bytes32[] _nameHashes
) external view returns (
    address[]);

Returns contract addresses for the given name hashes, which might be address(0).

Parameters Type Description
_nameHashes bytes32[] Hashes of the contract names: keccak256(abi.encode(name))
Returns Type Description
[0] address[] Current addresses for the queried contracts.

getContractNamesAndAddresses#

Defined in AddressUpdater (Docs, Source).

function getContractNamesAndAddresses(
) external view returns (
    string[] _contractNames,
    address[] _contractAddresses);

Returns all contract names and corresponding addresses currently being tracked.

Returns Type Description
_contractNames string[] Array of contract names.
_contractAddresses address[] Array of contract addresses.

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

removeContracts#

Defined in AddressUpdater (Docs, Source).

function removeContracts(
    string[] _contractNames
) external;

Remove contracts with given names.

Can only be called by governance.

Parameters Type Description
_contractNames string[] Contract names.

switchToProductionMode#

Defined in GovernedBase (Docs, Source).

function switchToProductionMode(
) external;

Enter the production mode after all the initial governance settings have been set. This enables timelocks and the governance can be obtained afterward by calling governanceSettings.getGovernanceAddress(). Emits GovernedProductionModeEntered.

update#

Defined in AddressUpdater (Docs, Source).

function update(
    string[] _contractNames,
    address[] _contractAddresses,
    contract IIAddressUpdatable[] _contractsToUpdate
) external;

Set or update contract names and addresses, and then apply changes to specific contracts.

This is a combination of addOrUpdateContractNamesAndAddresses and updateContractAddresses. Can only be called by governance.

Parameters Type Description
_contractNames string[] Contracts names.
_contractAddresses address[] Addresses of corresponding contracts names.
_contractsToUpdate contract IIAddressUpdatable[] Contracts to be updated.

updateContractAddresses#

Defined in AddressUpdater (Docs, Source).

function updateContractAddresses(
    contract IIAddressUpdatable[] _contractsToUpdate
) external;

Updates contract addresses on specific contracts.

Can only be called by governance.

Parameters Type Description
_contractsToUpdate contract IIAddressUpdatable[] Contracts to be updated, which must implement the IIAddressUpdatable interface.

Variables#

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

When true, governance is enabled and cannot be disabled. See switchToProductionMode.

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.