Use .value() for value forwarding
With .value() we don't need a separate line to send value
and we can use msg.value normally in the called function
@@ -44,9 +44,13 @@ contract DepositFactory is CloneFactory{
uint256 _keepSize
) public payable returns(address) {
address cloneAddress = createClone(masterDepositAddress);
- Deposit(address(uint160(cloneAddress))).createNewDeposit(_TBTCSystem, _TBTCToken, _KeepBridge, _keepThreshold, _keepSize);
- address(uint160(cloneAddress)).transfer(msg.value);
+ Deposit(address(uint160(cloneAddress))).createNewDeposit.value(msg.value)(
+ _TBTCSystem,
+ _TBTCToken,
+ _KeepBridge,
+ _keepThreshold,
+ _keepSize);
TBTCSystem _system = TBTCSystem(_TBTCSystem);
_system.mint(msg.sender, uint256(cloneAddress));
