mirror of
https://github.com/status-im/keycard-redeem.git
synced 2025-01-28 04:45:36 +00:00
closes #9
This commit is contained in:
parent
aec3c4d77e
commit
01ca6aaf01
@ -99,7 +99,10 @@ contract GiftBucket {
|
|||||||
uint256 amount = gift.amount;
|
uint256 amount = gift.amount;
|
||||||
require(redeemableSupply >= amount, "not enough redeemable supply");
|
require(redeemableSupply >= amount, "not enough redeemable supply");
|
||||||
|
|
||||||
|
gift.recipient = address(0);
|
||||||
gift.amount = 0;
|
gift.amount = 0;
|
||||||
|
gift.code = 0;
|
||||||
|
|
||||||
redeemableSupply -= amount;
|
redeemableSupply -= amount;
|
||||||
|
|
||||||
tokenContract.transfer(_redeem.receiver, amount);
|
tokenContract.transfer(_redeem.receiver, amount);
|
||||||
|
@ -69,7 +69,12 @@ contract NFTBucket is IERC165, IERC721Receiver {
|
|||||||
|
|
||||||
RedeemUtil.validateCode(_redeem, gift.code);
|
RedeemUtil.validateCode(_redeem, gift.code);
|
||||||
|
|
||||||
tokenContract.safeTransferFrom(address(this), _redeem.receiver, gift.tokenID);
|
uint256 tokenID = gift.tokenID;
|
||||||
|
gift.recipient = address(0);
|
||||||
|
gift.tokenID = 0;
|
||||||
|
gift.code = 0;
|
||||||
|
|
||||||
|
tokenContract.safeTransferFrom(address(this), _redeem.receiver, tokenID);
|
||||||
}
|
}
|
||||||
|
|
||||||
function kill() external onlyOwner {
|
function kill() external onlyOwner {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user