@arbitrum/nitro-contracts 3.0.0-alpha.2 → 3.0.0-beta.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 (249) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -3
  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/extensions/draft-IERC20Permit.sol/IERC20Permit.dbg.json +1 -1
  18. package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
  19. package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
  20. package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
  21. package/build/contracts/@openzeppelin/contracts/utils/Create2.sol/Create2.dbg.json +1 -1
  22. package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
  23. package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
  24. package/build/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.dbg.json +4 -0
  25. package/build/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.json +10 -0
  26. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol/AccessControlEnumerableUpgradeable.dbg.json +4 -0
  27. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol/AccessControlEnumerableUpgradeable.json +271 -0
  28. package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
  29. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol/IAccessControlEnumerableUpgradeable.dbg.json +4 -0
  30. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol/IAccessControlEnumerableUpgradeable.json +226 -0
  31. package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +1 -1
  32. package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
  33. package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
  34. package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
  35. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.dbg.json +4 -0
  36. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.json +294 -0
  37. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +4 -0
  38. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.json +194 -0
  39. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol/ERC20BurnableUpgradeable.dbg.json +4 -0
  40. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol/ERC20BurnableUpgradeable.json +325 -0
  41. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol/IERC20MetadataUpgradeable.dbg.json +4 -0
  42. package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol/IERC20MetadataUpgradeable.json +233 -0
  43. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
  44. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
  45. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/Create2Upgradeable.sol/Create2Upgradeable.dbg.json +1 -1
  46. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
  47. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
  48. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol/ECDSAUpgradeable.dbg.json +4 -0
  49. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol/ECDSAUpgradeable.json +10 -0
  50. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol/EIP712Upgradeable.dbg.json +4 -0
  51. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol/EIP712Upgradeable.json +24 -0
  52. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
  53. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
  54. package/build/contracts/@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol/EnumerableSetUpgradeable.dbg.json +1 -1
  55. package/build/contracts/src/assertionStakingPool/AbsBoldStakingPool.sol/AbsBoldStakingPool.dbg.json +1 -1
  56. package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.dbg.json +1 -1
  57. package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.dbg.json +1 -1
  58. package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.dbg.json +1 -1
  59. package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.dbg.json +1 -1
  60. package/build/contracts/src/assertionStakingPool/StakingPoolCreatorUtils.sol/StakingPoolCreatorUtils.dbg.json +1 -1
  61. package/build/contracts/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol/IAbsBoldStakingPool.dbg.json +1 -1
  62. package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol/IAssertionStakingPool.dbg.json +1 -1
  63. package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol/IAssertionStakingPoolCreator.dbg.json +1 -1
  64. package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol/IEdgeStakingPool.dbg.json +1 -1
  65. package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol/IEdgeStakingPoolCreator.dbg.json +1 -1
  66. package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
  67. package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
  68. package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
  69. package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  70. package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -2
  71. package/build/contracts/src/bridge/DelayBuffer.sol/DelayBuffer.dbg.json +1 -1
  72. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
  73. package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +2 -2
  74. package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
  75. package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
  76. package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
  77. package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
  78. package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
  79. package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
  80. package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
  81. package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
  82. package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
  83. package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
  84. package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
  85. package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
  86. package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
  87. package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
  88. package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
  89. package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
  90. package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
  91. package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +1 -1
  92. package/build/contracts/src/challengeV2/IAssertionChain.sol/IAssertionChain.dbg.json +1 -1
  93. package/build/contracts/src/challengeV2/IEdgeChallengeManager.sol/IEdgeChallengeManager.dbg.json +1 -1
  94. package/build/contracts/src/challengeV2/libraries/ArrayUtilsLib.sol/ArrayUtilsLib.dbg.json +1 -1
  95. package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.dbg.json +1 -1
  96. package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.dbg.json +1 -1
  97. package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.dbg.json +1 -1
  98. package/build/contracts/src/challengeV2/libraries/UintUtilsLib.sol/UintUtilsLib.dbg.json +1 -1
  99. package/build/contracts/src/express-lane-auction/Balance.sol/BalanceLib.dbg.json +4 -0
  100. package/build/contracts/src/express-lane-auction/Balance.sol/BalanceLib.json +10 -0
  101. package/build/contracts/src/express-lane-auction/Burner.sol/Burner.dbg.json +4 -0
  102. package/build/contracts/src/express-lane-auction/Burner.sol/Burner.json +47 -0
  103. package/build/contracts/src/express-lane-auction/ELCRound.sol/LatestELCRoundsLib.dbg.json +4 -0
  104. package/build/contracts/src/express-lane-auction/ELCRound.sol/LatestELCRoundsLib.json +10 -0
  105. package/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.dbg.json +4 -0
  106. package/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.json +1601 -0
  107. package/build/contracts/src/express-lane-auction/IExpressLaneAuction.sol/IExpressLaneAuction.dbg.json +4 -0
  108. package/build/contracts/src/express-lane-auction/IExpressLaneAuction.sol/IExpressLaneAuction.json +1296 -0
  109. package/build/contracts/src/express-lane-auction/RoundTimingInfo.sol/RoundTimingInfoLib.dbg.json +4 -0
  110. package/build/contracts/src/express-lane-auction/RoundTimingInfo.sol/RoundTimingInfoLib.json +10 -0
  111. package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
  112. package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
  113. package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
  114. package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
  115. package/build/contracts/src/libraries/CallerChecker.sol/CallerChecker.dbg.json +1 -1
  116. package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
  117. package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.dbg.json +1 -1
  118. package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
  119. package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
  120. package/build/contracts/src/libraries/GasRefundEnabled.sol/GasRefundEnabled.dbg.json +1 -1
  121. package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
  122. package/build/contracts/src/libraries/IReader4844.sol/IReader4844.dbg.json +1 -1
  123. package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
  124. package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
  125. package/build/contracts/src/mocks/Benchmarks.sol/Benchmarks.dbg.json +1 -1
  126. package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
  127. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
  128. package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -2
  129. package/build/contracts/src/mocks/CreateTest.sol/CreateTest.dbg.json +1 -1
  130. package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
  131. package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.dbg.json +1 -1
  132. package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.dbg.json +1 -1
  133. package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.dbg.json +1 -1
  134. package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.dbg.json +1 -1
  135. package/build/contracts/src/mocks/Program.sol/ProgramTest.dbg.json +1 -1
  136. package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
  137. package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.dbg.json +1 -1
  138. package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.dbg.json +1 -1
  139. package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
  140. package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
  141. package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +1 -1
  142. package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.dbg.json +1 -1
  143. package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
  144. package/build/contracts/src/mocks/TestWETH9.sol/IWETH9.dbg.json +1 -1
  145. package/build/contracts/src/mocks/TestWETH9.sol/TestWETH9.dbg.json +1 -1
  146. package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
  147. package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
  148. package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
  149. package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
  150. package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
  151. package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
  152. package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
  153. package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
  154. package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
  155. package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
  156. package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
  157. package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
  158. package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
  159. package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
  160. package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
  161. package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
  162. package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
  163. package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
  164. package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
  165. package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
  166. package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
  167. package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
  168. package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
  169. package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
  170. package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.dbg.json +1 -1
  171. package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.dbg.json +1 -1
  172. package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
  173. package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
  174. package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
  175. package/build/contracts/src/rollup/Assertion.sol/AssertionNodeLib.dbg.json +1 -1
  176. package/build/contracts/src/rollup/AssertionState.sol/AssertionStateLib.dbg.json +1 -1
  177. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.dbg.json +1 -1
  178. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.json +84 -32
  179. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.dbg.json +1 -1
  180. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.json +2 -2
  181. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.dbg.json +1 -1
  182. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.json +45 -0
  183. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollupAdmin.dbg.json +1 -1
  184. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ISeqInboxPostUpgradeInit.dbg.json +1 -1
  185. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.dbg.json +1 -1
  186. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.json +2 -2
  187. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
  188. package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +2 -2
  189. package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
  190. package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
  191. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/FactoryDeployerHelper.dbg.json +1 -1
  192. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IDeployHelper.dbg.json +1 -1
  193. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20.dbg.json +1 -1
  194. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20Bridge.dbg.json +1 -1
  195. package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IInboxBase.dbg.json +1 -1
  196. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
  197. package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.json +10 -0
  198. package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
  199. package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
  200. package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
  201. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
  202. package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +12 -2
  203. package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
  204. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
  205. package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +12 -2
  206. package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
  207. package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
  208. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
  209. package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +12 -2
  210. package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
  211. package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
  212. package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
  213. package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
  214. package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
  215. package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
  216. package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
  217. package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
  218. package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
  219. package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
  220. package/build/contracts/src/state/MultiStack.sol/MultiStackLib.dbg.json +1 -1
  221. package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
  222. package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
  223. package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
  224. package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
  225. package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
  226. package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
  227. package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
  228. package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
  229. package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
  230. package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
  231. package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
  232. package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
  233. package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
  234. package/package.json +2 -3
  235. package/src/bridge/AbsBridge.sol +2 -2
  236. package/src/bridge/ERC20Bridge.sol +6 -2
  237. package/src/express-lane-auction/Balance.sol +137 -0
  238. package/src/express-lane-auction/Burner.sol +26 -0
  239. package/src/express-lane-auction/ELCRound.sol +70 -0
  240. package/src/express-lane-auction/Errors.sol +31 -0
  241. package/src/express-lane-auction/ExpressLaneAuction.sol +567 -0
  242. package/src/express-lane-auction/IExpressLaneAuction.sol +441 -0
  243. package/src/express-lane-auction/RoundTimingInfo.sol +118 -0
  244. package/src/rollup/BOLDUpgradeAction.sol +53 -104
  245. package/src/rollup/BridgeCreator.sol +23 -5
  246. package/src/rollup/Config.sol +2 -0
  247. package/src/rollup/RollupAdminLogic.sol +4 -4
  248. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.dbg.json +0 -4
  249. package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.json +0 -385
@@ -0,0 +1,441 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity ^0.8.0;
3
+
4
+ import {IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
5
+ import {RoundTimingInfo} from "./RoundTimingInfo.sol";
6
+ import {ELCRound} from "./ELCRound.sol";
7
+ import {IAccessControlEnumerableUpgradeable} from
8
+ "@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol";
9
+ import {IERC165Upgradeable} from
10
+ "@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol";
11
+
12
+ /// @notice A bid to control the express lane for a specific round
13
+ struct Bid {
14
+ /// @notice The address to be set as the express lane controller if this bid wins the auction round
15
+ address expressLaneController;
16
+ /// @notice The maximum amount the bidder is willing to pay if they win the round
17
+ /// The auction is a second price auction, so the winner may end up paying less than this amount
18
+ /// however this is the maximum amount up to which they may have to pay
19
+ uint256 amount;
20
+ /// @notice Authentication of this bid by the bidder.
21
+ /// The bidder signs the 712 hash of the struct Bid(uint64 round,address expressLaneController,uint256 amount)
22
+ bytes signature;
23
+ }
24
+
25
+ /// @notice Sets a transferor for an express lane controller
26
+ /// The transferor is an address that will have the right to transfer express lane controller rights
27
+ /// on behalf an express lane controller.
28
+ struct Transferor {
29
+ /// @notice The address of the transferor
30
+ address addr;
31
+ /// @notice The express lane controller can choose to fix the transferor until a future round number
32
+ /// This gives them ability to guarantee to other parties that they will not change transferor during an ongoing round
33
+ /// The express lane controller can ignore this feature by setting this value to 0.
34
+ uint64 fixedUntilRound;
35
+ }
36
+
37
+ /// @notice The arguments used to initialize an express lane auction
38
+ struct InitArgs {
39
+ /// @notice The address who can resolve auctions
40
+ address _auctioneer;
41
+ /// @notice The ERC20 token that bids will be made in
42
+ /// It is assumed that this token does NOT have fee-on-transfer, rebasing,
43
+ /// transfer hooks or otherwise non-standard ERC20 logic.
44
+ address _biddingToken;
45
+ /// @notice The address to which auction winners will pay the bid
46
+ address _beneficiary;
47
+ /// @notice Round timing components: offset, auction closing, round duration, reserve submission
48
+ RoundTimingInfo _roundTimingInfo;
49
+ /// @notice The minimum reserve price, also used to set the initial reserve price
50
+ uint256 _minReservePrice;
51
+ /// @notice Can update the auctioneer address
52
+ address _auctioneerAdmin;
53
+ /// @notice The address given the rights to change the min reserve price
54
+ address _minReservePriceSetter;
55
+ /// @notice The address given the rights to change the reserve price
56
+ address _reservePriceSetter;
57
+ /// @notice Can update the reserve price setter address
58
+ address _reservePriceSetterAdmin;
59
+ /// @notice The address given the rights to change the beneficiary address
60
+ address _beneficiarySetter;
61
+ /// @notice _roundTimingSetter The address given the rights to update the round timing info
62
+ address _roundTimingSetter;
63
+ /// @notice The admin that can manage all the admin roles in the contract
64
+ address _masterAdmin;
65
+ }
66
+
67
+ interface IExpressLaneAuction is IAccessControlEnumerableUpgradeable, IERC165Upgradeable {
68
+ /// @notice An account has deposited funds to be used for bidding in the auction
69
+ /// @param account The account that deposited funds
70
+ /// @param amount The amount deposited by that account
71
+ event Deposit(address indexed account, uint256 amount);
72
+
73
+ /// @notice An account has initiated a withdrawal of funds from the auction
74
+ /// @param account The account withdrawing the funds
75
+ /// @param withdrawalAmount The amount beind withdrawn
76
+ /// @param roundWithdrawable The round the funds will become withdrawable in
77
+ event WithdrawalInitiated(
78
+ address indexed account, uint256 withdrawalAmount, uint256 roundWithdrawable
79
+ );
80
+
81
+ /// @notice An account has finalized a withdrawal
82
+ /// @param account The account that finalized the withdrawal
83
+ /// @param withdrawalAmount The amount that was withdrawn
84
+ event WithdrawalFinalized(address indexed account, uint256 withdrawalAmount);
85
+
86
+ /// @notice An auction was resolved and a new express lane controller was set
87
+ /// @param isMultiBidAuction Whether there was more than one bid in the auction
88
+ /// @param round The round for which the rights were being auctioned
89
+ /// @param firstPriceBidder The bidder who won the auction
90
+ /// @param firstPriceExpressLaneController The address that will have express lane control in the specified round
91
+ /// @param firstPriceAmount The price in the winning bid
92
+ /// @param price The price paid by the winning bidder
93
+ /// @param roundStartTimestamp The time at which the round will start
94
+ /// @param roundEndTimestamp The time at which the round will end
95
+ event AuctionResolved(
96
+ bool indexed isMultiBidAuction,
97
+ uint64 round,
98
+ address indexed firstPriceBidder,
99
+ address indexed firstPriceExpressLaneController,
100
+ uint256 firstPriceAmount,
101
+ uint256 price,
102
+ uint64 roundStartTimestamp,
103
+ uint64 roundEndTimestamp
104
+ );
105
+
106
+ /// @notice A new express lane controller was set
107
+ /// @param round The round which the express lane controller will control
108
+ /// @param previousExpressLaneController The previous express lane controller
109
+ /// @param newExpressLaneController The new express lane controller
110
+ /// @param transferor The address that transferored the controller rights. The transferor if set, otherwise the express lane controller
111
+ /// @param startTimestamp The timestamp at which the new express lane controller takes over
112
+ /// @param endTimestamp The timestamp at which the new express lane controller's rights are expected to cease. They can cease earlier if
113
+ /// if they are transfered before the end of the round
114
+ event SetExpressLaneController(
115
+ uint64 round,
116
+ address indexed previousExpressLaneController,
117
+ address indexed newExpressLaneController,
118
+ address indexed transferor,
119
+ uint64 startTimestamp,
120
+ uint64 endTimestamp
121
+ );
122
+
123
+ /// @notice A new transferor has been set for
124
+ /// @param expressLaneController The express lane controller that has a transferor
125
+ /// @param transferor The transferor chosen
126
+ /// @param fixedUntilRound The round until which this transferor is fixed for this controller
127
+ event SetTransferor(
128
+ address indexed expressLaneController, address indexed transferor, uint64 fixedUntilRound
129
+ );
130
+
131
+ /// @notice The minimum reserve price was set
132
+ /// @param oldPrice The previous minimum reserve price
133
+ /// @param newPrice The new minimum reserve price
134
+ event SetMinReservePrice(uint256 oldPrice, uint256 newPrice);
135
+
136
+ /// @notice A new reserve price was set
137
+ /// @param oldReservePrice Previous reserve price
138
+ /// @param newReservePrice New reserve price
139
+ event SetReservePrice(uint256 oldReservePrice, uint256 newReservePrice);
140
+
141
+ /// @notice A new beneficiary was set
142
+ /// @param oldBeneficiary The previous beneficiary
143
+ /// @param newBeneficiary The new beneficiary
144
+ event SetBeneficiary(address oldBeneficiary, address newBeneficiary);
145
+
146
+ /// @notice A new round timing info has been set
147
+ /// @param currentRound The round during which the timing info was set
148
+ /// @param offsetTimestamp The new offset timestamp
149
+ /// @param roundDurationSeconds The new round duration seconds
150
+ /// @param auctionClosingSeconds The new auction closing seconds
151
+ /// @param reserveSubmissionSeconds The new reserve submission seconds
152
+ event SetRoundTimingInfo(
153
+ uint64 currentRound,
154
+ int64 offsetTimestamp,
155
+ uint64 roundDurationSeconds,
156
+ uint64 auctionClosingSeconds,
157
+ uint64 reserveSubmissionSeconds
158
+ );
159
+
160
+ /// @notice The role given to the address that can resolve auctions
161
+ function AUCTIONEER_ROLE() external returns (bytes32);
162
+
163
+ /// @notice The role that administers AUCTIONEER_ROLE
164
+ function AUCTIONEER_ADMIN_ROLE() external returns (bytes32);
165
+
166
+ /// @notice The role given to the address that can set the minimum reserve
167
+ function MIN_RESERVE_SETTER_ROLE() external returns (bytes32);
168
+
169
+ /// @notice The role given to the address that can set the reserve
170
+ function RESERVE_SETTER_ROLE() external returns (bytes32);
171
+
172
+ /// @notice The role that administers the RESERVE_SETTER_ROLE
173
+ function RESERVE_SETTER_ADMIN_ROLE() external returns (bytes32);
174
+
175
+ /// @notice The role given to the address that can set the beneficiary
176
+ function BENEFICIARY_SETTER_ROLE() external returns (bytes32);
177
+
178
+ /// @notice The role given to addresses that can set round timing info
179
+ function ROUND_TIMING_SETTER_ROLE() external returns (bytes32);
180
+
181
+ /// @notice The beneficiary who receives the funds that are paid by the auction winners
182
+ function beneficiary() external returns (address);
183
+
184
+ /// @notice The ERC20 token that can be used for bidding
185
+ /// It is assumed that the this token does NOT have fee-on-transfer, rebasing,
186
+ /// transfer hooks or otherwise non-standard ERC20 logic.
187
+ function biddingToken() external returns (IERC20);
188
+
189
+ /// @notice The reserve price for the auctions. The reserve price setter can update this value
190
+ /// to ensure that controlling rights are auctioned off at a reasonable value
191
+ function reservePrice() external returns (uint256);
192
+
193
+ /// @notice The minimum amount the reserve can be set to. This ensures that reserve prices cannot be
194
+ /// set too low
195
+ function minReservePrice() external returns (uint256);
196
+
197
+ /// @notice Returns the currently unflushed balance of the beneficiary
198
+ /// Anyone can call flushBalance to transfer this balance from the auction to the beneficiary
199
+ /// This is a gas optimisation to avoid making a transfer every time an auction is resolved
200
+ function beneficiaryBalance() external returns (uint256);
201
+
202
+ /// @notice Express lane controllers can optionally set a transferor address that has the rights
203
+ /// to transfer their controller rights. This function returns the transferor if one has been set
204
+ /// Returns the transferor for the supplied controller, and the round until which this
205
+ /// transferor is fixed if set.
206
+ function transferorOf(
207
+ address expressLaneController
208
+ ) external returns (address addr, uint64 fixedUntil);
209
+
210
+ /// @notice Initialize the auction
211
+ /// @param args Initialization parameters
212
+ function initialize(
213
+ InitArgs memory args
214
+ ) external;
215
+
216
+ /// @notice Round timing components: offset, auction closing, round duration and reserve submission
217
+ function roundTimingInfo()
218
+ external
219
+ view
220
+ returns (
221
+ int64 offsetTimestamp,
222
+ uint64 roundDurationSeconds,
223
+ uint64 auctionClosingSeconds,
224
+ uint64 reserveSubmissionSeconds
225
+ );
226
+
227
+ /// @notice The current auction round that we're in
228
+ /// Bidding for control of the next round occurs in the current round
229
+ function currentRound() external view returns (uint64);
230
+
231
+ /// @notice Is the current auction round closed for bidding
232
+ /// After the round has closed the auctioneer can resolve it with the highest bids
233
+ /// Note. This can change unexpectedly if a round timing info is updated
234
+ function isAuctionRoundClosed() external view returns (bool);
235
+
236
+ /// @notice The auction reserve cannot be updated during the blackout period
237
+ /// This starts ReserveSubmissionSeconds before the round closes and ends when the round is resolved, or the round ends
238
+ /// Note. This can change unexpectedly if a round timing info is updated
239
+ function isReserveBlackout() external view returns (bool);
240
+
241
+ /// @notice Gets the start and end timestamps for a given round
242
+ /// This only returns the start and end timestamps given the current round timing info, which can be updated
243
+ /// Historical round timestamp can be found by checking the logs for round timing info updates, or by looking
244
+ /// at the timing info emitted in events from resolved auctions
245
+ /// Since it is possible to set a negative offset, the start and end time may also be negative
246
+ /// In this case requesting roundTimestamps will revert.
247
+ /// @param round The round to find the timestamps for
248
+ /// @return start The start of the round in seconds, inclusive
249
+ /// @return end The end of the round in seconds, inclusive
250
+ function roundTimestamps(
251
+ uint64 round
252
+ ) external view returns (uint64 start, uint64 end);
253
+
254
+ /// @notice Update the beneficiary to a new address
255
+ /// Setting the beneficiary does not flush any pending balance, so anyone calling this function should consider
256
+ /// whether they want to flush before calling set.
257
+ /// It is expected that the DAO will have the rights to set beneficiary, and since they execute calls via
258
+ /// action contract they can atomically call flush and set beneficiary together.
259
+ /// @param newBeneficiary The new beneficiary
260
+ function setBeneficiary(
261
+ address newBeneficiary
262
+ ) external;
263
+
264
+ /// @notice Set the minimum reserve. The reserve cannot be set below this value
265
+ /// Having a minimum reserve ensures that the reserve setter doesn't set the reserve too low
266
+ /// If the new minimum reserve is greater than the current reserve then the reserve will also be set,
267
+ /// this will happen regardless of whether we are in a reserve blackout period or not.
268
+ /// The min reserve setter is therefore trusted to either give bidders plenty of notice that they may change the min
269
+ /// reserve, or do so outside of the blackout window. It is expected that the min reserve setter will be controlled by
270
+ /// Arbitrum DAO who can only make changes via timelocks, thereby providing the notice to bidders.
271
+ /// If the new minimum reserve is set to a very high value eg max(uint) then the auction will never be able to resolve
272
+ /// the min reserve setter is therefore trusted not to do this as it would DOS the auction. Note that even if this occurs
273
+ /// bidders will not lose their funds and will still be able to withdraw them.
274
+ /// @param newMinReservePrice The new minimum reserve
275
+ function setMinReservePrice(
276
+ uint256 newMinReservePrice
277
+ ) external;
278
+
279
+ /// @notice Set the auction reserve price. Must be greater than or equal the minimum reserve.
280
+ /// A reserve price setter is given the ability to change the reserve price to ensure that express lane control rights
281
+ /// are not sold off too cheaply. They are trusted to set realistic values for this.
282
+ /// However they can only change this value when not in the blackout period, which occurs before at the auction close
283
+ /// This ensures that bidders will have plenty of time to observe the reserve before the auction closes, and that
284
+ /// the reserve cannot be changed at the last second. One exception to this is if the minimum reserve changes, see the setMinReservePrice
285
+ /// documentation for more details.
286
+ /// If the new reserve is set to a very high value eg max(uint) then the auction will never be able to resolve
287
+ /// the reserve setter is therefore trusted not to do this as it would DOS the auction. Note that even if this occurs
288
+ /// bidders will not lose their funds and will still be able to withdraw them.
289
+ /// Note to reserve price setter, setting reserve price is dependent on the time into the round, which can change if the round timing info is updated
290
+ /// @param newReservePrice The price to set the reserve to
291
+ function setReservePrice(
292
+ uint256 newReservePrice
293
+ ) external;
294
+
295
+ /// @notice Sets new round timing info. When setting a new round timing info the current round and the start
296
+ /// timestamp of the next round cannot change. The caller can ensure this by dynamically calculating
297
+ /// the correct offset which will produce this for the specified round duration seconds in the new timing info.
298
+ /// Changing timing info affects the current ongoing auction, given that the round may already have been resolved
299
+ /// this could result in bidders paying for a round that is longer or shorter than they expected. To that end
300
+ /// the round timing setter is trusted not to set this function too often, and any observers who depend upon this timing info
301
+ /// (eg bidders, auctioneer, reserve price setter etc) should be able to see when this is going to happen.
302
+ /// On Arbitrum One the expected round timing setter is the Arbitrum DAO, that can only
303
+ /// make changes by passing proposals through timelocks, therefore providing the notice to bidders.
304
+ /// Since the next round of the new info must be the same as the next round of the current info, it follows
305
+ /// that the update can only be made within min(roundDuration, newRoundDuration) of the end of the round, making
306
+ /// an update outside of this will cause a revert.
307
+ /// If necessary negative offsets can be set in order to achieve the next round number, given that
308
+ /// the maximum round duration is 1 day it should be possible to have many thousands of years worth of
309
+ /// rounds before it is not longer possible (due to int underflow) to change from 1 second to 1 day duration
310
+ /// @param newRoundTimingInfo The new timing info to set
311
+ function setRoundTimingInfo(
312
+ RoundTimingInfo calldata newRoundTimingInfo
313
+ ) external;
314
+
315
+ /// @notice Get the current balance of specified account.
316
+ /// If a withdrawal is initiated this balance will reduce in current round + 2
317
+ /// @param account The specified account
318
+ function balanceOf(
319
+ address account
320
+ ) external view returns (uint256);
321
+
322
+ /// @notice Get what the balance will be at some future round
323
+ /// Since withdrawals are scheduled for future rounds it is possible to see that a balance
324
+ /// will reduce at some future round, this method provides a way to query that.
325
+ /// Specifically this will return 0 if the withdrawal round has been set, and is < the supplied round
326
+ /// Will revert if a round from the past is supplied
327
+ /// @param account The specified account
328
+ /// @param round The round to query the balance at
329
+ function balanceOfAtRound(address account, uint64 round) external view returns (uint256);
330
+
331
+ /// @notice The amount of balance that can currently be withdrawn via the finalize method
332
+ /// This balance only increases current round + 2 after a withdrawal is initiated
333
+ /// @param account The account the check the withdrawable balance for
334
+ function withdrawableBalance(
335
+ address account
336
+ ) external view returns (uint256);
337
+
338
+ /// @notice The amount of balance that can currently be withdrawn via the finalize method
339
+ /// Since withdrawals are scheduled for future rounds it is possible to see that a withdrawal balance
340
+ /// will increase at some future round, this method provides a way to query that.
341
+ /// Specifically this will return 0 unless the withdrawal round has been set, and is >= the supplied round
342
+ /// Will revert if a round from the past is supplied
343
+ /// This balance only increases current round + 2 after a withdrawal is initiated
344
+ /// @param account The account the check the withdrawable balance for
345
+ /// @param round The round to query the withdrawable balance at
346
+ function withdrawableBalanceAtRound(
347
+ address account,
348
+ uint64 round
349
+ ) external view returns (uint256);
350
+
351
+ /// @notice Deposit an amount of ERC20 token to the auction to make bids with
352
+ /// Deposits must be submitted prior to bidding.
353
+ /// When withdrawing the full balance must be withdrawn. This is done via a two step process
354
+ /// of initialization and finalization, which takes at least 2 rounds to complete.
355
+ /// The round timing info offset timestamp is the start of the zeroth round, so if deposits
356
+ /// are made before that time they will need to wait until 2 rounds after that offset has occurred
357
+ /// @dev Deposits are submitted first so that the auctioneer can be sure that the accepted bids can actually be paid
358
+ /// @param amount The amount to deposit.
359
+ function deposit(
360
+ uint256 amount
361
+ ) external;
362
+
363
+ /// @notice Initiate a withdrawal of the full account balance of the message sender
364
+ /// Once funds have been deposited they can only be retrieved by initiating + finalizing a withdrawal
365
+ /// There is a delay between initializing and finalizing a withdrawal so that the auctioneer can be sure
366
+ /// that value cannot be removed before an auction is resolved. The timeline is as follows:
367
+ /// 1. Initiate a withdrawal at some time in round r
368
+ /// 2. During round r the balance is still available and can be used in an auction
369
+ /// 3. During round r+1 the auctioneer should consider any accounts that have been initiated for withdrawal as having zero balance
370
+ /// However if a bid is submitted the balance will be available for use
371
+ /// 4. During round r+2 the bidder can finalize a withdrawal and remove their funds
372
+ /// A bidder may have only one withdrawal being processed at any one time, and that withdrawal will be for the full balance
373
+ function initiateWithdrawal() external;
374
+
375
+ /// @notice Finalizes a withdrawal and transfers the funds to the msg.sender
376
+ /// Withdrawals can only be finalized 2 rounds after being initiated
377
+ function finalizeWithdrawal() external;
378
+
379
+ /// @notice Can be called by anyone to transfer any beneficiary balance from the auction contract to the beneficiary
380
+ /// This is not done separately so that it does not need to be done during auction resolution, thus saving some gas costs there
381
+ function flushBeneficiaryBalance() external;
382
+
383
+ /// @notice The domain separator used in the 712 signing hash
384
+ function domainSeparator() external view returns (bytes32);
385
+
386
+ /// @notice Get the 712 hash of a bid used for signing
387
+ /// @param round The round the bid is for the control of
388
+ /// @param expressLaneController The address that will be the express lane controller if the bid wins
389
+ /// @param amount The amount being bid
390
+ function getBidHash(
391
+ uint64 round,
392
+ address expressLaneController,
393
+ uint256 amount
394
+ ) external view returns (bytes32);
395
+
396
+ /// @notice Resolve the auction with just a single bid. The auctioneer is trusted to call this only when there are
397
+ /// less than two bids higher than the reserve price for an auction round.
398
+ /// In this case the highest bidder will pay the reserve price for the round
399
+ /// @dev We do not enforce it, but the following accounts or their sybils, are trusted not to send bids to the auctioneer
400
+ /// Auctioneer, beneficiary, beneficiary setter, reserve price setter, min reserve price setter, role admin, round timing info setter
401
+ /// @param firstPriceBid The highest price bid. Must have a price higher than the reserve. Price paid is the reserve
402
+ function resolveSingleBidAuction(
403
+ Bid calldata firstPriceBid
404
+ ) external;
405
+
406
+ /// @notice Resolves the auction round with the two highest bids for that round
407
+ /// The highest price bidder pays the price of the second highest bid
408
+ /// Both bids must be higher than the reserve
409
+ /// @dev We do not enforce it, but the following accounts or their sybils, are trusted not to send bids to the auctioneer
410
+ /// Auctioneer, beneficiary, beneficiary setter, reserve price setter, min reserve price setter, role admin, round timing info setter
411
+ /// @param firstPriceBid The highest price bid
412
+ /// @param secondPriceBid The second highest price bid
413
+ function resolveMultiBidAuction(
414
+ Bid calldata firstPriceBid,
415
+ Bid calldata secondPriceBid
416
+ ) external;
417
+
418
+ /// @notice Sets a transferor for an express lane controller
419
+ /// The transferor is an address that will have the right to transfer express lane controller rights
420
+ /// on behalf an express lane controller.
421
+ /// @param transferor The transferor to set
422
+ function setTransferor(
423
+ Transferor calldata transferor
424
+ ) external;
425
+
426
+ /// @notice Express lane controllers are allowed to transfer their express lane rights for the current or future
427
+ /// round to another address. They may use this for reselling their rights after purchasing them
428
+ /// Again, the priviledged accounts mentioned in resolve documentation are trusted not to try to receive rights via this message.
429
+ /// Although they cannot stop someone transferring the rights to them, they should not use the controller rights if that does occur
430
+ /// @param round The round to transfer rights for
431
+ /// @param newExpressLaneController The new express lane controller to transfer the rights to
432
+ function transferExpressLaneController(
433
+ uint64 round,
434
+ address newExpressLaneController
435
+ ) external;
436
+
437
+ /// @notice The last two auction rounds that were resolved
438
+ /// @return The most recent resolved auction round
439
+ /// @return The second most recent resolved auction round
440
+ function resolvedRounds() external view returns (ELCRound memory, ELCRound memory);
441
+ }
@@ -0,0 +1,118 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+ pragma solidity ^0.8.0;
3
+
4
+ import {NegativeRoundStart} from "./Errors.sol";
5
+
6
+ /// @notice Information about the timings of auction round. All timings measured in seconds
7
+ /// Bids can be submitted to the offchain autonomous auctioneer until the auction round closes
8
+ /// after which the auctioneer can submit the two highest bids to the auction contract to resolve the auction
9
+ struct RoundTimingInfo {
10
+ /// @notice The timestamp when round 0 starts
11
+ /// We allow this to be negative so that later when setting new round timing info
12
+ /// we can use offsets very far in the past. This combined with the maxium that we allow
13
+ /// on round duration ensures that we can always set a new round duration within the possible range
14
+ int64 offsetTimestamp;
15
+ /// @notice The total duration (in seconds) of the round. Always less than 86400 and greater than 0
16
+ uint64 roundDurationSeconds;
17
+ /// @notice The number of seconds before the end of the round that the auction round closes. Cannot be 0
18
+ uint64 auctionClosingSeconds;
19
+ /// @notice A reserve setter account has the rights to set a reserve for a round,
20
+ /// however they cannot do this within a reserve blackout period.
21
+ /// The blackout period starts at RoundDuration - AuctionClosingSeconds - ReserveSubmissionSeconds,
22
+ /// and ends when the auction round is resolved, or the round ends.
23
+ uint64 reserveSubmissionSeconds;
24
+ }
25
+
26
+ library RoundTimingInfoLib {
27
+ /// @dev Using signed offset involves a lot of casting when comparing the to the block timestamp
28
+ /// so we provide a helper method here
29
+ function blockTimestampBeforeOffset(
30
+ int64 offsetTimestamp
31
+ ) private view returns (bool) {
32
+ return int64(uint64(block.timestamp)) < offsetTimestamp;
33
+ }
34
+
35
+ /// @dev Using signed offset involves a lot of casting when comparing the to the block timestamp
36
+ /// so we provide a helper method here
37
+ /// Notice! this helper method should not be used before checking that the offset is less than the timestamp
38
+ function unsignedSinceTimestamp(
39
+ int64 offsetTimestamp
40
+ ) private view returns (uint64) {
41
+ return uint64(int64(uint64(block.timestamp)) - offsetTimestamp);
42
+ }
43
+
44
+ /// @notice The current round, given the current timestamp, the offset and the round duration
45
+ function currentRound(
46
+ RoundTimingInfo memory info
47
+ ) internal view returns (uint64) {
48
+ if (blockTimestampBeforeOffset(info.offsetTimestamp)) {
49
+ return 0;
50
+ }
51
+
52
+ return (unsignedSinceTimestamp(info.offsetTimestamp)) / info.roundDurationSeconds;
53
+ }
54
+
55
+ /// @notice Has the current auction round closed
56
+ function isAuctionRoundClosed(
57
+ RoundTimingInfo memory info
58
+ ) internal view returns (bool) {
59
+ if (blockTimestampBeforeOffset(info.offsetTimestamp)) {
60
+ return false;
61
+ }
62
+
63
+ uint64 timeSinceOffset = unsignedSinceTimestamp(info.offsetTimestamp);
64
+ uint64 timeInRound = timeSinceOffset % info.roundDurationSeconds;
65
+ // round closes at AuctionClosedSeconds before the end of the round
66
+ return timeInRound >= info.roundDurationSeconds - info.auctionClosingSeconds;
67
+ }
68
+
69
+ /// @notice The reserve cannot be set during the blackout period
70
+ /// This period runs from ReserveSubmissionSeconds before the auction closes and ends when the round resolves, or when the round ends.
71
+ /// @param info Round timing info
72
+ /// @param latestResolvedRound The last auction round number that was resolved
73
+ function isReserveBlackout(
74
+ RoundTimingInfo memory info,
75
+ uint64 latestResolvedRound
76
+ ) internal view returns (bool) {
77
+ if (blockTimestampBeforeOffset(info.offsetTimestamp)) {
78
+ // no rounds have started, can't be in blackout
79
+ return false;
80
+ }
81
+
82
+ // if we're in round r, we are selling the rights for r+1
83
+ // if the latest round is r+1 that means we've already resolved the auction in r
84
+ // so we are no longer in the blackout period
85
+ uint64 curRound = currentRound(info);
86
+ if (latestResolvedRound >= curRound + 1) {
87
+ return false;
88
+ }
89
+
90
+ // the round in question hasnt been resolved
91
+ // therefore if we're within ReserveSubmissionSeconds of the auction close then we're in blackout
92
+ // otherwise we're not
93
+ uint64 timeSinceOffset = unsignedSinceTimestamp(info.offsetTimestamp);
94
+ uint64 timeInRound = timeSinceOffset % info.roundDurationSeconds;
95
+ return timeInRound
96
+ >= (info.roundDurationSeconds - info.auctionClosingSeconds - info.reserveSubmissionSeconds);
97
+ }
98
+
99
+ /// @notice Gets the start and end timestamps (seconds) of a specified round
100
+ /// Since it is possible to set a negative offset, the start and end time may also be negative
101
+ /// In this case requesting roundTimestamps will revert.
102
+ /// @param info Round timing info
103
+ /// @param round The specified round
104
+ /// @return The timestamp at which the round starts
105
+ /// @return The timestamp at which the round ends
106
+ function roundTimestamps(
107
+ RoundTimingInfo memory info,
108
+ uint64 round
109
+ ) internal pure returns (uint64, uint64) {
110
+ int64 intRoundStart = info.offsetTimestamp + int64(info.roundDurationSeconds * round);
111
+ if (intRoundStart < 0) {
112
+ revert NegativeRoundStart(intRoundStart);
113
+ }
114
+ uint64 roundStart = uint64(intRoundStart);
115
+ uint64 roundEnd = roundStart + info.roundDurationSeconds - 1;
116
+ return (roundStart, roundEnd);
117
+ }
118
+ }