Skip to content

Commit

Permalink
Can only refund leftovers once
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Apr 10, 2024
1 parent 5bbe9dd commit f8f9452
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Dropper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ contract Dropper {

function refundToRecipient(uint256 dropId) external {
require(_drops[dropId].expirationTimestamp <= block.timestamp, "Dropper: still live");
require(_drops[dropId].totalToken > _drops[dropId].claimedTokens, "Dropper: all tokens claimed");

IERC20(_drops[dropId].tokenAddress).transfer(
_drops[dropId].expirationRecipient, _drops[dropId].totalToken - _drops[dropId].claimedTokens
);

_drops[dropId].claimedTokens = _drops[dropId].totalToken;
}

function claim(uint256 dropId, uint256 amount, bytes32[] calldata merkleProof) public {
Expand Down

0 comments on commit f8f9452

Please sign in to comment.