Remove redemptionTBTCBurn from Deposit
Burn/mint occurs all in the vending machine now.
@@ -50,18 +50,6 @@ library DepositRedemption {
_d.approvedDigests[_digest] = block.timestamp;
}
- function redemptionTBTCBurn(DepositUtils.Deposit storage _d) private {
- // Burn the redeemer's TBTC plus enough extra to cover outstanding debt
- // Requires user to approve first
- /* TODO: implement such that it calls the system to burn TBTC? */
- TBTCToken _tbtc = TBTCToken(_d.TBTCToken);
- uint256 _bal = _tbtc.balanceOf(msg.sender);
- uint256 _red = _d.redemptionTBTCAmount();
- require(_bal >= _red, "Not enough TBTC to cover outstanding debt");
- _tbtc.burnFrom(msg.sender, TBTCConstants.getLotSize());
- _tbtc.transferFrom(msg.sender, address(this), DepositUtils.signerFee().add(DepositUtils.beneficiaryReward()));
- }
-
/// @notice Anyone can request redemption
/// @dev The redeemer specifies details about the Bitcoin redemption tx
/// @param _d deposit storage pointer
@@ -79,7 +67,11 @@ library DepositRedemption {
"redemption can only be called by deposit owner"
);
- redemptionTBTCBurn(_d);
+ TBTCToken tbtc = TBTCToken(_d.TBTCToken);
+ tbtc.transferFrom(msg.sender, address(this), DepositUtils.signerFee());
+
+ // TODO if the caller is the beneficiary, then it doesn't make sense to charge them for the beneficiaryReward
+ tbtc.transferFrom(msg.sender, address(this), DepositUtils.beneficiaryReward());
// Convert the 8-byte LE ints to uint256
uint256 _outputValue = abi.encodePacked(_outputValueBytes).reverseEndianness().bytesToUint();
