BridgeState

BridgeState

Storage

struct Storage {
  contract Bank bank;
  contract IRelay relay;
  uint96 txProofDifficultyFactor;
  contract IWalletRegistry ecdsaWalletRegistry;
  contract ReimbursementPool reimbursementPool;
  address treasury;
  bytes32 __treasuryAlignmentGap;
  uint64 depositDustThreshold;
  uint64 depositTreasuryFeeDivisor;
  uint64 depositTxMaxFee;
  uint32 depositRevealAheadPeriod;
  bytes32 __depositAlignmentGap;
  uint64 movingFundsTxMaxTotalFee;
  uint64 movingFundsDustThreshold;
  uint32 movingFundsTimeoutResetDelay;
  uint32 movingFundsTimeout;
  uint96 movingFundsTimeoutSlashingAmount;
  uint32 movingFundsTimeoutNotifierRewardMultiplier;
  uint16 movingFundsCommitmentGasOffset;
  bytes32 __movingFundsAlignmentGap;
  uint64 movedFundsSweepTxMaxTotalFee;
  uint32 movedFundsSweepTimeout;
  uint96 movedFundsSweepTimeoutSlashingAmount;
  uint32 movedFundsSweepTimeoutNotifierRewardMultiplier;
  uint64 redemptionDustThreshold;
  uint64 redemptionTreasuryFeeDivisor;
  uint64 redemptionTxMaxFee;
  uint64 redemptionTxMaxTotalFee;
  bytes32 __redemptionAlignmentGap;
  uint32 redemptionTimeout;
  uint96 redemptionTimeoutSlashingAmount;
  uint32 redemptionTimeoutNotifierRewardMultiplier;
  uint96 fraudChallengeDepositAmount;
  uint32 fraudChallengeDefeatTimeout;
  uint96 fraudSlashingAmount;
  uint32 fraudNotifierRewardMultiplier;
  uint32 walletCreationPeriod;
  uint64 walletCreationMinBtcBalance;
  uint64 walletCreationMaxBtcBalance;
  uint64 walletClosureMinBtcBalance;
  uint32 walletMaxAge;
  bytes20 activeWalletPubKeyHash;
  uint32 liveWalletsCount;
  uint64 walletMaxBtcTransfer;
  uint32 walletClosingPeriod;
  mapping(uint256 => struct Deposit.DepositRequest) deposits;
  mapping(address => bool) isVaultTrusted;
  mapping(address => bool) isSpvMaintainer;
  mapping(uint256 => struct MovingFunds.MovedFundsSweepRequest) movedFundsSweepRequests;
  mapping(uint256 => struct Redemption.RedemptionRequest) pendingRedemptions;
  mapping(uint256 => struct Redemption.RedemptionRequest) timedOutRedemptions;
  mapping(uint256 => struct Fraud.FraudChallenge) fraudChallenges;
  mapping(uint256 => bool) spentMainUTXOs;
  mapping(bytes20 => struct Wallets.Wallet) registeredWallets;
  uint256[50] __gap;
}

DepositParametersUpdated

event DepositParametersUpdated(uint64 depositDustThreshold, uint64 depositTreasuryFeeDivisor, uint64 depositTxMaxFee, uint32 depositRevealAheadPeriod)

RedemptionParametersUpdated

event RedemptionParametersUpdated(uint64 redemptionDustThreshold, uint64 redemptionTreasuryFeeDivisor, uint64 redemptionTxMaxFee, uint64 redemptionTxMaxTotalFee, uint32 redemptionTimeout, uint96 redemptionTimeoutSlashingAmount, uint32 redemptionTimeoutNotifierRewardMultiplier)

MovingFundsParametersUpdated

event MovingFundsParametersUpdated(uint64 movingFundsTxMaxTotalFee, uint64 movingFundsDustThreshold, uint32 movingFundsTimeoutResetDelay, uint32 movingFundsTimeout, uint96 movingFundsTimeoutSlashingAmount, uint32 movingFundsTimeoutNotifierRewardMultiplier, uint16 movingFundsCommitmentGasOffset, uint64 movedFundsSweepTxMaxTotalFee, uint32 movedFundsSweepTimeout, uint96 movedFundsSweepTimeoutSlashingAmount, uint32 movedFundsSweepTimeoutNotifierRewardMultiplier)

WalletParametersUpdated

event WalletParametersUpdated(uint32 walletCreationPeriod, uint64 walletCreationMinBtcBalance, uint64 walletCreationMaxBtcBalance, uint64 walletClosureMinBtcBalance, uint32 walletMaxAge, uint64 walletMaxBtcTransfer, uint32 walletClosingPeriod)

FraudParametersUpdated

event FraudParametersUpdated(uint96 fraudChallengeDepositAmount, uint32 fraudChallengeDefeatTimeout, uint96 fraudSlashingAmount, uint32 fraudNotifierRewardMultiplier)

TreasuryUpdated

event TreasuryUpdated(address treasury)

updateDepositParameters

function updateDepositParameters(struct BridgeState.Storage self, uint64 _depositDustThreshold, uint64 _depositTreasuryFeeDivisor, uint64 _depositTxMaxFee, uint32 _depositRevealAheadPeriod) internal

of depositTreasuryFeeDivisor and depositTxMaxFee parameters in order to make requests that can incur the treasury and transaction fee and still satisfy the depositor.

Requirements:

  • Deposit dust threshold must be greater than zero,

  • Deposit dust threshold must be greater than deposit TX max fee,

  • Deposit transaction max fee must be greater than zero.

Parameters

updateRedemptionParameters

function updateRedemptionParameters(struct BridgeState.Storage self, uint64 _redemptionDustThreshold, uint64 _redemptionTreasuryFeeDivisor, uint64 _redemptionTxMaxFee, uint64 _redemptionTxMaxTotalFee, uint32 _redemptionTimeout, uint96 _redemptionTimeoutSlashingAmount, uint32 _redemptionTimeoutNotifierRewardMultiplier) internal

Updates parameters of redemptions.

Requirements:

  • Redemption dust threshold must be greater than moving funds dust threshold,

  • Redemption dust threshold must be greater than the redemption TX max fee,

  • Redemption transaction max fee must be greater than zero,

  • Redemption transaction max total fee must be greater than or equal to the redemption transaction per-request max fee,

  • Redemption timeout must be greater than zero,

  • Redemption timeout notifier reward multiplier must be in the range [0, 100].

Parameters

updateMovingFundsParameters

function updateMovingFundsParameters(struct BridgeState.Storage self, uint64 _movingFundsTxMaxTotalFee, uint64 _movingFundsDustThreshold, uint32 _movingFundsTimeoutResetDelay, uint32 _movingFundsTimeout, uint96 _movingFundsTimeoutSlashingAmount, uint32 _movingFundsTimeoutNotifierRewardMultiplier, uint16 _movingFundsCommitmentGasOffset, uint64 _movedFundsSweepTxMaxTotalFee, uint32 _movedFundsSweepTimeout, uint96 _movedFundsSweepTimeoutSlashingAmount, uint32 _movedFundsSweepTimeoutNotifierRewardMultiplier) internal

Updates parameters of moving funds.

Requirements:

  • Moving funds transaction max total fee must be greater than zero,

  • Moving funds dust threshold must be greater than zero and lower than the redemption dust threshold,

  • Moving funds timeout reset delay must be greater than zero,

  • Moving funds timeout must be greater than the moving funds timeout reset delay,

  • Moving funds timeout notifier reward multiplier must be in the range [0, 100],

  • Moved funds sweep transaction max total fee must be greater than zero,

  • Moved funds sweep timeout must be greater than zero,

  • Moved funds sweep timeout notifier reward multiplier must be in the range [0, 100].

Parameters

updateWalletParameters

function updateWalletParameters(struct BridgeState.Storage self, uint32 _walletCreationPeriod, uint64 _walletCreationMinBtcBalance, uint64 _walletCreationMaxBtcBalance, uint64 _walletClosureMinBtcBalance, uint32 _walletMaxAge, uint64 _walletMaxBtcTransfer, uint32 _walletClosingPeriod) internal

Requirements:

  • Wallet maximum BTC balance must be greater than the wallet minimum BTC balance,

  • Wallet maximum BTC transfer must be greater than zero,

  • Wallet closing period must be greater than zero.

updateFraudParameters

function updateFraudParameters(struct BridgeState.Storage self, uint96 _fraudChallengeDepositAmount, uint32 _fraudChallengeDefeatTimeout, uint96 _fraudSlashingAmount, uint32 _fraudNotifierRewardMultiplier) internal

Updates parameters related to frauds.

Requirements:

  • Fraud challenge defeat timeout must be greater than 0,

  • Fraud notifier reward multiplier must be in the range [0, 100].

Parameters

updateTreasury

function updateTreasury(struct BridgeState.Storage self, address _treasury) internal

Updates treasury address. The treasury receives the system fees.

The treasury address must not be 0x0.

Parameters

Last updated