Skip to content

Commit

Permalink
Make deposit dust threshold configurable in MockBridge
Browse files Browse the repository at this point in the history
Integrators using the MockBridge contract implementation may be
interested in configuring the deposit dust threshold, to test their
implementation.
  • Loading branch information
nkuba committed Feb 16, 2024
1 parent e3c317e commit 866122d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions solidity/contracts/test/TestTBTCDepositor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ contract MockBridge is IBridge {

mapping(uint256 => IBridgeTypes.DepositRequest) internal _deposits;

uint64 internal _depositDustThreshold = 1000000; // 1000000 satoshi = 0.01 BTC
uint64 internal _depositTreasuryFeeDivisor = 50; // 1/50 == 100 bps == 2% == 0.02
uint64 internal _depositTxMaxFee = 1000; // 1000 satoshi = 0.00001 BTC

Expand Down Expand Up @@ -137,12 +138,16 @@ contract MockBridge is IBridge {
uint32 depositRevealAheadPeriod
)
{
depositDustThreshold = 0;
depositTreasuryFeeDivisor = 0;
depositDustThreshold = _depositDustThreshold;
depositTreasuryFeeDivisor = _depositTreasuryFeeDivisor;
depositTxMaxFee = _depositTxMaxFee;
depositRevealAheadPeriod = 0;
}

function setDepositDustThreshold(uint64 value) external {
_depositDustThreshold = value;
}

function setDepositTreasuryFeeDivisor(uint64 value) external {
_depositTreasuryFeeDivisor = value;
}
Expand Down

0 comments on commit 866122d

Please sign in to comment.