Skip to content

Commit

Permalink
Merge pull request #193 from rsksmart/feature/GBI-1578
Browse files Browse the repository at this point in the history
Feature/GBI-1578 - Avoid fee collector tx on 0 product fee
  • Loading branch information
MaximStanciu8 committed Jan 3, 2024
2 parents 3570c9d + dc6dd34 commit 5e137b1
Show file tree
Hide file tree
Showing 10 changed files with 193 additions and 337 deletions.
179 changes: 0 additions & 179 deletions contracts/BtcUtils.sol

This file was deleted.

6 changes: 3 additions & 3 deletions contracts/LiquidityBridgeContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma experimental ABIEncoderV2;
import "./Bridge.sol";
import "./Quotes.sol";
import "./SignatureValidator.sol";
import "./BtcUtils.sol";
import "@rsksmart/btc-transaction-solidity-helper/contracts/BtcUtils.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";

Expand Down Expand Up @@ -749,7 +749,7 @@ contract LiquidityBridgeContract is Initializable, OwnableUpgradeable, Reentranc
Quotes.PegOutQuote storage quote = registeredPegoutQuotes[quoteHash];
require(quote.lbcAddress != address(0), "LBC042");
BtcUtils.TxRawOutput[] memory outputs = BtcUtils.getOutputs(btcTx);
bytes32 txQuoteHash = abi.decode(BtcUtils.parseOpReturnOuput(outputs[QUOTE_HASH_OUTPUT].pkScript), (bytes32));
bytes32 txQuoteHash = abi.decode(BtcUtils.parseNullDataScript(outputs[QUOTE_HASH_OUTPUT].pkScript), (bytes32));
require(quoteHash == txQuoteHash, "LBC069");
require(msg.sender == quote.lpRskAddress, "LBC048");
require(
Expand All @@ -762,7 +762,7 @@ contract LiquidityBridgeContract is Initializable, OwnableUpgradeable, Reentranc
"LBC049"
);
require(quote.value <= outputs[PAY_TO_ADDRESS_OUTPUT].value * (10**10), "LBC067"); // satoshi to wei
bytes memory btcTxDestination = BtcUtils.parsePayToAddressScript(outputs[PAY_TO_ADDRESS_OUTPUT]
bytes memory btcTxDestination = BtcUtils.parsePayToPubKeyHash(outputs[PAY_TO_ADDRESS_OUTPUT]
.pkScript, mainnet);
require(keccak256(quote.deposityAddress) == keccak256(btcTxDestination), "LBC068");

Expand Down
Loading

0 comments on commit 5e137b1

Please sign in to comment.