From 3f8c7c1557c3561edc7923856aa0474dcd7aba46 Mon Sep 17 00:00:00 2001 From: Volodymyr Lykhonis Date: Mon, 27 Nov 2023 22:00:11 +0100 Subject: [PATCH] Claim scripts for marketplaces --- scripts/marketplace/lsp7/LSP7Marketplace.s.sol | 17 ++++++++++++----- scripts/marketplace/lsp8/LSP8Marketplace.s.sol | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/scripts/marketplace/lsp7/LSP7Marketplace.s.sol b/scripts/marketplace/lsp7/LSP7Marketplace.s.sol index d2967c5..1f0ba1d 100644 --- a/scripts/marketplace/lsp7/LSP7Marketplace.s.sol +++ b/scripts/marketplace/lsp7/LSP7Marketplace.s.sol @@ -47,6 +47,18 @@ contract Deploy is Script { } } +contract Claim is Script { + function run() external { + address owner = vm.envAddress("OWNER_ADDRESS"); + LSP7Marketplace marketplace = LSP7Marketplace(payable(vm.envAddress("CONTRACT_LSP7_MARKETPLACE_ADDRESS"))); + + if (address(marketplace).balance > 0) { + vm.broadcast(owner); + marketplace.withdraw(address(marketplace).balance); + } + } +} + contract Configure is Script { function run() external { address owner = vm.envAddress("OWNER_ADDRESS"); @@ -85,10 +97,5 @@ contract Configure is Script { vm.broadcast(owner); marketplace.setParticipant(participant); } - - if (address(marketplace).balance > 0) { - vm.broadcast(owner); - marketplace.withdraw(address(marketplace).balance); - } } } diff --git a/scripts/marketplace/lsp8/LSP8Marketplace.s.sol b/scripts/marketplace/lsp8/LSP8Marketplace.s.sol index c4e4df0..5ec261e 100644 --- a/scripts/marketplace/lsp8/LSP8Marketplace.s.sol +++ b/scripts/marketplace/lsp8/LSP8Marketplace.s.sol @@ -48,6 +48,18 @@ contract Deploy is Script { } } +contract Claim is Script { + function run() external { + address owner = vm.envAddress("OWNER_ADDRESS"); + LSP8Marketplace marketplace = LSP8Marketplace(payable(vm.envAddress("CONTRACT_LSP8_MARKETPLACE_ADDRESS"))); + + if (address(marketplace).balance > 0) { + vm.broadcast(owner); + marketplace.withdraw(address(marketplace).balance); + } + } +} + contract Configure is Script { function run() external { address owner = vm.envAddress("OWNER_ADDRESS"); @@ -98,10 +110,5 @@ contract Configure is Script { vm.broadcast(owner); marketplace.setParticipant(participant); } - - if (address(marketplace).balance > 0) { - vm.broadcast(owner); - marketplace.withdraw(address(marketplace).balance); - } } }