|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity 0.8.25; |
| 3 | + |
| 4 | +import {Quotes} from "../libraries/Quotes.sol"; |
| 5 | + |
| 6 | +interface IPegIn { |
| 7 | + enum PegInStates { UNPROCESSED_QUOTE, CALL_DONE, PROCESSED_QUOTE } |
| 8 | + |
| 9 | + event BalanceIncrease(address indexed dest, uint256 indexed amount); |
| 10 | + event BalanceDecrease(address indexed dest, uint256 indexed amount); |
| 11 | + event Withdrawal(address indexed from, uint256 indexed amount); |
| 12 | + event BridgeCapExceeded(bytes32 indexed quoteHash, int256 indexed errorCode); |
| 13 | + event PegInRegistered(bytes32 indexed quoteHash, uint256 indexed transferredAmount); |
| 14 | + event Refund(address indexed dest, bytes32 indexed quoteHash, uint indexed amount, bool success); |
| 15 | + event CallForUser( |
| 16 | + address indexed from, |
| 17 | + address indexed dest, |
| 18 | + bytes32 indexed quoteHash, |
| 19 | + uint gasLimit, |
| 20 | + uint value, |
| 21 | + bytes data, |
| 22 | + bool success |
| 23 | + ); |
| 24 | + |
| 25 | + error InvalidRefundAddress(bytes refundAddress); |
| 26 | + error AmountUnderMinimum(uint256 amount); |
| 27 | + error QuoteAlreadyProcessed(bytes32 quoteHash); |
| 28 | + error InsufficientGas(uint256 gasLeft, uint256 gasRequired); |
| 29 | + error NotEnoughConfirmations(); |
| 30 | + error UnexpectedBridgeError(int256 errorCode); |
| 31 | + |
| 32 | + function deposit() external payable; |
| 33 | + function callForUser(Quotes.PegInQuote calldata quote) external payable returns (bool); |
| 34 | + function withdraw(uint256 amount) external; |
| 35 | + function registerPegIn( |
| 36 | + Quotes.PegInQuote calldata quote, |
| 37 | + bytes calldata signature, |
| 38 | + bytes calldata btcRawTransaction, |
| 39 | + bytes calldata partialMerkleTree, |
| 40 | + uint256 height |
| 41 | + ) external returns (int256); |
| 42 | + function getBalance(address addr) external view returns (uint256); |
| 43 | + function validatePegInDepositAddress( |
| 44 | + Quotes.PegInQuote calldata quote, |
| 45 | + bytes calldata depositAddress |
| 46 | + ) external view returns (bool); |
| 47 | + function hashPegInQuote(Quotes.PegInQuote calldata quote) external view returns (bytes32); |
| 48 | +} |
0 commit comments