Ir ao conteúdo principal

StrategyDutchAuction

Strategy to launch a Dutch Auction for a token where the price decreases linearly until a specified timestamp and end price defined by the seller.

Methods

PROTOCOL_FEE

function PROTOCOL_FEE() external view returns (uint256)

Returns

NameTypeDescription
PROTOCOL_FEEuint256protocol fee (e.g., 200 = 2%)

canExecuteTakerAsk

function canExecuteTakerAsk(OrderTypes.TakerOrder, OrderTypes.MakerOrder) external pure returns (bool, uint256, uint256)

Check whether a taker ask order can be executed against a maker bid

It cannot execute but it is left for compatibility purposes with the interface.

Parameters

NameTypeDescription
-OrderTypes.TakerOrder-
-OrderTypes.MakerOrder-

Returns

NameTypeDescription
isValidboolwhether strategy can be executed, tokenId to execute, amount of tokens to execute
priceuint256price of the transaction
amountuint256amount of tokens to transfer

canExecuteTakerBid

function canExecuteTakerBid(OrderTypes.TakerOrder takerBid, OrderTypes.MakerOrder makerAsk) external view returns (bool, uint256, uint256)

Check whether a taker bid order can be executed against a maker ask

Parameters

NameTypeDescription
takerBidOrderTypes.TakerOrdertaker bid order
makerAskOrderTypes.MakerOrdermaker ask order

Returns

NameTypeDescription
isValidboolwhether strategy can be executed, tokenId to execute, amount of tokens to execute
priceuint256price of the transaction
amountuint256amount of tokens to transfer

minimumAuctionLengthInSeconds

function minimumAuctionLengthInSeconds() external view returns (uint256)

Returns

NameTypeDescription
minimumAuctionLengthInSecondsuint256minimum auction length in seconds

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
owneraddressaddress of the current owner

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressaddress of the new owner

updateMinimumAuctionLength

function updateMinimumAuctionLength(uint256 _minimumAuctionLengthInSeconds) external nonpayable

Update minimum auction length (in seconds)

It protects against auctions that would be too short to be executed (e.g., 15 seconds)

Parameters

NameTypeDescription
_minimumAuctionLengthInSecondsuint256minimum auction length in seconds

viewProtocolFee

function viewProtocolFee() external view returns (uint256)

Return protocol fee for this strategy

Returns

NameTypeDescription
protocolFeeuint256protocol fee

Events

NewMinimumAuctionLengthInSeconds

event NewMinimumAuctionLengthInSeconds(uint256 minimumAuctionLengthInSeconds)

Parameters

NameTypeDescription
minimumAuctionLengthInSecondsuint256minimum auction length in seconds

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressaddress of the previous owner
newOwner indexedaddressaddress of the new owner