-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
805f146
commit 7905bed
Showing
2 changed files
with
121 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard { | |
address public signerAddress; | ||
|
||
event Claimed(address indexed to, bytes32 indexed taskId, uint256 amount); | ||
event Withdrawn(address indexed wallet, uint256 amount); | ||
|
||
error InvalidSigner(); | ||
error SignatureExpired(); | ||
|
@@ -91,6 +92,15 @@ contract InstantRewards is Ownable, Pausable, ReentrancyGuard { | |
if (wallet == address(0)) revert InvalidAddress(); | ||
if (amount > address(this).balance) revert TransferFailed(); | ||
payable(wallet).transfer(amount); | ||
emit Withdrawn(wallet, amount); | ||
} | ||
Check warning Code scanning / Slither Reentrancy vulnerabilities Warning
Reentrancy in InstantRewards.withdraw(address,uint256):
External calls: - address(wallet).transfer(amount) Event emitted after the call(s): - Withdrawn(wallet,amount) |
||
|
||
function pause() external onlyOwner { | ||
_pause(); | ||
} | ||
|
||
function unpause() external onlyOwner { | ||
_unpause(); | ||
} | ||
|
||
receive() external payable {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters