@arbitrum/nitro-contracts 1.0.2 → 1.0.3-beta.1

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 (338) hide show
  1. package/LICENSE +114 -0
  2. package/README.md +2 -2
  3. package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +4 -0
  4. package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.json +63 -0
  5. package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +4 -0
  6. package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.json +24 -0
  7. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +4 -0
  8. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +80 -0
  9. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +4 -0
  10. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.json +56 -0
  11. package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +4 -0
  12. package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.json +19 -0
  13. package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +4 -0
  14. package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.json +24 -0
  15. package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +4 -0
  16. package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.json +113 -0
  17. package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +4 -0
  18. package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +160 -0
  19. package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +4 -0
  20. package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +155 -0
  21. package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +4 -0
  22. package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.json +100 -0
  23. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +4 -0
  24. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.json +10 -0
  25. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
  26. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
  27. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +4 -0
  28. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.json +10 -0
  29. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +4 -0
  30. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +63 -0
  31. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +4 -0
  32. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +10 -0
  33. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +4 -0
  34. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +50 -0
  35. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +4 -0
  36. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.json +194 -0
  37. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +4 -0
  38. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +10 -0
  39. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +4 -0
  40. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +10 -0
  41. package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +4 -0
  42. package/build/contracts/src/bridge/Bridge.sol/Bridge.json +650 -0
  43. package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +4 -0
  44. package/build/contracts/src/bridge/IBridge.sol/IBridge.json +538 -0
  45. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +4 -0
  46. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.json +43 -0
  47. package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +4 -0
  48. package/build/contracts/src/bridge/IInbox.sol/IInbox.json +575 -0
  49. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +4 -0
  50. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.json +419 -0
  51. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +4 -0
  52. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.json +24 -0
  53. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +4 -0
  54. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.json +651 -0
  55. package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +4 -0
  56. package/build/contracts/src/bridge/Inbox.sol/Inbox.json +954 -0
  57. package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +4 -0
  58. package/build/contracts/src/bridge/Messages.sol/Messages.json +10 -0
  59. package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +4 -0
  60. package/build/contracts/src/bridge/Outbox.sol/Outbox.json +546 -0
  61. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +4 -0
  62. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +814 -0
  63. package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +4 -0
  64. package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.json +10 -0
  65. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +4 -0
  66. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json +669 -0
  67. package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +4 -0
  68. package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.json +386 -0
  69. package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.dbg.json +4 -0
  70. package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.json +34 -0
  71. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +4 -0
  72. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.json +10 -0
  73. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +4 -0
  74. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.json +77 -0
  75. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +4 -0
  76. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.json +69 -0
  77. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +4 -0
  78. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.json +10 -0
  79. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +4 -0
  80. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.json +10 -0
  81. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +4 -0
  82. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.json +10 -0
  83. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +4 -0
  84. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.json +144 -0
  85. package/build/contracts/src/libraries/IGasRefunder.sol/GasRefundEnabled.dbg.json +4 -0
  86. package/build/contracts/src/libraries/IGasRefunder.sol/GasRefundEnabled.json +10 -0
  87. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +4 -0
  88. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.json +40 -0
  89. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +4 -0
  90. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.json +10 -0
  91. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +4 -0
  92. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.json +82 -0
  93. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +4 -0
  94. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +561 -0
  95. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +4 -0
  96. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +655 -0
  97. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +4 -0
  98. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +588 -0
  99. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.dbg.json +4 -0
  100. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.json +188 -0
  101. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +4 -0
  102. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.json +160 -0
  103. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +4 -0
  104. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +870 -0
  105. package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +4 -0
  106. package/build/contracts/src/mocks/Simple.sol/Simple.json +242 -0
  107. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +4 -0
  108. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.json +30 -0
  109. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +4 -0
  110. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +720 -0
  111. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +4 -0
  112. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +669 -0
  113. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +4 -0
  114. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.json +286 -0
  115. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +4 -0
  116. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.json +67 -0
  117. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +4 -0
  118. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.json +165 -0
  119. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +4 -0
  120. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.json +57 -0
  121. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +4 -0
  122. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.json +10 -0
  123. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +4 -0
  124. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.json +477 -0
  125. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +4 -0
  126. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.json +135 -0
  127. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +4 -0
  128. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.json +477 -0
  129. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +4 -0
  130. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.json +477 -0
  131. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +4 -0
  132. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.json +477 -0
  133. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +4 -0
  134. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.json +477 -0
  135. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +4 -0
  136. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.json +148 -0
  137. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +4 -0
  138. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.json +148 -0
  139. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +4 -0
  140. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.json +10 -0
  141. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +4 -0
  142. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.json +193 -0
  143. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +4 -0
  144. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.json +77 -0
  145. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +4 -0
  146. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.json +350 -0
  147. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +4 -0
  148. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.json +49 -0
  149. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +4 -0
  150. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.json +378 -0
  151. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +4 -0
  152. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.json +95 -0
  153. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +4 -0
  154. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.json +306 -0
  155. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +4 -0
  156. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.json +49 -0
  157. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +4 -0
  158. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.json +380 -0
  159. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +4 -0
  160. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.json +77 -0
  161. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +4 -0
  162. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.json +24 -0
  163. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +4 -0
  164. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +243 -0
  165. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +4 -0
  166. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +128 -0
  167. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +4 -0
  168. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.json +544 -0
  169. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +4 -0
  170. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.json +889 -0
  171. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +4 -0
  172. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.json +68 -0
  173. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +4 -0
  174. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.json +1428 -0
  175. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +4 -0
  176. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.json +1309 -0
  177. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +4 -0
  178. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.json +1443 -0
  179. package/build/contracts/src/rollup/Node.sol/NodeLib.dbg.json +4 -0
  180. package/build/contracts/src/rollup/Node.sol/NodeLib.json +10 -0
  181. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +4 -0
  182. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +1808 -0
  183. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +4 -0
  184. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.json +1051 -0
  185. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +4 -0
  186. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +383 -0
  187. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +4 -0
  188. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +110 -0
  189. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +4 -0
  190. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +10 -0
  191. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +4 -0
  192. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +226 -0
  193. package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +4 -0
  194. package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.json +1578 -0
  195. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +4 -0
  196. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +1712 -0
  197. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +4 -0
  198. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +1697 -0
  199. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +4 -0
  200. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +379 -0
  201. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +4 -0
  202. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +435 -0
  203. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +4 -0
  204. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +150 -0
  205. package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +4 -0
  206. package/build/contracts/src/state/Deserialize.sol/Deserialize.json +10 -0
  207. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +4 -0
  208. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.json +10 -0
  209. package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +4 -0
  210. package/build/contracts/src/state/Instructions.sol/Instructions.json +10 -0
  211. package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +4 -0
  212. package/build/contracts/src/state/Machine.sol/MachineLib.json +10 -0
  213. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +4 -0
  214. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.json +10 -0
  215. package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +4 -0
  216. package/build/contracts/src/state/Module.sol/ModuleLib.json +10 -0
  217. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +4 -0
  218. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.json +10 -0
  219. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +4 -0
  220. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.json +10 -0
  221. package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +4 -0
  222. package/build/contracts/src/state/PcArray.sol/PcArrayLib.json +10 -0
  223. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +4 -0
  224. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.json +10 -0
  225. package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +4 -0
  226. package/build/contracts/src/state/Value.sol/ValueLib.json +10 -0
  227. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +4 -0
  228. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.json +10 -0
  229. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +4 -0
  230. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.json +10 -0
  231. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +4 -0
  232. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +603 -0
  233. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +4 -0
  234. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.json +54 -0
  235. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +4 -0
  236. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.json +84 -0
  237. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +4 -0
  238. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +520 -0
  239. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +4 -0
  240. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.json +49 -0
  241. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +4 -0
  242. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.json +18 -0
  243. package/package.json +5 -3
  244. package/src/bridge/Bridge.sol +3 -3
  245. package/src/bridge/IBridge.sol +1 -1
  246. package/src/bridge/IDelayedMessageProvider.sol +1 -1
  247. package/src/bridge/IInbox.sol +1 -1
  248. package/src/bridge/IOutbox.sol +1 -1
  249. package/src/bridge/IOwnable.sol +1 -1
  250. package/src/bridge/ISequencerInbox.sol +22 -4
  251. package/src/bridge/Inbox.sol +2 -2
  252. package/src/bridge/Messages.sol +1 -1
  253. package/src/bridge/Outbox.sol +1 -1
  254. package/src/bridge/SequencerInbox.sol +9 -1
  255. package/src/challenge/ChallengeLib.sol +1 -1
  256. package/src/challenge/ChallengeManager.sol +1 -1
  257. package/src/challenge/IChallengeManager.sol +1 -1
  258. package/src/challenge/IChallengeResultReceiver.sol +1 -1
  259. package/src/libraries/AddressAliasHelper.sol +1 -1
  260. package/src/libraries/AdminFallbackProxy.sol +3 -3
  261. package/src/libraries/Constants.sol +1 -1
  262. package/src/libraries/CryptographyPrimitives.sol +1 -1
  263. package/src/libraries/DelegateCallAware.sol +1 -1
  264. package/src/libraries/DoubleLogicUUPSUpgradeable.sol +1 -1
  265. package/src/libraries/Error.sol +1 -1
  266. package/src/libraries/IGasRefunder.sol +2 -5
  267. package/src/libraries/MerkleLib.sol +1 -1
  268. package/src/libraries/MessageTypes.sol +1 -1
  269. package/src/mocks/BridgeStub.sol +2 -2
  270. package/src/mocks/BridgeUnproxied.sol +1 -1
  271. package/src/mocks/InboxStub.sol +1 -1
  272. package/src/mocks/MockResultReceiver.sol +1 -1
  273. package/src/mocks/ProxyAdminForBinding.sol +1 -1
  274. package/src/mocks/SequencerInboxStub.sol +1 -1
  275. package/src/mocks/Simple.sol +5 -1
  276. package/src/mocks/SimpleProxy.sol +1 -1
  277. package/src/mocks/SingleExecutionChallenge.sol +1 -1
  278. package/src/mocks/TimedOutChallengeManager.sol +1 -1
  279. package/src/node-interface/NodeInterface.sol +4 -2
  280. package/src/node-interface/NodeInterfaceDebug.sol +1 -1
  281. package/src/osp/HashProofHelper.sol +1 -1
  282. package/src/osp/IOneStepProofEntry.sol +1 -1
  283. package/src/osp/IOneStepProver.sol +2 -1
  284. package/src/osp/OneStepProofEntry.sol +1 -1
  285. package/src/osp/OneStepProver0.sol +1 -1
  286. package/src/osp/OneStepProverHostIo.sol +2 -1
  287. package/src/osp/OneStepProverMath.sol +1 -1
  288. package/src/osp/OneStepProverMemory.sol +2 -1
  289. package/src/precompiles/ArbAddressTable.sol +1 -1
  290. package/src/precompiles/ArbAggregator.sol +1 -1
  291. package/src/precompiles/ArbBLS.sol +1 -1
  292. package/src/precompiles/ArbDebug.sol +1 -1
  293. package/src/precompiles/ArbFunctionTable.sol +1 -1
  294. package/src/precompiles/ArbGasInfo.sol +1 -1
  295. package/src/precompiles/ArbInfo.sol +1 -1
  296. package/src/precompiles/ArbOwner.sol +4 -1
  297. package/src/precompiles/ArbOwnerPublic.sol +1 -1
  298. package/src/precompiles/ArbRetryableTx.sol +1 -1
  299. package/src/precompiles/ArbStatistics.sol +1 -1
  300. package/src/precompiles/ArbSys.sol +1 -1
  301. package/src/precompiles/ArbosTest.sol +1 -1
  302. package/src/rollup/BridgeCreator.sol +1 -1
  303. package/src/rollup/Config.sol +43 -0
  304. package/src/rollup/IRollupAdmin.sol +138 -0
  305. package/src/rollup/IRollupCore.sol +16 -3
  306. package/src/rollup/IRollupEventInbox.sol +2 -2
  307. package/src/rollup/IRollupLogic.sol +4 -132
  308. package/src/rollup/Node.sol +15 -1
  309. package/src/rollup/RollupAdminLogic.sol +7 -9
  310. package/src/rollup/RollupCore.sol +46 -3
  311. package/src/rollup/RollupCreator.sol +33 -45
  312. package/src/rollup/RollupEventInbox.sol +8 -3
  313. package/src/rollup/RollupLib.sol +2 -40
  314. package/src/rollup/RollupProxy.sol +26 -11
  315. package/src/rollup/RollupUserLogic.sol +6 -4
  316. package/src/rollup/ValidatorUtils.sol +2 -1
  317. package/src/rollup/ValidatorWallet.sol +1 -1
  318. package/src/rollup/ValidatorWalletCreator.sol +1 -1
  319. package/src/state/Deserialize.sol +2 -2
  320. package/src/state/GlobalState.sol +1 -1
  321. package/src/state/Instructions.sol +1 -1
  322. package/src/state/Machine.sol +1 -1
  323. package/src/state/MerkleProof.sol +1 -1
  324. package/src/state/Module.sol +3 -3
  325. package/src/state/ModuleMemory.sol +3 -8
  326. package/src/state/ModuleMemoryCompact.sol +17 -0
  327. package/src/state/PcArray.sol +1 -1
  328. package/src/state/StackFrame.sol +1 -1
  329. package/src/state/Value.sol +1 -1
  330. package/src/state/ValueArray.sol +1 -1
  331. package/src/state/ValueStack.sol +1 -1
  332. package/src/test-helpers/BridgeTester.sol +1 -1
  333. package/src/test-helpers/CryptographyPrimitivesTester.sol +1 -1
  334. package/src/test-helpers/InterfaceCompatibilityTester.sol +1 -1
  335. package/src/test-helpers/MessageTester.sol +1 -1
  336. package/src/test-helpers/OutboxWithoutOptTester.sol +1 -1
  337. package/src/test-helpers/RollupMock.sol +1 -1
  338. package/src/test-helpers/ValueArrayTester.sol +1 -1
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity >=0.4.21 <0.9.0;
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
@@ -0,0 +1,43 @@
1
+ // Copyright 2021-2022, Offchain Labs, Inc.
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
+ // SPDX-License-Identifier: BUSL-1.1
4
+
5
+ pragma solidity ^0.8.0;
6
+
7
+ import "../state/GlobalState.sol";
8
+ import "../state/Machine.sol";
9
+ import "../bridge/ISequencerInbox.sol";
10
+ import "../bridge/IBridge.sol";
11
+ import "../bridge/IOutbox.sol";
12
+ import "../bridge/IInbox.sol";
13
+ import "./IRollupEventInbox.sol";
14
+ import "./IRollupLogic.sol";
15
+ import "../challenge/IChallengeManager.sol";
16
+
17
+ struct Config {
18
+ uint64 confirmPeriodBlocks;
19
+ uint64 extraChallengeTimeBlocks;
20
+ address stakeToken;
21
+ uint256 baseStake;
22
+ bytes32 wasmModuleRoot;
23
+ address owner;
24
+ address loserStakeEscrow;
25
+ uint256 chainId;
26
+ string chainConfig;
27
+ uint64 genesisBlockNum;
28
+ ISequencerInbox.MaxTimeVariation sequencerInboxMaxTimeVariation;
29
+ }
30
+
31
+ struct ContractDependencies {
32
+ IBridge bridge;
33
+ ISequencerInbox sequencerInbox;
34
+ IInbox inbox;
35
+ IOutbox outbox;
36
+ IRollupEventInbox rollupEventInbox;
37
+ IChallengeManager challengeManager;
38
+ address rollupAdminLogic;
39
+ IRollupUser rollupUserLogic;
40
+ // misc contracts that are useful when interacting with the rollup
41
+ address validatorUtils;
42
+ address validatorWalletCreator;
43
+ }
@@ -0,0 +1,138 @@
1
+ // Copyright 2021-2022, Offchain Labs, Inc.
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
+ // SPDX-License-Identifier: BUSL-1.1
4
+
5
+ pragma solidity ^0.8.0;
6
+
7
+ import "./IRollupCore.sol";
8
+ import "../bridge/ISequencerInbox.sol";
9
+ import "../bridge/IOutbox.sol";
10
+ import "../bridge/IOwnable.sol";
11
+ import "./Config.sol";
12
+
13
+ interface IRollupAdmin {
14
+ event OwnerFunctionCalled(uint256 indexed id);
15
+
16
+ function initialize(Config calldata config, ContractDependencies calldata connectedContracts)
17
+ external;
18
+
19
+ /**
20
+ * @notice Add a contract authorized to put messages into this rollup's inbox
21
+ * @param _outbox Outbox contract to add
22
+ */
23
+ function setOutbox(IOutbox _outbox) external;
24
+
25
+ /**
26
+ * @notice Disable an old outbox from interacting with the bridge
27
+ * @param _outbox Outbox contract to remove
28
+ */
29
+ function removeOldOutbox(address _outbox) external;
30
+
31
+ /**
32
+ * @notice Enable or disable an inbox contract
33
+ * @param _inbox Inbox contract to add or remove
34
+ * @param _enabled New status of inbox
35
+ */
36
+ function setDelayedInbox(address _inbox, bool _enabled) external;
37
+
38
+ /**
39
+ * @notice Pause interaction with the rollup contract
40
+ */
41
+ function pause() external;
42
+
43
+ /**
44
+ * @notice Resume interaction with the rollup contract
45
+ */
46
+ function resume() external;
47
+
48
+ /**
49
+ * @notice Set the addresses of the validator whitelist
50
+ * @dev It is expected that both arrays are same length, and validator at
51
+ * position i corresponds to the value at position i
52
+ * @param _validator addresses to set in the whitelist
53
+ * @param _val value to set in the whitelist for corresponding address
54
+ */
55
+ function setValidator(address[] memory _validator, bool[] memory _val) external;
56
+
57
+ /**
58
+ * @notice Set a new owner address for the rollup proxy
59
+ * @param newOwner address of new rollup owner
60
+ */
61
+ function setOwner(address newOwner) external;
62
+
63
+ /**
64
+ * @notice Set minimum assertion period for the rollup
65
+ * @param newPeriod new minimum period for assertions
66
+ */
67
+ function setMinimumAssertionPeriod(uint256 newPeriod) external;
68
+
69
+ /**
70
+ * @notice Set number of blocks until a node is considered confirmed
71
+ * @param newConfirmPeriod new number of blocks until a node is confirmed
72
+ */
73
+ function setConfirmPeriodBlocks(uint64 newConfirmPeriod) external;
74
+
75
+ /**
76
+ * @notice Set number of extra blocks after a challenge
77
+ * @param newExtraTimeBlocks new number of blocks
78
+ */
79
+ function setExtraChallengeTimeBlocks(uint64 newExtraTimeBlocks) external;
80
+
81
+ /**
82
+ * @notice Set base stake required for an assertion
83
+ * @param newBaseStake maximum avmgas to be used per block
84
+ */
85
+ function setBaseStake(uint256 newBaseStake) external;
86
+
87
+ /**
88
+ * @notice Set the token used for stake, where address(0) == eth
89
+ * @dev Before changing the base stake token, you might need to change the
90
+ * implementation of the Rollup User logic!
91
+ * @param newStakeToken address of token used for staking
92
+ */
93
+ function setStakeToken(address newStakeToken) external;
94
+
95
+ /**
96
+ * @notice Upgrades the implementation of a beacon controlled by the rollup
97
+ * @param beacon address of beacon to be upgraded
98
+ * @param newImplementation new address of implementation
99
+ */
100
+ function upgradeBeacon(address beacon, address newImplementation) external;
101
+
102
+ function forceResolveChallenge(address[] memory stackerA, address[] memory stackerB) external;
103
+
104
+ function forceRefundStaker(address[] memory stacker) external;
105
+
106
+ function forceCreateNode(
107
+ uint64 prevNode,
108
+ uint256 prevNodeInboxMaxCount,
109
+ Assertion memory assertion,
110
+ bytes32 expectedNodeHash
111
+ ) external;
112
+
113
+ function forceConfirmNode(
114
+ uint64 nodeNum,
115
+ bytes32 blockHash,
116
+ bytes32 sendRoot
117
+ ) external;
118
+
119
+ function setLoserStakeEscrow(address newLoserStakerEscrow) external;
120
+
121
+ /**
122
+ * @notice Set the proving WASM module root
123
+ * @param newWasmModuleRoot new module root
124
+ */
125
+ function setWasmModuleRoot(bytes32 newWasmModuleRoot) external;
126
+
127
+ /**
128
+ * @notice set a new sequencer inbox contract
129
+ * @param _sequencerInbox new address of sequencer inbox
130
+ */
131
+ function setSequencerInbox(address _sequencerInbox) external;
132
+
133
+ /**
134
+ * @notice set the validatorWhitelistDisabled flag
135
+ * @param _validatorWhitelistDisabled new value of validatorWhitelistDisabled, i.e. true = disabled
136
+ */
137
+ function setValidatorWhitelistDisabled(bool _validatorWhitelistDisabled) external;
138
+ }
@@ -1,11 +1,15 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
6
6
 
7
7
  import "./Node.sol";
8
- import "./RollupLib.sol";
8
+ import "../bridge/IBridge.sol";
9
+ import "../bridge/IOutbox.sol";
10
+ import "../bridge/IInbox.sol";
11
+ import "./IRollupEventInbox.sol";
12
+ import "../challenge/IChallengeManager.sol";
9
13
 
10
14
  interface IRollupCore {
11
15
  struct Staker {
@@ -24,7 +28,7 @@ interface IRollupCore {
24
28
  bytes32 indexed parentNodeHash,
25
29
  bytes32 indexed nodeHash,
26
30
  bytes32 executionHash,
27
- RollupLib.Assertion assertion,
31
+ Assertion assertion,
28
32
  bytes32 afterInboxBatchAcc,
29
33
  bytes32 wasmModuleRoot,
30
34
  uint256 inboxMaxCount
@@ -84,6 +88,15 @@ interface IRollupCore {
84
88
  */
85
89
  function getNode(uint64 nodeNum) external view returns (Node memory);
86
90
 
91
+ /**
92
+ * @notice Returns the block in which the given node was created for looking up its creation event.
93
+ * Unlike the Node's createdAtBlock field, this will be the ArbSys blockNumber if the host chain is an Arbitrum chain.
94
+ * That means that the block number returned for this is usable for event queries.
95
+ * This function will revert if the given node number does not exist.
96
+ * @dev This function is meant for internal use only and has no stability guarantees.
97
+ */
98
+ function getNodeCreationBlockForLogLookup(uint64 nodeNum) external view returns (uint256);
99
+
87
100
  /**
88
101
  * @notice Check if the specified node has been staked on by the provided staker.
89
102
  * Only accurate at the latest confirmed node and afterwards.
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
@@ -13,5 +13,5 @@ interface IRollupEventInbox {
13
13
 
14
14
  function rollup() external view returns (address);
15
15
 
16
- function rollupInitialized(uint256 chainId) external;
16
+ function rollupInitialized(uint256 chainId, string calldata chainConfig) external;
17
17
  }
@@ -1,10 +1,9 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
6
6
 
7
- import "./RollupLib.sol";
8
7
  import "./IRollupCore.sol";
9
8
  import "../bridge/ISequencerInbox.sol";
10
9
  import "../bridge/IOutbox.sol";
@@ -28,7 +27,7 @@ interface IRollupUserAbs is IRollupCore, IOwnable {
28
27
  function stakeOnExistingNode(uint64 nodeNum, bytes32 nodeHash) external;
29
28
 
30
29
  function stakeOnNewNode(
31
- RollupLib.Assertion memory assertion,
30
+ Assertion memory assertion,
32
31
  bytes32 expectedNodeHash,
33
32
  uint256 prevNodeInboxMaxCount
34
33
  ) external;
@@ -75,7 +74,7 @@ interface IRollupUser is IRollupUserAbs {
75
74
  function newStakeOnExistingNode(uint64 nodeNum, bytes32 nodeHash) external payable;
76
75
 
77
76
  function newStakeOnNewNode(
78
- RollupLib.Assertion calldata assertion,
77
+ Assertion calldata assertion,
79
78
  bytes32 expectedNodeHash,
80
79
  uint256 prevNodeInboxMaxCount
81
80
  ) external payable;
@@ -92,137 +91,10 @@ interface IRollupUserERC20 is IRollupUserAbs {
92
91
 
93
92
  function newStakeOnNewNode(
94
93
  uint256 tokenAmount,
95
- RollupLib.Assertion calldata assertion,
94
+ Assertion calldata assertion,
96
95
  bytes32 expectedNodeHash,
97
96
  uint256 prevNodeInboxMaxCount
98
97
  ) external;
99
98
 
100
99
  function addToDeposit(address stakerAddress, uint256 tokenAmount) external;
101
100
  }
102
-
103
- interface IRollupAdmin {
104
- event OwnerFunctionCalled(uint256 indexed id);
105
-
106
- function initialize(Config calldata config, ContractDependencies calldata connectedContracts)
107
- external;
108
-
109
- /**
110
- * @notice Add a contract authorized to put messages into this rollup's inbox
111
- * @param _outbox Outbox contract to add
112
- */
113
- function setOutbox(IOutbox _outbox) external;
114
-
115
- /**
116
- * @notice Disable an old outbox from interacting with the bridge
117
- * @param _outbox Outbox contract to remove
118
- */
119
- function removeOldOutbox(address _outbox) external;
120
-
121
- /**
122
- * @notice Enable or disable an inbox contract
123
- * @param _inbox Inbox contract to add or remove
124
- * @param _enabled New status of inbox
125
- */
126
- function setDelayedInbox(address _inbox, bool _enabled) external;
127
-
128
- /**
129
- * @notice Pause interaction with the rollup contract
130
- */
131
- function pause() external;
132
-
133
- /**
134
- * @notice Resume interaction with the rollup contract
135
- */
136
- function resume() external;
137
-
138
- /**
139
- * @notice Set the addresses of the validator whitelist
140
- * @dev It is expected that both arrays are same length, and validator at
141
- * position i corresponds to the value at position i
142
- * @param _validator addresses to set in the whitelist
143
- * @param _val value to set in the whitelist for corresponding address
144
- */
145
- function setValidator(address[] memory _validator, bool[] memory _val) external;
146
-
147
- /**
148
- * @notice Set a new owner address for the rollup proxy
149
- * @param newOwner address of new rollup owner
150
- */
151
- function setOwner(address newOwner) external;
152
-
153
- /**
154
- * @notice Set minimum assertion period for the rollup
155
- * @param newPeriod new minimum period for assertions
156
- */
157
- function setMinimumAssertionPeriod(uint256 newPeriod) external;
158
-
159
- /**
160
- * @notice Set number of blocks until a node is considered confirmed
161
- * @param newConfirmPeriod new number of blocks until a node is confirmed
162
- */
163
- function setConfirmPeriodBlocks(uint64 newConfirmPeriod) external;
164
-
165
- /**
166
- * @notice Set number of extra blocks after a challenge
167
- * @param newExtraTimeBlocks new number of blocks
168
- */
169
- function setExtraChallengeTimeBlocks(uint64 newExtraTimeBlocks) external;
170
-
171
- /**
172
- * @notice Set base stake required for an assertion
173
- * @param newBaseStake maximum avmgas to be used per block
174
- */
175
- function setBaseStake(uint256 newBaseStake) external;
176
-
177
- /**
178
- * @notice Set the token used for stake, where address(0) == eth
179
- * @dev Before changing the base stake token, you might need to change the
180
- * implementation of the Rollup User logic!
181
- * @param newStakeToken address of token used for staking
182
- */
183
- function setStakeToken(address newStakeToken) external;
184
-
185
- /**
186
- * @notice Upgrades the implementation of a beacon controlled by the rollup
187
- * @param beacon address of beacon to be upgraded
188
- * @param newImplementation new address of implementation
189
- */
190
- function upgradeBeacon(address beacon, address newImplementation) external;
191
-
192
- function forceResolveChallenge(address[] memory stackerA, address[] memory stackerB) external;
193
-
194
- function forceRefundStaker(address[] memory stacker) external;
195
-
196
- function forceCreateNode(
197
- uint64 prevNode,
198
- uint256 prevNodeInboxMaxCount,
199
- RollupLib.Assertion memory assertion,
200
- bytes32 expectedNodeHash
201
- ) external;
202
-
203
- function forceConfirmNode(
204
- uint64 nodeNum,
205
- bytes32 blockHash,
206
- bytes32 sendRoot
207
- ) external;
208
-
209
- function setLoserStakeEscrow(address newLoserStakerEscrow) external;
210
-
211
- /**
212
- * @notice Set the proving WASM module root
213
- * @param newWasmModuleRoot new module root
214
- */
215
- function setWasmModuleRoot(bytes32 newWasmModuleRoot) external;
216
-
217
- /**
218
- * @notice set a new sequencer inbox contract
219
- * @param _sequencerInbox new address of sequencer inbox
220
- */
221
- function setSequencerInbox(address _sequencerInbox) external;
222
-
223
- /**
224
- * @notice set the validatorWhitelistDisabled flag
225
- * @param _validatorWhitelistDisabled new value of validatorWhitelistDisabled, i.e. true = disabled
226
- */
227
- function setValidatorWhitelistDisabled(bool _validatorWhitelistDisabled) external;
228
- }
@@ -1,9 +1,23 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
6
6
 
7
+ import "../state/GlobalState.sol";
8
+ import "../state/Machine.sol";
9
+
10
+ struct ExecutionState {
11
+ GlobalState globalState;
12
+ MachineStatus machineStatus;
13
+ }
14
+
15
+ struct Assertion {
16
+ ExecutionState beforeState;
17
+ ExecutionState afterState;
18
+ uint64 numBlocks;
19
+ }
20
+
7
21
  struct Node {
8
22
  // Hash of the state of the chain as of this node
9
23
  bytes32 stateHash;
@@ -1,10 +1,11 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
6
6
 
7
- import {IRollupAdmin, IRollupUser} from "./IRollupLogic.sol";
7
+ import "./IRollupAdmin.sol";
8
+ import "./IRollupLogic.sol";
8
9
  import "./RollupCore.sol";
9
10
  import "../bridge/IOutbox.sol";
10
11
  import "../bridge/ISequencerInbox.sol";
@@ -36,7 +37,7 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl
36
37
  true
37
38
  );
38
39
 
39
- connectedContracts.rollupEventInbox.rollupInitialized(config.chainId);
40
+ connectedContracts.rollupEventInbox.rollupInitialized(config.chainId, config.chainConfig);
40
41
  connectedContracts.sequencerInbox.addSequencerL2Batch(
41
42
  0,
42
43
  "",
@@ -76,7 +77,7 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl
76
77
  function createInitialNode() private view returns (Node memory) {
77
78
  GlobalState memory emptyGlobalState;
78
79
  bytes32 state = RollupLib.stateHashMem(
79
- RollupLib.ExecutionState(emptyGlobalState, MachineStatus.FINISHED),
80
+ ExecutionState(emptyGlobalState, MachineStatus.FINISHED),
80
81
  1 // inboxMaxCount - force the first assertion to read a message
81
82
  );
82
83
  return
@@ -285,7 +286,7 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl
285
286
  function forceCreateNode(
286
287
  uint64 prevNode,
287
288
  uint256 prevNodeInboxMaxCount,
288
- RollupLib.Assertion calldata assertion,
289
+ Assertion calldata assertion,
289
290
  bytes32 expectedNodeHash
290
291
  ) external override whenPaused {
291
292
  require(prevNode == latestConfirmed(), "ONLY_LATEST_CONFIRMED");
@@ -340,10 +341,7 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl
340
341
  emit OwnerFunctionCalled(28);
341
342
  }
342
343
 
343
- function createNitroMigrationGenesis(RollupLib.Assertion calldata assertion)
344
- external
345
- whenPaused
346
- {
344
+ function createNitroMigrationGenesis(Assertion calldata assertion) external whenPaused {
347
345
  bytes32 expectedSendRoot = bytes32(0);
348
346
  uint64 expectedInboxCount = 1;
349
347
 
@@ -1,5 +1,5 @@
1
1
  // Copyright 2021-2022, Offchain Labs, Inc.
2
- // For license information, see https://github.com/nitro/blob/master/LICENSE
2
+ // For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
3
3
  // SPDX-License-Identifier: BUSL-1.1
4
4
 
5
5
  pragma solidity ^0.8.0;
@@ -7,7 +7,6 @@ pragma solidity ^0.8.0;
7
7
  import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
8
8
 
9
9
  import "./Node.sol";
10
- import "./IRollupCore.sol";
11
10
  import "./RollupLib.sol";
12
11
  import "./IRollupEventInbox.sol";
13
12
  import "./IRollupCore.sol";
@@ -18,6 +17,8 @@ import "../bridge/ISequencerInbox.sol";
18
17
  import "../bridge/IBridge.sol";
19
18
  import "../bridge/IOutbox.sol";
20
19
 
20
+ import "../precompiles/ArbSys.sol";
21
+
21
22
  import {NO_CHAL_INDEX} from "../libraries/Constants.sol";
22
23
 
23
24
  abstract contract RollupCore is IRollupCore, PausableUpgradeable {
@@ -76,6 +77,18 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
76
77
 
77
78
  bool public validatorWhitelistDisabled;
78
79
 
80
+ // If the chain this RollupCore is deployed on is an Arbitrum chain.
81
+ bool internal immutable _hostChainIsArbitrum;
82
+ // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation.
83
+ mapping(uint64 => uint256) internal _nodeCreatedAtArbSysBlock;
84
+
85
+ constructor() {
86
+ (bool ok, bytes memory data) = address(100).staticcall(
87
+ abi.encodeWithSelector(ArbSys.arbOSVersion.selector)
88
+ );
89
+ _hostChainIsArbitrum = ok && data.length == 32;
90
+ }
91
+
79
92
  /**
80
93
  * @notice Get a storage reference to the Node for the given node index
81
94
  * @param nodeNum Index of the node
@@ -92,6 +105,30 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
92
105
  return getNodeStorage(nodeNum);
93
106
  }
94
107
 
108
+ /**
109
+ * @notice Returns the block in which the given node was created for looking up its creation event.
110
+ * Unlike the Node's createdAtBlock field, this will be the ArbSys blockNumber if the host chain is an Arbitrum chain.
111
+ * That means that the block number returned for this is usable for event queries.
112
+ * This function will revert if the given node number does not exist.
113
+ * @dev This function is meant for internal use only and has no stability guarantees.
114
+ */
115
+ function getNodeCreationBlockForLogLookup(uint64 nodeNum)
116
+ external
117
+ view
118
+ override
119
+ returns (uint256)
120
+ {
121
+ if (_hostChainIsArbitrum) {
122
+ uint256 blockNum = _nodeCreatedAtArbSysBlock[nodeNum];
123
+ require(blockNum > 0, "NO_NODE");
124
+ return blockNum;
125
+ } else {
126
+ Node storage node = getNodeStorage(nodeNum);
127
+ require(node.deadlineBlock != 0, "NO_NODE");
128
+ return node.createdAtBlock;
129
+ }
130
+ }
131
+
95
132
  /**
96
133
  * @notice Check if the specified node has been staked on by the provided staker.
97
134
  * Only accurate at the latest confirmed node and afterwards.
@@ -250,6 +287,9 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
250
287
  __Pausable_init();
251
288
  _nodes[GENESIS_NODE] = initialNode;
252
289
  _firstUnresolvedNode = GENESIS_NODE + 1;
290
+ if (_hostChainIsArbitrum) {
291
+ _nodeCreatedAtArbSysBlock[GENESIS_NODE] = ArbSys(address(100)).arbBlockNumber();
292
+ }
253
293
  }
254
294
 
255
295
  /**
@@ -259,6 +299,9 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
259
299
  function nodeCreated(Node memory node) internal {
260
300
  _latestNodeCreated++;
261
301
  _nodes[_latestNodeCreated] = node;
302
+ if (_hostChainIsArbitrum) {
303
+ _nodeCreatedAtArbSysBlock[_latestNodeCreated] = ArbSys(address(100)).arbBlockNumber();
304
+ }
262
305
  }
263
306
 
264
307
  /// @notice Reject the next unresolved node
@@ -524,7 +567,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
524
567
  }
525
568
 
526
569
  function createNewNode(
527
- RollupLib.Assertion calldata assertion,
570
+ Assertion calldata assertion,
528
571
  uint64 prevNodeNum,
529
572
  uint256 prevNodeInboxMaxCount,
530
573
  bytes32 expectedNodeHash