From 1c8b085a53f0dfa17cbb554dbb534bccfbd7205c Mon Sep 17 00:00:00 2001 From: orionstardust Date: Wed, 20 Mar 2024 23:49:52 -0400 Subject: [PATCH] feat: add but now and start bid price --- abis/abi_gbm.json | 2575 ++++++++++++++++++++------------------------- schema.graphql | 31 + src/helper.ts | 2 + src/mapping.ts | 117 ++ subgraph.yaml | 8 +- 5 files changed, 1308 insertions(+), 1425 deletions(-) diff --git a/abis/abi_gbm.json b/abis/abi_gbm.json index c969e13..06812fc 100644 --- a/abis/abi_gbm.json +++ b/abis/abi_gbm.json @@ -1,1434 +1,1161 @@ [ - { "inputs": [], "name": "EmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "ImmutableFunction", - "type": "error" - }, - { "inputs": [], "name": "InValidFacetCutAction", "type": "error" }, - { "inputs": [], "name": "InitCallFailed", "type": "error" }, - { "inputs": [], "name": "MustBeZeroAddress", "type": "error" }, - { "inputs": [], "name": "NoCode", "type": "error" }, - { "inputs": [], "name": "NoSelectorsInFacet", "type": "error" }, - { "inputs": [], "name": "NoZeroAddress", "type": "error" }, - { "inputs": [], "name": "NonEmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "NonExistentSelector", - "type": "error" - }, - { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SameSelectorReplacement", - "type": "error" - }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SelectorExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "facetAddress", - "type": "address" - }, - { - "internalType": "enum IDiamondCut.FacetCutAction", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bytes4[]", - "name": "functionSelectors", - "type": "bytes4[]" - } - ], - "indexed": false, - "internalType": "struct IDiamondCut.FacetCut[]", - "name": "_diamondCut", - "type": "tuple[]" - }, - { - "indexed": false, - "internalType": "address", - "name": "_init", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "DiamondCut", - "type": "event" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "facetAddress", - "type": "address" - }, - { - "internalType": "enum IDiamondCut.FacetCutAction", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bytes4[]", - "name": "functionSelectors", - "type": "bytes4[]" - } - ], - "internalType": "struct IDiamondCut.FacetCut[]", - "name": "_diamondCut", - "type": "tuple[]" - }, - { "internalType": "address", "name": "_init", "type": "address" }, - { "internalType": "bytes", "name": "_calldata", "type": "bytes" } - ], - "name": "diamondCut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "_functionSelector", - "type": "bytes4" - } - ], - "name": "facetAddress", - "outputs": [ - { - "internalType": "address", - "name": "facetAddress_", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "facetAddresses", - "outputs": [ - { - "internalType": "address[]", - "name": "facetAddresses_", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "_facet", "type": "address" } - ], - "name": "facetFunctionSelectors", - "outputs": [ - { - "internalType": "bytes4[]", - "name": "facetFunctionSelectors_", - "type": "bytes4[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "facets", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "facetAddress", - "type": "address" - }, - { - "internalType": "bytes4[]", - "name": "functionSelectors", - "type": "bytes4[]" - } - ], - "internalType": "struct IDiamondLoupe.Facet[]", - "name": "facets_", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "_interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "AuctionClaimed", "type": "error" }, - { "inputs": [], "name": "AuctionEnded", "type": "error" }, - { "inputs": [], "name": "AuctionExists", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timeToEnd", - "type": "uint256" - } - ], - "name": "AuctionNotEnded", - "type": "error" - }, - { "inputs": [], "name": "AuctionNotStarted", "type": "error" }, - { "inputs": [], "name": "BiddingNotAllowed", "type": "error" }, - { "inputs": [], "name": "CancellationTimeExceeded", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimAvailable", - "type": "uint256" - } - ], - "name": "ClaimNotReady", - "type": "error" - }, - { "inputs": [], "name": "ContractDisabledAlready", "type": "error" }, - { "inputs": [], "name": "ContractEnabledAlready", "type": "error" }, - { "inputs": [], "name": "DurationTooHigh", "type": "error" }, - { "inputs": [], "name": "DurationTooLow", "type": "error" }, - { "inputs": [], "name": "EndTimeTooLow", "type": "error" }, - { "inputs": [], "name": "InsufficientToken", "type": "error" }, - { - "inputs": [ - { "internalType": "string", "name": "arg", "type": "string" } - ], - "name": "InvalidAuctionParams", - "type": "error" - }, - { "inputs": [], "name": "MinBidNotMet", "type": "error" }, - { "inputs": [], "name": "ModifyAuctionError", "type": "error" }, - { "inputs": [], "name": "NoAuction", "type": "error" }, - { "inputs": [], "name": "NoSecondaryMarket", "type": "error" }, - { "inputs": [], "name": "NoZeroBidAmount", "type": "error" }, - { "inputs": [], "name": "NotAuctionOwner", "type": "error" }, - { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, - { "inputs": [], "name": "NotHighestBidderOrOwner", "type": "error" }, - { "inputs": [], "name": "NotTokenOwner", "type": "error" }, - { "inputs": [], "name": "OwnerBid", "type": "error" }, - { "inputs": [], "name": "StartOrEndTimeTooLow", "type": "error" }, - { "inputs": [], "name": "TokenTypeMismatch", "type": "error" }, - { "inputs": [], "name": "UndefinedPreset", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "currentHighestBid", - "type": "uint256" - } - ], - "name": "UnmatchedHighestBid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "AuctionCancelled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "_bidder", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_bidAmount", - "type": "uint256" - } - ], - "name": "Auction_BidPlaced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "_bidder", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_bidAmount", - "type": "uint256" - } - ], - "name": "Auction_BidRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_endTime", - "type": "uint256" - } - ], - "name": "Auction_EndTimeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "_earner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_incentiveAmount", - "type": "uint256" - } - ], - "name": "Auction_IncentivePaid", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "_tokenID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "_tokenAmount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "_contractAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes4", - "name": "_tokenKind", - "type": "bytes4" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_presetID", - "type": "uint256" - } - ], - "name": "Auction_Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "Auction_ItemClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint64", - "name": "_newTokenAmount", - "type": "uint64" - }, - { - "indexed": true, + { "inputs": [], "name": "EmptyCalldata", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "ImmutableFunction", + "type": "error" + }, + { "inputs": [], "name": "InValidFacetCutAction", "type": "error" }, + { "inputs": [], "name": "InitCallFailed", "type": "error" }, + { "inputs": [], "name": "MustBeZeroAddress", "type": "error" }, + { "inputs": [], "name": "NoCode", "type": "error" }, + { "inputs": [], "name": "NoSelectorsInFacet", "type": "error" }, + { "inputs": [], "name": "NoZeroAddress", "type": "error" }, + { "inputs": [], "name": "NonEmptyCalldata", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "NonExistentSelector", + "type": "error" + }, + { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "SameSelectorReplacement", + "type": "error" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "SelectorExists", + "type": "error" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { "internalType": "address", "name": "_init", "type": "address" }, + { "internalType": "bytes", "name": "_calldata", "type": "bytes" } + ], + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } + ], + "name": "facetAddress", + "outputs": [ + { "internalType": "address", "name": "facetAddress_", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facetAddresses", + "outputs": [ + { + "internalType": "address[]", + "name": "facetAddresses_", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_facet", "type": "address" } + ], + "name": "facetFunctionSelectors", + "outputs": [ + { + "internalType": "bytes4[]", + "name": "facetFunctionSelectors_", + "type": "bytes4[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "facets", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "internalType": "struct IDiamondLoupe.Facet[]", + "name": "facets_", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "_interfaceId", "type": "bytes4" } + ], + "name": "supportsInterface", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "AuctionCancelled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_bidder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_bidAmount", + "type": "uint256" + } + ], + "name": "Auction_BidPlaced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_bidder", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_bidAmount", + "type": "uint256" + } + ], + "name": "Auction_BidRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_buyer", + "type": "address" + } + ], + "name": "Auction_BoughtNow", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_buyItNowPrice", + "type": "uint256" + } + ], + "name": "Auction_BuyItNowUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + } + ], + "name": "Auction_EndTimeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_earner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_incentiveAmount", + "type": "uint256" + } + ], + "name": "Auction_IncentivePaid", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_tokenID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint256", + "name": "_tokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "_contractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes4", + "name": "_tokenKind", + "type": "bytes4" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_presetID", + "type": "uint256" + } + ], + "name": "Auction_Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + } + ], + "name": "Auction_ItemClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "_newTokenAmount", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "uint80", + "name": "_newEndTime", + "type": "uint80" + } + ], + "name": "Auction_Modified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionID", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + } + ], + "name": "Auction_StartTimeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_startPrice", + "type": "uint256" + } + ], + "name": "Auction_StartingPriceUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_contract", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_biddingAllowed", + "type": "bool" + } + ], + "name": "Contract_BiddingAllowed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "_auctionId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "_tokenContractAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "_beneficiary", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "RoyaltyPaid", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_auctionIDs", + "type": "uint256[]" + } + ], + "name": "batchClaim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "uint80", "name": "startTime", "type": "uint80" }, + { "internalType": "uint80", "name": "endTime", "type": "uint80" }, + { "internalType": "uint56", "name": "tokenAmount", "type": "uint56" }, + { "internalType": "uint8", "name": "category", "type": "uint8" }, + { "internalType": "bytes4", "name": "tokenKind", "type": "bytes4" }, + { "internalType": "uint256", "name": "tokenID", "type": "uint256" }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { "internalType": "uint96", "name": "startingBid", "type": "uint96" } + ], + "internalType": "struct InitiatorInfo[]", + "name": "_info", + "type": "tuple[]" + }, + { + "internalType": "address[]", + "name": "_tokenContracts", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "_auctionPresetIDs", + "type": "uint256[]" + } + ], + "name": "batchCreateAuctions", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "buyNow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "cancelAuction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "claim", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" }, + { "internalType": "uint256", "name": "_bidAmount", "type": "uint256" }, + { "internalType": "uint256", "name": "_highestBid", "type": "uint256" }, + { + "internalType": "address", + "name": "_tokenContract", + "type": "address" + }, + { "internalType": "uint256", "name": "_tokenID", "type": "uint256" }, + { "internalType": "uint256", "name": "_amount", "type": "uint256" }, + { "internalType": "bytes", "name": "_signature", "type": "bytes" } + ], + "name": "commitBid", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { "internalType": "uint80", "name": "startTime", "type": "uint80" }, + { "internalType": "uint80", "name": "endTime", "type": "uint80" }, + { "internalType": "uint56", "name": "tokenAmount", "type": "uint56" }, + { "internalType": "uint8", "name": "category", "type": "uint8" }, + { "internalType": "bytes4", "name": "tokenKind", "type": "bytes4" }, + { "internalType": "uint256", "name": "tokenID", "type": "uint256" }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { "internalType": "uint96", "name": "startingBid", "type": "uint96" } + ], + "internalType": "struct InitiatorInfo", + "name": "_info", + "type": "tuple" + }, + { + "internalType": "address", + "name": "_tokenContract", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_auctionPresetID", + "type": "uint256" + } + ], + "name": "createAuction", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionBidDecimals", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionBidMultiplier", + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionDebt", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionDueIncentives", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionEndTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuctionHammerTimeDuration", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionHighestBid", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionHighestBidder", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionIncMax", + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionIncMin", + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionInfo", + "outputs": [ + { + "components": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "uint96", "name": "highestBid", "type": "uint96" }, + { + "internalType": "address", + "name": "highestBidder", + "type": "address" + }, + { "internalType": "uint88", "name": "auctionDebt", "type": "uint88" }, + { + "internalType": "uint88", + "name": "dueIncentives", + "type": "uint88" + }, + { "internalType": "bool", "name": "biddingAllowed", "type": "bool" }, + { "internalType": "bool", "name": "claimed", "type": "bool" }, + { + "internalType": "address", + "name": "tokenContract", + "type": "address" + }, + { + "components": [ + { "internalType": "uint80", - "name": "_newEndTime", + "name": "startTime", "type": "uint80" - } - ], - "name": "Auction_Modified", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_startTime", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_endTime", - "type": "uint256" - } - ], - "name": "Auction_StartTimeUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "_contract", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "_biddingAllowed", - "type": "bool" - } - ], - "name": "Contract_BiddingAllowed", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "_auctionIDs", - "type": "uint256[]" - } - ], - "name": "batchClaim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "cancelAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "claim", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_bidAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_highestBid", - "type": "uint256" - }, - { - "internalType": "address", - "name": "_tokenContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_tokenID", - "type": "uint256" - }, - { "internalType": "uint256", "name": "_amount", "type": "uint256" }, - { "internalType": "bytes", "name": "_signature", "type": "bytes" } - ], - "name": "commitBid", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint80", - "name": "startTime", - "type": "uint80" - }, - { - "internalType": "uint80", - "name": "endTime", - "type": "uint80" - }, - { - "internalType": "uint56", - "name": "tokenAmount", - "type": "uint56" - }, - { - "internalType": "uint8", - "name": "category", - "type": "uint8" - }, - { - "internalType": "bytes4", - "name": "tokenKind", - "type": "bytes4" - }, - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], - "internalType": "struct InitiatorInfo", - "name": "_info", - "type": "tuple" - }, - { - "internalType": "address", - "name": "_tokenContract", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_auctionPresetID", - "type": "uint256" - } - ], - "name": "createAuction", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionBidDecimals", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionBidMultiplier", - "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionDebt", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionDueIncentives", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionEndTime", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAuctionHammerTimeDuration", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionHighestBid", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionHighestBidder", - "outputs": [ - { "internalType": "address", "name": "", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionIncMax", - "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionIncMin", - "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionInfo", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint96", - "name": "highestBid", - "type": "uint96" - }, - { - "internalType": "address", - "name": "highestBidder", - "type": "address" - }, - { - "internalType": "uint88", - "name": "auctionDebt", - "type": "uint88" - }, - { - "internalType": "uint88", - "name": "dueIncentives", - "type": "uint88" - }, - { - "internalType": "bool", - "name": "biddingAllowed", - "type": "bool" - }, - { - "internalType": "bool", - "name": "claimed", - "type": "bool" - }, - { - "internalType": "address", - "name": "tokenContract", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint80", - "name": "startTime", - "type": "uint80" - }, - { - "internalType": "uint80", - "name": "endTime", - "type": "uint80" - }, - { - "internalType": "uint56", - "name": "tokenAmount", - "type": "uint56" - }, - { - "internalType": "uint8", - "name": "category", - "type": "uint8" - }, - { - "internalType": "bytes4", - "name": "tokenKind", - "type": "bytes4" - }, - { - "internalType": "uint256", - "name": "tokenID", - "type": "uint256" - } - ], - "internalType": "struct InitiatorInfo", - "name": "info", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "incMin", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "incMax", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "bidMultiplier", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "stepMin", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "bidDecimals", - "type": "uint256" - } - ], - "internalType": "struct Preset", - "name": "presets", - "type": "tuple" - } - ], - "internalType": "struct Auction", - "name": "auctionInfo_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionPresetID", - "type": "uint256" - } - ], - "name": "getAuctionPresets", - "outputs": [ - { - "components": [ - { - "internalType": "uint64", - "name": "incMin", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "incMax", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "bidMultiplier", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "stepMin", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "bidDecimals", - "type": "uint256" - } - ], - "internalType": "struct Preset", - "name": "presets_", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionStartTime", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getAuctionStepMin", - "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getContractAddress", - "outputs": [ - { "internalType": "address", "name": "", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getTokenId", - "outputs": [ - { "internalType": "uint256", "name": "", "type": "uint256" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - } - ], - "name": "getTokenKind", - "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_contract", - "type": "address" - } - ], - "name": "isBiddingAllowed", - "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionID", - "type": "uint256" - }, - { - "internalType": "uint80", - "name": "_newEndTime", - "type": "uint80" - }, - { + }, + { "internalType": "uint80", "name": "endTime", "type": "uint80" }, + { "internalType": "uint56", - "name": "_newTokenAmount", + "name": "tokenAmount", "type": "uint56" - }, - { "internalType": "bytes4", "name": "_tokenKind", "type": "bytes4" } - ], - "name": "modifyAuction", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, - { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, - { "internalType": "bytes", "name": "", "type": "bytes" } - ], - "name": "onERC1155BatchReceived", - "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "bytes", "name": "", "type": "bytes" } - ], - "name": "onERC1155Received", - "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "uint256", "name": "", "type": "uint256" }, - { "internalType": "bytes", "name": "", "type": "bytes" } - ], - "name": "onERC721Received", - "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_auctionPresetID", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint64", - "name": "incMin", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "incMax", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "bidMultiplier", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "stepMin", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "bidDecimals", - "type": "uint256" - } - ], - "internalType": "struct Preset", - "name": "_preset", - "type": "tuple" - } - ], - "name": "setAuctionPresets", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_contract", - "type": "address" - }, - { "internalType": "bool", "name": "_value", "type": "bool" } - ], - "name": "setBiddingAllowed", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_tokenContract", - "type": "address" - }, - { "internalType": "bool", "name": "_allowed", "type": "bool" } - ], - "name": "toggleContractWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { "internalType": "address", "name": "owner_", "type": "address" } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { "inputs": [], "name": "EmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "ImmutableFunction", - "type": "error" - }, - { "inputs": [], "name": "InValidFacetCutAction", "type": "error" }, - { "inputs": [], "name": "InitCallFailed", "type": "error" }, - { "inputs": [], "name": "MustBeZeroAddress", "type": "error" }, - { "inputs": [], "name": "NoCode", "type": "error" }, - { "inputs": [], "name": "NoSelectorsInFacet", "type": "error" }, - { "inputs": [], "name": "NoZeroAddress", "type": "error" }, - { "inputs": [], "name": "NonEmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "NonExistentSelector", - "type": "error" - }, - { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SameSelectorReplacement", - "type": "error" - }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SelectorExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "facetAddress", - "type": "address" - }, - { - "internalType": "enum IDiamondCut.FacetCutAction", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bytes4[]", - "name": "functionSelectors", - "type": "bytes4[]" - } - ], - "indexed": false, - "internalType": "struct IDiamondCut.FacetCut[]", - "name": "_diamondCut", - "type": "tuple[]" - }, - { - "indexed": false, - "internalType": "address", - "name": "_init", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "DiamondCut", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { "inputs": [], "name": "EmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "ImmutableFunction", - "type": "error" - }, - { "inputs": [], "name": "InValidFacetCutAction", "type": "error" }, - { "inputs": [], "name": "InitCallFailed", "type": "error" }, - { "inputs": [], "name": "MustBeZeroAddress", "type": "error" }, - { "inputs": [], "name": "NoCode", "type": "error" }, - { "inputs": [], "name": "NoSelectorsInFacet", "type": "error" }, - { "inputs": [], "name": "NoZeroAddress", "type": "error" }, - { "inputs": [], "name": "NonEmptyCalldata", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "NonExistentSelector", - "type": "error" - }, - { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SameSelectorReplacement", - "type": "error" - }, - { - "inputs": [ - { "internalType": "bytes4", "name": "selector", "type": "bytes4" } - ], - "name": "SelectorExists", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "facetAddress", - "type": "address" - }, - { - "internalType": "enum IDiamondCut.FacetCutAction", - "name": "action", - "type": "uint8" - }, - { - "internalType": "bytes4[]", - "name": "functionSelectors", - "type": "bytes4[]" - } - ], - "indexed": false, - "internalType": "struct IDiamondCut.FacetCut[]", - "name": "_diamondCut", - "type": "tuple[]" - }, - { - "indexed": false, - "internalType": "address", - "name": "_init", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "_calldata", - "type": "bytes" - } - ], - "name": "DiamondCut", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, + }, + { "internalType": "uint8", "name": "category", "type": "uint8" }, + { + "internalType": "bytes4", + "name": "tokenKind", + "type": "bytes4" + }, + { "internalType": "uint256", - "name": "_auctionId", + "name": "tokenID", "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "_tokenContractAddress", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "_beneficiary", - "type": "address" - }, - { - "indexed": false, + }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "startingBid", + "type": "uint96" + } + ], + "internalType": "struct InitiatorInfo", + "name": "info", + "type": "tuple" + }, + { + "components": [ + { "internalType": "uint64", "name": "incMin", "type": "uint64" }, + { "internalType": "uint64", "name": "incMax", "type": "uint64" }, + { + "internalType": "uint64", + "name": "bidMultiplier", + "type": "uint64" + }, + { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, + { "internalType": "uint256", - "name": "_amount", + "name": "bidDecimals", "type": "uint256" - } - ], - "name": "RoyaltyPaid", - "type": "event" - } + } + ], + "internalType": "struct Preset", + "name": "presets", + "type": "tuple" + }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { "internalType": "uint96", "name": "startingBid", "type": "uint96" } + ], + "internalType": "struct Auction", + "name": "auctionInfo_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_auctionPresetID", + "type": "uint256" + } + ], + "name": "getAuctionPresets", + "outputs": [ + { + "components": [ + { "internalType": "uint64", "name": "incMin", "type": "uint64" }, + { "internalType": "uint64", "name": "incMax", "type": "uint64" }, + { + "internalType": "uint64", + "name": "bidMultiplier", + "type": "uint64" + }, + { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, + { + "internalType": "uint256", + "name": "bidDecimals", + "type": "uint256" + } + ], + "internalType": "struct Preset", + "name": "presets_", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionStartTime", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getAuctionStepMin", + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBuyItNowInvalidationThreshold", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getContractAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getTokenId", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "getTokenKind", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_contract", "type": "address" } + ], + "name": "isBiddingAllowed", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" }, + { "internalType": "uint80", "name": "_newEndTime", "type": "uint80" }, + { "internalType": "uint56", "name": "_newTokenAmount", "type": "uint56" }, + { "internalType": "bytes4", "name": "_tokenKind", "type": "bytes4" } + ], + "name": "modifyAuction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, + { "internalType": "uint256[]", "name": "", "type": "uint256[]" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "onERC1155BatchReceived", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "onERC1155Received", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "uint256", "name": "", "type": "uint256" }, + { "internalType": "bytes", "name": "", "type": "bytes" } + ], + "name": "onERC721Received", + "outputs": [{ "internalType": "bytes4", "name": "", "type": "bytes4" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_pixelcraft", "type": "address" }, + { "internalType": "address", "name": "_dao", "type": "address" }, + { "internalType": "address", "name": "_gbm", "type": "address" }, + { "internalType": "address", "name": "_rarityFarming", "type": "address" } + ], + "name": "setAddresses", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_auctionPresetID", + "type": "uint256" + }, + { + "components": [ + { "internalType": "uint64", "name": "incMin", "type": "uint64" }, + { "internalType": "uint64", "name": "incMax", "type": "uint64" }, + { + "internalType": "uint64", + "name": "bidMultiplier", + "type": "uint64" + }, + { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, + { + "internalType": "uint256", + "name": "bidDecimals", + "type": "uint256" + } + ], + "internalType": "struct Preset", + "name": "_preset", + "type": "tuple" + } + ], + "name": "setAuctionPresets", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_contract", "type": "address" }, + { "internalType": "bool", "name": "_value", "type": "bool" } + ], + "name": "setBiddingAllowed", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_invalidationThreshold", + "type": "uint256" + } + ], + "name": "setBuyItNowInvalidationThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" }, + { "internalType": "uint96", "name": "_buyItNowPrice", "type": "uint96" } + ], + "name": "setBuyNow", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "bytes", "name": "_newPubkey", "type": "bytes" } + ], + "name": "setPubkey", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tokenContract", + "type": "address" + }, + { "internalType": "bool", "name": "_allowed", "type": "bool" } + ], + "name": "toggleContractWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { "internalType": "address", "name": "owner_", "type": "address" } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "_newOwner", "type": "address" } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "EmptyCalldata", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "ImmutableFunction", + "type": "error" + }, + { "inputs": [], "name": "InValidFacetCutAction", "type": "error" }, + { "inputs": [], "name": "InitCallFailed", "type": "error" }, + { "inputs": [], "name": "MustBeZeroAddress", "type": "error" }, + { "inputs": [], "name": "NoCode", "type": "error" }, + { "inputs": [], "name": "NoSelectorsInFacet", "type": "error" }, + { "inputs": [], "name": "NoZeroAddress", "type": "error" }, + { "inputs": [], "name": "NonEmptyCalldata", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "NonExistentSelector", + "type": "error" + }, + { "inputs": [], "name": "NotDiamondOwner", "type": "error" }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "SameSelectorReplacement", + "type": "error" + }, + { + "inputs": [ + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } + ], + "name": "SelectorExists", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "facetAddress", + "type": "address" + }, + { + "internalType": "enum IDiamondCut.FacetCutAction", + "name": "action", + "type": "uint8" + }, + { + "internalType": "bytes4[]", + "name": "functionSelectors", + "type": "bytes4[]" + } + ], + "indexed": false, + "internalType": "struct IDiamondCut.FacetCut[]", + "name": "_diamondCut", + "type": "tuple[]" + }, + { + "indexed": false, + "internalType": "address", + "name": "_init", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "_calldata", + "type": "bytes" + } + ], + "name": "DiamondCut", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + } ] diff --git a/schema.graphql b/schema.graphql index b4d6733..c0c02de 100644 --- a/schema.graphql +++ b/schema.graphql @@ -45,6 +45,8 @@ type Auction @entity { royaltyFees: BigInt! category: Int! + buyNowPrice: BigInt! + startBidPrice: BigInt! } type Bid @entity { @@ -241,3 +243,32 @@ type Auction_BidPlaced implements Event @entity(immutable: true) { # auction: Auction! } + +type Auction_BuyItNowUpdated implements Event @entity(immutable: true) { + id: ID! + emitter: User! + transaction: Transaction! + timestamp: BigInt! + + auctionId: BigInt! + buyNowPrice: BigInt! +} + +type Auction_StartingPriceUpdated implements Event @entity(immutable: true) { + id: ID! + emitter: User! + transaction: Transaction! + timestamp: BigInt! + + auctionId: BigInt! + startBidPrice: BigInt! +} + +type Auction_BoughtNow implements Event @entity(immutable: true) { + id: ID! + emitter: User! + transaction: Transaction! + timestamp: BigInt! + + auctionId: BigInt! +} diff --git a/src/helper.ts b/src/helper.ts index c0e6629..cb4e3fd 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -95,6 +95,8 @@ export function getOrCreateAuction( auction.totalBidsVolume = BIGINT_ZERO; auction.royaltyFees = BIGINT_ZERO; auction.totalBids = BIGINT_ZERO; + auction.buyNowPrice = BIGINT_ZERO; + auction.startBidPrice = BIGINT_ZERO; } return auction; diff --git a/src/mapping.ts b/src/mapping.ts index 5ecd4e0..cf009f2 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -11,6 +11,9 @@ import { Auction_ItemClaimed as Auction_ItemClaimedEvent, AuctionCancelled as AuctionCancelledEvent, RoyaltyPaid as RoyaltyPaidEvent, + Auction_BuyItNowUpdated as Auction_BuyItNowUpdatedEvent, + Auction_StartingPriceUpdated as Auction_StartingPriceUpdatedEvent, + Auction_BoughtNow as Auction_BoughtNowEvent, } from "../generated/Contract/Contract"; import { Auction, @@ -26,6 +29,9 @@ import { Auction_ItemClaimed, AuctionCancelled, Bid, + Auction_BuyItNowUpdated, + Auction_StartingPriceUpdated, + Auction_BoughtNow, } from "../generated/schema"; import { calculateIncentives, @@ -529,3 +535,114 @@ export function handleContract_RoyaltyPaid(event: RoyaltyPaidEvent): void { auction = updateProceeds(auction); auction.save(); } + +export function handleAuction_BuyItNowUpdated( + event: Auction_BuyItNowUpdatedEvent +): void { + // emitter + let emitter = getOrCreateUser(event.transaction.from); + emitter.save(); + + // event + let ev = new Auction_BuyItNowUpdated(events.id(event)); + ev.emitter = emitter.id; + ev.transaction = transactions.log(event).id; + ev.timestamp = event.block.timestamp; + + ev.auctionId = event.params._auctionId; + ev.buyNowPrice = event.params._buyItNowPrice; + ev.save(); + + // update entity + let entity = getOrCreateAuction(event.params._auctionId, event); + if (!entity) { + log.warning("auction with id {} not found", [ + event.params._auctionId.toString(), + ]); + return; + } + entity.buyNowPrice = event.params._buyItNowPrice; + entity.save(); +} + +export function handleAuction_StartingPriceUpdated( + event: Auction_StartingPriceUpdatedEvent +): void { + // emitter + let emitter = getOrCreateUser(event.transaction.from); + emitter.save(); + + // event + let ev = new Auction_StartingPriceUpdated(events.id(event)); + ev.emitter = emitter.id; + ev.transaction = transactions.log(event).id; + ev.timestamp = event.block.timestamp; + + ev.auctionId = event.params._auctionId; + ev.startBidPrice = event.params._startPrice; + ev.save(); + + // update entity + let entity = getOrCreateAuction(event.params._auctionId, event); + if (!entity) { + log.warning("auction with id {} not found", [ + event.params._auctionId.toString(), + ]); + return; + } + entity.startBidPrice = event.params._startPrice; + entity.save(); +} + +export function handleAuction_BoughtNow( + event: Auction_BoughtNowEvent +): void { + // emitter + let emitter = getOrCreateUser(event.transaction.from); + emitter.save(); + + // event + let ev = new Auction_BoughtNow(events.id(event)); + ev.emitter = emitter.id; + ev.transaction = transactions.log(event).id; + ev.timestamp = event.block.timestamp; + + ev.auctionId = event.params._auctionId; + ev.save(); + + // update entity + let auction = getOrCreateAuction(event.params._auctionId, event); + if (!auction) { + log.warning("auction with id {} not found", [ + event.params._auctionId.toString(), + ]); + return; + } + auction.claimed = true; + auction.claimAt = event.block.timestamp; + + let bid = getOrCreateBid( + auction.highestBidder, + auction.highestBid, + auction as Auction, + event + ); + bid.outbid = true; + + let user = getOrCreateUser(auction.highestBidder); + user.outbids = user.outbids.plus(BigInt.fromI32(1)); + user.save(); + + // Update Stats + let stats = Statistic.load("0")!; + stats.totalSalesVolume = stats.totalSalesVolume.plus(auction.buyNowPrice); + stats.save(); + + // update contract stats + let cStats = getOrCreateStatistics(auction.contractAddress); + cStats.totalSalesVolume = cStats.totalSalesVolume.plus(auction.buyNowPrice); + cStats.save(); + + bid.save(); + auction.save(); +} diff --git a/subgraph.yaml b/subgraph.yaml index 774a35f..7cd1932 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -11,7 +11,7 @@ dataSources: startBlock: 36176058 mapping: kind: ethereum/events - apiVersion: 0.0.5 + apiVersion: 0.0.6 language: wasm/assemblyscript entities: - AuctionCancelled @@ -47,4 +47,10 @@ dataSources: handler: handleContract_BiddingAllowed - event: RoyaltyPaid(indexed uint256,indexed address,address,uint256) handler: handleContract_RoyaltyPaid + - event: Auction_BuyItNowUpdated(indexed uint256,uint256) + handler: handleAuction_BuyItNowUpdated + - event: Auction_StartingPriceUpdated(indexed uint256,uint256) + handler: handleAuction_StartingPriceUpdated + - event: Auction_BoughtNow(indexed uint256,indexed address) + handler: handleAuction_BoughtNow file: ./src/mapping.ts