BitcoinRedeemer
This contract facilitates redemption of stBTC tokens to Bitcoin through tBTC redemption process.
tbtcToken
Interface for tBTC token contract.
stbtc
stBTC token contract.
tbtcVault
Address of the TBTCVault contract.
TbtcVaultUpdated
Emitted when the TBTCVault contract address is updated.
Parameters
RedemptionRequested
Emitted when redemption is requested.
Parameters
TbtcTokenZeroAddress
Reverts if the tBTC Token address is zero.
StbtcZeroAddress
Reverts if the stBTC address is zero.
TbtcVaultZeroAddress
Reverts if the TBTCVault address is zero.
CallerNotAllowed
Attempted to call receiveApproval by supported token.
EmptyExtraData
Attempted to call receiveApproval with empty data.
UnexpectedTbtcTokenOwner
Attempted to call _redeemSharesAndUnmint with unexpected tBTC token owner.
RedeemerNotOwner
Reverts if the redeemer is not the deposit owner.
ApproveAndCallFailed
Reverts when approveAndCall to tBTC contract fails.
NotTbtcTokenOwner
Reverts if the new TBTCVault contract is not tBTC token owner.
constructor
initialize
Initializes the contract with tBTC token and stBTC token addresses.
Parameters
receiveApproval
Redeems shares for tBTC and requests bridging to Bitcoin.
Parameters
updateTbtcVault
Updates TBTCVault contract address.
Parameters
_redeemSharesAndUnmint
Initiates the redemption process by exchanging stBTC tokens for tBTC tokens and requesting bridging to Bitcoin.
Redeems stBTC shares to receive tBTC and requests redemption of tBTC to Bitcoin via tBTC Bridge. Redemption data in a format expected from redemptionData
parameter of Bridge's receiveBalanceApproval
. It uses tBTC token owner which is the TBTCVault contract as spender of tBTC requested for redemption. tBTC Bridge redemption process has a path where request can timeout. It is a scenario that is unlikely to happen with the current Bridge setup. This contract remains upgradable to have flexibility to handle adjustments to tBTC Bridge changes. Redemption data should include a redeemer
address matching the address of the deposit owner who is redeeming the shares. In case anything goes wrong during the tBTC unminting process, the redeemer will be able to claim the tBTC tokens back from the tBTC Bank contract.
Parameters
Last updated