This commit is contained in:
Michele Balistreri 2020-04-23 14:44:04 +03:00
parent aec3c4d77e
commit 01ca6aaf01
No known key found for this signature in database
GPG Key ID: E9567DA33A4F791A
2 changed files with 9 additions and 1 deletions

View File

@ -99,7 +99,10 @@ contract GiftBucket {
uint256 amount = gift.amount;
require(redeemableSupply >= amount, "not enough redeemable supply");
gift.recipient = address(0);
gift.amount = 0;
gift.code = 0;
redeemableSupply -= amount;
tokenContract.transfer(_redeem.receiver, amount);

View File

@ -69,7 +69,12 @@ contract NFTBucket is IERC165, IERC721Receiver {
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 {