From 1c8b085a53f0dfa17cbb554dbb534bccfbd7205c Mon Sep 17 00:00:00 2001 From: orionstardust Date: Wed, 20 Mar 2024 23:49:52 -0400 Subject: [PATCH 1/7] 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 From 07f71ff11317dcc844ba6fcc01cbb6ce72a24baf Mon Sep 17 00:00:00 2001 From: orionstardust Date: Thu, 21 Mar 2024 14:11:01 -0400 Subject: [PATCH 2/7] fix: init issue --- src/mapping.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mapping.ts b/src/mapping.ts index cf009f2..2537366 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -316,6 +316,8 @@ export function handleAuction_Initialized( "0x0000000000000000000000000000000000000000" ); auction.cancelled = false; + auction.buyNowPrice = BigInt.fromI32(0); + auction.startBidPrice = BigInt.fromI32(0); //Fetch auction info from contract let contract = Contract.bind(event.address); From 1c093b98db9c0b6505927e1626b7f9b1335fb371 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 23 Mar 2024 11:13:17 +0100 Subject: [PATCH 3/7] fix: subgraph fails if auction info not found --- src/mapping.ts | 69 +++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/mapping.ts b/src/mapping.ts index 2537366..86dfbb4 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -323,46 +323,47 @@ export function handleAuction_Initialized( let contract = Contract.bind(event.address); let result = contract.try_getAuctionInfo(event.params._auctionID); - let resultHammerTime = contract.try_getAuctionHammerTimeDuration(); - - // @todo: seller, createdAt, startsAt, endsAt, claimAt, - // contractId quantity, presetId, cancelled, ercType, bids objects - if (!result.reverted) { - let auctionInfo = result.value; - - auction.category = auctionInfo.info.category; - auction.auctionDebt = auctionInfo.auctionDebt; - auctionInfo.biddingAllowed; - auction.claimed = auctionInfo.claimed; - - let presets = auctionInfo.presets; - auction.bidDecimals = presets.bidDecimals; - auction.bidMultiplier = presets.bidMultiplier; - - auction.incMax = presets.incMax; - auction.incMin = presets.incMin; - auction.stepMin = presets.stepMin; - auction.seller = auctionInfo.owner; - auction.createdAt = event.block.timestamp; - auction.quantity = event.params._tokenAmount; - auction.startsAt = event.block.timestamp; - auction.dueIncentives = auctionInfo.dueIncentives; - - auction.startsAt = auctionInfo.info.startTime; - auction.endsAt = auctionInfo.info.endTime; - auction.endsAtOriginal = auctionInfo.info.endTime; - - // auction.claimAt = - auction.highestBidder = auctionInfo.highestBidder; - auction.cancellationPeriodDuration = BIGINT_CANCELLATION_PERIOD_IN_SECONDS; - - auction = updateProceeds(auction); + // skip if auction info is not found + if (result.reverted) { + return; } + let resultHammerTime = contract.try_getAuctionHammerTimeDuration(); if (!resultHammerTime.reverted) { auction.hammerTimeDuration = resultHammerTime.value; } + // @todo: seller, createdAt, startsAt, endsAt, claimAt, + // contractId quantity, presetId, cancelled, ercType, bids objects + + let auctionInfo = result.value; + auction.category = auctionInfo.info.category; + auction.auctionDebt = auctionInfo.auctionDebt; + auctionInfo.biddingAllowed; + auction.claimed = auctionInfo.claimed; + + let presets = auctionInfo.presets; + auction.bidDecimals = presets.bidDecimals; + auction.bidMultiplier = presets.bidMultiplier; + + auction.incMax = presets.incMax; + auction.incMin = presets.incMin; + auction.stepMin = presets.stepMin; + auction.seller = auctionInfo.owner; + auction.createdAt = event.block.timestamp; + auction.quantity = event.params._tokenAmount; + auction.startsAt = event.block.timestamp; + auction.dueIncentives = auctionInfo.dueIncentives; + + auction.startsAt = auctionInfo.info.startTime; + auction.endsAt = auctionInfo.info.endTime; + auction.endsAtOriginal = auctionInfo.info.endTime; + + // auction.claimAt = + auction.highestBidder = auctionInfo.highestBidder; + auction.cancellationPeriodDuration = BIGINT_CANCELLATION_PERIOD_IN_SECONDS; + + auction = updateProceeds(auction); auction.save(); let contractEntity = ContractEntity.load( From 1f2380b293b07bc651bb045312b2d83ea8e2e64e Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 23 Mar 2024 13:06:27 +0100 Subject: [PATCH 4/7] chore: some check whether auction was found or not --- src/helper.ts | 4 ++-- src/mapping.ts | 37 ++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/helper.ts b/src/helper.ts index cb4e3fd..973d7dc 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -73,7 +73,7 @@ export function getOrCreateUser(address: Bytes): User { export function getOrCreateAuction( auctionId: BigInt, event: ethereum.Event -): Auction { +): Auction | null { let id = auctionId.toString(); let auction = Auction.load(id); if (!auction) { @@ -81,7 +81,7 @@ export function getOrCreateAuction( let contract = Contract.bind(event.address); let result = contract.try_getAuctionInfo(auctionId); if (result.reverted) { - return auction; + return null; } let value = result.value; diff --git a/src/mapping.ts b/src/mapping.ts index 86dfbb4..117193e 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -72,7 +72,7 @@ export function handleAuction_BidPlaced(event: Auction_BidPlacedEvent): void { event.params._auctionID.toString(), ]); let auction = getOrCreateAuction(event.params._auctionID, event); - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); @@ -142,7 +142,7 @@ export function handleAuction_BidRemoved(event: Auction_BidRemovedEvent): void { ev.save(); let auction = getOrCreateAuction(event.params._auctionID, event); - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); @@ -184,7 +184,7 @@ export function handleAuction_EndTimeUpdated( ev.save(); let entity = getOrCreateAuction(event.params._auctionID, event); - if (!entity) { + if (entity === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); @@ -217,17 +217,16 @@ export function handleAuction_IncentivePaid( // updated auction debt let auction = getOrCreateAuction(event.params._auctionID, event); - auction.auctionDebt = auction.auctionDebt.plus( - event.params._incentiveAmount - ); - auction.save(); - - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); return; } + auction.auctionDebt = auction.auctionDebt.plus( + event.params._incentiveAmount + ); + auction.save(); let incentive = getOrCreateIncentive( auction, event.params._earner, @@ -299,8 +298,9 @@ export function handleAuction_Initialized( let auction = getOrCreateAuction(event.params._auctionID, event); - if (auction == null) { - auction = new Auction(event.params._auctionID.toString()); + // auction does not exist on chain + if (!auction) { + return; } auction.orderId = orderId; @@ -406,7 +406,7 @@ export function handleAuction_StartTimeUpdated( // update entity let entity = getOrCreateAuction(event.params._auctionID, event); - if (!entity) { + if (entity === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); @@ -465,7 +465,7 @@ export function handleAuction_ItemClaimed( // update entity let auction = getOrCreateAuction(event.params._auctionID, event); - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionID.toString(), ]); @@ -519,7 +519,7 @@ export function handleAuctionCancelled(event: AuctionCancelledEvent): void { // update entity let auction = getOrCreateAuction(event.params._auctionId, event); - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionId.toString(), ]); @@ -534,6 +534,9 @@ export function handleAuctionCancelled(event: AuctionCancelledEvent): void { export function handleContract_RoyaltyPaid(event: RoyaltyPaidEvent): void { // update fees let auction = getOrCreateAuction(event.params._auctionId, event); + if (auction === null) { + return; + } auction.royaltyFees = auction.royaltyFees.plus(event.params._amount); auction = updateProceeds(auction); auction.save(); @@ -558,7 +561,7 @@ export function handleAuction_BuyItNowUpdated( // update entity let entity = getOrCreateAuction(event.params._auctionId, event); - if (!entity) { + if (entity === null) { log.warning("auction with id {} not found", [ event.params._auctionId.toString(), ]); @@ -587,7 +590,7 @@ export function handleAuction_StartingPriceUpdated( // update entity let entity = getOrCreateAuction(event.params._auctionId, event); - if (!entity) { + if (entity === null) { log.warning("auction with id {} not found", [ event.params._auctionId.toString(), ]); @@ -615,7 +618,7 @@ export function handleAuction_BoughtNow( // update entity let auction = getOrCreateAuction(event.params._auctionId, event); - if (!auction) { + if (auction === null) { log.warning("auction with id {} not found", [ event.params._auctionId.toString(), ]); From 0ed819f243711da00250767ab710b0f3978cccaa Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 24 Mar 2024 12:09:54 +0100 Subject: [PATCH 5/7] fix: use new abi at block x --- abis/abi_gbm.json | 2346 ++++++++++++---------- abis/{Contract.json => abi_gbm_new.json} | 636 +++++- src/constants.ts | 3 + src/helper.ts | 106 +- src/mapping.ts | 40 +- subgraph.yaml | 4 +- 6 files changed, 1904 insertions(+), 1231 deletions(-) rename abis/{Contract.json => abi_gbm_new.json} (55%) diff --git a/abis/abi_gbm.json b/abis/abi_gbm.json index 06812fc..77c5484 100644 --- a/abis/abi_gbm.json +++ b/abis/abi_gbm.json @@ -1,1096 +1,1288 @@ [ - { "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[]" - } + { "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" + } ], - "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[]" - } + "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" } ], - "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" } + "name": "diamondCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "_functionSelector", + "type": "bytes4" + } ], - "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" } + "name": "facetAddress", + "outputs": [ + { + "internalType": "address", + "name": "facetAddress_", + "type": "address" + } ], - "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" }, - { + "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", + "name": "_tokenKind", "type": "bytes4" - }, - { + }, + { + "indexed": false, "internalType": "uint256", - "name": "tokenID", + "name": "_presetID", "type": "uint256" - }, - { - "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" }, - { + } + ], + "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": "bidMultiplier", + "name": "_newTokenAmount", "type": "uint64" - }, - { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, - { + }, + { + "indexed": true, + "internalType": "uint80", + "name": "_newEndTime", + "type": "uint80" + } + ], + "name": "Auction_Modified", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, "internalType": "uint256", - "name": "bidDecimals", + "name": "_auctionID", "type": "uint256" - } - ], - "internalType": "struct Preset", - "name": "presets", - "type": "tuple" - }, - { - "internalType": "uint96", - "name": "buyItNowPrice", - "type": "uint96" - }, - { "internalType": "uint96", "name": "startingBid", "type": "uint96" } + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_endTime", + "type": "uint256" + } ], - "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" - } + "name": "Auction_StartTimeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_contract", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "_biddingAllowed", + "type": "bool" + } ], - "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" - } + "name": "Contract_BiddingAllowed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "_auctionIDs", + "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" - }, - { + "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": "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": "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" } ], diff --git a/abis/Contract.json b/abis/abi_gbm_new.json similarity index 55% rename from abis/Contract.json rename to abis/abi_gbm_new.json index 01569a2..06812fc 100644 --- a/abis/Contract.json +++ b/abis/abi_gbm_new.json @@ -1,50 +1,151 @@ [ - { "inputs": [], "name": "AuctionClaimed", "type": "error" }, - { "inputs": [], "name": "AuctionEnded", "type": "error" }, - { "inputs": [], "name": "AuctionExists", "type": "error" }, + { "inputs": [], "name": "EmptyCalldata", "type": "error" }, { "inputs": [ - { "internalType": "uint256", "name": "timeToEnd", "type": "uint256" } + { "internalType": "bytes4", "name": "selector", "type": "bytes4" } ], - "name": "AuctionNotEnded", + "name": "ImmutableFunction", "type": "error" }, - { "inputs": [], "name": "AuctionNotStarted", "type": "error" }, - { "inputs": [], "name": "BiddingNotAllowed", "type": "error" }, - { "inputs": [], "name": "CancellationTimeExceeded", "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", + { "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": [], "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": "NotHighestBidderOrOwner", "type": "error" }, - { "inputs": [], "name": "NotTokenOwner", "type": "error" }, - { "inputs": [], "name": "StartOrEndTimeTooLow", "type": "error" }, - { "inputs": [], "name": "TokenTypeMismatch", "type": "error" }, - { "inputs": [], "name": "UndefinedPreset", "type": "error" }, { "inputs": [ { - "internalType": "uint256", - "name": "currentHighestBid", - "type": "uint256" + "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": "UnmatchedHighestBid", - "type": "error" + "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": [ @@ -114,6 +215,44 @@ "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": [ @@ -190,6 +329,12 @@ "internalType": "bytes4", "name": "_tokenKind", "type": "bytes4" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_presetID", + "type": "uint256" } ], "name": "Auction_Initialized", @@ -208,6 +353,31 @@ "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": [ @@ -222,11 +392,36 @@ "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": [ @@ -246,6 +441,37 @@ "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": [ { @@ -261,29 +487,57 @@ }, { "inputs": [ - { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + { + "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": "cancelAuction", + "name": "batchCreateAuctions", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ - { "internalType": "address", "name": "_contract", "type": "address" }, - { "internalType": "uint256", "name": "id", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } ], - "name": "checkIndex", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", + "name": "buyNow", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { - "inputs": [], - "name": "checkPubKey", - "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }], - "stateMutability": "view", + "inputs": [ + { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } + ], + "name": "cancelAuction", + "outputs": [], + "stateMutability": "nonpayable", "type": "function" }, { @@ -300,7 +554,11 @@ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" }, { "internalType": "uint256", "name": "_bidAmount", "type": "uint256" }, { "internalType": "uint256", "name": "_highestBid", "type": "uint256" }, - { "internalType": "uint256", "name": "_contractID", "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" } @@ -316,15 +574,26 @@ "components": [ { "internalType": "uint80", "name": "startTime", "type": "uint80" }, { "internalType": "uint80", "name": "endTime", "type": "uint80" }, - { "internalType": "uint64", "name": "tokenAmount", "type": "uint64" }, + { "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": "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": "uint160", "name": "_contractID", "type": "uint160" }, + { + "internalType": "address", + "name": "_tokenContract", + "type": "address" + }, { "internalType": "uint256", "name": "_auctionPresetID", @@ -336,25 +605,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "uint256", "name": "_contractID", "type": "uint256" } - ], - "name": "disableContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "_contractID", "type": "uint256" }, - { "internalType": "address", "name": "_tokenContract", "type": "address" } - ], - "name": "enableContract", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } @@ -369,7 +619,7 @@ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } ], "name": "getAuctionBidMultiplier", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, @@ -401,9 +651,7 @@ "type": "function" }, { - "inputs": [ - { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } - ], + "inputs": [], "name": "getAuctionHammerTimeDuration", "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], "stateMutability": "view", @@ -432,7 +680,7 @@ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } ], "name": "getAuctionIncMax", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, @@ -441,7 +689,7 @@ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" } ], "name": "getAuctionIncMin", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "outputs": [{ "internalType": "uint64", "name": "", "type": "uint64" }], "stateMutability": "view", "type": "function" }, @@ -469,9 +717,9 @@ { "internalType": "bool", "name": "biddingAllowed", "type": "bool" }, { "internalType": "bool", "name": "claimed", "type": "bool" }, { - "internalType": "uint160", - "name": "contractID", - "type": "uint160" + "internalType": "address", + "name": "tokenContract", + "type": "address" }, { "components": [ @@ -482,10 +730,11 @@ }, { "internalType": "uint80", "name": "endTime", "type": "uint80" }, { - "internalType": "uint64", + "internalType": "uint56", "name": "tokenAmount", - "type": "uint64" + "type": "uint56" }, + { "internalType": "uint8", "name": "category", "type": "uint8" }, { "internalType": "bytes4", "name": "tokenKind", @@ -495,6 +744,16 @@ "internalType": "uint256", "name": "tokenID", "type": "uint256" + }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { + "internalType": "uint96", + "name": "startingBid", + "type": "uint96" } ], "internalType": "struct InitiatorInfo", @@ -512,20 +771,21 @@ }, { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, { - "internalType": "uint240", + "internalType": "uint256", "name": "bidDecimals", - "type": "uint240" - }, - { - "internalType": "uint16", - "name": "hammerTimeDuration", - "type": "uint16" + "type": "uint256" } ], "internalType": "struct Preset", "name": "presets", "type": "tuple" - } + }, + { + "internalType": "uint96", + "name": "buyItNowPrice", + "type": "uint96" + }, + { "internalType": "uint96", "name": "startingBid", "type": "uint96" } ], "internalType": "struct Auction", "name": "auctionInfo_", @@ -556,14 +816,9 @@ }, { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, { - "internalType": "uint240", + "internalType": "uint256", "name": "bidDecimals", - "type": "uint240" - }, - { - "internalType": "uint16", - "name": "hammerTimeDuration", - "type": "uint16" + "type": "uint256" } ], "internalType": "struct Preset", @@ -588,6 +843,13 @@ { "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" @@ -632,7 +894,7 @@ "inputs": [ { "internalType": "uint256", "name": "_auctionID", "type": "uint256" }, { "internalType": "uint80", "name": "_newEndTime", "type": "uint80" }, - { "internalType": "uint64", "name": "_newTokenAmount", "type": "uint64" }, + { "internalType": "uint56", "name": "_newTokenAmount", "type": "uint56" }, { "internalType": "bytes4", "name": "_tokenKind", "type": "bytes4" } ], "name": "modifyAuction", @@ -678,6 +940,18 @@ "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": [ { @@ -696,14 +970,9 @@ }, { "internalType": "uint64", "name": "stepMin", "type": "uint64" }, { - "internalType": "uint240", + "internalType": "uint256", "name": "bidDecimals", - "type": "uint240" - }, - { - "internalType": "uint16", - "name": "hammerTimeDuration", - "type": "uint16" + "type": "uint256" } ], "internalType": "struct Preset", @@ -725,5 +994,168 @@ "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/src/constants.ts b/src/constants.ts index 8760e8c..c2e8e92 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -4,3 +4,6 @@ export let BIGINT_ZERO = BigInt.fromI32(0); export let BIGINT_ONE = BigInt.fromI32(1); export let BIGINT_CANCELLATION_PERIOD_IN_SECONDS = BigInt.fromI32(3600); + +// TODO: Needs to be updated to activated block number +export let BLOCK_NR_BUY_NOW_ACTIVATED = BigInt.fromI32(54989367); \ No newline at end of file diff --git a/src/helper.ts b/src/helper.ts index 973d7dc..3d00188 100644 --- a/src/helper.ts +++ b/src/helper.ts @@ -5,13 +5,10 @@ import { Bytes, ethereum, } from "@graphprotocol/graph-ts"; -import { - Auction_BidPlaced, - Auction_BidRemoved, - Contract, -} from "../generated/Contract/Contract"; import { Auction, Bid, Incentive, Statistic, User } from "../generated/schema"; -import { BIGINT_ONE, BIGINT_ZERO } from "./constants"; +import { BIGINT_ONE, BIGINT_ZERO, BLOCK_NR_BUY_NOW_ACTIVATED } from "./constants"; +import { ContractV1 } from "../generated/Contract/ContractV1"; +import { Contract } from "../generated/Contract/Contract"; export function getOrCreateBid( bidder: Bytes, @@ -78,18 +75,8 @@ export function getOrCreateAuction( let auction = Auction.load(id); if (!auction) { auction = new Auction(id); - let contract = Contract.bind(event.address); - let result = contract.try_getAuctionInfo(auctionId); - if (result.reverted) { - return null; - } - - let value = result.value; - auction.bidDecimals = value.presets.bidDecimals; - auction.bidMultiplier = value.presets.bidMultiplier; - // auction.bids = []; + auction = updateAuction(auction, event); auction.cancelled = false; - auction.claimed = value.claimed; auction.claimAt = BIGINT_ZERO; auction.contractAddress = event.address; auction.totalBidsVolume = BIGINT_ZERO; @@ -216,3 +203,88 @@ export function getOrCreateStatistics(contractAddress: Bytes): Statistic { return stats; } + +export function updateAuctionV0(auction: Auction, event: ethereum.Event): Auction { + let contract = Contract.bind(event.address); + let result = contract.try_getAuctionInfo(BigInt.fromString(auction.id)); + if (result.reverted) { + return auction; + } + + let auctionInfo = result.value; + auction.category = auctionInfo.info.category; + auction.auctionDebt = auctionInfo.auctionDebt; + auctionInfo.biddingAllowed; + auction.claimed = auctionInfo.claimed; + + let presets = auctionInfo.presets; + auction.bidDecimals = presets.bidDecimals; + auction.bidMultiplier = presets.bidMultiplier; + + auction.incMax = presets.incMax; + auction.incMin = presets.incMin; + auction.stepMin = presets.stepMin; + auction.seller = auctionInfo.owner; + auction.createdAt = event.block.timestamp; + + auction.startsAt = event.block.timestamp; + auction.dueIncentives = auctionInfo.dueIncentives; + + auction.startsAt = auctionInfo.info.startTime; + auction.endsAt = auctionInfo.info.endTime; + auction.endsAtOriginal = auctionInfo.info.endTime; + + // auction.claimAt = + auction.highestBidder = auctionInfo.highestBidder; + + auction.bidDecimals = auctionInfo.presets.bidDecimals; + auction.bidMultiplier = auctionInfo.presets.bidMultiplier; + + auction.claimed = auctionInfo.claimed; + return auction; +} + +export function updateAuctionV1(auction: Auction, event: ethereum.Event): Auction { + let contract = ContractV1.bind(event.address); + let result = contract.try_getAuctionInfo(BigInt.fromString(auction.id)); + if (result.reverted) { + return auction; + } + + let auctionInfo = result.value; + auction.category = auctionInfo.info.category; + auction.auctionDebt = auctionInfo.auctionDebt; + auctionInfo.biddingAllowed; + auction.claimed = auctionInfo.claimed; + + let presets = auctionInfo.presets; + auction.bidDecimals = presets.bidDecimals; + auction.bidMultiplier = presets.bidMultiplier; + + auction.incMax = presets.incMax; + auction.incMin = presets.incMin; + auction.stepMin = presets.stepMin; + auction.seller = auctionInfo.owner; + auction.createdAt = event.block.timestamp; + + auction.startsAt = event.block.timestamp; + auction.dueIncentives = auctionInfo.dueIncentives; + + auction.startsAt = auctionInfo.info.startTime; + auction.endsAt = auctionInfo.info.endTime; + auction.endsAtOriginal = auctionInfo.info.endTime; + + // auction.claimAt = + auction.highestBidder = auctionInfo.highestBidder; + + auction.bidDecimals = auctionInfo.presets.bidDecimals; + auction.bidMultiplier = auctionInfo.presets.bidMultiplier; + + auction.claimed = auctionInfo.claimed; + + return auction; +} + +export function updateAuction(auction: Auction, event: ethereum.Event): Auction { + return event.block.number.lt(BLOCK_NR_BUY_NOW_ACTIVATED) ? updateAuctionV0(auction, event) : updateAuctionV1(auction, event); +} \ No newline at end of file diff --git a/src/mapping.ts b/src/mapping.ts index 117193e..e30cca9 100644 --- a/src/mapping.ts +++ b/src/mapping.ts @@ -1,6 +1,5 @@ import { Address, BigInt, log } from "@graphprotocol/graph-ts"; import { - Contract, Auction_BidPlaced as Auction_BidPlacedEvent, Auction_BidRemoved as Auction_BidRemovedEvent, Auction_EndTimeUpdated as Auction_EndTimeUpdatedEvent, @@ -14,7 +13,8 @@ import { Auction_BuyItNowUpdated as Auction_BuyItNowUpdatedEvent, Auction_StartingPriceUpdated as Auction_StartingPriceUpdatedEvent, Auction_BoughtNow as Auction_BoughtNowEvent, -} from "../generated/Contract/Contract"; + ContractV1, +} from "../generated/Contract/ContractV1"; import { Auction, Statistic, @@ -40,6 +40,7 @@ import { getOrCreateIncentive, getOrCreateStatistics, getOrCreateUser, + updateAuction, updateProceeds, } from "./helper"; import { events, transactions } from "@amxx/graphprotocol-utils"; @@ -319,15 +320,10 @@ export function handleAuction_Initialized( auction.buyNowPrice = BigInt.fromI32(0); auction.startBidPrice = BigInt.fromI32(0); - //Fetch auction info from contract - let contract = Contract.bind(event.address); - - let result = contract.try_getAuctionInfo(event.params._auctionID); - // skip if auction info is not found - if (result.reverted) { - return; - } + // Update Auction + auction = updateAuction(auction, event); + let contract = ContractV1.bind(event.address) let resultHammerTime = contract.try_getAuctionHammerTimeDuration(); if (!resultHammerTime.reverted) { auction.hammerTimeDuration = resultHammerTime.value; @@ -336,31 +332,7 @@ export function handleAuction_Initialized( // @todo: seller, createdAt, startsAt, endsAt, claimAt, // contractId quantity, presetId, cancelled, ercType, bids objects - let auctionInfo = result.value; - auction.category = auctionInfo.info.category; - auction.auctionDebt = auctionInfo.auctionDebt; - auctionInfo.biddingAllowed; - auction.claimed = auctionInfo.claimed; - - let presets = auctionInfo.presets; - auction.bidDecimals = presets.bidDecimals; - auction.bidMultiplier = presets.bidMultiplier; - - auction.incMax = presets.incMax; - auction.incMin = presets.incMin; - auction.stepMin = presets.stepMin; - auction.seller = auctionInfo.owner; - auction.createdAt = event.block.timestamp; auction.quantity = event.params._tokenAmount; - auction.startsAt = event.block.timestamp; - auction.dueIncentives = auctionInfo.dueIncentives; - - auction.startsAt = auctionInfo.info.startTime; - auction.endsAt = auctionInfo.info.endTime; - auction.endsAtOriginal = auctionInfo.info.endTime; - - // auction.claimAt = - auction.highestBidder = auctionInfo.highestBidder; auction.cancellationPeriodDuration = BIGINT_CANCELLATION_PERIOD_IN_SECONDS; auction = updateProceeds(auction); diff --git a/subgraph.yaml b/subgraph.yaml index 7cd1932..c12a1ea 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -7,7 +7,7 @@ dataSources: network: matic source: address: "0xd5543237c656f25eea69f1e247b8fa59ba353306" - abi: Contract + abi: ContractV1 startBlock: 36176058 mapping: kind: ethereum/events @@ -24,6 +24,8 @@ dataSources: - Auction_StartTimeUpdated - Contract_BiddingAllowed abis: + - name: ContractV1 + file: ./abis/abi_gbm_new.json - name: Contract file: ./abis/abi_gbm.json eventHandlers: From ea6e31b441eb4ab0814d8e70b958e1747763d7dc Mon Sep 17 00:00:00 2001 From: orionstardust Date: Thu, 18 Apr 2024 06:33:34 -0400 Subject: [PATCH 6/7] chore: update block info --- src/constants.ts | 2 +- subgraph.yaml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index c2e8e92..b682952 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,4 +6,4 @@ export let BIGINT_ONE = BigInt.fromI32(1); export let BIGINT_CANCELLATION_PERIOD_IN_SECONDS = BigInt.fromI32(3600); // TODO: Needs to be updated to activated block number -export let BLOCK_NR_BUY_NOW_ACTIVATED = BigInt.fromI32(54989367); \ No newline at end of file +export let BLOCK_NR_BUY_NOW_ACTIVATED = BigInt.fromI32(55931248); \ No newline at end of file diff --git a/subgraph.yaml b/subgraph.yaml index c12a1ea..3762313 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,4 +1,9 @@ specVersion: 0.0.4 +features: + - grafting +graft: + base: QmT2JC12A18dVFPs9BAoHFDgAjna8xHEELNB92GyJkZwda # Subgraph ID of base subgraph + block: 55931247 # Block number schema: file: ./schema.graphql dataSources: From 9a5c236ed004400786f892279e15d948186aa97b Mon Sep 17 00:00:00 2001 From: orionstardust Date: Thu, 18 Apr 2024 06:37:54 -0400 Subject: [PATCH 7/7] fix: graft configuration --- subgraph.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subgraph.yaml b/subgraph.yaml index 3762313..4c7bf98 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,9 +1,9 @@ specVersion: 0.0.4 -features: - - grafting -graft: - base: QmT2JC12A18dVFPs9BAoHFDgAjna8xHEELNB92GyJkZwda # Subgraph ID of base subgraph - block: 55931247 # Block number +#features: +# - grafting +#graft: +# base: QmT2JC12A18dVFPs9BAoHFDgAjna8xHEELNB92GyJkZwda # Subgraph ID of base subgraph +# block: 55931247 # Block number schema: file: ./schema.graphql dataSources: