@arbitrum/nitro-contracts 2.0.0-beta.0 → 2.0.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/README.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/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/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/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 +0 -13
- 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 +0 -13
- 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 +1 -15
- 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 +0 -13
- package/build/contracts/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol/IERC20Upgradeable.dbg.json +1 -1
- 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 +1 -15
- 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 +0 -13
- package/build/contracts/@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol/IERC165Upgradeable.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsBridge.sol/AbsBridge.json +0 -13
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.dbg.json +1 -1
- package/build/contracts/src/bridge/AbsInbox.sol/AbsInbox.json +0 -13
- package/build/contracts/src/bridge/AbsOutbox.sol/AbsOutbox.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/Bridge.sol/Bridge.json +2 -15
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Bridge.sol/ERC20Bridge.json +26 -15
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.dbg.json +1 -1
- package/build/contracts/src/bridge/ERC20Inbox.sol/ERC20Inbox.json +13 -15
- 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/IERC20Bridge.sol/IERC20Bridge.json +13 -0
- 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 -15
- 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/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 +2 -2
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.dbg.json +1 -1
- package/build/contracts/src/chain/CacheManager.sol/CacheManager.json +48 -21
- 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/ChallengeManager.sol/ChallengeManager.json +2 -2
- 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/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/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/CryptographyPrimitives.sol/CryptographyPrimitives.dbg.json +1 -1
- package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.dbg.json +4 -0
- package/build/contracts/src/libraries/DecimalsConverterHelper.sol/DecimalsConverterHelper.json +10 -0
- 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/BridgeStub.sol/BridgeStub.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeStub.sol/BridgeStub.json +28 -2
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.dbg.json +1 -1
- package/build/contracts/src/mocks/BridgeUnproxied.sol/BridgeUnproxied.json +2 -15
- 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/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/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/SequencerInboxStub.sol/SequencerInboxStub.dbg.json +1 -1
- package/build/contracts/src/mocks/SequencerInboxStub.sol/SequencerInboxStub.json +2 -2
- package/build/contracts/src/mocks/Simple.sol/Simple.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.dbg.json +1 -1
- package/build/contracts/src/mocks/SimpleCacheManager.sol/SimpleCacheManager.json +2 -2
- 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/SingleExecutionChallenge.sol/SingleExecutionChallenge.dbg.json +1 -1
- package/build/contracts/src/mocks/SingleExecutionChallenge.sol/SingleExecutionChallenge.json +2 -2
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.dbg.json +1 -1
- package/build/contracts/src/mocks/TimedOutChallengeManager.sol/TimedOutChallengeManager.json +2 -2
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.dbg.json +1 -1
- package/build/contracts/src/mocks/UpgradeExecutorMock.sol/UpgradeExecutorMock.json +2 -15
- package/build/contracts/src/node-interface/NodeInterface.sol/NodeInterface.dbg.json +1 -1
- package/build/contracts/src/node-interface/NodeInterfaceDebug.sol/NodeInterfaceDebug.dbg.json +1 -1
- package/build/contracts/src/osp/HashProofHelper.sol/HashProofHelper.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/IOneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProofEntry.sol/OneStepProofEntryLib.dbg.json +1 -1
- package/build/contracts/src/osp/IOneStepProver.sol/IOneStepProver.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProofEntry.sol/OneStepProofEntry.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProver0.sol/OneStepProver0.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverHostIo.sol/OneStepProverHostIo.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMath.sol/OneStepProverMath.dbg.json +1 -1
- package/build/contracts/src/osp/OneStepProverMemory.sol/OneStepProverMemory.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbAddressTable.sol/ArbAddressTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbAggregator.sol/ArbAggregator.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbBLS.sol/ArbBLS.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbDebug.sol/ArbDebug.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbFunctionTable.sol/ArbFunctionTable.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbGasInfo.sol/ArbGasInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbInfo.sol/ArbInfo.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwner.sol/ArbOwner.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbOwnerPublic.sol/ArbOwnerPublic.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbRetryableTx.sol/ArbRetryableTx.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbStatistics.sol/ArbStatistics.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbSys.sol/ArbSys.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasm.sol/ArbWasm.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.dbg.json +1 -1
- package/build/contracts/src/precompiles/ArbWasmCache.sol/ArbWasmCache.json +13 -0
- 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/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 +4 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/FactoryDeployerHelper.json +68 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IDeployHelper.dbg.json +4 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IDeployHelper.json +58 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20.dbg.json +4 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20.json +40 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20Bridge.dbg.json +4 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IERC20Bridge.json +24 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IInboxBase.dbg.json +4 -0
- package/build/contracts/src/rollup/FactoryDeployerHelper.sol/IInboxBase.json +24 -0
- 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/IRollupUser.json +18 -0
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserAbs.json +18 -0
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.dbg.json +1 -1
- package/build/contracts/src/rollup/IRollupLogic.sol/IRollupUserERC20.json +18 -0
- 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 +28 -15
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupCore.sol/RollupCore.json +13 -13
- 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/RollupProxy.sol/RollupProxy.json +2 -2
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.json +31 -13
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.json +33 -15
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.dbg.json +1 -1
- package/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json +33 -15
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorUtils.sol/ValidatorUtils.json +2 -2
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.dbg.json +1 -1
- package/build/contracts/src/rollup/ValidatorWallet.sol/ValidatorWallet.json +2 -15
- 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/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/BridgeTester.sol/BridgeTester.json +28 -15
- 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/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/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/package.json +6 -3
- package/src/bridge/AbsInbox.sol +16 -4
- package/src/bridge/AbsOutbox.sol +11 -2
- package/src/bridge/ERC20Bridge.sol +30 -3
- package/src/bridge/ERC20Inbox.sol +28 -4
- package/src/bridge/ERC20Outbox.sol +10 -1
- package/src/bridge/IERC20Bridge.sol +7 -0
- package/src/bridge/IERC20Inbox.sol +4 -3
- package/src/bridge/IInbox.sol +3 -3
- package/src/bridge/Inbox.sol +6 -1
- package/src/bridge/Outbox.sol +5 -0
- package/src/chain/CacheManager.sol +19 -9
- package/src/libraries/Constants.sol +11 -0
- package/src/libraries/DecimalsConverterHelper.sol +33 -0
- package/src/libraries/Error.sol +6 -0
- package/src/mocks/BridgeStub.sol +3 -0
- package/src/mocks/SimpleCacheManager.sol +1 -1
- package/src/node-interface/NodeInterface.sol +1 -1
- package/src/precompiles/ArbWasmCache.sol +5 -2
- package/src/rollup/AbsRollupEventInbox.sol +3 -4
- package/src/rollup/DeployHelper.sol +22 -11
- package/src/rollup/ERC20RollupEventInbox.sol +5 -0
- package/src/rollup/FactoryDeployerHelper.sol +54 -0
- package/src/rollup/IRollupLogic.sol +2 -0
- package/src/rollup/RollupAdminLogic.sol +11 -0
- package/src/rollup/RollupCore.sol +1 -0
- package/src/rollup/RollupCreator.sol +49 -1
- package/src/rollup/RollupEventInbox.sol +8 -0
- package/src/rollup/RollupUserLogic.sol +35 -13
- package/src/test-helpers/BridgeTester.sol +3 -0
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.dbg.json +0 -4
- package/build/contracts/@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol/IERC20Permit.json +0 -86
|
@@ -7,9 +7,11 @@ pragma solidity ^0.8.0;
|
|
|
7
7
|
import "../precompiles/ArbOwnerPublic.sol";
|
|
8
8
|
import "../precompiles/ArbWasm.sol";
|
|
9
9
|
import "../precompiles/ArbWasmCache.sol";
|
|
10
|
+
import "../libraries/DelegateCallAware.sol";
|
|
10
11
|
import "solady/src/utils/MinHeapLib.sol";
|
|
12
|
+
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
11
13
|
|
|
12
|
-
contract CacheManager {
|
|
14
|
+
contract CacheManager is Initializable, DelegateCallAware {
|
|
13
15
|
using MinHeapLib for MinHeapLib.Heap;
|
|
14
16
|
|
|
15
17
|
ArbOwnerPublic internal constant ARB_OWNER_PUBLIC = ArbOwnerPublic(address(0x6b));
|
|
@@ -34,7 +36,7 @@ contract CacheManager {
|
|
|
34
36
|
error BidsArePaused();
|
|
35
37
|
error MakeSpaceTooLarge(uint64 size, uint64 limit);
|
|
36
38
|
|
|
37
|
-
event InsertBid(bytes32 indexed codehash, uint192 bid, uint64 size);
|
|
39
|
+
event InsertBid(bytes32 indexed codehash, address program, uint192 bid, uint64 size);
|
|
38
40
|
event DeleteBid(bytes32 indexed codehash, uint192 bid, uint64 size);
|
|
39
41
|
event SetCacheSize(uint64 size);
|
|
40
42
|
event SetDecayRate(uint64 decay);
|
|
@@ -47,7 +49,7 @@ contract CacheManager {
|
|
|
47
49
|
uint192 bid;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
function initialize(uint64 initCacheSize, uint64 initDecay) external initializer onlyDelegated {
|
|
51
53
|
cacheSize = initCacheSize;
|
|
52
54
|
decay = initDecay;
|
|
53
55
|
}
|
|
@@ -151,10 +153,16 @@ contract CacheManager {
|
|
|
151
153
|
|
|
152
154
|
/// @notice Returns the minimum bid required to cache the program with given codehash.
|
|
153
155
|
/// Value returned here is the minimum bid that you can send with msg.value
|
|
154
|
-
function getMinBid(bytes32 codehash)
|
|
156
|
+
function getMinBid(bytes32 codehash) public view returns (uint192 min) {
|
|
155
157
|
return getMinBid(_asmSize(codehash));
|
|
156
158
|
}
|
|
157
159
|
|
|
160
|
+
/// @notice Returns the minimum bid required to cache the program at given address.
|
|
161
|
+
/// Value returned here is the minimum bid that you can send with msg.value
|
|
162
|
+
function getMinBid(address program) external view returns (uint192 min) {
|
|
163
|
+
return getMinBid(program.codehash);
|
|
164
|
+
}
|
|
165
|
+
|
|
158
166
|
/// @notice Sends all revenue to the network fee account.
|
|
159
167
|
function sweepFunds() external {
|
|
160
168
|
(bool success, bytes memory data) = ARB_OWNER_PUBLIC.getNetworkFeeAccount().call{
|
|
@@ -167,18 +175,19 @@ contract CacheManager {
|
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
177
|
|
|
170
|
-
///
|
|
171
|
-
function placeBid(
|
|
178
|
+
/// Places a bid, reverting if payment is insufficient.
|
|
179
|
+
function placeBid(address program) external payable {
|
|
172
180
|
if (isPaused) {
|
|
173
181
|
revert BidsArePaused();
|
|
174
182
|
}
|
|
183
|
+
bytes32 codehash = program.codehash;
|
|
175
184
|
if (_isCached(codehash)) {
|
|
176
185
|
revert AlreadyCached(codehash);
|
|
177
186
|
}
|
|
178
187
|
|
|
179
188
|
uint64 asm = _asmSize(codehash);
|
|
180
189
|
(uint192 bid, uint64 index) = _makeSpace(asm);
|
|
181
|
-
return _addBid(bid, codehash, asm, index);
|
|
190
|
+
return _addBid(bid, program, codehash, asm, index);
|
|
182
191
|
}
|
|
183
192
|
|
|
184
193
|
/// @notice Evicts entries until enough space exists in the cache, reverting if payment is insufficient.
|
|
@@ -230,6 +239,7 @@ contract CacheManager {
|
|
|
230
239
|
/// @dev Adds a bid
|
|
231
240
|
function _addBid(
|
|
232
241
|
uint192 bid,
|
|
242
|
+
address program,
|
|
233
243
|
bytes32 code,
|
|
234
244
|
uint64 size,
|
|
235
245
|
uint64 index
|
|
@@ -239,7 +249,7 @@ contract CacheManager {
|
|
|
239
249
|
}
|
|
240
250
|
|
|
241
251
|
Entry memory entry = Entry({size: size, code: code, bid: bid});
|
|
242
|
-
ARB_WASM_CACHE.
|
|
252
|
+
ARB_WASM_CACHE.cacheProgram(program);
|
|
243
253
|
bids.push(_packBid(bid, index));
|
|
244
254
|
queueSize += size;
|
|
245
255
|
if (index == entries.length) {
|
|
@@ -247,7 +257,7 @@ contract CacheManager {
|
|
|
247
257
|
} else {
|
|
248
258
|
entries[index] = entry;
|
|
249
259
|
}
|
|
250
|
-
emit InsertBid(code, bid, size);
|
|
260
|
+
emit InsertBid(code, program, bid, size);
|
|
251
261
|
}
|
|
252
262
|
|
|
253
263
|
/// @dev Clears the entry at the given index
|
|
@@ -8,3 +8,14 @@ uint64 constant NO_CHAL_INDEX = 0;
|
|
|
8
8
|
|
|
9
9
|
// Expected seconds per block in Ethereum PoS
|
|
10
10
|
uint256 constant ETH_POS_BLOCK_TIME = 12;
|
|
11
|
+
|
|
12
|
+
/// @dev If nativeTokenDecimals is different than 18 decimals, bridge will inflate or deflate token amounts
|
|
13
|
+
/// when depositing to child chain to match 18 decimal denomination. Opposite process happens when
|
|
14
|
+
/// amount is withdrawn back to parent chain. In order to avoid uint256 overflows we restrict max number
|
|
15
|
+
/// of decimals to 36 which should be enough for most practical use-cases.
|
|
16
|
+
uint8 constant MAX_ALLOWED_NATIVE_TOKEN_DECIMALS = uint8(36);
|
|
17
|
+
|
|
18
|
+
/// @dev Max amount of erc20 native token that can deposit when upscaling is required (i.e. < 18 decimals)
|
|
19
|
+
/// Amounts higher than this would risk uint256 overflows when adjusting decimals. Considering
|
|
20
|
+
/// 18 decimals are 60 bits, we choose 2^192 as the limit which equals to ~6.3*10^57 weis of token
|
|
21
|
+
uint256 constant MAX_UPSCALE_AMOUNT = type(uint192).max;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2021-2022, Offchain Labs, Inc.
|
|
2
|
+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
|
|
3
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
4
|
+
|
|
5
|
+
pragma solidity ^0.8.0;
|
|
6
|
+
|
|
7
|
+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
8
|
+
|
|
9
|
+
library DecimalsConverterHelper {
|
|
10
|
+
/// @notice generic function for mapping amount from one decimal denomination to another
|
|
11
|
+
/// @dev Ie. let's say amount is 752. If token has 16 decimals and is being adjusted to
|
|
12
|
+
/// 18 decimals then amount will be 75200. If token has 20 decimals adjusted amount
|
|
13
|
+
/// is 7. If token uses no decimals converted amount is 752*10^18.
|
|
14
|
+
/// When amount is adjusted from 18 decimals back to native token decimals, opposite
|
|
15
|
+
/// process is performed.
|
|
16
|
+
/// @param amount amount to convert
|
|
17
|
+
/// @param decimalsIn current decimals
|
|
18
|
+
/// @param decimalsOut target decimals
|
|
19
|
+
/// @return amount converted to 'decimalsOut' decimals
|
|
20
|
+
function adjustDecimals(
|
|
21
|
+
uint256 amount,
|
|
22
|
+
uint8 decimalsIn,
|
|
23
|
+
uint8 decimalsOut
|
|
24
|
+
) internal pure returns (uint256) {
|
|
25
|
+
if (decimalsIn == decimalsOut) {
|
|
26
|
+
return amount;
|
|
27
|
+
} else if (decimalsIn < decimalsOut) {
|
|
28
|
+
return amount * 10**(decimalsOut - decimalsIn);
|
|
29
|
+
} else {
|
|
30
|
+
return amount / 10**(decimalsIn - decimalsOut);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/libraries/Error.sol
CHANGED
|
@@ -119,6 +119,12 @@ error NotForked();
|
|
|
119
119
|
/// @dev The provided gasLimit is larger than uint64
|
|
120
120
|
error GasLimitTooLarge();
|
|
121
121
|
|
|
122
|
+
/// @dev The provided amount cannot be adjusted to 18 decimals due to overflow
|
|
123
|
+
error AmountTooLarge(uint256 amount);
|
|
124
|
+
|
|
125
|
+
/// @dev Number of native token's decimals is restricted to enable conversions to 18 decimals
|
|
126
|
+
error NativeTokenDecimalsTooLarge(uint256 decimals);
|
|
127
|
+
|
|
122
128
|
// Outbox Errors
|
|
123
129
|
|
|
124
130
|
/// @dev The provided proof was too long
|
package/src/mocks/BridgeStub.sol
CHANGED
|
@@ -32,6 +32,9 @@ contract BridgeStub is IBridge, IEthBridge {
|
|
|
32
32
|
address public sequencerInbox;
|
|
33
33
|
uint256 public override sequencerReportedSubMessageCount;
|
|
34
34
|
|
|
35
|
+
address public nativeToken;
|
|
36
|
+
uint8 public nativeTokenDecimals;
|
|
37
|
+
|
|
35
38
|
function setSequencerInbox(address _sequencerInbox) external override {
|
|
36
39
|
sequencerInbox = _sequencerInbox;
|
|
37
40
|
emit SequencerInboxUpdated(_sequencerInbox);
|
|
@@ -7,7 +7,7 @@ import "../precompiles/ArbWasmCache.sol";
|
|
|
7
7
|
|
|
8
8
|
contract SimpleCacheManager {
|
|
9
9
|
function cacheProgram(address program) external {
|
|
10
|
-
ArbWasmCache(address(0x72)).
|
|
10
|
+
ArbWasmCache(address(0x72)).cacheProgram(program);
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
function evictProgram(address program) external {
|
|
@@ -18,7 +18,7 @@ interface NodeInterface {
|
|
|
18
18
|
* @param deposit amount to deposit to sender in L2
|
|
19
19
|
* @param to destination L2 contract address
|
|
20
20
|
* @param l2CallValue call value for retryable L2 message
|
|
21
|
-
* @param excessFeeRefundAddress
|
|
21
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost
|
|
22
22
|
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
|
23
23
|
* @param data ABI encoded data of L2 message
|
|
24
24
|
*/
|
|
@@ -16,11 +16,14 @@ interface ArbWasmCache {
|
|
|
16
16
|
/// @return managers the list of managers.
|
|
17
17
|
function allCacheManagers() external view returns (address[] memory managers);
|
|
18
18
|
|
|
19
|
-
/// @
|
|
19
|
+
/// @dev Deprecated, replaced with cacheProgram
|
|
20
|
+
function cacheCodehash(bytes32 codehash) external;
|
|
21
|
+
|
|
22
|
+
/// @notice Caches all programs with a codehash equal to the given address.
|
|
20
23
|
/// @notice Reverts if the programs have expired.
|
|
21
24
|
/// @notice Caller must be a cache manager or chain owner.
|
|
22
25
|
/// @notice If you're looking for how to bid for position, interact with the chain's cache manager contract.
|
|
23
|
-
function
|
|
26
|
+
function cacheProgram(address addr) external;
|
|
24
27
|
|
|
25
28
|
/// @notice Evicts all programs with the given codehash.
|
|
26
29
|
/// @notice Caller must be a cache manager or chain owner.
|
|
@@ -53,10 +53,7 @@ abstract contract AbsRollupEventInbox is
|
|
|
53
53
|
{
|
|
54
54
|
require(bytes(chainConfig).length > 0, "EMPTY_CHAIN_CONFIG");
|
|
55
55
|
uint8 initMsgVersion = 1;
|
|
56
|
-
uint256 currentDataCost =
|
|
57
|
-
if (ArbitrumChecker.runningOnArbitrum()) {
|
|
58
|
-
currentDataCost += ArbGasInfo(address(0x6c)).getL1BaseFeeEstimate();
|
|
59
|
-
}
|
|
56
|
+
uint256 currentDataCost = _currentDataCostToReport();
|
|
60
57
|
bytes memory initMsg = abi.encodePacked(
|
|
61
58
|
chainId,
|
|
62
59
|
initMsgVersion,
|
|
@@ -68,4 +65,6 @@ abstract contract AbsRollupEventInbox is
|
|
|
68
65
|
}
|
|
69
66
|
|
|
70
67
|
function _enqueueInitializationMsg(bytes memory initMsg) internal virtual returns (uint256);
|
|
68
|
+
|
|
69
|
+
function _currentDataCostToReport() internal virtual returns (uint256);
|
|
71
70
|
}
|
|
@@ -6,8 +6,8 @@ pragma solidity ^0.8.0;
|
|
|
6
6
|
|
|
7
7
|
import {IInbox} from "../bridge/IInbox.sol";
|
|
8
8
|
import {IInboxBase} from "../bridge/IInboxBase.sol";
|
|
9
|
-
import {IERC20Bridge} from "../bridge/IERC20Bridge.sol";
|
|
10
9
|
import {IERC20Inbox} from "../bridge/ERC20Inbox.sol";
|
|
10
|
+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
11
11
|
|
|
12
12
|
/// @notice Helper contract for deploying some keyless deployment to Arbitrum using delayed inbox
|
|
13
13
|
contract DeployHelper {
|
|
@@ -48,7 +48,7 @@ contract DeployHelper {
|
|
|
48
48
|
uint256 _value,
|
|
49
49
|
address _l2Address,
|
|
50
50
|
bytes memory payload,
|
|
51
|
-
|
|
51
|
+
address _nativeToken,
|
|
52
52
|
uint256 maxFeePerGas
|
|
53
53
|
) internal {
|
|
54
54
|
uint256 submissionCost = IInboxBase(inbox).calculateRetryableSubmissionFee(
|
|
@@ -58,7 +58,20 @@ contract DeployHelper {
|
|
|
58
58
|
uint256 feeAmount = _value + submissionCost + GASLIMIT * maxFeePerGas;
|
|
59
59
|
|
|
60
60
|
// fund the target L2 address
|
|
61
|
-
if (
|
|
61
|
+
if (_nativeToken != address(0)) {
|
|
62
|
+
// calculate the fee amount in the native token's decimals
|
|
63
|
+
uint256 feeAmountNativeDenominated = feeAmount;
|
|
64
|
+
uint8 decimals = ERC20(_nativeToken).decimals();
|
|
65
|
+
if (decimals < 18) {
|
|
66
|
+
feeAmountNativeDenominated = feeAmount / (10**(18 - decimals));
|
|
67
|
+
// round up if necessary
|
|
68
|
+
if (feeAmountNativeDenominated * (10**(18 - decimals)) < feeAmount) {
|
|
69
|
+
feeAmountNativeDenominated++;
|
|
70
|
+
}
|
|
71
|
+
} else if (decimals > 18) {
|
|
72
|
+
feeAmountNativeDenominated = feeAmount * (10**(decimals - 18));
|
|
73
|
+
}
|
|
74
|
+
|
|
62
75
|
IERC20Inbox(inbox).createRetryableTicket({
|
|
63
76
|
to: _l2Address,
|
|
64
77
|
l2CallValue: _value,
|
|
@@ -67,7 +80,7 @@ contract DeployHelper {
|
|
|
67
80
|
callValueRefundAddress: msg.sender,
|
|
68
81
|
gasLimit: GASLIMIT,
|
|
69
82
|
maxFeePerGas: maxFeePerGas,
|
|
70
|
-
tokenTotalFeeAmount:
|
|
83
|
+
tokenTotalFeeAmount: feeAmountNativeDenominated,
|
|
71
84
|
data: ""
|
|
72
85
|
});
|
|
73
86
|
} else {
|
|
@@ -91,14 +104,12 @@ contract DeployHelper {
|
|
|
91
104
|
address _nativeToken,
|
|
92
105
|
uint256 _maxFeePerGas
|
|
93
106
|
) external payable {
|
|
94
|
-
bool isUsingFeeToken = _nativeToken != address(0);
|
|
95
|
-
|
|
96
107
|
_fundAndDeploy(
|
|
97
108
|
_inbox,
|
|
98
109
|
NICK_CREATE2_VALUE,
|
|
99
110
|
NICK_CREATE2_DEPLOYER,
|
|
100
111
|
NICK_CREATE2_PAYLOAD,
|
|
101
|
-
|
|
112
|
+
_nativeToken,
|
|
102
113
|
_maxFeePerGas
|
|
103
114
|
);
|
|
104
115
|
_fundAndDeploy(
|
|
@@ -106,7 +117,7 @@ contract DeployHelper {
|
|
|
106
117
|
ERC2470_VALUE,
|
|
107
118
|
ERC2470_DEPLOYER,
|
|
108
119
|
ERC2470_PAYLOAD,
|
|
109
|
-
|
|
120
|
+
_nativeToken,
|
|
110
121
|
_maxFeePerGas
|
|
111
122
|
);
|
|
112
123
|
_fundAndDeploy(
|
|
@@ -114,7 +125,7 @@ contract DeployHelper {
|
|
|
114
125
|
ZOLTU_VALUE,
|
|
115
126
|
ZOLTU_CREATE2_DEPLOYER,
|
|
116
127
|
ZOLTU_CREATE2_PAYLOAD,
|
|
117
|
-
|
|
128
|
+
_nativeToken,
|
|
118
129
|
_maxFeePerGas
|
|
119
130
|
);
|
|
120
131
|
_fundAndDeploy(
|
|
@@ -122,12 +133,12 @@ contract DeployHelper {
|
|
|
122
133
|
ERC1820_VALUE,
|
|
123
134
|
ERC1820_DEPLOYER,
|
|
124
135
|
ERC1820_PAYLOAD,
|
|
125
|
-
|
|
136
|
+
_nativeToken,
|
|
126
137
|
_maxFeePerGas
|
|
127
138
|
);
|
|
128
139
|
|
|
129
140
|
// if paying with ETH refund the caller
|
|
130
|
-
if (
|
|
141
|
+
if (_nativeToken == address(0)) {
|
|
131
142
|
payable(msg.sender).transfer(address(this).balance);
|
|
132
143
|
}
|
|
133
144
|
}
|
|
@@ -23,4 +23,9 @@ contract ERC20RollupEventInbox is AbsRollupEventInbox {
|
|
|
23
23
|
tokenAmount
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
function _currentDataCostToReport() internal pure override returns (uint256) {
|
|
28
|
+
// at the moment chains using fee token in Anytrust mode do not charge for the data posting fees
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
26
31
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @title Helper contract for cross-chain deployment of deterministic factories when rollup uses custom fee token
|
|
6
|
+
* @notice It bundles sending the fee token to inbox and invoking the factory deployment function.
|
|
7
|
+
* Prerequisite: fee token must be approved for this contract to send it to inbox.
|
|
8
|
+
*/
|
|
9
|
+
contract FactoryDeployerHelper {
|
|
10
|
+
address public constant DEPLOY_HELPER = address(0x90D68B056c411015eaE3EC0b98AD94E2C91419F1);
|
|
11
|
+
uint256 public constant MAX_FEE_PER_GAS = 100_000_000;
|
|
12
|
+
|
|
13
|
+
function deploy(address inbox) external {
|
|
14
|
+
deploy(inbox, MAX_FEE_PER_GAS);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function deploy(address inbox, uint256 maxFeePerGas) public {
|
|
18
|
+
address bridge = address(IInboxBase(inbox).bridge());
|
|
19
|
+
address feeToken = IERC20Bridge(bridge).nativeToken();
|
|
20
|
+
|
|
21
|
+
uint256 amount = IDeployHelper(DEPLOY_HELPER).getDeploymentTotalCost(inbox, maxFeePerGas);
|
|
22
|
+
IERC20(feeToken).transferFrom(msg.sender, inbox, amount);
|
|
23
|
+
IDeployHelper(DEPLOY_HELPER).perform(inbox, feeToken, maxFeePerGas);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface IERC20 {
|
|
28
|
+
function transferFrom(
|
|
29
|
+
address from,
|
|
30
|
+
address to,
|
|
31
|
+
uint256 value
|
|
32
|
+
) external returns (bool);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface IDeployHelper {
|
|
36
|
+
function getDeploymentTotalCost(address inbox, uint256 maxFeePerGas)
|
|
37
|
+
external
|
|
38
|
+
view
|
|
39
|
+
returns (uint256);
|
|
40
|
+
|
|
41
|
+
function perform(
|
|
42
|
+
address _inbox,
|
|
43
|
+
address _nativeToken,
|
|
44
|
+
uint256 _maxFeePerGas
|
|
45
|
+
) external payable;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface IInboxBase {
|
|
49
|
+
function bridge() external view returns (address);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface IERC20Bridge {
|
|
53
|
+
function nativeToken() external view returns (address);
|
|
54
|
+
}
|
|
@@ -24,6 +24,8 @@ interface IRollupUserAbs is IRollupCore, IOwnable {
|
|
|
24
24
|
|
|
25
25
|
function confirmNextNode(bytes32 blockHash, bytes32 sendRoot) external;
|
|
26
26
|
|
|
27
|
+
function fastConfirmNextNode(bytes32 blockHash, bytes32 sendRoot) external;
|
|
28
|
+
|
|
27
29
|
function stakeOnExistingNode(uint64 nodeNum, bytes32 nodeHash) external;
|
|
28
30
|
|
|
29
31
|
function stakeOnNewNode(
|
|
@@ -379,4 +379,15 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl
|
|
|
379
379
|
validatorWhitelistDisabled = _validatorWhitelistDisabled;
|
|
380
380
|
emit OwnerFunctionCalled(30);
|
|
381
381
|
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* @notice set the anyTrustFastConfirmer address
|
|
385
|
+
* must also call `setValidator` to set the same address as a validator to work
|
|
386
|
+
* old fast confirmer need to be removed from the validator list manually
|
|
387
|
+
* @param _anyTrustFastConfirmer new value of anyTrustFastConfirmer
|
|
388
|
+
*/
|
|
389
|
+
function setAnyTrustFastConfirmer(address _anyTrustFastConfirmer) external {
|
|
390
|
+
anyTrustFastConfirmer = _anyTrustFastConfirmer;
|
|
391
|
+
emit OwnerFunctionCalled(31);
|
|
392
|
+
}
|
|
382
393
|
}
|
|
@@ -77,6 +77,7 @@ abstract contract RollupCore is IRollupCore, PausableUpgradeable {
|
|
|
77
77
|
uint64 internal constant GENESIS_NODE = 0;
|
|
78
78
|
|
|
79
79
|
bool public validatorWhitelistDisabled;
|
|
80
|
+
address public anyTrustFastConfirmer;
|
|
80
81
|
|
|
81
82
|
// If the chain this RollupCore is deployed on is an Arbitrum chain.
|
|
82
83
|
bool internal immutable _hostChainIsArbitrum = ArbitrumChecker.runningOnArbitrum();
|
|
@@ -277,10 +277,58 @@ contract RollupCreator is Ownable {
|
|
|
277
277
|
IInboxBase(_inbox),
|
|
278
278
|
_maxFeePerGas
|
|
279
279
|
);
|
|
280
|
-
|
|
280
|
+
|
|
281
|
+
// calculate the fee amount in the native token's decimals
|
|
282
|
+
uint8 decimals = ERC20(_nativeToken).decimals();
|
|
283
|
+
|
|
284
|
+
uint256 totalFeeNativeDenominated = totalFee;
|
|
285
|
+
if (decimals < 18) {
|
|
286
|
+
uint256 gasCost = _maxFeePerGas * 21_000;
|
|
287
|
+
uint256 nickCreate2Cost = _scaleDownToNativeDecimals(
|
|
288
|
+
l2FactoriesDeployer.NICK_CREATE2_VALUE() + gasCost,
|
|
289
|
+
decimals
|
|
290
|
+
);
|
|
291
|
+
uint256 erc2470Cost = _scaleDownToNativeDecimals(
|
|
292
|
+
l2FactoriesDeployer.ERC2470_VALUE() + gasCost,
|
|
293
|
+
decimals
|
|
294
|
+
);
|
|
295
|
+
uint256 zoltuCreate2Cost = _scaleDownToNativeDecimals(
|
|
296
|
+
l2FactoriesDeployer.ZOLTU_VALUE() + gasCost,
|
|
297
|
+
decimals
|
|
298
|
+
);
|
|
299
|
+
uint256 erc1820Cost = _scaleDownToNativeDecimals(
|
|
300
|
+
l2FactoriesDeployer.ERC1820_VALUE() + gasCost,
|
|
301
|
+
decimals
|
|
302
|
+
);
|
|
303
|
+
totalFeeNativeDenominated =
|
|
304
|
+
nickCreate2Cost +
|
|
305
|
+
erc2470Cost +
|
|
306
|
+
zoltuCreate2Cost +
|
|
307
|
+
erc1820Cost;
|
|
308
|
+
} else if (decimals > 18) {
|
|
309
|
+
totalFeeNativeDenominated = totalFee * (10**(decimals - 18));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
IERC20(_nativeToken).safeTransferFrom(msg.sender, _inbox, totalFeeNativeDenominated);
|
|
281
313
|
|
|
282
314
|
// do it
|
|
283
315
|
l2FactoriesDeployer.perform(_inbox, _nativeToken, _maxFeePerGas);
|
|
284
316
|
}
|
|
285
317
|
}
|
|
318
|
+
|
|
319
|
+
function _scaleDownToNativeDecimals(uint256 amount, uint8 decimals)
|
|
320
|
+
internal
|
|
321
|
+
pure
|
|
322
|
+
returns (uint256)
|
|
323
|
+
{
|
|
324
|
+
uint256 scaledAmount = amount;
|
|
325
|
+
if (decimals < 18) {
|
|
326
|
+
scaledAmount = amount / (10**(18 - decimals));
|
|
327
|
+
// round up if necessary
|
|
328
|
+
if (scaledAmount * (10**(18 - decimals)) < amount) {
|
|
329
|
+
scaledAmount++;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return scaledAmount;
|
|
333
|
+
}
|
|
286
334
|
}
|
|
@@ -21,4 +21,12 @@ contract RollupEventInbox is AbsRollupEventInbox {
|
|
|
21
21
|
keccak256(initMsg)
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
function _currentDataCostToReport() internal view override returns (uint256) {
|
|
26
|
+
uint256 currentDataCost = block.basefee;
|
|
27
|
+
if (ArbitrumChecker.runningOnArbitrum()) {
|
|
28
|
+
currentDataCost += ArbGasInfo(address(0x6c)).getL1BaseFeeEstimate();
|
|
29
|
+
}
|
|
30
|
+
return currentDataCost;
|
|
31
|
+
}
|
|
24
32
|
}
|
|
@@ -116,29 +116,28 @@ abstract contract AbsRollupUserLogic is
|
|
|
116
116
|
emit NodeRejected(firstUnresolvedNodeNum);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
function confirmNextNode(bytes32 blockHash, bytes32 sendRoot)
|
|
125
|
-
external
|
|
126
|
-
onlyValidator
|
|
127
|
-
whenNotPaused
|
|
128
|
-
{
|
|
119
|
+
function _confirmNextNode(
|
|
120
|
+
bytes32 blockHash,
|
|
121
|
+
bytes32 sendRoot,
|
|
122
|
+
bool isFastConfirm
|
|
123
|
+
) internal {
|
|
129
124
|
requireUnresolvedExists();
|
|
130
125
|
|
|
131
126
|
uint64 nodeNum = firstUnresolvedNode();
|
|
132
127
|
Node storage node = getNodeStorage(nodeNum);
|
|
133
128
|
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
if (!isFastConfirm) {
|
|
130
|
+
// Verify the block's deadline has passed
|
|
131
|
+
node.requirePastDeadline();
|
|
132
|
+
}
|
|
136
133
|
|
|
137
134
|
// Check that prev is latest confirmed
|
|
138
135
|
assert(node.prevNum == latestConfirmed());
|
|
139
136
|
|
|
140
137
|
Node storage prevNode = getNodeStorage(node.prevNum);
|
|
141
|
-
|
|
138
|
+
if (!isFastConfirm) {
|
|
139
|
+
prevNode.requirePastChildConfirmDeadline();
|
|
140
|
+
}
|
|
142
141
|
|
|
143
142
|
removeOldZombies(0);
|
|
144
143
|
|
|
@@ -155,6 +154,29 @@ abstract contract AbsRollupUserLogic is
|
|
|
155
154
|
confirmNode(nodeNum, blockHash, sendRoot);
|
|
156
155
|
}
|
|
157
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);
|
|
178
|
+
}
|
|
179
|
+
|
|
158
180
|
/**
|
|
159
181
|
* @notice Create a new stake
|
|
160
182
|
* @param depositAmount The amount of either eth or tokens staked
|
|
@@ -46,6 +46,9 @@ contract BridgeTester is Initializable, DelegateCallAware, IBridge, IEthBridge {
|
|
|
46
46
|
IOwnable public rollup;
|
|
47
47
|
address public sequencerInbox;
|
|
48
48
|
|
|
49
|
+
address public nativeToken;
|
|
50
|
+
uint8 public nativeTokenDecimals;
|
|
51
|
+
|
|
49
52
|
modifier onlyRollupOrOwner() {
|
|
50
53
|
if (msg.sender != address(rollup)) {
|
|
51
54
|
address rollupOwner = rollup.owner();
|