@arbitrum/nitro-contracts 1.1.0-alpha.1 → 1.1.0-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +114 -0
- package/README.md +2 -2
- package/build/types/@openzeppelin/contracts/access/Ownable.ts +175 -0
- package/build/types/@openzeppelin/contracts/access/index.ts +4 -0
- package/build/types/@openzeppelin/contracts/index.ts +11 -0
- package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable.ts +87 -0
- package/build/types/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +4 -0
- package/build/types/@openzeppelin/contracts/interfaces/index.ts +5 -0
- package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +108 -0
- package/build/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.ts +108 -0
- package/build/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
- package/build/types/@openzeppelin/contracts/proxy/Proxy.ts +55 -0
- package/build/types/@openzeppelin/contracts/proxy/beacon/IBeacon.ts +87 -0
- package/build/types/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.ts +239 -0
- package/build/types/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
- package/build/types/@openzeppelin/contracts/proxy/index.ts +12 -0
- package/build/types/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.ts +359 -0
- package/build/types/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.ts +278 -0
- package/build/types/@openzeppelin/contracts/proxy/transparent/index.ts +5 -0
- package/build/types/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.ts +216 -0
- package/build/types/@openzeppelin/contracts/proxy/utils/index.ts +4 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/ERC20.ts +444 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/IERC20.ts +322 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.ts +507 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.ts +364 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/index.ts +9 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply.ts +507 -0
- package/build/types/@openzeppelin/contracts/token/ERC20/presets/index.ts +4 -0
- package/build/types/@openzeppelin/contracts/token/index.ts +5 -0
- package/build/types/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.ts +175 -0
- package/build/types/@openzeppelin/contracts-upgradeable/access/index.ts +4 -0
- package/build/types/@openzeppelin/contracts-upgradeable/index.ts +9 -0
- package/build/types/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.ts +111 -0
- package/build/types/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
- package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.ts +322 -0
- package/build/types/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +4 -0
- package/build/types/@openzeppelin/contracts-upgradeable/token/index.ts +5 -0
- package/build/types/@openzeppelin/index.ts +7 -0
- package/build/types/common.ts +44 -0
- package/build/types/factories/@openzeppelin/contracts/access/Ownable__factory.ts +78 -0
- package/build/types/factories/@openzeppelin/contracts/access/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts/index.ts +7 -0
- package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/IERC1822Proxiable__factory.ts +39 -0
- package/build/types/factories/@openzeppelin/contracts/interfaces/draft-IERC1822.sol/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts/interfaces/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +146 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade__factory.ts +71 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +5 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/Proxy__factory.ts +31 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/beacon/IBeacon__factory.ts +39 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon__factory.ts +169 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/beacon/index.ts +5 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/index.ts +8 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/transparent/ProxyAdmin__factory.ts +211 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy__factory.ts +228 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/transparent/index.ts +5 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/utils/UUPSUpgradeable__factory.ts +115 -0
- package/build/types/factories/@openzeppelin/contracts/proxy/utils/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory.ts +349 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/IERC20__factory.ts +206 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable__factory.ts +327 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata__factory.ts +248 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/extensions/index.ts +5 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/index.ts +7 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/ERC20PresetFixedSupply__factory.ts +420 -0
- package/build/types/factories/@openzeppelin/contracts/token/ERC20/presets/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts/token/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable__factory.ts +78 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/access/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/index.ts +6 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable__factory.ts +65 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/security/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable__factory.ts +209 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/token/ERC20/index.ts +4 -0
- package/build/types/factories/@openzeppelin/contracts-upgradeable/token/index.ts +4 -0
- package/build/types/factories/@openzeppelin/index.ts +5 -0
- package/build/types/factories/index.ts +5 -0
- package/build/types/factories/src/bridge/AbsBridge__factory.ts +612 -0
- package/build/types/factories/src/bridge/AbsInbox__factory.ts +455 -0
- package/build/types/factories/src/bridge/AbsOutbox__factory.ts +561 -0
- package/build/types/factories/src/bridge/Bridge__factory.ts +695 -0
- package/build/types/factories/src/bridge/ERC20Bridge__factory.ts +746 -0
- package/build/types/factories/src/bridge/ERC20Inbox__factory.ts +719 -0
- package/build/types/factories/src/bridge/ERC20Outbox__factory.ts +610 -0
- package/build/types/factories/src/bridge/IBridge__factory.ts +508 -0
- package/build/types/factories/src/bridge/IDelayedMessageProvider__factory.ts +62 -0
- package/build/types/factories/src/bridge/IERC20Bridge__factory.ts +576 -0
- package/build/types/factories/src/bridge/IERC20Inbox__factory.ts +461 -0
- package/build/types/factories/src/bridge/IEthBridge__factory.ts +553 -0
- package/build/types/factories/src/bridge/IEthInbox__factory.ts +653 -0
- package/build/types/factories/src/bridge/IInbox__factory.ts +318 -0
- package/build/types/factories/src/bridge/IOutbox__factory.ts +431 -0
- package/build/types/factories/src/bridge/IOwnable__factory.ts +36 -0
- package/build/types/factories/src/bridge/ISequencerInbox__factory.ts +666 -0
- package/build/types/factories/src/bridge/Inbox__factory.ts +999 -0
- package/build/types/factories/src/bridge/Outbox__factory.ts +591 -0
- package/build/types/factories/src/bridge/SequencerInbox__factory.ts +865 -0
- package/build/types/factories/src/bridge/index.ts +23 -0
- package/build/types/factories/src/challenge/ChallengeManager__factory.ts +720 -0
- package/build/types/factories/src/challenge/IChallengeManager__factory.ts +401 -0
- package/build/types/factories/src/challenge/IChallengeResultReceiver__factory.ts +53 -0
- package/build/types/factories/src/challenge/index.ts +6 -0
- package/build/types/factories/src/index.ts +12 -0
- package/build/types/factories/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy__factory.ts +128 -0
- package/build/types/factories/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade__factory.ts +88 -0
- package/build/types/factories/src/libraries/AdminFallbackProxy.sol/index.ts +5 -0
- package/build/types/factories/src/libraries/DoubleLogicUUPSUpgradeable__factory.ts +163 -0
- package/build/types/factories/src/libraries/IGasRefunder__factory.ts +55 -0
- package/build/types/factories/src/libraries/UUPSNotUpgradeable__factory.ts +97 -0
- package/build/types/factories/src/libraries/index.ts +7 -0
- package/build/types/factories/src/mocks/BridgeStub__factory.ts +612 -0
- package/build/types/factories/src/mocks/BridgeUnproxied__factory.ts +706 -0
- package/build/types/factories/src/mocks/InboxStub__factory.ts +702 -0
- package/build/types/factories/src/mocks/MockResultReceiver__factory.ts +244 -0
- package/build/types/factories/src/mocks/ProxyAdminForBinding__factory.ts +215 -0
- package/build/types/factories/src/mocks/SequencerInboxStub__factory.ts +938 -0
- package/build/types/factories/src/mocks/SimpleProxy__factory.ts +83 -0
- package/build/types/factories/src/mocks/Simple__factory.ts +287 -0
- package/build/types/factories/src/mocks/SingleExecutionChallenge__factory.ts +823 -0
- package/build/types/factories/src/mocks/TimedOutChallengeManager__factory.ts +724 -0
- package/build/types/factories/src/mocks/index.ts +13 -0
- package/build/types/factories/src/node-interface/NodeInterfaceDebug__factory.ts +82 -0
- package/build/types/factories/src/node-interface/NodeInterface__factory.ts +301 -0
- package/build/types/factories/src/node-interface/index.ts +5 -0
- package/build/types/factories/src/osp/HashProofHelper__factory.ts +216 -0
- package/build/types/factories/src/osp/IOneStepProofEntry__factory.ts +72 -0
- package/build/types/factories/src/osp/IOneStepProver__factory.ts +492 -0
- package/build/types/factories/src/osp/OneStepProofEntry__factory.ts +206 -0
- package/build/types/factories/src/osp/OneStepProver0__factory.ts +528 -0
- package/build/types/factories/src/osp/OneStepProverHostIo__factory.ts +528 -0
- package/build/types/factories/src/osp/OneStepProverMath__factory.ts +528 -0
- package/build/types/factories/src/osp/OneStepProverMemory__factory.ts +528 -0
- package/build/types/factories/src/osp/index.ts +11 -0
- package/build/types/factories/src/precompiles/ArbAddressTable__factory.ts +163 -0
- package/build/types/factories/src/precompiles/ArbAggregator__factory.ts +163 -0
- package/build/types/factories/src/precompiles/ArbDebug__factory.ts +208 -0
- package/build/types/factories/src/precompiles/ArbFunctionTable__factory.ts +92 -0
- package/build/types/factories/src/precompiles/ArbGasInfo__factory.ts +339 -0
- package/build/types/factories/src/precompiles/ArbInfo__factory.ts +64 -0
- package/build/types/factories/src/precompiles/ArbOwnerPublic__factory.ts +84 -0
- package/build/types/factories/src/precompiles/ArbOwner__factory.ts +393 -0
- package/build/types/factories/src/precompiles/ArbRetryableTx__factory.ts +321 -0
- package/build/types/factories/src/precompiles/ArbStatistics__factory.ts +64 -0
- package/build/types/factories/src/precompiles/ArbSys__factory.ts +389 -0
- package/build/types/factories/src/precompiles/ArbosActs__factory.ts +92 -0
- package/build/types/factories/src/precompiles/ArbosTest__factory.ts +39 -0
- package/build/types/factories/src/precompiles/index.ts +16 -0
- package/build/types/factories/src/rollup/AbsBridgeCreator__factory.ts +182 -0
- package/build/types/factories/src/rollup/AbsRollupCreator__factory.ts +285 -0
- package/build/types/factories/src/rollup/AbsRollupEventInbox__factory.ts +125 -0
- package/build/types/factories/src/rollup/BridgeCreator__factory.ts +294 -0
- package/build/types/factories/src/rollup/ERC20BridgeCreator__factory.ts +299 -0
- package/build/types/factories/src/rollup/ERC20RollupCreator__factory.ts +439 -0
- package/build/types/factories/src/rollup/ERC20RollupEventInbox__factory.ts +170 -0
- package/build/types/factories/src/rollup/IBridgeCreator.sol/IBridgeCreator__factory.ts +124 -0
- package/build/types/factories/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator__factory.ts +200 -0
- package/build/types/factories/src/rollup/IBridgeCreator.sol/IEthBridgeCreator__factory.ts +195 -0
- package/build/types/factories/src/rollup/IBridgeCreator.sol/index.ts +6 -0
- package/build/types/factories/src/rollup/IRollupAdmin__factory.ts +559 -0
- package/build/types/factories/src/rollup/IRollupCore__factory.ts +904 -0
- package/build/types/factories/src/rollup/IRollupCreator.sol/IERC20RollupCreator__factory.ts +182 -0
- package/build/types/factories/src/rollup/IRollupCreator.sol/IEthRollupCreator__factory.ts +177 -0
- package/build/types/factories/src/rollup/IRollupCreator.sol/IRollupCreator__factory.ts +69 -0
- package/build/types/factories/src/rollup/IRollupCreator.sol/index.ts +6 -0
- package/build/types/factories/src/rollup/IRollupEventInbox__factory.ts +83 -0
- package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserAbs__factory.ts +1324 -0
- package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUserERC20__factory.ts +1458 -0
- package/build/types/factories/src/rollup/IRollupLogic.sol/IRollupUser__factory.ts +1443 -0
- package/build/types/factories/src/rollup/IRollupLogic.sol/index.ts +6 -0
- package/build/types/factories/src/rollup/RollupAdminLogic__factory.ts +1859 -0
- package/build/types/factories/src/rollup/RollupCore__factory.ts +1066 -0
- package/build/types/factories/src/rollup/RollupCreator__factory.ts +434 -0
- package/build/types/factories/src/rollup/RollupEventInbox__factory.ts +166 -0
- package/build/types/factories/src/rollup/RollupProxy__factory.ts +277 -0
- package/build/types/factories/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic__factory.ts +1593 -0
- package/build/types/factories/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic__factory.ts +1767 -0
- package/build/types/factories/src/rollup/RollupUserLogic.sol/RollupUserLogic__factory.ts +1748 -0
- package/build/types/factories/src/rollup/RollupUserLogic.sol/index.ts +6 -0
- package/build/types/factories/src/rollup/ValidatorUtils__factory.ts +430 -0
- package/build/types/factories/src/rollup/ValidatorWalletCreator__factory.ts +205 -0
- package/build/types/factories/src/rollup/ValidatorWallet__factory.ts +486 -0
- package/build/types/factories/src/rollup/index.ts +25 -0
- package/build/types/factories/src/test-helpers/BridgeTester__factory.ts +654 -0
- package/build/types/factories/src/test-helpers/CryptographyPrimitivesTester__factory.ts +111 -0
- package/build/types/factories/src/test-helpers/EthVault__factory.ts +95 -0
- package/build/types/factories/src/test-helpers/MessageTester__factory.ts +135 -0
- package/build/types/factories/src/test-helpers/OutboxWithoutOptTester__factory.ts +575 -0
- package/build/types/factories/src/test-helpers/RollupMock__factory.ts +100 -0
- package/build/types/factories/src/test-helpers/ValueArrayTester__factory.ts +69 -0
- package/build/types/factories/src/test-helpers/index.ts +10 -0
- package/build/types/index.ts +240 -0
- package/build/types/src/bridge/AbsBridge.ts +863 -0
- package/build/types/src/bridge/AbsInbox.ts +664 -0
- package/build/types/src/bridge/AbsOutbox.ts +700 -0
- package/build/types/src/bridge/Bridge.ts +934 -0
- package/build/types/src/bridge/ERC20Bridge.ts +970 -0
- package/build/types/src/bridge/ERC20Inbox.ts +869 -0
- package/build/types/src/bridge/ERC20Outbox.ts +722 -0
- package/build/types/src/bridge/IBridge.ts +799 -0
- package/build/types/src/bridge/IDelayedMessageProvider.ts +108 -0
- package/build/types/src/bridge/IERC20Bridge.ts +914 -0
- package/build/types/src/bridge/IERC20Inbox.ts +788 -0
- package/build/types/src/bridge/IEthBridge.ts +871 -0
- package/build/types/src/bridge/IEthInbox.ts +1081 -0
- package/build/types/src/bridge/IInbox.ts +583 -0
- package/build/types/src/bridge/IOutbox.ts +654 -0
- package/build/types/src/bridge/IOwnable.ts +81 -0
- package/build/types/src/bridge/ISequencerInbox.ts +1038 -0
- package/build/types/src/bridge/Inbox.ts +1279 -0
- package/build/types/src/bridge/Outbox.ts +700 -0
- package/build/types/src/bridge/SequencerInbox.ts +1138 -0
- package/build/types/src/bridge/index.ts +23 -0
- package/build/types/src/challenge/ChallengeManager.ts +889 -0
- package/build/types/src/challenge/IChallengeManager.ts +543 -0
- package/build/types/src/challenge/IChallengeResultReceiver.ts +115 -0
- package/build/types/src/challenge/index.ts +6 -0
- package/build/types/src/index.ts +21 -0
- package/build/types/src/libraries/AdminFallbackProxy.sol/AdminFallbackProxy.ts +128 -0
- package/build/types/src/libraries/AdminFallbackProxy.sol/DoubleLogicERC1967Upgrade.ts +128 -0
- package/build/types/src/libraries/AdminFallbackProxy.sol/index.ts +5 -0
- package/build/types/src/libraries/DoubleLogicUUPSUpgradeable.ts +314 -0
- package/build/types/src/libraries/IGasRefunder.ts +112 -0
- package/build/types/src/libraries/UUPSNotUpgradeable.ts +164 -0
- package/build/types/src/libraries/index.ts +8 -0
- package/build/types/src/mocks/BridgeStub.ts +887 -0
- package/build/types/src/mocks/BridgeUnproxied.ts +934 -0
- package/build/types/src/mocks/InboxStub.ts +1076 -0
- package/build/types/src/mocks/MockResultReceiver.ts +301 -0
- package/build/types/src/mocks/ProxyAdminForBinding.ts +359 -0
- package/build/types/src/mocks/SequencerInboxStub.ts +1173 -0
- package/build/types/src/mocks/Simple.ts +514 -0
- package/build/types/src/mocks/SimpleProxy.ts +55 -0
- package/build/types/src/mocks/SingleExecutionChallenge.ts +889 -0
- package/build/types/src/mocks/TimedOutChallengeManager.ts +883 -0
- package/build/types/src/mocks/index.ts +13 -0
- package/build/types/src/node-interface/NodeInterface.ts +502 -0
- package/build/types/src/node-interface/NodeInterfaceDebug.ts +137 -0
- package/build/types/src/node-interface/index.ts +5 -0
- package/build/types/src/osp/HashProofHelper.ts +308 -0
- package/build/types/src/osp/IOneStepProofEntry.ts +128 -0
- package/build/types/src/osp/IOneStepProver.ts +284 -0
- package/build/types/src/osp/OneStepProofEntry.ts +196 -0
- package/build/types/src/osp/OneStepProver0.ts +284 -0
- package/build/types/src/osp/OneStepProverHostIo.ts +284 -0
- package/build/types/src/osp/OneStepProverMath.ts +284 -0
- package/build/types/src/osp/OneStepProverMemory.ts +284 -0
- package/build/types/src/osp/index.ts +11 -0
- package/build/types/src/precompiles/ArbAddressTable.ts +248 -0
- package/build/types/src/precompiles/ArbAggregator.ts +335 -0
- package/build/types/src/precompiles/ArbDebug.ts +292 -0
- package/build/types/src/precompiles/ArbFunctionTable.ts +150 -0
- package/build/types/src/precompiles/ArbGasInfo.ts +494 -0
- package/build/types/src/precompiles/ArbInfo.ts +105 -0
- package/build/types/src/precompiles/ArbOwner.ts +928 -0
- package/build/types/src/precompiles/ArbOwnerPublic.ts +157 -0
- package/build/types/src/precompiles/ArbRetryableTx.ts +467 -0
- package/build/types/src/precompiles/ArbStatistics.ts +93 -0
- package/build/types/src/precompiles/ArbSys.ts +553 -0
- package/build/types/src/precompiles/ArbosActs.ts +173 -0
- package/build/types/src/precompiles/ArbosTest.ts +97 -0
- package/build/types/src/precompiles/index.ts +16 -0
- package/build/types/src/rollup/AbsBridgeCreator.ts +348 -0
- package/build/types/src/rollup/AbsRollupCreator.ts +449 -0
- package/build/types/src/rollup/AbsRollupEventInbox.ts +218 -0
- package/build/types/src/rollup/BridgeCreator.ts +415 -0
- package/build/types/src/rollup/ERC20BridgeCreator.ts +420 -0
- package/build/types/src/rollup/ERC20RollupCreator.ts +561 -0
- package/build/types/src/rollup/ERC20RollupEventInbox.ts +218 -0
- package/build/types/src/rollup/IBridgeCreator.sol/IBridgeCreator.ts +231 -0
- package/build/types/src/rollup/IBridgeCreator.sol/IERC20BridgeCreator.ts +303 -0
- package/build/types/src/rollup/IBridgeCreator.sol/IEthBridgeCreator.ts +298 -0
- package/build/types/src/rollup/IBridgeCreator.sol/index.ts +6 -0
- package/build/types/src/rollup/IRollupAdmin.ts +1003 -0
- package/build/types/src/rollup/IRollupCore.ts +1183 -0
- package/build/types/src/rollup/IRollupCreator.sol/IERC20RollupCreator.ts +247 -0
- package/build/types/src/rollup/IRollupCreator.sol/IEthRollupCreator.ts +242 -0
- package/build/types/src/rollup/IRollupCreator.sol/IRollupCreator.ts +134 -0
- package/build/types/src/rollup/IRollupCreator.sol/index.ts +6 -0
- package/build/types/src/rollup/IRollupEventInbox.ts +167 -0
- package/build/types/src/rollup/IRollupLogic.sol/IRollupUser.ts +2022 -0
- package/build/types/src/rollup/IRollupLogic.sol/IRollupUserAbs.ts +1901 -0
- package/build/types/src/rollup/IRollupLogic.sol/IRollupUserERC20.ts +2036 -0
- package/build/types/src/rollup/IRollupLogic.sol/index.ts +6 -0
- package/build/types/src/rollup/RollupAdminLogic.ts +2593 -0
- package/build/types/src/rollup/RollupCore.ts +1406 -0
- package/build/types/src/rollup/RollupCreator.ts +556 -0
- package/build/types/src/rollup/RollupEventInbox.ts +218 -0
- package/build/types/src/rollup/RollupProxy.ts +285 -0
- package/build/types/src/rollup/RollupUserLogic.sol/AbsRollupUserLogic.ts +2282 -0
- package/build/types/src/rollup/RollupUserLogic.sol/ERC20RollupUserLogic.ts +2417 -0
- package/build/types/src/rollup/RollupUserLogic.sol/RollupUserLogic.ts +2403 -0
- package/build/types/src/rollup/RollupUserLogic.sol/index.ts +6 -0
- package/build/types/src/rollup/ValidatorUtils.ts +561 -0
- package/build/types/src/rollup/ValidatorWallet.ts +751 -0
- package/build/types/src/rollup/ValidatorWalletCreator.ts +294 -0
- package/build/types/src/rollup/index.ts +29 -0
- package/build/types/src/test-helpers/BridgeTester.ts +899 -0
- package/build/types/src/test-helpers/CryptographyPrimitivesTester.ts +141 -0
- package/build/types/src/test-helpers/EthVault.ts +141 -0
- package/build/types/src/test-helpers/MessageTester.ts +182 -0
- package/build/types/src/test-helpers/OutboxWithoutOptTester.ts +700 -0
- package/build/types/src/test-helpers/RollupMock.ts +164 -0
- package/build/types/src/test-helpers/ValueArrayTester.ts +81 -0
- package/build/types/src/test-helpers/index.ts +10 -0
- package/package.json +9 -3
- package/src/bridge/AbsBridge.sol +302 -0
- package/src/bridge/AbsInbox.sol +335 -0
- package/src/bridge/AbsOutbox.sol +295 -0
- package/src/bridge/Bridge.sol +15 -244
- package/src/bridge/ERC20Bridge.sol +74 -0
- package/src/bridge/ERC20Inbox.sol +141 -0
- package/src/bridge/ERC20Outbox.sol +27 -0
- package/src/bridge/IBridge.sol +1 -16
- package/src/bridge/IDelayedMessageProvider.sol +1 -1
- package/src/bridge/IERC20Bridge.sol +35 -0
- package/src/bridge/IERC20Inbox.sol +75 -0
- package/src/bridge/IEthBridge.sol +26 -0
- package/src/bridge/IEthInbox.sol +133 -0
- package/src/bridge/IInbox.sol +13 -123
- package/src/bridge/IOutbox.sol +1 -1
- package/src/bridge/IOwnable.sol +1 -1
- package/src/bridge/ISequencerInbox.sol +12 -4
- package/src/bridge/Inbox.sol +46 -333
- package/src/bridge/Messages.sol +1 -1
- package/src/bridge/Outbox.sol +8 -265
- package/src/bridge/SequencerInbox.sol +29 -8
- package/src/challenge/ChallengeLib.sol +1 -1
- package/src/challenge/ChallengeManager.sol +1 -1
- package/src/challenge/IChallengeManager.sol +1 -1
- package/src/challenge/IChallengeResultReceiver.sol +1 -1
- package/src/libraries/AddressAliasHelper.sol +1 -1
- package/src/libraries/AdminFallbackProxy.sol +1 -1
- package/src/libraries/ArbitrumChecker.sol +16 -0
- package/src/libraries/Constants.sol +1 -4
- package/src/libraries/CryptographyPrimitives.sol +1 -1
- package/src/libraries/DelegateCallAware.sol +1 -1
- package/src/libraries/DoubleLogicUUPSUpgradeable.sol +1 -1
- package/src/libraries/Error.sol +9 -1
- package/src/libraries/IGasRefunder.sol +1 -1
- package/src/libraries/MerkleLib.sol +1 -1
- package/src/libraries/MessageTypes.sol +1 -1
- package/src/mocks/BridgeStub.sol +3 -2
- package/src/mocks/BridgeUnproxied.sol +1 -1
- package/src/mocks/InboxStub.sol +28 -5
- package/src/mocks/MockResultReceiver.sol +1 -1
- package/src/mocks/ProxyAdminForBinding.sol +1 -1
- package/src/mocks/SequencerInboxStub.sol +3 -2
- package/src/mocks/Simple.sol +3 -1
- package/src/mocks/SimpleProxy.sol +1 -1
- package/src/mocks/SingleExecutionChallenge.sol +1 -1
- package/src/mocks/TimedOutChallengeManager.sol +1 -1
- package/src/node-interface/NodeInterface.sol +1 -1
- package/src/node-interface/NodeInterfaceDebug.sol +1 -1
- package/src/osp/HashProofHelper.sol +1 -1
- package/src/osp/IOneStepProofEntry.sol +1 -1
- package/src/osp/IOneStepProver.sol +2 -1
- package/src/osp/OneStepProofEntry.sol +1 -1
- package/src/osp/OneStepProver0.sol +1 -1
- package/src/osp/OneStepProverHostIo.sol +2 -1
- package/src/osp/OneStepProverMath.sol +1 -1
- package/src/osp/OneStepProverMemory.sol +2 -1
- package/src/precompiles/ArbAddressTable.sol +1 -1
- package/src/precompiles/ArbAggregator.sol +1 -1
- package/src/precompiles/ArbBLS.sol +1 -1
- package/src/precompiles/ArbDebug.sol +1 -1
- package/src/precompiles/ArbFunctionTable.sol +1 -1
- package/src/precompiles/ArbGasInfo.sol +1 -1
- package/src/precompiles/ArbInfo.sol +1 -1
- package/src/precompiles/ArbOwner.sol +1 -1
- package/src/precompiles/ArbOwnerPublic.sol +1 -1
- package/src/precompiles/ArbRetryableTx.sol +1 -1
- package/src/precompiles/ArbStatistics.sol +1 -1
- package/src/precompiles/ArbSys.sol +1 -1
- package/src/precompiles/ArbosTest.sol +1 -1
- package/src/rollup/AbsBridgeCreator.sol +117 -0
- package/src/rollup/AbsRollupCreator.sol +164 -0
- package/src/rollup/AbsRollupEventInbox.sol +62 -0
- package/src/rollup/BridgeCreator.sol +17 -88
- package/src/rollup/Config.sol +43 -0
- package/src/rollup/ERC20BridgeCreator.sol +48 -0
- package/src/rollup/ERC20RollupCreator.sol +48 -0
- package/src/rollup/ERC20RollupEventInbox.sol +26 -0
- package/src/rollup/IBridgeCreator.sol +64 -0
- package/src/rollup/IRollupAdmin.sol +138 -0
- package/src/rollup/IRollupCore.sol +7 -3
- package/src/rollup/IRollupCreator.sol +40 -0
- package/src/rollup/IRollupEventInbox.sol +1 -1
- package/src/rollup/IRollupLogic.sol +4 -132
- package/src/rollup/Node.sol +15 -1
- package/src/rollup/RollupAdminLogic.sol +6 -8
- package/src/rollup/RollupCore.sol +4 -11
- package/src/rollup/RollupCreator.sol +22 -97
- package/src/rollup/RollupEventInbox.sol +12 -35
- package/src/rollup/RollupLib.sol +2 -41
- package/src/rollup/RollupProxy.sol +3 -2
- package/src/rollup/RollupUserLogic.sol +6 -4
- package/src/rollup/ValidatorUtils.sol +2 -1
- package/src/rollup/ValidatorWallet.sol +1 -1
- package/src/rollup/ValidatorWalletCreator.sol +1 -1
- package/src/state/Deserialize.sol +2 -2
- package/src/state/GlobalState.sol +1 -1
- package/src/state/Instructions.sol +1 -1
- package/src/state/Machine.sol +1 -1
- package/src/state/MerkleProof.sol +1 -1
- package/src/state/Module.sol +3 -3
- package/src/state/ModuleMemory.sol +3 -8
- package/src/state/ModuleMemoryCompact.sol +17 -0
- package/src/state/PcArray.sol +1 -1
- package/src/state/StackFrame.sol +1 -1
- package/src/state/Value.sol +1 -1
- package/src/state/ValueArray.sol +1 -1
- package/src/state/ValueStack.sol +1 -1
- package/src/test-helpers/BridgeTester.sol +3 -2
- package/src/test-helpers/CryptographyPrimitivesTester.sol +1 -1
- package/src/test-helpers/EthVault.sol +20 -0
- package/src/test-helpers/InterfaceCompatibilityTester.sol +1 -1
- package/src/test-helpers/MessageTester.sol +1 -1
- package/src/test-helpers/OutboxWithoutOptTester.sol +1 -1
- package/src/test-helpers/RollupMock.sol +1 -1
- package/src/test-helpers/ValueArrayTester.sol +1 -1
- package/hardhat.config.ts +0 -164
package/src/bridge/Inbox.sol
CHANGED
@@ -1,32 +1,24 @@
|
|
1
1
|
// Copyright 2021-2022, Offchain Labs, Inc.
|
2
|
-
// For license information, see https://github.com/nitro/blob/
|
2
|
+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
|
3
3
|
// SPDX-License-Identifier: BUSL-1.1
|
4
4
|
|
5
5
|
pragma solidity ^0.8.4;
|
6
6
|
|
7
7
|
import {
|
8
|
-
AlreadyInit,
|
9
8
|
NotOrigin,
|
10
9
|
DataTooLarge,
|
11
|
-
AlreadyPaused,
|
12
|
-
AlreadyUnpaused,
|
13
|
-
Paused,
|
14
10
|
InsufficientValue,
|
15
11
|
InsufficientSubmissionCost,
|
16
|
-
NotAllowedOrigin,
|
17
12
|
RetryableData,
|
18
|
-
NotRollupOrOwner,
|
19
13
|
L1Forked,
|
20
14
|
NotForked,
|
21
15
|
GasLimitTooLarge
|
22
16
|
} from "../libraries/Error.sol";
|
23
|
-
import "./
|
24
|
-
import "./
|
17
|
+
import "./AbsInbox.sol";
|
18
|
+
import "./IEthInbox.sol";
|
25
19
|
import "./IBridge.sol";
|
26
|
-
|
27
|
-
import "./Messages.sol";
|
20
|
+
import "./IEthBridge.sol";
|
28
21
|
import "../libraries/AddressAliasHelper.sol";
|
29
|
-
import "../libraries/DelegateCallAware.sol";
|
30
22
|
import {
|
31
23
|
L2_MSG,
|
32
24
|
L1MessageType_L2FundedByL1,
|
@@ -35,125 +27,30 @@ import {
|
|
35
27
|
L2MessageType_unsignedEOATx,
|
36
28
|
L2MessageType_unsignedContractTx
|
37
29
|
} from "../libraries/MessageTypes.sol";
|
38
|
-
import {MAX_DATA_SIZE
|
30
|
+
import {MAX_DATA_SIZE} from "../libraries/Constants.sol";
|
39
31
|
import "../precompiles/ArbSys.sol";
|
40
32
|
|
41
33
|
import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol";
|
42
|
-
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
|
43
34
|
|
44
35
|
/**
|
45
36
|
* @title Inbox for user and contract originated messages
|
46
37
|
* @notice Messages created via this inbox are enqueued in the delayed accumulator
|
47
38
|
* to await inclusion in the SequencerInbox
|
48
39
|
*/
|
49
|
-
contract Inbox is
|
50
|
-
IBridge public bridge;
|
51
|
-
ISequencerInbox public sequencerInbox;
|
52
|
-
|
53
|
-
/// ------------------------------------ allow list start ------------------------------------ ///
|
54
|
-
|
55
|
-
bool public allowListEnabled;
|
56
|
-
mapping(address => bool) public isAllowed;
|
57
|
-
|
58
|
-
event AllowListAddressSet(address indexed user, bool val);
|
59
|
-
event AllowListEnabledUpdated(bool isEnabled);
|
60
|
-
|
61
|
-
function setAllowList(address[] memory user, bool[] memory val) external onlyRollupOrOwner {
|
62
|
-
require(user.length == val.length, "INVALID_INPUT");
|
63
|
-
|
64
|
-
for (uint256 i = 0; i < user.length; i++) {
|
65
|
-
isAllowed[user[i]] = val[i];
|
66
|
-
emit AllowListAddressSet(user[i], val[i]);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
function setAllowListEnabled(bool _allowListEnabled) external onlyRollupOrOwner {
|
71
|
-
require(_allowListEnabled != allowListEnabled, "ALREADY_SET");
|
72
|
-
allowListEnabled = _allowListEnabled;
|
73
|
-
emit AllowListEnabledUpdated(_allowListEnabled);
|
74
|
-
}
|
75
|
-
|
76
|
-
/// @dev this modifier checks the tx.origin instead of msg.sender for convenience (ie it allows
|
77
|
-
/// allowed users to interact with the token bridge without needing the token bridge to be allowList aware).
|
78
|
-
/// this modifier is not intended to use to be used for security (since this opens the allowList to
|
79
|
-
/// a smart contract phishing risk).
|
80
|
-
modifier onlyAllowed() {
|
81
|
-
// solhint-disable-next-line avoid-tx-origin
|
82
|
-
if (allowListEnabled && !isAllowed[tx.origin]) revert NotAllowedOrigin(tx.origin);
|
83
|
-
_;
|
84
|
-
}
|
85
|
-
|
86
|
-
/// ------------------------------------ allow list end ------------------------------------ ///
|
87
|
-
|
88
|
-
modifier onlyRollupOrOwner() {
|
89
|
-
IOwnable rollup = bridge.rollup();
|
90
|
-
if (msg.sender != address(rollup)) {
|
91
|
-
address rollupOwner = rollup.owner();
|
92
|
-
if (msg.sender != rollupOwner) {
|
93
|
-
revert NotRollupOrOwner(msg.sender, address(rollup), rollupOwner);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
_;
|
97
|
-
}
|
98
|
-
|
99
|
-
uint256 internal immutable deployTimeChainId = block.chainid;
|
100
|
-
|
101
|
-
function _chainIdChanged() internal view returns (bool) {
|
102
|
-
return deployTimeChainId != block.chainid;
|
103
|
-
}
|
104
|
-
|
105
|
-
/// @inheritdoc IInbox
|
106
|
-
function pause() external onlyRollupOrOwner {
|
107
|
-
_pause();
|
108
|
-
}
|
109
|
-
|
40
|
+
contract Inbox is AbsInbox, IEthInbox {
|
110
41
|
/// @inheritdoc IInbox
|
111
|
-
function unpause() external onlyRollupOrOwner {
|
112
|
-
_unpause();
|
113
|
-
}
|
114
|
-
|
115
42
|
function initialize(IBridge _bridge, ISequencerInbox _sequencerInbox)
|
116
43
|
external
|
117
44
|
initializer
|
118
45
|
onlyDelegated
|
119
46
|
{
|
120
|
-
|
121
|
-
sequencerInbox = _sequencerInbox;
|
122
|
-
allowListEnabled = false;
|
123
|
-
__Pausable_init();
|
47
|
+
__AbsInbox_init(_bridge, _sequencerInbox);
|
124
48
|
}
|
125
49
|
|
126
|
-
/// @inheritdoc
|
50
|
+
/// @inheritdoc IEthInbox
|
127
51
|
function postUpgradeInit(IBridge) external onlyDelegated onlyProxyOwner {}
|
128
52
|
|
129
|
-
/// @inheritdoc
|
130
|
-
function sendL2MessageFromOrigin(bytes calldata messageData)
|
131
|
-
external
|
132
|
-
whenNotPaused
|
133
|
-
onlyAllowed
|
134
|
-
returns (uint256)
|
135
|
-
{
|
136
|
-
if (_chainIdChanged()) revert L1Forked();
|
137
|
-
// solhint-disable-next-line avoid-tx-origin
|
138
|
-
if (msg.sender != tx.origin) revert NotOrigin();
|
139
|
-
if (messageData.length > MAX_DATA_SIZE)
|
140
|
-
revert DataTooLarge(messageData.length, MAX_DATA_SIZE);
|
141
|
-
uint256 msgNum = deliverToBridge(L2_MSG, msg.sender, keccak256(messageData));
|
142
|
-
emit InboxMessageDeliveredFromOrigin(msgNum);
|
143
|
-
return msgNum;
|
144
|
-
}
|
145
|
-
|
146
|
-
/// @inheritdoc IInbox
|
147
|
-
function sendL2Message(bytes calldata messageData)
|
148
|
-
external
|
149
|
-
whenNotPaused
|
150
|
-
onlyAllowed
|
151
|
-
returns (uint256)
|
152
|
-
{
|
153
|
-
if (_chainIdChanged()) revert L1Forked();
|
154
|
-
return _deliverMessage(L2_MSG, msg.sender, messageData);
|
155
|
-
}
|
156
|
-
|
53
|
+
/// @inheritdoc IEthInbox
|
157
54
|
function sendL1FundedUnsignedTransaction(
|
158
55
|
uint256 gasLimit,
|
159
56
|
uint256 maxFeePerGas,
|
@@ -177,10 +74,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
177
74
|
uint256(uint160(to)),
|
178
75
|
msg.value,
|
179
76
|
data
|
180
|
-
)
|
77
|
+
),
|
78
|
+
msg.value
|
181
79
|
);
|
182
80
|
}
|
183
81
|
|
82
|
+
/// @inheritdoc IEthInbox
|
184
83
|
function sendL1FundedContractTransaction(
|
185
84
|
uint256 gasLimit,
|
186
85
|
uint256 maxFeePerGas,
|
@@ -202,65 +101,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
202
101
|
uint256(uint160(to)),
|
203
102
|
msg.value,
|
204
103
|
data
|
205
|
-
)
|
206
|
-
|
207
|
-
}
|
208
|
-
|
209
|
-
function sendUnsignedTransaction(
|
210
|
-
uint256 gasLimit,
|
211
|
-
uint256 maxFeePerGas,
|
212
|
-
uint256 nonce,
|
213
|
-
address to,
|
214
|
-
uint256 value,
|
215
|
-
bytes calldata data
|
216
|
-
) external whenNotPaused onlyAllowed returns (uint256) {
|
217
|
-
// arbos will discard unsigned tx with gas limit too large
|
218
|
-
if (gasLimit > type(uint64).max) {
|
219
|
-
revert GasLimitTooLarge();
|
220
|
-
}
|
221
|
-
return
|
222
|
-
_deliverMessage(
|
223
|
-
L2_MSG,
|
224
|
-
msg.sender,
|
225
|
-
abi.encodePacked(
|
226
|
-
L2MessageType_unsignedEOATx,
|
227
|
-
gasLimit,
|
228
|
-
maxFeePerGas,
|
229
|
-
nonce,
|
230
|
-
uint256(uint160(to)),
|
231
|
-
value,
|
232
|
-
data
|
233
|
-
)
|
234
|
-
);
|
235
|
-
}
|
236
|
-
|
237
|
-
function sendContractTransaction(
|
238
|
-
uint256 gasLimit,
|
239
|
-
uint256 maxFeePerGas,
|
240
|
-
address to,
|
241
|
-
uint256 value,
|
242
|
-
bytes calldata data
|
243
|
-
) external whenNotPaused onlyAllowed returns (uint256) {
|
244
|
-
// arbos will discard unsigned tx with gas limit too large
|
245
|
-
if (gasLimit > type(uint64).max) {
|
246
|
-
revert GasLimitTooLarge();
|
247
|
-
}
|
248
|
-
return
|
249
|
-
_deliverMessage(
|
250
|
-
L2_MSG,
|
251
|
-
msg.sender,
|
252
|
-
abi.encodePacked(
|
253
|
-
L2MessageType_unsignedContractTx,
|
254
|
-
gasLimit,
|
255
|
-
maxFeePerGas,
|
256
|
-
uint256(uint160(to)),
|
257
|
-
value,
|
258
|
-
data
|
259
|
-
)
|
104
|
+
),
|
105
|
+
msg.value
|
260
106
|
);
|
261
107
|
}
|
262
108
|
|
263
|
-
/// @inheritdoc
|
109
|
+
/// @inheritdoc IEthInbox
|
264
110
|
function sendL1FundedUnsignedTransactionToFork(
|
265
111
|
uint256 gasLimit,
|
266
112
|
uint256 maxFeePerGas,
|
@@ -288,11 +134,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
288
134
|
uint256(uint160(to)),
|
289
135
|
msg.value,
|
290
136
|
data
|
291
|
-
)
|
137
|
+
),
|
138
|
+
msg.value
|
292
139
|
);
|
293
140
|
}
|
294
141
|
|
295
|
-
/// @inheritdoc
|
142
|
+
/// @inheritdoc IEthInbox
|
296
143
|
function sendUnsignedTransactionToFork(
|
297
144
|
uint256 gasLimit,
|
298
145
|
uint256 maxFeePerGas,
|
@@ -321,11 +168,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
321
168
|
uint256(uint160(to)),
|
322
169
|
value,
|
323
170
|
data
|
324
|
-
)
|
171
|
+
),
|
172
|
+
0
|
325
173
|
);
|
326
174
|
}
|
327
175
|
|
328
|
-
/// @inheritdoc
|
176
|
+
/// @inheritdoc IEthInbox
|
329
177
|
function sendWithdrawEthToFork(
|
330
178
|
uint256 gasLimit,
|
331
179
|
uint256 maxFeePerGas,
|
@@ -353,21 +201,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
353
201
|
uint256(uint160(address(100))), // ArbSys address
|
354
202
|
value,
|
355
203
|
abi.encodeWithSelector(ArbSys.withdrawEth.selector, withdrawTo)
|
356
|
-
)
|
204
|
+
),
|
205
|
+
0
|
357
206
|
);
|
358
207
|
}
|
359
208
|
|
360
|
-
/// @inheritdoc
|
361
|
-
function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee)
|
362
|
-
public
|
363
|
-
view
|
364
|
-
returns (uint256)
|
365
|
-
{
|
366
|
-
// Use current block basefee if baseFee parameter is 0
|
367
|
-
return (1400 + 6 * dataLength) * (baseFee == 0 ? block.basefee : baseFee);
|
368
|
-
}
|
369
|
-
|
370
|
-
/// @inheritdoc IInbox
|
209
|
+
/// @inheritdoc IEthInbox
|
371
210
|
function depositEth() public payable whenNotPaused onlyAllowed returns (uint256) {
|
372
211
|
address dest = msg.sender;
|
373
212
|
|
@@ -381,7 +220,8 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
381
220
|
_deliverMessage(
|
382
221
|
L1MessageType_ethDeposit,
|
383
222
|
msg.sender,
|
384
|
-
abi.encodePacked(dest, msg.value)
|
223
|
+
abi.encodePacked(dest, msg.value),
|
224
|
+
msg.value
|
385
225
|
);
|
386
226
|
}
|
387
227
|
|
@@ -428,7 +268,7 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
428
268
|
);
|
429
269
|
}
|
430
270
|
|
431
|
-
/// @inheritdoc
|
271
|
+
/// @inheritdoc IEthInbox
|
432
272
|
function createRetryableTicket(
|
433
273
|
address to,
|
434
274
|
uint256 l2CallValue,
|
@@ -439,28 +279,8 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
439
279
|
uint256 maxFeePerGas,
|
440
280
|
bytes calldata data
|
441
281
|
) external payable whenNotPaused onlyAllowed returns (uint256) {
|
442
|
-
// ensure the user's deposit alone will make submission succeed
|
443
|
-
if (msg.value < (maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas)) {
|
444
|
-
revert InsufficientValue(
|
445
|
-
maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas,
|
446
|
-
msg.value
|
447
|
-
);
|
448
|
-
}
|
449
|
-
|
450
|
-
// if a refund address is a contract, we apply the alias to it
|
451
|
-
// so that it can access its funds on the L2
|
452
|
-
// since the beneficiary and other refund addresses don't get rewritten by arb-os
|
453
|
-
if (AddressUpgradeable.isContract(excessFeeRefundAddress)) {
|
454
|
-
excessFeeRefundAddress = AddressAliasHelper.applyL1ToL2Alias(excessFeeRefundAddress);
|
455
|
-
}
|
456
|
-
if (AddressUpgradeable.isContract(callValueRefundAddress)) {
|
457
|
-
// this is the beneficiary. be careful since this is the address that can cancel the retryable in the L2
|
458
|
-
callValueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(callValueRefundAddress);
|
459
|
-
}
|
460
|
-
|
461
|
-
// gas limit is validated to be within uint64 in unsafeCreateRetryableTicket
|
462
282
|
return
|
463
|
-
|
283
|
+
_createRetryableTicket(
|
464
284
|
to,
|
465
285
|
l2CallValue,
|
466
286
|
maxSubmissionCost,
|
@@ -468,11 +288,12 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
468
288
|
callValueRefundAddress,
|
469
289
|
gasLimit,
|
470
290
|
maxFeePerGas,
|
291
|
+
msg.value,
|
471
292
|
data
|
472
293
|
);
|
473
294
|
}
|
474
295
|
|
475
|
-
/// @inheritdoc
|
296
|
+
/// @inheritdoc IEthInbox
|
476
297
|
function unsafeCreateRetryableTicket(
|
477
298
|
address to,
|
478
299
|
uint256 l2CallValue,
|
@@ -483,147 +304,39 @@ contract Inbox is DelegateCallAware, PausableUpgradeable, IInbox {
|
|
483
304
|
uint256 maxFeePerGas,
|
484
305
|
bytes calldata data
|
485
306
|
) public payable whenNotPaused onlyAllowed returns (uint256) {
|
486
|
-
// gas price and limit of 1 should never be a valid input, so instead they are used as
|
487
|
-
// magic values to trigger a revert in eth calls that surface data without requiring a tx trace
|
488
|
-
if (gasLimit == 1 || maxFeePerGas == 1)
|
489
|
-
revert RetryableData(
|
490
|
-
msg.sender,
|
491
|
-
to,
|
492
|
-
l2CallValue,
|
493
|
-
msg.value,
|
494
|
-
maxSubmissionCost,
|
495
|
-
excessFeeRefundAddress,
|
496
|
-
callValueRefundAddress,
|
497
|
-
gasLimit,
|
498
|
-
maxFeePerGas,
|
499
|
-
data
|
500
|
-
);
|
501
|
-
|
502
|
-
// arbos will discard retryable with gas limit too large
|
503
|
-
if (gasLimit > type(uint64).max) {
|
504
|
-
revert GasLimitTooLarge();
|
505
|
-
}
|
506
|
-
|
507
|
-
uint256 submissionFee = calculateRetryableSubmissionFee(data.length, block.basefee);
|
508
|
-
if (maxSubmissionCost < submissionFee)
|
509
|
-
revert InsufficientSubmissionCost(submissionFee, maxSubmissionCost);
|
510
|
-
|
511
307
|
return
|
512
|
-
|
513
|
-
L1MessageType_submitRetryableTx,
|
514
|
-
msg.sender,
|
515
|
-
abi.encodePacked(
|
516
|
-
uint256(uint160(to)),
|
517
|
-
l2CallValue,
|
518
|
-
msg.value,
|
519
|
-
maxSubmissionCost,
|
520
|
-
uint256(uint160(excessFeeRefundAddress)),
|
521
|
-
uint256(uint160(callValueRefundAddress)),
|
522
|
-
gasLimit,
|
523
|
-
maxFeePerGas,
|
524
|
-
data.length,
|
525
|
-
data
|
526
|
-
)
|
527
|
-
);
|
528
|
-
}
|
529
|
-
|
530
|
-
/// @notice This is an one-time-exception to resolve a misconfiguration of Uniswap Arbitrum deployment
|
531
|
-
/// Only the Uniswap L1 Timelock may call this function and it is allowed to create a crosschain
|
532
|
-
/// retryable ticket without address aliasing. More info here:
|
533
|
-
/// https://gov.uniswap.org/t/consensus-check-fix-the-cross-chain-messaging-bridge-on-arbitrum/18547
|
534
|
-
/// @dev This function will be removed in future releases
|
535
|
-
function uniswapCreateRetryableTicket(
|
536
|
-
address to,
|
537
|
-
uint256 l2CallValue,
|
538
|
-
uint256 maxSubmissionCost,
|
539
|
-
address excessFeeRefundAddress,
|
540
|
-
address callValueRefundAddress,
|
541
|
-
uint256 gasLimit,
|
542
|
-
uint256 maxFeePerGas,
|
543
|
-
bytes calldata data
|
544
|
-
) external payable whenNotPaused onlyAllowed returns (uint256) {
|
545
|
-
// this can only be called by UNISWAP_L1_TIMELOCK
|
546
|
-
require(msg.sender == UNISWAP_L1_TIMELOCK, "NOT_UNISWAP_L1_TIMELOCK");
|
547
|
-
// the retryable can only call UNISWAP_L2_FACTORY
|
548
|
-
require(to == UNISWAP_L2_FACTORY, "NOT_TO_UNISWAP_L2_FACTORY");
|
549
|
-
|
550
|
-
// ensure the user's deposit alone will make submission succeed
|
551
|
-
if (msg.value < (maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas)) {
|
552
|
-
revert InsufficientValue(
|
553
|
-
maxSubmissionCost + l2CallValue + gasLimit * maxFeePerGas,
|
554
|
-
msg.value
|
555
|
-
);
|
556
|
-
}
|
557
|
-
|
558
|
-
// if a refund address is a contract, we apply the alias to it
|
559
|
-
// so that it can access its funds on the L2
|
560
|
-
// since the beneficiary and other refund addresses don't get rewritten by arb-os
|
561
|
-
if (AddressUpgradeable.isContract(excessFeeRefundAddress)) {
|
562
|
-
excessFeeRefundAddress = AddressAliasHelper.applyL1ToL2Alias(excessFeeRefundAddress);
|
563
|
-
}
|
564
|
-
if (AddressUpgradeable.isContract(callValueRefundAddress)) {
|
565
|
-
// this is the beneficiary. be careful since this is the address that can cancel the retryable in the L2
|
566
|
-
callValueRefundAddress = AddressAliasHelper.applyL1ToL2Alias(callValueRefundAddress);
|
567
|
-
}
|
568
|
-
|
569
|
-
// gas price and limit of 1 should never be a valid input, so instead they are used as
|
570
|
-
// magic values to trigger a revert in eth calls that surface data without requiring a tx trace
|
571
|
-
if (gasLimit == 1 || maxFeePerGas == 1)
|
572
|
-
revert RetryableData(
|
573
|
-
msg.sender,
|
308
|
+
_unsafeCreateRetryableTicket(
|
574
309
|
to,
|
575
310
|
l2CallValue,
|
576
|
-
msg.value,
|
577
311
|
maxSubmissionCost,
|
578
312
|
excessFeeRefundAddress,
|
579
313
|
callValueRefundAddress,
|
580
314
|
gasLimit,
|
581
315
|
maxFeePerGas,
|
316
|
+
msg.value,
|
582
317
|
data
|
583
318
|
);
|
584
|
-
|
585
|
-
uint256 submissionFee = calculateRetryableSubmissionFee(data.length, block.basefee);
|
586
|
-
if (maxSubmissionCost < submissionFee)
|
587
|
-
revert InsufficientSubmissionCost(submissionFee, maxSubmissionCost);
|
588
|
-
|
589
|
-
return
|
590
|
-
_deliverMessage(
|
591
|
-
L1MessageType_submitRetryableTx,
|
592
|
-
AddressAliasHelper.undoL1ToL2Alias(msg.sender),
|
593
|
-
abi.encodePacked(
|
594
|
-
uint256(uint160(to)),
|
595
|
-
l2CallValue,
|
596
|
-
msg.value,
|
597
|
-
maxSubmissionCost,
|
598
|
-
uint256(uint160(excessFeeRefundAddress)),
|
599
|
-
uint256(uint160(callValueRefundAddress)),
|
600
|
-
gasLimit,
|
601
|
-
maxFeePerGas,
|
602
|
-
data.length,
|
603
|
-
data
|
604
|
-
)
|
605
|
-
);
|
606
319
|
}
|
607
320
|
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
return msgNum;
|
321
|
+
/// @inheritdoc IInbox
|
322
|
+
function calculateRetryableSubmissionFee(uint256 dataLength, uint256 baseFee)
|
323
|
+
public
|
324
|
+
view
|
325
|
+
override(AbsInbox, IInbox)
|
326
|
+
returns (uint256)
|
327
|
+
{
|
328
|
+
// Use current block basefee if baseFee parameter is 0
|
329
|
+
return (1400 + 6 * dataLength) * (baseFee == 0 ? block.basefee : baseFee);
|
618
330
|
}
|
619
331
|
|
620
|
-
function
|
332
|
+
function _deliverToBridge(
|
621
333
|
uint8 kind,
|
622
334
|
address sender,
|
623
|
-
bytes32 messageDataHash
|
624
|
-
|
335
|
+
bytes32 messageDataHash,
|
336
|
+
uint256 amount
|
337
|
+
) internal override returns (uint256) {
|
625
338
|
return
|
626
|
-
bridge.enqueueDelayedMessage{value:
|
339
|
+
IEthBridge(address(bridge)).enqueueDelayedMessage{value: amount}(
|
627
340
|
kind,
|
628
341
|
AddressAliasHelper.applyL1ToL2Alias(sender),
|
629
342
|
messageDataHash
|
package/src/bridge/Messages.sol
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
// Copyright 2021-2022, Offchain Labs, Inc.
|
2
|
-
// For license information, see https://github.com/nitro/blob/
|
2
|
+
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
|
3
3
|
// SPDX-License-Identifier: BUSL-1.1
|
4
4
|
|
5
5
|
pragma solidity ^0.8.0;
|