diff --git a/packages/nouns-contracts/contracts/governance/ExcessETHBurner.sol b/packages/nouns-contracts/contracts/governance/ExcessETHBurner.sol index d503179262..7e4471127a 100644 --- a/packages/nouns-contracts/contracts/governance/ExcessETHBurner.sol +++ b/packages/nouns-contracts/contracts/governance/ExcessETHBurner.sol @@ -173,13 +173,13 @@ contract ExcessETHBurner is IExcessETHBurner, Ownable { */ function meanAuctionPrice() public view returns (uint256) { uint16 numberOfPastAuctionsForMeanPrice_ = numberOfPastAuctionsForMeanPrice; - INounsAuctionHouseV2.Settlement[] memory settlements = auction.prices(numberOfPastAuctionsForMeanPrice_); + uint256[] memory prices = auction.getPrices(numberOfPastAuctionsForMeanPrice_); - if (settlements.length < numberOfPastAuctionsForMeanPrice_) revert NotEnoughAuctionHistory(); + if (prices.length < numberOfPastAuctionsForMeanPrice_) revert NotEnoughAuctionHistory(); uint256 sum = 0; for (uint16 i = 0; i < numberOfPastAuctionsForMeanPrice_; i++) { - sum += settlements[i].amount; + sum += prices[i]; } return sum / numberOfPastAuctionsForMeanPrice_; diff --git a/packages/nouns-contracts/test/foundry/governance/ExcessETHBurner.t.sol b/packages/nouns-contracts/test/foundry/governance/ExcessETHBurner.t.sol index 6ca05600ca..7f7258852a 100644 --- a/packages/nouns-contracts/test/foundry/governance/ExcessETHBurner.t.sol +++ b/packages/nouns-contracts/test/foundry/governance/ExcessETHBurner.t.sol @@ -33,11 +33,8 @@ contract AuctionMock is INounsAuctionHouseV2 { pricesHistory = pricesHistory_; } - function prices(uint256) external view override returns (INounsAuctionHouseV2.Settlement[] memory priceHistory_) { - priceHistory_ = new INounsAuctionHouseV2.Settlement[](pricesHistory.length); - for (uint256 i; i < pricesHistory.length; ++i) { - priceHistory_[i].amount = pricesHistory[i]; - } + function getPrices(uint256) external view override returns (uint256[] memory) { + return pricesHistory; } function auction() external view returns (INounsAuctionHouseV2.AuctionV2 memory) { @@ -60,6 +57,12 @@ contract AuctionMock is INounsAuctionHouseV2 { function setMinBidIncrementPercentage(uint8 minBidIncrementPercentage) external {} + function getSettlements(uint256 auctionCount) external view returns (Settlement[] memory settlements) {} + + function getSettlements(uint256 startId, uint256 endId) external view returns (Settlement[] memory settlements) {} + + function getPrices(uint256 startId, uint256 endId) external view returns (uint256[] memory prices) {} + function warmUpSettlementState(uint256[] calldata nounIds) external {} }