@arbitrum/nitro-contracts 1.1.0-alpha.7 → 1.1.0-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (540) hide show
  1. package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
  2. package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
  3. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
  4. package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
  5. package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +1 -1
  6. package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
  7. package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +1 -1
  8. package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
  9. package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
  10. package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +1 -1
  11. package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +4 -0
  12. package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.json +10 -0
  13. package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
  14. package/build/contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
  15. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
  16. package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
  17. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
  18. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  19. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
  20. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +4 -0
  21. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.json +215 -0
  22. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +4 -0
  23. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.json +183 -0
  24. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  25. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  26. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
  27. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
  28. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  29. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  30. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +4 -0
  31. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.json +10 -0
  32. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +4 -0
  33. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.json +10 -0
  34. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +4 -0
  35. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.json +30 -0
  36. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +4 -0
  37. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.json +30 -0
  38. package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
  39. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
  40. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.json +26 -0
  41. package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
  42. package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  43. package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -2
  44. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
  45. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +7 -2
  46. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
  47. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +39 -2
  48. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
  49. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.json +2 -2
  50. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +4 -0
  51. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.json +539 -0
  52. package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
  53. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
  54. package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
  55. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
  56. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.json +26 -0
  57. package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
  58. package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
  59. package/build/contracts/src/bridge/IInbox.sol/IInbox.json +26 -0
  60. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
  61. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.json +26 -0
  62. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
  63. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.json +13 -0
  64. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
  65. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
  66. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.json +13 -0
  67. package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
  68. package/build/contracts/src/bridge/Inbox.sol/Inbox.json +39 -2
  69. package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
  70. package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
  71. package/build/contracts/src/bridge/Outbox.sol/Outbox.json +2 -2
  72. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
  73. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +26 -2
  74. package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +1 -1
  75. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +1 -1
  76. package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json +2 -2
  77. package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +1 -1
  78. package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.dbg.json +1 -1
  79. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
  80. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
  81. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
  82. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
  83. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
  84. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
  85. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
  86. package/build/contracts/src/libraries/IGasRefunder.sol/GasRefundEnabled.dbg.json +1 -1
  87. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
  88. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
  89. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.json +2 -2
  90. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
  91. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
  92. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +2 -2
  93. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
  94. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -2
  95. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
  96. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +33 -2
  97. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.dbg.json +1 -1
  98. package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.json +2 -2
  99. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
  100. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
  101. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +20 -2
  102. package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
  103. package/build/contracts/src/mocks/Simple.sol/Simple.json +2 -2
  104. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
  105. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +1 -1
  106. package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +2 -2
  107. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +1 -1
  108. package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +2 -2
  109. package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +4 -0
  110. package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.json +350 -0
  111. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
  112. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.json +43 -0
  113. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
  114. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
  115. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
  116. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
  117. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.json +2 -2
  118. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
  119. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
  120. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.json +2 -2
  121. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
  122. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.json +2 -2
  123. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
  124. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.json +2 -2
  125. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
  126. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.json +2 -2
  127. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
  128. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.json +2 -2
  129. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
  130. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
  131. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
  132. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
  133. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
  134. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
  135. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
  136. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
  137. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.json +13 -0
  138. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
  139. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.json +39 -0
  140. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
  141. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
  142. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
  143. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
  144. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
  145. package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
  146. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
  147. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +214 -83
  148. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +4 -0
  149. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +214 -0
  150. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
  151. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.json +2 -2
  152. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
  153. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
  154. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
  155. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
  156. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +1 -1
  157. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +1 -1
  158. package/build/contracts/src/rollup/Node.sol/NodeLib.dbg.json +1 -1
  159. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
  160. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +2 -2
  161. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
  162. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
  163. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +67 -24
  164. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
  165. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +2 -2
  166. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
  167. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +2 -2
  168. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
  169. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +2 -2
  170. package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +1 -1
  171. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +1 -1
  172. package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +2 -2
  173. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
  174. package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +2 -2
  175. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +1 -1
  176. package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +2 -2
  177. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
  178. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +2 -2
  179. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
  180. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +2 -2
  181. package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
  182. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
  183. package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
  184. package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
  185. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
  186. package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
  187. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
  188. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
  189. package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
  190. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
  191. package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
  192. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
  193. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
  194. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
  195. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +2 -2
  196. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
  197. package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
  198. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
  199. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
  200. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +2 -2
  201. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
  202. package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +4 -0
  203. package/build/contracts/src/test-helpers/TestToken.sol/TestToken.json +292 -0
  204. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
  205. package/package.json +9 -8
  206. package/src/bridge/AbsBridge.sol +1 -1
  207. package/src/bridge/AbsInbox.sol +27 -6
  208. package/src/bridge/AbsOutbox.sol +7 -0
  209. package/src/bridge/ERC20Bridge.sol +22 -5
  210. package/src/bridge/ERC20Inbox.sol +4 -1
  211. package/src/bridge/ERC20Outbox.sol +3 -0
  212. package/src/bridge/GasRefunder.sol +255 -0
  213. package/src/bridge/IERC20Bridge.sol +5 -3
  214. package/src/bridge/IInboxBase.sol +5 -0
  215. package/src/bridge/IOutbox.sol +2 -0
  216. package/src/bridge/ISequencerInbox.sol +2 -0
  217. package/src/bridge/Inbox.sol +2 -1
  218. package/src/bridge/Outbox.sol +4 -0
  219. package/src/bridge/SequencerInbox.sol +8 -4
  220. package/src/libraries/Constants.sol +0 -3
  221. package/src/libraries/Error.sol +3 -0
  222. package/src/mocks/InboxStub.sol +9 -0
  223. package/src/mocks/SequencerInboxStub.sol +3 -2
  224. package/src/mocks/Simple.sol +2 -1
  225. package/src/mocks/UpgradeExecutorMock.sol +82 -0
  226. package/src/node-interface/NodeInterface.sol +16 -0
  227. package/src/precompiles/ArbOwner.sol +6 -0
  228. package/src/precompiles/ArbOwnerPublic.sol +12 -0
  229. package/src/rollup/BridgeCreator.sol +90 -28
  230. package/src/rollup/DeployHelper.sol +149 -0
  231. package/src/rollup/RollupCreator.sol +124 -55
  232. package/src/test-helpers/TestToken.sol +16 -0
  233. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol/ERC20Burnable.dbg.json +0 -4
  234. package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol/ERC20Burnable.json +0 -312
  235. package/build/contracts/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol/ERC20PresetFixedSupply.dbg.json +0 -4
  236. package/build/contracts/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.sol/ERC20PresetFixedSupply.json +0 -338
  237. package/build/contracts/src/rollup/AbsBridgeCreator.sol/AbsBridgeCreator.dbg.json +0 -4
  238. package/build/contracts/src/rollup/AbsBridgeCreator.sol/AbsBridgeCreator.json +0 -167
  239. package/build/contracts/src/rollup/ERC20BridgeCreator.sol/ERC20BridgeCreator.dbg.json +0 -4
  240. package/build/contracts/src/rollup/ERC20BridgeCreator.sol/ERC20BridgeCreator.json +0 -248
  241. package/build/contracts/src/rollup/IBridgeCreator.sol/IBridgeCreator.dbg.json +0 -4
  242. package/build/contracts/src/rollup/IBridgeCreator.sol/IBridgeCreator.json +0 -109
  243. package/build/contracts/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator.dbg.json +0 -4
  244. package/build/contracts/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator.json +0 -185
  245. package/build/contracts/src/rollup/IBridgeCreator.sol/IEthBridgeCreator.dbg.json +0 -4
  246. package/build/contracts/src/rollup/IBridgeCreator.sol/IEthBridgeCreator.json +0 -180
  247. package/build/types/@openzeppelin/contracts/access/Ownable.ts +0 -175
  248. package/build/types/@openzeppelin/contracts/access/index.ts +0 -4
  249. package/build/types/@openzeppelin/contracts/index.ts +0 -11
  250. package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.ts +0 -87
  251. package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +0 -4
  252. package/build/types/@openzeppelin/contracts/interfaces/index.ts +0 -5
  253. package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +0 -108
  254. package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.ts +0 -108
  255. package/build/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -5
  256. package/build/types/@openzeppelin/contracts/proxy/Proxy.ts +0 -55
  257. package/build/types/@openzeppelin/contracts/proxy/beacon/IBeacon.ts +0 -87
  258. package/build/types/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.ts +0 -239
  259. package/build/types/@openzeppelin/contracts/proxy/beacon/index.ts +0 -5
  260. package/build/types/@openzeppelin/contracts/proxy/index.ts +0 -12
  261. package/build/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.ts +0 -359
  262. package/build/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.ts +0 -278
  263. package/build/types/@openzeppelin/contracts/proxy/transparent/index.ts +0 -5
  264. package/build/types/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.ts +0 -216
  265. package/build/types/@openzeppelin/contracts/proxy/utils/index.ts +0 -4
  266. package/build/types/@openzeppelin/contracts/token/ERC20/ERC20.ts +0 -444
  267. package/build/types/@openzeppelin/contracts/token/ERC20/IERC20.ts +0 -322
  268. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.ts +0 -507
  269. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +0 -364
  270. package/build/types/@openzeppelin/contracts/token/ERC20/extensions/index.ts +0 -5
  271. package/build/types/@openzeppelin/contracts/token/ERC20/index.ts +0 -9
  272. package/build/types/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.ts +0 -507
  273. package/build/types/@openzeppelin/contracts/token/ERC20/presets/index.ts +0 -4
  274. package/build/types/@openzeppelin/contracts/token/index.ts +0 -5
  275. package/build/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.ts +0 -175
  276. package/build/types/@openzeppelin/contracts-upgradeable/access/index.ts +0 -4
  277. package/build/types/@openzeppelin/contracts-upgradeable/index.ts +0 -9
  278. package/build/types/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.ts +0 -111
  279. package/build/types/@openzeppelin/contracts-upgradeable/security/index.ts +0 -4
  280. package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.ts +0 -322
  281. package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +0 -4
  282. package/build/types/@openzeppelin/contracts-upgradeable/token/index.ts +0 -5
  283. package/build/types/@openzeppelin/index.ts +0 -7
  284. package/build/types/common.ts +0 -44
  285. package/build/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +0 -78
  286. package/build/types/factories/@openzeppelin/contracts/access/index.ts +0 -4
  287. package/build/types/factories/@openzeppelin/contracts/index.ts +0 -7
  288. package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.ts +0 -39
  289. package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +0 -4
  290. package/build/types/factories/@openzeppelin/contracts/interfaces/index.ts +0 -4
  291. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +0 -146
  292. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade__factory.ts +0 -71
  293. package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +0 -5
  294. package/build/types/factories/@openzeppelin/contracts/proxy/Proxy__factory.ts +0 -31
  295. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.ts +0 -39
  296. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon__factory.ts +0 -169
  297. package/build/types/factories/@openzeppelin/contracts/proxy/beacon/index.ts +0 -5
  298. package/build/types/factories/@openzeppelin/contracts/proxy/index.ts +0 -8
  299. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.ts +0 -211
  300. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy__factory.ts +0 -228
  301. package/build/types/factories/@openzeppelin/contracts/proxy/transparent/index.ts +0 -5
  302. package/build/types/factories/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable__factory.ts +0 -115
  303. package/build/types/factories/@openzeppelin/contracts/proxy/utils/index.ts +0 -4
  304. package/build/types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +0 -349
  305. package/build/types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +0 -206
  306. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable__factory.ts +0 -327
  307. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +0 -248
  308. package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.ts +0 -5
  309. package/build/types/factories/@openzeppelin/contracts/token/ERC20/index.ts +0 -7
  310. package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply__factory.ts +0 -420
  311. package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/index.ts +0 -4
  312. package/build/types/factories/@openzeppelin/contracts/token/index.ts +0 -4
  313. package/build/types/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.ts +0 -78
  314. package/build/types/factories/@openzeppelin/contracts-upgradeable/access/index.ts +0 -4
  315. package/build/types/factories/@openzeppelin/contracts-upgradeable/index.ts +0 -6
  316. package/build/types/factories/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable__factory.ts +0 -65
  317. package/build/types/factories/@openzeppelin/contracts-upgradeable/security/index.ts +0 -4
  318. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable__factory.ts +0 -209
  319. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +0 -4
  320. package/build/types/factories/@openzeppelin/contracts-upgradeable/token/index.ts +0 -4
  321. package/build/types/factories/@openzeppelin/index.ts +0 -5
  322. package/build/types/factories/index.ts +0 -5
  323. package/build/types/factories/src/bridge/AbsBridge__factory.ts +0 -612
  324. package/build/types/factories/src/bridge/AbsInbox__factory.ts +0 -455
  325. package/build/types/factories/src/bridge/AbsOutbox__factory.ts +0 -561
  326. package/build/types/factories/src/bridge/Bridge__factory.ts +0 -695
  327. package/build/types/factories/src/bridge/ERC20Bridge__factory.ts +0 -746
  328. package/build/types/factories/src/bridge/ERC20Inbox__factory.ts +0 -719
  329. package/build/types/factories/src/bridge/ERC20Outbox__factory.ts +0 -610
  330. package/build/types/factories/src/bridge/IBridge__factory.ts +0 -508
  331. package/build/types/factories/src/bridge/IDelayedMessageProvider__factory.ts +0 -62
  332. package/build/types/factories/src/bridge/IERC20Bridge__factory.ts +0 -576
  333. package/build/types/factories/src/bridge/IERC20Inbox__factory.ts +0 -461
  334. package/build/types/factories/src/bridge/IEthBridge__factory.ts +0 -553
  335. package/build/types/factories/src/bridge/IInboxBase__factory.ts +0 -324
  336. package/build/types/factories/src/bridge/IInbox__factory.ts +0 -647
  337. package/build/types/factories/src/bridge/IOutbox__factory.ts +0 -431
  338. package/build/types/factories/src/bridge/IOwnable__factory.ts +0 -36
  339. package/build/types/factories/src/bridge/ISequencerInbox__factory.ts +0 -666
  340. package/build/types/factories/src/bridge/Inbox__factory.ts +0 -999
  341. package/build/types/factories/src/bridge/Outbox__factory.ts +0 -591
  342. package/build/types/factories/src/bridge/SequencerInbox__factory.ts +0 -865
  343. package/build/types/factories/src/bridge/index.ts +0 -23
  344. package/build/types/factories/src/challenge/ChallengeManager__factory.ts +0 -720
  345. package/build/types/factories/src/challenge/IChallengeManager__factory.ts +0 -401
  346. package/build/types/factories/src/challenge/IChallengeResultReceiver__factory.ts +0 -53
  347. package/build/types/factories/src/challenge/index.ts +0 -6
  348. package/build/types/factories/src/index.ts +0 -12
  349. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy__factory.ts +0 -128
  350. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade__factory.ts +0 -88
  351. package/build/types/factories/src/libraries/AdminFallbackProxy.sol/index.ts +0 -5
  352. package/build/types/factories/src/libraries/DoubleLogicUUPSUpgradeable__factory.ts +0 -163
  353. package/build/types/factories/src/libraries/IGasRefunder__factory.ts +0 -55
  354. package/build/types/factories/src/libraries/UUPSNotUpgradeable__factory.ts +0 -97
  355. package/build/types/factories/src/libraries/index.ts +0 -7
  356. package/build/types/factories/src/mocks/BridgeStub__factory.ts +0 -612
  357. package/build/types/factories/src/mocks/BridgeUnproxied__factory.ts +0 -706
  358. package/build/types/factories/src/mocks/InboxStub__factory.ts +0 -702
  359. package/build/types/factories/src/mocks/MockResultReceiver__factory.ts +0 -244
  360. package/build/types/factories/src/mocks/ProxyAdminForBinding__factory.ts +0 -215
  361. package/build/types/factories/src/mocks/SequencerInboxStub__factory.ts +0 -938
  362. package/build/types/factories/src/mocks/SimpleProxy__factory.ts +0 -83
  363. package/build/types/factories/src/mocks/Simple__factory.ts +0 -287
  364. package/build/types/factories/src/mocks/SingleExecutionChallenge__factory.ts +0 -823
  365. package/build/types/factories/src/mocks/TimedOutChallengeManager__factory.ts +0 -724
  366. package/build/types/factories/src/mocks/index.ts +0 -13
  367. package/build/types/factories/src/node-interface/NodeInterfaceDebug__factory.ts +0 -82
  368. package/build/types/factories/src/node-interface/NodeInterface__factory.ts +0 -301
  369. package/build/types/factories/src/node-interface/index.ts +0 -5
  370. package/build/types/factories/src/osp/HashProofHelper__factory.ts +0 -216
  371. package/build/types/factories/src/osp/IOneStepProofEntry__factory.ts +0 -72
  372. package/build/types/factories/src/osp/IOneStepProver__factory.ts +0 -492
  373. package/build/types/factories/src/osp/OneStepProofEntry__factory.ts +0 -206
  374. package/build/types/factories/src/osp/OneStepProver0__factory.ts +0 -528
  375. package/build/types/factories/src/osp/OneStepProverHostIo__factory.ts +0 -528
  376. package/build/types/factories/src/osp/OneStepProverMath__factory.ts +0 -528
  377. package/build/types/factories/src/osp/OneStepProverMemory__factory.ts +0 -528
  378. package/build/types/factories/src/osp/index.ts +0 -11
  379. package/build/types/factories/src/precompiles/ArbAddressTable__factory.ts +0 -163
  380. package/build/types/factories/src/precompiles/ArbAggregator__factory.ts +0 -163
  381. package/build/types/factories/src/precompiles/ArbDebug__factory.ts +0 -208
  382. package/build/types/factories/src/precompiles/ArbFunctionTable__factory.ts +0 -92
  383. package/build/types/factories/src/precompiles/ArbGasInfo__factory.ts +0 -365
  384. package/build/types/factories/src/precompiles/ArbInfo__factory.ts +0 -64
  385. package/build/types/factories/src/precompiles/ArbOwnerPublic__factory.ts +0 -84
  386. package/build/types/factories/src/precompiles/ArbOwner__factory.ts +0 -393
  387. package/build/types/factories/src/precompiles/ArbRetryableTx__factory.ts +0 -321
  388. package/build/types/factories/src/precompiles/ArbStatistics__factory.ts +0 -64
  389. package/build/types/factories/src/precompiles/ArbSys__factory.ts +0 -389
  390. package/build/types/factories/src/precompiles/ArbosActs__factory.ts +0 -92
  391. package/build/types/factories/src/precompiles/ArbosTest__factory.ts +0 -39
  392. package/build/types/factories/src/precompiles/index.ts +0 -16
  393. package/build/types/factories/src/rollup/AbsBridgeCreator__factory.ts +0 -182
  394. package/build/types/factories/src/rollup/AbsRollupEventInbox__factory.ts +0 -125
  395. package/build/types/factories/src/rollup/BridgeCreator__factory.ts +0 -294
  396. package/build/types/factories/src/rollup/ERC20BridgeCreator__factory.ts +0 -299
  397. package/build/types/factories/src/rollup/ERC20RollupEventInbox__factory.ts +0 -170
  398. package/build/types/factories/src/rollup/IBridgeCreator.sol/IBridgeCreator__factory.ts +0 -124
  399. package/build/types/factories/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator__factory.ts +0 -200
  400. package/build/types/factories/src/rollup/IBridgeCreator.sol/IEthBridgeCreator__factory.ts +0 -195
  401. package/build/types/factories/src/rollup/IBridgeCreator.sol/index.ts +0 -6
  402. package/build/types/factories/src/rollup/IRollupAdmin__factory.ts +0 -559
  403. package/build/types/factories/src/rollup/IRollupCore__factory.ts +0 -904
  404. package/build/types/factories/src/rollup/IRollupEventInbox__factory.ts +0 -83
  405. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserAbs__factory.ts +0 -1324
  406. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserERC20__factory.ts +0 -1458
  407. package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUser__factory.ts +0 -1443
  408. package/build/types/factories/src/rollup/IRollupLogic.sol/index.ts +0 -6
  409. package/build/types/factories/src/rollup/RollupAdminLogic__factory.ts +0 -1859
  410. package/build/types/factories/src/rollup/RollupCore__factory.ts +0 -1066
  411. package/build/types/factories/src/rollup/RollupCreator__factory.ts +0 -463
  412. package/build/types/factories/src/rollup/RollupEventInbox__factory.ts +0 -166
  413. package/build/types/factories/src/rollup/RollupProxy__factory.ts +0 -277
  414. package/build/types/factories/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic__factory.ts +0 -1593
  415. package/build/types/factories/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic__factory.ts +0 -1767
  416. package/build/types/factories/src/rollup/RollupUserLogic.sol/RollupUserLogic__factory.ts +0 -1748
  417. package/build/types/factories/src/rollup/RollupUserLogic.sol/index.ts +0 -6
  418. package/build/types/factories/src/rollup/ValidatorUtils__factory.ts +0 -430
  419. package/build/types/factories/src/rollup/ValidatorWalletCreator__factory.ts +0 -205
  420. package/build/types/factories/src/rollup/ValidatorWallet__factory.ts +0 -486
  421. package/build/types/factories/src/rollup/index.ts +0 -22
  422. package/build/types/factories/src/test-helpers/BridgeTester__factory.ts +0 -654
  423. package/build/types/factories/src/test-helpers/CryptographyPrimitivesTester__factory.ts +0 -111
  424. package/build/types/factories/src/test-helpers/EthVault__factory.ts +0 -95
  425. package/build/types/factories/src/test-helpers/MessageTester__factory.ts +0 -135
  426. package/build/types/factories/src/test-helpers/OutboxWithoutOptTester__factory.ts +0 -575
  427. package/build/types/factories/src/test-helpers/RollupMock__factory.ts +0 -100
  428. package/build/types/factories/src/test-helpers/ValueArrayTester__factory.ts +0 -69
  429. package/build/types/factories/src/test-helpers/index.ts +0 -10
  430. package/build/types/index.ts +0 -230
  431. package/build/types/src/bridge/AbsBridge.ts +0 -863
  432. package/build/types/src/bridge/AbsInbox.ts +0 -664
  433. package/build/types/src/bridge/AbsOutbox.ts +0 -700
  434. package/build/types/src/bridge/Bridge.ts +0 -934
  435. package/build/types/src/bridge/ERC20Bridge.ts +0 -970
  436. package/build/types/src/bridge/ERC20Inbox.ts +0 -869
  437. package/build/types/src/bridge/ERC20Outbox.ts +0 -722
  438. package/build/types/src/bridge/IBridge.ts +0 -799
  439. package/build/types/src/bridge/IDelayedMessageProvider.ts +0 -108
  440. package/build/types/src/bridge/IERC20Bridge.ts +0 -906
  441. package/build/types/src/bridge/IERC20Inbox.ts +0 -788
  442. package/build/types/src/bridge/IEthBridge.ts +0 -871
  443. package/build/types/src/bridge/IInbox.ts +0 -1081
  444. package/build/types/src/bridge/IInboxBase.ts +0 -583
  445. package/build/types/src/bridge/IOutbox.ts +0 -654
  446. package/build/types/src/bridge/IOwnable.ts +0 -81
  447. package/build/types/src/bridge/ISequencerInbox.ts +0 -1038
  448. package/build/types/src/bridge/Inbox.ts +0 -1279
  449. package/build/types/src/bridge/Outbox.ts +0 -700
  450. package/build/types/src/bridge/SequencerInbox.ts +0 -1138
  451. package/build/types/src/bridge/index.ts +0 -23
  452. package/build/types/src/challenge/ChallengeManager.ts +0 -889
  453. package/build/types/src/challenge/IChallengeManager.ts +0 -543
  454. package/build/types/src/challenge/IChallengeResultReceiver.ts +0 -115
  455. package/build/types/src/challenge/index.ts +0 -6
  456. package/build/types/src/index.ts +0 -21
  457. package/build/types/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.ts +0 -128
  458. package/build/types/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.ts +0 -128
  459. package/build/types/src/libraries/AdminFallbackProxy.sol/index.ts +0 -5
  460. package/build/types/src/libraries/DoubleLogicUUPSUpgradeable.ts +0 -314
  461. package/build/types/src/libraries/IGasRefunder.ts +0 -112
  462. package/build/types/src/libraries/UUPSNotUpgradeable.ts +0 -164
  463. package/build/types/src/libraries/index.ts +0 -8
  464. package/build/types/src/mocks/BridgeStub.ts +0 -887
  465. package/build/types/src/mocks/BridgeUnproxied.ts +0 -934
  466. package/build/types/src/mocks/InboxStub.ts +0 -1076
  467. package/build/types/src/mocks/MockResultReceiver.ts +0 -301
  468. package/build/types/src/mocks/ProxyAdminForBinding.ts +0 -359
  469. package/build/types/src/mocks/SequencerInboxStub.ts +0 -1173
  470. package/build/types/src/mocks/Simple.ts +0 -514
  471. package/build/types/src/mocks/SimpleProxy.ts +0 -55
  472. package/build/types/src/mocks/SingleExecutionChallenge.ts +0 -889
  473. package/build/types/src/mocks/TimedOutChallengeManager.ts +0 -883
  474. package/build/types/src/mocks/index.ts +0 -13
  475. package/build/types/src/node-interface/NodeInterface.ts +0 -502
  476. package/build/types/src/node-interface/NodeInterfaceDebug.ts +0 -137
  477. package/build/types/src/node-interface/index.ts +0 -5
  478. package/build/types/src/osp/HashProofHelper.ts +0 -308
  479. package/build/types/src/osp/IOneStepProofEntry.ts +0 -128
  480. package/build/types/src/osp/IOneStepProver.ts +0 -284
  481. package/build/types/src/osp/OneStepProofEntry.ts +0 -196
  482. package/build/types/src/osp/OneStepProver0.ts +0 -284
  483. package/build/types/src/osp/OneStepProverHostIo.ts +0 -284
  484. package/build/types/src/osp/OneStepProverMath.ts +0 -284
  485. package/build/types/src/osp/OneStepProverMemory.ts +0 -284
  486. package/build/types/src/osp/index.ts +0 -11
  487. package/build/types/src/precompiles/ArbAddressTable.ts +0 -248
  488. package/build/types/src/precompiles/ArbAggregator.ts +0 -335
  489. package/build/types/src/precompiles/ArbDebug.ts +0 -292
  490. package/build/types/src/precompiles/ArbFunctionTable.ts +0 -150
  491. package/build/types/src/precompiles/ArbGasInfo.ts +0 -536
  492. package/build/types/src/precompiles/ArbInfo.ts +0 -105
  493. package/build/types/src/precompiles/ArbOwner.ts +0 -928
  494. package/build/types/src/precompiles/ArbOwnerPublic.ts +0 -157
  495. package/build/types/src/precompiles/ArbRetryableTx.ts +0 -467
  496. package/build/types/src/precompiles/ArbStatistics.ts +0 -93
  497. package/build/types/src/precompiles/ArbSys.ts +0 -553
  498. package/build/types/src/precompiles/ArbosActs.ts +0 -173
  499. package/build/types/src/precompiles/ArbosTest.ts +0 -97
  500. package/build/types/src/precompiles/index.ts +0 -16
  501. package/build/types/src/rollup/AbsBridgeCreator.ts +0 -348
  502. package/build/types/src/rollup/AbsRollupEventInbox.ts +0 -218
  503. package/build/types/src/rollup/BridgeCreator.ts +0 -415
  504. package/build/types/src/rollup/ERC20BridgeCreator.ts +0 -420
  505. package/build/types/src/rollup/ERC20RollupEventInbox.ts +0 -218
  506. package/build/types/src/rollup/IBridgeCreator.sol/IBridgeCreator.ts +0 -231
  507. package/build/types/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator.ts +0 -303
  508. package/build/types/src/rollup/IBridgeCreator.sol/IEthBridgeCreator.ts +0 -298
  509. package/build/types/src/rollup/IBridgeCreator.sol/index.ts +0 -6
  510. package/build/types/src/rollup/IRollupAdmin.ts +0 -1003
  511. package/build/types/src/rollup/IRollupCore.ts +0 -1183
  512. package/build/types/src/rollup/IRollupEventInbox.ts +0 -167
  513. package/build/types/src/rollup/IRollupLogic.sol/IRollupUser.ts +0 -2022
  514. package/build/types/src/rollup/IRollupLogic.sol/IRollupUserAbs.ts +0 -1901
  515. package/build/types/src/rollup/IRollupLogic.sol/IRollupUserERC20.ts +0 -2036
  516. package/build/types/src/rollup/IRollupLogic.sol/index.ts +0 -6
  517. package/build/types/src/rollup/RollupAdminLogic.ts +0 -2593
  518. package/build/types/src/rollup/RollupCore.ts +0 -1406
  519. package/build/types/src/rollup/RollupCreator.ts +0 -592
  520. package/build/types/src/rollup/RollupEventInbox.ts +0 -218
  521. package/build/types/src/rollup/RollupProxy.ts +0 -285
  522. package/build/types/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.ts +0 -2282
  523. package/build/types/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.ts +0 -2417
  524. package/build/types/src/rollup/RollupUserLogic.sol/RollupUserLogic.ts +0 -2403
  525. package/build/types/src/rollup/RollupUserLogic.sol/index.ts +0 -6
  526. package/build/types/src/rollup/ValidatorUtils.ts +0 -561
  527. package/build/types/src/rollup/ValidatorWallet.ts +0 -751
  528. package/build/types/src/rollup/ValidatorWalletCreator.ts +0 -294
  529. package/build/types/src/rollup/index.ts +0 -25
  530. package/build/types/src/test-helpers/BridgeTester.ts +0 -899
  531. package/build/types/src/test-helpers/CryptographyPrimitivesTester.ts +0 -141
  532. package/build/types/src/test-helpers/EthVault.ts +0 -141
  533. package/build/types/src/test-helpers/MessageTester.ts +0 -182
  534. package/build/types/src/test-helpers/OutboxWithoutOptTester.ts +0 -700
  535. package/build/types/src/test-helpers/RollupMock.ts +0 -164
  536. package/build/types/src/test-helpers/ValueArrayTester.ts +0 -81
  537. package/build/types/src/test-helpers/index.ts +0 -10
  538. package/src/rollup/AbsBridgeCreator.sol +0 -117
  539. package/src/rollup/ERC20BridgeCreator.sol +0 -48
  540. package/src/rollup/IBridgeCreator.sol +0 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbitrum/nitro-contracts",
3
- "version": "1.1.0-alpha.7",
3
+ "version": "1.1.0-beta.0",
4
4
  "description": "Layer 2 precompiles and rollup for Arbitrum Nitro",
5
5
  "author": "Offchain Labs, Inc.",
6
6
  "license": "BUSL-1.1",
@@ -10,9 +10,8 @@
10
10
  },
11
11
  "files": [
12
12
  "src/",
13
- "build/types",
14
- "build/contracts/@openzeppelin",
15
- "build/contracts/src"
13
+ "build/contracts/src",
14
+ "build/contracts/@openzeppelin"
16
15
  ],
17
16
  "bugs": {
18
17
  "url": "https://github.com/offchainlabs/nitro-contracts/issues"
@@ -35,6 +34,7 @@
35
34
  "deploy-erc20-rollup": "hardhat run scripts/createERC20Rollup.ts"
36
35
  },
37
36
  "dependencies": {
37
+ "@offchainlabs/upgrade-executor": "1.1.0-beta.0",
38
38
  "@openzeppelin/contracts": "4.5.0",
39
39
  "@openzeppelin/contracts-upgradeable": "4.5.2",
40
40
  "patch-package": "^6.4.7"
@@ -62,15 +62,16 @@
62
62
  "eslint-plugin-prettier": "^4.0.0",
63
63
  "ethereum-waffle": "^3.4.0",
64
64
  "ethers": "^5.5.2",
65
- "hardhat": "^2.6.6",
66
- "hardhat-deploy": "^0.11.4",
67
- "hardhat-gas-reporter": "^1.0.8",
65
+ "hardhat": "^2.17.2",
66
+ "hardhat-deploy": "^0.11.37",
67
+ "hardhat-gas-reporter": "^1.0.9",
68
+ "hardhat-ignore-warnings": "^0.2.9",
68
69
  "postinstall-postinstall": "^2.1.0",
69
70
  "prettier": "^2.5.1",
70
71
  "prettier-plugin-solidity": "^1.0.0-beta.19",
71
72
  "solhint": "^3.3.7",
72
73
  "solhint-plugin-prettier": "^0.0.5",
73
- "solidity-coverage": "^0.7.20",
74
+ "solidity-coverage": "^0.8.4",
74
75
  "ts-node": "^10.4.0",
75
76
  "tslint": "^6.1.3",
76
77
  "typechain": "^8.0.0",
@@ -298,5 +298,5 @@ abstract contract AbsBridge is Initializable, DelegateCallAware, IBridge {
298
298
  * variables without shifting down storage in the inheritance chain.
299
299
  * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
300
300
  */
301
- uint256[50] private __gap;
301
+ uint256[40] private __gap;
302
302
  }
@@ -26,10 +26,9 @@ import {
26
26
  L2MessageType_unsignedEOATx,
27
27
  L2_MSG
28
28
  } from "../libraries/MessageTypes.sol";
29
- import {MAX_DATA_SIZE} from "../libraries/Constants.sol";
30
-
31
29
  import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
32
30
  import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
31
+ import "@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol";
33
32
 
34
33
  /**
35
34
  * @title Inbox for user and contract originated messages
@@ -37,6 +36,11 @@ import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
37
36
  * to await inclusion in the SequencerInbox
38
37
  */
39
38
  abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase {
39
+ /// @dev Storage slot with the admin of the contract.
40
+ /// This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1.
41
+ bytes32 internal constant _ADMIN_SLOT =
42
+ 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
43
+
40
44
  /// @inheritdoc IInboxBase
41
45
  IBridge public bridge;
42
46
  /// @inheritdoc IInboxBase
@@ -93,8 +97,14 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
93
97
  _;
94
98
  }
95
99
 
100
+ // On L1 this should be set to 117964: 90% of Geth's 128KB tx size limit, leaving ~13KB for proving
101
+ uint256 public immutable maxDataSize;
96
102
  uint256 internal immutable deployTimeChainId = block.chainid;
97
103
 
104
+ constructor(uint256 _maxDataSize) {
105
+ maxDataSize = _maxDataSize;
106
+ }
107
+
98
108
  function _chainIdChanged() internal view returns (bool) {
99
109
  return deployTimeChainId != block.chainid;
100
110
  }
@@ -130,8 +140,7 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
130
140
  if (_chainIdChanged()) revert L1Forked();
131
141
  // solhint-disable-next-line avoid-tx-origin
132
142
  if (msg.sender != tx.origin) revert NotOrigin();
133
- if (messageData.length > MAX_DATA_SIZE)
134
- revert DataTooLarge(messageData.length, MAX_DATA_SIZE);
143
+ if (messageData.length > maxDataSize) revert DataTooLarge(messageData.length, maxDataSize);
135
144
  uint256 msgNum = _deliverToBridge(L2_MSG, msg.sender, keccak256(messageData), 0);
136
145
  emit InboxMessageDeliveredFromOrigin(msgNum);
137
146
  return msgNum;
@@ -206,6 +215,11 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
206
215
  );
207
216
  }
208
217
 
218
+ /// @inheritdoc IInboxBase
219
+ function getProxyAdmin() external view returns (address) {
220
+ return StorageSlotUpgradeable.getAddressSlot(_ADMIN_SLOT).value;
221
+ }
222
+
209
223
  function _createRetryableTicket(
210
224
  address to,
211
225
  uint256 l2CallValue,
@@ -313,8 +327,8 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
313
327
  bytes memory _messageData,
314
328
  uint256 amount
315
329
  ) internal returns (uint256) {
316
- if (_messageData.length > MAX_DATA_SIZE)
317
- revert DataTooLarge(_messageData.length, MAX_DATA_SIZE);
330
+ if (_messageData.length > maxDataSize)
331
+ revert DataTooLarge(_messageData.length, maxDataSize);
318
332
  uint256 msgNum = _deliverToBridge(_kind, _sender, keccak256(_messageData), amount);
319
333
  emit InboxMessageDelivered(msgNum, _messageData);
320
334
  return msgNum;
@@ -332,4 +346,11 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
332
346
  view
333
347
  virtual
334
348
  returns (uint256);
349
+
350
+ /**
351
+ * @dev This empty reserved space is put in place to allow future versions to add new
352
+ * variables without shifting down storage in the inheritance chain.
353
+ * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
354
+ */
355
+ uint256[47] private __gap;
335
356
  }
@@ -292,4 +292,11 @@ abstract contract AbsOutbox is DelegateCallAware, IOutbox {
292
292
  /// rollup this amount shall always be 0, because amount of ETH being withdrawn can be read from msg.value.
293
293
  /// @return amount of native token being withdrawn in case of ERC20-based rollup, or 0 in case of ETH-based rollup
294
294
  function _amountToSetInContext(uint256 value) internal pure virtual returns (uint256);
295
+
296
+ /**
297
+ * @dev This empty reserved space is put in place to allow future versions to add new
298
+ * variables without shifting down storage in the inheritance chain.
299
+ * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
300
+ */
301
+ uint256[42] private __gap;
295
302
  }
@@ -7,7 +7,7 @@ pragma solidity ^0.8.4;
7
7
  import "./AbsBridge.sol";
8
8
  import "./IERC20Bridge.sol";
9
9
  import "../libraries/AddressAliasHelper.sol";
10
- import {InvalidTokenSet, CallTargetNotAllowed} from "../libraries/Error.sol";
10
+ import {InvalidTokenSet, CallTargetNotAllowed, CallNotAllowed} from "../libraries/Error.sol";
11
11
  import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
12
12
  import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
13
13
 
@@ -15,6 +15,11 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
15
15
  * @title Staging ground for incoming and outgoing messages
16
16
  * @notice Unlike the standard Eth bridge, native token bridge escrows the custom ERC20 token which is
17
17
  * used as native currency on L2.
18
+ * @dev Fees are paid in this token. There are certain restrictions on the native token:
19
+ * - The token can't be rebasing or have a transfer fee
20
+ * - The token must only be transferrable via a call to the token address itself
21
+ * - The token must only be able to set allowance via a call to the token address itself
22
+ * - The token must not have a callback on transfer, and more generally a user must not be able to make a transfer to themselves revert
18
23
  */
19
24
  contract ERC20Bridge is AbsBridge, IERC20Bridge {
20
25
  using SafeERC20 for IERC20;
@@ -50,18 +55,30 @@ contract ERC20Bridge is AbsBridge, IERC20Bridge {
50
55
  uint256 value,
51
56
  bytes memory data
52
57
  ) internal override returns (bool success, bytes memory returnData) {
53
- if (to == nativeToken) {
54
- revert CallTargetNotAllowed(nativeToken);
58
+ address _nativeToken = nativeToken;
59
+
60
+ // we don't allow outgoing calls to native token contract because it could
61
+ // result in loss of native tokens which are escrowed by ERC20Bridge
62
+ if (to == _nativeToken) {
63
+ revert CallTargetNotAllowed(_nativeToken);
55
64
  }
56
65
 
57
66
  // first release native token
58
- IERC20(nativeToken).safeTransfer(to, value);
67
+ IERC20(_nativeToken).safeTransfer(to, value);
59
68
  success = true;
60
69
 
61
- // if there's data do additional contract call
70
+ // if there's data do additional contract call. Make sure that call is not used to
71
+ // decrease bridge contract's balance of the native token
62
72
  if (data.length > 0) {
73
+ uint256 bridgeBalanceBefore = IERC20(_nativeToken).balanceOf(address(this));
74
+
63
75
  // solhint-disable-next-line avoid-low-level-calls
64
76
  (success, returnData) = to.call(data);
77
+
78
+ uint256 bridgeBalanceAfter = IERC20(_nativeToken).balanceOf(address(this));
79
+ if (bridgeBalanceAfter < bridgeBalanceBefore) {
80
+ revert CallNotAllowed();
81
+ }
65
82
  }
66
83
  }
67
84
 
@@ -21,6 +21,8 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
21
21
  contract ERC20Inbox is AbsInbox, IERC20Inbox {
22
22
  using SafeERC20 for IERC20;
23
23
 
24
+ constructor(uint256 _maxDataSize) AbsInbox(_maxDataSize) {}
25
+
24
26
  /// @inheritdoc IInboxBase
25
27
  function initialize(IBridge _bridge, ISequencerInbox _sequencerInbox)
26
28
  external
@@ -122,7 +124,8 @@ contract ERC20Inbox is AbsInbox, IERC20Inbox {
122
124
  bytes32 messageDataHash,
123
125
  uint256 tokenAmount
124
126
  ) internal override returns (uint256) {
125
- // fetch native token from sender if inbox doesn't already hold enough tokens to pay for fees
127
+ // Fetch native token from sender if inbox doesn't already hold enough tokens to pay for fees.
128
+ // Inbox might have been pre-funded in prior call, ie. as part of token bridging flow.
126
129
  address nativeToken = IERC20Bridge(address(bridge)).nativeToken();
127
130
  uint256 inboxNativeTokenBalance = IERC20(nativeToken).balanceOf(address(this));
128
131
  if (inboxNativeTokenBalance < tokenAmount) {
@@ -7,6 +7,7 @@ pragma solidity ^0.8.4;
7
7
  import "./AbsOutbox.sol";
8
8
 
9
9
  contract ERC20Outbox is AbsOutbox {
10
+ // it is assumed that arb-os never assigns this value to a valid leaf to be redeemed
10
11
  uint256 private constant AMOUNT_DEFAULT_CONTEXT = type(uint256).max;
11
12
 
12
13
  function l2ToL1WithdrawalAmount() external view returns (uint256) {
@@ -17,11 +18,13 @@ contract ERC20Outbox is AbsOutbox {
17
18
 
18
19
  /// @inheritdoc AbsOutbox
19
20
  function _defaultContextAmount() internal pure override returns (uint256) {
21
+ // we use type(uint256).max as representation of 0 native token withdrawal amount
20
22
  return AMOUNT_DEFAULT_CONTEXT;
21
23
  }
22
24
 
23
25
  /// @inheritdoc AbsOutbox
24
26
  function _amountToSetInContext(uint256 value) internal pure override returns (uint256) {
27
+ // native token withdrawal amount which can be fetched from context
25
28
  return value;
26
29
  }
27
30
  }
@@ -0,0 +1,255 @@
1
+ // SPDX-License-Identifier: Apache-2.0
2
+
3
+ /*
4
+ * Copyright 2021, Offchain Labs, Inc.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ pragma solidity ^0.8.7;
20
+
21
+ import "../libraries/IGasRefunder.sol";
22
+
23
+ import "@openzeppelin/contracts/access/Ownable.sol";
24
+
25
+ /**
26
+ * @notice DEPRECATED - only for classic version, see new repo (https://github.com/OffchainLabs/nitro/tree/master/contracts)
27
+ * for new updates
28
+ */
29
+ contract GasRefunder is IGasRefunder, Ownable {
30
+ mapping(address => bool) public allowedContracts;
31
+ mapping(address => bool) public allowedRefundees;
32
+ address public disallower;
33
+
34
+ struct CommonParameters {
35
+ uint128 maxRefundeeBalance;
36
+ uint32 extraGasMargin;
37
+ uint8 calldataCost;
38
+ uint64 maxGasTip;
39
+ uint64 maxGasCost;
40
+ uint32 maxSingleGasUsage;
41
+ }
42
+
43
+ CommonParameters public commonParams;
44
+
45
+ enum CommonParameterKey {
46
+ MAX_REFUNDEE_BALANCE,
47
+ EXTRA_GAS_MARGIN,
48
+ CALLDATA_COST,
49
+ MAX_GAS_TIP,
50
+ MAX_GAS_COST,
51
+ MAX_SINGLE_GAS_USAGE
52
+ }
53
+
54
+ enum RefundDenyReason {
55
+ CONTRACT_NOT_ALLOWED,
56
+ REFUNDEE_NOT_ALLOWED,
57
+ REFUNDEE_ABOVE_MAX_BALANCE,
58
+ OUT_OF_FUNDS
59
+ }
60
+
61
+ event RefundedGasCosts(
62
+ address indexed refundee,
63
+ address indexed contractAddress,
64
+ bool indexed success,
65
+ uint256 gas,
66
+ uint256 gasPrice,
67
+ uint256 amountPaid
68
+ );
69
+ event RefundGasCostsDenied(
70
+ address indexed refundee,
71
+ address indexed contractAddress,
72
+ RefundDenyReason indexed reason,
73
+ uint256 gas
74
+ );
75
+ event Deposited(address sender, uint256 amount);
76
+ event Withdrawn(address initiator, address destination, uint256 amount);
77
+ event ContractAllowedSet(address indexed addr, bool indexed allowed);
78
+ event RefundeeAllowedSet(address indexed addr, bool indexed allowed);
79
+ event DisallowerSet(address indexed addr);
80
+ event CommonParameterSet(CommonParameterKey indexed parameter, uint256 value);
81
+
82
+ constructor() Ownable() {
83
+ commonParams = CommonParameters({
84
+ maxRefundeeBalance: 0, // no limit
85
+ extraGasMargin: 4000, // 4k gas
86
+ calldataCost: 12, // Between 4 for zero bytes and 16 for non-zero bytes
87
+ maxGasTip: 2 gwei,
88
+ maxGasCost: 120 gwei,
89
+ maxSingleGasUsage: 2e6 // 2 million gas
90
+ });
91
+ }
92
+
93
+ function setDisallower(address addr) external onlyOwner {
94
+ disallower = addr;
95
+ emit DisallowerSet(addr);
96
+ }
97
+
98
+ function allowContracts(address[] calldata addresses) external onlyOwner {
99
+ setContractsAllowedImpl(addresses, true);
100
+ }
101
+
102
+ function disallowContracts(address[] calldata addresses) external {
103
+ require(msg.sender == owner() || msg.sender == disallower, "NOT_AUTHORIZED");
104
+ setContractsAllowedImpl(addresses, false);
105
+ }
106
+
107
+ function setContractsAllowedImpl(address[] calldata addresses, bool allow) internal {
108
+ for (uint256 i = 0; i < addresses.length; i++) {
109
+ address addr = addresses[i];
110
+ allowedContracts[addr] = allow;
111
+ emit ContractAllowedSet(addr, allow);
112
+ }
113
+ }
114
+
115
+ function allowRefundees(address[] calldata addresses) external onlyOwner {
116
+ setRefundeesAllowedImpl(addresses, true);
117
+ }
118
+
119
+ function disallowRefundees(address[] calldata addresses) external {
120
+ require(msg.sender == owner() || msg.sender == disallower, "NOT_AUTHORIZED");
121
+ setRefundeesAllowedImpl(addresses, false);
122
+ }
123
+
124
+ function setRefundeesAllowedImpl(address[] calldata addresses, bool allow) internal {
125
+ for (uint256 i = 0; i < addresses.length; i++) {
126
+ address addr = addresses[i];
127
+ allowedRefundees[addr] = allow;
128
+ emit RefundeeAllowedSet(addr, allow);
129
+ }
130
+ }
131
+
132
+ function setMaxRefundeeBalance(uint128 newValue) external onlyOwner {
133
+ commonParams.maxRefundeeBalance = newValue;
134
+ emit CommonParameterSet(CommonParameterKey.MAX_REFUNDEE_BALANCE, newValue);
135
+ }
136
+
137
+ function setExtraGasMargin(uint32 newValue) external onlyOwner {
138
+ commonParams.extraGasMargin = newValue;
139
+ emit CommonParameterSet(CommonParameterKey.EXTRA_GAS_MARGIN, newValue);
140
+ }
141
+
142
+ function setCalldataCost(uint8 newValue) external onlyOwner {
143
+ commonParams.calldataCost = newValue;
144
+ emit CommonParameterSet(CommonParameterKey.CALLDATA_COST, newValue);
145
+ }
146
+
147
+ function setMaxGasTip(uint64 newValue) external onlyOwner {
148
+ commonParams.maxGasTip = newValue;
149
+ emit CommonParameterSet(CommonParameterKey.MAX_GAS_TIP, newValue);
150
+ }
151
+
152
+ function setMaxGasCost(uint64 newValue) external onlyOwner {
153
+ commonParams.maxGasCost = newValue;
154
+ emit CommonParameterSet(CommonParameterKey.MAX_GAS_COST, newValue);
155
+ }
156
+
157
+ function setMaxSingleGasUsage(uint32 newValue) external onlyOwner {
158
+ commonParams.maxSingleGasUsage = newValue;
159
+ emit CommonParameterSet(CommonParameterKey.MAX_SINGLE_GAS_USAGE, newValue);
160
+ }
161
+
162
+ receive() external payable {
163
+ emit Deposited(msg.sender, msg.value);
164
+ }
165
+
166
+ function withdraw(address payable destination, uint256 amount) external onlyOwner {
167
+ // It's expected that destination is an EOA
168
+ (bool success, ) = destination.call{value: amount}("");
169
+ require(success, "WITHDRAW_FAILED");
170
+ emit Withdrawn(msg.sender, destination, amount);
171
+ }
172
+
173
+ function onGasSpent(
174
+ address payable refundee,
175
+ uint256 gasUsed,
176
+ uint256 calldataSize
177
+ ) external override returns (bool success) {
178
+ uint256 startGasLeft = gasleft();
179
+
180
+ uint256 ownBalance = address(this).balance;
181
+
182
+ if (ownBalance == 0) {
183
+ emit RefundGasCostsDenied(refundee, msg.sender, RefundDenyReason.OUT_OF_FUNDS, gasUsed);
184
+ return false;
185
+ }
186
+
187
+ if (!allowedContracts[msg.sender]) {
188
+ emit RefundGasCostsDenied(
189
+ refundee,
190
+ msg.sender,
191
+ RefundDenyReason.CONTRACT_NOT_ALLOWED,
192
+ gasUsed
193
+ );
194
+ return false;
195
+ }
196
+ if (!allowedRefundees[refundee]) {
197
+ emit RefundGasCostsDenied(
198
+ refundee,
199
+ msg.sender,
200
+ RefundDenyReason.REFUNDEE_NOT_ALLOWED,
201
+ gasUsed
202
+ );
203
+ return false;
204
+ }
205
+
206
+ uint256 estGasPrice = block.basefee + commonParams.maxGasTip;
207
+ if (tx.gasprice < estGasPrice) {
208
+ estGasPrice = tx.gasprice;
209
+ }
210
+ if (commonParams.maxGasCost != 0 && estGasPrice > commonParams.maxGasCost) {
211
+ estGasPrice = commonParams.maxGasCost;
212
+ }
213
+
214
+ // Retrieve these variables before measuring gasleft()
215
+ uint256 refundeeBalance = refundee.balance;
216
+ uint256 maxRefundeeBalance = commonParams.maxRefundeeBalance;
217
+ uint256 maxSingleGasUsage = commonParams.maxSingleGasUsage;
218
+
219
+ // Add in a bit of a buffer for the tx costs not measured with gasleft
220
+ gasUsed +=
221
+ startGasLeft +
222
+ commonParams.extraGasMargin +
223
+ (calldataSize * commonParams.calldataCost);
224
+ // Split this up into two statements so that gasleft() comes after the storage loads
225
+ gasUsed -= gasleft();
226
+
227
+ if (maxSingleGasUsage != 0 && gasUsed > maxSingleGasUsage) {
228
+ gasUsed = maxSingleGasUsage;
229
+ }
230
+
231
+ uint256 refundAmount = estGasPrice * gasUsed;
232
+ if (maxRefundeeBalance != 0 && refundeeBalance + refundAmount > maxRefundeeBalance) {
233
+ if (refundeeBalance > maxRefundeeBalance) {
234
+ // The refundee is already above their max balance
235
+ // emit RefundGasCostsDenied(
236
+ // refundee,
237
+ // msg.sender,
238
+ // RefundDenyReason.REFUNDEE_ABOVE_MAX_BALANCE,
239
+ // gasUsed
240
+ // );
241
+ return false;
242
+ } else {
243
+ refundAmount = maxRefundeeBalance - refundeeBalance;
244
+ }
245
+ }
246
+
247
+ if (refundAmount > ownBalance) {
248
+ refundAmount = ownBalance;
249
+ }
250
+
251
+ // It's expected that refundee is an EOA
252
+ (success, ) = refundee.call{value: refundAmount}("");
253
+ emit RefundedGasCosts(refundee, msg.sender, success, gasUsed, estGasPrice, refundAmount);
254
+ }
255
+ }
@@ -11,9 +11,11 @@ import "./IBridge.sol";
11
11
  interface IERC20Bridge is IBridge {
12
12
  /**
13
13
  * @dev token that is escrowed in bridge on L1 side and minted on L2 as native currency.
14
- * Also fees are paid in this token. ERC777, fee on transfer tokens and rebasing tokens
15
- * are not supported to be used as chain's native token, as they can break collateralization
16
- * invariants.
14
+ * Fees are paid in this token. There are certain restrictions on the native token:
15
+ * - The token can't be rebasing or have a transfer fee
16
+ * - The token must only be transferrable via a call to the token address itself
17
+ * - The token must only be able to set allowance via a call to the token address itself
18
+ * - The token must not have a callback on transfer, and more generally a user must not be able to make a transfer to themselves revert
17
19
  */
18
20
  function nativeToken() external view returns (address);
19
21
 
@@ -14,6 +14,8 @@ interface IInboxBase is IDelayedMessageProvider {
14
14
 
15
15
  function sequencerInbox() external view returns (ISequencerInbox);
16
16
 
17
+ function maxDataSize() external view returns (uint256);
18
+
17
19
  /**
18
20
  * @notice Send a generic L2 message to the chain
19
21
  * @dev This method is an optimization to avoid having to emit the entirety of the messageData in a log. Instead validators are expected to be able to parse the data from the transaction's input
@@ -78,4 +80,7 @@ interface IInboxBase is IDelayedMessageProvider {
78
80
  function allowListEnabled() external view returns (bool);
79
81
 
80
82
  function initialize(IBridge _bridge, ISequencerInbox _sequencerInbox) external;
83
+
84
+ /// @notice returns the current admin
85
+ function getProxyAdmin() external view returns (address);
81
86
  }
@@ -16,6 +16,8 @@ interface IOutbox {
16
16
  uint256 transactionIndex
17
17
  );
18
18
 
19
+ function initialize(IBridge _bridge) external;
20
+
19
21
  function rollup() external view returns (address); // the rollup contract
20
22
 
21
23
  function bridge() external view returns (IBridge); // the bridge contract
@@ -71,6 +71,8 @@ interface ISequencerInbox is IDelayedMessageProvider {
71
71
 
72
72
  function isSequencer(address) external view returns (bool);
73
73
 
74
+ function maxDataSize() external view returns (uint256);
75
+
74
76
  struct DasKeySetInfo {
75
77
  bool isValidKeyset;
76
78
  uint64 creationBlock;
@@ -27,7 +27,6 @@ import {
27
27
  L2MessageType_unsignedEOATx,
28
28
  L2MessageType_unsignedContractTx
29
29
  } from "../libraries/MessageTypes.sol";
30
- import {MAX_DATA_SIZE} from "../libraries/Constants.sol";
31
30
  import "../precompiles/ArbSys.sol";
32
31
 
33
32
  import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
@@ -38,6 +37,8 @@ import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
38
37
  * to await inclusion in the SequencerInbox
39
38
  */
40
39
  contract Inbox is AbsInbox, IInbox {
40
+ constructor(uint256 _maxDataSize) AbsInbox(_maxDataSize) {}
41
+
41
42
  /// @inheritdoc IInboxBase
42
43
  function initialize(IBridge _bridge, ISequencerInbox _sequencerInbox)
43
44
  external
@@ -9,11 +9,15 @@ import "./AbsOutbox.sol";
9
9
  contract Outbox is AbsOutbox {
10
10
  /// @inheritdoc AbsOutbox
11
11
  function _defaultContextAmount() internal pure override returns (uint256) {
12
+ // In ETH-based chains withdrawal amount can be read from msg.value. For that reason
13
+ // amount slot in context will never be accessed and it has 0 default value
12
14
  return 0;
13
15
  }
14
16
 
15
17
  /// @inheritdoc AbsOutbox
16
18
  function _amountToSetInContext(uint256) internal pure override returns (uint256) {
19
+ // In ETH-based chains withdrawal amount can be read from msg.value. For that reason
20
+ // amount slot in context will never be accessed, we keep it as 0 all the time
17
21
  return 0;
18
22
  }
19
23
  }
@@ -34,7 +34,6 @@ import {L1MessageType_batchPostingReport} from "../libraries/MessageTypes.sol";
34
34
  import {GasRefundEnabled, IGasRefunder} from "../libraries/IGasRefunder.sol";
35
35
  import "../libraries/DelegateCallAware.sol";
36
36
  import "../libraries/ArbitrumChecker.sol";
37
- import {MAX_DATA_SIZE} from "../libraries/Constants.sol";
38
37
 
39
38
  /**
40
39
  * @title Accepts batches from the sequencer and adds them to the rollup inbox.
@@ -65,13 +64,18 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
65
64
  _;
66
65
  }
67
66
 
68
- uint256 internal immutable deployTimeChainId = block.chainid;
69
-
70
67
  mapping(address => bool) public isSequencer;
71
68
 
69
+ // On L1 this should be set to 117964: 90% of Geth's 128KB tx size limit, leaving ~13KB for proving
70
+ uint256 public immutable maxDataSize;
71
+ uint256 internal immutable deployTimeChainId = block.chainid;
72
72
  // If the chain this SequencerInbox is deployed on is an Arbitrum chain.
73
73
  bool internal immutable hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum();
74
74
 
75
+ constructor(uint256 _maxDataSize) {
76
+ maxDataSize = _maxDataSize;
77
+ }
78
+
75
79
  function _chainIdChanged() internal view returns (bool) {
76
80
  return deployTimeChainId != block.chainid;
77
81
  }
@@ -310,7 +314,7 @@ contract SequencerInbox is DelegateCallAware, GasRefundEnabled, ISequencerInbox
310
314
 
311
315
  modifier validateBatchData(bytes calldata data) {
312
316
  uint256 fullDataLen = HEADER_LENGTH + data.length;
313
- if (fullDataLen > MAX_DATA_SIZE) revert DataTooLarge(fullDataLen, MAX_DATA_SIZE);
317
+ if (fullDataLen > maxDataSize) revert DataTooLarge(fullDataLen, maxDataSize);
314
318
  if (data.length > 0 && (data[0] & DATA_AUTHENTICATED_FLAG) == DATA_AUTHENTICATED_FLAG) {
315
319
  revert DataNotAuthenticated();
316
320
  }
@@ -4,9 +4,6 @@
4
4
 
5
5
  pragma solidity ^0.8.4;
6
6
 
7
- // 90% of Geth's 128KB tx size limit, leaving ~13KB for proving
8
- uint256 constant MAX_DATA_SIZE = 117964;
9
-
10
7
  uint64 constant NO_CHAL_INDEX = 0;
11
8
 
12
9
  // Expected seconds per block in Ethereum PoS
@@ -69,6 +69,9 @@ error InvalidTokenSet(address token);
69
69
  /// @param target address of the call receiver
70
70
  error CallTargetNotAllowed(address target);
71
71
 
72
+ /// @dev Call that changes the balance of ERC20Bridge is not allowed
73
+ error CallNotAllowed();
74
+
72
75
  // Inbox Errors
73
76
 
74
77
  /// @dev The contract is paused, so cannot be paused