Bridge
Inherits: ERC2771Recipient
State Variables
number
uint256 public number;
collateralThreshold
uint256 public collateralThreshold;
nextOrderId
uint256 nextOrderId;
orders
mapping(uint256 => Order) public orders;
suppliedCollateral
mapping(address => uint256) public suppliedCollateral;
totalCollateral
uint256 totalCollateral;
wrapped
BobWrappedBtc wrapped = new BobWrappedBtc();
Functions
constructor
constructor(uint256 threshold);
mint
lock COL in exchange for zBTC and cCOL
function mint() public payable;
requestSwap
request zBTC to be redeemed for given amount of BTC.
function requestSwap(uint256 amountZbtc, uint256 amountBtc, BitcoinAddress calldata bitcoinAddress) public;
acceptSwap
function acceptSwap(uint256 id) public;
cancelSwap
function cancelSwap(uint256 id) public;
executeSwap
function executeSwap(uint256 id, TransactionProof calldata) public;
liquidate
function liquidate(uint256 amountZbtc) public;
withdraw
function withdraw() public;
colToBtc
function colToBtc(uint256 collateral) internal pure returns (uint256);
btcToCol
function btcToCol(uint256 collateral) internal pure returns (uint256);
Structs
Order
struct Order {
bool open;
uint256 amountZbtc;
uint256 amountBtc;
address requesterAddress;
address accepterAddress;
BitcoinAddress bitcoinAddress;
}
BitcoinAddress
struct BitcoinAddress {
bytes scriptPubKey;
}
TransactionProof
struct TransactionProof {
uint256 dummy;
}