Contract API
Auction
A Dutch auction of USDG for one asset.
Loading…
Browse documentation
Contract API
A Dutch auction of USDG for one asset.
Loading…
Contract API
A Dutch auction of USDG for one asset.
This reference is generated from the repository contracts. Check the deployed version before using a signature or constant. The audit covers a specific source revision.
Source: src/core/Auction.sol
Artifact: out/Auction.sol/Auction.json
Sells the Auction's complete accumulated USDG balance for a configured ERC-20 payment asset.
Auctions decay to zero over epochDuration, including while empty. A purchase sends payment directly to Fund and BribeRouter, pays the accumulated USDG to the receiver, and starts the next epoch. minimumPrice floors that next starting price, not the purchase price. Accounting assumes standard non-rebasing ERC-20 transfers. Killing the containing Strategy stops its future allocation but leaves this Auction able to sell retained USDG. The auction design is adapted with credit to Euler Fee Flow and Liquid Signal Governance.
Public ABI: 20 functions, 1 event, 11 custom errors, 1 constructor, 0 receive entries, 0 fallback entries.
constructor(address,address,address,address,(uint256,uint256,uint256,uint256))constructor(address resonance_, contract IERC20 usdg_, contract IERC20 paymentToken_, address fund_, struct Auction.Config config);Creates one Auction and starts its zero-based first auction epoch immediately. Dependencies must be deployed contracts. The clock starts immediately, even without USDG, and incoming revenue does not reset it. Auction settings are fixed at deployment.
Parameters
config: Immutable auction configuration expressed in seconds, raw payment units, and fixed-point scale.fund_: Treasury receiving the non-Bribe share of every auction payment.paymentToken_: ERC-20 asset buyers pay to fill this Auction.resonance_: Resonance that releases USDG and provides split and BribeRouter configuration.usdg_: USDG revenue token sold by this Auction.ABSOLUTE_MAXIMUM_PRICE()function ABSOLUTE_MAXIMUM_PRICE() external view returns (uint256 arg0);Absolute upper bound for a starting or minimum price, in raw payment-token units.
ABSOLUTE_MINIMUM_PRICE()function ABSOLUTE_MINIMUM_PRICE() external view returns (uint256 arg0);Absolute lower bound for minimumPrice, in raw payment-token units regardless of token decimals.
BPS()function BPS() external view returns (uint256 arg0);Basis-point denominator used to split each purchase payment.
MAX_EPOCH_DURATION()function MAX_EPOCH_DURATION() external view returns (uint256 arg0);Longest permitted price-decay period, in seconds.
MAX_PRICE_MULTIPLIER()function MAX_PRICE_MULTIPLIER() external view returns (uint256 arg0);Largest multiplier for the next starting price, scaled by PRICE_SCALE.
MIN_EPOCH_DURATION()function MIN_EPOCH_DURATION() external view returns (uint256 arg0);Shortest permitted price-decay period, in seconds.
MIN_PRICE_MULTIPLIER()function MIN_PRICE_MULTIPLIER() external view returns (uint256 arg0);Smallest multiplier for the next starting price, scaled by PRICE_SCALE.
PRICE_SCALE()function PRICE_SCALE() external view returns (uint256 arg0);Fixed-point scale representing a 1.0 price multiplier.
buy(address,uint256,uint256,uint256)function buy(address revenueReceiver, uint256 expectedEpochId, uint256 deadline, uint256 maximumPayment) external returns (uint256 paymentAmount);Purchases all released and directly held Auction USDG at the current declining price. Anyone may buy. Captures the Bribe share before token calls and the released USDG balance before payment, keeping payment separate from purchased revenue even when both use USDG. Split rounding favors Fund. A fully decayed nonempty auction sells for zero payment and restarts at minimumPrice; an empty auction cannot be filled. The caller's epoch, deadline, and maximum payment protect the purchase.
Parameters
deadline: Latest valid Unix timestamp; execution exactly at this timestamp is allowed.expectedEpochId: Active epoch expected by the buyer, protecting against a prior fill.maximumPayment: Maximum raw payment-token units authorized by the buyer.revenueReceiver: Address that receives the complete snapshotted USDG balance; need not equal the buyer.Returns
paymentAmount: Actual raw payment-token units required at execution, possibly zero.currentPrice()function currentPrice() external view returns (uint256 paymentAmount);Returns the payment required to fill the active auction epoch at the current timestamp. Rounds the declining price up to a whole raw token unit. The price reaches zero at epochDuration seconds and stays there until a purchase, regardless of whether the Auction holds USDG.
Returns
paymentAmount: Current price in raw payment-token units.epochDuration()function epochDuration() external view returns (uint256 arg0);Immutable number of seconds over which each epoch's price declines to zero.
epochId()function epochId() external view returns (uint256 arg0);Zero-based identifier of the active auction epoch, incremented after every successful fill.
epochStartedAt()function epochStartedAt() external view returns (uint256 arg0);Unix timestamp at which the active epoch began.
fund()function fund() external view returns (address arg0);Immutable treasury that receives the payment remainder after the floored Bribe share.
initialPrice()function initialPrice() external view returns (uint256 arg0);Starting price of the active epoch, in raw payment-token units.
minimumPrice()function minimumPrice() external view returns (uint256 arg0);Floor for each next epoch's starting price, in raw payment-token units.
paymentToken()function paymentToken() external view returns (contract IERC20 arg0);Immutable ERC-20 asset required from buyers, accounted for in raw token units.
priceMultiplier()function priceMultiplier() external view returns (uint256 arg0);Immutable PRICE_SCALE-scaled multiplier applied to a completed epoch's clearing payment.
resonance()function resonance() external view returns (address arg0);Immutable Resonance that releases USDG and supplies the current Bribe split and paired BribeRouter.
usdg()function usdg() external view returns (contract IERC20 arg0);Immutable USDG revenue token sold by this Auction, accounted for in raw token units.
Purchased(address,address,uint256,uint256,uint256)event Purchased(address indexed buyer, address indexed revenueReceiver, uint256 indexed epochId, uint256 revenueAmount, uint256 paymentAmount);Emitted after a buyer atomically fills one auction epoch and the next epoch begins.
Parameters
buyer: Account that supplied the payment asset or completed a free fill.epochId: Zero-based identifier of the completed auction epoch.paymentAmount: Whole raw payment-token units paid, possibly zero after full decay.revenueAmount: Whole raw USDG units purchased.revenueReceiver: Address that received the complete snapshotted USDG balance.DeadlinePassed(uint256)error DeadlinePassed(uint256 deadline);No additional NatSpec notice is present in the compiled artifact.
EmptyRevenue()error EmptyRevenue();No additional NatSpec notice is present in the compiled artifact.
EpochDurationOutOfRange(uint256)error EpochDurationOutOfRange(uint256 duration);No additional NatSpec notice is present in the compiled artifact.
EpochIdMismatch(uint256,uint256)error EpochIdMismatch(uint256 expected, uint256 actual);No additional NatSpec notice is present in the compiled artifact.
InitialPriceOutOfRange(uint256)error InitialPriceOutOfRange(uint256 price);No additional NatSpec notice is present in the compiled artifact.
MaximumPaymentExceeded(uint256,uint256)error MaximumPaymentExceeded(uint256 payment, uint256 maximum);No additional NatSpec notice is present in the compiled artifact.
MinimumPriceOutOfRange(uint256)error MinimumPriceOutOfRange(uint256 price);No additional NatSpec notice is present in the compiled artifact.
PriceMultiplierOutOfRange(uint256)error PriceMultiplierOutOfRange(uint256 multiplier);No additional NatSpec notice is present in the compiled artifact.
ReentrancyGuardReentrantCall()error ReentrancyGuardReentrantCall();No additional NatSpec notice is present in the compiled artifact.
SafeERC20FailedOperation(address)error SafeERC20FailedOperation(address token);No additional NatSpec notice is present in the compiled artifact.
ZeroAddress()error ZeroAddress();No additional NatSpec notice is present in the compiled artifact.