Skip to content

Commit

Permalink
Claim scripts for marketplaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lykhonis committed Nov 27, 2023
1 parent bda83de commit 3f8c7c1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions scripts/marketplace/lsp7/LSP7Marketplace.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
}
}
17 changes: 12 additions & 5 deletions scripts/marketplace/lsp8/LSP8Marketplace.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
}
}

0 comments on commit 3f8c7c1

Please sign in to comment.