@arbitrum/nitro-contracts 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/{LICENSE → LICENSE.md} +18 -16
  2. package/README.md +14 -0
  3. package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
  4. package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
  5. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
  6. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
  7. package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +1 -1
  8. package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
  9. package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +1 -1
  10. package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
  11. package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
  12. package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +1 -1
  13. package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
  14. package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
  15. package/build/contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
  16. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
  17. package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
  18. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
  19. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  20. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
  21. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
  22. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +1 -1
  23. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  24. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  25. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
  26. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
  27. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  28. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  29. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
  30. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
  31. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
  32. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
  33. package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
  34. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
  35. package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
  36. package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  37. package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -2
  38. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
  39. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +2 -2
  40. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
  41. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +2 -2
  42. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
  43. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.json +2 -2
  44. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
  45. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.json +2 -2
  46. package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
  47. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
  48. package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
  49. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
  50. package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
  51. package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
  52. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
  53. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
  54. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
  55. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
  56. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.json +184 -22
  57. package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
  58. package/build/contracts/src/bridge/Inbox.sol/Inbox.json +2 -2
  59. package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
  60. package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
  61. package/build/contracts/src/bridge/Outbox.sol/Outbox.json +2 -2
  62. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
  63. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +249 -29
  64. package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +1 -1
  65. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +1 -1
  66. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json +31 -2
  67. package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +1 -1
  68. package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.dbg.json +1 -1
  69. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
  70. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
  71. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
  72. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
  73. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
  74. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
  75. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
  76. package/build/contracts/src/libraries/GasRefundEnabled.sol/GasRefundEnabled.dbg.json +4 -0
  77. package/build/contracts/src/libraries/{IGasRefunder.sol → GasRefundEnabled.sol}/GasRefundEnabled.json +1 -1
  78. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
  79. package/build/contracts/src/libraries/IReader4844.sol/IReader4844.dbg.json +4 -0
  80. package/build/contracts/src/libraries/IReader4844.sol/IReader4844.json +37 -0
  81. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
  82. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.json +2 -2
  83. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
  84. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
  85. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +2 -2
  86. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
  87. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -2
  88. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
  89. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +4 -4
  90. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.dbg.json +1 -1
  91. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.json +2 -2
  92. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
  93. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
  94. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +257 -37
  95. package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
  96. package/build/contracts/src/mocks/Simple.sol/Simple.json +45 -2
  97. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
  98. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +1 -1
  99. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +31 -2
  100. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +1 -1
  101. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +31 -2
  102. package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
  103. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
  104. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
  105. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
  106. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
  107. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
  108. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.json +2 -2
  109. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
  110. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
  111. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.json +2 -2
  112. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
  113. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.json +2 -2
  114. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
  115. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.json +2 -2
  116. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
  117. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.json +2 -2
  118. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
  119. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.json +2 -2
  120. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
  121. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
  122. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
  123. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
  124. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
  125. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
  126. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.json +65 -0
  127. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
  128. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
  129. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
  130. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.json +18 -0
  131. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
  132. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
  133. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
  134. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
  135. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
  136. package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
  137. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
  138. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +10 -10
  139. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
  140. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +2 -2
  141. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
  142. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.json +2 -2
  143. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
  144. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.json +8 -8
  145. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
  146. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
  147. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
  148. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +1 -1
  149. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +1 -1
  150. package/build/contracts/src/rollup/Node.sol/NodeLib.dbg.json +1 -1
  151. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
  152. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +10 -10
  153. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
  154. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
  155. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +20 -15
  156. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
  157. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +2 -2
  158. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
  159. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +2 -2
  160. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
  161. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +10 -10
  162. package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +1 -1
  163. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +1 -1
  164. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +2 -2
  165. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
  166. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +2 -2
  167. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +1 -1
  168. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +2 -2
  169. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
  170. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +2 -2
  171. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
  172. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +2 -2
  173. package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
  174. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
  175. package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
  176. package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
  177. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
  178. package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
  179. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
  180. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
  181. package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
  182. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
  183. package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
  184. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
  185. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
  186. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
  187. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +2 -2
  188. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
  189. package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
  190. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
  191. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
  192. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +2 -2
  193. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
  194. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.json +26 -2
  195. package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
  196. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
  197. package/out/yul/Reader4844.yul/Reader4844.json +1 -0
  198. package/package.json +12 -7
  199. package/src/bridge/GasRefunder.sol +2 -0
  200. package/src/bridge/IBridge.sol +22 -0
  201. package/src/bridge/ISequencerInbox.sol +73 -26
  202. package/src/bridge/SequencerInbox.sol +426 -140
  203. package/src/challenge/ChallengeManager.sol +6 -0
  204. package/src/libraries/Error.sol +27 -0
  205. package/src/libraries/GasRefundEnabled.sol +52 -0
  206. package/src/libraries/IGasRefunder.sol +0 -25
  207. package/src/libraries/IReader4844.sol +13 -0
  208. package/src/mocks/InboxStub.sol +2 -2
  209. package/src/mocks/SequencerInboxStub.sol +11 -6
  210. package/src/mocks/Simple.sol +31 -1
  211. package/src/osp/OneStepProverHostIo.sol +100 -7
  212. package/src/precompiles/ArbGasInfo.sol +20 -0
  213. package/src/precompiles/ArbOwnerPublic.sol +8 -0
  214. package/src/rollup/BridgeCreator.sol +1 -1
  215. package/src/rollup/RollupCreator.sol +31 -19
  216. package/src/rollup/ValidatorWallet.sol +4 -3
  217. package/src/test-helpers/RollupMock.sol +6 -0
  218. package/build/contracts/src/libraries/IGasRefunder.sol/GasRefundEnabled.dbg.json +0 -4
@@ -110,6 +110,12 @@ contract ChallengeManager is DelegateCallAware, IChallengeManager {
110
110
  osp = osp_;
111
111
  }
112
112
 
113
+ function postUpgradeInit(IOneStepProofEntry osp_) external onlyDelegated onlyProxyOwner {
114
+ // when updating to 4844 we need to create new osp contracts and set them here
115
+ // on the challenge manager
116
+ osp = osp_;
117
+ }
118
+
113
119
  function createChallenge(
114
120
  bytes32 wasmModuleRoot_,
115
121
  MachineStatus[2] calldata startAndEndMachineStatuses_,
@@ -176,5 +176,32 @@ error AlreadyValidDASKeyset(bytes32);
176
176
  /// @dev Tried to use or invalidate an already invalid Data Availability Service keyset
177
177
  error NoSuchKeyset(bytes32);
178
178
 
179
+ /// @dev Thrown when the provided address is not the designated batch poster manager
180
+ error NotBatchPosterManager(address);
181
+
182
+ /// @dev Thrown when a data blob feature is attempted to be used on a chain that doesnt support it
183
+ error DataBlobsNotSupported();
184
+
185
+ /// @dev Thrown when an init param was supplied as empty
186
+ error InitParamZero(string name);
187
+
188
+ /// @dev Thrown when data hashes where expected but not where present on the tx
189
+ error MissingDataHashes();
190
+
191
+ /// @dev Thrown when the data blob meta data is invalid
192
+ error InvalidBlobMetadata();
193
+
179
194
  /// @dev Thrown when rollup is not updated with updateRollupAddress
180
195
  error RollupNotChanged();
196
+
197
+ /// @dev Batch data was empty when non empty was expected
198
+ error EmptyBatchData();
199
+
200
+ /// @dev Unsupported header flag was provided
201
+ error InvalidHeaderFlag(bytes1);
202
+
203
+ /// @dev SequencerInbox and Bridge are not in the same feeToken/ETH mode
204
+ error NativeTokenMismatch();
205
+
206
+ /// @dev Thrown when a deprecated function is called
207
+ error Deprecated();
@@ -0,0 +1,52 @@
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
+ // solhint-disable-next-line compiler-version
6
+ pragma solidity ^0.8.0;
7
+
8
+ import "./IReader4844.sol";
9
+ import "./IGasRefunder.sol";
10
+
11
+ abstract contract GasRefundEnabled {
12
+ uint256 internal immutable gasPerBlob = 2**17;
13
+
14
+ /// @dev this refunds the sender for execution costs of the tx
15
+ /// calldata costs are only refunded if `msg.sender == tx.origin` to guarantee the value refunded relates to charging
16
+ /// for the `tx.input`. this avoids a possible attack where you generate large calldata from a contract and get over-refunded
17
+ modifier refundsGas(IGasRefunder gasRefunder, IReader4844 reader4844) {
18
+ uint256 startGasLeft = gasleft();
19
+ _;
20
+ if (address(gasRefunder) != address(0)) {
21
+ uint256 calldataSize = msg.data.length;
22
+ uint256 calldataWords = (calldataSize + 31) / 32;
23
+ // account for the CALLDATACOPY cost of the proxy contract, including the memory expansion cost
24
+ startGasLeft += calldataWords * 6 + (calldataWords**2) / 512;
25
+ // if triggered in a contract call, the spender may be overrefunded by appending dummy data to the call
26
+ // so we check if it is a top level call, which would mean the sender paid calldata as part of tx.input
27
+ // solhint-disable-next-line avoid-tx-origin
28
+ if (msg.sender != tx.origin) {
29
+ // We can't be sure if this calldata came from the top level tx,
30
+ // so to be safe we tell the gas refunder there was no calldata.
31
+ calldataSize = 0;
32
+ } else {
33
+ // for similar reasons to above we only refund blob gas when the tx.origin is the msg.sender
34
+ // this avoids the caller being able to send blobs to other contracts and still get refunded here
35
+ if (address(reader4844) != address(0)) {
36
+ // add any cost for 4844 data, the data hash reader throws an error prior to 4844 being activated
37
+ // we do this addition here rather in the GasRefunder so that we can check the msg.sender is the tx.origin
38
+ try reader4844.getDataHashes() returns (bytes32[] memory dataHashes) {
39
+ if (dataHashes.length != 0) {
40
+ uint256 blobBasefee = reader4844.getBlobBaseFee();
41
+ startGasLeft +=
42
+ (dataHashes.length * gasPerBlob * blobBasefee) /
43
+ block.basefee;
44
+ }
45
+ } catch {}
46
+ }
47
+ }
48
+
49
+ gasRefunder.onGasSpent(payable(msg.sender), startGasLeft - gasleft(), calldataSize);
50
+ }
51
+ }
52
+ }
@@ -12,28 +12,3 @@ interface IGasRefunder {
12
12
  uint256 calldataSize
13
13
  ) external returns (bool success);
14
14
  }
15
-
16
- abstract contract GasRefundEnabled {
17
- /// @dev this refunds the sender for execution costs of the tx
18
- /// calldata costs are only refunded if `msg.sender == tx.origin` to guarantee the value refunded relates to charging
19
- /// for the `tx.input`. this avoids a possible attack where you generate large calldata from a contract and get over-refunded
20
- modifier refundsGas(IGasRefunder gasRefunder) {
21
- uint256 startGasLeft = gasleft();
22
- _;
23
- if (address(gasRefunder) != address(0)) {
24
- uint256 calldataSize = msg.data.length;
25
- uint256 calldataWords = (calldataSize + 31) / 32;
26
- // account for the CALLDATACOPY cost of the proxy contract, including the memory expansion cost
27
- startGasLeft += calldataWords * 6 + (calldataWords**2) / 512;
28
- // if triggered in a contract call, the spender may be overrefunded by appending dummy data to the call
29
- // so we check if it is a top level call, which would mean the sender paid calldata as part of tx.input
30
- // solhint-disable-next-line avoid-tx-origin
31
- if (msg.sender != tx.origin) {
32
- // We can't be sure if this calldata came from the top level tx,
33
- // so to be safe we tell the gas refunder there was no calldata.
34
- calldataSize = 0;
35
- }
36
- gasRefunder.onGasSpent(payable(msg.sender), startGasLeft - gasleft(), calldataSize);
37
- }
38
- }
39
- }
@@ -0,0 +1,13 @@
1
+ // Copyright 2023-2024, 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.6.9 <0.9.0;
6
+
7
+ interface IReader4844 {
8
+ /// @notice Returns the current BLOBBASEFEE
9
+ function getBlobBaseFee() external view returns (uint256);
10
+
11
+ /// @notice Returns all the data hashes of all the blobs on the current transaction
12
+ function getDataHashes() external view returns (bytes32[] memory);
13
+ }
@@ -163,7 +163,7 @@ contract InboxStub is IInboxBase, IInbox {
163
163
  address,
164
164
  uint256,
165
165
  bytes calldata
166
- ) external returns (uint256) {
166
+ ) external pure returns (uint256) {
167
167
  revert("NOT_IMPLEMENTED");
168
168
  }
169
169
 
@@ -173,7 +173,7 @@ contract InboxStub is IInboxBase, IInbox {
173
173
  uint256,
174
174
  uint256,
175
175
  address
176
- ) external returns (uint256) {
176
+ ) external pure returns (uint256) {
177
177
  revert("NOT_IMPLEMENTED");
178
178
  }
179
179
 
@@ -13,11 +13,16 @@ contract SequencerInboxStub is SequencerInbox {
13
13
  IBridge bridge_,
14
14
  address sequencer_,
15
15
  ISequencerInbox.MaxTimeVariation memory maxTimeVariation_,
16
- uint256 maxDataSize_
17
- ) SequencerInbox(maxDataSize_) {
16
+ uint256 maxDataSize_,
17
+ IReader4844 reader4844_,
18
+ bool isUsingFeeToken_
19
+ ) SequencerInbox(maxDataSize_, reader4844_, isUsingFeeToken_) {
18
20
  bridge = bridge_;
19
21
  rollup = IOwnable(msg.sender);
20
- maxTimeVariation = maxTimeVariation_;
22
+ delayBlocks = maxTimeVariation_.delayBlocks;
23
+ futureBlocks = maxTimeVariation_.futureBlocks;
24
+ delaySeconds = maxTimeVariation_.delaySeconds;
25
+ futureSeconds = maxTimeVariation_.futureSeconds;
21
26
  isBatchPoster[sequencer_] = true;
22
27
  }
23
28
 
@@ -30,7 +35,7 @@ contract SequencerInboxStub is SequencerInbox {
30
35
  );
31
36
  require(num == 0, "ALREADY_DELAYED_INIT");
32
37
  emit InboxMessageDelivered(num, initMsg);
33
- (bytes32 dataHash, TimeBounds memory timeBounds) = formEmptyDataHash(1);
38
+ (bytes32 dataHash, IBridge.TimeBounds memory timeBounds) = formEmptyDataHash(1);
34
39
  (
35
40
  uint256 sequencerMessageCount,
36
41
  bytes32 beforeAcc,
@@ -45,11 +50,11 @@ contract SequencerInboxStub is SequencerInbox {
45
50
  delayedAcc,
46
51
  totalDelayedMessagesRead,
47
52
  timeBounds,
48
- BatchDataLocation.NoData
53
+ IBridge.BatchDataLocation.NoData
49
54
  );
50
55
  }
51
56
 
52
- function getTimeBounds() internal view override returns (TimeBounds memory bounds) {
57
+ function getTimeBounds() internal view override returns (IBridge.TimeBounds memory bounds) {
53
58
  this; // silence warning about function not being view
54
59
  return bounds;
55
60
  }
@@ -4,11 +4,13 @@
4
4
 
5
5
  pragma solidity ^0.8.0;
6
6
 
7
+ import "../bridge/ISequencerInbox.sol";
7
8
  import "../precompiles/ArbRetryableTx.sol";
8
9
  import "../precompiles/ArbSys.sol";
9
10
 
10
11
  contract Simple {
11
12
  uint64 public counter;
13
+ uint256 public difficulty;
12
14
 
13
15
  event CounterEvent(uint64 count);
14
16
  event RedeemedEvent(address caller, address redeemer);
@@ -30,6 +32,7 @@ contract Simple {
30
32
  }
31
33
 
32
34
  function incrementRedeem() external {
35
+ // solhint-disable-next-line avoid-tx-origin
33
36
  require(msg.sender == tx.origin, "SENDER_NOT_ORIGIN");
34
37
  require(ArbSys(address(0x64)).wasMyCallersAddressAliased(), "NOT_ALIASED");
35
38
  counter++;
@@ -45,8 +48,12 @@ contract Simple {
45
48
  return block.number;
46
49
  }
47
50
 
51
+ function storeDifficulty() external {
52
+ difficulty = block.difficulty;
53
+ }
54
+
48
55
  function getBlockDifficulty() external view returns (uint256) {
49
- return block.difficulty;
56
+ return difficulty;
50
57
  }
51
58
 
52
59
  function noop() external pure {}
@@ -93,6 +100,7 @@ contract Simple {
93
100
  useTopLevel,
94
101
  delegateCase
95
102
  );
103
+ // solhint-disable-next-line avoid-low-level-calls
96
104
  (bool success, ) = address(this).delegatecall(data);
97
105
  require(success, "DELEGATE_CALL_FAILED");
98
106
 
@@ -113,6 +121,7 @@ contract Simple {
113
121
  useTopLevel,
114
122
  callCase
115
123
  );
124
+ // solhint-disable-next-line avoid-low-level-calls
116
125
  (success, ) = address(this).call(data);
117
126
  require(success, "CALL_FAILED");
118
127
  }
@@ -121,8 +130,29 @@ contract Simple {
121
130
  uint256 before = gasleft();
122
131
  // The inner call may revert, but we still want to return the amount of gas used,
123
132
  // so we ignore the result of this call.
133
+ // solhint-disable-next-line avoid-low-level-calls
124
134
  // solc-ignore-next-line unused-call-retval
125
135
  to.staticcall{gas: before - 10000}(input);
126
136
  return before - gasleft();
127
137
  }
138
+
139
+ function postManyBatches(
140
+ ISequencerInbox sequencerInbox,
141
+ bytes memory batchData,
142
+ uint256 numberToPost
143
+ ) external {
144
+ uint256 sequenceNumber = sequencerInbox.batchCount();
145
+ uint256 delayedMessagesRead = sequencerInbox.totalDelayedMessagesRead();
146
+ for (uint256 i = 0; i < numberToPost; i++) {
147
+ sequencerInbox.addSequencerL2Batch(
148
+ sequenceNumber,
149
+ batchData,
150
+ delayedMessagesRead,
151
+ IGasRefunder(address(0)),
152
+ 0,
153
+ 0
154
+ );
155
+ sequenceNumber++;
156
+ }
157
+ }
128
158
  }
@@ -101,16 +101,35 @@ contract OneStepProverHostIo is IOneStepProver {
101
101
  state.u64Vals[idx] = val;
102
102
  }
103
103
 
104
+ uint256 internal constant BLS_MODULUS =
105
+ 52435875175126190479447740508185965837690552500527637822603658699938581184513;
106
+ uint256 internal constant PRIMITIVE_ROOT_OF_UNITY =
107
+ 10238227357739495823651030575849232062558860180284477541189508159991286009131;
108
+
109
+ // Computes b**e % m
110
+ // Really pure but the Solidity compiler sees the staticcall and requires view
111
+ function modExp256(
112
+ uint256 b,
113
+ uint256 e,
114
+ uint256 m
115
+ ) internal view returns (uint256) {
116
+ bytes memory modExpInput = abi.encode(32, 32, 32, b, e, m);
117
+ (bool modexpSuccess, bytes memory modExpOutput) = address(0x05).staticcall(modExpInput);
118
+ require(modexpSuccess, "MODEXP_FAILED");
119
+ require(modExpOutput.length == 32, "MODEXP_WRONG_LENGTH");
120
+ return uint256(bytes32(modExpOutput));
121
+ }
122
+
104
123
  function executeReadPreImage(
105
124
  ExecutionContext calldata,
106
125
  Machine memory mach,
107
126
  Module memory mod,
108
- Instruction calldata,
127
+ Instruction calldata inst,
109
128
  bytes calldata proof
110
- ) internal pure {
129
+ ) internal view {
111
130
  uint256 preimageOffset = mach.valueStack.pop().assumeI32();
112
131
  uint256 ptr = mach.valueStack.pop().assumeI32();
113
- if (ptr + 32 > mod.moduleMemory.size || ptr % LEAF_SIZE != 0) {
132
+ if (preimageOffset % 32 != 0 || ptr + 32 > mod.moduleMemory.size || ptr % LEAF_SIZE != 0) {
114
133
  mach.status = MachineStatus.ERRORED;
115
134
  return;
116
135
  }
@@ -128,18 +147,92 @@ contract OneStepProverHostIo is IOneStepProver {
128
147
  bytes memory extracted;
129
148
  uint8 proofType = uint8(proof[proofOffset]);
130
149
  proofOffset++;
131
- if (proofType == 0) {
150
+ // These values must be kept in sync with `arbitrator/arbutil/src/types.rs`
151
+ // and `arbutil/preimage_type.go` (both in the nitro repo).
152
+ if (inst.argumentData == 0) {
153
+ // The machine is asking for a keccak256 preimage
154
+
155
+ if (proofType == 0) {
156
+ bytes calldata preimage = proof[proofOffset:];
157
+ require(keccak256(preimage) == leafContents, "BAD_PREIMAGE");
158
+
159
+ uint256 preimageEnd = preimageOffset + 32;
160
+ if (preimageEnd > preimage.length) {
161
+ preimageEnd = preimage.length;
162
+ }
163
+ extracted = preimage[preimageOffset:preimageEnd];
164
+ } else {
165
+ // TODO: support proving via an authenticated contract
166
+ revert("UNKNOWN_PREIMAGE_PROOF");
167
+ }
168
+ } else if (inst.argumentData == 1) {
169
+ // The machine is asking for a sha2-256 preimage
170
+
171
+ require(proofType == 0, "UNKNOWN_PREIMAGE_PROOF");
132
172
  bytes calldata preimage = proof[proofOffset:];
133
- require(keccak256(preimage) == leafContents, "BAD_PREIMAGE");
173
+ require(sha256(preimage) == leafContents, "BAD_PREIMAGE");
134
174
 
135
175
  uint256 preimageEnd = preimageOffset + 32;
136
176
  if (preimageEnd > preimage.length) {
137
177
  preimageEnd = preimage.length;
138
178
  }
139
179
  extracted = preimage[preimageOffset:preimageEnd];
180
+ } else if (inst.argumentData == 2) {
181
+ // The machine is asking for an Ethereum versioned hash preimage
182
+
183
+ require(proofType == 0, "UNKNOWN_PREIMAGE_PROOF");
184
+
185
+ // kzgProof should be a valid input to the EIP-4844 point evaluation precompile at address 0x0A.
186
+ // It should prove the preimageOffset/32'th word of the machine's requested KZG commitment.
187
+ bytes calldata kzgProof = proof[proofOffset:];
188
+
189
+ require(bytes32(kzgProof[:32]) == leafContents, "KZG_PROOF_WRONG_HASH");
190
+
191
+ uint256 fieldElementsPerBlob;
192
+ uint256 blsModulus;
193
+ {
194
+ (bool success, bytes memory kzgParams) = address(0x0A).staticcall(kzgProof);
195
+ require(success, "INVALID_KZG_PROOF");
196
+ require(kzgParams.length > 0, "KZG_PRECOMPILE_MISSING");
197
+ (fieldElementsPerBlob, blsModulus) = abi.decode(kzgParams, (uint256, uint256));
198
+ }
199
+
200
+ // With a hardcoded PRIMITIVE_ROOT_OF_UNITY, we can only support this BLS modulus.
201
+ // It may be worth in the future supporting arbitrary BLS moduli, but we would likely need to
202
+ // validate a user-supplied root of unity.
203
+ require(blsModulus == BLS_MODULUS, "UNKNOWN_BLS_MODULUS");
204
+
205
+ // If preimageOffset is greater than or equal to the blob size, leave extracted empty and call it here.
206
+ if (preimageOffset < fieldElementsPerBlob * 32) {
207
+ // We need to compute what point the polynomial should be evaluated at to get the right part of the preimage.
208
+ // KZG commitments use a bit reversal permutation to order the roots of unity.
209
+ // To account for that, we reverse the bit order of the index.
210
+ uint256 bitReversedIndex = 0;
211
+ // preimageOffset was required to be 32 byte aligned above
212
+ uint256 tmp = preimageOffset / 32;
213
+ for (uint256 i = 1; i < fieldElementsPerBlob; i <<= 1) {
214
+ bitReversedIndex <<= 1;
215
+ if (tmp & 1 == 1) {
216
+ bitReversedIndex |= 1;
217
+ }
218
+ tmp >>= 1;
219
+ }
220
+
221
+ // First, we get the root of unity of order 2**fieldElementsPerBlob.
222
+ // We start with a root of unity of order 2**32 and then raise it to
223
+ // the power of (2**32)/fieldElementsPerBlob to get root of unity we need.
224
+ uint256 rootOfUnityPower = (1 << 32) / fieldElementsPerBlob;
225
+ // Then, we raise the root of unity to the power of bitReversedIndex,
226
+ // to retrieve this word of the KZG commitment.
227
+ rootOfUnityPower *= bitReversedIndex;
228
+ // z is the point the polynomial is evaluated at to retrieve this word of data
229
+ uint256 z = modExp256(PRIMITIVE_ROOT_OF_UNITY, rootOfUnityPower, blsModulus);
230
+ require(bytes32(kzgProof[32:64]) == bytes32(z), "KZG_PROOF_WRONG_Z");
231
+
232
+ extracted = kzgProof[64:96];
233
+ }
140
234
  } else {
141
- // TODO: support proving via an authenticated contract
142
- revert("UNKNOWN_PREIMAGE_PROOF");
235
+ revert("UNKNOWN_PREIMAGE_TYPE");
143
236
  }
144
237
 
145
238
  for (uint256 i = 0; i < extracted.length; i++) {
@@ -129,4 +129,24 @@ interface ArbGasInfo {
129
129
 
130
130
  /// @notice Returns the available funds from L1 fees
131
131
  function getL1FeesAvailable() external view returns (uint256);
132
+
133
+ /// @notice Returns the equilibration units parameter for L1 price adjustment algorithm
134
+ /// Available in ArbOS version 20
135
+ function getL1PricingEquilibrationUnits() external view returns (uint256);
136
+
137
+ /// @notice Returns the last time the L1 calldata pricer was updated.
138
+ /// Available in ArbOS version 20
139
+ function getLastL1PricingUpdateTime() external view returns (uint64);
140
+
141
+ /// @notice Returns the amount of L1 calldata payments due for rewards (per the L1 reward rate)
142
+ /// Available in ArbOS version 20
143
+ function getL1PricingFundsDueForRewards() external view returns (uint256);
144
+
145
+ /// @notice Returns the amount of L1 calldata posted since the last update.
146
+ /// Available in ArbOS version 20
147
+ function getL1PricingUnitsSinceUpdate() external view returns (uint64);
148
+
149
+ /// @notice Returns the L1 pricing surplus as of the last update (may be negative).
150
+ /// Available in ArbOS version 20
151
+ function getLastL1PricingSurplus() external view returns (int256);
132
152
  }
@@ -29,5 +29,13 @@ interface ArbOwnerPublic {
29
29
  /// @notice Get the Brotli compression level used for fast compression
30
30
  function getBrotliCompressionLevel() external view returns (uint64);
31
31
 
32
+ /// @notice Get the next scheduled ArbOS version upgrade and its activation timestamp.
33
+ /// Returns (0, 0) if no ArbOS upgrade is scheduled.
34
+ /// Available in ArbOS version 20.
35
+ function getScheduledUpgrade()
36
+ external
37
+ view
38
+ returns (uint64 arbosVersion, uint64 scheduledForTimestamp);
39
+
32
40
  event ChainOwnerRectified(address rectifiedOwner);
33
41
  }
@@ -96,7 +96,7 @@ contract BridgeCreator is Ownable {
96
96
  } else {
97
97
  IERC20Bridge(address(frame.bridge)).initialize(IOwnable(rollup), nativeToken);
98
98
  }
99
- frame.sequencerInbox.initialize(frame.bridge, maxTimeVariation);
99
+ frame.sequencerInbox.initialize(IBridge(frame.bridge), maxTimeVariation);
100
100
  frame.inbox.initialize(frame.bridge, frame.sequencerInbox);
101
101
  frame.rollupEventInbox.initialize(frame.bridge);
102
102
  frame.outbox.initialize(frame.bridge);
@@ -35,12 +35,14 @@ contract RollupCreator is Ownable {
35
35
 
36
36
  struct RollupDeploymentParams {
37
37
  Config config;
38
- address batchPoster;
39
38
  address[] validators;
40
39
  uint256 maxDataSize;
41
40
  address nativeToken;
42
41
  bool deployFactoriesToL2;
43
42
  uint256 maxFeePerGasForRetryables;
43
+ //// @dev The address of the batch poster, not used when set to zero address
44
+ address[] batchPosters;
45
+ address batchPosterManager;
44
46
  }
45
47
 
46
48
  BridgeCreator public bridgeCreator;
@@ -102,6 +104,7 @@ contract RollupCreator is Ownable {
102
104
  * anyone can try to deploy factories and potentially burn the nonce 0 (ie. due to gas price spike when doing direct
103
105
  * L2 TX). That would mean we permanently lost capability to deploy deterministic factory at expected address.
104
106
  * - maxFeePerGasForRetryables price bid for L2 execution.
107
+ * - dataHashReader The address of the data hash reader used to read blob hashes
105
108
  * @return The address of the newly created rollup
106
109
  */
107
110
  function createRollup(RollupDeploymentParams memory deployParams)
@@ -109,22 +112,27 @@ contract RollupCreator is Ownable {
109
112
  payable
110
113
  returns (address)
111
114
  {
112
- // Make sure the immutable maxDataSize is as expected
113
- (, ISequencerInbox ethSequencerInbox, IInboxBase ethInbox, , ) = bridgeCreator
114
- .ethBasedTemplates();
115
- require(
116
- deployParams.maxDataSize == ethSequencerInbox.maxDataSize(),
117
- "SI_MAX_DATA_SIZE_MISMATCH"
118
- );
119
- require(deployParams.maxDataSize == ethInbox.maxDataSize(), "I_MAX_DATA_SIZE_MISMATCH");
115
+ {
116
+ // Make sure the immutable maxDataSize is as expected
117
+ (, ISequencerInbox ethSequencerInbox, IInboxBase ethInbox, , ) = bridgeCreator
118
+ .ethBasedTemplates();
119
+ require(
120
+ deployParams.maxDataSize == ethSequencerInbox.maxDataSize(),
121
+ "SI_MAX_DATA_SIZE_MISMATCH"
122
+ );
123
+ require(deployParams.maxDataSize == ethInbox.maxDataSize(), "I_MAX_DATA_SIZE_MISMATCH");
120
124
 
121
- (, ISequencerInbox erc20SequencerInbox, IInboxBase erc20Inbox, , ) = bridgeCreator
122
- .erc20BasedTemplates();
123
- require(
124
- deployParams.maxDataSize == erc20SequencerInbox.maxDataSize(),
125
- "SI_MAX_DATA_SIZE_MISMATCH"
126
- );
127
- require(deployParams.maxDataSize == erc20Inbox.maxDataSize(), "I_MAX_DATA_SIZE_MISMATCH");
125
+ (, ISequencerInbox erc20SequencerInbox, IInboxBase erc20Inbox, , ) = bridgeCreator
126
+ .erc20BasedTemplates();
127
+ require(
128
+ deployParams.maxDataSize == erc20SequencerInbox.maxDataSize(),
129
+ "SI_MAX_DATA_SIZE_MISMATCH"
130
+ );
131
+ require(
132
+ deployParams.maxDataSize == erc20Inbox.maxDataSize(),
133
+ "I_MAX_DATA_SIZE_MISMATCH"
134
+ );
135
+ }
128
136
 
129
137
  // create proxy admin which will manage bridge contracts
130
138
  ProxyAdmin proxyAdmin = new ProxyAdmin();
@@ -180,9 +188,12 @@ contract RollupCreator is Ownable {
180
188
  })
181
189
  );
182
190
 
183
- // setting batch poster, if the address provided is not zero address
184
- if (deployParams.batchPoster != address(0)) {
185
- bridgeContracts.sequencerInbox.setIsBatchPoster(deployParams.batchPoster, true);
191
+ // Setting batch posters and batch poster manager
192
+ for (uint256 i = 0; i < deployParams.batchPosters.length; i++) {
193
+ bridgeContracts.sequencerInbox.setIsBatchPoster(deployParams.batchPosters[i], true);
194
+ }
195
+ if (deployParams.batchPosterManager != address(0)) {
196
+ bridgeContracts.sequencerInbox.setBatchPosterManager(deployParams.batchPosterManager);
186
197
  }
187
198
 
188
199
  // Call setValidator on the newly created rollup contract just if validator set is not empty
@@ -257,6 +268,7 @@ contract RollupCreator is Ownable {
257
268
  l2FactoriesDeployer.perform{value: cost}(_inbox, _nativeToken, _maxFeePerGas);
258
269
 
259
270
  // refund the caller
271
+ // solhint-disable-next-line avoid-low-level-calls
260
272
  (bool sent, ) = msg.sender.call{value: address(this).balance}("");
261
273
  require(sent, "Refund failed");
262
274
  } else {
@@ -7,6 +7,7 @@ pragma solidity ^0.8.0;
7
7
  import "../challenge/IChallengeManager.sol";
8
8
  import "../libraries/DelegateCallAware.sol";
9
9
  import "../libraries/IGasRefunder.sol";
10
+ import "../libraries/GasRefundEnabled.sol";
10
11
  import "@openzeppelin/contracts/utils/Address.sol";
11
12
  import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
12
13
 
@@ -109,7 +110,7 @@ contract ValidatorWallet is OwnableUpgradeable, DelegateCallAware, GasRefundEnab
109
110
  bytes[] calldata data,
110
111
  address[] calldata destination,
111
112
  uint256[] calldata amount
112
- ) public payable onlyExecutorOrOwner refundsGas(gasRefunder) {
113
+ ) public payable onlyExecutorOrOwner refundsGas(gasRefunder, IReader4844(address(0))) {
113
114
  uint256 numTxes = data.length;
114
115
  if (numTxes != destination.length) revert BadArrayLength(numTxes, destination.length);
115
116
  if (numTxes != amount.length) revert BadArrayLength(numTxes, amount.length);
@@ -144,7 +145,7 @@ contract ValidatorWallet is OwnableUpgradeable, DelegateCallAware, GasRefundEnab
144
145
  bytes calldata data,
145
146
  address destination,
146
147
  uint256 amount
147
- ) public payable onlyExecutorOrOwner refundsGas(gasRefunder) {
148
+ ) public payable onlyExecutorOrOwner refundsGas(gasRefunder, IReader4844(address(0))) {
148
149
  if (data.length > 0) require(destination.isContract(), "NO_CODE_AT_ADDR");
149
150
  validateExecuteTransaction(destination);
150
151
  // We use a low level call here to allow for contract and non-contract calls
@@ -168,7 +169,7 @@ contract ValidatorWallet is OwnableUpgradeable, DelegateCallAware, GasRefundEnab
168
169
  IGasRefunder gasRefunder,
169
170
  IChallengeManager manager,
170
171
  uint64[] calldata challenges
171
- ) public onlyExecutorOrOwner refundsGas(gasRefunder) {
172
+ ) public onlyExecutorOrOwner refundsGas(gasRefunder, IReader4844(address(0))) {
172
173
  uint256 challengesCount = challenges.length;
173
174
  for (uint256 i = 0; i < challengesCount; i++) {
174
175
  try manager.timeout(challenges[i]) {} catch (bytes memory error) {
@@ -8,6 +8,12 @@ contract RollupMock {
8
8
  event WithdrawTriggered();
9
9
  event ZombieTriggered();
10
10
 
11
+ address public owner;
12
+
13
+ constructor(address _owner) {
14
+ owner = _owner;
15
+ }
16
+
11
17
  function withdrawStakerFunds() external returns (uint256) {
12
18
  emit WithdrawTriggered();
13
19
  return 0;
@@ -1,4 +0,0 @@
1
- {
2
- "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/bd6d911e8af19014a6d3612fec6f93ac.json"
4
- }