FlareContractRegistry
#
Source | Inherits from IFlareContractRegistry, AddressUpdatable
The Flare contract registry.
Entry point for all external dapps that need the latest contract addresses deployed by Flare.
Functions#
constructor
#
constructor(
address _addressUpdater
) public;
getAddressUpdater
#
function getAddressUpdater(
) public view returns (
address _addressUpdater);
Returns the configured address updater.
Returns | Type | Description |
---|---|---|
_addressUpdater |
address |
The AddresUpdater contract that can update our contract address list, as a response to a governance call. |
getAllContracts
#
function getAllContracts(
) external view returns (
string[] _names,
address[] _addresses);
Returns all contract names and their corresponding addresses.
Returns | Type | Description |
---|---|---|
_names |
string[] |
Array of contract names. |
_addresses |
address[] |
Array of corresponding contract addresses. |
getContractAddressByHash
#
function getContractAddressByHash(
bytes32 _nameHash
) external view returns (
address);
Returns the address of a given contract hash.
Parameters | Type | Description |
---|---|---|
_nameHash |
bytes32 |
Hash of the contract name as: keccak256(abi.encode(name)) . |
Returns | Type | Description |
---|---|---|
[0] | address |
Address of the contract, or address(0) if not found. |
getContractAddressByName
#
function getContractAddressByName(
string _name
) external view returns (
address);
Returns the address of a given contract name.
Parameters | Type | Description |
---|---|---|
_name |
string |
Name of the contract. |
Returns | Type | Description |
---|---|---|
[0] | address |
Address of the contract, or address(0) if not found. |
getContractAddressesByHash
#
function getContractAddressesByHash(
bytes32[] _nameHashes
) external view returns (
address[]);
Returns the addresses of a list of contract hashes.
Parameters | Type | Description |
---|---|---|
_nameHashes |
bytes32[] |
Array of contract name hashes as: keccak256(abi.encode(name)) . |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Array of addresses of the contracts. Any of them might be address(0) if not found. |
getContractAddressesByName
#
function getContractAddressesByName(
string[] _names
) external view returns (
address[]);
Returns the addresses of a list of contract names.
Parameters | Type | Description |
---|---|---|
_names |
string[] |
Array of contract names. |
Returns | Type | Description |
---|---|---|
[0] | address[] |
Array of addresses of the contracts. Any of them might be address(0) if not found. |
updateContractAddresses
#
function updateContractAddresses(
bytes32[] _contractNameHashes,
address[] _contractAddresses
) external;
External method called from AddressUpdater
only.