Skip to content

Commit d8283e5

Browse files
committed
cleanup
1 parent 4f3789e commit d8283e5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/SovaBTC.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ contract SovaBTC is ISovaBTC, UBTC20, Ownable, ReentrancyGuard {
6363
event WithdrawSignaled(
6464
address indexed user, uint256 amount, uint64 btcGasBid, uint64 operatorFee, string destination
6565
);
66-
event Withdraw(address user, bytes32 txid);
66+
event Withdraw(address user, bytes32 txid, uint256 totalAmount);
6767
event MinDepositAmountUpdated(uint64 oldAmount, uint64 newAmount);
6868
event MaxDepositAmountUpdated(uint64 oldAmount, uint64 newAmount);
6969
event MaxGasLimitAmountUpdated(uint64 oldAmount, uint64 newAmount);
@@ -247,20 +247,20 @@ contract SovaBTC is ISovaBTC, UBTC20, Ownable, ReentrancyGuard {
247247
// decode signed tx so that we know it is a valid bitcoin tx
248248
SovaBitcoin.BitcoinTx memory btcTx = SovaBitcoin.decodeBitcoinTx(signedTx);
249249

250-
uint256 totalRequired = amount + uint256(btcGasLimit) + uint256(operatorFee);
250+
uint256 totalAmount = amount + uint256(btcGasLimit) + uint256(operatorFee);
251251

252-
if (balanceOf(user) < totalRequired) revert InsufficientAmount();
252+
if (balanceOf(user) < totalAmount) revert InsufficientAmount();
253253

254254
// Track pending withdrawal
255-
_setPendingWithdrawal(user, totalRequired);
255+
_setPendingWithdrawal(user, totalAmount);
256256

257257
// Clear the withdraw request
258258
delete _pendingUserWithdrawRequests[user];
259259

260260
// Broadcast the signed BTC tx
261261
SovaBitcoin.broadcastBitcoinTx(signedTx);
262262

263-
emit Withdraw(user, btcTx.txid);
263+
emit Withdraw(user, btcTx.txid, totalAmount);
264264
}
265265

266266
/// Admin

0 commit comments

Comments
 (0)