Check contract balance instead of FRT owner during at-term TDT owner redemption
Fee rebate is not distributed during at-term redemption. What we care about is signerFee. We escrow signer fee if no signer fee is escrowed already. If a signerFee is alreayd escrowed, there is no further TBTC requirement.
@@ -71,8 +71,9 @@ library DepositRedemption {
return 0;
}
if(_d.depositOwner() == msg.sender){
- if(_d.feeRebateTokenHolder() != msg.sender) {
- return _d.signerFee();
+ uint256 signerFee = _d.signerFee();
+ if(address(this).balance < signerFee) {
+ return signerFee;
}
return 0;
}
