IBridge.sol 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // SPDX-License-Identifier: Apache-2.0
  2. // OpenZeppelin Contracts (last updated v4.6.0) (vendor/arbitrum/IBridge.sol)
  3. /*
  4. * Copyright 2021, Offchain Labs, Inc.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. pragma solidity ^0.8.0;
  19. interface IBridge {
  20. event MessageDelivered(
  21. uint256 indexed messageIndex,
  22. bytes32 indexed beforeInboxAcc,
  23. address inbox,
  24. uint8 kind,
  25. address sender,
  26. bytes32 messageDataHash
  27. );
  28. event BridgeCallTriggered(address indexed outbox, address indexed destAddr, uint256 amount, bytes data);
  29. event InboxToggle(address indexed inbox, bool enabled);
  30. event OutboxToggle(address indexed outbox, bool enabled);
  31. function deliverMessageToInbox(
  32. uint8 kind,
  33. address sender,
  34. bytes32 messageDataHash
  35. ) external payable returns (uint256);
  36. function executeCall(
  37. address destAddr,
  38. uint256 amount,
  39. bytes calldata data
  40. ) external returns (bool success, bytes memory returnData);
  41. // These are only callable by the admin
  42. function setInbox(address inbox, bool enabled) external;
  43. function setOutbox(address inbox, bool enabled) external;
  44. // View functions
  45. function activeOutbox() external view returns (address);
  46. function allowedInboxes(address inbox) external view returns (bool);
  47. function allowedOutboxes(address outbox) external view returns (bool);
  48. function inboxAccs(uint256 index) external view returns (bytes32);
  49. function messageCount() external view returns (uint256);
  50. }