From 26116dd9f340c1e58caa3bfe3d70ee38a154101e Mon Sep 17 00:00:00 2001 From: ogarciarevett Date: Wed, 15 May 2024 21:23:10 -0400 Subject: [PATCH] Fix: Adding sponsor admin cancel trd --- .../proxy-deployments/deployments-game7-arb-sepolia.ts | 1 + .../marketplace/direct-listings/DirectListingsLogic.sol | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/constants/proxy-deployments/deployments-game7-arb-sepolia.ts b/constants/proxy-deployments/deployments-game7-arb-sepolia.ts index 522f70c..32908f3 100644 --- a/constants/proxy-deployments/deployments-game7-arb-sepolia.ts +++ b/constants/proxy-deployments/deployments-game7-arb-sepolia.ts @@ -62,6 +62,7 @@ export const GAME7_ARB_SEPOLIA_CONTRACTS: DeploymentProxyContract[] = [ 'updateListing(uint256,(address,uint256,uint256,address,uint256,uint128,uint128,bool))', 'adminUpdateListing(uint256,(address,uint256,uint256,address,uint256,uint128,uint128,bool),address)', 'cancelListing(uint256)', + 'adminCancelListing(address,uint256)', 'approveBuyerForListing(uint256,address,bool)', 'approveCurrencyForListing(uint256,address,uint256)', 'buyFromListing(uint256,address,uint256,address,uint256)', diff --git a/contracts/upgradeables/marketplace/direct-listings/DirectListingsLogic.sol b/contracts/upgradeables/marketplace/direct-listings/DirectListingsLogic.sol index f4b0450..e84028b 100644 --- a/contracts/upgradeables/marketplace/direct-listings/DirectListingsLogic.sol +++ b/contracts/upgradeables/marketplace/direct-listings/DirectListingsLogic.sol @@ -240,6 +240,13 @@ contract DirectListingsLogic is IDirectListings, ReentrancyGuard, ERC2771Context emit CancelledListing(_msgSender(), _listingId); } + /// @notice Cancel a listing. + function adminCancelListing(address listingCreator, uint256 _listingId) external onlyManagerRole { + _directListingsStorage().listings[_listingId].status = IDirectListings.Status.CANCELLED; + _transferListingTokensToCreator(_directListingsStorage().listings[_listingId]); + emit CancelledListing(listingCreator, _listingId); + } + /// @notice Approve a buyer to buy from a reserved listing. function approveBuyerForListing( uint256 _listingId,