Skip to main content

AuctionRegistry

Git Source

Inherits: Governance2Step

Title: AuctionRegistry

Registry contract that manages released and endorsed auction factory addresses

Provides on-chain discovery and verification of official auction factories

State Variables

factories

Array of all registered factories

address[] public factories

factoryInfo

Mapping from factory address to its index in the factories array

mapping(address => FactoryInfo) public factoryInfo

versionToFactory

Mapping from version string to factory address

mapping(string => address) public versionToFactory

Functions

constructor

Initialize the registry with known factory addresses

constructor(address _governance, address[] memory _knownFactories, string[] memory _versions)
Governance2Step(_governance);

Parameters

NameTypeDescription
_governanceaddressThe address that will have governance rights
_knownFactoriesaddress[]Array of known factory addresses to register
_versionsstring[]Array of version strings corresponding to the factories

getLatestFactory

Get the latest endorsed auction factory address

function getLatestFactory() external view returns (address factory);

Returns

NameTypeDescription
factoryaddressThe address of the latest endorsed factory

getFactory

Get a factory by its version string

function getFactory(string memory _version) external view returns (address factory);

Parameters

NameTypeDescription
_versionstringThe version string of the factory

Returns

NameTypeDescription
factoryaddressThe address of the factory

getFactoryInfo

Get factory information by address

function getFactoryInfo(address _factory) external view returns (FactoryInfo memory info);

Parameters

NameTypeDescription
_factoryaddressThe address of the factory

Returns

NameTypeDescription
infoFactoryInfoThe factory information struct

getAllFactories

Get all registered factories

function getAllFactories() external view returns (address[] memory);

Returns

NameTypeDescription
<none>address[]All factory information

numberOfFactories

Get the total number of registered factories

function numberOfFactories() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The number of registered factories

isRegisteredFactory

Check if a factory is endorsed

function isRegisteredFactory(address _factory) public view returns (bool);

Parameters

NameTypeDescription
_factoryaddressThe address to check

Returns

NameTypeDescription
<none>boolTrue if the factory is endorsed

registerNewFactory

Release a new factory

function registerNewFactory(address _factory, string memory _version) external onlyGovernance;

Parameters

NameTypeDescription
_factoryaddressThe address of the factory
_versionstringThe version string of the factory

retireFactory

Revoke endorsement from a factory

function retireFactory(address _factory) external onlyGovernance;

Parameters

NameTypeDescription
_factoryaddressThe address of the factory

_registerFactory

Internal function to register a factory

function _registerFactory(address _factory, string memory _version) internal;

Events

FactoryRegistered

event FactoryRegistered(address indexed factory, string version, uint256 index);

FactoryRetired

event FactoryRetired(address indexed factory);

Structs

FactoryInfo

struct FactoryInfo {
string version;
uint256 index;
bool isRetired;
}