@across-protocol/contracts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/LICENSE +661 -0
  3. package/README.md +53 -0
  4. package/artifacts/@eth-optimism/contracts/L2/messaging/IL2ERC20Bridge.sol/IL2ERC20Bridge.dbg.json +4 -0
  5. package/artifacts/@eth-optimism/contracts/L2/messaging/IL2ERC20Bridge.sol/IL2ERC20Bridge.json +252 -0
  6. package/artifacts/@eth-optimism/contracts/libraries/bridge/CrossDomainEnabled.sol/CrossDomainEnabled.dbg.json +4 -0
  7. package/artifacts/@eth-optimism/contracts/libraries/bridge/CrossDomainEnabled.sol/CrossDomainEnabled.json +35 -0
  8. package/artifacts/@eth-optimism/contracts/libraries/bridge/ICrossDomainMessenger.sol/ICrossDomainMessenger.dbg.json +4 -0
  9. package/artifacts/@eth-optimism/contracts/libraries/bridge/ICrossDomainMessenger.sol/ICrossDomainMessenger.json +110 -0
  10. package/artifacts/@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol/Lib_PredeployAddresses.dbg.json +4 -0
  11. package/artifacts/@eth-optimism/contracts/libraries/constants/Lib_PredeployAddresses.sol/Lib_PredeployAddresses.json +10 -0
  12. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +4 -0
  13. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +215 -0
  14. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/IAccessControl.dbg.json +4 -0
  15. package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/IAccessControl.json +108 -0
  16. package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +4 -0
  17. package/artifacts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json +63 -0
  18. package/artifacts/@openzeppelin/contracts/security/Pausable.sol/Pausable.dbg.json +4 -0
  19. package/artifacts/@openzeppelin/contracts/security/Pausable.sol/Pausable.json +50 -0
  20. package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +4 -0
  21. package/artifacts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.json +297 -0
  22. package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +4 -0
  23. package/artifacts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.json +194 -0
  24. package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +4 -0
  25. package/artifacts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.json +233 -0
  26. package/artifacts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +4 -0
  27. package/artifacts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.json +10 -0
  28. package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +4 -0
  29. package/artifacts/@openzeppelin/contracts/utils/Address.sol/Address.json +10 -0
  30. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
  31. package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
  32. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
  33. package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +10 -0
  34. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
  35. package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
  36. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
  37. package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
  38. package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.dbg.json +4 -0
  39. package/artifacts/@openzeppelin/contracts/utils/math/SafeMath.sol/SafeMath.json +10 -0
  40. package/artifacts/@openzeppelin/contracts/utils/math/SignedSafeMath.sol/SignedSafeMath.dbg.json +4 -0
  41. package/artifacts/@openzeppelin/contracts/utils/math/SignedSafeMath.sol/SignedSafeMath.json +10 -0
  42. package/artifacts/@uma/core/contracts/common/implementation/Lockable.sol/Lockable.dbg.json +4 -0
  43. package/artifacts/@uma/core/contracts/common/implementation/Lockable.sol/Lockable.json +16 -0
  44. package/artifacts/@uma/core/contracts/cross-chain-oracle/chain-adapters/Arbitrum_ParentMessenger.sol/Arbitrum_ParentMessenger.dbg.json +4 -0
  45. package/artifacts/@uma/core/contracts/cross-chain-oracle/chain-adapters/Arbitrum_ParentMessenger.sol/Arbitrum_ParentMessenger.json +611 -0
  46. package/artifacts/@uma/core/contracts/cross-chain-oracle/chain-adapters/ParentMessengerBase.sol/ParentMessengerBase.dbg.json +4 -0
  47. package/artifacts/@uma/core/contracts/cross-chain-oracle/chain-adapters/ParentMessengerBase.sol/ParentMessengerBase.json +297 -0
  48. package/artifacts/@uma/core/contracts/cross-chain-oracle/interfaces/ParentMessengerConsumerInterface.sol/ParentMessengerConsumerInterface.dbg.json +4 -0
  49. package/artifacts/@uma/core/contracts/cross-chain-oracle/interfaces/ParentMessengerConsumerInterface.sol/ParentMessengerConsumerInterface.json +29 -0
  50. package/artifacts/@uma/core/contracts/cross-chain-oracle/interfaces/ParentMessengerInterface.sol/ParentMessengerInterface.dbg.json +4 -0
  51. package/artifacts/@uma/core/contracts/cross-chain-oracle/interfaces/ParentMessengerInterface.sol/ParentMessengerInterface.json +37 -0
  52. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/IBridge.dbg.json +4 -0
  53. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/IBridge.json +24 -0
  54. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/iArbitrum_Inbox.dbg.json +4 -0
  55. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/iArbitrum_Inbox.json +78 -0
  56. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Outbox.sol/iArbitrum_Outbox.dbg.json +4 -0
  57. package/artifacts/@uma/core/contracts/external/avm/interfaces/iArbitrum_Outbox.sol/iArbitrum_Outbox.json +24 -0
  58. package/artifacts/@uma/core/contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol/Arbitrum_CrossDomainEnabled.dbg.json +4 -0
  59. package/artifacts/@uma/core/contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol/Arbitrum_CrossDomainEnabled.json +24 -0
  60. package/artifacts/build-info/1cd64db7a8ac0a153df93d26826ad4e9.json +1653 -0
  61. package/artifacts/build-info/1f738b56edd7602183f2f8d2f23f6e90.json +1592 -0
  62. package/artifacts/build-info/343b9221be36acd9ddaca3f3b83d2e75.json +3943 -0
  63. package/artifacts/build-info/622e561692c193f4cd0ff989b5a231e2.json +5661 -0
  64. package/artifacts/build-info/8e408b49e0ff2873bc28d45221a7ff71.json +277715 -0
  65. package/artifacts/build-info/9d1a3182633612bd337d811d567d5d60.json +2072 -0
  66. package/artifacts/build-info/a8cd9c443d245fe513d6650634b60f93.json +23776 -0
  67. package/artifacts/build-info/d302d9d63fbafb5c8d635cc62cb1cc7c.json +167529 -0
  68. package/artifacts/contracts/common/implementation/AncillaryData.sol/AncillaryData.dbg.json +4 -0
  69. package/artifacts/contracts/common/implementation/AncillaryData.sol/AncillaryData.json +10 -0
  70. package/artifacts/contracts/common/implementation/FixedPoint.sol/FixedPoint.dbg.json +4 -0
  71. package/artifacts/contracts/common/implementation/FixedPoint.sol/FixedPoint.json +10 -0
  72. package/artifacts/contracts/common/implementation/Lockable.sol/Lockable.dbg.json +4 -0
  73. package/artifacts/contracts/common/implementation/Lockable.sol/Lockable.json +16 -0
  74. package/artifacts/contracts/common/implementation/MultiCaller.sol/MultiCaller.dbg.json +4 -0
  75. package/artifacts/contracts/common/implementation/MultiCaller.sol/MultiCaller.json +30 -0
  76. package/artifacts/contracts/common/implementation/Testable.sol/Testable.dbg.json +4 -0
  77. package/artifacts/contracts/common/implementation/Testable.sol/Testable.json +50 -0
  78. package/artifacts/contracts/common/implementation/Timer.sol/Timer.dbg.json +4 -0
  79. package/artifacts/contracts/common/implementation/Timer.sol/Timer.json +42 -0
  80. package/artifacts/contracts/common/interfaces/AddressWhitelistInterface.sol/AddressWhitelistInterface.dbg.json +4 -0
  81. package/artifacts/contracts/common/interfaces/AddressWhitelistInterface.sol/AddressWhitelistInterface.json +69 -0
  82. package/artifacts/contracts/external/avm/AVM_CrossDomainEnabled.sol/AVM_CrossDomainEnabled.dbg.json +4 -0
  83. package/artifacts/contracts/external/avm/AVM_CrossDomainEnabled.sol/AVM_CrossDomainEnabled.json +42 -0
  84. package/artifacts/contracts/external/avm/interfaces/ArbSys.sol/ArbSys.dbg.json +4 -0
  85. package/artifacts/contracts/external/avm/interfaces/ArbSys.sol/ArbSys.json +235 -0
  86. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/IBridge.dbg.json +4 -0
  87. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/IBridge.json +24 -0
  88. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/iArbitrum_Inbox.dbg.json +4 -0
  89. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Inbox.sol/iArbitrum_Inbox.json +78 -0
  90. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Outbox.sol/iArbitrum_Outbox.dbg.json +4 -0
  91. package/artifacts/contracts/external/avm/interfaces/iArbitrum_Outbox.sol/iArbitrum_Outbox.json +24 -0
  92. package/artifacts/contracts/external/chainbridge/Bridge.sol/Bridge.dbg.json +4 -0
  93. package/artifacts/contracts/external/chainbridge/Bridge.sol/Bridge.json +1019 -0
  94. package/artifacts/contracts/external/chainbridge/handlers/GenericHandler.sol/GenericHandler.dbg.json +4 -0
  95. package/artifacts/contracts/external/chainbridge/handlers/GenericHandler.sol/GenericHandler.json +314 -0
  96. package/artifacts/contracts/external/chainbridge/interfaces/IBridge.sol/IBridge.dbg.json +4 -0
  97. package/artifacts/contracts/external/chainbridge/interfaces/IBridge.sol/IBridge.json +47 -0
  98. package/artifacts/contracts/external/chainbridge/interfaces/IDepositExecute.sol/IDepositExecute.dbg.json +4 -0
  99. package/artifacts/contracts/external/chainbridge/interfaces/IDepositExecute.sol/IDepositExecute.json +62 -0
  100. package/artifacts/contracts/external/chainbridge/interfaces/IERCHandler.sol/IERCHandler.dbg.json +4 -0
  101. package/artifacts/contracts/external/chainbridge/interfaces/IERCHandler.sol/IERCHandler.json +65 -0
  102. package/artifacts/contracts/external/chainbridge/interfaces/IGenericHandler.sol/IGenericHandler.dbg.json +4 -0
  103. package/artifacts/contracts/external/chainbridge/interfaces/IGenericHandler.sol/IGenericHandler.json +39 -0
  104. package/artifacts/contracts/external/ovm/OVM_CrossDomainEnabled.sol/OVM_CrossDomainEnabled.dbg.json +4 -0
  105. package/artifacts/contracts/external/ovm/OVM_CrossDomainEnabled.sol/OVM_CrossDomainEnabled.json +35 -0
  106. package/artifacts/contracts/external/ovm/OVM_CrossDomainEnabled.sol/iOVM_CrossDomainMessenger.dbg.json +4 -0
  107. package/artifacts/contracts/external/ovm/OVM_CrossDomainEnabled.sol/iOVM_CrossDomainMessenger.json +86 -0
  108. package/artifacts/contracts/external/polygon/lib/Merkle.sol/Merkle.dbg.json +4 -0
  109. package/artifacts/contracts/external/polygon/lib/Merkle.sol/Merkle.json +10 -0
  110. package/artifacts/contracts/external/polygon/lib/MerklePatriciaProof.sol/MerklePatriciaProof.dbg.json +4 -0
  111. package/artifacts/contracts/external/polygon/lib/MerklePatriciaProof.sol/MerklePatriciaProof.json +10 -0
  112. package/artifacts/contracts/external/polygon/lib/RLPReader.sol/RLPReader.dbg.json +4 -0
  113. package/artifacts/contracts/external/polygon/lib/RLPReader.sol/RLPReader.json +10 -0
  114. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/FxChildMock.dbg.json +4 -0
  115. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/FxChildMock.json +104 -0
  116. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/IFxMessageProcessor.dbg.json +4 -0
  117. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/IFxMessageProcessor.json +34 -0
  118. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/IStateReceiver.dbg.json +4 -0
  119. package/artifacts/contracts/external/polygon/test/FxChildMock.sol/IStateReceiver.json +29 -0
  120. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/FxRootMock.dbg.json +4 -0
  121. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/FxRootMock.json +79 -0
  122. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/IFxStateSender.dbg.json +4 -0
  123. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/IFxStateSender.json +29 -0
  124. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/IStateSender.dbg.json +4 -0
  125. package/artifacts/contracts/external/polygon/test/FxRootMock.sol/IStateSender.json +29 -0
  126. package/artifacts/contracts/external/polygon/test/StateSyncMock.sol/StateSyncMock.dbg.json +4 -0
  127. package/artifacts/contracts/external/polygon/test/StateSyncMock.sol/StateSyncMock.json +54 -0
  128. package/artifacts/contracts/external/polygon/tunnel/FxBaseChildTunnel.sol/FxBaseChildTunnel.dbg.json +4 -0
  129. package/artifacts/contracts/external/polygon/tunnel/FxBaseChildTunnel.sol/FxBaseChildTunnel.json +86 -0
  130. package/artifacts/contracts/external/polygon/tunnel/FxBaseChildTunnel.sol/IFxMessageProcessor.dbg.json +4 -0
  131. package/artifacts/contracts/external/polygon/tunnel/FxBaseChildTunnel.sol/IFxMessageProcessor.json +34 -0
  132. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.dbg.json +4 -0
  133. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/FxBaseRootTunnel.json +108 -0
  134. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.dbg.json +4 -0
  135. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/ICheckpointManager.json +50 -0
  136. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/IFxStateSender.dbg.json +4 -0
  137. package/artifacts/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol/IFxStateSender.json +29 -0
  138. package/artifacts/contracts/insured-bridge/BridgeAdmin.sol/BridgeAdmin.dbg.json +4 -0
  139. package/artifacts/contracts/insured-bridge/BridgeAdmin.sol/BridgeAdmin.json +662 -0
  140. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/BridgeDepositBox.dbg.json +4 -0
  141. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/BridgeDepositBox.json +391 -0
  142. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/TokenLike.dbg.json +4 -0
  143. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/TokenLike.json +30 -0
  144. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/WETH9Like.dbg.json +4 -0
  145. package/artifacts/contracts/insured-bridge/BridgeDepositBox.sol/WETH9Like.json +31 -0
  146. package/artifacts/contracts/insured-bridge/BridgePool.sol/BridgePool.dbg.json +4 -0
  147. package/artifacts/contracts/insured-bridge/BridgePool.sol/BridgePool.json +1709 -0
  148. package/artifacts/contracts/insured-bridge/BridgePool.sol/BridgePoolProd.dbg.json +4 -0
  149. package/artifacts/contracts/insured-bridge/BridgePool.sol/BridgePoolProd.json +1709 -0
  150. package/artifacts/contracts/insured-bridge/BridgePool.sol/WETH9Like.dbg.json +4 -0
  151. package/artifacts/contracts/insured-bridge/BridgePool.sol/WETH9Like.json +31 -0
  152. package/artifacts/contracts/insured-bridge/avm/AVM_BridgeDepositBox.sol/AVM_BridgeDepositBox.dbg.json +4 -0
  153. package/artifacts/contracts/insured-bridge/avm/AVM_BridgeDepositBox.sol/AVM_BridgeDepositBox.json +564 -0
  154. package/artifacts/contracts/insured-bridge/avm/AVM_BridgeDepositBox.sol/StandardBridgeLike.dbg.json +4 -0
  155. package/artifacts/contracts/insured-bridge/avm/AVM_BridgeDepositBox.sol/StandardBridgeLike.json +45 -0
  156. package/artifacts/contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol/Arbitrum_CrossDomainEnabled.dbg.json +4 -0
  157. package/artifacts/contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol/Arbitrum_CrossDomainEnabled.json +24 -0
  158. package/artifacts/contracts/insured-bridge/avm/Arbitrum_Messenger.sol/Arbitrum_Messenger.dbg.json +4 -0
  159. package/artifacts/contracts/insured-bridge/avm/Arbitrum_Messenger.sol/Arbitrum_Messenger.json +191 -0
  160. package/artifacts/contracts/insured-bridge/interfaces/BridgeAdminInterface.sol/BridgeAdminInterface.dbg.json +4 -0
  161. package/artifacts/contracts/insured-bridge/interfaces/BridgeAdminInterface.sol/BridgeAdminInterface.json +319 -0
  162. package/artifacts/contracts/insured-bridge/interfaces/BridgePoolInterface.sol/BridgePoolInterface.dbg.json +4 -0
  163. package/artifacts/contracts/insured-bridge/interfaces/BridgePoolInterface.sol/BridgePoolInterface.json +63 -0
  164. package/artifacts/contracts/insured-bridge/interfaces/MessengerInterface.sol/MessengerInterface.dbg.json +4 -0
  165. package/artifacts/contracts/insured-bridge/interfaces/MessengerInterface.sol/MessengerInterface.json +54 -0
  166. package/artifacts/contracts/insured-bridge/ovm/OVM_BridgeDepositBox.sol/OVM_BridgeDepositBox.dbg.json +4 -0
  167. package/artifacts/contracts/insured-bridge/ovm/OVM_BridgeDepositBox.sol/OVM_BridgeDepositBox.json +528 -0
  168. package/artifacts/contracts/insured-bridge/ovm/OVM_CrossDomainEnabled.sol/OVM_CrossDomainEnabled.dbg.json +4 -0
  169. package/artifacts/contracts/insured-bridge/ovm/OVM_CrossDomainEnabled.sol/OVM_CrossDomainEnabled.json +35 -0
  170. package/artifacts/contracts/insured-bridge/ovm/OVM_OETH_BridgeDepositBox.sol/OVM_OETH_BridgeDepositBox.dbg.json +4 -0
  171. package/artifacts/contracts/insured-bridge/ovm/OVM_OETH_BridgeDepositBox.sol/OVM_OETH_BridgeDepositBox.json +572 -0
  172. package/artifacts/contracts/insured-bridge/ovm/Optimism_Messenger.sol/Optimism_Messenger.dbg.json +4 -0
  173. package/artifacts/contracts/insured-bridge/ovm/Optimism_Messenger.sol/Optimism_Messenger.json +130 -0
  174. package/artifacts/contracts/insured-bridge/ovm/Optimism_Wrapper.sol/Optimism_Wrapper.dbg.json +4 -0
  175. package/artifacts/contracts/insured-bridge/ovm/Optimism_Wrapper.sol/Optimism_Wrapper.json +142 -0
  176. package/artifacts/contracts/insured-bridge/ovm/Optimism_Wrapper.sol/WETH9Like.dbg.json +4 -0
  177. package/artifacts/contracts/insured-bridge/ovm/Optimism_Wrapper.sol/WETH9Like.json +55 -0
  178. package/artifacts/contracts/insured-bridge/ovm/iOVM_CrossDomainMessenger.sol/iOVM_CrossDomainMessenger.dbg.json +4 -0
  179. package/artifacts/contracts/insured-bridge/ovm/iOVM_CrossDomainMessenger.sol/iOVM_CrossDomainMessenger.json +86 -0
  180. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_BridgeMock.dbg.json +4 -0
  181. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_BridgeMock.json +68 -0
  182. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_InboxMock.dbg.json +4 -0
  183. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_InboxMock.json +78 -0
  184. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_OutboxMock.dbg.json +4 -0
  185. package/artifacts/contracts/insured-bridge/test/Arbitrum_InboxMock.sol/Arbitrum_OutboxMock.json +24 -0
  186. package/artifacts/contracts/insured-bridge/test/BridgeDepositBoxMock.sol/BridgeDepositBoxMock.dbg.json +4 -0
  187. package/artifacts/contracts/insured-bridge/test/BridgeDepositBoxMock.sol/BridgeDepositBoxMock.json +510 -0
  188. package/artifacts/contracts/insured-bridge/test/MessengerMock.sol/MessengerMock.dbg.json +4 -0
  189. package/artifacts/contracts/insured-bridge/test/MessengerMock.sol/MessengerMock.json +85 -0
  190. package/artifacts/contracts/insured-bridge/test/OVM_L1CrossDomainMessengerMock.sol/OVM_L1CrossDomainMessengerMock.dbg.json +4 -0
  191. package/artifacts/contracts/insured-bridge/test/OVM_L1CrossDomainMessengerMock.sol/OVM_L1CrossDomainMessengerMock.json +110 -0
  192. package/artifacts/contracts/oracle/implementation/Constants.sol/OptimisticOracleConstraints.dbg.json +4 -0
  193. package/artifacts/contracts/oracle/implementation/Constants.sol/OptimisticOracleConstraints.json +24 -0
  194. package/artifacts/contracts/oracle/implementation/Constants.sol/OracleInterfaces.dbg.json +4 -0
  195. package/artifacts/contracts/oracle/implementation/Constants.sol/OracleInterfaces.json +141 -0
  196. package/artifacts/contracts/oracle/interfaces/FinderInterface.sol/FinderInterface.dbg.json +4 -0
  197. package/artifacts/contracts/oracle/interfaces/FinderInterface.sol/FinderInterface.json +48 -0
  198. package/artifacts/contracts/oracle/interfaces/IdentifierWhitelistInterface.sol/IdentifierWhitelistInterface.dbg.json +4 -0
  199. package/artifacts/contracts/oracle/interfaces/IdentifierWhitelistInterface.sol/IdentifierWhitelistInterface.json +56 -0
  200. package/artifacts/contracts/oracle/interfaces/OptimisticOracleInterface.sol/OptimisticOracleInterface.dbg.json +4 -0
  201. package/artifacts/contracts/oracle/interfaces/OptimisticOracleInterface.sol/OptimisticOracleInterface.json +555 -0
  202. package/artifacts/contracts/oracle/interfaces/SkinnyOptimisticOracleInterface.sol/SkinnyOptimisticOracleInterface.dbg.json +4 -0
  203. package/artifacts/contracts/oracle/interfaces/SkinnyOptimisticOracleInterface.sol/SkinnyOptimisticOracleInterface.json +853 -0
  204. package/artifacts/contracts/oracle/interfaces/StoreInterface.sol/StoreInterface.dbg.json +4 -0
  205. package/artifacts/contracts/oracle/interfaces/StoreInterface.sol/StoreInterface.json +124 -0
  206. package/contracts/common/implementation/AncillaryData.sol +144 -0
  207. package/contracts/common/implementation/FixedPoint.sol +763 -0
  208. package/contracts/common/implementation/Lockable.sol +61 -0
  209. package/contracts/common/implementation/MultiCaller.sol +27 -0
  210. package/contracts/common/implementation/Testable.sol +52 -0
  211. package/contracts/common/implementation/Timer.sol +30 -0
  212. package/contracts/common/interfaces/AddressWhitelistInterface.sol +12 -0
  213. package/contracts/external/avm/AVM_CrossDomainEnabled.sol +43 -0
  214. package/contracts/external/avm/interfaces/ArbSys.sol +79 -0
  215. package/contracts/external/avm/interfaces/iArbitrum_Inbox.sol +28 -0
  216. package/contracts/external/avm/interfaces/iArbitrum_Outbox.sol +26 -0
  217. package/contracts/external/chainbridge/Bridge.sol +454 -0
  218. package/contracts/external/chainbridge/handlers/GenericHandler.sol +237 -0
  219. package/contracts/external/chainbridge/interfaces/IBridge.sol +20 -0
  220. package/contracts/external/chainbridge/interfaces/IDepositExecute.sol +29 -0
  221. package/contracts/external/chainbridge/interfaces/IERCHandler.sol +33 -0
  222. package/contracts/external/chainbridge/interfaces/IGenericHandler.sol +23 -0
  223. package/contracts/external/ovm/OVM_CrossDomainEnabled.sol +114 -0
  224. package/contracts/external/polygon/lib/Merkle.sol +36 -0
  225. package/contracts/external/polygon/lib/MerklePatriciaProof.sol +139 -0
  226. package/contracts/external/polygon/lib/RLPReader.sol +251 -0
  227. package/contracts/external/polygon/test/FxChildMock.sol +42 -0
  228. package/contracts/external/polygon/test/FxRootMock.sol +32 -0
  229. package/contracts/external/polygon/test/StateSyncMock.sol +26 -0
  230. package/contracts/external/polygon/tunnel/FxBaseChildTunnel.sol +80 -0
  231. package/contracts/external/polygon/tunnel/FxBaseRootTunnel.sol +185 -0
  232. package/contracts/insured-bridge/BridgeAdmin.sol +394 -0
  233. package/contracts/insured-bridge/BridgeDepositBox.sol +245 -0
  234. package/contracts/insured-bridge/BridgePool.sol +980 -0
  235. package/contracts/insured-bridge/avm/AVM_BridgeDepositBox.sol +144 -0
  236. package/contracts/insured-bridge/avm/Arbitrum_CrossDomainEnabled.sol +67 -0
  237. package/contracts/insured-bridge/avm/Arbitrum_Messenger.sol +72 -0
  238. package/contracts/insured-bridge/interfaces/BridgeAdminInterface.sol +44 -0
  239. package/contracts/insured-bridge/interfaces/BridgePoolInterface.sol +14 -0
  240. package/contracts/insured-bridge/interfaces/MessengerInterface.sol +18 -0
  241. package/contracts/insured-bridge/ovm/OVM_BridgeDepositBox.sol +135 -0
  242. package/contracts/insured-bridge/ovm/OVM_CrossDomainEnabled.sol +84 -0
  243. package/contracts/insured-bridge/ovm/OVM_OETH_BridgeDepositBox.sol +89 -0
  244. package/contracts/insured-bridge/ovm/Optimism_Messenger.sol +34 -0
  245. package/contracts/insured-bridge/ovm/Optimism_Wrapper.sol +59 -0
  246. package/contracts/insured-bridge/ovm/iOVM_CrossDomainMessenger.sol +41 -0
  247. package/contracts/insured-bridge/test/Arbitrum_InboxMock.sol +50 -0
  248. package/contracts/insured-bridge/test/BridgeDepositBoxMock.sol +113 -0
  249. package/contracts/insured-bridge/test/MessengerMock.sol +32 -0
  250. package/contracts/insured-bridge/test/OVM_L1CrossDomainMessengerMock.sol +16 -0
  251. package/contracts/oracle/implementation/Constants.sol +29 -0
  252. package/contracts/oracle/interfaces/FinderInterface.sol +22 -0
  253. package/contracts/oracle/interfaces/IdentifierWhitelistInterface.sol +28 -0
  254. package/contracts/oracle/interfaces/OptimisticOracleInterface.sol +263 -0
  255. package/contracts/oracle/interfaces/SkinnyOptimisticOracleInterface.sol +251 -0
  256. package/contracts/oracle/interfaces/StoreInterface.sol +46 -0
  257. package/package.json +60 -0
@@ -0,0 +1,34 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ import "@eth-optimism/contracts/libraries/bridge/CrossDomainEnabled.sol";
5
+ import "../interfaces/MessengerInterface.sol";
6
+ import "@openzeppelin/contracts/access/Ownable.sol";
7
+
8
+ /**
9
+ * @notice Sends cross chain messages Optimism L2 network.
10
+ * @dev This contract's owner should be set to the BridgeAdmin deployed on the same L1 network so that only the
11
+ * BridgeAdmin can call cross-chain administrative functions on the L2 DepositBox via this messenger.
12
+ */
13
+ contract Optimism_Messenger is Ownable, CrossDomainEnabled, MessengerInterface {
14
+ constructor(address _crossDomainMessenger) CrossDomainEnabled(_crossDomainMessenger) {}
15
+
16
+ /**
17
+ * @notice Sends a message to an account on L2.
18
+ * @param target The intended recipient on L2.
19
+ * @param gasLimit The gasLimit for the receipt of the message on L2.
20
+ * @param message The data to send to the target (usually calldata to a function with
21
+ * `onlyFromCrossDomainAccount()`)
22
+ */
23
+ function relayMessage(
24
+ address target,
25
+ address,
26
+ uint256,
27
+ uint256 gasLimit,
28
+ uint256,
29
+ uint256,
30
+ bytes memory message
31
+ ) external payable override onlyOwner {
32
+ sendCrossDomainMessage(target, uint32(gasLimit), message);
33
+ }
34
+ }
@@ -0,0 +1,59 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ import "@openzeppelin/contracts/access/Ownable.sol";
5
+
6
+ /**
7
+ * @title Optimism Eth Wrapper
8
+ * @dev Any ETH sent to this contract is wrapped into WETH and sent to the set bridge pool. This enables ETH to be sent
9
+ * over the canonical Optimism bridge, which does not support WETH bridging.
10
+ */
11
+ interface WETH9Like {
12
+ function deposit() external payable;
13
+
14
+ function transfer(address guy, uint256 wad) external;
15
+
16
+ function balanceOf(address guy) external view returns (uint256);
17
+ }
18
+
19
+ contract Optimism_Wrapper is Ownable {
20
+ WETH9Like public weth;
21
+ address public bridgePool;
22
+
23
+ event ChangedBridgePool(address indexed bridgePool);
24
+
25
+ /**
26
+ * @notice Construct Optimism Wrapper contract.
27
+ * @param _weth l1WethContract address. Normally deployed at 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.
28
+ * @param _bridgePool address of the bridge pool to send Wrapped ETH to when ETH is sent to this contract.
29
+ */
30
+ constructor(WETH9Like _weth, address _bridgePool) {
31
+ weth = _weth;
32
+ bridgePool = _bridgePool;
33
+ emit ChangedBridgePool(bridgePool);
34
+ }
35
+
36
+ /**
37
+ * @notice Called by owner of the wrapper to change the destination of the wrapped ETH (bridgePool).
38
+ * @param newBridgePool address of the bridge pool to send Wrapped ETH to when ETH is sent to this contract.
39
+ */
40
+ function changeBridgePool(address newBridgePool) public onlyOwner {
41
+ bridgePool = newBridgePool;
42
+ emit ChangedBridgePool(bridgePool);
43
+ }
44
+
45
+ /**
46
+ * @notice Publicly callable function that takes all ETH in this contract, wraps it to WETH and sends it to the
47
+ * bridge pool contract. Function is called by fallback functions to automatically wrap ETH to WETH and send at the
48
+ * conclusion of a canonical ETH bridging action.
49
+ */
50
+ function wrapAndTransfer() public payable {
51
+ weth.deposit{ value: address(this).balance }();
52
+ weth.transfer(bridgePool, weth.balanceOf(address(this)));
53
+ }
54
+
55
+ // Fallback function enable this contract to receive funds when they are unwrapped from the weth contract.
56
+ fallback() external payable {
57
+ wrapAndTransfer();
58
+ }
59
+ }
@@ -0,0 +1,41 @@
1
+ // Copied directly from https://github.com/ethereum-optimism/optimism/blob/7ffb83509c589bd35c2e5f9cb2c6ccbd5f346175/packages/contracts/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol
2
+ // with a change to the solidity version. Old line is commented out for transparency.
3
+
4
+ // SPDX-License-Identifier: MIT
5
+ // pragma solidity >0.5.0 <0.8.0;
6
+ pragma solidity ^0.8.0;
7
+
8
+ /**
9
+ * @title iOVM_CrossDomainMessenger
10
+ */
11
+ interface iOVM_CrossDomainMessenger {
12
+ /**********
13
+ * Events *
14
+ **********/
15
+
16
+ event SentMessage(bytes message);
17
+ event RelayedMessage(bytes32 msgHash);
18
+ event FailedRelayedMessage(bytes32 msgHash);
19
+
20
+ /*************
21
+ * Variables *
22
+ *************/
23
+
24
+ function xDomainMessageSender() external view returns (address);
25
+
26
+ /********************
27
+ * Public Functions *
28
+ ********************/
29
+
30
+ /**
31
+ * Sends a cross domain message to the target messenger.
32
+ * @param _target Target contract address.
33
+ * @param _message Message to send to the target.
34
+ * @param _gasLimit Gas limit for the provided message.
35
+ */
36
+ function sendMessage(
37
+ address _target,
38
+ bytes calldata _message,
39
+ uint32 _gasLimit
40
+ ) external;
41
+ }
@@ -0,0 +1,50 @@
1
+ pragma solidity ^0.8.0;
2
+ import "@uma/core/contracts/external/avm/interfaces/iArbitrum_Inbox.sol";
3
+ import "@uma/core/contracts/cross-chain-oracle/chain-adapters/Arbitrum_ParentMessenger.sol";
4
+
5
+ contract Arbitrum_OutboxMock {
6
+ function l2ToL1Sender() external view returns (address) {
7
+ // Function not called in tests, only smocked.
8
+ return address(this);
9
+ }
10
+ }
11
+
12
+ contract Arbitrum_BridgeMock {
13
+ address public outbox;
14
+
15
+ function setOutbox(address _outbox) external {
16
+ outbox = _outbox;
17
+ }
18
+
19
+ function activeOutbox() external view returns (address) {
20
+ return outbox;
21
+ }
22
+
23
+ // This function can be called by an EOA to send a call to the parent messenger, which is important in tests
24
+ // because `processMessageFromCrossChainChild` can only be called by the Bridge contract.
25
+ function processMessageFromCrossChainChild(address payable messengerToCall, bytes memory data) external {
26
+ Arbitrum_ParentMessenger(messengerToCall).processMessageFromCrossChainChild(data);
27
+ }
28
+ }
29
+
30
+ contract Arbitrum_InboxMock is iArbitrum_Inbox {
31
+ // We leave these unused function parameters named because this contract is used with smockit and makes testing
32
+ // this function's call inputs easier.
33
+ function createRetryableTicketNoRefundAliasRewrite(
34
+ address destAddr,
35
+ uint256 l2CallValue,
36
+ uint256 maxSubmissionCost,
37
+ address excessFeeRefundAddress,
38
+ address callValueRefundAddress,
39
+ uint256 maxGas,
40
+ uint256 gasPriceBid,
41
+ bytes calldata data
42
+ ) external payable override returns (uint256) {
43
+ return 0;
44
+ }
45
+
46
+ function bridge() external view returns (address) {
47
+ // Function not called in tests, only smocked.
48
+ return address(this);
49
+ }
50
+ }
@@ -0,0 +1,113 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ import "../BridgeDepositBox.sol";
5
+
6
+ contract BridgeDepositBoxMock is BridgeDepositBox {
7
+ using SafeERC20 for IERC20;
8
+
9
+ // Address of the L1 contract that acts as the owner of this Bridge deposit box.
10
+ address public bridgeAdmin;
11
+
12
+ event SetBridgeAdmin(address newBridgeAdmin);
13
+
14
+ modifier onlyBridgeAdmin() {
15
+ require(msg.sender == bridgeAdmin, "Not bridge admin");
16
+ _;
17
+ }
18
+
19
+ /**
20
+ * @notice Ownable bridge deposit box. Used for testing environments that don't have specific l1/l2 messaging logic.
21
+ */
22
+
23
+ constructor(
24
+ address _bridgeAdmin,
25
+ uint64 _minimumBridgingDelay,
26
+ address _l1Weth,
27
+ address timerAddress
28
+ ) BridgeDepositBox(_minimumBridgingDelay, 10, _l1Weth, timerAddress) {
29
+ _setBridgeAdmin(_bridgeAdmin);
30
+ }
31
+
32
+ /**************************************
33
+ * ADMIN FUNCTIONS *
34
+ **************************************/
35
+
36
+ /**
37
+ * @notice Changes the L1 administrator associated with this L2 deposit deposit box.
38
+ * @dev Only callable by the existing bridgeAdmin via the optimism cross domain messenger.
39
+ * @param _bridgeAdmin address of the new L1 admin contract.
40
+ */
41
+ function setCrossDomainAdmin(address _bridgeAdmin) public onlyBridgeAdmin() {
42
+ _setBridgeAdmin(_bridgeAdmin);
43
+ }
44
+
45
+ /**
46
+ * @notice Changes the minimum time in seconds that must elapse between withdraws from L2->L1.
47
+ * @dev Only callable by the existing bridgeAdmin via the optimism cross domain messenger.
48
+ * @param _minimumBridgingDelay the new minimum delay.
49
+ */
50
+ function setMinimumBridgingDelay(uint64 _minimumBridgingDelay) public onlyBridgeAdmin() {
51
+ _setMinimumBridgingDelay(_minimumBridgingDelay);
52
+ }
53
+
54
+ /**
55
+ * @notice Enables L1 owner to whitelist a L1 Token <-> L2 Token pair for bridging.
56
+ * @dev Only callable by the existing bridgeAdmin via the optimism cross domain messenger.
57
+ * @param l1Token Address of the canonical L1 token. This is the token users will receive on Ethereum.
58
+ * @param l2Token Address of the L2 token representation. This is the token users would deposit on optimism.
59
+ * @param l1BridgePool Address of the L1 withdrawal pool linked to this L2+L1 token.
60
+ */
61
+ function whitelistToken(
62
+ address l1Token,
63
+ address l2Token,
64
+ address l1BridgePool
65
+ ) public onlyBridgeAdmin() {
66
+ _whitelistToken(l1Token, l2Token, l1BridgePool);
67
+ }
68
+
69
+ /**
70
+ * @notice L1 owner can enable/disable deposits for a whitelisted token.
71
+ * @dev Only callable by the existing bridgeAdmin via the optimism cross domain messenger.
72
+ * @param _l2Token address of L2 token to enable/disable deposits for.
73
+ * @param _depositsEnabled bool to set if the deposit box should accept/reject deposits.
74
+ */
75
+ function setEnableDeposits(address _l2Token, bool _depositsEnabled) public onlyBridgeAdmin() {
76
+ _setEnableDeposits(_l2Token, _depositsEnabled);
77
+ }
78
+
79
+ /**************************************
80
+ * RELAYER FUNCTIONS *
81
+ **************************************/
82
+
83
+ /**
84
+ * @notice Called by relayer (or any other EOA) to move a batch of funds from the deposit box, through the canonical
85
+ * token bridge, to the L1 Withdraw box.
86
+ * @dev The frequency that this function can be called is rate limited by the `minimumBridgingDelay` to prevent spam
87
+ * on L1 as the finalization of a L2->L1 tx is quite expensive.
88
+ * @param l2Token L2 token to relay over the canonical bridge.
89
+ * @param l1Gas Unused by optimism, but included for potential forward compatibility considerations.
90
+ */
91
+ function bridgeTokens(address l2Token, uint32 l1Gas) public override nonReentrant() {
92
+ uint256 bridgeDepositBoxBalance = TokenLike(l2Token).balanceOf(address(this));
93
+ require(bridgeDepositBoxBalance > 0, "can't bridge zero tokens");
94
+ require(canBridge(l2Token), "non-whitelisted token or last bridge too recent");
95
+
96
+ whitelistedTokens[l2Token].lastBridgeTime = uint64(getCurrentTime());
97
+
98
+ // Note in this test contract we simply send the l2 tokens to the l1BridgePool.
99
+ IERC20(l2Token).safeTransfer(whitelistedTokens[l2Token].l1BridgePool, bridgeDepositBoxBalance);
100
+
101
+ emit TokensBridged(l2Token, bridgeDepositBoxBalance, l1Gas, msg.sender);
102
+ }
103
+
104
+ /**************************************
105
+ * INTERNAL FUNCTIONS *
106
+ **************************************/
107
+
108
+ function _setBridgeAdmin(address _l1BridgeAdmin) internal {
109
+ require(_l1BridgeAdmin != address(0), "Bad bridge router address");
110
+ bridgeAdmin = _l1BridgeAdmin;
111
+ emit SetBridgeAdmin(bridgeAdmin);
112
+ }
113
+ }
@@ -0,0 +1,32 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ import "../interfaces/MessengerInterface.sol";
5
+
6
+ /**
7
+ * @notice Implements the `relayMessage` trivially so that we can test whether the BridgeAdmin correctly calls into this
8
+ * contract.
9
+ */
10
+ contract MessengerMock is MessengerInterface {
11
+ event RelayedMessage(address indexed target, uint256 gasLimit, uint256 gasPrice, bytes message);
12
+
13
+ /**
14
+ * @notice Sends a message to an account on L2.
15
+ * @param target The intended recipient on L2.
16
+ * @param gasLimit The gasLimit for the receipt of the message on L2.
17
+ * @param gasPrice Gas price bid for L2 transaction.
18
+ * @param message The data to send to the target (usually calldata to a function with
19
+ * `onlyFromCrossDomainAccount()`)
20
+ */
21
+ function relayMessage(
22
+ address target,
23
+ address,
24
+ uint256,
25
+ uint256 gasLimit,
26
+ uint256 gasPrice,
27
+ uint256,
28
+ bytes memory message
29
+ ) external payable override {
30
+ emit RelayedMessage(target, gasLimit, gasPrice, message);
31
+ }
32
+ }
@@ -0,0 +1,16 @@
1
+ pragma solidity ^0.8.0;
2
+ import "@eth-optimism/contracts/libraries/bridge/ICrossDomainMessenger.sol";
3
+
4
+ contract OVM_L1CrossDomainMessengerMock is ICrossDomainMessenger {
5
+ function xDomainMessageSender() external view override returns (address) {
6
+ // Trivial return this contract's address.
7
+ return address(this);
8
+ }
9
+
10
+ function sendMessage(
11
+ address _target,
12
+ bytes calldata _message,
13
+ uint32 _gasLimit
14
+ ) external override {}
15
+ // Do nothing.
16
+ }
@@ -0,0 +1,29 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ /**
5
+ * @title Stores common interface names used throughout the DVM by registration in the Finder.
6
+ */
7
+ library OracleInterfaces {
8
+ bytes32 public constant Oracle = "Oracle";
9
+ bytes32 public constant IdentifierWhitelist = "IdentifierWhitelist";
10
+ bytes32 public constant Store = "Store";
11
+ bytes32 public constant FinancialContractsAdmin = "FinancialContractsAdmin";
12
+ bytes32 public constant Registry = "Registry";
13
+ bytes32 public constant CollateralWhitelist = "CollateralWhitelist";
14
+ bytes32 public constant OptimisticOracle = "OptimisticOracle";
15
+ bytes32 public constant Bridge = "Bridge";
16
+ bytes32 public constant GenericHandler = "GenericHandler";
17
+ bytes32 public constant SkinnyOptimisticOracle = "SkinnyOptimisticOracle";
18
+ }
19
+
20
+ /**
21
+ * @title Commonly re-used values for contracts associated with the OptimisticOracle.
22
+ */
23
+ library OptimisticOracleConstraints {
24
+ // Any price request submitted to the OptimisticOracle must contain ancillary data no larger than this value.
25
+ // This value must be <= the Voting contract's `ancillaryBytesLimit` constant value otherwise it is possible
26
+ // that a price can be requested to the OptimisticOracle successfully, but cannot be resolved by the DVM which
27
+ // refuses to accept a price request made with ancillary data length over a certain size.
28
+ uint256 public constant ancillaryBytesLimit = 8192;
29
+ }
@@ -0,0 +1,22 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ /**
5
+ * @title Provides addresses of the live contracts implementing certain interfaces.
6
+ * @dev Examples are the Oracle or Store interfaces.
7
+ */
8
+ interface FinderInterface {
9
+ /**
10
+ * @notice Updates the address of the contract that implements `interfaceName`.
11
+ * @param interfaceName bytes32 encoding of the interface name that is either changed or registered.
12
+ * @param implementationAddress address of the deployed contract that implements the interface.
13
+ */
14
+ function changeImplementationAddress(bytes32 interfaceName, address implementationAddress) external;
15
+
16
+ /**
17
+ * @notice Gets the address of the contract that implements the given `interfaceName`.
18
+ * @param interfaceName queried interface.
19
+ * @return implementationAddress address of the deployed contract that implements the interface.
20
+ */
21
+ function getImplementationAddress(bytes32 interfaceName) external view returns (address);
22
+ }
@@ -0,0 +1,28 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ pragma solidity ^0.8.0;
3
+
4
+ /**
5
+ * @title Interface for whitelists of supported identifiers that the oracle can provide prices for.
6
+ */
7
+ interface IdentifierWhitelistInterface {
8
+ /**
9
+ * @notice Adds the provided identifier as a supported identifier.
10
+ * @dev Price requests using this identifier will succeed after this call.
11
+ * @param identifier bytes32 encoding of the string identifier. Eg: BTC/USD.
12
+ */
13
+ function addSupportedIdentifier(bytes32 identifier) external;
14
+
15
+ /**
16
+ * @notice Removes the identifier from the whitelist.
17
+ * @dev Price requests using this identifier will no longer succeed after this call.
18
+ * @param identifier bytes32 encoding of the string identifier. Eg: BTC/USD.
19
+ */
20
+ function removeSupportedIdentifier(bytes32 identifier) external;
21
+
22
+ /**
23
+ * @notice Checks whether an identifier is on the whitelist.
24
+ * @param identifier bytes32 encoding of the string identifier. Eg: BTC/USD.
25
+ * @return bool if the identifier is supported (or not).
26
+ */
27
+ function isIdentifierSupported(bytes32 identifier) external view returns (bool);
28
+ }