Skip to main content

AuctionFactory

Git Source

Inherits: ClonableCreate2

Title: AuctionFactory

Deploy a new Auction.

State Variables

DEFAULT_STARTING_PRICE

The amount to start the auction with.

uint256 public constant DEFAULT_STARTING_PRICE = 1_000_000

auctions

Full array of all auctions deployed through this factory.

address[] public auctions

Functions

constructor

constructor() ;

version

function version() external pure returns (string memory);

createNewAuction

Creates a new auction contract.

function createNewAuction(address _want) external returns (address);

Parameters

NameTypeDescription
_wantaddressAddress of the token users will bid with.

Returns

NameTypeDescription
<none>address_newAuction Address of the newly created auction contract.

createNewAuction

Creates a new auction contract.

function createNewAuction(address _want, address _receiver) external returns (address);

Parameters

NameTypeDescription
_wantaddressAddress of the token users will bid with.
_receiveraddressAddress that will receive the funds in the auction.

Returns

NameTypeDescription
<none>address_newAuction Address of the newly created auction contract.

createNewAuction

Creates a new auction contract.

function createNewAuction(address _want, address _receiver, address _governance) external returns (address);

Parameters

NameTypeDescription
_wantaddressAddress of the token users will bid with.
_receiveraddressAddress that will receive the funds in the auction.
_governanceaddressAddress allowed to enable and disable auctions.

Returns

NameTypeDescription
<none>address_newAuction Address of the newly created auction contract.

createNewAuction

Creates a new auction contract.

function createNewAuction(address _want, address _receiver, address _governance, uint256 _startingPrice)
external
returns (address);

Parameters

NameTypeDescription
_wantaddressAddress of the token users will bid with.
_receiveraddressAddress that will receive the funds in the auction.
_governanceaddressAddress allowed to enable and disable auctions.
_startingPriceuint256Starting price for the auction (no decimals). NOTE: The starting price should be without decimals (1k == 1_000).

Returns

NameTypeDescription
<none>address_newAuction Address of the newly created auction contract.

createNewAuction

Creates a new auction contract.

function createNewAuction(
address _want,
address _receiver,
address _governance,
uint256 _startingPrice,
bytes32 _salt
) external returns (address);

Parameters

NameTypeDescription
_wantaddressAddress of the token users will bid with.
_receiveraddressAddress that will receive the funds in the auction.
_governanceaddressAddress allowed to enable and disable auctions.
_startingPriceuint256Starting price for the auction (no decimals).
_saltbytes32The salt to use for deterministic deployment.

Returns

NameTypeDescription
<none>address_newAuction Address of the newly created auction contract.

_createNewAuction

Deploys and initializes a new Auction

function _createNewAuction(
address _want,
address _receiver,
address _governance,
uint256 _startingPrice,
bytes32 _salt
) internal returns (address _newAuction);

getAllAuctions

Get the full list of auctions deployed through this factory.

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

numberOfAuctions

Get the total number of auctions deployed through this factory.

function numberOfAuctions() external view returns (uint256);

Events

DeployedNewAuction

event DeployedNewAuction(address indexed auction, address indexed want);