Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions contracts/src/factory/HyperdriveFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -679,14 +679,6 @@ contract HyperdriveFactory is IHyperdriveFactory {
);
}

// Refund any excess ether that was sent to this contract.
if (refund > 0) {
(bool success, ) = payable(msg.sender).call{ value: refund }("");
if (!success) {
revert IHyperdriveFactory.TransferFailed();
}
}

// Set the default pausers and transfer the governance status to the
// hyperdrive governance address.
for (uint256 i = 0; i < _defaultPausers.length; ) {
Expand All @@ -697,6 +689,14 @@ contract HyperdriveFactory is IHyperdriveFactory {
}
hyperdrive.setGovernance(hyperdriveGovernance);

// Refund any excess ether that was sent to this contract.
if (refund > 0) {
(bool success, ) = payable(msg.sender).call{ value: refund }("");
if (!success) {
revert IHyperdriveFactory.TransferFailed();
}
}

return hyperdrive;
}

Expand Down