ICommonSurplusAuctionHouse
Functions
AUCTION_HOUSE_TYPE
Type of the auction house
function AUCTION_HOUSE_TYPE() external view returns (bytes32 _auctionHouseType);
Returns
Name | Type | Description |
---|---|---|
_auctionHouseType | bytes32 | Bytes32 representation of the auction house type |
auctions
Data of an auction
function auctions(uint256 _id) external view returns (Auction memory _auction);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
Returns
Name | Type | Description |
---|---|---|
_auction | Auction | Auction data struct |
_auctions
Raw data of an auction
function _auctions(uint256 _id)
external
view
returns (uint256 _bidAmount, uint256 _amountToSell, address _highBidder, uint256 _bidExpiry, uint256 _auctionDeadline);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
Returns
Name | Type | Description |
---|---|---|
_bidAmount | uint256 | How many system coins are offered for the protocol tokens [rad] |
_amountToSell | uint256 | How protocol tokens are sold to buy the surplus system coins [wad] |
_highBidder | address | Who the high bidder is |
_bidExpiry | uint256 | When the latest bid expires and the auction can be settled [timestamp] |
_auctionDeadline | uint256 | Hard deadline for the auction after which no more bids can be placed [timestamp] |
auctionsStarted
Total amount of surplus auctions created
function auctionsStarted() external view returns (uint256 _auctionsStarted);
safeEngine
Address of the SAFEEngine contract
function safeEngine() external view returns (ISAFEEngine _safeEngine);
protocolToken
Address of the ProtocolToken contract
function protocolToken() external view returns (IProtocolToken _protocolToken);
startAuction
Start a new surplus auction
function startAuction(uint256 _amountToSell, uint256 _initialBid) external returns (uint256 _id);
Parameters
Name | Type | Description |
---|---|---|
_amountToSell | uint256 | Total amount of system coins to sell [rad] |
_initialBid | uint256 | Initial protocol token bid [wad] |
Returns
Name | Type | Description |
---|---|---|
_id | uint256 | ID of the started auction |
restartAuction
Restart an auction if no bids were submitted for it
function restartAuction(uint256 _id) external;
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | ID of the auction to restart |
increaseBidSize
Submit a higher protocol token bid for the same amount of system coins
function increaseBidSize(uint256 _id, uint256 _bid) external;
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | ID of the auction you want to submit the bid for |
_bid | uint256 | New bid submitted [wad] |
settleAuction
Settle/finish an auction
function settleAuction(uint256 _id) external;
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | ID of the auction to settle |
Events
StartAuction
Emitted when a new auction is started
event StartAuction(
uint256 indexed _id,
address indexed _auctioneer,
uint256 _blockTimestamp,
uint256 _amountToSell,
uint256 _amountToRaise,
uint256 _auctionDeadline
);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
_auctioneer | address | Address who started the auction |
_blockTimestamp | uint256 | Time when the auction was started |
_amountToSell | uint256 | How many protocol tokens are initially bidded [wad] |
_amountToRaise | uint256 | Amount of system coins to raise [rad] |
_auctionDeadline | uint256 | Time when the auction expires |
RestartAuction
Emitted when an auction is restarted
event RestartAuction(uint256 indexed _id, uint256 _blockTimestamp, uint256 _auctionDeadline);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
_blockTimestamp | uint256 | Time when the auction was restarted |
_auctionDeadline | uint256 | New time when the auction expires |
IncreaseBidSize
Emitted when a bid is made in an auction
event IncreaseBidSize(
uint256 indexed _id,
address _bidder,
uint256 _blockTimestamp,
uint256 _raisedAmount,
uint256 _soldAmount,
uint256 _bidExpiry
);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
_bidder | address | Who made the bid |
_blockTimestamp | uint256 | Time when the bid was made |
_raisedAmount | uint256 | Amount of system coins raised in the bid [rad] |
_soldAmount | uint256 | Amount of protocol tokens offered to buy in the bid [wad] |
_bidExpiry | uint256 | Time when the bid expires |
SettleAuction
Emitted when an auction is settled
event SettleAuction(uint256 indexed _id, uint256 _blockTimestamp, address _highBidder, uint256 _raisedAmount);
Parameters
Name | Type | Description |
---|---|---|
_id | uint256 | Id of the auction |
_blockTimestamp | uint256 | Time when the auction was settled |
_highBidder | address | Who won the auction |
_raisedAmount | uint256 | Amount of system coins raised in the auction [rad] |
Errors
SAH_AuctionNeverStarted
Throws when trying to bid in an auction that hasn't started yet
error SAH_AuctionNeverStarted();
SAH_AuctionNotFinished
Throws when trying to settle an auction that hasn't finished yet
error SAH_AuctionNotFinished();
SAH_AuctionAlreadyExpired
Throws when trying to bid in an auction that has already expired
error SAH_AuctionAlreadyExpired();
SAH_BidAlreadyExpired
Throws when trying to bid in an auction that has an expired bid
error SAH_BidAlreadyExpired();
SAH_BidAlreadyPlaced
Throws when trying to restart an auction that has an active bid
error SAH_BidAlreadyPlaced();
SAH_AmountsNotMatching
Throws when trying to place a bid that differs from the amount to raise
error SAH_AmountsNotMatching();
SAH_BidNotHigher
Throws when trying to place a bid that is not higher than the previous one
error SAH_BidNotHigher();
SAH_InsufficientIncrease
Throws when trying to place a bid that is not higher than the previous one by the minimum increase
error SAH_InsufficientIncrease();
SAH_HighBidderNotSet
Throws when trying to prematurely terminate an auction that has no bids
error SAH_HighBidderNotSet();
Structs
Auction
struct Auction {
uint256 bidAmount;
uint256 amountToSell;
address highBidder;
uint256 bidExpiry;
uint256 auctionDeadline;
}