@arbitrum/nitro-contracts 3.0.0-alpha.1 → 3.0.0-beta.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.md +1 -1
- package/README.md +3 -3
- package/build/contracts/@openzeppelin/contracts/access/Ownable.sol/Ownable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol/ERC1967Upgrade.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/Proxy.sol/Proxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/beacon/IBeacon.sol/IBeacon.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol/UUPSUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/security/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/ERC20.sol/ERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/IERC20.sol/IERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol/IERC20Metadata.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Create2.sol/Create2.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts/utils/cryptography/ECDSA.sol/ECDSA.json +10 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol/AccessControlEnumerableUpgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol/AccessControlEnumerableUpgradeable.json +271 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol/IAccessControlEnumerableUpgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlEnumerableUpgradeable.sol/IAccessControlEnumerableUpgradeable.json +226 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol/IAccessControlUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol/OwnableUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.json +294 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.json +194 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol/ERC20BurnableUpgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol/ERC20BurnableUpgradeable.json +325 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol/IERC20MetadataUpgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol/IERC20MetadataUpgradeable.json +233 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/Create2Upgradeable.sol/Create2Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol/ECDSAUpgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol/ECDSAUpgradeable.json +10 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol/EIP712Upgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol/EIP712Upgradeable.json +24 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol/EnumerableSetUpgradeable.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/AbsBoldStakingPool.sol/AbsBoldStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.json +2 -2
- package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.json +2 -2
- package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.json +2 -2
- package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.json +2 -2
- package/build/contracts/src/assertionStakingPool/StakingPoolCreatorUtils.sol/StakingPoolCreatorUtils.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol/IAbsBoldStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol/IAssertionStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol/IAssertionStakingPoolCreator.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol/IEdgeStakingPool.dbg.json +1 -1
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol/IEdgeStakingPoolCreator.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -2
- package/build/contracts/src/bridge/DelayBuffer.sol/DelayBuffer.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +2 -2
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
- package/build/contracts/src/bridge/IBridge.sol/IBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IDelayedMessageProvider.sol/IDelayedMessageProvider.dbg.json +1 -1
- package/build/contracts/src/bridge/IERC20Bridge.sol/IERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IERC20Inbox.sol/IERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IEthBridge.sol/IEthBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/IInbox.sol/IInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
- package/build/contracts/src/bridge/IOutbox.sol/IOutbox.dbg.json +1 -1
- package/build/contracts/src/bridge/IOwnable.sol/IOwnable.dbg.json +1 -1
- package/build/contracts/src/bridge/ISequencerInbox.sol/ISequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
- package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +2 -2
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +1 -1
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.json +2 -2
- package/build/contracts/src/challengeV2/IAssertionChain.sol/IAssertionChain.dbg.json +1 -1
- package/build/contracts/src/challengeV2/IEdgeChallengeManager.sol/IEdgeChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challengeV2/IEdgeChallengeManager.sol/IEdgeChallengeManager.json +32 -0
- package/build/contracts/src/challengeV2/libraries/ArrayUtilsLib.sol/ArrayUtilsLib.dbg.json +1 -1
- package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.dbg.json +1 -1
- package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.dbg.json +1 -1
- package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.dbg.json +1 -1
- package/build/contracts/src/challengeV2/libraries/UintUtilsLib.sol/UintUtilsLib.dbg.json +1 -1
- package/build/contracts/src/express-lane-auction/Balance.sol/BalanceLib.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/Balance.sol/BalanceLib.json +10 -0
- package/build/contracts/src/express-lane-auction/Burner.sol/Burner.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/Burner.sol/Burner.json +47 -0
- package/build/contracts/src/express-lane-auction/ELCRound.sol/LatestELCRoundsLib.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/ELCRound.sol/LatestELCRoundsLib.json +10 -0
- package/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/ExpressLaneAuction.sol/ExpressLaneAuction.json +1601 -0
- package/build/contracts/src/express-lane-auction/IExpressLaneAuction.sol/IExpressLaneAuction.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/IExpressLaneAuction.sol/IExpressLaneAuction.json +1296 -0
- package/build/contracts/src/express-lane-auction/RoundTimingInfo.sol/RoundTimingInfoLib.dbg.json +4 -0
- package/build/contracts/src/express-lane-auction/RoundTimingInfo.sol/RoundTimingInfoLib.json +10 -0
- package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.dbg.json +1 -1
- package/build/contracts/src/libraries/ArbitrumChecker.sol/ArbitrumChecker.dbg.json +1 -1
- package/build/contracts/src/libraries/CallerChecker.sol/CallerChecker.dbg.json +1 -1
- package/build/contracts/src/libraries/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
- package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.dbg.json +1 -1
- package/build/contracts/src/libraries/DelegateCallAware.sol/DelegateCallAware.dbg.json +1 -1
- package/build/contracts/src/libraries/DoubleLogicUUPSUpgradeable.sol/DoubleLogicUUPSUpgradeable.dbg.json +1 -1
- package/build/contracts/src/libraries/GasRefundEnabled.sol/GasRefundEnabled.dbg.json +1 -1
- package/build/contracts/src/libraries/IGasRefunder.sol/IGasRefunder.dbg.json +1 -1
- package/build/contracts/src/libraries/IReader4844.sol/IReader4844.dbg.json +1 -1
- package/build/contracts/src/libraries/MerkleLib.sol/MerkleLib.dbg.json +1 -1
- package/build/contracts/src/libraries/UUPSNotUpgradeable.sol/UUPSNotUpgradeable.dbg.json +1 -1
- package/build/contracts/src/mocks/Benchmarks.sol/Benchmarks.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -2
- package/build/contracts/src/mocks/CreateTest.sol/CreateTest.dbg.json +1 -1
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.dbg.json +1 -1
- package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.dbg.json +1 -1
- package/build/contracts/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.dbg.json +1 -1
- package/build/contracts/src/mocks/Program.sol/ProgramTest.dbg.json +1 -1
- package/build/contracts/src/mocks/ProxyAdminForBinding.sol/ProxyAdminForBinding.dbg.json +1 -1
- package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.json +2 -2
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +2 -2
- package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.json +2 -2
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
- package/build/contracts/src/mocks/TestWETH9.sol/IWETH9.dbg.json +1 -1
- package/build/contracts/src/mocks/TestWETH9.sol/TestWETH9.dbg.json +1 -1
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
- package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
- package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
- package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbosActs.sol/ArbosActs.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbosTest.sol/ArbosTest.dbg.json +1 -1
- package/build/contracts/src/rollup/AbsRollupEventInbox.sol/AbsRollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/Assertion.sol/AssertionNodeLib.dbg.json +1 -1
- package/build/contracts/src/rollup/AssertionState.sol/AssertionStateLib.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.json +84 -32
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.json +2 -2
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.json +45 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollupAdmin.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ISeqInboxPostUpgradeInit.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.dbg.json +1 -1
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.json +2 -2
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +2 -2
- package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
- package/build/contracts/src/rollup/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/FactoryDeployerHelper.dbg.json +1 -1
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IDeployHelper.dbg.json +1 -1
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20.dbg.json +1 -1
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IInboxBase.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupAdmin.sol/IRollupAdmin.json +10 -0
- package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupEventInbox.sol/IRollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUser.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +12 -2
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +12 -2
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupLib.sol/RollupLib.json +2 -2
- package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.json +12 -2
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +2 -2
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
- package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
- package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
- package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
- package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
- package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
- package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
- package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
- package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
- package/build/contracts/src/state/MultiStack.sol/MultiStackLib.dbg.json +1 -1
- package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
- package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
- package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
- package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
- package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
- package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
- package/package.json +2 -3
- package/src/assertionStakingPool/EdgeStakingPool.sol +3 -4
- package/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol +1 -1
- package/src/bridge/AbsBridge.sol +2 -2
- package/src/bridge/ERC20Bridge.sol +6 -2
- package/src/challengeV2/IEdgeChallengeManager.sol +6 -0
- package/src/express-lane-auction/Balance.sol +137 -0
- package/src/express-lane-auction/Burner.sol +26 -0
- package/src/express-lane-auction/ELCRound.sol +70 -0
- package/src/express-lane-auction/Errors.sol +31 -0
- package/src/express-lane-auction/ExpressLaneAuction.sol +567 -0
- package/src/express-lane-auction/IExpressLaneAuction.sol +441 -0
- package/src/express-lane-auction/RoundTimingInfo.sol +118 -0
- package/src/mocks/SimpleOneStepProofEntry.sol +1 -1
- package/src/rollup/BOLDUpgradeAction.sol +53 -104
- package/src/rollup/BridgeCreator.sol +23 -5
- package/src/rollup/Config.sol +3 -1
- package/src/rollup/RollupAdminLogic.sol +4 -4
- package/src/rollup/RollupCore.sol +1 -1
- package/src/rollup/RollupLib.sol +1 -1
- package/src/rollup/RollupUserLogic.sol +1 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.dbg.json +0 -4
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.json +0 -385
@@ -0,0 +1,567 @@
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
2
|
+
pragma solidity ^0.8.0;
|
3
|
+
|
4
|
+
import "./Errors.sol";
|
5
|
+
import {Balance, BalanceLib} from "./Balance.sol";
|
6
|
+
import {SafeERC20, IERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
7
|
+
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
8
|
+
import {AccessControlEnumerableUpgradeable} from
|
9
|
+
"@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
|
10
|
+
import {DelegateCallAware} from "../libraries/DelegateCallAware.sol";
|
11
|
+
import {IExpressLaneAuction, Bid, InitArgs, Transferor} from "./IExpressLaneAuction.sol";
|
12
|
+
import {ELCRound, LatestELCRoundsLib} from "./ELCRound.sol";
|
13
|
+
import {RoundTimingInfo, RoundTimingInfoLib} from "./RoundTimingInfo.sol";
|
14
|
+
import {EIP712Upgradeable} from
|
15
|
+
"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
|
16
|
+
|
17
|
+
/// @title ExpressLaneAuction
|
18
|
+
/// @notice The express lane allows a controller to submit undelayed transactions to the sequencer
|
19
|
+
/// The right to be the express lane controller are auctioned off in rounds, by an offchain auctioneer.
|
20
|
+
/// The auctioneer then submits the winning bids to this control to deduct funds from the bidders and register the winner
|
21
|
+
contract ExpressLaneAuction is
|
22
|
+
IExpressLaneAuction,
|
23
|
+
AccessControlEnumerableUpgradeable,
|
24
|
+
DelegateCallAware,
|
25
|
+
EIP712Upgradeable
|
26
|
+
{
|
27
|
+
using SafeERC20 for IERC20;
|
28
|
+
using RoundTimingInfoLib for RoundTimingInfo;
|
29
|
+
using BalanceLib for Balance;
|
30
|
+
using ECDSA for bytes32;
|
31
|
+
using ECDSA for bytes;
|
32
|
+
using LatestELCRoundsLib for ELCRound[2];
|
33
|
+
|
34
|
+
/// @inheritdoc IExpressLaneAuction
|
35
|
+
bytes32 public constant AUCTIONEER_ROLE = keccak256("AUCTIONEER");
|
36
|
+
/// @inheritdoc IExpressLaneAuction
|
37
|
+
bytes32 public constant AUCTIONEER_ADMIN_ROLE = keccak256("AUCTIONEER_ADMIN");
|
38
|
+
/// @inheritdoc IExpressLaneAuction
|
39
|
+
bytes32 public constant MIN_RESERVE_SETTER_ROLE = keccak256("MIN_RESERVE_SETTER");
|
40
|
+
/// @inheritdoc IExpressLaneAuction
|
41
|
+
bytes32 public constant RESERVE_SETTER_ROLE = keccak256("RESERVE_SETTER");
|
42
|
+
/// @inheritdoc IExpressLaneAuction
|
43
|
+
bytes32 public constant RESERVE_SETTER_ADMIN_ROLE = keccak256("RESERVE_SETTER_ADMIN");
|
44
|
+
/// @inheritdoc IExpressLaneAuction
|
45
|
+
bytes32 public constant BENEFICIARY_SETTER_ROLE = keccak256("BENEFICIARY_SETTER");
|
46
|
+
/// @inheritdoc IExpressLaneAuction
|
47
|
+
bytes32 public constant ROUND_TIMING_SETTER_ROLE = keccak256("ROUND_TIMING_SETTER");
|
48
|
+
|
49
|
+
/// @notice The balances of each address
|
50
|
+
mapping(address => Balance) internal _balanceOf;
|
51
|
+
|
52
|
+
/// @dev Recently resolved round information. Contains the two most recently resolved rounds
|
53
|
+
ELCRound[2] internal latestResolvedRounds;
|
54
|
+
|
55
|
+
/// @inheritdoc IExpressLaneAuction
|
56
|
+
address public beneficiary;
|
57
|
+
|
58
|
+
/// @inheritdoc IExpressLaneAuction
|
59
|
+
IERC20 public biddingToken;
|
60
|
+
|
61
|
+
/// @inheritdoc IExpressLaneAuction
|
62
|
+
uint256 public reservePrice;
|
63
|
+
|
64
|
+
/// @inheritdoc IExpressLaneAuction
|
65
|
+
uint256 public minReservePrice;
|
66
|
+
|
67
|
+
/// @inheritdoc IExpressLaneAuction
|
68
|
+
RoundTimingInfo public roundTimingInfo;
|
69
|
+
|
70
|
+
/// @inheritdoc IExpressLaneAuction
|
71
|
+
uint256 public beneficiaryBalance;
|
72
|
+
|
73
|
+
/// @inheritdoc IExpressLaneAuction
|
74
|
+
mapping(address => Transferor) public transferorOf;
|
75
|
+
|
76
|
+
/// @inheritdoc IExpressLaneAuction
|
77
|
+
function initialize(
|
78
|
+
InitArgs calldata args
|
79
|
+
) public initializer onlyDelegated {
|
80
|
+
__AccessControl_init();
|
81
|
+
__EIP712_init("ExpressLaneAuction", "1");
|
82
|
+
|
83
|
+
if (address(args._biddingToken) == address(0)) {
|
84
|
+
revert ZeroBiddingToken();
|
85
|
+
}
|
86
|
+
biddingToken = IERC20(args._biddingToken);
|
87
|
+
|
88
|
+
beneficiary = args._beneficiary;
|
89
|
+
emit SetBeneficiary(address(0), args._beneficiary);
|
90
|
+
|
91
|
+
minReservePrice = args._minReservePrice;
|
92
|
+
emit SetMinReservePrice(0, args._minReservePrice);
|
93
|
+
|
94
|
+
reservePrice = args._minReservePrice;
|
95
|
+
emit SetReservePrice(0, args._minReservePrice);
|
96
|
+
|
97
|
+
// the initial timestamp cannot be negative
|
98
|
+
if (args._roundTimingInfo.offsetTimestamp < 0) {
|
99
|
+
revert NegativeOffset();
|
100
|
+
}
|
101
|
+
setRoundTimingInfoInternal(args._roundTimingInfo);
|
102
|
+
|
103
|
+
// roles without a custom role admin set will have this as the admin
|
104
|
+
_grantRole(DEFAULT_ADMIN_ROLE, args._masterAdmin);
|
105
|
+
_grantRole(MIN_RESERVE_SETTER_ROLE, args._minReservePriceSetter);
|
106
|
+
_grantRole(BENEFICIARY_SETTER_ROLE, args._beneficiarySetter);
|
107
|
+
|
108
|
+
// the following roles are expected to be controlled by hot wallets, so we add
|
109
|
+
// additional custom admin role for each of them to allow for key rotation management
|
110
|
+
setRoleAndAdmin(
|
111
|
+
AUCTIONEER_ROLE, args._auctioneer, AUCTIONEER_ADMIN_ROLE, args._auctioneerAdmin
|
112
|
+
);
|
113
|
+
setRoleAndAdmin(
|
114
|
+
RESERVE_SETTER_ROLE,
|
115
|
+
args._reservePriceSetter,
|
116
|
+
RESERVE_SETTER_ADMIN_ROLE,
|
117
|
+
args._reservePriceSetterAdmin
|
118
|
+
);
|
119
|
+
_grantRole(ROUND_TIMING_SETTER_ROLE, args._roundTimingSetter);
|
120
|
+
}
|
121
|
+
|
122
|
+
/// @notice Set an address for a role, an admin role for the role, and an address for the admin role
|
123
|
+
function setRoleAndAdmin(
|
124
|
+
bytes32 role,
|
125
|
+
address roleAddr,
|
126
|
+
bytes32 adminRole,
|
127
|
+
address adminRoleAddr
|
128
|
+
) internal {
|
129
|
+
_grantRole(role, roleAddr);
|
130
|
+
_grantRole(adminRole, adminRoleAddr);
|
131
|
+
_setRoleAdmin(role, adminRole);
|
132
|
+
}
|
133
|
+
|
134
|
+
/// @inheritdoc IExpressLaneAuction
|
135
|
+
function currentRound() external view returns (uint64) {
|
136
|
+
return roundTimingInfo.currentRound();
|
137
|
+
}
|
138
|
+
|
139
|
+
/// @inheritdoc IExpressLaneAuction
|
140
|
+
function isAuctionRoundClosed() external view returns (bool) {
|
141
|
+
return roundTimingInfo.isAuctionRoundClosed();
|
142
|
+
}
|
143
|
+
|
144
|
+
/// @inheritdoc IExpressLaneAuction
|
145
|
+
function isReserveBlackout() external view returns (bool) {
|
146
|
+
(ELCRound storage lastRoundResolved,) = latestResolvedRounds.latestELCRound();
|
147
|
+
return roundTimingInfo.isReserveBlackout(lastRoundResolved.round);
|
148
|
+
}
|
149
|
+
|
150
|
+
/// @inheritdoc IExpressLaneAuction
|
151
|
+
function roundTimestamps(
|
152
|
+
uint64 round
|
153
|
+
) external view returns (uint64, uint64) {
|
154
|
+
return roundTimingInfo.roundTimestamps(round);
|
155
|
+
}
|
156
|
+
|
157
|
+
/// @inheritdoc IExpressLaneAuction
|
158
|
+
function setBeneficiary(
|
159
|
+
address newBeneficiary
|
160
|
+
) external onlyRole(BENEFICIARY_SETTER_ROLE) {
|
161
|
+
emit SetBeneficiary(beneficiary, newBeneficiary);
|
162
|
+
beneficiary = newBeneficiary;
|
163
|
+
}
|
164
|
+
|
165
|
+
function _setReservePrice(
|
166
|
+
uint256 newReservePrice
|
167
|
+
) private {
|
168
|
+
if (newReservePrice < minReservePrice) {
|
169
|
+
revert ReservePriceTooLow(newReservePrice, minReservePrice);
|
170
|
+
}
|
171
|
+
|
172
|
+
emit SetReservePrice(reservePrice, newReservePrice);
|
173
|
+
reservePrice = newReservePrice;
|
174
|
+
}
|
175
|
+
|
176
|
+
function setRoundTimingInfoInternal(
|
177
|
+
RoundTimingInfo calldata newRoundTimingInfo
|
178
|
+
) internal {
|
179
|
+
// auction closing seconds of 0 wouldnt make sense as it would then be impossible to close the round
|
180
|
+
// due to the check below this also causes round duration > 0
|
181
|
+
if (newRoundTimingInfo.auctionClosingSeconds == 0) {
|
182
|
+
revert ZeroAuctionClosingSeconds();
|
183
|
+
}
|
184
|
+
|
185
|
+
// ensure that round duration cannot be too high, other wise this could be used to lock balances
|
186
|
+
// in the contract by setting round duration = uint.max
|
187
|
+
if (newRoundTimingInfo.roundDurationSeconds > 1 days) {
|
188
|
+
revert RoundTooLong(newRoundTimingInfo.roundDurationSeconds);
|
189
|
+
}
|
190
|
+
|
191
|
+
// the same check as in initialization - reserve submission and auction closing are non overlapping
|
192
|
+
// sub sections of a round, so must fit within it
|
193
|
+
if (
|
194
|
+
newRoundTimingInfo.reserveSubmissionSeconds + newRoundTimingInfo.auctionClosingSeconds
|
195
|
+
> newRoundTimingInfo.roundDurationSeconds
|
196
|
+
) {
|
197
|
+
revert RoundDurationTooShort();
|
198
|
+
}
|
199
|
+
|
200
|
+
roundTimingInfo = newRoundTimingInfo;
|
201
|
+
emit SetRoundTimingInfo(
|
202
|
+
newRoundTimingInfo.currentRound(),
|
203
|
+
newRoundTimingInfo.offsetTimestamp,
|
204
|
+
newRoundTimingInfo.roundDurationSeconds,
|
205
|
+
newRoundTimingInfo.auctionClosingSeconds,
|
206
|
+
newRoundTimingInfo.reserveSubmissionSeconds
|
207
|
+
);
|
208
|
+
}
|
209
|
+
|
210
|
+
/// @inheritdoc IExpressLaneAuction
|
211
|
+
function setRoundTimingInfo(
|
212
|
+
RoundTimingInfo calldata newRoundTimingInfo
|
213
|
+
) external onlyRole(ROUND_TIMING_SETTER_ROLE) {
|
214
|
+
RoundTimingInfo memory currentRoundTimingInfo = roundTimingInfo;
|
215
|
+
uint64 currentCurrentRound = currentRoundTimingInfo.currentRound();
|
216
|
+
uint64 newCurrentRound = newRoundTimingInfo.currentRound();
|
217
|
+
// updating round timing info needs to be synchronised
|
218
|
+
// so we ensure that the current round won't change
|
219
|
+
if (currentCurrentRound != newCurrentRound) {
|
220
|
+
revert InvalidNewRound(currentCurrentRound, newCurrentRound);
|
221
|
+
}
|
222
|
+
|
223
|
+
(uint64 currentStart,) = currentRoundTimingInfo.roundTimestamps(currentCurrentRound + 1);
|
224
|
+
(uint64 newStart,) = newRoundTimingInfo.roundTimestamps(newCurrentRound + 1);
|
225
|
+
// we also ensure that the current round end time/next round start time, will not change
|
226
|
+
if (currentStart != newStart) {
|
227
|
+
revert InvalidNewStart(currentStart, newStart);
|
228
|
+
}
|
229
|
+
|
230
|
+
setRoundTimingInfoInternal(newRoundTimingInfo);
|
231
|
+
}
|
232
|
+
|
233
|
+
/// @inheritdoc IExpressLaneAuction
|
234
|
+
function setMinReservePrice(
|
235
|
+
uint256 newMinReservePrice
|
236
|
+
) external onlyRole(MIN_RESERVE_SETTER_ROLE) {
|
237
|
+
emit SetMinReservePrice(minReservePrice, newMinReservePrice);
|
238
|
+
|
239
|
+
minReservePrice = newMinReservePrice;
|
240
|
+
|
241
|
+
if (newMinReservePrice > reservePrice) {
|
242
|
+
_setReservePrice(newMinReservePrice);
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
/// @inheritdoc IExpressLaneAuction
|
247
|
+
function setReservePrice(
|
248
|
+
uint256 newReservePrice
|
249
|
+
) external onlyRole(RESERVE_SETTER_ROLE) {
|
250
|
+
(ELCRound storage lastRoundResolved,) = latestResolvedRounds.latestELCRound();
|
251
|
+
if (roundTimingInfo.isReserveBlackout(lastRoundResolved.round)) {
|
252
|
+
revert ReserveBlackout();
|
253
|
+
}
|
254
|
+
|
255
|
+
_setReservePrice(newReservePrice);
|
256
|
+
}
|
257
|
+
|
258
|
+
/// @inheritdoc IExpressLaneAuction
|
259
|
+
function balanceOf(
|
260
|
+
address account
|
261
|
+
) external view returns (uint256) {
|
262
|
+
return _balanceOf[account].balanceAtRound(roundTimingInfo.currentRound());
|
263
|
+
}
|
264
|
+
|
265
|
+
/// @inheritdoc IExpressLaneAuction
|
266
|
+
function balanceOfAtRound(address account, uint64 round) external view returns (uint256) {
|
267
|
+
if (round < roundTimingInfo.currentRound()) {
|
268
|
+
revert RoundTooOld(round, roundTimingInfo.currentRound());
|
269
|
+
}
|
270
|
+
return _balanceOf[account].balanceAtRound(round);
|
271
|
+
}
|
272
|
+
|
273
|
+
/// @inheritdoc IExpressLaneAuction
|
274
|
+
function withdrawableBalance(
|
275
|
+
address account
|
276
|
+
) external view returns (uint256) {
|
277
|
+
return _balanceOf[account].withdrawableBalanceAtRound(roundTimingInfo.currentRound());
|
278
|
+
}
|
279
|
+
|
280
|
+
/// @inheritdoc IExpressLaneAuction
|
281
|
+
function withdrawableBalanceAtRound(
|
282
|
+
address account,
|
283
|
+
uint64 round
|
284
|
+
) external view returns (uint256) {
|
285
|
+
if (round < roundTimingInfo.currentRound()) {
|
286
|
+
revert RoundTooOld(round, roundTimingInfo.currentRound());
|
287
|
+
}
|
288
|
+
return _balanceOf[account].withdrawableBalanceAtRound(round);
|
289
|
+
}
|
290
|
+
|
291
|
+
/// @inheritdoc IExpressLaneAuction
|
292
|
+
function deposit(
|
293
|
+
uint256 amount
|
294
|
+
) external {
|
295
|
+
_balanceOf[msg.sender].increase(amount);
|
296
|
+
biddingToken.safeTransferFrom(msg.sender, address(this), amount);
|
297
|
+
emit Deposit(msg.sender, amount);
|
298
|
+
}
|
299
|
+
|
300
|
+
/// @inheritdoc IExpressLaneAuction
|
301
|
+
function initiateWithdrawal() external {
|
302
|
+
// The withdrawal can be finalized 2 rounds for now. We dont make it round + 1 in
|
303
|
+
// case the initiation were to occur right at the end of a round. Doing round + 2 ensures
|
304
|
+
// observers always have at least one full round to become aware of the future balance change.
|
305
|
+
uint64 withdrawalRound = roundTimingInfo.currentRound() + 2;
|
306
|
+
uint256 amount = _balanceOf[msg.sender].balance;
|
307
|
+
_balanceOf[msg.sender].initiateWithdrawal(withdrawalRound);
|
308
|
+
emit WithdrawalInitiated(msg.sender, amount, withdrawalRound);
|
309
|
+
}
|
310
|
+
|
311
|
+
/// @inheritdoc IExpressLaneAuction
|
312
|
+
function finalizeWithdrawal() external {
|
313
|
+
uint256 amountReduced =
|
314
|
+
_balanceOf[msg.sender].finalizeWithdrawal(roundTimingInfo.currentRound());
|
315
|
+
biddingToken.safeTransfer(msg.sender, amountReduced);
|
316
|
+
emit WithdrawalFinalized(msg.sender, amountReduced);
|
317
|
+
}
|
318
|
+
|
319
|
+
/// @inheritdoc IExpressLaneAuction
|
320
|
+
function flushBeneficiaryBalance() external {
|
321
|
+
uint256 bal = beneficiaryBalance;
|
322
|
+
if (bal == 0) {
|
323
|
+
revert ZeroAmount();
|
324
|
+
}
|
325
|
+
beneficiaryBalance = 0;
|
326
|
+
biddingToken.safeTransfer(beneficiary, bal);
|
327
|
+
}
|
328
|
+
|
329
|
+
/// @dev Update local state to resolve an auction
|
330
|
+
/// @param isMultiBid Where the auction should be resolved from multiple bids
|
331
|
+
/// @param firstPriceBid The winning bid
|
332
|
+
/// @param firstPriceBidder The winning bidder
|
333
|
+
/// @param priceToPay The price that needs to be paid by the winner
|
334
|
+
/// @param biddingInRound The round bidding is taking place in. This is not the round the bidding is taking place for, which is biddingInRound + 1
|
335
|
+
/// @param roundStart The timestamp at which the bidding for round starts
|
336
|
+
/// @param roundEnd The timestamp at which the bidding for round ends
|
337
|
+
function resolveAuction(
|
338
|
+
bool isMultiBid,
|
339
|
+
Bid calldata firstPriceBid,
|
340
|
+
address firstPriceBidder,
|
341
|
+
uint256 priceToPay,
|
342
|
+
uint64 biddingInRound,
|
343
|
+
uint64 roundStart,
|
344
|
+
uint64 roundEnd
|
345
|
+
) internal {
|
346
|
+
// store that a round has been resolved
|
347
|
+
uint64 biddingForRound = biddingInRound + 1;
|
348
|
+
latestResolvedRounds.setResolvedRound(biddingForRound, firstPriceBid.expressLaneController);
|
349
|
+
|
350
|
+
// first price bidder pays the beneficiary
|
351
|
+
_balanceOf[firstPriceBidder].reduce(priceToPay, biddingInRound);
|
352
|
+
beneficiaryBalance += priceToPay;
|
353
|
+
|
354
|
+
// emit events so that the offchain sequencer knows a new express lane controller has been selected
|
355
|
+
emit SetExpressLaneController(
|
356
|
+
biddingForRound,
|
357
|
+
address(0),
|
358
|
+
firstPriceBid.expressLaneController,
|
359
|
+
address(0),
|
360
|
+
roundStart,
|
361
|
+
roundEnd
|
362
|
+
);
|
363
|
+
emit AuctionResolved(
|
364
|
+
isMultiBid,
|
365
|
+
biddingForRound,
|
366
|
+
firstPriceBidder,
|
367
|
+
firstPriceBid.expressLaneController,
|
368
|
+
firstPriceBid.amount,
|
369
|
+
priceToPay,
|
370
|
+
roundStart,
|
371
|
+
roundEnd
|
372
|
+
);
|
373
|
+
}
|
374
|
+
|
375
|
+
/// @inheritdoc IExpressLaneAuction
|
376
|
+
function domainSeparator() external view returns (bytes32) {
|
377
|
+
return _domainSeparatorV4();
|
378
|
+
}
|
379
|
+
|
380
|
+
/// @dev Internal bid domain hash
|
381
|
+
bytes32 private constant BID_DOMAIN =
|
382
|
+
keccak256("Bid(uint64 round,address expressLaneController,uint256 amount)");
|
383
|
+
|
384
|
+
/// @inheritdoc IExpressLaneAuction
|
385
|
+
function getBidHash(
|
386
|
+
uint64 round,
|
387
|
+
address expressLaneController,
|
388
|
+
uint256 amount
|
389
|
+
) public view returns (bytes32) {
|
390
|
+
return _hashTypedDataV4(
|
391
|
+
keccak256(abi.encode(BID_DOMAIN, round, expressLaneController, amount))
|
392
|
+
);
|
393
|
+
}
|
394
|
+
|
395
|
+
/// @notice Recover the signing address of the provided bid, and check that that address has enough funds to fulfil that bid
|
396
|
+
/// Returns the signing address and the bid hash that was signed
|
397
|
+
/// @param bid The bid to recover the signing address of
|
398
|
+
/// @param biddingForRound The round the bid is for the control of
|
399
|
+
function recoverAndCheckBalance(
|
400
|
+
Bid memory bid,
|
401
|
+
uint64 biddingForRound
|
402
|
+
) internal view returns (address, bytes32) {
|
403
|
+
bytes32 bidHash = getBidHash(biddingForRound, bid.expressLaneController, bid.amount);
|
404
|
+
address bidder = bidHash.recover(bid.signature);
|
405
|
+
// we are always bidding for in the current round for the next round
|
406
|
+
uint64 curRnd = biddingForRound - 1;
|
407
|
+
// always check that the bidder has as much as they're claiming
|
408
|
+
if (_balanceOf[bidder].balanceAtRound(curRnd) < bid.amount) {
|
409
|
+
revert InsufficientBalanceAcc(
|
410
|
+
bidder, bid.amount, _balanceOf[bidder].balanceAtRound(curRnd)
|
411
|
+
);
|
412
|
+
}
|
413
|
+
|
414
|
+
return (bidder, bidHash);
|
415
|
+
}
|
416
|
+
|
417
|
+
/// @inheritdoc IExpressLaneAuction
|
418
|
+
function resolveSingleBidAuction(
|
419
|
+
Bid calldata firstPriceBid
|
420
|
+
) external onlyRole(AUCTIONEER_ROLE) {
|
421
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
422
|
+
if (!info.isAuctionRoundClosed()) {
|
423
|
+
revert AuctionNotClosed();
|
424
|
+
}
|
425
|
+
|
426
|
+
if (firstPriceBid.amount < reservePrice) {
|
427
|
+
revert ReservePriceNotMet(firstPriceBid.amount, reservePrice);
|
428
|
+
}
|
429
|
+
|
430
|
+
uint64 biddingInRound = info.currentRound();
|
431
|
+
uint64 biddingForRound = biddingInRound + 1;
|
432
|
+
(address firstPriceBidder,) = recoverAndCheckBalance(firstPriceBid, biddingForRound);
|
433
|
+
|
434
|
+
(uint64 roundStart, uint64 roundEnd) = info.roundTimestamps(biddingForRound);
|
435
|
+
resolveAuction(
|
436
|
+
false,
|
437
|
+
firstPriceBid,
|
438
|
+
firstPriceBidder,
|
439
|
+
reservePrice,
|
440
|
+
biddingInRound,
|
441
|
+
roundStart,
|
442
|
+
roundEnd
|
443
|
+
);
|
444
|
+
}
|
445
|
+
|
446
|
+
/// @inheritdoc IExpressLaneAuction
|
447
|
+
function resolveMultiBidAuction(
|
448
|
+
Bid calldata firstPriceBid,
|
449
|
+
Bid calldata secondPriceBid
|
450
|
+
) external onlyRole(AUCTIONEER_ROLE) {
|
451
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
452
|
+
if (!info.isAuctionRoundClosed()) {
|
453
|
+
revert AuctionNotClosed();
|
454
|
+
}
|
455
|
+
|
456
|
+
if (firstPriceBid.amount < secondPriceBid.amount) {
|
457
|
+
revert BidsWrongOrder();
|
458
|
+
}
|
459
|
+
|
460
|
+
// second amount must be greater than or equal the reserve
|
461
|
+
if (secondPriceBid.amount < reservePrice) {
|
462
|
+
revert ReservePriceNotMet(secondPriceBid.amount, reservePrice);
|
463
|
+
}
|
464
|
+
|
465
|
+
uint64 biddingInRound = info.currentRound();
|
466
|
+
uint64 biddingForRound = biddingInRound + 1;
|
467
|
+
// check the signatures and balances of both bids
|
468
|
+
// even the second price bid must have the balance it's claiming
|
469
|
+
(address firstPriceBidder, bytes32 firstBidHash) =
|
470
|
+
recoverAndCheckBalance(firstPriceBid, biddingForRound);
|
471
|
+
(address secondPriceBidder, bytes32 secondBidHash) =
|
472
|
+
recoverAndCheckBalance(secondPriceBid, biddingForRound);
|
473
|
+
|
474
|
+
// The bidders must be different so that our balance check isnt fooled into thinking
|
475
|
+
// that the same balance is valid for both the first and second bid
|
476
|
+
if (firstPriceBidder == secondPriceBidder) {
|
477
|
+
revert SameBidder();
|
478
|
+
}
|
479
|
+
|
480
|
+
// when bids have the same amount we break ties based on the bid hash
|
481
|
+
// although we include equality in the check we know this isnt possible due
|
482
|
+
// to the check above that ensures the first price bidder and second price bidder are different
|
483
|
+
if (
|
484
|
+
firstPriceBid.amount == secondPriceBid.amount
|
485
|
+
&& uint256(keccak256(abi.encodePacked(firstPriceBidder, firstBidHash)))
|
486
|
+
< uint256(keccak256(abi.encodePacked(secondPriceBidder, secondBidHash)))
|
487
|
+
) {
|
488
|
+
revert TieBidsWrongOrder();
|
489
|
+
}
|
490
|
+
|
491
|
+
(uint64 roundStart, uint64 roundEnd) = info.roundTimestamps(biddingForRound);
|
492
|
+
resolveAuction(
|
493
|
+
true,
|
494
|
+
firstPriceBid,
|
495
|
+
firstPriceBidder,
|
496
|
+
secondPriceBid.amount,
|
497
|
+
biddingInRound,
|
498
|
+
roundStart,
|
499
|
+
roundEnd
|
500
|
+
);
|
501
|
+
}
|
502
|
+
|
503
|
+
/// @inheritdoc IExpressLaneAuction
|
504
|
+
function setTransferor(
|
505
|
+
Transferor calldata transferor
|
506
|
+
) external {
|
507
|
+
// if a transferor has already been set, it may be fixed until a future round
|
508
|
+
Transferor storage currentTransferor = transferorOf[msg.sender];
|
509
|
+
if (
|
510
|
+
currentTransferor.addr != address(0)
|
511
|
+
&& currentTransferor.fixedUntilRound > roundTimingInfo.currentRound()
|
512
|
+
) {
|
513
|
+
revert FixedTransferor(currentTransferor.fixedUntilRound);
|
514
|
+
}
|
515
|
+
|
516
|
+
transferorOf[msg.sender] = transferor;
|
517
|
+
|
518
|
+
emit SetTransferor(msg.sender, transferor.addr, transferor.fixedUntilRound);
|
519
|
+
}
|
520
|
+
|
521
|
+
/// @inheritdoc IExpressLaneAuction
|
522
|
+
function transferExpressLaneController(
|
523
|
+
uint64 round,
|
524
|
+
address newExpressLaneController
|
525
|
+
) external {
|
526
|
+
// past rounds cannot be transferred
|
527
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
528
|
+
uint64 curRnd = info.currentRound();
|
529
|
+
if (round < curRnd) {
|
530
|
+
revert RoundTooOld(round, curRnd);
|
531
|
+
}
|
532
|
+
|
533
|
+
// only resolved rounds can be transferred
|
534
|
+
ELCRound storage resolvedRound = latestResolvedRounds.resolvedRound(round);
|
535
|
+
|
536
|
+
address resolvedELC = resolvedRound.expressLaneController;
|
537
|
+
address transferor = transferorOf[resolvedELC].addr;
|
538
|
+
// can only be the transferor if one has been set
|
539
|
+
// otherwise we default to the express lane controller to do the transfer
|
540
|
+
if (transferor != address(0)) {
|
541
|
+
if (transferor != msg.sender) {
|
542
|
+
revert NotTransferor(round, transferor, msg.sender);
|
543
|
+
}
|
544
|
+
} else if (resolvedELC != msg.sender) {
|
545
|
+
revert NotExpressLaneController(round, resolvedELC, msg.sender);
|
546
|
+
}
|
547
|
+
|
548
|
+
resolvedRound.expressLaneController = newExpressLaneController;
|
549
|
+
|
550
|
+
(uint64 start, uint64 end) = info.roundTimestamps(round);
|
551
|
+
emit SetExpressLaneController(
|
552
|
+
round,
|
553
|
+
resolvedELC,
|
554
|
+
newExpressLaneController,
|
555
|
+
transferor != address(0) ? transferor : resolvedELC,
|
556
|
+
start < uint64(block.timestamp) ? uint64(block.timestamp) : start,
|
557
|
+
end
|
558
|
+
);
|
559
|
+
}
|
560
|
+
|
561
|
+
/// @inheritdoc IExpressLaneAuction
|
562
|
+
function resolvedRounds() external view returns (ELCRound memory, ELCRound memory) {
|
563
|
+
return latestResolvedRounds[0].round > latestResolvedRounds[1].round
|
564
|
+
? (latestResolvedRounds[0], latestResolvedRounds[1])
|
565
|
+
: (latestResolvedRounds[1], latestResolvedRounds[0]);
|
566
|
+
}
|
567
|
+
}
|