LogoLogo
Threshold WebsitetBTC v2 DocsTACo Docs
  • What is the Threshold Network?
  • THRESHOLD DASHBOARD
    • tBTC Minting Walkthrough
  • Applications
    • tBTC Bitcoin Bridge
      • Fees
      • Wallet Generation
      • Wallet Signing
      • The Path to Permissionlessness
      • Sweeping
      • Coverage Pool
    • Threshold USD
      • Overview of thUSD
      • Borrowing
      • Stability Pool and Liquidations
      • Redemptions and thUSD Price Stability
      • Recovery Mode
      • Bootstrapping
        • Initial Protocol Loan
      • B. Protocol
      • thUSD on Build on Bitcoin (BOB)
        • Connecting to BOB Network
        • Bridging Collateral to BOB Network
        • Opening Collateral Vaults and Minting thUSD
  • Governance
    • Threshold DAO
      • 🗳️Governance Process
      • 🙋‍♀️Guilds
      • 💰Threshold Multisigs
      • Threshold DAO Rules
    • Vote Delegation
      • Liquid Token Delegation
  • Staking & Running a Node
    • tBTC v2 Node Setup
      • Operator Account
      • Application Authorization & Operator Registration
      • Network Configuration
      • Data Storage
      • Installation
        • Docker Installation
        • Binary Installation
      • Updating tBTC v2 Node
      • Advanced Options
        • Alternatives to Dashboard
        • Logging
        • Config File
        • CLI Options
        • Client Info
      • Frequently Asked Questions
      • Sepolia Testnet
        • Testnet tBTC v2 node Setup
    • tBTC Beta Stakers Program
  • App Development
    • DAO Contracts
      • DAO Contracts API
        • BaseTokenholderGovernor
        • Checkpoints
        • GovernorParameters
        • IApplication
        • ILegacyTokenStaking
        • IStaking
        • IVotesHistory
        • KeepStake
        • PercentUtils
        • ProxyAdminWithDeputy
        • SafeTUpgradeable
        • StakerGovernor
        • StakerGovernorVotes
        • T
        • TokenholderGovernor
        • TokenholderGovernorVotes
        • TokenStaking
        • VendingMachine
    • Random Beacon
      • Random Beacon API
        • AltBn128
        • BeaconAuthorization
        • BeaconDkg
        • BeaconDkgValidator
        • BeaconInactivity
        • BLS
        • BytesLib
        • Callback
        • Governable
        • Groups
        • IRandomBeacon
        • IRandomBeaconConsumer
        • ModUtils
        • RandomBeacon
        • RandomBeaconChaosnet
        • RandomBeaconGovernance
        • Reimbursable
        • ReimbursementPool
        • Relay
    • tBTC
      • tBTC SDK
        • Quickstart
        • Architecture
        • Guides
          • Initialize SDK
            • Ethereum and Bitcoin mainnet
            • Ethereum and Bitcoin testnet
            • Crosschain
            • Custom mode
          • Deposit and mint
          • Unmint and redeem
        • API Reference
      • tBTC Contracts API
        • Bridge API
          • Bank
          • BitcoinTx
          • Bridge
          • BridgeGovernance
          • BridgeGovernanceParameters
          • BridgeState
          • Deposit
          • DepositSweep
          • DonationVault
          • EcdsaLib
          • Fraud
          • GovernanceUtils
          • Heartbeat
          • IReceiveBalanceApproval
          • IRelay
          • IVault
          • L2TBTC
          • L2WormholeGateway
          • LightRelay
          • LightRelayMaintainerProxy
          • MaintainerProxy
          • MovingFunds
          • Redemption
          • TBTC
          • TBTCOptimisticMinting
          • TBTCVault
          • VendingMachine
          • VendingMachineV2
          • VendingMachineV3
          • WalletCoordinator
          • Wallets
        • ECDSA API
          • EcdsaAuthorization
          • EcdsaDkg
          • EcdsaDkgValidator
          • EcdsaInactivity
          • IWalletOwner
          • IWalletRegistry
          • WalletRegistry
          • WalletRegistryGovernance
          • Wallets
  • Resources
    • T Token
    • Contract Addresses
      • Mainnet
        • Threshold DAO
        • tBTC
        • thUSD
        • Legacy
      • Görli Testnet
      • Sepolia Testnet
    • tBTC Pools
    • Upgrade NU & KEEP to T
    • Contribution
    • Security
    • Brand Assets
    • Links
Powered by GitBook
On this page
  • ReimbursementPool
  • isAuthorized
  • staticGas
  • maxGasPrice
  • StaticGasUpdated
  • MaxGasPriceUpdated
  • SendingEtherFailed
  • AuthorizedContract
  • UnauthorizedContract
  • FundsWithdrawn
  • constructor
  • receive
  • refund
  • authorize
  • unauthorize
  • setStaticGas
  • setMaxGasPrice
  • withdrawAll
  • withdraw

Was this helpful?

Export as PDF
  1. App Development
  2. Random Beacon
  3. Random Beacon API

ReimbursementPool

ReimbursementPool

This file documents a contract which is not yet deployed to Mainnet.

isAuthorized

mapping(address => bool) isAuthorized

Authorized contracts that can interact with the reimbursment pool. Authorization can be granted and removed by the owner.

staticGas

uint256 staticGas

Static gas includes:

  • cost of the refund function

  • base transaction cost

maxGasPrice

uint256 maxGasPrice

Max gas price used to reimburse a transaction submitter. Protects against malicious operator-miners.

StaticGasUpdated

event StaticGasUpdated(uint256 newStaticGas)

MaxGasPriceUpdated

event MaxGasPriceUpdated(uint256 newMaxGasPrice)

SendingEtherFailed

event SendingEtherFailed(uint256 refundAmount, address receiver)

AuthorizedContract

event AuthorizedContract(address thirdPartyContract)

UnauthorizedContract

event UnauthorizedContract(address thirdPartyContract)

FundsWithdrawn

event FundsWithdrawn(uint256 withdrawnAmount, address receiver)

constructor

constructor(uint256 _staticGas, uint256 _maxGasPrice) public

receive

receive() external payable

Receive ETH

refund

function refund(uint256 gasSpent, address receiver) external

Refunds ETH to a spender for executing specific transactions.

Ignoring the result of sending ETH to a receiver is made on purpose. For EOA receiving ETH should always work. If a receiver is a smart contract, then we do not want to fail a transaction, because in some cases the refund is done at the very end of multiple calls where all the previous calls were already paid off. It is a receiver's smart contract resposibility to make sure it can receive ETH. Only authorized contracts are allowed calling this function.

Parameters

Name
Type
Description

gasSpent

uint256

Gas spent on a transaction that needs to be reimbursed.

receiver

address

Address where the reimbursment is sent.

authorize

function authorize(address _contract) external

Authorize a contract that can interact with this reimbursment pool. Can be authorized by the owner only.

Parameters

Name
Type
Description

_contract

address

Authorized contract.

unauthorize

function unauthorize(address _contract) external

Unauthorize a contract that was previously authorized to interact with this reimbursment pool. Can be unauthorized by the owner only.

Parameters

Name
Type
Description

_contract

address

Authorized contract.

setStaticGas

function setStaticGas(uint256 _staticGas) external

Setting a static gas cost for executing a transaction. Can be set by the owner only.

Parameters

Name
Type
Description

_staticGas

uint256

Static gas cost.

setMaxGasPrice

function setMaxGasPrice(uint256 _maxGasPrice) external

Setting a max gas price for transactions. Can be set by the owner only.

Parameters

Name
Type
Description

_maxGasPrice

uint256

Max gas price used to reimburse tx submitters.

withdrawAll

function withdrawAll(address receiver) external

Withdraws all ETH from this pool which are sent to a given address. Can be set by the owner only.

Parameters

Name
Type
Description

receiver

address

An address where ETH is sent.

withdraw

function withdraw(uint256 amount, address receiver) public

Withdraws ETH amount from this pool which are sent to a given address. Can be set by the owner only.

Parameters

Name
Type
Description

amount

uint256

Amount to withdraw from the pool.

receiver

address

An address where ETH is sent.

PreviousReimbursableNextRelay

Last updated 1 year ago

Was this helpful?