@arbitrum/nitro-contracts 2.0.0-beta.0 → 2.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- 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
package/build/contracts/src/test-helpers/OutboxWithoutOptTester.sol/OutboxWithoutOptTester.json
CHANGED
@@ -543,8 +543,8 @@
|
|
543
543
|
"type": "function"
|
544
544
|
}
|
545
545
|
],
|
546
|
-
"bytecode": "
|
547
|
-
"deployedBytecode": "
|
546
|
+
"bytecode": "0x60a06040523060805234801561001457600080fd5b5060805161130b61003060003960006106a2015261130b6000f3fe608060405234801561001057600080fd5b506004361061012b5760003560e01c806395fcea78116100ad578063c4d66de811610071578063c4d66de81461026d578063c75184df14610280578063cb23bcb5146102a0578063d5b5cc23146102b3578063e78cea92146102c657600080fd5b806395fcea78146101695780639f0c04bf14610216578063a04cee6014610229578063ae6dead71461023c578063b0f305371461025c57600080fd5b80635a129efe116100f45780635a129efe146101965780636ae71f12146101c957806372f2a8c7146101d157806380648b02146101d95780638515bc6a146101fe57600080fd5b80627436d31461013057806308635a9514610156578063119852711461016b578063288e5b10146101725780634654779014610185575b600080fd5b61014361013e366004610c79565b6102d9565b6040519081526020015b60405180910390f35b610169610164366004610d9e565b610316565b005b6000610143565b610169610180366004610e92565b610658565b6004546001600160801b0316610143565b6101b96101a4366004610f2d565b60026020526000908152604090205460ff1681565b604051901515815260200161014d565b610169610697565b600654610143565b6007546001600160a01b03165b6040516001600160a01b03909116815260200161014d565b600454600160801b90046001600160801b0316610143565b610143610224366004610f46565b61082c565b610169610237366004610fd4565b610871565b61014361024a366004610f2d565b60036020526000908152604090205481565b6005546001600160801b0316610143565b61016961027b366004610ff6565b6108b0565b610288600281565b6040516001600160801b03909116815260200161014d565b6000546101e6906001600160a01b031681565b6101436102c1366004610f2d565b610989565b6001546101e6906001600160a01b031681565b600061030e8484846040516020016102f391815260200190565b604051602081830303815290604052805190602001206109c5565b949350505050565b6000806103298a8a8a8a8a8a8a8a61082c565b905061036b8d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508f9250859150610a689050565b915060008a6001600160a01b03168a6001600160a01b03167f20af7f3bbfe38132b8900ae295cd9c8d1914be7052d061a511f3f728dab189648e6040516103b491815260200190565b60405180910390a450600060046040518060a00160405290816000820160009054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016000820160109054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016001820160009054906101000a90046001600160801b03166001600160801b03166001600160801b03168152602001600282015481526020016003820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152505090506040518060a00160405280896001600160801b03168152602001886001600160801b03168152602001876001600160801b031681526020018381526020018b6001600160a01b0316815250600460008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010160006101000a8154816001600160801b0302191690836001600160801b031602179055506060820151816002015560808201518160030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050506105e3898686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b6b92505050565b805160208201516001600160801b03918216600160801b91831691909102176004556040820151600580546001600160801b03191691909216179055606081015160065560800151600780546001600160a01b0319166001600160a01b03909216919091179055505050505050505050505050565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b5c1b195b595b9d1959608a1b60448201526064015b60405180910390fd5b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156107255760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b606482015260840161068e565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038054336001600160a01b0382161461078257604051631194af8760e11b81523360048201526001600160a01b038216602482015260440161068e565b600160009054906101000a90046001600160a01b03166001600160a01b031663cb23bcb56040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d057600080fd5b505afa1580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610808919061101a565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6000888888888888888860405160200161084d989796959493929190611037565b60405160208183030381529060405280519060200120905098975050505050505050565b60008281526003602052604080822083905551829184917fb4df3847300f076a369cd76d2314b470a1194d9e8a6bb97f1860aee88a5f67489190a35050565b6001546001600160a01b0316156108da57604051633bcd329760e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040805163cb23bcb560e01b8152905163cb23bcb591600480820192602092909190829003018186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610966919061101a565b600080546001600160a01b0319166001600160a01b039290921691909117905550565b60405162461bcd60e51b815260206004820152600e60248201526d1393d517d253541311535155115160921b604482015260009060640161068e565b82516000906101008111156109f857604051637ed6198f60e11b815260048101829052610100602482015260440161068e565b8260005b82811015610a5e576000878281518110610a1857610a18611090565b60200260200101519050816001901b871660001415610a4557826000528060205260406000209250610a55565b8060005282602052604060002092505b506001016109fc565b5095945050505050565b6000610100845110610a9257835160405163ab6a068360e01b815260040161068e91815260200190565b8351610a9f9060026111a2565b8310610ad6578284516002610ab491906111a2565b604051630b8a724b60e01b81526004810192909252602482015260440161068e565b6000610ae38585856102d9565b600081815260036020526040902054909150610b15576040516310e61af960e31b81526004810182905260240161068e565b60008481526002602052604090205460ff1615610b4857604051639715b8d360e01b81526004810185905260240161068e565b50506000828152600260205260409020805460ff19166001179055819392505050565b600154604051639e5d4c4960e01b815260009182916001600160a01b0390911690639e5d4c4990610ba4908890889088906004016111de565b600060405180830381600087803b158015610bbe57600080fd5b505af1158015610bd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bfa9190810190611227565b9150915081610c2c57805115610c135780518082602001fd5b604051631bb7daad60e11b815260040160405180910390fd5b5050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610c7157610c71610c33565b604052919050565b600080600060608486031215610c8e57600080fd5b83356001600160401b0380821115610ca557600080fd5b818601915086601f830112610cb957600080fd5b8135602082821115610ccd57610ccd610c33565b8160051b9250610cde818401610c49565b828152928401810192818101908a851115610cf857600080fd5b948201945b84861015610d1657853582529482019490820190610cfd565b9a918901359950506040909701359695505050505050565b6001600160a01b0381168114610d4357600080fd5b50565b8035610d5181610d2e565b919050565b60008083601f840112610d6857600080fd5b5081356001600160401b03811115610d7f57600080fd5b602083019150836020828501011115610d9757600080fd5b9250929050565b60008060008060008060008060008060006101208c8e031215610dc057600080fd5b8b356001600160401b0380821115610dd757600080fd5b818e0191508e601f830112610deb57600080fd5b813581811115610dfa57600080fd5b8f60208260051b8501011115610e0f57600080fd5b60208381019e50909c508e01359a50610e2a60408f01610d46565b9950610e3860608f01610d46565b985060808e0135975060a08e0135965060c08e0135955060e08e013594506101008e0135915080821115610e6b57600080fd5b50610e788e828f01610d56565b915080935050809150509295989b509295989b9093969950565b60008060008060008060008060006101008a8c031215610eb157600080fd5b8935985060208a0135610ec381610d2e565b975060408a0135610ed381610d2e565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a01356001600160401b03811115610f0a57600080fd5b610f168c828d01610d56565b915080935050809150509295985092959850929598565b600060208284031215610f3f57600080fd5b5035919050565b60008060008060008060008060e0898b031215610f6257600080fd5b8835610f6d81610d2e565b97506020890135610f7d81610d2e565b965060408901359550606089013594506080890135935060a0890135925060c08901356001600160401b03811115610fb457600080fd5b610fc08b828c01610d56565b999c989b5096995094979396929594505050565b60008060408385031215610fe757600080fd5b50508035926020909101359150565b60006020828403121561100857600080fd5b813561101381610d2e565b9392505050565b60006020828403121561102c57600080fd5b815161101381610d2e565b60006bffffffffffffffffffffffff19808b60601b168352808a60601b16601484015250876028830152866048830152856068830152846088830152828460a8840137506000910160a801908152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600181815b808511156110f75781600019048211156110dd576110dd6110a6565b808516156110ea57918102915b93841c93908002906110c1565b509250929050565b60008261110e5750600161119c565b8161111b5750600061119c565b8160018114611131576002811461113b57611157565b600191505061119c565b60ff84111561114c5761114c6110a6565b50506001821b61119c565b5060208310610133831016604e8410600b841016171561117a575081810a61119c565b61118483836110bc565b8060001904821115611198576111986110a6565b0290505b92915050565b600061101383836110ff565b60005b838110156111c95781810151838201526020016111b1565b838111156111d8576000848401525b50505050565b60018060a01b038416815282602082015260606040820152600082518060608401526112118160808501602087016111ae565b601f01601f191691909101608001949350505050565b6000806040838503121561123a57600080fd5b8251801515811461124a57600080fd5b60208401519092506001600160401b038082111561126757600080fd5b818501915085601f83011261127b57600080fd5b81518181111561128d5761128d610c33565b6112a0601f8201601f1916602001610c49565b91508082528660208285010111156112b757600080fd5b6112c88160208401602086016111ae565b508092505050925092905056fea2646970667358221220506d19e333877b7983601d5e422713d715ebbd702882a87b8237c40844bf50e764736f6c63430008090033",
|
547
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061012b5760003560e01c806395fcea78116100ad578063c4d66de811610071578063c4d66de81461026d578063c75184df14610280578063cb23bcb5146102a0578063d5b5cc23146102b3578063e78cea92146102c657600080fd5b806395fcea78146101695780639f0c04bf14610216578063a04cee6014610229578063ae6dead71461023c578063b0f305371461025c57600080fd5b80635a129efe116100f45780635a129efe146101965780636ae71f12146101c957806372f2a8c7146101d157806380648b02146101d95780638515bc6a146101fe57600080fd5b80627436d31461013057806308635a9514610156578063119852711461016b578063288e5b10146101725780634654779014610185575b600080fd5b61014361013e366004610c79565b6102d9565b6040519081526020015b60405180910390f35b610169610164366004610d9e565b610316565b005b6000610143565b610169610180366004610e92565b610658565b6004546001600160801b0316610143565b6101b96101a4366004610f2d565b60026020526000908152604090205460ff1681565b604051901515815260200161014d565b610169610697565b600654610143565b6007546001600160a01b03165b6040516001600160a01b03909116815260200161014d565b600454600160801b90046001600160801b0316610143565b610143610224366004610f46565b61082c565b610169610237366004610fd4565b610871565b61014361024a366004610f2d565b60036020526000908152604090205481565b6005546001600160801b0316610143565b61016961027b366004610ff6565b6108b0565b610288600281565b6040516001600160801b03909116815260200161014d565b6000546101e6906001600160a01b031681565b6101436102c1366004610f2d565b610989565b6001546101e6906001600160a01b031681565b600061030e8484846040516020016102f391815260200190565b604051602081830303815290604052805190602001206109c5565b949350505050565b6000806103298a8a8a8a8a8a8a8a61082c565b905061036b8d8d808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152508f9250859150610a689050565b915060008a6001600160a01b03168a6001600160a01b03167f20af7f3bbfe38132b8900ae295cd9c8d1914be7052d061a511f3f728dab189648e6040516103b491815260200190565b60405180910390a450600060046040518060a00160405290816000820160009054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016000820160109054906101000a90046001600160801b03166001600160801b03166001600160801b031681526020016001820160009054906101000a90046001600160801b03166001600160801b03166001600160801b03168152602001600282015481526020016003820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b03168152505090506040518060a00160405280896001600160801b03168152602001886001600160801b03168152602001876001600160801b031681526020018381526020018b6001600160a01b0316815250600460008201518160000160006101000a8154816001600160801b0302191690836001600160801b0316021790555060208201518160000160106101000a8154816001600160801b0302191690836001600160801b0316021790555060408201518160010160006101000a8154816001600160801b0302191690836001600160801b031602179055506060820151816002015560808201518160030160006101000a8154816001600160a01b0302191690836001600160a01b031602179055509050506105e3898686868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610b6b92505050565b805160208201516001600160801b03918216600160801b91831691909102176004556040820151600580546001600160801b03191691909216179055606081015160065560800151600780546001600160a01b0319166001600160a01b03909216919091179055505050505050505050505050565b60405162461bcd60e51b815260206004820152600f60248201526e139bdd081a5b5c1b195b595b9d1959608a1b60448201526064015b60405180910390fd5b306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614156107255760405162461bcd60e51b815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201526b19195b1959d85d1958d85b1b60a21b606482015260840161068e565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038054336001600160a01b0382161461078257604051631194af8760e11b81523360048201526001600160a01b038216602482015260440161068e565b600160009054906101000a90046001600160a01b03166001600160a01b031663cb23bcb56040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d057600080fd5b505afa1580156107e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610808919061101a565b600080546001600160a01b0319166001600160a01b03929092169190911790555050565b6000888888888888888860405160200161084d989796959493929190611037565b60405160208183030381529060405280519060200120905098975050505050505050565b60008281526003602052604080822083905551829184917fb4df3847300f076a369cd76d2314b470a1194d9e8a6bb97f1860aee88a5f67489190a35050565b6001546001600160a01b0316156108da57604051633bcd329760e21b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040805163cb23bcb560e01b8152905163cb23bcb591600480820192602092909190829003018186803b15801561092e57600080fd5b505afa158015610942573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610966919061101a565b600080546001600160a01b0319166001600160a01b039290921691909117905550565b60405162461bcd60e51b815260206004820152600e60248201526d1393d517d253541311535155115160921b604482015260009060640161068e565b82516000906101008111156109f857604051637ed6198f60e11b815260048101829052610100602482015260440161068e565b8260005b82811015610a5e576000878281518110610a1857610a18611090565b60200260200101519050816001901b871660001415610a4557826000528060205260406000209250610a55565b8060005282602052604060002092505b506001016109fc565b5095945050505050565b6000610100845110610a9257835160405163ab6a068360e01b815260040161068e91815260200190565b8351610a9f9060026111a2565b8310610ad6578284516002610ab491906111a2565b604051630b8a724b60e01b81526004810192909252602482015260440161068e565b6000610ae38585856102d9565b600081815260036020526040902054909150610b15576040516310e61af960e31b81526004810182905260240161068e565b60008481526002602052604090205460ff1615610b4857604051639715b8d360e01b81526004810185905260240161068e565b50506000828152600260205260409020805460ff19166001179055819392505050565b600154604051639e5d4c4960e01b815260009182916001600160a01b0390911690639e5d4c4990610ba4908890889088906004016111de565b600060405180830381600087803b158015610bbe57600080fd5b505af1158015610bd2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610bfa9190810190611227565b9150915081610c2c57805115610c135780518082602001fd5b604051631bb7daad60e11b815260040160405180910390fd5b5050505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b0381118282101715610c7157610c71610c33565b604052919050565b600080600060608486031215610c8e57600080fd5b83356001600160401b0380821115610ca557600080fd5b818601915086601f830112610cb957600080fd5b8135602082821115610ccd57610ccd610c33565b8160051b9250610cde818401610c49565b828152928401810192818101908a851115610cf857600080fd5b948201945b84861015610d1657853582529482019490820190610cfd565b9a918901359950506040909701359695505050505050565b6001600160a01b0381168114610d4357600080fd5b50565b8035610d5181610d2e565b919050565b60008083601f840112610d6857600080fd5b5081356001600160401b03811115610d7f57600080fd5b602083019150836020828501011115610d9757600080fd5b9250929050565b60008060008060008060008060008060006101208c8e031215610dc057600080fd5b8b356001600160401b0380821115610dd757600080fd5b818e0191508e601f830112610deb57600080fd5b813581811115610dfa57600080fd5b8f60208260051b8501011115610e0f57600080fd5b60208381019e50909c508e01359a50610e2a60408f01610d46565b9950610e3860608f01610d46565b985060808e0135975060a08e0135965060c08e0135955060e08e013594506101008e0135915080821115610e6b57600080fd5b50610e788e828f01610d56565b915080935050809150509295989b509295989b9093969950565b60008060008060008060008060006101008a8c031215610eb157600080fd5b8935985060208a0135610ec381610d2e565b975060408a0135610ed381610d2e565b965060608a0135955060808a0135945060a08a0135935060c08a0135925060e08a01356001600160401b03811115610f0a57600080fd5b610f168c828d01610d56565b915080935050809150509295985092959850929598565b600060208284031215610f3f57600080fd5b5035919050565b60008060008060008060008060e0898b031215610f6257600080fd5b8835610f6d81610d2e565b97506020890135610f7d81610d2e565b965060408901359550606089013594506080890135935060a0890135925060c08901356001600160401b03811115610fb457600080fd5b610fc08b828c01610d56565b999c989b5096995094979396929594505050565b60008060408385031215610fe757600080fd5b50508035926020909101359150565b60006020828403121561100857600080fd5b813561101381610d2e565b9392505050565b60006020828403121561102c57600080fd5b815161101381610d2e565b60006bffffffffffffffffffffffff19808b60601b168352808a60601b16601484015250876028830152866048830152856068830152846088830152828460a8840137506000910160a801908152979650505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600181815b808511156110f75781600019048211156110dd576110dd6110a6565b808516156110ea57918102915b93841c93908002906110c1565b509250929050565b60008261110e5750600161119c565b8161111b5750600061119c565b8160018114611131576002811461113b57611157565b600191505061119c565b60ff84111561114c5761114c6110a6565b50506001821b61119c565b5060208310610133831016604e8410600b841016171561117a575081810a61119c565b61118483836110bc565b8060001904821115611198576111986110a6565b0290505b92915050565b600061101383836110ff565b60005b838110156111c95781810151838201526020016111b1565b838111156111d8576000848401525b50505050565b60018060a01b038416815282602082015260606040820152600082518060608401526112118160808501602087016111ae565b601f01601f191691909101608001949350505050565b6000806040838503121561123a57600080fd5b8251801515811461124a57600080fd5b60208401519092506001600160401b038082111561126757600080fd5b818501915085601f83011261127b57600080fd5b81518181111561128d5761128d610c33565b6112a0601f8201601f1916602001610c49565b91508082528660208285010111156112b757600080fd5b6112c88160208401602086016111ae565b508092505050925092905056fea2646970667358221220506d19e333877b7983601d5e422713d715ebbd702882a87b8237c40844bf50e764736f6c63430008090033",
|
548
548
|
"linkReferences": {},
|
549
549
|
"deployedLinkReferences": {}
|
550
550
|
}
|
@@ -285,8 +285,8 @@
|
|
285
285
|
"type": "function"
|
286
286
|
}
|
287
287
|
],
|
288
|
-
"bytecode": "
|
289
|
-
"deployedBytecode": "
|
288
|
+
"bytecode": "0x60806040523480156200001157600080fd5b5060405162000b8838038062000b8883398101604081905262000034916200023f565b60408051808201825260098152682a32b9ba2a37b5b2b760b91b602080830191825283518085019094526002845261151560f21b9084015281519192916200007f9160039162000199565b5080516200009590600490602084019062000199565b505050620000aa3382620000b160201b60201c565b50620002bd565b6001600160a01b0382166200010c5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b806002600082825462000120919062000259565b90915550506001600160a01b038216600090815260208190526040812080548392906200014f90849062000259565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620001a79062000280565b90600052602060002090601f016020900481019282620001cb576000855562000216565b82601f10620001e657805160ff191683800117855562000216565b8280016001018555821562000216579182015b8281111562000216578251825591602001919060010190620001f9565b506200022492915062000228565b5090565b5b8082111562000224576000815560010162000229565b6000602082840312156200025257600080fd5b5051919050565b600082198211156200027b57634e487b7160e01b600052601160045260246000fd5b500190565b600181811c908216806200029557607f821691505b60208210811415620002b757634e487b7160e01b600052602260045260246000fd5b50919050565b6108bb80620002cd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c391906106f8565b60405180910390f35b6100df6100da366004610769565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610793565b61024a565b604051601281526020016100c3565b6100df610131366004610769565b61026e565b6100f36101443660046107cf565b6001600160a01b031660009081526020819052604090205490565b6100b66102ad565b6100df610175366004610769565b6102bc565b6100df610188366004610769565b610353565b6100f361019b3660046107f1565b610361565b6060600380546101af90610824565b80601f01602080910402602001604051908101604052809291908181526020018280546101db90610824565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561038c565b5060019392505050565b6000336102588582856104b0565b61026385858561052a565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061024090829086906102a890879061085f565b61038c565b6060600480546101af90610824565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103465760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610263828686840361038c565b60003361024081858561052a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103ee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161033d565b6001600160a01b03821661044f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161033d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104bc8484610361565b9050600019811461052457818110156105175760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161033d565b610524848484840361038c565b50505050565b6001600160a01b03831661058e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161033d565b6001600160a01b0382166105f05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161033d565b6001600160a01b038316600090815260208190526040902054818110156106685760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161033d565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061069f90849061085f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106eb91815260200190565b60405180910390a3610524565b600060208083528351808285015260005b8181101561072557858101830151858201604001528201610709565b81811115610737576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461076457600080fd5b919050565b6000806040838503121561077c57600080fd5b6107858361074d565b946020939093013593505050565b6000806000606084860312156107a857600080fd5b6107b18461074d565b92506107bf6020850161074d565b9150604084013590509250925092565b6000602082840312156107e157600080fd5b6107ea8261074d565b9392505050565b6000806040838503121561080457600080fd5b61080d8361074d565b915061081b6020840161074d565b90509250929050565b600181811c9082168061083857607f821691505b6020821081141561085957634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561088057634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212205520cebf912a7b37ad2078443ea206cc6187d18972e4366e20d773c71e326a0464736f6c63430008090033",
|
289
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b411461015f578063a457c2d714610167578063a9059cbb1461017a578063dd62ed3e1461018d57600080fd5b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101a0565b6040516100c391906106f8565b60405180910390f35b6100df6100da366004610769565b610232565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610793565b61024a565b604051601281526020016100c3565b6100df610131366004610769565b61026e565b6100f36101443660046107cf565b6001600160a01b031660009081526020819052604090205490565b6100b66102ad565b6100df610175366004610769565b6102bc565b6100df610188366004610769565b610353565b6100f361019b3660046107f1565b610361565b6060600380546101af90610824565b80601f01602080910402602001604051908101604052809291908181526020018280546101db90610824565b80156102285780601f106101fd57610100808354040283529160200191610228565b820191906000526020600020905b81548152906001019060200180831161020b57829003601f168201915b5050505050905090565b60003361024081858561038c565b5060019392505050565b6000336102588582856104b0565b61026385858561052a565b506001949350505050565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919061024090829086906102a890879061085f565b61038c565b6060600480546101af90610824565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909190838110156103465760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b610263828686840361038c565b60003361024081858561052a565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b0383166103ee5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161033d565b6001600160a01b03821661044f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161033d565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60006104bc8484610361565b9050600019811461052457818110156105175760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161033d565b610524848484840361038c565b50505050565b6001600160a01b03831661058e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161033d565b6001600160a01b0382166105f05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161033d565b6001600160a01b038316600090815260208190526040902054818110156106685760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161033d565b6001600160a01b0380851660009081526020819052604080822085850390559185168152908120805484929061069f90849061085f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516106eb91815260200190565b60405180910390a3610524565b600060208083528351808285015260005b8181101561072557858101830151858201604001528201610709565b81811115610737576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b038116811461076457600080fd5b919050565b6000806040838503121561077c57600080fd5b6107858361074d565b946020939093013593505050565b6000806000606084860312156107a857600080fd5b6107b18461074d565b92506107bf6020850161074d565b9150604084013590509250925092565b6000602082840312156107e157600080fd5b6107ea8261074d565b9392505050565b6000806040838503121561080457600080fd5b61080d8361074d565b915061081b6020840161074d565b90509250929050565b600181811c9082168061083857607f821691505b6020821081141561085957634e487b7160e01b600052602260045260246000fd5b50919050565b6000821982111561088057634e487b7160e01b600052601160045260246000fd5b50019056fea26469706673582212205520cebf912a7b37ad2078443ea206cc6187d18972e4366e20d773c71e326a0464736f6c63430008090033",
|
290
290
|
"linkReferences": {},
|
291
291
|
"deployedLinkReferences": {}
|
292
292
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@arbitrum/nitro-contracts",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.1",
|
4
4
|
"description": "Layer 2 precompiles and rollup for Arbitrum Nitro",
|
5
5
|
"author": "Offchain Labs, Inc.",
|
6
6
|
"license": "BUSL-1.1",
|
@@ -26,6 +26,7 @@
|
|
26
26
|
"build:forge:sol": "forge build --skip *.yul",
|
27
27
|
"build:forge:yul": "FOUNDRY_PROFILE=yul forge build --skip *.sol",
|
28
28
|
"build:forge": "yarn build:forge:sol && yarn build:forge:yul",
|
29
|
+
"contract:size": "STRICT=true hardhat size-contracts",
|
29
30
|
"lint:test": "eslint ./test",
|
30
31
|
"solhint": "solhint -f table src/**/*.sol",
|
31
32
|
"prettier:solidity": "prettier --write src/**/*.sol",
|
@@ -42,7 +43,8 @@
|
|
42
43
|
"deploy-factory": "hardhat run scripts/deployment.ts",
|
43
44
|
"deploy-eth-rollup": "hardhat run scripts/createEthRollup.ts",
|
44
45
|
"deploy-erc20-rollup": "hardhat run scripts/createERC20Rollup.ts",
|
45
|
-
"create-rollup-testnode": "hardhat run scripts/local-deployment/deployCreatorAndCreateRollup.ts"
|
46
|
+
"create-rollup-testnode": "hardhat run scripts/local-deployment/deployCreatorAndCreateRollup.ts",
|
47
|
+
"deploy-cachemanager-testnode": "hardhat run scripts/local-deployment/deployCacheManager.ts"
|
46
48
|
},
|
47
49
|
"dependencies": {
|
48
50
|
"@offchainlabs/upgrade-executor": "1.1.0-beta.0",
|
@@ -53,7 +55,7 @@
|
|
53
55
|
},
|
54
56
|
"private": false,
|
55
57
|
"devDependencies": {
|
56
|
-
"@arbitrum/sdk": "^3.1
|
58
|
+
"@arbitrum/sdk": "^3.4.1",
|
57
59
|
"@ethersproject/providers": "^5.7.2",
|
58
60
|
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers@^0.3.0-beta.13",
|
59
61
|
"@nomiclabs/hardhat-etherscan": "^3.1.0",
|
@@ -77,6 +79,7 @@
|
|
77
79
|
"ethereum-waffle": "^4.0.10",
|
78
80
|
"ethers": "^5.5.4",
|
79
81
|
"hardhat": "^2.17.2",
|
82
|
+
"hardhat-contract-sizer": "^2.10.0",
|
80
83
|
"hardhat-deploy": "^0.11.37",
|
81
84
|
"hardhat-gas-reporter": "^1.0.9",
|
82
85
|
"hardhat-ignore-warnings": "^0.2.9",
|
package/src/bridge/AbsInbox.sol
CHANGED
@@ -231,11 +231,14 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
|
|
231
231
|
uint256 amount,
|
232
232
|
bytes calldata data
|
233
233
|
) internal returns (uint256) {
|
234
|
-
//
|
235
|
-
|
234
|
+
// Ensure the user's deposit alone will make submission succeed.
|
235
|
+
// In case of native token having non-18 decimals: 'amount' is denominated in native token's decimals. All other
|
236
|
+
// value params - l2CallValue, maxSubmissionCost and maxFeePerGas are denominated in child chain's native 18 decimals.
|
237
|
+
uint256 amountToBeMintedOnL2 = _fromNativeTo18Decimals(amount);
|
238
|
+
if (amountToBeMintedOnL2 < (maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas)) {
|
236
239
|
revert InsufficientValue(
|
237
240
|
maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas,
|
238
|
-
|
241
|
+
amountToBeMintedOnL2
|
239
242
|
);
|
240
243
|
}
|
241
244
|
|
@@ -308,7 +311,7 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
|
|
308
311
|
abi.encodePacked(
|
309
312
|
uint256(uint160(to)),
|
310
313
|
l2CallValue,
|
311
|
-
amount,
|
314
|
+
_fromNativeTo18Decimals(amount),
|
312
315
|
maxSubmissionCost,
|
313
316
|
uint256(uint160(excessFeeRefundAddress)),
|
314
317
|
uint256(uint160(callValueRefundAddress)),
|
@@ -347,6 +350,15 @@ abstract contract AbsInbox is DelegateCallAware, PausableUpgradeable, IInboxBase
|
|
347
350
|
virtual
|
348
351
|
returns (uint256);
|
349
352
|
|
353
|
+
/// @notice get amount of ETH/token to mint on child chain based on provided value.
|
354
|
+
/// In case of ETH-based rollup this amount will always equal the provided
|
355
|
+
/// value. In case of ERC20-based rollup where native token has number of
|
356
|
+
/// decimals different thatn 18, amount will be re-adjusted to reflect 18
|
357
|
+
/// decimals used for native currency on child chain.
|
358
|
+
/// @dev provided value has to be less than 'type(uint256).max/10**(18-decimalsIn)'
|
359
|
+
/// or otherwise it will overflow.
|
360
|
+
function _fromNativeTo18Decimals(uint256 value) internal view virtual returns (uint256);
|
361
|
+
|
350
362
|
/**
|
351
363
|
* @dev This empty reserved space is put in place to allow future versions to add new
|
352
364
|
* variables without shifting down storage in the inheritance chain.
|
package/src/bridge/AbsOutbox.sol
CHANGED
@@ -205,6 +205,10 @@ abstract contract AbsOutbox is DelegateCallAware, IOutbox {
|
|
205
205
|
) internal {
|
206
206
|
emit OutBoxTransactionExecuted(to, l2Sender, 0, outputId);
|
207
207
|
|
208
|
+
// get amount to unlock based on provided value. It might differ in case
|
209
|
+
// of native token which uses number of decimals different than 18
|
210
|
+
uint256 amountToUnlock = _getAmountToUnlock(value);
|
211
|
+
|
208
212
|
// we temporarily store the previous values so the outbox can naturally
|
209
213
|
// unwind itself when there are nested calls to `executeTransaction`
|
210
214
|
L2ToL1Context memory prevContext = context;
|
@@ -215,11 +219,11 @@ abstract contract AbsOutbox is DelegateCallAware, IOutbox {
|
|
215
219
|
l1Block: uint96(l1Block),
|
216
220
|
timestamp: uint128(l2Timestamp),
|
217
221
|
outputId: bytes32(outputId),
|
218
|
-
withdrawalAmount: _amountToSetInContext(
|
222
|
+
withdrawalAmount: _amountToSetInContext(amountToUnlock)
|
219
223
|
});
|
220
224
|
|
221
225
|
// set and reset vars around execution so they remain valid during call
|
222
|
-
executeBridgeCall(to,
|
226
|
+
executeBridgeCall(to, amountToUnlock, data);
|
223
227
|
|
224
228
|
context = prevContext;
|
225
229
|
}
|
@@ -311,6 +315,11 @@ abstract contract AbsOutbox is DelegateCallAware, IOutbox {
|
|
311
315
|
/// @return default 'amount' in case of ERC20-based rollup is type(uint256).max, or 0 in case of ETH-based rollup
|
312
316
|
function _defaultContextAmount() internal pure virtual returns (uint256);
|
313
317
|
|
318
|
+
/// @notice based on provided value, get amount of ETH/token to unlock. In case of ETH-based rollup this amount
|
319
|
+
/// will always equal the provided value. In case of ERC20-based rollup, amount will be re-adjusted to
|
320
|
+
/// reflect the number of decimals used by native token, in case it is different than 18.
|
321
|
+
function _getAmountToUnlock(uint256 value) internal view virtual returns (uint256);
|
322
|
+
|
314
323
|
/// @notice value to be set for 'amount' field in L2ToL1Context during L2 to L1 transaction execution.
|
315
324
|
/// In case of ERC20-based rollup this is the amount of native token being withdrawn. In case of standard ETH-based
|
316
325
|
/// rollup this amount shall always be 0, because amount of ETH being withdrawn can be read from msg.value.
|
@@ -7,9 +7,18 @@ pragma solidity ^0.8.4;
|
|
7
7
|
import "./AbsBridge.sol";
|
8
8
|
import "./IERC20Bridge.sol";
|
9
9
|
import "../libraries/AddressAliasHelper.sol";
|
10
|
-
import {
|
11
|
-
|
12
|
-
|
10
|
+
import {
|
11
|
+
InvalidTokenSet,
|
12
|
+
CallTargetNotAllowed,
|
13
|
+
CallNotAllowed,
|
14
|
+
NativeTokenDecimalsTooLarge
|
15
|
+
} from "../libraries/Error.sol";
|
16
|
+
import {DecimalsConverterHelper} from "../libraries/DecimalsConverterHelper.sol";
|
17
|
+
import {MAX_ALLOWED_NATIVE_TOKEN_DECIMALS} from "../libraries/Constants.sol";
|
18
|
+
|
19
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
20
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
21
|
+
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
13
22
|
|
14
23
|
/**
|
15
24
|
* @title Staging ground for incoming and outgoing messages
|
@@ -20,6 +29,8 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
20
29
|
* - The token must only be transferrable via a call to the token address itself
|
21
30
|
* - The token must only be able to set allowance via a call to the token address itself
|
22
31
|
* - The token must not have a callback on transfer, and more generally a user must not be able to make a transfer to themselves revert
|
32
|
+
* - The token must have a max of 2^256 - 1 wei total supply unscaled
|
33
|
+
* - The token must have a max of 2^256 - 1 wei total supply when scaled to 18 decimals
|
23
34
|
*/
|
24
35
|
contract ERC20Bridge is AbsBridge, IERC20Bridge {
|
25
36
|
using SafeERC20 for IERC20;
|
@@ -27,12 +38,28 @@ contract ERC20Bridge is AbsBridge, IERC20Bridge {
|
|
27
38
|
/// @inheritdoc IERC20Bridge
|
28
39
|
address public nativeToken;
|
29
40
|
|
41
|
+
/// @inheritdoc IERC20Bridge
|
42
|
+
uint8 public nativeTokenDecimals;
|
43
|
+
|
30
44
|
/// @inheritdoc IERC20Bridge
|
31
45
|
function initialize(IOwnable rollup_, address nativeToken_) external initializer onlyDelegated {
|
32
46
|
if (nativeToken_ == address(0)) revert InvalidTokenSet(nativeToken_);
|
33
47
|
nativeToken = nativeToken_;
|
34
48
|
_activeOutbox = EMPTY_ACTIVEOUTBOX;
|
35
49
|
rollup = rollup_;
|
50
|
+
|
51
|
+
// store number of decimals used by native token
|
52
|
+
try ERC20(nativeToken_).decimals() returns (uint8 decimals) {
|
53
|
+
if (decimals > MAX_ALLOWED_NATIVE_TOKEN_DECIMALS) {
|
54
|
+
revert NativeTokenDecimalsTooLarge(decimals);
|
55
|
+
}
|
56
|
+
nativeTokenDecimals = decimals;
|
57
|
+
} catch {
|
58
|
+
// decimal is not part of the ERC20 spec
|
59
|
+
// assume it have 0 decimals if it does not have decimals() method
|
60
|
+
// we do this to align with the token bridge behavior
|
61
|
+
nativeTokenDecimals = 0;
|
62
|
+
}
|
36
63
|
}
|
37
64
|
|
38
65
|
/// @inheritdoc IERC20Bridge
|
@@ -9,9 +9,14 @@ import "./IERC20Inbox.sol";
|
|
9
9
|
import "./IERC20Bridge.sol";
|
10
10
|
import "../libraries/AddressAliasHelper.sol";
|
11
11
|
import {L1MessageType_ethDeposit} from "../libraries/MessageTypes.sol";
|
12
|
-
import "
|
12
|
+
import {AmountTooLarge} from "../libraries/Error.sol";
|
13
|
+
import {MAX_UPSCALE_AMOUNT} from "../libraries/Constants.sol";
|
14
|
+
|
15
|
+
import {DecimalsConverterHelper} from "../libraries/DecimalsConverterHelper.sol";
|
16
|
+
|
17
|
+
import {AddressUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
|
13
18
|
import {IERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
14
|
-
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
19
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
15
20
|
|
16
21
|
/**
|
17
22
|
* @title Inbox for user and contract originated messages
|
@@ -33,7 +38,7 @@ contract ERC20Inbox is AbsInbox, IERC20Inbox {
|
|
33
38
|
|
34
39
|
// inbox holds native token in transit used to pay for retryable tickets, approve bridge to use it
|
35
40
|
address nativeToken = IERC20Bridge(address(bridge)).nativeToken();
|
36
|
-
IERC20(nativeToken).
|
41
|
+
IERC20(nativeToken).safeApprove(address(bridge), type(uint256).max);
|
37
42
|
}
|
38
43
|
|
39
44
|
/// @inheritdoc IERC20Inbox
|
@@ -46,11 +51,12 @@ contract ERC20Inbox is AbsInbox, IERC20Inbox {
|
|
46
51
|
dest = AddressAliasHelper.applyL1ToL2Alias(msg.sender);
|
47
52
|
}
|
48
53
|
|
54
|
+
uint256 amountToMintOnL2 = _fromNativeTo18Decimals(amount);
|
49
55
|
return
|
50
56
|
_deliverMessage(
|
51
57
|
L1MessageType_ethDeposit,
|
52
58
|
msg.sender,
|
53
|
-
abi.encodePacked(dest,
|
59
|
+
abi.encodePacked(dest, amountToMintOnL2),
|
54
60
|
amount
|
55
61
|
);
|
56
62
|
}
|
@@ -141,4 +147,22 @@ contract ERC20Inbox is AbsInbox, IERC20Inbox {
|
|
141
147
|
tokenAmount
|
142
148
|
);
|
143
149
|
}
|
150
|
+
|
151
|
+
/// @inheritdoc AbsInbox
|
152
|
+
function _fromNativeTo18Decimals(uint256 value) internal view override returns (uint256) {
|
153
|
+
// In order to keep compatibility of child chain's native currency with external 3rd party tooling we
|
154
|
+
// expect 18 decimals to be always used for native currency. If native token uses different number of
|
155
|
+
// decimals then here it will be normalized to 18. Keep in mind, when withdrawing from child chain back
|
156
|
+
// to parent chain then the amount has to match native token's granularity, otherwise it will be rounded
|
157
|
+
// down.
|
158
|
+
uint8 nativeTokenDecimals = IERC20Bridge(address(bridge)).nativeTokenDecimals();
|
159
|
+
|
160
|
+
// Also make sure that inflated amount does not overflow uint256
|
161
|
+
if (nativeTokenDecimals < 18) {
|
162
|
+
if (value > MAX_UPSCALE_AMOUNT) {
|
163
|
+
revert AmountTooLarge(value);
|
164
|
+
}
|
165
|
+
}
|
166
|
+
return DecimalsConverterHelper.adjustDecimals(value, nativeTokenDecimals, 18);
|
167
|
+
}
|
144
168
|
}
|
@@ -5,9 +5,11 @@
|
|
5
5
|
pragma solidity ^0.8.4;
|
6
6
|
|
7
7
|
import "./AbsOutbox.sol";
|
8
|
+
import {IERC20Bridge} from "./IERC20Bridge.sol";
|
9
|
+
import {DecimalsConverterHelper} from "../libraries/DecimalsConverterHelper.sol";
|
8
10
|
|
9
11
|
contract ERC20Outbox is AbsOutbox {
|
10
|
-
|
12
|
+
/// @dev it is assumed that arb-os never assigns this value to a valid leaf to be redeemed
|
11
13
|
uint256 private constant AMOUNT_DEFAULT_CONTEXT = type(uint256).max;
|
12
14
|
|
13
15
|
function l2ToL1WithdrawalAmount() external view returns (uint256) {
|
@@ -22,6 +24,13 @@ contract ERC20Outbox is AbsOutbox {
|
|
22
24
|
return AMOUNT_DEFAULT_CONTEXT;
|
23
25
|
}
|
24
26
|
|
27
|
+
/// @inheritdoc AbsOutbox
|
28
|
+
function _getAmountToUnlock(uint256 value) internal view override returns (uint256) {
|
29
|
+
uint8 nativeTokenDecimals = IERC20Bridge(address(bridge)).nativeTokenDecimals();
|
30
|
+
// this might revert due to overflow, but we assume the token supply is less than 2^256
|
31
|
+
return DecimalsConverterHelper.adjustDecimals(value, 18, nativeTokenDecimals);
|
32
|
+
}
|
33
|
+
|
25
34
|
/// @inheritdoc AbsOutbox
|
26
35
|
function _amountToSetInContext(uint256 value) internal pure override returns (uint256) {
|
27
36
|
// native token withdrawal amount which can be fetched from context
|
@@ -19,6 +19,13 @@ interface IERC20Bridge is IBridge {
|
|
19
19
|
*/
|
20
20
|
function nativeToken() external view returns (address);
|
21
21
|
|
22
|
+
/**
|
23
|
+
* @dev number of decimals used by the native token
|
24
|
+
* This is set on bridge initialization using nativeToken.decimals()
|
25
|
+
* If the token does not have decimals() method, we assume it have 0 decimals
|
26
|
+
*/
|
27
|
+
function nativeTokenDecimals() external view returns (uint8);
|
28
|
+
|
22
29
|
/**
|
23
30
|
* @dev Enqueue a message in the delayed inbox accumulator.
|
24
31
|
* These messages are later sequenced in the SequencerInbox, either
|
@@ -20,11 +20,12 @@ interface IERC20Inbox is IInboxBase {
|
|
20
20
|
* @notice Put a message in the L2 inbox that can be reexecuted for some fixed amount of time if it reverts
|
21
21
|
* @dev all tokenTotalFeeAmount will be deposited to callValueRefundAddress on L2
|
22
22
|
* @dev Gas limit and maxFeePerGas should not be set to 1 as that is used to trigger the RetryableData error
|
23
|
+
* @dev In case of native token having non-18 decimals: tokenTotalFeeAmount is denominated in native token's decimals. All other value params - l2CallValue, maxSubmissionCost and maxFeePerGas are denominated in child chain's native 18 decimals.
|
23
24
|
* @param to destination L2 contract address
|
24
25
|
* @param l2CallValue call value for retryable L2 message
|
25
26
|
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
|
26
|
-
* @param excessFeeRefundAddress
|
27
|
-
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
27
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost. In case this address is a contract, funds will be received in its alias on L2.
|
28
|
+
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled. In case this address is a contract, funds will be received in its alias on L2.
|
28
29
|
* @param gasLimit Max gas deducted from user's L2 balance to cover L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
29
30
|
* @param maxFeePerGas price bid for L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
30
31
|
* @param tokenTotalFeeAmount amount of fees to be deposited in native token to cover for retryable ticket cost
|
@@ -53,7 +54,7 @@ interface IERC20Inbox is IInboxBase {
|
|
53
54
|
* @param to destination L2 contract address
|
54
55
|
* @param l2CallValue call value for retryable L2 message
|
55
56
|
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
|
56
|
-
* @param excessFeeRefundAddress
|
57
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost
|
57
58
|
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
58
59
|
* @param gasLimit Max gas deducted from user's L2 balance to cover L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
59
60
|
* @param maxFeePerGas price bid for L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
package/src/bridge/IInbox.sol
CHANGED
@@ -77,8 +77,8 @@ interface IInbox is IInboxBase {
|
|
77
77
|
* @param to destination L2 contract address
|
78
78
|
* @param l2CallValue call value for retryable L2 message
|
79
79
|
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
|
80
|
-
* @param excessFeeRefundAddress
|
81
|
-
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
80
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost. In case this address is a contract, funds will be received in its alias on L2.
|
81
|
+
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled. In case this address is a contract, funds will be received in its alias on L2.
|
82
82
|
* @param gasLimit Max gas deducted from user's L2 balance to cover L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
83
83
|
* @param maxFeePerGas price bid for L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
84
84
|
* @param data ABI encoded data of L2 message
|
@@ -105,7 +105,7 @@ interface IInbox is IInboxBase {
|
|
105
105
|
* @param to destination L2 contract address
|
106
106
|
* @param l2CallValue call value for retryable L2 message
|
107
107
|
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
|
108
|
-
* @param excessFeeRefundAddress
|
108
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost
|
109
109
|
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
110
110
|
* @param gasLimit Max gas deducted from user's L2 balance to cover L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
111
111
|
* @param maxFeePerGas price bid for L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
package/src/bridge/Inbox.sol
CHANGED
@@ -238,7 +238,7 @@ contract Inbox is AbsInbox, IInbox {
|
|
238
238
|
* @param to destination L2 contract address
|
239
239
|
* @param l2CallValue call value for retryable L2 message
|
240
240
|
* @param maxSubmissionCost Max gas deducted from user's L2 balance to cover base submission fee
|
241
|
-
* @param excessFeeRefundAddress
|
241
|
+
* @param excessFeeRefundAddress the address which receives the difference between execution fee paid and the actual execution cost
|
242
242
|
* @param callValueRefundAddress l2Callvalue gets credited here on L2 if retryable txn times out or gets cancelled
|
243
243
|
* @param gasLimit Max gas deducted from user's L2 balance to cover L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
244
244
|
* @param maxFeePerGas price bid for L2 execution. Should not be set to 1 (magic value used to trigger the RetryableData error)
|
@@ -343,4 +343,9 @@ contract Inbox is AbsInbox, IInbox {
|
|
343
343
|
messageDataHash
|
344
344
|
);
|
345
345
|
}
|
346
|
+
|
347
|
+
/// @inheritdoc AbsInbox
|
348
|
+
function _fromNativeTo18Decimals(uint256 value) internal pure override returns (uint256) {
|
349
|
+
return value;
|
350
|
+
}
|
346
351
|
}
|
package/src/bridge/Outbox.sol
CHANGED
@@ -14,6 +14,11 @@ contract Outbox is AbsOutbox {
|
|
14
14
|
return 0;
|
15
15
|
}
|
16
16
|
|
17
|
+
/// @inheritdoc AbsOutbox
|
18
|
+
function _getAmountToUnlock(uint256 value) internal pure override returns (uint256) {
|
19
|
+
return value;
|
20
|
+
}
|
21
|
+
|
17
22
|
/// @inheritdoc AbsOutbox
|
18
23
|
function _amountToSetInContext(uint256) internal pure override returns (uint256) {
|
19
24
|
// In ETH-based chains withdrawal amount can be read from msg.value. For that reason
|