Skip to content

Commit

Permalink
custom amount to withdraw
Browse files Browse the repository at this point in the history
  • Loading branch information
andresaiello committed Aug 21, 2024
1 parent 172158c commit f52a4bd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard {
signerAddress = signerAddress_;
}

function withdraw(address wallet) external onlyOwner {
function withdraw(address wallet, uint256 amount) external onlyOwner {
if (wallet == address(0)) revert InvalidAddress();
payable(wallet).transfer(address(this).balance);
if (amount > address(this).balance) revert TransferFailed();
payable(wallet).transfer(amount);
}

receive() external payable {}
Expand Down

0 comments on commit f52a4bd

Please sign in to comment.