@arbitrum/nitro-contracts 1.1.0-alpha.1 → 1.1.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (422) hide show
  1. package/LICENSE +114 -0
  2. package/README.md +2 -2
  3. package/build/types/@openzeppelin/contracts/access/Ownable.ts +175 -0
  4. package/build/types/@openzeppelin/contracts/access/index.ts +4 -0
  5. package/build/types/@openzeppelin/contracts/index.ts +11 -0
  6. package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.ts +87 -0
  7. package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +4 -0
  8. package/build/types/@openzeppelin/contracts/interfaces/index.ts +5 -0
  9. package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +108 -0
  10. package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.ts +108 -0
  11. package/build/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
  12. package/build/types/@openzeppelin/contracts/proxy/Proxy.ts +55 -0
  13. package/build/types/@openzeppelin/contracts/proxy/beacon/IBeacon.ts +87 -0
  14. package/build/types/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.ts +239 -0
  15. package/build/types/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
  16. package/build/types/@openzeppelin/contracts/proxy/index.ts +12 -0
  17. package/build/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.ts +359 -0
  18. package/build/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.ts +278 -0
  19. package/build/types/@openzeppelin/contracts/proxy/transparent/index.ts +5 -0
  20. package/build/types/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.ts +216 -0
  21. package/build/types/@openzeppelin/contracts/proxy/utils/index.ts +4 -0
  22. package/build/types/@openzeppelin/contracts/token/ERC20/ERC20.ts +444 -0
  23. package/build/types/@openzeppelin/contracts/token/ERC20/IERC20.ts +322 -0
  24. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.ts +507 -0
  25. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +364 -0
  26. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
  27. package/build/types/@openzeppelin/contracts/token/ERC20/index.ts +9 -0
  28. package/build/types/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.ts +507 -0
  29. package/build/types/@openzeppelin/contracts/token/ERC20/presets/index.ts +4 -0
  30. package/build/types/@openzeppelin/contracts/token/index.ts +5 -0
  31. package/build/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.ts +175 -0
  32. package/build/types/@openzeppelin/contracts-upgradeable/access/index.ts +4 -0
  33. package/build/types/@openzeppelin/contracts-upgradeable/index.ts +9 -0
  34. package/build/types/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.ts +111 -0
  35. package/build/types/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
  36. package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.ts +322 -0
  37. package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +4 -0
  38. package/build/types/@openzeppelin/contracts-upgradeable/token/index.ts +5 -0
  39. package/build/types/@openzeppelin/index.ts +7 -0
  40. package/build/types/common.ts +44 -0
  41. package/build/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +78 -0
  42. package/build/types/factories/@openzeppelin/contracts/access/index.ts +4 -0
  43. package/build/types/factories/@openzeppelin/contracts/index.ts +7 -0
  44. package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.ts +39 -0
  45. package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +4 -0
  46. package/build/types/factories/@openzeppelin/contracts/interfaces/index.ts +4 -0
  47. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +146 -0
  48. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade__factory.ts +71 -0
  49. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
  50. package/build/types/factories/@openzeppelin/contracts/proxy/Proxy__factory.ts +31 -0
  51. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.ts +39 -0
  52. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon__factory.ts +169 -0
  53. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
  54. package/build/types/factories/@openzeppelin/contracts/proxy/index.ts +8 -0
  55. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.ts +211 -0
  56. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy__factory.ts +228 -0
  57. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/index.ts +5 -0
  58. package/build/types/factories/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable__factory.ts +115 -0
  59. package/build/types/factories/@openzeppelin/contracts/proxy/utils/index.ts +4 -0
  60. package/build/types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +349 -0
  61. package/build/types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +206 -0
  62. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable__factory.ts +327 -0
  63. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +248 -0
  64. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
  65. package/build/types/factories/@openzeppelin/contracts/token/ERC20/index.ts +7 -0
  66. package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply__factory.ts +420 -0
  67. package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/index.ts +4 -0
  68. package/build/types/factories/@openzeppelin/contracts/token/index.ts +4 -0
  69. package/build/types/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.ts +78 -0
  70. package/build/types/factories/@openzeppelin/contracts-upgradeable/access/index.ts +4 -0
  71. package/build/types/factories/@openzeppelin/contracts-upgradeable/index.ts +6 -0
  72. package/build/types/factories/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable__factory.ts +65 -0
  73. package/build/types/factories/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
  74. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable__factory.ts +209 -0
  75. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +4 -0
  76. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/index.ts +4 -0
  77. package/build/types/factories/@openzeppelin/index.ts +5 -0
  78. package/build/types/factories/index.ts +5 -0
  79. package/build/types/factories/src/bridge/AbsBridge__factory.ts +612 -0
  80. package/build/types/factories/src/bridge/AbsInbox__factory.ts +455 -0
  81. package/build/types/factories/src/bridge/AbsOutbox__factory.ts +561 -0
  82. package/build/types/factories/src/bridge/Bridge__factory.ts +695 -0
  83. package/build/types/factories/src/bridge/ERC20Bridge__factory.ts +746 -0
  84. package/build/types/factories/src/bridge/ERC20Inbox__factory.ts +719 -0
  85. package/build/types/factories/src/bridge/ERC20Outbox__factory.ts +610 -0
  86. package/build/types/factories/src/bridge/IBridge__factory.ts +508 -0
  87. package/build/types/factories/src/bridge/IDelayedMessageProvider__factory.ts +62 -0
  88. package/build/types/factories/src/bridge/IERC20Bridge__factory.ts +576 -0
  89. package/build/types/factories/src/bridge/IERC20Inbox__factory.ts +461 -0
  90. package/build/types/factories/src/bridge/IEthBridge__factory.ts +553 -0
  91. package/build/types/factories/src/bridge/IEthInbox__factory.ts +653 -0
  92. package/build/types/factories/src/bridge/IInbox__factory.ts +318 -0
  93. package/build/types/factories/src/bridge/IOutbox__factory.ts +431 -0
  94. package/build/types/factories/src/bridge/IOwnable__factory.ts +36 -0
  95. package/build/types/factories/src/bridge/ISequencerInbox__factory.ts +666 -0
  96. package/build/types/factories/src/bridge/Inbox__factory.ts +999 -0
  97. package/build/types/factories/src/bridge/Outbox__factory.ts +591 -0
  98. package/build/types/factories/src/bridge/SequencerInbox__factory.ts +865 -0
  99. package/build/types/factories/src/bridge/index.ts +23 -0
  100. package/build/types/factories/src/challenge/ChallengeManager__factory.ts +720 -0
  101. package/build/types/factories/src/challenge/IChallengeManager__factory.ts +401 -0
  102. package/build/types/factories/src/challenge/IChallengeResultReceiver__factory.ts +53 -0
  103. package/build/types/factories/src/challenge/index.ts +6 -0
  104. package/build/types/factories/src/index.ts +12 -0
  105. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy__factory.ts +128 -0
  106. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade__factory.ts +88 -0
  107. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/index.ts +5 -0
  108. package/build/types/factories/src/libraries/DoubleLogicUUPSUpgradeable__factory.ts +163 -0
  109. package/build/types/factories/src/libraries/IGasRefunder__factory.ts +55 -0
  110. package/build/types/factories/src/libraries/UUPSNotUpgradeable__factory.ts +97 -0
  111. package/build/types/factories/src/libraries/index.ts +7 -0
  112. package/build/types/factories/src/mocks/BridgeStub__factory.ts +612 -0
  113. package/build/types/factories/src/mocks/BridgeUnproxied__factory.ts +706 -0
  114. package/build/types/factories/src/mocks/InboxStub__factory.ts +702 -0
  115. package/build/types/factories/src/mocks/MockResultReceiver__factory.ts +244 -0
  116. package/build/types/factories/src/mocks/ProxyAdminForBinding__factory.ts +215 -0
  117. package/build/types/factories/src/mocks/SequencerInboxStub__factory.ts +938 -0
  118. package/build/types/factories/src/mocks/SimpleProxy__factory.ts +83 -0
  119. package/build/types/factories/src/mocks/Simple__factory.ts +287 -0
  120. package/build/types/factories/src/mocks/SingleExecutionChallenge__factory.ts +823 -0
  121. package/build/types/factories/src/mocks/TimedOutChallengeManager__factory.ts +724 -0
  122. package/build/types/factories/src/mocks/index.ts +13 -0
  123. package/build/types/factories/src/node-interface/NodeInterfaceDebug__factory.ts +82 -0
  124. package/build/types/factories/src/node-interface/NodeInterface__factory.ts +301 -0
  125. package/build/types/factories/src/node-interface/index.ts +5 -0
  126. package/build/types/factories/src/osp/HashProofHelper__factory.ts +216 -0
  127. package/build/types/factories/src/osp/IOneStepProofEntry__factory.ts +72 -0
  128. package/build/types/factories/src/osp/IOneStepProver__factory.ts +492 -0
  129. package/build/types/factories/src/osp/OneStepProofEntry__factory.ts +206 -0
  130. package/build/types/factories/src/osp/OneStepProver0__factory.ts +528 -0
  131. package/build/types/factories/src/osp/OneStepProverHostIo__factory.ts +528 -0
  132. package/build/types/factories/src/osp/OneStepProverMath__factory.ts +528 -0
  133. package/build/types/factories/src/osp/OneStepProverMemory__factory.ts +528 -0
  134. package/build/types/factories/src/osp/index.ts +11 -0
  135. package/build/types/factories/src/precompiles/ArbAddressTable__factory.ts +163 -0
  136. package/build/types/factories/src/precompiles/ArbAggregator__factory.ts +163 -0
  137. package/build/types/factories/src/precompiles/ArbDebug__factory.ts +208 -0
  138. package/build/types/factories/src/precompiles/ArbFunctionTable__factory.ts +92 -0
  139. package/build/types/factories/src/precompiles/ArbGasInfo__factory.ts +339 -0
  140. package/build/types/factories/src/precompiles/ArbInfo__factory.ts +64 -0
  141. package/build/types/factories/src/precompiles/ArbOwnerPublic__factory.ts +84 -0
  142. package/build/types/factories/src/precompiles/ArbOwner__factory.ts +393 -0
  143. package/build/types/factories/src/precompiles/ArbRetryableTx__factory.ts +321 -0
  144. package/build/types/factories/src/precompiles/ArbStatistics__factory.ts +64 -0
  145. package/build/types/factories/src/precompiles/ArbSys__factory.ts +389 -0
  146. package/build/types/factories/src/precompiles/ArbosActs__factory.ts +92 -0
  147. package/build/types/factories/src/precompiles/ArbosTest__factory.ts +39 -0
  148. package/build/types/factories/src/precompiles/index.ts +16 -0
  149. package/build/types/factories/src/rollup/AbsBridgeCreator__factory.ts +182 -0
  150. package/build/types/factories/src/rollup/AbsRollupCreator__factory.ts +285 -0
  151. package/build/types/factories/src/rollup/AbsRollupEventInbox__factory.ts +125 -0
  152. package/build/types/factories/src/rollup/BridgeCreator__factory.ts +294 -0
  153. package/build/types/factories/src/rollup/ERC20BridgeCreator__factory.ts +299 -0
  154. package/build/types/factories/src/rollup/ERC20RollupCreator__factory.ts +439 -0
  155. package/build/types/factories/src/rollup/ERC20RollupEventInbox__factory.ts +170 -0
  156. package/build/types/factories/src/rollup/IBridgeCreator.sol/IBridgeCreator__factory.ts +124 -0
  157. package/build/types/factories/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator__factory.ts +200 -0
  158. package/build/types/factories/src/rollup/IBridgeCreator.sol/IEthBridgeCreator__factory.ts +195 -0
  159. package/build/types/factories/src/rollup/IBridgeCreator.sol/index.ts +6 -0
  160. package/build/types/factories/src/rollup/IRollupAdmin__factory.ts +559 -0
  161. package/build/types/factories/src/rollup/IRollupCore__factory.ts +904 -0
  162. package/build/types/factories/src/rollup/IRollupCreator.sol/IERC20RollupCreator__factory.ts +182 -0
  163. package/build/types/factories/src/rollup/IRollupCreator.sol/IEthRollupCreator__factory.ts +177 -0
  164. package/build/types/factories/src/rollup/IRollupCreator.sol/IRollupCreator__factory.ts +69 -0
  165. package/build/types/factories/src/rollup/IRollupCreator.sol/index.ts +6 -0
  166. package/build/types/factories/src/rollup/IRollupEventInbox__factory.ts +83 -0
  167. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserAbs__factory.ts +1324 -0
  168. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserERC20__factory.ts +1458 -0
  169. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUser__factory.ts +1443 -0
  170. package/build/types/factories/src/rollup/IRollupLogic.sol/index.ts +6 -0
  171. package/build/types/factories/src/rollup/RollupAdminLogic__factory.ts +1859 -0
  172. package/build/types/factories/src/rollup/RollupCore__factory.ts +1066 -0
  173. package/build/types/factories/src/rollup/RollupCreator__factory.ts +434 -0
  174. package/build/types/factories/src/rollup/RollupEventInbox__factory.ts +166 -0
  175. package/build/types/factories/src/rollup/RollupProxy__factory.ts +277 -0
  176. package/build/types/factories/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic__factory.ts +1593 -0
  177. package/build/types/factories/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic__factory.ts +1767 -0
  178. package/build/types/factories/src/rollup/RollupUserLogic.sol/RollupUserLogic__factory.ts +1748 -0
  179. package/build/types/factories/src/rollup/RollupUserLogic.sol/index.ts +6 -0
  180. package/build/types/factories/src/rollup/ValidatorUtils__factory.ts +430 -0
  181. package/build/types/factories/src/rollup/ValidatorWalletCreator__factory.ts +205 -0
  182. package/build/types/factories/src/rollup/ValidatorWallet__factory.ts +486 -0
  183. package/build/types/factories/src/rollup/index.ts +25 -0
  184. package/build/types/factories/src/test-helpers/BridgeTester__factory.ts +654 -0
  185. package/build/types/factories/src/test-helpers/CryptographyPrimitivesTester__factory.ts +111 -0
  186. package/build/types/factories/src/test-helpers/EthVault__factory.ts +95 -0
  187. package/build/types/factories/src/test-helpers/MessageTester__factory.ts +135 -0
  188. package/build/types/factories/src/test-helpers/OutboxWithoutOptTester__factory.ts +575 -0
  189. package/build/types/factories/src/test-helpers/RollupMock__factory.ts +100 -0
  190. package/build/types/factories/src/test-helpers/ValueArrayTester__factory.ts +69 -0
  191. package/build/types/factories/src/test-helpers/index.ts +10 -0
  192. package/build/types/index.ts +240 -0
  193. package/build/types/src/bridge/AbsBridge.ts +863 -0
  194. package/build/types/src/bridge/AbsInbox.ts +664 -0
  195. package/build/types/src/bridge/AbsOutbox.ts +700 -0
  196. package/build/types/src/bridge/Bridge.ts +934 -0
  197. package/build/types/src/bridge/ERC20Bridge.ts +970 -0
  198. package/build/types/src/bridge/ERC20Inbox.ts +869 -0
  199. package/build/types/src/bridge/ERC20Outbox.ts +722 -0
  200. package/build/types/src/bridge/IBridge.ts +799 -0
  201. package/build/types/src/bridge/IDelayedMessageProvider.ts +108 -0
  202. package/build/types/src/bridge/IERC20Bridge.ts +914 -0
  203. package/build/types/src/bridge/IERC20Inbox.ts +788 -0
  204. package/build/types/src/bridge/IEthBridge.ts +871 -0
  205. package/build/types/src/bridge/IEthInbox.ts +1081 -0
  206. package/build/types/src/bridge/IInbox.ts +583 -0
  207. package/build/types/src/bridge/IOutbox.ts +654 -0
  208. package/build/types/src/bridge/IOwnable.ts +81 -0
  209. package/build/types/src/bridge/ISequencerInbox.ts +1038 -0
  210. package/build/types/src/bridge/Inbox.ts +1279 -0
  211. package/build/types/src/bridge/Outbox.ts +700 -0
  212. package/build/types/src/bridge/SequencerInbox.ts +1138 -0
  213. package/build/types/src/bridge/index.ts +23 -0
  214. package/build/types/src/challenge/ChallengeManager.ts +889 -0
  215. package/build/types/src/challenge/IChallengeManager.ts +543 -0
  216. package/build/types/src/challenge/IChallengeResultReceiver.ts +115 -0
  217. package/build/types/src/challenge/index.ts +6 -0
  218. package/build/types/src/index.ts +21 -0
  219. package/build/types/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.ts +128 -0
  220. package/build/types/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.ts +128 -0
  221. package/build/types/src/libraries/AdminFallbackProxy.sol/index.ts +5 -0
  222. package/build/types/src/libraries/DoubleLogicUUPSUpgradeable.ts +314 -0
  223. package/build/types/src/libraries/IGasRefunder.ts +112 -0
  224. package/build/types/src/libraries/UUPSNotUpgradeable.ts +164 -0
  225. package/build/types/src/libraries/index.ts +8 -0
  226. package/build/types/src/mocks/BridgeStub.ts +887 -0
  227. package/build/types/src/mocks/BridgeUnproxied.ts +934 -0
  228. package/build/types/src/mocks/InboxStub.ts +1076 -0
  229. package/build/types/src/mocks/MockResultReceiver.ts +301 -0
  230. package/build/types/src/mocks/ProxyAdminForBinding.ts +359 -0
  231. package/build/types/src/mocks/SequencerInboxStub.ts +1173 -0
  232. package/build/types/src/mocks/Simple.ts +514 -0
  233. package/build/types/src/mocks/SimpleProxy.ts +55 -0
  234. package/build/types/src/mocks/SingleExecutionChallenge.ts +889 -0
  235. package/build/types/src/mocks/TimedOutChallengeManager.ts +883 -0
  236. package/build/types/src/mocks/index.ts +13 -0
  237. package/build/types/src/node-interface/NodeInterface.ts +502 -0
  238. package/build/types/src/node-interface/NodeInterfaceDebug.ts +137 -0
  239. package/build/types/src/node-interface/index.ts +5 -0
  240. package/build/types/src/osp/HashProofHelper.ts +308 -0
  241. package/build/types/src/osp/IOneStepProofEntry.ts +128 -0
  242. package/build/types/src/osp/IOneStepProver.ts +284 -0
  243. package/build/types/src/osp/OneStepProofEntry.ts +196 -0
  244. package/build/types/src/osp/OneStepProver0.ts +284 -0
  245. package/build/types/src/osp/OneStepProverHostIo.ts +284 -0
  246. package/build/types/src/osp/OneStepProverMath.ts +284 -0
  247. package/build/types/src/osp/OneStepProverMemory.ts +284 -0
  248. package/build/types/src/osp/index.ts +11 -0
  249. package/build/types/src/precompiles/ArbAddressTable.ts +248 -0
  250. package/build/types/src/precompiles/ArbAggregator.ts +335 -0
  251. package/build/types/src/precompiles/ArbDebug.ts +292 -0
  252. package/build/types/src/precompiles/ArbFunctionTable.ts +150 -0
  253. package/build/types/src/precompiles/ArbGasInfo.ts +494 -0
  254. package/build/types/src/precompiles/ArbInfo.ts +105 -0
  255. package/build/types/src/precompiles/ArbOwner.ts +928 -0
  256. package/build/types/src/precompiles/ArbOwnerPublic.ts +157 -0
  257. package/build/types/src/precompiles/ArbRetryableTx.ts +467 -0
  258. package/build/types/src/precompiles/ArbStatistics.ts +93 -0
  259. package/build/types/src/precompiles/ArbSys.ts +553 -0
  260. package/build/types/src/precompiles/ArbosActs.ts +173 -0
  261. package/build/types/src/precompiles/ArbosTest.ts +97 -0
  262. package/build/types/src/precompiles/index.ts +16 -0
  263. package/build/types/src/rollup/AbsBridgeCreator.ts +348 -0
  264. package/build/types/src/rollup/AbsRollupCreator.ts +449 -0
  265. package/build/types/src/rollup/AbsRollupEventInbox.ts +218 -0
  266. package/build/types/src/rollup/BridgeCreator.ts +415 -0
  267. package/build/types/src/rollup/ERC20BridgeCreator.ts +420 -0
  268. package/build/types/src/rollup/ERC20RollupCreator.ts +561 -0
  269. package/build/types/src/rollup/ERC20RollupEventInbox.ts +218 -0
  270. package/build/types/src/rollup/IBridgeCreator.sol/IBridgeCreator.ts +231 -0
  271. package/build/types/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator.ts +303 -0
  272. package/build/types/src/rollup/IBridgeCreator.sol/IEthBridgeCreator.ts +298 -0
  273. package/build/types/src/rollup/IBridgeCreator.sol/index.ts +6 -0
  274. package/build/types/src/rollup/IRollupAdmin.ts +1003 -0
  275. package/build/types/src/rollup/IRollupCore.ts +1183 -0
  276. package/build/types/src/rollup/IRollupCreator.sol/IERC20RollupCreator.ts +247 -0
  277. package/build/types/src/rollup/IRollupCreator.sol/IEthRollupCreator.ts +242 -0
  278. package/build/types/src/rollup/IRollupCreator.sol/IRollupCreator.ts +134 -0
  279. package/build/types/src/rollup/IRollupCreator.sol/index.ts +6 -0
  280. package/build/types/src/rollup/IRollupEventInbox.ts +167 -0
  281. package/build/types/src/rollup/IRollupLogic.sol/IRollupUser.ts +2022 -0
  282. package/build/types/src/rollup/IRollupLogic.sol/IRollupUserAbs.ts +1901 -0
  283. package/build/types/src/rollup/IRollupLogic.sol/IRollupUserERC20.ts +2036 -0
  284. package/build/types/src/rollup/IRollupLogic.sol/index.ts +6 -0
  285. package/build/types/src/rollup/RollupAdminLogic.ts +2593 -0
  286. package/build/types/src/rollup/RollupCore.ts +1406 -0
  287. package/build/types/src/rollup/RollupCreator.ts +556 -0
  288. package/build/types/src/rollup/RollupEventInbox.ts +218 -0
  289. package/build/types/src/rollup/RollupProxy.ts +285 -0
  290. package/build/types/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.ts +2282 -0
  291. package/build/types/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.ts +2417 -0
  292. package/build/types/src/rollup/RollupUserLogic.sol/RollupUserLogic.ts +2403 -0
  293. package/build/types/src/rollup/RollupUserLogic.sol/index.ts +6 -0
  294. package/build/types/src/rollup/ValidatorUtils.ts +561 -0
  295. package/build/types/src/rollup/ValidatorWallet.ts +751 -0
  296. package/build/types/src/rollup/ValidatorWalletCreator.ts +294 -0
  297. package/build/types/src/rollup/index.ts +29 -0
  298. package/build/types/src/test-helpers/BridgeTester.ts +899 -0
  299. package/build/types/src/test-helpers/CryptographyPrimitivesTester.ts +141 -0
  300. package/build/types/src/test-helpers/EthVault.ts +141 -0
  301. package/build/types/src/test-helpers/MessageTester.ts +182 -0
  302. package/build/types/src/test-helpers/OutboxWithoutOptTester.ts +700 -0
  303. package/build/types/src/test-helpers/RollupMock.ts +164 -0
  304. package/build/types/src/test-helpers/ValueArrayTester.ts +81 -0
  305. package/build/types/src/test-helpers/index.ts +10 -0
  306. package/package.json +9 -3
  307. package/src/bridge/AbsBridge.sol +302 -0
  308. package/src/bridge/AbsInbox.sol +335 -0
  309. package/src/bridge/AbsOutbox.sol +295 -0
  310. package/src/bridge/Bridge.sol +15 -244
  311. package/src/bridge/ERC20Bridge.sol +74 -0
  312. package/src/bridge/ERC20Inbox.sol +141 -0
  313. package/src/bridge/ERC20Outbox.sol +27 -0
  314. package/src/bridge/IBridge.sol +1 -16
  315. package/src/bridge/IDelayedMessageProvider.sol +1 -1
  316. package/src/bridge/IERC20Bridge.sol +35 -0
  317. package/src/bridge/IERC20Inbox.sol +75 -0
  318. package/src/bridge/IEthBridge.sol +26 -0
  319. package/src/bridge/IEthInbox.sol +133 -0
  320. package/src/bridge/IInbox.sol +13 -123
  321. package/src/bridge/IOutbox.sol +1 -1
  322. package/src/bridge/IOwnable.sol +1 -1
  323. package/src/bridge/ISequencerInbox.sol +12 -4
  324. package/src/bridge/Inbox.sol +46 -333
  325. package/src/bridge/Messages.sol +1 -1
  326. package/src/bridge/Outbox.sol +8 -265
  327. package/src/bridge/SequencerInbox.sol +29 -8
  328. package/src/challenge/ChallengeLib.sol +1 -1
  329. package/src/challenge/ChallengeManager.sol +1 -1
  330. package/src/challenge/IChallengeManager.sol +1 -1
  331. package/src/challenge/IChallengeResultReceiver.sol +1 -1
  332. package/src/libraries/AddressAliasHelper.sol +1 -1
  333. package/src/libraries/AdminFallbackProxy.sol +1 -1
  334. package/src/libraries/ArbitrumChecker.sol +16 -0
  335. package/src/libraries/Constants.sol +1 -4
  336. package/src/libraries/CryptographyPrimitives.sol +1 -1
  337. package/src/libraries/DelegateCallAware.sol +1 -1
  338. package/src/libraries/DoubleLogicUUPSUpgradeable.sol +1 -1
  339. package/src/libraries/Error.sol +9 -1
  340. package/src/libraries/IGasRefunder.sol +1 -1
  341. package/src/libraries/MerkleLib.sol +1 -1
  342. package/src/libraries/MessageTypes.sol +1 -1
  343. package/src/mocks/BridgeStub.sol +3 -2
  344. package/src/mocks/BridgeUnproxied.sol +1 -1
  345. package/src/mocks/InboxStub.sol +28 -5
  346. package/src/mocks/MockResultReceiver.sol +1 -1
  347. package/src/mocks/ProxyAdminForBinding.sol +1 -1
  348. package/src/mocks/SequencerInboxStub.sol +3 -2
  349. package/src/mocks/Simple.sol +3 -1
  350. package/src/mocks/SimpleProxy.sol +1 -1
  351. package/src/mocks/SingleExecutionChallenge.sol +1 -1
  352. package/src/mocks/TimedOutChallengeManager.sol +1 -1
  353. package/src/node-interface/NodeInterface.sol +1 -1
  354. package/src/node-interface/NodeInterfaceDebug.sol +1 -1
  355. package/src/osp/HashProofHelper.sol +1 -1
  356. package/src/osp/IOneStepProofEntry.sol +1 -1
  357. package/src/osp/IOneStepProver.sol +2 -1
  358. package/src/osp/OneStepProofEntry.sol +1 -1
  359. package/src/osp/OneStepProver0.sol +1 -1
  360. package/src/osp/OneStepProverHostIo.sol +2 -1
  361. package/src/osp/OneStepProverMath.sol +1 -1
  362. package/src/osp/OneStepProverMemory.sol +2 -1
  363. package/src/precompiles/ArbAddressTable.sol +1 -1
  364. package/src/precompiles/ArbAggregator.sol +1 -1
  365. package/src/precompiles/ArbBLS.sol +1 -1
  366. package/src/precompiles/ArbDebug.sol +1 -1
  367. package/src/precompiles/ArbFunctionTable.sol +1 -1
  368. package/src/precompiles/ArbGasInfo.sol +1 -1
  369. package/src/precompiles/ArbInfo.sol +1 -1
  370. package/src/precompiles/ArbOwner.sol +1 -1
  371. package/src/precompiles/ArbOwnerPublic.sol +1 -1
  372. package/src/precompiles/ArbRetryableTx.sol +1 -1
  373. package/src/precompiles/ArbStatistics.sol +1 -1
  374. package/src/precompiles/ArbSys.sol +1 -1
  375. package/src/precompiles/ArbosTest.sol +1 -1
  376. package/src/rollup/AbsBridgeCreator.sol +117 -0
  377. package/src/rollup/AbsRollupCreator.sol +164 -0
  378. package/src/rollup/AbsRollupEventInbox.sol +62 -0
  379. package/src/rollup/BridgeCreator.sol +17 -88
  380. package/src/rollup/Config.sol +43 -0
  381. package/src/rollup/ERC20BridgeCreator.sol +48 -0
  382. package/src/rollup/ERC20RollupCreator.sol +48 -0
  383. package/src/rollup/ERC20RollupEventInbox.sol +26 -0
  384. package/src/rollup/IBridgeCreator.sol +64 -0
  385. package/src/rollup/IRollupAdmin.sol +138 -0
  386. package/src/rollup/IRollupCore.sol +7 -3
  387. package/src/rollup/IRollupCreator.sol +40 -0
  388. package/src/rollup/IRollupEventInbox.sol +1 -1
  389. package/src/rollup/IRollupLogic.sol +4 -132
  390. package/src/rollup/Node.sol +15 -1
  391. package/src/rollup/RollupAdminLogic.sol +6 -8
  392. package/src/rollup/RollupCore.sol +4 -11
  393. package/src/rollup/RollupCreator.sol +22 -97
  394. package/src/rollup/RollupEventInbox.sol +12 -35
  395. package/src/rollup/RollupLib.sol +2 -41
  396. package/src/rollup/RollupProxy.sol +3 -2
  397. package/src/rollup/RollupUserLogic.sol +6 -4
  398. package/src/rollup/ValidatorUtils.sol +2 -1
  399. package/src/rollup/ValidatorWallet.sol +1 -1
  400. package/src/rollup/ValidatorWalletCreator.sol +1 -1
  401. package/src/state/Deserialize.sol +2 -2
  402. package/src/state/GlobalState.sol +1 -1
  403. package/src/state/Instructions.sol +1 -1
  404. package/src/state/Machine.sol +1 -1
  405. package/src/state/MerkleProof.sol +1 -1
  406. package/src/state/Module.sol +3 -3
  407. package/src/state/ModuleMemory.sol +3 -8
  408. package/src/state/ModuleMemoryCompact.sol +17 -0
  409. package/src/state/PcArray.sol +1 -1
  410. package/src/state/StackFrame.sol +1 -1
  411. package/src/state/Value.sol +1 -1
  412. package/src/state/ValueArray.sol +1 -1
  413. package/src/state/ValueStack.sol +1 -1
  414. package/src/test-helpers/BridgeTester.sol +3 -2
  415. package/src/test-helpers/CryptographyPrimitivesTester.sol +1 -1
  416. package/src/test-helpers/EthVault.sol +20 -0
  417. package/src/test-helpers/InterfaceCompatibilityTester.sol +1 -1
  418. package/src/test-helpers/MessageTester.sol +1 -1
  419. package/src/test-helpers/OutboxWithoutOptTester.sol +1 -1
  420. package/src/test-helpers/RollupMock.sol +1 -1
  421. package/src/test-helpers/ValueArrayTester.sol +1 -1
  422. package/hardhat.config.ts +0 -164
@@ -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";
@@ -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";
@@ -20,6 +19,7 @@ import "../bridge/IOutbox.sol";
20
19
 
21
20
  import "../precompiles/ArbSys.sol";
22
21
 
22
+ import "../libraries/ArbitrumChecker.sol";
23
23
  import {NO_CHAL_INDEX} from "../libraries/Constants.sol";
24
24
 
25
25
  abstract contract RollupCore is IRollupCore, PausableUpgradeable {
@@ -79,17 +79,10 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
79
79
  bool public validatorWhitelistDisabled;
80
80
 
81
81
  // If the chain this RollupCore is deployed on is an Arbitrum chain.
82
- bool internal immutable _hostChainIsArbitrum;
82
+ bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum();
83
83
  // If the chain RollupCore is deployed on, this will contain the ArbSys.blockNumber() at each node's creation.
84
84
  mapping(uint64 => uint256) internal _nodeCreatedAtArbSysBlock;
85
85
 
86
- constructor() {
87
- (bool ok, bytes memory data) = address(100).staticcall(
88
- abi.encodeWithSelector(ArbSys.arbOSVersion.selector)
89
- );
90
- _hostChainIsArbitrum = ok && data.length == 32;
91
- }
92
-
93
86
  /**
94
87
  * @notice Get a storage reference to the Node for the given node index
95
88
  * @param nodeNum Index of the node
@@ -568,7 +561,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
568
561
  }
569
562
 
570
563
  function createNewNode(
571
- RollupLib.Assertion calldata assertion,
564
+ Assertion calldata assertion,
572
565
  uint64 prevNodeNum,
573
566
  uint256 prevNodeInboxMaxCount,
574
567
  bytes32 expectedNodeHash
@@ -1,121 +1,46 @@
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 "./AbsRollupCreator.sol";
7
8
  import "./BridgeCreator.sol";
8
9
 
9
- import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
10
- import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";
11
- import "@openzeppelin/contracts/access/Ownable.sol";
12
-
13
- import "./RollupProxy.sol";
14
-
15
- contract RollupCreator is Ownable {
16
- event RollupCreated(
17
- address indexed rollupAddress,
18
- address inboxAddress,
19
- address adminProxy,
20
- address sequencerInbox,
21
- address bridge
22
- );
23
- event TemplatesUpdated();
24
-
25
- BridgeCreator public bridgeCreator;
26
- IOneStepProofEntry public osp;
27
- IChallengeManager public challengeManagerTemplate;
28
- IRollupAdmin public rollupAdminLogic;
29
- IRollupUser public rollupUserLogic;
30
-
31
- address public validatorUtils;
32
- address public validatorWalletCreator;
33
-
34
- constructor() Ownable() {}
35
-
36
- function setTemplates(
37
- BridgeCreator _bridgeCreator,
38
- IOneStepProofEntry _osp,
39
- IChallengeManager _challengeManagerLogic,
40
- IRollupAdmin _rollupAdminLogic,
41
- IRollupUser _rollupUserLogic,
42
- address _validatorUtils,
43
- address _validatorWalletCreator
44
- ) external onlyOwner {
45
- bridgeCreator = _bridgeCreator;
46
- osp = _osp;
47
- challengeManagerTemplate = _challengeManagerLogic;
48
- rollupAdminLogic = _rollupAdminLogic;
49
- rollupUserLogic = _rollupUserLogic;
50
- validatorUtils = _validatorUtils;
51
- validatorWalletCreator = _validatorWalletCreator;
52
- emit TemplatesUpdated();
53
- }
10
+ contract RollupCreator is AbsRollupCreator, IEthRollupCreator {
11
+ constructor() AbsRollupCreator() {}
54
12
 
55
13
  // After this setup:
56
14
  // Rollup should be the owner of bridge
57
15
  // RollupOwner should be the owner of Rollup's ProxyAdmin
58
16
  // RollupOwner should be the owner of Rollup
59
17
  // Bridge should have a single inbox and outbox
60
- function createRollup(Config memory config) external returns (address) {
61
- ProxyAdmin proxyAdmin = new ProxyAdmin();
62
-
63
- // Create the rollup proxy to figure out the address and initialize it later
64
- RollupProxy rollup = new RollupProxy{salt: keccak256(abi.encode(config))}();
18
+ function createRollup(
19
+ Config memory config,
20
+ address _batchPoster,
21
+ address[] calldata _validators
22
+ ) external override returns (address) {
23
+ return _createRollup(config, _batchPoster, _validators, address(0));
24
+ }
65
25
 
26
+ function _createBridge(
27
+ address proxyAdmin,
28
+ address rollup,
29
+ ISequencerInbox.MaxTimeVariation memory maxTimeVariation,
30
+ address // nativeToken does not exist in context of standard Eth based rollup
31
+ ) internal override returns (BridgeContracts memory) {
66
32
  (
67
33
  IBridge bridge,
68
34
  ISequencerInbox sequencerInbox,
69
35
  IInbox inbox,
70
36
  IRollupEventInbox rollupEventInbox,
71
37
  IOutbox outbox
72
- ) = bridgeCreator.createBridge(
73
- address(proxyAdmin),
74
- address(rollup),
75
- config.sequencerInboxMaxTimeVariation
38
+ ) = BridgeCreator(address(bridgeCreator)).createBridge(
39
+ proxyAdmin,
40
+ rollup,
41
+ maxTimeVariation
76
42
  );
77
43
 
78
- proxyAdmin.transferOwnership(config.owner);
79
-
80
- IChallengeManager challengeManager = IChallengeManager(
81
- address(
82
- new TransparentUpgradeableProxy(
83
- address(challengeManagerTemplate),
84
- address(proxyAdmin),
85
- ""
86
- )
87
- )
88
- );
89
- challengeManager.initialize(
90
- IChallengeResultReceiver(address(rollup)),
91
- sequencerInbox,
92
- bridge,
93
- osp
94
- );
95
-
96
- rollup.initializeProxy(
97
- config,
98
- ContractDependencies({
99
- bridge: bridge,
100
- sequencerInbox: sequencerInbox,
101
- inbox: inbox,
102
- outbox: outbox,
103
- rollupEventInbox: rollupEventInbox,
104
- challengeManager: challengeManager,
105
- rollupAdminLogic: rollupAdminLogic,
106
- rollupUserLogic: rollupUserLogic,
107
- validatorUtils: validatorUtils,
108
- validatorWalletCreator: validatorWalletCreator
109
- })
110
- );
111
-
112
- emit RollupCreated(
113
- address(rollup),
114
- address(inbox),
115
- address(proxyAdmin),
116
- address(sequencerInbox),
117
- address(bridge)
118
- );
119
- return address(rollup);
44
+ return BridgeContracts(bridge, sequencerInbox, inbox, rollupEventInbox, outbox);
120
45
  }
121
46
  }
@@ -1,47 +1,24 @@
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 "./IRollupEventInbox.sol";
8
- import "../bridge/IBridge.sol";
9
- import "../bridge/IDelayedMessageProvider.sol";
10
- import "../libraries/DelegateCallAware.sol";
11
- import {INITIALIZATION_MSG_TYPE} from "../libraries/MessageTypes.sol";
12
- import {AlreadyInit, HadZeroInit} from "../libraries/Error.sol";
7
+ import "./AbsRollupEventInbox.sol";
8
+ import "../bridge/IEthBridge.sol";
13
9
 
14
10
  /**
15
11
  * @title The inbox for rollup protocol events
16
12
  */
17
- contract RollupEventInbox is IRollupEventInbox, IDelayedMessageProvider, DelegateCallAware {
18
- IBridge public override bridge;
19
- address public override rollup;
13
+ contract RollupEventInbox is AbsRollupEventInbox {
14
+ constructor() AbsRollupEventInbox() {}
20
15
 
21
- modifier onlyRollup() {
22
- require(msg.sender == rollup, "ONLY_ROLLUP");
23
- _;
24
- }
25
-
26
- function initialize(IBridge _bridge) external override onlyDelegated {
27
- if (address(bridge) != address(0)) revert AlreadyInit();
28
- if (address(_bridge) == address(0)) revert HadZeroInit();
29
- bridge = _bridge;
30
- rollup = address(_bridge.rollup());
31
- }
32
-
33
- function rollupInitialized(uint256 chainId, string calldata chainConfig)
34
- external
35
- override
36
- onlyRollup
37
- {
38
- require(bytes(chainConfig).length > 0, "EMPTY_CHAIN_CONFIG");
39
- bytes memory initMsg = abi.encodePacked(chainId, uint8(0), chainConfig);
40
- uint256 num = bridge.enqueueDelayedMessage(
41
- INITIALIZATION_MSG_TYPE,
42
- address(0),
43
- keccak256(initMsg)
44
- );
45
- emit InboxMessageDelivered(num, initMsg);
16
+ function _enqueueInitializationMsg(bytes memory initMsg) internal override returns (uint256) {
17
+ return
18
+ IEthBridge(address(bridge)).enqueueDelayedMessage(
19
+ INITIALIZATION_MSG_TYPE,
20
+ address(0),
21
+ keccak256(initMsg)
22
+ );
46
23
  }
47
24
  }
@@ -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;
@@ -12,45 +12,12 @@ import "../bridge/ISequencerInbox.sol";
12
12
  import "../bridge/IBridge.sol";
13
13
  import "../bridge/IOutbox.sol";
14
14
  import "../bridge/IInbox.sol";
15
+ import "./Node.sol";
15
16
  import "./IRollupEventInbox.sol";
16
- import "./IRollupLogic.sol";
17
-
18
- struct Config {
19
- uint64 confirmPeriodBlocks;
20
- uint64 extraChallengeTimeBlocks;
21
- address stakeToken;
22
- uint256 baseStake;
23
- bytes32 wasmModuleRoot;
24
- address owner;
25
- address loserStakeEscrow;
26
- uint256 chainId;
27
- string chainConfig;
28
- uint64 genesisBlockNum;
29
- ISequencerInbox.MaxTimeVariation sequencerInboxMaxTimeVariation;
30
- }
31
-
32
- struct ContractDependencies {
33
- IBridge bridge;
34
- ISequencerInbox sequencerInbox;
35
- IInbox inbox;
36
- IOutbox outbox;
37
- IRollupEventInbox rollupEventInbox;
38
- IChallengeManager challengeManager;
39
- IRollupAdmin rollupAdminLogic;
40
- IRollupUser rollupUserLogic;
41
- // misc contracts that are useful when interacting with the rollup
42
- address validatorUtils;
43
- address validatorWalletCreator;
44
- }
45
17
 
46
18
  library RollupLib {
47
19
  using GlobalStateLib for GlobalState;
48
20
 
49
- struct ExecutionState {
50
- GlobalState globalState;
51
- MachineStatus machineStatus;
52
- }
53
-
54
21
  function stateHash(ExecutionState calldata execState, uint256 inboxMaxCount)
55
22
  internal
56
23
  pure
@@ -82,12 +49,6 @@ library RollupLib {
82
49
  );
83
50
  }
84
51
 
85
- struct Assertion {
86
- ExecutionState beforeState;
87
- ExecutionState afterState;
88
- uint64 numBlocks;
89
- }
90
-
91
52
  function executionHash(Assertion memory assertion) internal pure returns (bytes32) {
92
53
  MachineStatus[2] memory statuses;
93
54
  statuses[0] = assertion.beforeState.machineStatus;
@@ -1,11 +1,12 @@
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 "../libraries/AdminFallbackProxy.sol";
8
- import "./IRollupLogic.sol";
8
+ import "./IRollupAdmin.sol";
9
+ import "./Config.sol";
9
10
 
10
11
  contract RollupProxy is AdminFallbackProxy {
11
12
  function initializeProxy(Config memory config, ContractDependencies memory connectedContracts)
@@ -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;
@@ -9,6 +9,8 @@ import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
9
9
  import {IRollupUser} from "./IRollupLogic.sol";
10
10
  import "../libraries/UUPSNotUpgradeable.sol";
11
11
  import "./RollupCore.sol";
12
+ import "./IRollupLogic.sol";
13
+
12
14
  import {ETH_POS_BLOCK_TIME} from "../libraries/Constants.sol";
13
15
 
14
16
  abstract contract AbsRollupUserLogic is
@@ -189,7 +191,7 @@ abstract contract AbsRollupUserLogic is
189
191
  * @param expectedNodeHash The hash of the node being created (protects against reorgs)
190
192
  */
191
193
  function stakeOnNewNode(
192
- RollupLib.Assertion calldata assertion,
194
+ Assertion calldata assertion,
193
195
  bytes32 expectedNodeHash,
194
196
  uint256 prevNodeInboxMaxCount
195
197
  ) public onlyValidator whenNotPaused {
@@ -632,7 +634,7 @@ contract RollupUserLogic is AbsRollupUserLogic, IRollupUser {
632
634
  * @param prevNodeInboxMaxCount Total of messages in the inbox as of the previous node
633
635
  */
634
636
  function newStakeOnNewNode(
635
- RollupLib.Assertion calldata assertion,
637
+ Assertion calldata assertion,
636
638
  bytes32 expectedNodeHash,
637
639
  uint256 prevNodeInboxMaxCount
638
640
  ) external payable override {
@@ -701,7 +703,7 @@ contract ERC20RollupUserLogic is AbsRollupUserLogic, IRollupUserERC20 {
701
703
  */
702
704
  function newStakeOnNewNode(
703
705
  uint256 tokenAmount,
704
- RollupLib.Assertion calldata assertion,
706
+ Assertion calldata assertion,
705
707
  bytes32 expectedNodeHash,
706
708
  uint256 prevNodeInboxMaxCount
707
709
  ) external override {
@@ -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;
@@ -8,6 +8,7 @@ pragma experimental ABIEncoderV2;
8
8
 
9
9
  import "../rollup/IRollupCore.sol";
10
10
  import "../challenge/IChallengeManager.sol";
11
+ import "./IRollupLogic.sol";
11
12
 
12
13
  import {NO_CHAL_INDEX} from "../libraries/Constants.sol";
13
14
 
@@ -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;
@@ -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;
@@ -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;
@@ -10,7 +10,7 @@ import "./Machine.sol";
10
10
  import "./Instructions.sol";
11
11
  import "./StackFrame.sol";
12
12
  import "./MerkleProof.sol";
13
- import "./ModuleMemory.sol";
13
+ import "./ModuleMemoryCompact.sol";
14
14
  import "./Module.sol";
15
15
  import "./GlobalState.sol";
16
16
 
@@ -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;