@arbitrum/nitro-contracts 2.0.0 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/ERC1967Proxy.sol/ERC1967Proxy.json +2 -2
- 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/beacon/UpgradeableBeacon.sol/UpgradeableBeacon.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +2 -2
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +2 -2
- 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/ERC20.sol/ERC20.json +2 -2
- 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 +4 -0
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.json +86 -0
- package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol/SafeERC20.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Address.sol/Address.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Create2.sol/Create2.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts/utils/Create2.sol/Create2.json +10 -0
- package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/StorageSlot.sol/StorageSlot.json +2 -2
- package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol/AccessControlUpgradeable.json +13 -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/access/OwnableUpgradeable.sol/OwnableUpgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol/Initializable.json +15 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol/PausableUpgradeable.json +13 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol/AddressUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol/ContextUpgradeable.json +15 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/Create2Upgradeable.sol/Create2Upgradeable.dbg.json +4 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/Create2Upgradeable.sol/Create2Upgradeable.json +10 -0
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StorageSlotUpgradeable.sol/StorageSlotUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol/StringsUpgradeable.json +2 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol/ERC165Upgradeable.json +13 -0
- 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/assertionStakingPool/AbsBoldStakingPool.sol/AbsBoldStakingPool.dbg.json +4 -0
- package/build/contracts/{@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.json → src/assertionStakingPool/AbsBoldStakingPool.sol/AbsBoldStakingPool.json} +41 -95
- package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/AssertionStakingPool.sol/AssertionStakingPool.json +340 -0
- package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/AssertionStakingPoolCreator.sol/AssertionStakingPoolCreator.json +89 -0
- package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/EdgeStakingPool.sol/EdgeStakingPool.json +248 -0
- package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/EdgeStakingPoolCreator.sol/EdgeStakingPoolCreator.json +83 -0
- package/build/contracts/src/assertionStakingPool/StakingPoolCreatorUtils.sol/StakingPoolCreatorUtils.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/StakingPoolCreatorUtils.sol/StakingPoolCreatorUtils.json +16 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol/IAbsBoldStakingPool.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol/IAbsBoldStakingPool.json +140 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol/IAssertionStakingPool.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol/IAssertionStakingPool.json +324 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol/IAssertionStakingPoolCreator.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol/IAssertionStakingPoolCreator.json +84 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol/IEdgeStakingPool.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol/IEdgeStakingPool.json +232 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol/IEdgeStakingPoolCreator.dbg.json +4 -0
- package/build/contracts/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol/IEdgeStakingPoolCreator.json +78 -0
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.json +13 -0
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.json +20 -7
- 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 +15 -2
- package/build/contracts/src/bridge/DelayBuffer.sol/DelayBuffer.dbg.json +4 -0
- package/build/contracts/src/bridge/DelayBuffer.sol/DelayBuffer.json +24 -0
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +15 -2
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +22 -9
- package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Outbox.sol/ERC20Outbox.json +2 -2
- package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.dbg.json +1 -1
- package/build/contracts/src/bridge/GasRefunder.sol/GasRefunder.json +2 -2
- 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/IERC20Inbox.sol/IERC20Inbox.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/IInbox.sol/IInbox.json +1 -1
- package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.dbg.json +1 -1
- package/build/contracts/src/bridge/IInboxBase.sol/IInboxBase.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/ISequencerInbox.sol/ISequencerInbox.json +441 -0
- package/build/contracts/src/bridge/Inbox.sol/Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Inbox.sol/Inbox.json +22 -4
- package/build/contracts/src/bridge/Messages.sol/Messages.dbg.json +1 -1
- package/build/contracts/src/bridge/Messages.sol/Messages.json +2 -2
- package/build/contracts/src/bridge/Outbox.sol/Outbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Outbox.sol/Outbox.json +2 -2
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json +564 -7
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +1 -1
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.json +15 -2
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.dbg.json +4 -0
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/EdgeChallengeManager.json +1631 -0
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/IEdgeChallengeManager.dbg.json +4 -0
- package/build/contracts/src/challengeV2/EdgeChallengeManager.sol/IEdgeChallengeManager.json +762 -0
- package/build/contracts/src/challengeV2/IAssertionChain.sol/IAssertionChain.dbg.json +4 -0
- package/build/contracts/src/challengeV2/IAssertionChain.sol/IAssertionChain.json +247 -0
- package/build/contracts/src/challengeV2/libraries/ArrayUtilsLib.sol/ArrayUtilsLib.dbg.json +4 -0
- package/build/contracts/src/challengeV2/libraries/ArrayUtilsLib.sol/ArrayUtilsLib.json +10 -0
- package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.dbg.json +4 -0
- package/build/contracts/src/challengeV2/libraries/ChallengeEdgeLib.sol/ChallengeEdgeLib.json +10 -0
- package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.dbg.json +4 -0
- package/build/contracts/src/challengeV2/libraries/EdgeChallengeManagerLib.sol/EdgeChallengeManagerLib.json +24 -0
- package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.dbg.json +4 -0
- package/build/contracts/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol/MerkleTreeAccumulatorLib.json +24 -0
- package/build/contracts/src/challengeV2/libraries/UintUtilsLib.sol/UintUtilsLib.dbg.json +4 -0
- package/build/contracts/src/challengeV2/libraries/UintUtilsLib.sol/UintUtilsLib.json +10 -0
- package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.dbg.json +1 -1
- package/build/contracts/src/libraries/AddressAliasHelper.sol/AddressAliasHelper.json +2 -2
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.dbg.json +1 -1
- package/build/contracts/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.json +2 -2
- 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/CryptographyPrimitives.sol/CryptographyPrimitives.json +2 -2
- package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.dbg.json +1 -1
- package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.json +2 -2
- 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/MerkleLib.sol/MerkleLib.json +2 -2
- 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/Benchmarks.sol/Benchmarks.json +2 -2
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +8 -8
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +28 -2
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/InboxStub.sol/InboxStub.json +2 -2
- package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.dbg.json +4 -0
- package/build/contracts/src/mocks/MerkleTreeAccess.sol/MerkleTreeAccess.json +227 -0
- package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.dbg.json +4 -0
- package/build/contracts/src/mocks/MockRollupEventInbox.sol/MockRollupEventInbox.json +133 -0
- package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.dbg.json +1 -1
- package/build/contracts/src/mocks/MultiCallTest.sol/MultiCallTest.json +2 -2
- 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/ProxyAdminForBinding.sol/ProxyAdminForBinding.json +2 -2
- package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.dbg.json +1 -1
- package/build/contracts/src/mocks/SdkStorage.sol/SdkStorage.json +2 -2
- package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.dbg.json +4 -0
- package/build/contracts/src/mocks/SequencerInboxBlobMock.sol/SequencerInboxBlobMock.json +1632 -0
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +564 -7
- 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/SimpleCacheManager.sol/SimpleCacheManager.json +2 -2
- package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.dbg.json +4 -0
- package/build/contracts/src/mocks/SimpleOneStepProofEntry.sol/SimpleOneStepProofEntry.json +142 -0
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleProxy.sol/SimpleProxy.json +2 -2
- package/build/contracts/src/mocks/TestWETH9.sol/IWETH9.dbg.json +4 -0
- package/build/contracts/src/mocks/TestWETH9.sol/IWETH9.json +31 -0
- package/build/contracts/src/mocks/TestWETH9.sol/TestWETH9.dbg.json +4 -0
- package/build/contracts/src/mocks/TestWETH9.sol/TestWETH9.json +317 -0
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.json +15 -2
- 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/HashProofHelper.sol/HashProofHelper.json +2 -2
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.json +33 -9
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.json +2 -2
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.json +5 -0
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.json +35 -11
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.json +7 -2
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.json +7 -2
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.json +7 -2
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.json +7 -2
- 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 +4 -0
- package/build/contracts/src/rollup/{Node.sol/NodeLib.json → Assertion.sol/AssertionNodeLib.json} +4 -4
- package/build/contracts/src/rollup/AssertionState.sol/AssertionStateLib.dbg.json +4 -0
- package/build/contracts/src/{challenge/ChallengeLib.sol/ChallengeLib.json → rollup/AssertionState.sol/AssertionStateLib.json} +4 -4
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/BOLDUpgradeAction.json +807 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ConstantArrayStorage.json +35 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollup.json +361 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollupAdmin.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/IOldRollupAdmin.json +38 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ISeqInboxPostUpgradeInit.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/ISeqInboxPostUpgradeInit.json +41 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/RollupReader.json +385 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.dbg.json +4 -0
- package/build/contracts/src/rollup/BOLDUpgradeAction.sol/StateHashPreImageLookup.json +203 -0
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/BridgeCreator.sol/BridgeCreator.json +62 -10
- package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.dbg.json +1 -1
- package/build/contracts/src/rollup/DeployHelper.sol/DeployHelper.json +2 -2
- 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/FactoryDeployerHelper.json +2 -2
- 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 +473 -99
- package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupCore.sol/IRollupCore.json +315 -221
- 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/IRollupUser.json +678 -494
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json +806 -435
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.json +323 -235
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCreator.sol/RollupCreator.json +98 -36
- 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/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 +97 -16
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +924 -530
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +15 -43
- package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWalletCreator.sol/ValidatorWalletCreator.json +2 -2
- package/build/contracts/src/state/Deserialize.sol/Deserialize.dbg.json +1 -1
- package/build/contracts/src/state/Deserialize.sol/Deserialize.json +2 -2
- package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.dbg.json +1 -1
- package/build/contracts/src/state/GlobalState.sol/GlobalStateLib.json +2 -2
- package/build/contracts/src/state/Instructions.sol/Instructions.dbg.json +1 -1
- package/build/contracts/src/state/Instructions.sol/Instructions.json +2 -2
- package/build/contracts/src/state/Machine.sol/MachineLib.dbg.json +1 -1
- package/build/contracts/src/state/Machine.sol/MachineLib.json +2 -2
- package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.dbg.json +1 -1
- package/build/contracts/src/state/MerkleProof.sol/MerkleProofLib.json +2 -2
- package/build/contracts/src/state/Module.sol/ModuleLib.dbg.json +1 -1
- package/build/contracts/src/state/Module.sol/ModuleLib.json +2 -2
- package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.dbg.json +1 -1
- package/build/contracts/src/state/ModuleMemory.sol/ModuleMemoryLib.json +2 -2
- package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.dbg.json +1 -1
- package/build/contracts/src/state/ModuleMemoryCompact.sol/ModuleMemoryCompactLib.json +2 -2
- package/build/contracts/src/state/MultiStack.sol/MultiStackLib.dbg.json +1 -1
- package/build/contracts/src/state/MultiStack.sol/MultiStackLib.json +2 -2
- package/build/contracts/src/state/PcArray.sol/PcArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/PcArray.sol/PcArrayLib.json +2 -2
- package/build/contracts/src/state/StackFrame.sol/StackFrameLib.dbg.json +1 -1
- package/build/contracts/src/state/StackFrame.sol/StackFrameLib.json +2 -2
- package/build/contracts/src/state/Value.sol/ValueLib.dbg.json +1 -1
- package/build/contracts/src/state/Value.sol/ValueLib.json +2 -2
- package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueArray.sol/ValueArrayLib.json +2 -2
- package/build/contracts/src/state/ValueStack.sol/ValueStackLib.dbg.json +1 -1
- package/build/contracts/src/state/ValueStack.sol/ValueStackLib.json +2 -2
- package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/BridgeTester.sol/BridgeTester.json +15 -2
- package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/CryptographyPrimitivesTester.sol/CryptographyPrimitivesTester.json +2 -2
- package/build/contracts/src/test-helpers/EthVault.sol/EthVault.dbg.json +1 -1
- package/build/contracts/src/test-helpers/EthVault.sol/EthVault.json +2 -2
- package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/MessageTester.sol/MessageTester.json +2 -2
- package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json +2 -2
- package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.dbg.json +1 -1
- package/build/contracts/src/test-helpers/RollupMock.sol/RollupMock.json +2 -15
- package/build/contracts/src/test-helpers/TestToken.sol/TestToken.dbg.json +1 -1
- package/build/contracts/src/test-helpers/TestToken.sol/TestToken.json +2 -2
- package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.dbg.json +1 -1
- package/build/contracts/src/test-helpers/ValueArrayTester.sol/ValueArrayTester.json +2 -2
- package/out/yul/Reader4844.yul/Reader4844.json +1 -1
- package/package.json +16 -6
- package/src/assertionStakingPool/AbsBoldStakingPool.sol +66 -0
- package/src/assertionStakingPool/AssertionStakingPool.sol +70 -0
- package/src/assertionStakingPool/AssertionStakingPoolCreator.sol +35 -0
- package/src/assertionStakingPool/EdgeStakingPool.sol +57 -0
- package/src/assertionStakingPool/EdgeStakingPoolCreator.sol +34 -0
- package/src/assertionStakingPool/StakingPoolCreatorUtils.sol +25 -0
- package/src/assertionStakingPool/interfaces/IAbsBoldStakingPool.sol +41 -0
- package/src/assertionStakingPool/interfaces/IAssertionStakingPool.sol +36 -0
- package/src/assertionStakingPool/interfaces/IAssertionStakingPoolCreator.sol +31 -0
- package/src/assertionStakingPool/interfaces/IEdgeStakingPool.sol +27 -0
- package/src/assertionStakingPool/interfaces/IEdgeStakingPoolCreator.sol +28 -0
- package/src/bridge/AbsBridge.sol +38 -48
- package/src/bridge/AbsInbox.sol +88 -97
- package/src/bridge/AbsOutbox.sol +23 -37
- package/src/bridge/Bridge.sol +6 -4
- package/src/bridge/DelayBuffer.sol +123 -0
- package/src/bridge/DelayBufferTypes.sol +38 -0
- package/src/bridge/ERC20Bridge.sol +8 -4
- package/src/bridge/ERC20Inbox.sol +46 -53
- package/src/bridge/ERC20Outbox.sol +7 -3
- package/src/bridge/GasRefunder.sol +38 -24
- package/src/bridge/IBridge.sol +30 -21
- package/src/bridge/IERC20Bridge.sol +1 -1
- package/src/bridge/IERC20Inbox.sol +4 -2
- package/src/bridge/IEthBridge.sol +4 -2
- package/src/bridge/IInbox.sol +4 -2
- package/src/bridge/IInboxBase.sol +17 -13
- package/src/bridge/IOutbox.sol +13 -8
- package/src/bridge/ISequencerInbox.sol +118 -13
- package/src/bridge/Inbox.sol +131 -151
- package/src/bridge/Messages.sol +48 -18
- package/src/bridge/Outbox.sol +6 -2
- package/src/bridge/SequencerInbox.sol +339 -274
- package/src/chain/CacheManager.sol +49 -18
- package/src/challengeV2/EdgeChallengeManager.sol +783 -0
- package/src/challengeV2/IAssertionChain.sol +39 -0
- package/src/challengeV2/libraries/ArrayUtilsLib.sol +61 -0
- package/src/challengeV2/libraries/ChallengeEdgeLib.sol +333 -0
- package/src/challengeV2/libraries/ChallengeErrors.sol +108 -0
- package/src/challengeV2/libraries/EdgeChallengeManagerLib.sol +930 -0
- package/src/challengeV2/libraries/Enums.sol +26 -0
- package/src/challengeV2/libraries/MerkleTreeAccumulatorLib.sol +390 -0
- package/src/challengeV2/libraries/UintUtilsLib.sol +74 -0
- package/src/libraries/AddressAliasHelper.sol +6 -2
- package/src/libraries/AdminFallbackProxy.sol +8 -4
- package/src/libraries/ArbitrumChecker.sol +3 -4
- package/src/libraries/CryptographyPrimitives.sol +39 -46
- package/src/libraries/DecimalsConverterHelper.sol +2 -4
- package/src/libraries/DoubleLogicUUPSUpgradeable.sol +10 -7
- package/src/libraries/Error.sol +18 -12
- package/src/libraries/GasRefundEnabled.sol +3 -4
- package/src/libraries/MerkleLib.sol +6 -5
- package/src/libraries/UUPSNotUpgradeable.sol +2 -4
- package/src/mocks/BridgeStub.sol +50 -48
- package/src/mocks/BridgeUnproxied.sol +2 -0
- package/src/mocks/InboxStub.sol +22 -17
- package/src/mocks/MerkleTreeAccess.sol +72 -0
- package/src/mocks/MockRollupEventInbox.sol +59 -0
- package/src/mocks/MultiCallTest.sol +3 -1
- package/src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol +3 -1
- package/src/mocks/Program.sol +9 -7
- package/src/mocks/SequencerInboxBlobMock.sol +38 -0
- package/src/mocks/SequencerInboxStub.sol +9 -12
- package/src/mocks/Simple.sol +13 -25
- package/src/mocks/SimpleCacheManager.sol +10 -3
- package/src/mocks/SimpleOneStepProofEntry.sol +60 -0
- package/src/mocks/SimpleProxy.sol +3 -1
- package/src/mocks/TestWETH9.sol +30 -0
- package/src/mocks/UpgradeExecutorMock.sol +10 -17
- package/src/node-interface/NodeInterface.sol +23 -22
- package/src/node-interface/NodeInterfaceDebug.sol +5 -3
- package/src/osp/HashProofHelper.sol +9 -10
- package/src/osp/IOneStepProofEntry.sol +14 -9
- package/src/osp/IOneStepProver.sol +1 -0
- package/src/osp/OneStepProofEntry.sol +63 -54
- package/src/osp/OneStepProver0.sol +14 -27
- package/src/osp/OneStepProverHostIo.sol +31 -58
- package/src/osp/OneStepProverMath.sol +15 -23
- package/src/osp/OneStepProverMemory.sol +9 -23
- package/src/precompiles/ArbAddressTable.sol +19 -9
- package/src/precompiles/ArbAggregator.sol +12 -4
- package/src/precompiles/ArbBLS.sol +1 -3
- package/src/precompiles/ArbDebug.sol +5 -11
- package/src/precompiles/ArbFunctionTable.sol +7 -10
- package/src/precompiles/ArbGasInfo.sol +9 -43
- package/src/precompiles/ArbInfo.sol +6 -2
- package/src/precompiles/ArbOwner.sol +101 -34
- package/src/precompiles/ArbOwnerPublic.sol +6 -2
- package/src/precompiles/ArbRetryableTx.sol +15 -5
- package/src/precompiles/ArbStatistics.sol +1 -8
- package/src/precompiles/ArbSys.sol +16 -18
- package/src/precompiles/ArbWasm.sol +24 -14
- package/src/precompiles/ArbWasmCache.sol +15 -5
- package/src/precompiles/ArbosTest.sol +3 -1
- package/src/rollup/AbsRollupEventInbox.sol +15 -16
- package/src/rollup/Assertion.sol +100 -0
- package/src/rollup/AssertionState.sol +29 -0
- package/src/rollup/BOLDUpgradeAction.sol +631 -0
- package/src/rollup/BridgeCreator.sol +42 -15
- package/src/rollup/Config.sol +15 -7
- package/src/rollup/DeployHelper.sol +12 -31
- package/src/rollup/ERC20RollupEventInbox.sol +8 -9
- package/src/rollup/FactoryDeployerHelper.sol +8 -10
- package/src/rollup/IRollupAdmin.sol +127 -45
- package/src/rollup/IRollupCore.sol +64 -84
- package/src/rollup/IRollupEventInbox.sol +3 -1
- package/src/rollup/IRollupLogic.sol +36 -69
- package/src/rollup/RollupAdminLogic.sol +224 -203
- package/src/rollup/RollupCore.sol +407 -428
- package/src/rollup/RollupCreator.sol +88 -75
- package/src/rollup/RollupEventInbox.sol +7 -7
- package/src/rollup/RollupLib.sol +50 -86
- package/src/rollup/RollupProxy.sol +8 -12
- package/src/rollup/RollupUserLogic.sol +279 -642
- package/src/rollup/ValidatorUtils.sol +0 -242
- package/src/rollup/ValidatorWallet.sol +22 -38
- package/src/rollup/ValidatorWalletCreator.sol +8 -8
- package/src/state/Deserialize.sol +74 -96
- package/src/state/GlobalState.sol +74 -20
- package/src/state/Instructions.sol +4 -3
- package/src/state/Machine.sol +18 -19
- package/src/state/Module.sol +14 -13
- package/src/state/ModuleMemory.sol +6 -25
- package/src/state/ModuleMemoryCompact.sol +3 -1
- package/src/state/MultiStack.sol +16 -20
- package/src/state/PcArray.sol +7 -7
- package/src/state/StackFrame.sol +21 -14
- package/src/state/Value.sol +18 -6
- package/src/state/ValueArray.sol +7 -7
- package/src/state/ValueStack.sol +9 -3
- package/src/test-helpers/BridgeTester.sol +32 -42
- package/src/test-helpers/CryptographyPrimitivesTester.sol +12 -13
- package/src/test-helpers/EthVault.sol +4 -2
- package/src/test-helpers/InterfaceCompatibilityTester.sol +1 -1
- package/src/test-helpers/MessageTester.sol +3 -10
- package/src/test-helpers/OutboxWithoutOptTester.sol +12 -19
- package/src/test-helpers/RollupMock.sol +3 -7
- package/src/test-helpers/TestToken.sol +4 -2
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +0 -4
- package/build/contracts/src/challenge/ChallengeLib.sol/ChallengeLib.dbg.json +0 -4
- package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.dbg.json +0 -4
- package/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json +0 -746
- package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.dbg.json +0 -4
- package/build/contracts/src/challenge/IChallengeManager.sol/IChallengeManager.json +0 -441
- package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.dbg.json +0 -4
- package/build/contracts/src/challenge/IChallengeResultReceiver.sol/IChallengeResultReceiver.json +0 -34
- package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.dbg.json +0 -4
- package/build/contracts/src/mocks/MockResultReceiver.sol/MockResultReceiver.json +0 -188
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +0 -4
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +0 -797
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +0 -4
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +0 -746
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +0 -4
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.json +0 -1327
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +0 -4
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.json +0 -1461
- package/build/contracts/src/rollup/Node.sol/NodeLib.dbg.json +0 -4
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +0 -4
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.json +0 -1609
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +0 -4
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +0 -1743
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +0 -4
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +0 -379
- package/src/challenge/ChallengeLib.sol +0 -88
- package/src/challenge/ChallengeManager.sol +0 -375
- package/src/challenge/IChallengeManager.sol +0 -86
- package/src/challenge/IChallengeResultReceiver.sol +0 -13
- package/src/mocks/MockResultReceiver.sol +0 -59
- package/src/mocks/SingleExecutionChallenge.sol +0 -41
- package/src/mocks/TimedOutChallengeManager.sol +0 -13
- package/src/rollup/Node.sol +0 -113
|
@@ -4,32 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
pragma solidity ^0.8.0;
|
|
6
6
|
|
|
7
|
-
import "@openzeppelin/contracts
|
|
7
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
8
8
|
|
|
9
9
|
import {IRollupUser} from "./IRollupLogic.sol";
|
|
10
10
|
import "../libraries/UUPSNotUpgradeable.sol";
|
|
11
11
|
import "./RollupCore.sol";
|
|
12
12
|
import "./IRollupLogic.sol";
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
abstract contract AbsRollupUserLogic is
|
|
17
|
-
RollupCore,
|
|
18
|
-
UUPSNotUpgradeable,
|
|
19
|
-
IRollupUserAbs,
|
|
20
|
-
IChallengeResultReceiver
|
|
21
|
-
{
|
|
22
|
-
using NodeLib for Node;
|
|
14
|
+
contract RollupUserLogic is RollupCore, UUPSNotUpgradeable, IRollupUser {
|
|
15
|
+
using AssertionNodeLib for AssertionNode;
|
|
23
16
|
using GlobalStateLib for GlobalState;
|
|
17
|
+
using SafeERC20 for IERC20;
|
|
18
|
+
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
|
|
24
19
|
|
|
25
|
-
modifier onlyValidator(
|
|
26
|
-
|
|
20
|
+
modifier onlyValidator(
|
|
21
|
+
address account
|
|
22
|
+
) {
|
|
23
|
+
require(validators.contains(account) || validatorWhitelistDisabled, "NOT_VALIDATOR");
|
|
27
24
|
_;
|
|
28
25
|
}
|
|
29
26
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
/// @dev the user logic just validated configuration and shouldn't write to state during init
|
|
28
|
+
/// this allows the admin logic to ensure consistency on parameters.
|
|
29
|
+
function initialize(
|
|
30
|
+
address _stakeToken
|
|
31
|
+
) external view override onlyProxy {
|
|
32
|
+
require(_stakeToken != address(0), "NEED_STAKE_TOKEN");
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
uint256 internal immutable deployTimeChainId = block.chainid;
|
|
@@ -38,19 +38,17 @@ abstract contract AbsRollupUserLogic is
|
|
|
38
38
|
return deployTimeChainId != block.chainid;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
/**
|
|
42
|
-
* @notice Extra number of blocks the validator can remain inactive before considered inactive
|
|
43
|
-
* This is 7 days assuming a 13.2 seconds block time
|
|
44
|
-
*/
|
|
45
|
-
uint256 public constant VALIDATOR_AFK_BLOCKS = 45818;
|
|
46
|
-
|
|
47
41
|
function _validatorIsAfk() internal view returns (bool) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
|
|
42
|
+
AssertionNode memory latestConfirmedAssertion = getAssertionStorage(latestConfirmed());
|
|
43
|
+
uint256 _validatorAfkBlocks = validatorAfkBlocks; // cache and cast to uint256 to prevent overflow
|
|
44
|
+
if (_validatorAfkBlocks == 0) return false;
|
|
45
|
+
if (latestConfirmedAssertion.createdAtBlock == 0) return false;
|
|
46
|
+
// We consider the validator is gone if the last known assertion is older than VALIDATOR_AFK_BLOCKS
|
|
47
|
+
// Which is either the latest confirmed assertion or the first child of the latest confirmed assertion
|
|
48
|
+
if (latestConfirmedAssertion.firstChildBlock > 0) {
|
|
49
|
+
return latestConfirmedAssertion.firstChildBlock + _validatorAfkBlocks < block.number;
|
|
52
50
|
}
|
|
53
|
-
return
|
|
51
|
+
return latestConfirmedAssertion.createdAtBlock + _validatorAfkBlocks < block.number;
|
|
54
52
|
}
|
|
55
53
|
|
|
56
54
|
function removeWhitelistAfterFork() external {
|
|
@@ -59,709 +57,354 @@ abstract contract AbsRollupUserLogic is
|
|
|
59
57
|
validatorWhitelistDisabled = true;
|
|
60
58
|
}
|
|
61
59
|
|
|
60
|
+
/**
|
|
61
|
+
* @notice Remove the whitelist after the validator has been inactive for too long
|
|
62
|
+
*/
|
|
62
63
|
function removeWhitelistAfterValidatorAfk() external {
|
|
63
64
|
require(!validatorWhitelistDisabled, "WHITELIST_DISABLED");
|
|
64
65
|
require(_validatorIsAfk(), "VALIDATOR_NOT_AFK");
|
|
65
66
|
validatorWhitelistDisabled = true;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
function isERC20Enabled() public view override returns (bool) {
|
|
69
|
-
return stakeToken != address(0);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
69
|
/**
|
|
73
|
-
* @notice
|
|
74
|
-
* @param
|
|
70
|
+
* @notice Confirm a unresolved assertion
|
|
71
|
+
* @param confirmState The state to confirm
|
|
72
|
+
* @param winningEdgeId The winning edge if a challenge is started
|
|
75
73
|
*/
|
|
76
|
-
function
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
74
|
+
function confirmAssertion(
|
|
75
|
+
bytes32 assertionHash,
|
|
76
|
+
bytes32 prevAssertionHash,
|
|
77
|
+
AssertionState calldata confirmState,
|
|
78
|
+
bytes32 winningEdgeId,
|
|
79
|
+
ConfigData calldata prevConfig,
|
|
80
|
+
bytes32 inboxAcc
|
|
81
|
+
) external onlyValidator(msg.sender) whenNotPaused {
|
|
82
|
+
/*
|
|
83
|
+
* To confirm an assertion, the following must be true:
|
|
84
|
+
* 1. The assertion must be pending
|
|
85
|
+
* 2. The assertion's deadline must have passed
|
|
86
|
+
* 3. The assertion's prev must be latest confirmed
|
|
87
|
+
* 4. The assertion's prev's child confirm deadline must have passed
|
|
88
|
+
* 5. If the assertion's prev has more than 1 child, the assertion must be the winner of the challenge
|
|
89
|
+
*
|
|
90
|
+
* Note that we do not need to ever reject invalid assertion because they can never confirm
|
|
91
|
+
* and the stake on them is swept to the loserStakeEscrow as soon as the leaf is created
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
// The assertion's must exists and be pending and will be validated in RollupCore.confirmAssertionInternal
|
|
95
|
+
AssertionNode storage assertion = getAssertionStorage(assertionHash);
|
|
96
|
+
|
|
97
|
+
// prevAssertionHash is user supplied, but will be validated in RollupCore.confirmAssertionInternal
|
|
98
|
+
AssertionNode storage prevAssertion = getAssertionStorage(prevAssertionHash);
|
|
99
|
+
RollupLib.validateConfigHash(prevConfig, prevAssertion.configHash);
|
|
100
|
+
|
|
101
|
+
// Check that deadline has passed
|
|
102
|
+
require(
|
|
103
|
+
block.number >= assertion.createdAtBlock + prevConfig.confirmPeriodBlocks,
|
|
104
|
+
"BEFORE_DEADLINE"
|
|
105
|
+
);
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
// Check that prev is latest confirmed
|
|
108
|
+
require(prevAssertionHash == latestConfirmed(), "PREV_NOT_LATEST_CONFIRMED");
|
|
109
|
+
|
|
110
|
+
if (prevAssertion.secondChildBlock > 0) {
|
|
111
|
+
// if the prev has more than 1 child, check if this assertion is the challenge winner
|
|
112
|
+
ChallengeEdge memory winningEdge =
|
|
113
|
+
IEdgeChallengeManager(prevConfig.challengeManager).getEdge(winningEdgeId);
|
|
114
|
+
require(winningEdge.claimId == assertionHash, "NOT_WINNER");
|
|
115
|
+
require(winningEdge.status == EdgeStatus.Confirmed, "EDGE_NOT_CONFIRMED");
|
|
116
|
+
require(winningEdge.confirmedAtBlock != 0, "ZERO_CONFIRMED_AT_BLOCK");
|
|
117
|
+
// an additional number of blocks is added to ensure that the result of the challenge is widely
|
|
118
|
+
// observable before it causes an assertion to be confirmed. After a winning edge is found, it will
|
|
119
|
+
// always be challengeGracePeriodBlocks before an assertion can be confirmed
|
|
108
120
|
require(
|
|
109
|
-
|
|
110
|
-
"
|
|
121
|
+
block.number >= winningEdge.confirmedAtBlock + challengeGracePeriodBlocks,
|
|
122
|
+
"CHALLENGE_GRACE_PERIOD_NOT_PASSED"
|
|
111
123
|
);
|
|
112
124
|
}
|
|
113
|
-
// Simpler case: if the first unreseolved node doesn't point to the last confirmed node, another branch was confirmed and can simply reject it outright
|
|
114
|
-
_rejectNextNode();
|
|
115
125
|
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function _confirmNextNode(
|
|
120
|
-
bytes32 blockHash,
|
|
121
|
-
bytes32 sendRoot,
|
|
122
|
-
bool isFastConfirm
|
|
123
|
-
) internal {
|
|
124
|
-
requireUnresolvedExists();
|
|
125
|
-
|
|
126
|
-
uint64 nodeNum = firstUnresolvedNode();
|
|
127
|
-
Node storage node = getNodeStorage(nodeNum);
|
|
128
|
-
|
|
129
|
-
if (!isFastConfirm) {
|
|
130
|
-
// Verify the block's deadline has passed
|
|
131
|
-
node.requirePastDeadline();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
// Check that prev is latest confirmed
|
|
135
|
-
assert(node.prevNum == latestConfirmed());
|
|
136
|
-
|
|
137
|
-
Node storage prevNode = getNodeStorage(node.prevNum);
|
|
138
|
-
if (!isFastConfirm) {
|
|
139
|
-
prevNode.requirePastChildConfirmDeadline();
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
removeOldZombies(0);
|
|
143
|
-
|
|
144
|
-
// Require only zombies are staked on siblings to this node, and there's at least one non-zombie staked on this node
|
|
145
|
-
uint256 stakedZombies = countStakedZombies(nodeNum);
|
|
146
|
-
uint256 zombiesStakedOnOtherChildren = countZombiesStakedOnChildren(node.prevNum) -
|
|
147
|
-
stakedZombies;
|
|
148
|
-
require(node.stakerCount > stakedZombies, "NO_STAKERS");
|
|
149
|
-
require(
|
|
150
|
-
prevNode.childStakerCount == node.stakerCount + zombiesStakedOnOtherChildren,
|
|
151
|
-
"NOT_ALL_STAKED"
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
confirmNode(nodeNum, blockHash, sendRoot);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @notice Confirm the next unresolved node
|
|
159
|
-
* @param blockHash The block hash at the end of the assertion
|
|
160
|
-
* @param sendRoot The send root at the end of the assertion
|
|
161
|
-
*/
|
|
162
|
-
function confirmNextNode(bytes32 blockHash, bytes32 sendRoot)
|
|
163
|
-
external
|
|
164
|
-
onlyValidator
|
|
165
|
-
whenNotPaused
|
|
166
|
-
{
|
|
167
|
-
_confirmNextNode(blockHash, sendRoot, false);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* @notice This allow anyTrustFastConfirmer to confirm next node regardless of deadline
|
|
172
|
-
* the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to
|
|
173
|
-
* a contract that can call this function when received sufficient signatures
|
|
174
|
-
*/
|
|
175
|
-
function fastConfirmNextNode(bytes32 blockHash, bytes32 sendRoot) external whenNotPaused {
|
|
176
|
-
require(msg.sender == anyTrustFastConfirmer, "NOT_FAST_CONFIRMER");
|
|
177
|
-
_confirmNextNode(blockHash, sendRoot, true);
|
|
126
|
+
confirmAssertionInternal(assertionHash, prevAssertionHash, confirmState, inboxAcc);
|
|
178
127
|
}
|
|
179
128
|
|
|
180
129
|
/**
|
|
181
130
|
* @notice Create a new stake
|
|
182
131
|
* @param depositAmount The amount of either eth or tokens staked
|
|
132
|
+
* @param _withdrawalAddress The new staker's withdrawal address
|
|
183
133
|
*/
|
|
184
|
-
function _newStake(
|
|
134
|
+
function _newStake(
|
|
135
|
+
uint256 depositAmount,
|
|
136
|
+
address _withdrawalAddress
|
|
137
|
+
) internal onlyValidator(msg.sender) whenNotPaused {
|
|
185
138
|
// Verify that sender is not already a staker
|
|
186
139
|
require(!isStaked(msg.sender), "ALREADY_STAKED");
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
createNewStake(msg.sender, depositAmount);
|
|
140
|
+
// amount will be checked when creating an assertion
|
|
141
|
+
createNewStake(msg.sender, depositAmount, _withdrawalAddress);
|
|
191
142
|
}
|
|
192
143
|
|
|
193
144
|
/**
|
|
194
|
-
* @notice
|
|
195
|
-
* @param
|
|
196
|
-
* @param
|
|
145
|
+
* @notice Computes the hash of an assertion
|
|
146
|
+
* @param state The execution state for the assertion
|
|
147
|
+
* @param prevAssertionHash The hash of the assertion's parent
|
|
148
|
+
* @param inboxAcc The inbox batch accumulator
|
|
197
149
|
*/
|
|
198
|
-
function
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
require(
|
|
206
|
-
nodeNum >= firstUnresolvedNode() && nodeNum <= latestNodeCreated(),
|
|
207
|
-
"NODE_NUM_OUT_OF_RANGE"
|
|
208
|
-
);
|
|
209
|
-
Node storage node = getNodeStorage(nodeNum);
|
|
210
|
-
require(node.nodeHash == nodeHash, "NODE_REORG");
|
|
211
|
-
require(latestStakedNode(msg.sender) == node.prevNum, "NOT_STAKED_PREV");
|
|
212
|
-
stakeOnNode(msg.sender, nodeNum);
|
|
150
|
+
function computeAssertionHash(
|
|
151
|
+
bytes32 prevAssertionHash,
|
|
152
|
+
AssertionState calldata state,
|
|
153
|
+
bytes32 inboxAcc
|
|
154
|
+
) external pure returns (bytes32) {
|
|
155
|
+
return RollupLib.assertionHash(prevAssertionHash, state, inboxAcc);
|
|
213
156
|
}
|
|
214
157
|
|
|
215
158
|
/**
|
|
216
|
-
* @notice Create a new
|
|
159
|
+
* @notice Create a new assertion and move stake onto it
|
|
217
160
|
* @param assertion The assertion data
|
|
218
|
-
* @param
|
|
219
|
-
*/
|
|
220
|
-
function stakeOnNewNode(
|
|
221
|
-
Assertion calldata assertion,
|
|
222
|
-
bytes32 expectedNodeHash,
|
|
223
|
-
uint256 prevNodeInboxMaxCount
|
|
224
|
-
) public onlyValidator whenNotPaused {
|
|
225
|
-
require(isStakedOnLatestConfirmed(msg.sender), "NOT_STAKED");
|
|
226
|
-
// Ensure staker is staked on the previous node
|
|
227
|
-
uint64 prevNode = latestStakedNode(msg.sender);
|
|
228
|
-
|
|
229
|
-
{
|
|
230
|
-
uint256 timeSinceLastNode = block.number - getNode(prevNode).createdAtBlock;
|
|
231
|
-
// Verify that assertion meets the minimum Delta time requirement
|
|
232
|
-
require(timeSinceLastNode >= minimumAssertionPeriod, "TIME_DELTA");
|
|
233
|
-
|
|
234
|
-
// Minimum size requirement: any assertion must consume at least all inbox messages
|
|
235
|
-
// put into L1 inbox before the prev node’s L1 blocknum.
|
|
236
|
-
// We make an exception if the machine enters the errored state,
|
|
237
|
-
// as it can't consume future batches.
|
|
238
|
-
require(
|
|
239
|
-
assertion.afterState.machineStatus == MachineStatus.ERRORED ||
|
|
240
|
-
assertion.afterState.globalState.getInboxPosition() >= prevNodeInboxMaxCount,
|
|
241
|
-
"TOO_SMALL"
|
|
242
|
-
);
|
|
243
|
-
// Minimum size requirement: any assertion must contain at least one block
|
|
244
|
-
require(assertion.numBlocks > 0, "EMPTY_ASSERTION");
|
|
245
|
-
|
|
246
|
-
// The rollup cannot advance normally from an errored state
|
|
247
|
-
require(
|
|
248
|
-
assertion.beforeState.machineStatus == MachineStatus.FINISHED,
|
|
249
|
-
"BAD_PREV_STATUS"
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
createNewNode(assertion, prevNode, prevNodeInboxMaxCount, expectedNodeHash);
|
|
253
|
-
|
|
254
|
-
stakeOnNode(msg.sender, latestNodeCreated());
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @notice Refund a staker that is currently staked on or before the latest confirmed node
|
|
259
|
-
* @dev Since a staker is initially placed in the latest confirmed node, if they don't move it
|
|
260
|
-
* a griefer can remove their stake. It is recomended to batch together the txs to place a stake
|
|
261
|
-
* and move it to the desired node.
|
|
262
|
-
* @param stakerAddress Address of the staker whose stake is refunded
|
|
263
|
-
*/
|
|
264
|
-
function returnOldDeposit(address stakerAddress)
|
|
265
|
-
external
|
|
266
|
-
override
|
|
267
|
-
onlyValidator
|
|
268
|
-
whenNotPausedOrDeprecated
|
|
269
|
-
{
|
|
270
|
-
require(latestStakedNode(stakerAddress) <= latestConfirmed(), "TOO_RECENT");
|
|
271
|
-
requireUnchallengedStaker(stakerAddress);
|
|
272
|
-
withdrawStaker(stakerAddress);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @notice Increase the amount staked for the given staker
|
|
277
|
-
* @param stakerAddress Address of the staker whose stake is increased
|
|
278
|
-
* @param depositAmount The amount of either eth or tokens deposited
|
|
161
|
+
* @param expectedAssertionHash The hash of the assertion being created (protects against reorgs)
|
|
279
162
|
*/
|
|
280
|
-
function
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
163
|
+
function stakeOnNewAssertion(
|
|
164
|
+
AssertionInputs calldata assertion,
|
|
165
|
+
bytes32 expectedAssertionHash
|
|
166
|
+
) public onlyValidator(msg.sender) whenNotPaused {
|
|
167
|
+
// Early revert on duplicated assertion if expectedAssertionHash is set
|
|
168
|
+
require(
|
|
169
|
+
expectedAssertionHash == bytes32(0)
|
|
170
|
+
|| getAssertionStorage(expectedAssertionHash).status == AssertionStatus.NoAssertion,
|
|
171
|
+
"EXPECTED_ASSERTION_SEEN"
|
|
172
|
+
);
|
|
288
173
|
|
|
289
|
-
|
|
290
|
-
* @notice Reduce the amount staked for the sender (difference between initial amount staked and target is creditted back to the sender).
|
|
291
|
-
* @param target Target amount of stake for the staker. If this is below the current minimum, it will be set to minimum instead
|
|
292
|
-
*/
|
|
293
|
-
function reduceDeposit(uint256 target) external onlyValidator whenNotPausedOrDeprecated {
|
|
294
|
-
requireUnchallengedStaker(msg.sender);
|
|
295
|
-
uint256 currentRequired = currentRequiredStake();
|
|
296
|
-
if (target < currentRequired) {
|
|
297
|
-
target = currentRequired;
|
|
298
|
-
}
|
|
299
|
-
reduceStakeTo(msg.sender, target);
|
|
300
|
-
}
|
|
174
|
+
require(isStaked(msg.sender), "NOT_STAKED");
|
|
301
175
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
* @param globalStates The before and after global state for the first assertion
|
|
308
|
-
* @param numBlocks The number of L2 blocks contained in the first assertion
|
|
309
|
-
* @param secondExecutionHash The execution hash of the second assertion
|
|
310
|
-
* @param proposedBlocks L1 block numbers that the two nodes were proposed at
|
|
311
|
-
* @param wasmModuleRoots The wasm module roots at the time of the creation of each assertion
|
|
312
|
-
*/
|
|
313
|
-
function createChallenge(
|
|
314
|
-
address[2] calldata stakers,
|
|
315
|
-
uint64[2] calldata nodeNums,
|
|
316
|
-
MachineStatus[2] calldata machineStatuses,
|
|
317
|
-
GlobalState[2] calldata globalStates,
|
|
318
|
-
uint64 numBlocks,
|
|
319
|
-
bytes32 secondExecutionHash,
|
|
320
|
-
uint256[2] calldata proposedBlocks,
|
|
321
|
-
bytes32[2] calldata wasmModuleRoots
|
|
322
|
-
) external onlyValidator whenNotPaused {
|
|
323
|
-
require(nodeNums[0] < nodeNums[1], "WRONG_ORDER");
|
|
324
|
-
require(nodeNums[1] <= latestNodeCreated(), "NOT_PROPOSED");
|
|
325
|
-
require(latestConfirmed() < nodeNums[0], "ALREADY_CONFIRMED");
|
|
326
|
-
|
|
327
|
-
Node storage node1 = getNodeStorage(nodeNums[0]);
|
|
328
|
-
Node storage node2 = getNodeStorage(nodeNums[1]);
|
|
329
|
-
|
|
330
|
-
// ensure nodes staked on the same parent (and thus in conflict)
|
|
331
|
-
require(node1.prevNum == node2.prevNum, "DIFF_PREV");
|
|
332
|
-
|
|
333
|
-
// ensure both stakers aren't currently in challenge
|
|
334
|
-
requireUnchallengedStaker(stakers[0]);
|
|
335
|
-
requireUnchallengedStaker(stakers[1]);
|
|
336
|
-
|
|
337
|
-
require(nodeHasStaker(nodeNums[0], stakers[0]), "STAKER1_NOT_STAKED");
|
|
338
|
-
require(nodeHasStaker(nodeNums[1], stakers[1]), "STAKER2_NOT_STAKED");
|
|
339
|
-
|
|
340
|
-
// Check param data against challenge hash
|
|
176
|
+
// requiredStake is user supplied, will be verified against configHash later
|
|
177
|
+
// the prev's requiredStake is used to make sure all children have the same stake
|
|
178
|
+
// the staker may have more than enough stake, and the entire stake will be locked
|
|
179
|
+
// we cannot do a refund here because the staker may be staker on an unconfirmed ancestor that requires more stake
|
|
180
|
+
// excess stake can be removed by calling reduceDeposit when the staker is inactive
|
|
341
181
|
require(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
RollupLib.executionHash(machineStatuses, globalStates, numBlocks),
|
|
345
|
-
proposedBlocks[0],
|
|
346
|
-
wasmModuleRoots[0]
|
|
347
|
-
),
|
|
348
|
-
"CHAL_HASH1"
|
|
182
|
+
amountStaked(msg.sender) >= assertion.beforeStateData.configData.requiredStake,
|
|
183
|
+
"INSUFFICIENT_STAKE"
|
|
349
184
|
);
|
|
350
185
|
|
|
186
|
+
bytes32 prevAssertion = RollupLib.assertionHash(
|
|
187
|
+
assertion.beforeStateData.prevPrevAssertionHash,
|
|
188
|
+
assertion.beforeState,
|
|
189
|
+
assertion.beforeStateData.sequencerBatchAcc
|
|
190
|
+
);
|
|
191
|
+
getAssertionStorage(prevAssertion).requireExists();
|
|
192
|
+
|
|
193
|
+
// Staker can create new assertion only if
|
|
194
|
+
// a) its last staked assertion is the prev; or
|
|
195
|
+
// b) its last staked assertion have a child
|
|
196
|
+
bytes32 lastAssertion = latestStakedAssertion(msg.sender);
|
|
351
197
|
require(
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
secondExecutionHash,
|
|
355
|
-
proposedBlocks[1],
|
|
356
|
-
wasmModuleRoots[1]
|
|
357
|
-
),
|
|
358
|
-
"CHAL_HASH2"
|
|
198
|
+
lastAssertion == prevAssertion || getAssertionStorage(lastAssertion).firstChildBlock > 0,
|
|
199
|
+
"STAKED_ON_ANOTHER_BRANCH"
|
|
359
200
|
);
|
|
360
201
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
//
|
|
368
|
-
|
|
369
|
-
return;
|
|
202
|
+
(bytes32 newAssertionHash, bool overflowAssertion) =
|
|
203
|
+
createNewAssertion(assertion, prevAssertion, expectedAssertionHash);
|
|
204
|
+
_stakerMap[msg.sender].latestStakedAssertion = newAssertionHash;
|
|
205
|
+
|
|
206
|
+
if (!overflowAssertion) {
|
|
207
|
+
uint256 timeSincePrev = block.number - getAssertionStorage(prevAssertion).createdAtBlock;
|
|
208
|
+
// Verify that assertion meets the minimum Delta time requirement
|
|
209
|
+
require(timeSincePrev >= minimumAssertionPeriod, "TIME_DELTA");
|
|
370
210
|
}
|
|
371
|
-
// Start a challenge between staker1 and staker2. Staker1 will defend the correctness of node1, and staker2 will challenge it.
|
|
372
|
-
uint64 challengeIndex = createChallengeHelper(
|
|
373
|
-
stakers,
|
|
374
|
-
machineStatuses,
|
|
375
|
-
globalStates,
|
|
376
|
-
numBlocks,
|
|
377
|
-
wasmModuleRoots,
|
|
378
|
-
// convert from block counts to real second based timestamps
|
|
379
|
-
(commonEndBlock - proposedBlocks[0]) * ETH_POS_BLOCK_TIME,
|
|
380
|
-
(commonEndBlock - proposedBlocks[1]) * ETH_POS_BLOCK_TIME
|
|
381
|
-
); // trusted external call
|
|
382
|
-
|
|
383
|
-
challengeStarted(stakers[0], stakers[1], challengeIndex);
|
|
384
|
-
|
|
385
|
-
emit RollupChallengeStarted(challengeIndex, stakers[0], stakers[1], nodeNums[0]);
|
|
386
|
-
}
|
|
387
211
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
uint256 challengerTimeLeft
|
|
396
|
-
) internal returns (uint64) {
|
|
397
|
-
return
|
|
398
|
-
challengeManager.createChallenge(
|
|
399
|
-
wasmModuleRoots[0],
|
|
400
|
-
machineStatuses,
|
|
401
|
-
globalStates,
|
|
402
|
-
numBlocks,
|
|
403
|
-
stakers[0],
|
|
404
|
-
stakers[1],
|
|
405
|
-
asserterTimeLeft,
|
|
406
|
-
challengerTimeLeft
|
|
212
|
+
if (!getAssertionStorage(newAssertionHash).isFirstChild) {
|
|
213
|
+
// We assume assertion.beforeStateData is valid here as it will be validated in createNewAssertion
|
|
214
|
+
// only 1 of the children can be confirmed and get their stake refunded
|
|
215
|
+
// so we send the other children's stake to the loserStakeEscrow
|
|
216
|
+
// NOTE: if the losing staker have staked more than requiredStake, the excess stake will be stuck
|
|
217
|
+
IERC20(stakeToken).safeTransfer(
|
|
218
|
+
loserStakeEscrow, assertion.beforeStateData.configData.requiredStake
|
|
407
219
|
);
|
|
220
|
+
}
|
|
408
221
|
}
|
|
409
222
|
|
|
410
223
|
/**
|
|
411
|
-
* @notice
|
|
412
|
-
* @param winningStaker Address of the winning staker
|
|
413
|
-
* @param losingStaker Address of the losing staker
|
|
224
|
+
* @notice Refund a staker that is currently staked on an assertion that either has a chlid assertion or is the latest confirmed assertion.
|
|
414
225
|
*/
|
|
415
|
-
function
|
|
416
|
-
|
|
417
|
-
address winningStaker,
|
|
418
|
-
address losingStaker
|
|
419
|
-
) external override whenNotPaused {
|
|
420
|
-
// Only the challenge manager contract can call this to declare the winner and loser
|
|
421
|
-
require(msg.sender == address(challengeManager), "WRONG_SENDER");
|
|
422
|
-
require(challengeIndex == inChallenge(winningStaker, losingStaker), "NOT_IN_CHAL");
|
|
423
|
-
completeChallengeImpl(winningStaker, losingStaker);
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
function completeChallengeImpl(address winningStaker, address losingStaker) private {
|
|
427
|
-
uint256 remainingLoserStake = amountStaked(losingStaker);
|
|
428
|
-
uint256 winnerStake = amountStaked(winningStaker);
|
|
429
|
-
if (remainingLoserStake > winnerStake) {
|
|
430
|
-
// If loser has a higher stake than the winner, refund the difference
|
|
431
|
-
remainingLoserStake -= reduceStakeTo(losingStaker, winnerStake);
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// Reward the winner with half the remaining stake
|
|
435
|
-
uint256 amountWon = remainingLoserStake / 2;
|
|
436
|
-
increaseStakeBy(winningStaker, amountWon);
|
|
437
|
-
remainingLoserStake -= amountWon;
|
|
438
|
-
// We deliberately leave loser in challenge state to prevent them from
|
|
439
|
-
// doing certain thing that are allowed only to parties not in a challenge
|
|
440
|
-
clearChallenge(winningStaker);
|
|
441
|
-
// Credit the other half to the loserStakeEscrow address
|
|
442
|
-
increaseWithdrawableFunds(loserStakeEscrow, remainingLoserStake);
|
|
443
|
-
// Turning loser into zombie renders the loser's remaining stake inaccessible
|
|
444
|
-
turnIntoZombie(losingStaker);
|
|
226
|
+
function returnOldDeposit() external override onlyValidator(msg.sender) whenNotPaused {
|
|
227
|
+
_requireInactiveAndWithdrawStaker(msg.sender);
|
|
445
228
|
}
|
|
446
229
|
|
|
447
230
|
/**
|
|
448
|
-
* @notice
|
|
449
|
-
*
|
|
450
|
-
* @param maxNodes Maximum number of nodes to remove the zombie from (to limit the cost of this transaction)
|
|
231
|
+
* @notice From the staker's withdrawal address,
|
|
232
|
+
* refund a staker that is currently staked on an assertion that either has a chlid assertion or is the latest confirmed assertion.
|
|
451
233
|
*/
|
|
452
|
-
function
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
require(zombieNum < zombieCount(), "NO_SUCH_ZOMBIE");
|
|
458
|
-
address zombieStakerAddress = zombieAddress(zombieNum);
|
|
459
|
-
uint64 latestNodeStaked = zombieLatestStakedNode(zombieNum);
|
|
460
|
-
uint256 nodesRemoved = 0;
|
|
461
|
-
uint256 latestConfirmedNum = latestConfirmed();
|
|
462
|
-
while (latestNodeStaked >= latestConfirmedNum && nodesRemoved < maxNodes) {
|
|
463
|
-
Node storage node = getNodeStorage(latestNodeStaked);
|
|
464
|
-
removeStaker(latestNodeStaked, zombieStakerAddress);
|
|
465
|
-
latestNodeStaked = node.prevNum;
|
|
466
|
-
nodesRemoved++;
|
|
467
|
-
}
|
|
468
|
-
if (latestNodeStaked < latestConfirmedNum) {
|
|
469
|
-
removeZombie(zombieNum);
|
|
470
|
-
} else {
|
|
471
|
-
zombieUpdateLatestStakedNode(zombieNum, latestNodeStaked);
|
|
472
|
-
}
|
|
234
|
+
function returnOldDepositFor(
|
|
235
|
+
address stakerAddress
|
|
236
|
+
) external override onlyValidator(stakerAddress) whenNotPaused {
|
|
237
|
+
require(msg.sender == withdrawalAddress(stakerAddress), "NOT_WITHDRAWAL_ADDRESS");
|
|
238
|
+
_requireInactiveAndWithdrawStaker(stakerAddress);
|
|
473
239
|
}
|
|
474
240
|
|
|
475
241
|
/**
|
|
476
|
-
* @
|
|
477
|
-
* @param startIndex Index in the zombie list to start removing zombies from (to limit the cost of this transaction)
|
|
242
|
+
* @dev Require that the staker is inactive and withdraw their stake
|
|
478
243
|
*/
|
|
479
|
-
function
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
removeZombie(i);
|
|
485
|
-
currentZombieCount--;
|
|
486
|
-
if (i >= currentZombieCount) {
|
|
487
|
-
return;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
244
|
+
function _requireInactiveAndWithdrawStaker(
|
|
245
|
+
address stakerAddress
|
|
246
|
+
) internal {
|
|
247
|
+
requireInactiveStaker(stakerAddress);
|
|
248
|
+
withdrawStaker(stakerAddress);
|
|
491
249
|
}
|
|
492
250
|
|
|
493
251
|
/**
|
|
494
|
-
* @notice
|
|
495
|
-
* @
|
|
496
|
-
*
|
|
497
|
-
* @return The current minimum stake requirement
|
|
252
|
+
* @notice Increase the amount staked for the given staker
|
|
253
|
+
* @param stakerAddress Address of the staker whose stake is increased
|
|
254
|
+
* @param depositAmount The amount of either eth or tokens deposited
|
|
498
255
|
*/
|
|
499
|
-
function
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
uint256
|
|
503
|
-
) internal
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
return baseStake;
|
|
511
|
-
}
|
|
512
|
-
uint24[10] memory numerators = [
|
|
513
|
-
1,
|
|
514
|
-
122971,
|
|
515
|
-
128977,
|
|
516
|
-
80017,
|
|
517
|
-
207329,
|
|
518
|
-
114243,
|
|
519
|
-
314252,
|
|
520
|
-
129988,
|
|
521
|
-
224562,
|
|
522
|
-
162163
|
|
523
|
-
];
|
|
524
|
-
uint24[10] memory denominators = [
|
|
525
|
-
1,
|
|
526
|
-
114736,
|
|
527
|
-
112281,
|
|
528
|
-
64994,
|
|
529
|
-
157126,
|
|
530
|
-
80782,
|
|
531
|
-
207329,
|
|
532
|
-
80017,
|
|
533
|
-
128977,
|
|
534
|
-
86901
|
|
535
|
-
];
|
|
536
|
-
uint256 firstUnresolvedAge = _blockNumber - firstUnresolvedDeadline;
|
|
537
|
-
uint256 periodsPassed = (firstUnresolvedAge * 10) / confirmPeriodBlocks;
|
|
538
|
-
uint256 baseMultiplier = 2**(periodsPassed / 10);
|
|
539
|
-
uint256 withNumerator = baseMultiplier * numerators[periodsPassed % 10];
|
|
540
|
-
uint256 multiplier = withNumerator / denominators[periodsPassed % 10];
|
|
541
|
-
if (multiplier == 0) {
|
|
542
|
-
multiplier = 1;
|
|
543
|
-
}
|
|
544
|
-
return baseStake * multiplier;
|
|
256
|
+
function _addToDeposit(
|
|
257
|
+
address stakerAddress,
|
|
258
|
+
address expectedWithdrawalAddress,
|
|
259
|
+
uint256 depositAmount
|
|
260
|
+
) internal onlyValidator(stakerAddress) whenNotPaused {
|
|
261
|
+
require(isStaked(stakerAddress), "NOT_STAKED");
|
|
262
|
+
require(
|
|
263
|
+
withdrawalAddress(stakerAddress) == expectedWithdrawalAddress,
|
|
264
|
+
"WRONG_WITHDRAWAL_ADDRESS"
|
|
265
|
+
);
|
|
266
|
+
increaseStakeBy(stakerAddress, depositAmount);
|
|
545
267
|
}
|
|
546
268
|
|
|
547
269
|
/**
|
|
548
|
-
* @notice
|
|
549
|
-
* @
|
|
550
|
-
* that only blocks operations that should be blocked anyway
|
|
551
|
-
* @return The current minimum stake requirement
|
|
270
|
+
* @notice Reduce the amount staked for the sender (difference between initial amount staked and target is creditted back to the sender).
|
|
271
|
+
* @param target Target amount of stake for the staker.
|
|
552
272
|
*/
|
|
553
|
-
function
|
|
554
|
-
uint256
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
function owner() external view returns (address) {
|
|
562
|
-
return _getAdmin();
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
function currentRequiredStake() public view returns (uint256) {
|
|
566
|
-
uint64 firstUnresolvedNodeNum = firstUnresolvedNode();
|
|
567
|
-
|
|
568
|
-
return currentRequiredStake(block.number, firstUnresolvedNodeNum, latestNodeCreated());
|
|
273
|
+
function reduceDeposit(
|
|
274
|
+
uint256 target
|
|
275
|
+
) external onlyValidator(msg.sender) whenNotPaused {
|
|
276
|
+
requireInactiveStaker(msg.sender);
|
|
277
|
+
// amount will be checked when creating an assertion
|
|
278
|
+
reduceStakeTo(msg.sender, target);
|
|
569
279
|
}
|
|
570
280
|
|
|
571
281
|
/**
|
|
572
|
-
* @notice
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* removeZombie and removeOldZombies can be used to remove any zombies that exist
|
|
576
|
-
* so that this will then be callable
|
|
577
|
-
*
|
|
578
|
-
* @param nodeNum The node on which to count staked zombies
|
|
579
|
-
* @return The number of zombies staked on the node
|
|
282
|
+
* @notice This allow the anyTrustFastConfirmer to force confirm any pending assertion
|
|
283
|
+
* the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to
|
|
284
|
+
* a contract that can call this function when received sufficient signatures
|
|
580
285
|
*/
|
|
581
|
-
function
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
286
|
+
function fastConfirmAssertion(
|
|
287
|
+
bytes32 assertionHash,
|
|
288
|
+
bytes32 parentAssertionHash,
|
|
289
|
+
AssertionState calldata confirmState,
|
|
290
|
+
bytes32 inboxAcc
|
|
291
|
+
) public whenNotPaused {
|
|
292
|
+
require(msg.sender == anyTrustFastConfirmer, "NOT_FAST_CONFIRMER");
|
|
293
|
+
// this skip deadline, prev, challenge validations
|
|
294
|
+
confirmAssertionInternal(assertionHash, parentAssertionHash, confirmState, inboxAcc);
|
|
590
295
|
}
|
|
591
296
|
|
|
592
297
|
/**
|
|
593
|
-
* @notice
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
*
|
|
597
|
-
* so that this will then be callable
|
|
298
|
+
* @notice This allow the anyTrustFastConfirmer to immediately create and confirm an assertion
|
|
299
|
+
* the anyTrustFastConfirmer is supposed to be set only on an AnyTrust chain to
|
|
300
|
+
* a contract that can call this function when received sufficient signatures
|
|
301
|
+
* The logic in this function is similar to stakeOnNewAssertion, but without staker checks
|
|
598
302
|
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
303
|
+
* We trust the anyTrustFastConfirmer to not call this function multiple times on the same prev,
|
|
304
|
+
* as doing so would result in incorrect accounting of withdrawable funds in the loserStakeEscrow.
|
|
305
|
+
* This is because the protocol assume there is only 1 unique confirmable child assertion.
|
|
601
306
|
*/
|
|
602
|
-
function
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
307
|
+
function fastConfirmNewAssertion(
|
|
308
|
+
AssertionInputs calldata assertion,
|
|
309
|
+
bytes32 expectedAssertionHash
|
|
310
|
+
) external whenNotPaused {
|
|
311
|
+
// Must supply expectedAssertionHash to fastConfirmNewAssertion
|
|
312
|
+
require(expectedAssertionHash != bytes32(0), "EXPECTED_ASSERTION_HASH");
|
|
313
|
+
AssertionStatus status = getAssertionStorage(expectedAssertionHash).status;
|
|
314
|
+
|
|
315
|
+
bytes32 prevAssertion = RollupLib.assertionHash(
|
|
316
|
+
assertion.beforeStateData.prevPrevAssertionHash,
|
|
317
|
+
assertion.beforeState,
|
|
318
|
+
assertion.beforeStateData.sequencerBatchAcc
|
|
319
|
+
);
|
|
320
|
+
getAssertionStorage(prevAssertion).requireExists();
|
|
321
|
+
|
|
322
|
+
if (status == AssertionStatus.NoAssertion) {
|
|
323
|
+
// If not exists, we create the new assertion
|
|
324
|
+
(bytes32 newAssertionHash,) =
|
|
325
|
+
createNewAssertion(assertion, prevAssertion, expectedAssertionHash);
|
|
326
|
+
if (!getAssertionStorage(newAssertionHash).isFirstChild) {
|
|
327
|
+
// only 1 of the children can be confirmed and get their stake refunded
|
|
328
|
+
// so we send the other children's stake to the loserStakeEscrow
|
|
329
|
+
// NOTE: if the losing staker have staked more than requiredStake, the excess stake will be stuck
|
|
330
|
+
IERC20(stakeToken).safeTransfer(
|
|
331
|
+
loserStakeEscrow, assertion.beforeStateData.configData.requiredStake
|
|
332
|
+
);
|
|
613
333
|
}
|
|
614
334
|
}
|
|
615
|
-
return stakedZombieCount;
|
|
616
|
-
}
|
|
617
335
|
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
firstUnresolved > latestConfirmed() && firstUnresolved <= latestNodeCreated(),
|
|
625
|
-
"NO_UNRESOLVED"
|
|
336
|
+
// This would revert if the assertion is already confirmed
|
|
337
|
+
fastConfirmAssertion(
|
|
338
|
+
expectedAssertionHash,
|
|
339
|
+
prevAssertion,
|
|
340
|
+
assertion.afterState,
|
|
341
|
+
bridge.sequencerInboxAccs(assertion.afterState.globalState.getInboxPosition() - 1)
|
|
626
342
|
);
|
|
627
343
|
}
|
|
628
344
|
|
|
629
|
-
function
|
|
630
|
-
|
|
631
|
-
require(nodeNum <= latestNodeCreated(), "DOESNT_EXIST");
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* @notice Verify that the given address is staked and not actively in a challenge
|
|
636
|
-
* @param stakerAddress Address to check
|
|
637
|
-
*/
|
|
638
|
-
function requireUnchallengedStaker(address stakerAddress) private view {
|
|
639
|
-
require(isStaked(stakerAddress), "NOT_STAKED");
|
|
640
|
-
require(currentChallenge(stakerAddress) == NO_CHAL_INDEX, "IN_CHAL");
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
contract RollupUserLogic is AbsRollupUserLogic, IRollupUser {
|
|
645
|
-
/// @dev the user logic just validated configuration and shouldn't write to state during init
|
|
646
|
-
/// this allows the admin logic to ensure consistency on parameters.
|
|
647
|
-
function initialize(address _stakeToken) external view override onlyProxy {
|
|
648
|
-
require(_stakeToken == address(0), "NO_TOKEN_ALLOWED");
|
|
649
|
-
require(!isERC20Enabled(), "FACET_NOT_ERC20");
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* @notice Create a new stake on an existing node
|
|
654
|
-
* @param nodeNum Number of the node your stake will be place one
|
|
655
|
-
* @param nodeHash Node hash of the node with the given nodeNum
|
|
656
|
-
*/
|
|
657
|
-
function newStakeOnExistingNode(uint64 nodeNum, bytes32 nodeHash) external payable override {
|
|
658
|
-
_newStake(msg.value);
|
|
659
|
-
stakeOnExistingNode(nodeNum, nodeHash);
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* @notice Create a new stake on a new node
|
|
664
|
-
* @param assertion Assertion describing the state change between the old node and the new one
|
|
665
|
-
* @param expectedNodeHash Node hash of the node that will be created
|
|
666
|
-
* @param prevNodeInboxMaxCount Total of messages in the inbox as of the previous node
|
|
667
|
-
*/
|
|
668
|
-
function newStakeOnNewNode(
|
|
669
|
-
Assertion calldata assertion,
|
|
670
|
-
bytes32 expectedNodeHash,
|
|
671
|
-
uint256 prevNodeInboxMaxCount
|
|
672
|
-
) external payable override {
|
|
673
|
-
_newStake(msg.value);
|
|
674
|
-
stakeOnNewNode(assertion, expectedNodeHash, prevNodeInboxMaxCount);
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* @notice Increase the amount staked eth for the given staker
|
|
679
|
-
* @param stakerAddress Address of the staker whose stake is increased
|
|
680
|
-
*/
|
|
681
|
-
function addToDeposit(address stakerAddress)
|
|
682
|
-
external
|
|
683
|
-
payable
|
|
684
|
-
override
|
|
685
|
-
onlyValidator
|
|
686
|
-
whenNotPaused
|
|
687
|
-
{
|
|
688
|
-
_addToDeposit(stakerAddress, msg.value);
|
|
345
|
+
function owner() external view returns (address) {
|
|
346
|
+
return _getAdmin();
|
|
689
347
|
}
|
|
690
348
|
|
|
691
349
|
/**
|
|
692
|
-
* @notice
|
|
350
|
+
* @notice Deprecated, use the function with `withdrawalAddress` instead
|
|
351
|
+
* Using this default `withdrawalAddress` to msg.sender
|
|
693
352
|
*/
|
|
694
|
-
function
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
{
|
|
701
|
-
uint256 amount = withdrawFunds(msg.sender);
|
|
702
|
-
// This is safe because it occurs after all checks and effects
|
|
703
|
-
// solhint-disable-next-line avoid-low-level-calls
|
|
704
|
-
(bool success, ) = msg.sender.call{value: amount}("");
|
|
705
|
-
require(success, "TRANSFER_FAILED");
|
|
706
|
-
return amount;
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
contract ERC20RollupUserLogic is AbsRollupUserLogic, IRollupUserERC20 {
|
|
711
|
-
/// @dev the user logic just validated configuration and shouldn't write to state during init
|
|
712
|
-
/// this allows the admin logic to ensure consistency on parameters.
|
|
713
|
-
function initialize(address _stakeToken) external view override onlyProxy {
|
|
714
|
-
require(_stakeToken != address(0), "NEED_STAKE_TOKEN");
|
|
715
|
-
require(isERC20Enabled(), "FACET_NOT_ERC20");
|
|
353
|
+
function newStakeOnNewAssertion(
|
|
354
|
+
uint256 tokenAmount,
|
|
355
|
+
AssertionInputs calldata assertion,
|
|
356
|
+
bytes32 expectedAssertionHash
|
|
357
|
+
) external {
|
|
358
|
+
newStakeOnNewAssertion(tokenAmount, assertion, expectedAssertionHash, msg.sender);
|
|
716
359
|
}
|
|
717
360
|
|
|
718
361
|
/**
|
|
719
|
-
* @notice Create a new stake on
|
|
362
|
+
* @notice Create a new stake on a new assertion
|
|
720
363
|
* @param tokenAmount Amount of the rollups staking token to stake
|
|
721
|
-
* @param
|
|
722
|
-
* @param
|
|
364
|
+
* @param assertion Assertion describing the state change between the old assertion and the new one
|
|
365
|
+
* @param expectedAssertionHash Assertion hash of the assertion that will be created
|
|
366
|
+
* @param _withdrawalAddress The address the send the stake back upon withdrawal
|
|
723
367
|
*/
|
|
724
|
-
function
|
|
368
|
+
function newStakeOnNewAssertion(
|
|
725
369
|
uint256 tokenAmount,
|
|
726
|
-
|
|
727
|
-
bytes32
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
370
|
+
AssertionInputs calldata assertion,
|
|
371
|
+
bytes32 expectedAssertionHash,
|
|
372
|
+
address _withdrawalAddress
|
|
373
|
+
) public {
|
|
374
|
+
require(_withdrawalAddress != address(0), "EMPTY_WITHDRAWAL_ADDRESS");
|
|
375
|
+
// _newStake makes sure the validator is whitelisted if the whitelist is enabled
|
|
376
|
+
_newStake(tokenAmount, _withdrawalAddress);
|
|
377
|
+
stakeOnNewAssertion(assertion, expectedAssertionHash);
|
|
731
378
|
/// @dev This is an external call, safe because it's at the end of the function
|
|
732
379
|
receiveTokens(tokenAmount);
|
|
733
380
|
}
|
|
734
381
|
|
|
735
382
|
/**
|
|
736
|
-
* @notice Create a new stake
|
|
737
|
-
*
|
|
738
|
-
* @param
|
|
739
|
-
* @param
|
|
740
|
-
* @param prevNodeInboxMaxCount Total of messages in the inbox as of the previous node
|
|
383
|
+
* @notice Create a new stake without creating a new assertion.
|
|
384
|
+
* Token amount can be zero if the staker wants to use `addToDeposit` from another account
|
|
385
|
+
* @param tokenAmount Amount to stake (can be zero)
|
|
386
|
+
* @param _withdrawalAddress The address the send the stake back upon withdrawal
|
|
741
387
|
*/
|
|
742
|
-
function
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
uint256 prevNodeInboxMaxCount
|
|
747
|
-
) external override {
|
|
748
|
-
_newStake(tokenAmount);
|
|
749
|
-
stakeOnNewNode(assertion, expectedNodeHash, prevNodeInboxMaxCount);
|
|
388
|
+
function newStake(uint256 tokenAmount, address _withdrawalAddress) external whenNotPaused {
|
|
389
|
+
require(_withdrawalAddress != address(0), "EMPTY_WITHDRAWAL_ADDRESS");
|
|
390
|
+
// _newStake makes sure the validator is whitelisted if the whitelist is enabled
|
|
391
|
+
_newStake(tokenAmount, _withdrawalAddress);
|
|
750
392
|
/// @dev This is an external call, safe because it's at the end of the function
|
|
751
|
-
receiveTokens(tokenAmount);
|
|
393
|
+
if (tokenAmount > 0) receiveTokens(tokenAmount);
|
|
752
394
|
}
|
|
753
395
|
|
|
754
396
|
/**
|
|
755
397
|
* @notice Increase the amount staked tokens for the given staker
|
|
756
398
|
* @param stakerAddress Address of the staker whose stake is increased
|
|
399
|
+
* @param expectedWithdrawalAddress The expected withdrawal address of the staker (protects depositor from a staker changing their withdrawal address)
|
|
757
400
|
* @param tokenAmount the amount of tokens staked
|
|
758
401
|
*/
|
|
759
|
-
function addToDeposit(
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
{
|
|
764
|
-
_addToDeposit(stakerAddress, tokenAmount);
|
|
402
|
+
function addToDeposit(
|
|
403
|
+
address stakerAddress,
|
|
404
|
+
address expectedWithdrawalAddress,
|
|
405
|
+
uint256 tokenAmount
|
|
406
|
+
) external whenNotPaused {
|
|
407
|
+
_addToDeposit(stakerAddress, expectedWithdrawalAddress, tokenAmount);
|
|
765
408
|
/// @dev This is an external call, safe because it's at the end of the function
|
|
766
409
|
receiveTokens(tokenAmount);
|
|
767
410
|
}
|
|
@@ -769,23 +412,17 @@ contract ERC20RollupUserLogic is AbsRollupUserLogic, IRollupUserERC20 {
|
|
|
769
412
|
/**
|
|
770
413
|
* @notice Withdraw uncommitted funds owned by sender from the rollup chain
|
|
771
414
|
*/
|
|
772
|
-
function withdrawStakerFunds()
|
|
773
|
-
external
|
|
774
|
-
override
|
|
775
|
-
onlyValidator
|
|
776
|
-
whenNotPausedOrDeprecated
|
|
777
|
-
returns (uint256)
|
|
778
|
-
{
|
|
415
|
+
function withdrawStakerFunds() external override whenNotPaused returns (uint256) {
|
|
779
416
|
uint256 amount = withdrawFunds(msg.sender);
|
|
417
|
+
require(amount > 0, "NO_FUNDS_TO_WITHDRAW");
|
|
780
418
|
// This is safe because it occurs after all checks and effects
|
|
781
|
-
|
|
419
|
+
IERC20(stakeToken).safeTransfer(msg.sender, amount);
|
|
782
420
|
return amount;
|
|
783
421
|
}
|
|
784
422
|
|
|
785
|
-
function receiveTokens(
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
);
|
|
423
|
+
function receiveTokens(
|
|
424
|
+
uint256 tokenAmount
|
|
425
|
+
) private {
|
|
426
|
+
IERC20(stakeToken).safeTransferFrom(msg.sender, address(this), tokenAmount);
|
|
790
427
|
}
|
|
791
428
|
}
|