Update code style and docs for mintTBTC
@@ -95,13 +95,20 @@ library DepositFunding {
}
}
- /// @dev Mints TBTC to the beneficiary and a small percentage to the Deposit contract
- function _mintTBTC(DepositUtils.Deposit storage _d) internal {
+ /// @notice Mints TBTC tokens.
+ /// @dev Minted value is based on a configured lot size. The lot size,
+ /// which is specified in satoshi is multiplied to match TBTC token unit.
+ /// Minted tokens are split between the beneficiary (99,5%) and the deposit
+ /// contract (0,5%).
+ function mintTBTC(DepositUtils.Deposit storage _d) internal {
TBTCToken _tbtc = TBTCToken(_d.TBTCToken);
+
uint256 _multiplier = TBTCConstants.getSatoshiMultiplier();
- uint256 _value = TBTCConstants.getLotSize().mul(_multiplier);
uint256 _signerFee = DepositUtils.signerFee();
- _tbtc.mint(_d.depositBeneficiary(), _value.sub(_signerFee));
+
+ uint256 _totalValue = TBTCConstants.getLotSize().mul(_multiplier);
+
+ _tbtc.mint(_d.depositBeneficiary(), _totalValue.sub(_signerFee));
_tbtc.mint(address(this), _signerFee);
}
@@ -337,7 +344,9 @@ library DepositFunding {
_d.logFunded();
returnFunderBond(_d);
- _mintTBTC(_d);
+
+ mintTBTC(_d);
+
return true;
}
}
