@arbitrum/nitro-contracts 2.1.0 → 2.1.1
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.
- package/LICENSE.md +1 -1
- 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/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/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 +258 -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 +281 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
- 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 +312 -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/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 +10 -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 +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol/EnumerableSetUpgradeable.json +10 -0
- 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/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
- 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/Inbox.sol/Inbox.json +2 -2
- 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/chain/CacheManager.sol/CacheManager.json +2 -2
- package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +1 -1
- package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +1 -1
- package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.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 +1588 -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/ArbitrumChecker.sol/ArbitrumChecker.json +2 -2
- 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 +15 -2
- package/build/contracts/src/mocks/CreateTest.sol/CreateTest.dbg.json +4 -0
- package/build/contracts/src/mocks/CreateTest.sol/CreateTest.json +15 -0
- package/build/contracts/src/mocks/HostioTest.sol/HostioTest.dbg.json +4 -0
- package/build/contracts/src/mocks/HostioTest.sol/HostioTest.json +513 -0
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.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/PendingBlkTimeAndNrAdvanceCheck.sol/PendingBlkTimeAndNrAdvanceCheck.json +2 -2
- package/build/contracts/src/mocks/Program.sol/ProgramTest.dbg.json +1 -1
- package/build/contracts/src/mocks/Program.sol/ProgramTest.json +2 -2
- 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/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/Simple.sol/Simple.json +2 -2
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +1 -1
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.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/ArbWasm.sol/ArbWasm.json +4 -4
- 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/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/ERC20RollupEventInbox.sol/ERC20RollupEventInbox.json +2 -2
- 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/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/IRollupLogic.sol/IRollupUserAbs.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +1 -1
- package/build/contracts/src/rollup/Node.sol/NodeLib.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 +2 -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 +2 -2
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupEventInbox.sol/RollupEventInbox.json +2 -2
- package/build/contracts/src/rollup/RollupLib.sol/RollupLib.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupProxy.sol/RollupProxy.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +2 -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/ValidatorUtils.sol/ValidatorUtils.dbg.json +1 -1
- 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/out/yul/Reader4844.yul/Reader4844.json +1 -1
- package/package.json +5 -2
- package/src/express-lane-auction/Balance.sol +142 -0
- package/src/express-lane-auction/Burner.sol +25 -0
- package/src/express-lane-auction/ELCRound.sol +73 -0
- package/src/express-lane-auction/Errors.sol +31 -0
- package/src/express-lane-auction/ExpressLaneAuction.sol +565 -0
- package/src/express-lane-auction/IExpressLaneAuction.sol +421 -0
- package/src/express-lane-auction/RoundTimingInfo.sol +115 -0
- package/src/mocks/BridgeUnproxied.sol +2 -0
- package/src/mocks/CreateTest.sol +42 -0
- package/src/mocks/HostioTest.sol +196 -0
- package/src/precompiles/ArbSys.sol +2 -1
- package/src/precompiles/ArbWasm.sol +1 -1
- package/src/rollup/RollupCreator.sol +4 -4
|
@@ -0,0 +1,565 @@
|
|
|
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 {
|
|
9
|
+
AccessControlEnumerableUpgradeable
|
|
10
|
+
} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
|
|
11
|
+
import {DelegateCallAware} from "../libraries/DelegateCallAware.sol";
|
|
12
|
+
import {IExpressLaneAuction, Bid, InitArgs, Transferor} from "./IExpressLaneAuction.sol";
|
|
13
|
+
import {ELCRound, LatestELCRoundsLib} from "./ELCRound.sol";
|
|
14
|
+
import {RoundTimingInfo, RoundTimingInfoLib} from "./RoundTimingInfo.sol";
|
|
15
|
+
import {
|
|
16
|
+
EIP712Upgradeable
|
|
17
|
+
} from "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
|
|
18
|
+
|
|
19
|
+
/// @title ExpressLaneAuction
|
|
20
|
+
/// @notice The express lane allows a controller to submit undelayed transactions to the sequencer
|
|
21
|
+
/// The right to be the express lane controller are auctioned off in rounds, by an offchain auctioneer.
|
|
22
|
+
/// The auctioneer then submits the winning bids to this control to deduct funds from the bidders and register the winner
|
|
23
|
+
contract ExpressLaneAuction is
|
|
24
|
+
IExpressLaneAuction,
|
|
25
|
+
AccessControlEnumerableUpgradeable,
|
|
26
|
+
DelegateCallAware,
|
|
27
|
+
EIP712Upgradeable
|
|
28
|
+
{
|
|
29
|
+
using SafeERC20 for IERC20;
|
|
30
|
+
using RoundTimingInfoLib for RoundTimingInfo;
|
|
31
|
+
using BalanceLib for Balance;
|
|
32
|
+
using ECDSA for bytes32;
|
|
33
|
+
using ECDSA for bytes;
|
|
34
|
+
using LatestELCRoundsLib for ELCRound[2];
|
|
35
|
+
|
|
36
|
+
/// @inheritdoc IExpressLaneAuction
|
|
37
|
+
bytes32 public constant AUCTIONEER_ROLE = keccak256("AUCTIONEER");
|
|
38
|
+
/// @inheritdoc IExpressLaneAuction
|
|
39
|
+
bytes32 public constant AUCTIONEER_ADMIN_ROLE = keccak256("AUCTIONEER_ADMIN");
|
|
40
|
+
/// @inheritdoc IExpressLaneAuction
|
|
41
|
+
bytes32 public constant MIN_RESERVE_SETTER_ROLE = keccak256("MIN_RESERVE_SETTER");
|
|
42
|
+
/// @inheritdoc IExpressLaneAuction
|
|
43
|
+
bytes32 public constant RESERVE_SETTER_ROLE = keccak256("RESERVE_SETTER");
|
|
44
|
+
/// @inheritdoc IExpressLaneAuction
|
|
45
|
+
bytes32 public constant RESERVE_SETTER_ADMIN_ROLE = keccak256("RESERVE_SETTER_ADMIN");
|
|
46
|
+
/// @inheritdoc IExpressLaneAuction
|
|
47
|
+
bytes32 public constant BENEFICIARY_SETTER_ROLE = keccak256("BENEFICIARY_SETTER");
|
|
48
|
+
/// @inheritdoc IExpressLaneAuction
|
|
49
|
+
bytes32 public constant ROUND_TIMING_SETTER_ROLE = keccak256("ROUND_TIMING_SETTER");
|
|
50
|
+
|
|
51
|
+
/// @notice The balances of each address
|
|
52
|
+
mapping(address => Balance) internal _balanceOf;
|
|
53
|
+
|
|
54
|
+
/// @dev Recently resolved round information. Contains the two most recently resolved rounds
|
|
55
|
+
ELCRound[2] internal latestResolvedRounds;
|
|
56
|
+
|
|
57
|
+
/// @inheritdoc IExpressLaneAuction
|
|
58
|
+
address public beneficiary;
|
|
59
|
+
|
|
60
|
+
/// @inheritdoc IExpressLaneAuction
|
|
61
|
+
IERC20 public biddingToken;
|
|
62
|
+
|
|
63
|
+
/// @inheritdoc IExpressLaneAuction
|
|
64
|
+
uint256 public reservePrice;
|
|
65
|
+
|
|
66
|
+
/// @inheritdoc IExpressLaneAuction
|
|
67
|
+
uint256 public minReservePrice;
|
|
68
|
+
|
|
69
|
+
/// @inheritdoc IExpressLaneAuction
|
|
70
|
+
RoundTimingInfo public roundTimingInfo;
|
|
71
|
+
|
|
72
|
+
/// @inheritdoc IExpressLaneAuction
|
|
73
|
+
uint256 public beneficiaryBalance;
|
|
74
|
+
|
|
75
|
+
/// @inheritdoc IExpressLaneAuction
|
|
76
|
+
mapping(address => Transferor) public transferorOf;
|
|
77
|
+
|
|
78
|
+
/// @inheritdoc IExpressLaneAuction
|
|
79
|
+
function initialize(InitArgs calldata args) 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,
|
|
112
|
+
args._auctioneer,
|
|
113
|
+
AUCTIONEER_ADMIN_ROLE,
|
|
114
|
+
args._auctioneerAdmin
|
|
115
|
+
);
|
|
116
|
+
setRoleAndAdmin(
|
|
117
|
+
RESERVE_SETTER_ROLE,
|
|
118
|
+
args._reservePriceSetter,
|
|
119
|
+
RESERVE_SETTER_ADMIN_ROLE,
|
|
120
|
+
args._reservePriceSetterAdmin
|
|
121
|
+
);
|
|
122
|
+
_grantRole(ROUND_TIMING_SETTER_ROLE, args._roundTimingSetter);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/// @notice Set an address for a role, an admin role for the role, and an address for the admin role
|
|
126
|
+
function setRoleAndAdmin(
|
|
127
|
+
bytes32 role,
|
|
128
|
+
address roleAddr,
|
|
129
|
+
bytes32 adminRole,
|
|
130
|
+
address adminRoleAddr
|
|
131
|
+
) internal {
|
|
132
|
+
_grantRole(role, roleAddr);
|
|
133
|
+
_grantRole(adminRole, adminRoleAddr);
|
|
134
|
+
_setRoleAdmin(role, adminRole);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/// @inheritdoc IExpressLaneAuction
|
|
138
|
+
function currentRound() external view returns (uint64) {
|
|
139
|
+
return roundTimingInfo.currentRound();
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/// @inheritdoc IExpressLaneAuction
|
|
143
|
+
function isAuctionRoundClosed() external view returns (bool) {
|
|
144
|
+
return roundTimingInfo.isAuctionRoundClosed();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/// @inheritdoc IExpressLaneAuction
|
|
148
|
+
function isReserveBlackout() external view returns (bool) {
|
|
149
|
+
(ELCRound storage lastRoundResolved, ) = latestResolvedRounds.latestELCRound();
|
|
150
|
+
return roundTimingInfo.isReserveBlackout(lastRoundResolved.round);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/// @inheritdoc IExpressLaneAuction
|
|
154
|
+
function roundTimestamps(uint64 round) external view returns (uint64, uint64) {
|
|
155
|
+
return roundTimingInfo.roundTimestamps(round);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/// @inheritdoc IExpressLaneAuction
|
|
159
|
+
function setBeneficiary(address newBeneficiary) external onlyRole(BENEFICIARY_SETTER_ROLE) {
|
|
160
|
+
emit SetBeneficiary(beneficiary, newBeneficiary);
|
|
161
|
+
beneficiary = newBeneficiary;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function _setReservePrice(uint256 newReservePrice) private {
|
|
165
|
+
if (newReservePrice < minReservePrice) {
|
|
166
|
+
revert ReservePriceTooLow(newReservePrice, minReservePrice);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
emit SetReservePrice(reservePrice, newReservePrice);
|
|
170
|
+
reservePrice = newReservePrice;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function setRoundTimingInfoInternal(RoundTimingInfo calldata newRoundTimingInfo) internal {
|
|
174
|
+
// auction closing seconds of 0 wouldnt make sense as it would then be impossible to close the round
|
|
175
|
+
// due to the check below this also causes round duration > 0
|
|
176
|
+
if (newRoundTimingInfo.auctionClosingSeconds == 0) {
|
|
177
|
+
revert ZeroAuctionClosingSeconds();
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ensure that round duration cannot be too high, other wise this could be used to lock balances
|
|
181
|
+
// in the contract by setting round duration = uint.max
|
|
182
|
+
if (newRoundTimingInfo.roundDurationSeconds > 1 days) {
|
|
183
|
+
revert RoundTooLong(newRoundTimingInfo.roundDurationSeconds);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// the same check as in initialization - reserve submission and auction closing are non overlapping
|
|
187
|
+
// sub sections of a round, so must fit within it
|
|
188
|
+
if (
|
|
189
|
+
newRoundTimingInfo.reserveSubmissionSeconds + newRoundTimingInfo.auctionClosingSeconds >
|
|
190
|
+
newRoundTimingInfo.roundDurationSeconds
|
|
191
|
+
) {
|
|
192
|
+
revert RoundDurationTooShort();
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
roundTimingInfo = newRoundTimingInfo;
|
|
196
|
+
emit SetRoundTimingInfo(
|
|
197
|
+
newRoundTimingInfo.currentRound(),
|
|
198
|
+
newRoundTimingInfo.offsetTimestamp,
|
|
199
|
+
newRoundTimingInfo.roundDurationSeconds,
|
|
200
|
+
newRoundTimingInfo.auctionClosingSeconds,
|
|
201
|
+
newRoundTimingInfo.reserveSubmissionSeconds
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/// @inheritdoc IExpressLaneAuction
|
|
206
|
+
function setRoundTimingInfo(RoundTimingInfo calldata newRoundTimingInfo)
|
|
207
|
+
external
|
|
208
|
+
onlyRole(ROUND_TIMING_SETTER_ROLE)
|
|
209
|
+
{
|
|
210
|
+
RoundTimingInfo memory currentRoundTimingInfo = roundTimingInfo;
|
|
211
|
+
uint64 currentCurrentRound = currentRoundTimingInfo.currentRound();
|
|
212
|
+
uint64 newCurrentRound = newRoundTimingInfo.currentRound();
|
|
213
|
+
// updating round timing info needs to be synchronised
|
|
214
|
+
// so we ensure that the current round won't change
|
|
215
|
+
if (currentCurrentRound != newCurrentRound) {
|
|
216
|
+
revert InvalidNewRound(currentCurrentRound, newCurrentRound);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
(uint64 currentStart, ) = currentRoundTimingInfo.roundTimestamps(currentCurrentRound + 1);
|
|
220
|
+
(uint64 newStart, ) = newRoundTimingInfo.roundTimestamps(newCurrentRound + 1);
|
|
221
|
+
// we also ensure that the current round end time/next round start time, will not change
|
|
222
|
+
if (currentStart != newStart) {
|
|
223
|
+
revert InvalidNewStart(currentStart, newStart);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
setRoundTimingInfoInternal(newRoundTimingInfo);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/// @inheritdoc IExpressLaneAuction
|
|
230
|
+
function setMinReservePrice(uint256 newMinReservePrice)
|
|
231
|
+
external
|
|
232
|
+
onlyRole(MIN_RESERVE_SETTER_ROLE)
|
|
233
|
+
{
|
|
234
|
+
emit SetMinReservePrice(minReservePrice, newMinReservePrice);
|
|
235
|
+
|
|
236
|
+
minReservePrice = newMinReservePrice;
|
|
237
|
+
|
|
238
|
+
if (newMinReservePrice > reservePrice) {
|
|
239
|
+
_setReservePrice(newMinReservePrice);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/// @inheritdoc IExpressLaneAuction
|
|
244
|
+
function setReservePrice(uint256 newReservePrice) external onlyRole(RESERVE_SETTER_ROLE) {
|
|
245
|
+
(ELCRound storage lastRoundResolved, ) = latestResolvedRounds.latestELCRound();
|
|
246
|
+
if (roundTimingInfo.isReserveBlackout(lastRoundResolved.round)) {
|
|
247
|
+
revert ReserveBlackout();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
_setReservePrice(newReservePrice);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/// @inheritdoc IExpressLaneAuction
|
|
254
|
+
function balanceOf(address account) external view returns (uint256) {
|
|
255
|
+
return _balanceOf[account].balanceAtRound(roundTimingInfo.currentRound());
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/// @inheritdoc IExpressLaneAuction
|
|
259
|
+
function balanceOfAtRound(address account, uint64 round) external view returns (uint256) {
|
|
260
|
+
if (round < roundTimingInfo.currentRound()) {
|
|
261
|
+
revert RoundTooOld(round, roundTimingInfo.currentRound());
|
|
262
|
+
}
|
|
263
|
+
return _balanceOf[account].balanceAtRound(round);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/// @inheritdoc IExpressLaneAuction
|
|
267
|
+
function withdrawableBalance(address account) external view returns (uint256) {
|
|
268
|
+
return _balanceOf[account].withdrawableBalanceAtRound(roundTimingInfo.currentRound());
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/// @inheritdoc IExpressLaneAuction
|
|
272
|
+
function withdrawableBalanceAtRound(address account, uint64 round)
|
|
273
|
+
external
|
|
274
|
+
view
|
|
275
|
+
returns (uint256)
|
|
276
|
+
{
|
|
277
|
+
if (round < roundTimingInfo.currentRound()) {
|
|
278
|
+
revert RoundTooOld(round, roundTimingInfo.currentRound());
|
|
279
|
+
}
|
|
280
|
+
return _balanceOf[account].withdrawableBalanceAtRound(round);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/// @inheritdoc IExpressLaneAuction
|
|
284
|
+
function deposit(uint256 amount) external {
|
|
285
|
+
_balanceOf[msg.sender].increase(amount);
|
|
286
|
+
biddingToken.safeTransferFrom(msg.sender, address(this), amount);
|
|
287
|
+
emit Deposit(msg.sender, amount);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/// @inheritdoc IExpressLaneAuction
|
|
291
|
+
function initiateWithdrawal() external {
|
|
292
|
+
// The withdrawal can be finalized 2 rounds for now. We dont make it round + 1 in
|
|
293
|
+
// case the initiation were to occur right at the end of a round. Doing round + 2 ensures
|
|
294
|
+
// observers always have at least one full round to become aware of the future balance change.
|
|
295
|
+
uint64 withdrawalRound = roundTimingInfo.currentRound() + 2;
|
|
296
|
+
uint256 amount = _balanceOf[msg.sender].balance;
|
|
297
|
+
_balanceOf[msg.sender].initiateWithdrawal(withdrawalRound);
|
|
298
|
+
emit WithdrawalInitiated(msg.sender, amount, withdrawalRound);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/// @inheritdoc IExpressLaneAuction
|
|
302
|
+
function finalizeWithdrawal() external {
|
|
303
|
+
uint256 amountReduced = _balanceOf[msg.sender].finalizeWithdrawal(
|
|
304
|
+
roundTimingInfo.currentRound()
|
|
305
|
+
);
|
|
306
|
+
biddingToken.safeTransfer(msg.sender, amountReduced);
|
|
307
|
+
emit WithdrawalFinalized(msg.sender, amountReduced);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/// @inheritdoc IExpressLaneAuction
|
|
311
|
+
function flushBeneficiaryBalance() external {
|
|
312
|
+
uint256 bal = beneficiaryBalance;
|
|
313
|
+
if (bal == 0) {
|
|
314
|
+
revert ZeroAmount();
|
|
315
|
+
}
|
|
316
|
+
beneficiaryBalance = 0;
|
|
317
|
+
biddingToken.safeTransfer(beneficiary, bal);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/// @dev Update local state to resolve an auction
|
|
321
|
+
/// @param isMultiBid Where the auction should be resolved from multiple bids
|
|
322
|
+
/// @param firstPriceBid The winning bid
|
|
323
|
+
/// @param firstPriceBidder The winning bidder
|
|
324
|
+
/// @param priceToPay The price that needs to be paid by the winner
|
|
325
|
+
/// @param biddingInRound The round bidding is taking place in. This is not the round the bidding is taking place for, which is biddingInRound + 1
|
|
326
|
+
/// @param roundStart The timestamp at which the bidding for round starts
|
|
327
|
+
/// @param roundEnd The timestamp at which the bidding for round ends
|
|
328
|
+
function resolveAuction(
|
|
329
|
+
bool isMultiBid,
|
|
330
|
+
Bid calldata firstPriceBid,
|
|
331
|
+
address firstPriceBidder,
|
|
332
|
+
uint256 priceToPay,
|
|
333
|
+
uint64 biddingInRound,
|
|
334
|
+
uint64 roundStart,
|
|
335
|
+
uint64 roundEnd
|
|
336
|
+
) internal {
|
|
337
|
+
// store that a round has been resolved
|
|
338
|
+
uint64 biddingForRound = biddingInRound + 1;
|
|
339
|
+
latestResolvedRounds.setResolvedRound(biddingForRound, firstPriceBid.expressLaneController);
|
|
340
|
+
|
|
341
|
+
// first price bidder pays the beneficiary
|
|
342
|
+
_balanceOf[firstPriceBidder].reduce(priceToPay, biddingInRound);
|
|
343
|
+
beneficiaryBalance += priceToPay;
|
|
344
|
+
|
|
345
|
+
// emit events so that the offchain sequencer knows a new express lane controller has been selected
|
|
346
|
+
emit SetExpressLaneController(
|
|
347
|
+
biddingForRound,
|
|
348
|
+
address(0),
|
|
349
|
+
firstPriceBid.expressLaneController,
|
|
350
|
+
address(0),
|
|
351
|
+
roundStart,
|
|
352
|
+
roundEnd
|
|
353
|
+
);
|
|
354
|
+
emit AuctionResolved(
|
|
355
|
+
isMultiBid,
|
|
356
|
+
biddingForRound,
|
|
357
|
+
firstPriceBidder,
|
|
358
|
+
firstPriceBid.expressLaneController,
|
|
359
|
+
firstPriceBid.amount,
|
|
360
|
+
priceToPay,
|
|
361
|
+
roundStart,
|
|
362
|
+
roundEnd
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/// @inheritdoc IExpressLaneAuction
|
|
367
|
+
function domainSeparator() external view returns (bytes32) {
|
|
368
|
+
return _domainSeparatorV4();
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/// @dev Internal bid domain hash
|
|
372
|
+
bytes32 private constant BID_DOMAIN =
|
|
373
|
+
keccak256("Bid(uint64 round,address expressLaneController,uint256 amount)");
|
|
374
|
+
|
|
375
|
+
/// @inheritdoc IExpressLaneAuction
|
|
376
|
+
function getBidHash(
|
|
377
|
+
uint64 round,
|
|
378
|
+
address expressLaneController,
|
|
379
|
+
uint256 amount
|
|
380
|
+
) public view returns (bytes32) {
|
|
381
|
+
return
|
|
382
|
+
_hashTypedDataV4(
|
|
383
|
+
keccak256(abi.encode(BID_DOMAIN, round, expressLaneController, amount))
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/// @notice Recover the signing address of the provided bid, and check that that address has enough funds to fulfil that bid
|
|
388
|
+
/// Returns the signing address and the bid hash that was signed
|
|
389
|
+
/// @param bid The bid to recover the signing address of
|
|
390
|
+
/// @param biddingForRound The round the bid is for the control of
|
|
391
|
+
function recoverAndCheckBalance(Bid memory bid, uint64 biddingForRound)
|
|
392
|
+
internal
|
|
393
|
+
view
|
|
394
|
+
returns (address, bytes32)
|
|
395
|
+
{
|
|
396
|
+
bytes32 bidHash = getBidHash(biddingForRound, bid.expressLaneController, bid.amount);
|
|
397
|
+
address bidder = bidHash.recover(bid.signature);
|
|
398
|
+
// we are always bidding for in the current round for the next round
|
|
399
|
+
uint64 curRnd = biddingForRound - 1;
|
|
400
|
+
// always check that the bidder has as much as they're claiming
|
|
401
|
+
if (_balanceOf[bidder].balanceAtRound(curRnd) < bid.amount) {
|
|
402
|
+
revert InsufficientBalanceAcc(
|
|
403
|
+
bidder,
|
|
404
|
+
bid.amount,
|
|
405
|
+
_balanceOf[bidder].balanceAtRound(curRnd)
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return (bidder, bidHash);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/// @inheritdoc IExpressLaneAuction
|
|
413
|
+
function resolveSingleBidAuction(Bid calldata firstPriceBid)
|
|
414
|
+
external
|
|
415
|
+
onlyRole(AUCTIONEER_ROLE)
|
|
416
|
+
{
|
|
417
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
|
418
|
+
if (!info.isAuctionRoundClosed()) {
|
|
419
|
+
revert AuctionNotClosed();
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (firstPriceBid.amount < reservePrice) {
|
|
423
|
+
revert ReservePriceNotMet(firstPriceBid.amount, reservePrice);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
uint64 biddingInRound = info.currentRound();
|
|
427
|
+
uint64 biddingForRound = biddingInRound + 1;
|
|
428
|
+
(address firstPriceBidder, ) = recoverAndCheckBalance(firstPriceBid, biddingForRound);
|
|
429
|
+
|
|
430
|
+
(uint64 roundStart, uint64 roundEnd) = info.roundTimestamps(biddingForRound);
|
|
431
|
+
resolveAuction(
|
|
432
|
+
false,
|
|
433
|
+
firstPriceBid,
|
|
434
|
+
firstPriceBidder,
|
|
435
|
+
reservePrice,
|
|
436
|
+
biddingInRound,
|
|
437
|
+
roundStart,
|
|
438
|
+
roundEnd
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/// @inheritdoc IExpressLaneAuction
|
|
443
|
+
function resolveMultiBidAuction(Bid calldata firstPriceBid, Bid calldata secondPriceBid)
|
|
444
|
+
external
|
|
445
|
+
onlyRole(AUCTIONEER_ROLE)
|
|
446
|
+
{
|
|
447
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
|
448
|
+
if (!info.isAuctionRoundClosed()) {
|
|
449
|
+
revert AuctionNotClosed();
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
if (firstPriceBid.amount < secondPriceBid.amount) {
|
|
453
|
+
revert BidsWrongOrder();
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// second amount must be greater than or equal the reserve
|
|
457
|
+
if (secondPriceBid.amount < reservePrice) {
|
|
458
|
+
revert ReservePriceNotMet(secondPriceBid.amount, reservePrice);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
uint64 biddingInRound = info.currentRound();
|
|
462
|
+
uint64 biddingForRound = biddingInRound + 1;
|
|
463
|
+
// check the signatures and balances of both bids
|
|
464
|
+
// even the second price bid must have the balance it's claiming
|
|
465
|
+
(address firstPriceBidder, bytes32 firstBidHash) = recoverAndCheckBalance(
|
|
466
|
+
firstPriceBid,
|
|
467
|
+
biddingForRound
|
|
468
|
+
);
|
|
469
|
+
(address secondPriceBidder, bytes32 secondBidHash) = recoverAndCheckBalance(
|
|
470
|
+
secondPriceBid,
|
|
471
|
+
biddingForRound
|
|
472
|
+
);
|
|
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(Transferor calldata transferor) external {
|
|
505
|
+
// if a transferor has already been set, it may be fixed until a future round
|
|
506
|
+
Transferor storage currentTransferor = transferorOf[msg.sender];
|
|
507
|
+
if (
|
|
508
|
+
currentTransferor.addr != address(0) &&
|
|
509
|
+
currentTransferor.fixedUntilRound > roundTimingInfo.currentRound()
|
|
510
|
+
) {
|
|
511
|
+
revert FixedTransferor(currentTransferor.fixedUntilRound);
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
transferorOf[msg.sender] = transferor;
|
|
515
|
+
|
|
516
|
+
emit SetTransferor(msg.sender, transferor.addr, transferor.fixedUntilRound);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/// @inheritdoc IExpressLaneAuction
|
|
520
|
+
function transferExpressLaneController(uint64 round, address newExpressLaneController)
|
|
521
|
+
external
|
|
522
|
+
{
|
|
523
|
+
// past rounds cannot be transferred
|
|
524
|
+
RoundTimingInfo memory info = roundTimingInfo;
|
|
525
|
+
uint64 curRnd = info.currentRound();
|
|
526
|
+
if (round < curRnd) {
|
|
527
|
+
revert RoundTooOld(round, curRnd);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
// only resolved rounds can be transferred
|
|
531
|
+
ELCRound storage resolvedRound = latestResolvedRounds.resolvedRound(round);
|
|
532
|
+
|
|
533
|
+
address resolvedELC = resolvedRound.expressLaneController;
|
|
534
|
+
address transferor = transferorOf[resolvedELC].addr;
|
|
535
|
+
// can only be the transferor if one has been set
|
|
536
|
+
// otherwise we default to the express lane controller to do the transfer
|
|
537
|
+
if (transferor != address(0)) {
|
|
538
|
+
if (transferor != msg.sender) {
|
|
539
|
+
revert NotTransferor(round, transferor, msg.sender);
|
|
540
|
+
}
|
|
541
|
+
} else if (resolvedELC != msg.sender) {
|
|
542
|
+
revert NotExpressLaneController(round, resolvedELC, msg.sender);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
resolvedRound.expressLaneController = newExpressLaneController;
|
|
546
|
+
|
|
547
|
+
(uint64 start, uint64 end) = info.roundTimestamps(round);
|
|
548
|
+
emit SetExpressLaneController(
|
|
549
|
+
round,
|
|
550
|
+
resolvedELC,
|
|
551
|
+
newExpressLaneController,
|
|
552
|
+
transferor != address(0) ? transferor : resolvedELC,
|
|
553
|
+
start < uint64(block.timestamp) ? uint64(block.timestamp) : start,
|
|
554
|
+
end
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/// @inheritdoc IExpressLaneAuction
|
|
559
|
+
function resolvedRounds() external view returns (ELCRound memory, ELCRound memory) {
|
|
560
|
+
return
|
|
561
|
+
latestResolvedRounds[0].round > latestResolvedRounds[1].round
|
|
562
|
+
? (latestResolvedRounds[0], latestResolvedRounds[1])
|
|
563
|
+
: (latestResolvedRounds[1], latestResolvedRounds[0]);
|
|
564
|
+
}
|
|
565
|
+
}
|