all files / contracts/interfaces/ iSequencerHandler.sol

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86                                                                                                                                                                           
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
 
/**
    @title Interface for handler that handles sequencer deposits and deposit executions.
    @author Router Protocol.
 */
interface iSequencerHandler {
  struct RouterLinker {
    address _rSyncContract;
    uint8 _chainID;
    address _linkedContract;
  }
 
  /// @notice Function fired to trigger Cross Chain Communication.
  /// @dev Used to transact generic calls as well as ERC20 cross-chain calls at once.
  /// @dev Can only be used when the contract is not paused and the dest chain is not unsupported.
  /// @dev Only callable by crosstalk contracts on supported chains and only when contract is not paused.
  /// @param _destChainID chainId of the destination chain defined by Router Protocol.
  /// @param _erc20 data regarding the transaction for erc20.
  /// @param _swapData data regarding the swapDetails for erc20 transaction.
  /// @param _generic data for generic cross-chain call.
  /// @param _gasLimit gas limit for the call.
  /// @param _gasPrice gas price for the call.
  /// @param _feeToken fee token for payment of fees.
  /// @param _isTransferFirst sequence for erc20 and generic call. True for prioritizing erc20 over generic call.
  function genericDepositWithERC(
    uint8 _destChainID,
    bytes memory _erc20,
    bytes calldata _swapData,
    bytes memory _generic,
    uint256 _gasLimit,
    uint256 _gasPrice,
    address _feeToken,
    bool _isTransferFirst
  ) external returns (uint64);
 
    /// @notice Function fired to trigger Cross Chain Communication.
    /// @dev Used to transact generic calls.
    /// @dev Can only be used when the contract is not paused and the dest chain is not unsupported.
    /// @dev Only callable by crosstalk contracts on supported chains and only when contract is not paused.
    /// @param _destChainID chainId of the destination chain defined by Router Protocol.
    /// @param _generic data for generic cross-chain call.
    /// @param _gasLimit gas limit for the call.
    /// @param _gasPrice gas price for the call.
    /// @param _feeToken fee token for payment of fees.
    function genericDeposit(
        uint8 _destChainID,
        bytes memory _generic,
        uint256 _gasLimit,
        uint256 _gasPrice,
        address _feeToken
    ) external returns (uint64);
 
 
  /// @notice Function Executes a cross chain request on destination chain.
  /// @dev Can only be triggered by bridge.
  /// @param  _data Cross chain data recived from relayer consisting of the deposit record.
  function executeProposal(bytes calldata _data) external returns (bool);
 
  /// @notice UnMapContract Unmaps the contract from the RouterCrossTalk Contract
  /// @dev This function is used to map contract from router-crosstalk contract
  /// @param linker The Data object consisting of target Contract , CHainid , Contract to be Mapped and linker type.
  function MapContract(RouterLinker calldata linker) external;
 
  /// @notice UnMapContract Unmaps the contract from the RouterCrossTalk Contract
  /// @dev This function is used to unmap contract from router-crosstalk contract
  /// @param linker The Data object consisting of target Contract , CHainid , Contract to be unMapped and linker type.
  function UnMapContract(RouterLinker calldata linker) external;
 
  /// @notice Fetches chainID for the native chain
  function fetch_chainID() external view returns (uint8);
 
  /// @notice Function to replay a transaction which was stuck due to underpricing of gas.
  /// @param  _destChainID Destination ChainID
  /// @param  _depositNonce Nonce for the transaction.
  /// @param  _gasLimit Gas limit allowed for the transaction.
  /// @param  _gasPrice Gas Price for the transaction.
  function replayDeposit(
    uint8 _destChainID,
    uint64 _depositNonce,
    uint256 _gasLimit,
    uint256 _gasPrice
  ) external;
}