Skip to content

Invalid enforced condition in updateListing extension #6622

@dirtycajunrice

Description

@dirtycajunrice

Update listing requires that either the start timestamp has not passed, or the start timestamp is unchanged and the end timestamp is after now.

https://github.com/thirdweb-dev/contracts/blob/e85528ed640eb6f5ed77e55195c1d138ab4e4cb5/contracts/prebuilts/marketplace/direct-listings/DirectListingsLogic.sol#L152-L156

        require(startTime < endTime, "Marketplace: endTimestamp not greater than startTimestamp.");
        require(
            listing.startTimestamp > block.timestamp ||
                (startTime == listing.startTimestamp && endTime > block.timestamp),
            "Marketplace: listing already active."
        );

However, the logic used in createListing was also copied into updateListing with no way to override it:

if (startTimestamp <= lastestBlock.timestamp) {
// set the start time to the next block if it is in the past
startTimestamp = lastestBlock.timestamp + 1n;
}

Can either the enforcement be removed or an override be added?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions