Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

feat: add reserve auction to ZN #202

Merged
merged 3 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions addresses/7777777.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"WETH": "0x4200000000000000000000000000000000000006",
"REGISTRAR": "0x12125c8a52B8E4ed1A28e1f964023b4477f11300",
"RoyaltyEngineV1": "0x0000000000000000000000000000000000000000",
"ZoraProtocolFeeSettings": "0x13D48CF16917Bbc91810153d4D4e3284609C3CDc",
"ZoraModuleManager": "0x69E2a5D39ed608Dfb75e29d7a4aa361C889FD25f",
"ERC20TransferHelper": "0x0f92db11b60E7D9d80843588eefDDA17644a9aaa",
"ERC721TransferHelper": "0x89a53404d3e29c6e5431d73e04F44045d37D01FE",
"ReserveAuctionV3": "0xA06262157905913f855573f53AD48DE2D4ba1F4A"
}
10 changes: 10 additions & 0 deletions addresses/999999999.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"WETH": "0x4200000000000000000000000000000000000006",
"REGISTRAR": "0x12125c8a52B8E4ed1A28e1f964023b4477f11300",
"RoyaltyEngineV1": "0x0000000000000000000000000000000000000000",
"ZoraProtocolFeeSettings": "0x824dD1cCd0824A15913B454A7E5D3Bf0C6b2BeEd",
"ZoraModuleManager": "0x2E0c148C1AeD0360Df9a86112fD7C4EAb8045779",
"ERC20TransferHelper": "0x421B6ad0CdD20bE3636F3511B6ae244d8F668dB1",
"ERC721TransferHelper": "0x0ABdD5AA61E9107519DB7cD626442B905284B7eb",
"ReserveAuctionV3": "0x0fbAB7302F9351dD1DB6674cc3bB855f0C55840B"
}
3 changes: 3 additions & 0 deletions contracts/common/FeePayoutSupport/FeePayoutSupportV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ contract FeePayoutSupportV1 is OutgoingTransferSupportV1 {
address _payoutCurrency,
uint256 _gasLimit
) internal returns (uint256, bool) {
// Early return if no royalty engine.
if (address(royaltyEngine) == address(0)) return (_amount, false);

// If no gas limit was provided or provided gas limit greater than gas left, just pass the remaining gas.
uint256 gas = (_gasLimit == 0 || _gasLimit > gasleft()) ? gasleft() : _gasLimit;

Expand Down
47 changes: 47 additions & 0 deletions contracts/modules/ReserveAuction/V3/IReserveAuctionV3.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IReserveAuctionV3 {
/// @notice Creates an auction for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The id of the ERC-721 token
/// @param _duration The length of time the auction should run after the first bid
/// @param _reservePrice The minimum bid amount to start the auction
/// @param _sellerFundsRecipient The address to send funds to once the auction is complete
/// @param _startTime The time that users can begin placing bids
/// @param _bidCurrency The address of the ERC-20 token, or address(0) for ETH, that users must bid with
/// @param _findersFeeBps The fee to send to the referrer of the winning bid
function createAuction(
address _tokenContract,
uint256 _tokenId,
uint256 _duration,
uint256 _reservePrice,
address _sellerFundsRecipient,
uint256 _startTime,
address _bidCurrency,
uint256 _findersFeeBps
) external;

/// @notice Updates the reserve price for a given auction
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The id of the ERC-721 token
/// @param _reservePrice The new reserve price
function setAuctionReservePrice(address _tokenContract, uint256 _tokenId, uint256 _reservePrice) external;

/// @notice Cancels the auction for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The id of the ERC-721 token
function cancelAuction(address _tokenContract, uint256 _tokenId) external;

/// @notice Places a bid on the auction for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The id of the ERC-721 token
/// @param _amount The amount to bid
/// @param _finder The referrer of the bid
function createBid(address _tokenContract, uint256 _tokenId, uint256 _amount, address _finder) external payable;

/// @notice Ends the auction for a given NFT
/// @param _tokenContract The address of the ERC-721 token
/// @param _tokenId The id of the ERC-721 token
function settleAuction(address _tokenContract, uint256 _tokenId) external;
}
Loading
Loading