@across-protocol/contracts 5.0.25 → 5.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/contracts/chain-adapters/CrossDomainEnabled.sol +1 -1
- package/contracts/external/interfaces/IAcrossV5Executor.sol +14 -0
- package/contracts/external/interfaces/IAcrossV5ExecutorAdapter.sol +14 -0
- package/contracts/external/interfaces/IGateway.sol +25 -0
- package/contracts/interfaces/ICounterfactualBeacon.sol +25 -16
- package/contracts/interfaces/ICounterfactualBeaconBase.sol +30 -0
- package/contracts/interfaces/ICounterfactualDeposit.sol +30 -0
- package/contracts/interfaces/ICounterfactualDepositFactory.sol +33 -54
- package/contracts/interfaces/SpokePoolPeripheryInterface.sol +16 -4
- package/contracts/interfaces/V5SpokePoolInterface.sol +71 -0
- package/contracts/libraries/HyperCoreLib.sol +114 -30
- package/contracts/libraries/PeripherySigningLib.sol +56 -0
- package/contracts/libraries/SafeTransferERC20.sol +4 -0
- package/contracts/periphery/SpokePoolPeriphery.sol +81 -19
- package/contracts/periphery/Tron_SpokePoolPeriphery.sol +52 -0
- package/contracts/periphery/counterfactual/AdminWithdrawManager.sol +12 -4
- package/contracts/periphery/counterfactual/CounterfactualBeacon.sol +28 -1
- package/contracts/periphery/counterfactual/CounterfactualBeaconBase.sol +11 -11
- package/contracts/periphery/counterfactual/CounterfactualDeposit.sol +6 -16
- package/contracts/periphery/counterfactual/CounterfactualDepositCCTP.sol +9 -5
- package/contracts/periphery/counterfactual/CounterfactualDepositFactory.sol +3 -5
- package/contracts/periphery/counterfactual/CounterfactualDepositOFT.sol +6 -3
- package/contracts/periphery/counterfactual/CounterfactualDepositSpokePool.sol +24 -8
- package/contracts/periphery/counterfactual/CounterfactualDepositVanillaCCTP.sol +28 -12
- package/contracts/periphery/counterfactual/CounterfactualImplementationBase.sol +8 -7
- package/contracts/periphery/counterfactual/CounterfactualNonces.sol +52 -0
- package/contracts/periphery/mintburn/HyperCoreFlowExecutor.sol +7 -1
- package/contracts/periphery/mintburn/SwapHandler.sol +8 -7
- package/contracts/spoke-pools/Arbitrum_SpokePool.sol +10 -2
- package/contracts/spoke-pools/Cher_SpokePool.sol +4 -2
- package/contracts/spoke-pools/Ethereum_SpokePool.sol +4 -2
- package/contracts/spoke-pools/Lens_SpokePool.sol +7 -2
- package/contracts/spoke-pools/Linea_SpokePool.sol +4 -2
- package/contracts/spoke-pools/Lisk_SpokePool.sol +4 -2
- package/contracts/spoke-pools/OP_SpokePool.sol +4 -2
- package/contracts/spoke-pools/Ovm_SpokePool.sol +7 -5
- package/contracts/spoke-pools/Polygon_SpokePool.sol +10 -2
- package/contracts/spoke-pools/SpokePool.sol +181 -25
- package/contracts/spoke-pools/Tron_SpokePool.sol +4 -2
- package/contracts/spoke-pools/Universal_SpokePool.sol +10 -2
- package/contracts/spoke-pools/ZkSync_SpokePool.sol +7 -2
- package/contracts/test/MockGateway.sol +33 -0
- package/contracts/test/MockSpokePool.sol +4 -1
- package/contracts/test/MockSpokePoolV2.sol +1 -1
- package/contracts/tron/TronCounterfactualImports.sol +2 -0
- package/contracts/tron/TronPeripheryImports.sol +5 -2
- package/dist/broadcast/deployed-addresses.json +611 -447
- package/dist/evm/artifacts/AcrossConfigStore.sol/AcrossConfigStore.json +1 -1
- package/dist/evm/artifacts/AcrossEventEmitter.sol/AcrossEventEmitter.json +1 -1
- package/dist/evm/artifacts/AcrossMerkleDistributor.sol/AcrossMerkleDistributor.json +1 -1
- package/dist/evm/artifacts/AcrossMessageHandlerMock.sol/AcrossMessageHandlerMock.json +1 -1
- package/dist/evm/artifacts/AdapterStore.sol/AdapterStore.json +1 -1
- package/dist/evm/artifacts/AdapterStore.sol/MessengerTypes.json +1 -1
- package/dist/evm/artifacts/Address.sol/Address.json +1 -1
- package/dist/evm/artifacts/AddressConverters.sol/Bytes32ToAddress.json +1 -1
- package/dist/evm/artifacts/AdminRelayTokensAdapter.sol/AdminRelayTokensAdapter.json +1 -1
- package/dist/evm/artifacts/AdminWithdrawManager.sol/AdminWithdrawManager.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/ArbitrumMockErc20GatewayRouter.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/Inbox.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/L2GatewayRouter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_Adapter.sol/Arbitrum_Adapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_CustomGasToken_Adapter.sol/Arbitrum_CustomGasToken_Adapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_Forwarder.sol/Arbitrum_Forwarder.json +1 -1
- package/dist/evm/artifacts/Arbitrum_RescueAdapter.sol/Arbitrum_RescueAdapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_SendTokensAdapter.sol/Arbitrum_SendTokensAdapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_SpokePool.sol/Arbitrum_SpokePool.json +1 -1
- package/dist/evm/artifacts/Arbitrum_WithdrawalHelper.sol/Arbitrum_WithdrawalHelper.json +1 -1
- package/dist/evm/artifacts/Base_Adapter.sol/Base_Adapter.json +1 -1
- package/dist/evm/artifacts/BeaconProxy.sol/BeaconProxy.json +1 -1
- package/dist/evm/artifacts/BondToken.sol/BondToken.json +1 -1
- package/dist/evm/artifacts/BytesLib.sol/BytesLib.json +1 -1
- package/dist/evm/artifacts/Cher_SpokePool.sol/Cher_SpokePool.json +1 -1
- package/dist/evm/artifacts/CircleCCTPAdapter.sol/CircleDomainIds.json +1 -1
- package/dist/evm/artifacts/Constants.sol/Constants.json +1 -1
- package/dist/evm/artifacts/Constants.sol/OptimisticOracleConstraints.json +1 -1
- package/dist/evm/artifacts/Constants.sol/OracleInterfaces.json +1 -1
- package/dist/evm/artifacts/CoreExecution.sol/CoreExecution.json +1 -1
- package/dist/evm/artifacts/CoreSimulatorLib.sol/HypeSystemContract.json +1 -1
- package/dist/evm/artifacts/CoreState.sol/CoreState.json +1 -1
- package/dist/evm/artifacts/CoreView.sol/CoreView.json +1 -1
- package/dist/evm/artifacts/CoreWriterLib.sol/CoreWriterLib.json +1 -1
- package/dist/evm/artifacts/CoreWriterSim.sol/CoreWriterSim.json +1 -1
- package/dist/evm/artifacts/CounterfactualBeacon.sol/CounterfactualBeacon.json +1 -1
- package/dist/evm/artifacts/CounterfactualBeaconBase.sol/CounterfactualBeaconBase.json +1 -1
- package/dist/evm/artifacts/CounterfactualBeaconBootstrap.sol/CounterfactualBeaconBootstrap.json +1 -1
- package/dist/evm/artifacts/CounterfactualConfig.sol/CounterfactualConfig.json +1 -1
- package/dist/evm/artifacts/CounterfactualDeposit.sol/CounterfactualDeposit.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositCCTP.sol/CounterfactualDepositCCTP.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositFactory.sol/CounterfactualDepositFactory.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositFactoryTron.sol/CounterfactualDepositFactoryTron.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositOFT.sol/CounterfactualDepositOFT.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositSpokePool.sol/CounterfactualDepositSpokePool.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositSpokePoolTr.sol/CounterfactualDepositSpokePoolTr.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositVanillaCCTP.sol/CounterfactualDepositVanillaCCTP.json +1 -1
- package/dist/evm/artifacts/CounterfactualNonces.sol/CounterfactualNonces.json +1 -0
- package/dist/evm/artifacts/Create2.sol/Create2.json +1 -1
- package/dist/evm/artifacts/CrossDomainEnabled.sol/CrossDomainEnabled.json +1 -1
- package/dist/evm/artifacts/DeployedAddresses.sol/DeployedAddresses.json +1 -1
- package/dist/evm/artifacts/DeploymentUtils.sol/DeploymentUtils.json +1 -1
- package/dist/evm/artifacts/DoctorWho_Adapter.sol/DoctorWho_Adapter.json +1 -1
- package/dist/evm/artifacts/DonationBox.sol/DonationBox.json +1 -1
- package/dist/evm/artifacts/DstOFTHandler.sol/DstOFTHandler.json +1 -1
- package/dist/evm/artifacts/ECDSA.sol/ECDSA.json +1 -1
- package/dist/evm/artifacts/ERC1155.sol/ERC1155.json +1 -1
- package/dist/evm/artifacts/ERC1967Proxy.sol/ERC1967Proxy.json +1 -1
- package/dist/evm/artifacts/ERC1967Utils.sol/ERC1967Utils.json +1 -1
- package/dist/evm/artifacts/ERC20.sol/ERC20.json +1 -1
- package/dist/evm/artifacts/Errors.sol/Errors.json +1 -1
- package/dist/evm/artifacts/Ethereum_Adapter.sol/Ethereum_Adapter.json +1 -1
- package/dist/evm/artifacts/Ethereum_RescueAdapter.sol/Ethereum_RescueAdapter.json +1 -1
- package/dist/evm/artifacts/Ethereum_SpokePool.sol/Ethereum_SpokePool.json +1 -1
- package/dist/evm/artifacts/ExpandedERC20.sol/ExpandedERC20.json +1 -1
- package/dist/evm/artifacts/ExpandedERC20WithBlacklist.sol/ExpandedERC20WithBlacklist.json +1 -1
- package/dist/evm/artifacts/HLConstants.sol/HLConstants.json +1 -1
- package/dist/evm/artifacts/HLConversions.sol/HLConversions.json +1 -1
- package/dist/evm/artifacts/HubPool.sol/HubPool.json +1 -1
- package/dist/evm/artifacts/HubPoolStore.sol/HubPoolStore.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/HubPoolTestBase.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockAddressWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockFinder.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockIdentifierWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockLpTokenFactory.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockOptimisticOracle.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockStore.json +1 -1
- package/dist/evm/artifacts/HyperCore.sol/HyperCore.json +1 -1
- package/dist/evm/artifacts/HyperCoreFlowExecutor.sol/HyperCoreFlowExecutor.json +1 -1
- package/dist/evm/artifacts/HyperCoreLib.sol/HyperCoreLib.json +1 -1
- package/dist/evm/artifacts/HyperliquidDepositHandler.sol/HyperliquidDepositHandler.json +1 -1
- package/dist/evm/artifacts/IAcrossV5Executor.sol/IAcrossV5Executor.json +1 -0
- package/dist/evm/artifacts/IAcrossV5ExecutorAdapter.sol/IAcrossV5ExecutorAdapter.json +1 -0
- package/dist/evm/artifacts/ICounterfactualBeacon.sol/ICounterfactualBeacon.json +1 -1
- package/dist/evm/artifacts/ICounterfactualBeaconBase.sol/ICounterfactualBeaconBase.json +1 -0
- package/dist/evm/artifacts/ICounterfactualDeposit.sol/ICounterfactualDeposit.json +1 -1
- package/dist/evm/artifacts/ICounterfactualDepositFactory.sol/ICounterfactualDepositFactory.json +1 -1
- package/dist/evm/artifacts/IGateway.sol/IGateway.json +1 -0
- package/dist/evm/artifacts/Lens_SpokePool.sol/Lens_SpokePool.json +1 -1
- package/dist/evm/artifacts/LibVariable.sol/LibVariable.json +1 -1
- package/dist/evm/artifacts/LineaMocks.sol/MockL2MessageService.json +1 -1
- package/dist/evm/artifacts/LineaMocks.sol/MockL2TokenBridge.json +1 -1
- package/dist/evm/artifacts/Linea_Adapter.sol/Linea_Adapter.json +1 -1
- package/dist/evm/artifacts/Linea_SpokePool.sol/Linea_SpokePool.json +1 -1
- package/dist/evm/artifacts/Lisk_Adapter.sol/Lisk_Adapter.json +1 -1
- package/dist/evm/artifacts/Lisk_SpokePool.sol/Lisk_SpokePool.json +1 -1
- package/dist/evm/artifacts/Lockable.sol/Lockable.json +1 -1
- package/dist/evm/artifacts/LpTokenFactory.sol/LpTokenFactory.json +1 -1
- package/dist/evm/artifacts/Merkle.sol/Merkle.json +1 -1
- package/dist/evm/artifacts/MerkleDistributor.sol/MerkleDistributor.json +1 -1
- package/dist/evm/artifacts/MerkleLibTest.sol/MerkleLibTest.json +1 -1
- package/dist/evm/artifacts/MerkleProof.sol/MerkleProof.json +1 -1
- package/dist/evm/artifacts/MinimalLZOptions.sol/MinimalLZOptions.json +1 -1
- package/dist/evm/artifacts/MintableERC1155.sol/MintableERC1155.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockCrossDomainMessenger.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockL1StandardBridge.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockL2StandardBridge.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessageTransmitter.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessenger.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessengerV2.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMinter.json +1 -1
- package/dist/evm/artifacts/MockCaller.sol/MockCaller.json +1 -1
- package/dist/evm/artifacts/MockERC1271.sol/MockERC1271.json +1 -1
- package/dist/evm/artifacts/MockERC20.sol/MintableERC20.json +1 -1
- package/dist/evm/artifacts/MockERC20.sol/MockERC20.json +1 -1
- package/dist/evm/artifacts/MockEndpoint.sol/MockEndpoint.json +1 -1
- package/dist/evm/artifacts/MockGateway.sol/MockGateway.json +1 -0
- package/dist/evm/artifacts/MockHubPool.sol/MockHubPool.json +1 -1
- package/dist/evm/artifacts/MockOFTMessenger.sol/MockOFTMessenger.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/MockPermit2.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/Permit2EIP712.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/SignatureVerification.json +1 -1
- package/dist/evm/artifacts/MockSpokePool.sol/MockSpokePool.json +1 -1
- package/dist/evm/artifacts/MockSpokePoolV2.sol/MockSpokePoolV2.json +1 -1
- package/dist/evm/artifacts/MockTronUSDT.sol/MockTronUSDT.json +1 -1
- package/dist/evm/artifacts/MockZkStackBridgeHub.sol/MockBridgeHub.json +1 -1
- package/dist/evm/artifacts/Mock_Adapter.sol/Mock_Adapter.json +1 -1
- package/dist/evm/artifacts/Mock_Adapter.sol/Mock_Bridge.json +1 -1
- package/dist/evm/artifacts/Mode_Adapter.sol/Mode_Adapter.json +1 -1
- package/dist/evm/artifacts/MultiCaller.sol/MultiCaller.json +1 -1
- package/dist/evm/artifacts/MultiCallerUpgradeable.sol/MultiCallerUpgradeable.json +1 -1
- package/dist/evm/artifacts/Multicall3.sol/Multicall3.json +1 -1
- package/dist/evm/artifacts/MulticallHandler.sol/MulticallHandler.json +1 -1
- package/dist/evm/artifacts/OFTTransportAdapter.sol/OFTTransportAdapter.json +1 -1
- package/dist/evm/artifacts/OFTTransportAdapterWithStore.sol/OFTTransportAdapterWithStore.json +1 -1
- package/dist/evm/artifacts/OP_Adapter.sol/OP_Adapter.json +1 -1
- package/dist/evm/artifacts/OP_SpokePool.sol/OP_SpokePool.json +1 -1
- package/dist/evm/artifacts/Ovm_Forwarder.sol/Ovm_Forwarder.json +1 -1
- package/dist/evm/artifacts/Ovm_SpokePool.sol/Ovm_SpokePool.json +1 -1
- package/dist/evm/artifacts/Ovm_WithdrawalHelper.sol/Ovm_WithdrawalHelper.json +1 -1
- package/dist/evm/artifacts/PeripherySigningLib.sol/PeripherySigningLib.json +1 -1
- package/dist/evm/artifacts/PermissionedMulticallHandler.sol/PermissionedMulticallHandler.json +1 -1
- package/dist/evm/artifacts/PolygonERC20Test.sol/PolygonERC20Test.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/DepositManagerMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/FxStateSenderMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonERC20Mock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonERC20PredicateMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonRegistryMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/RootChainManagerMock.json +1 -1
- package/dist/evm/artifacts/PolygonTokenBridger.sol/PolygonTokenBridger.json +1 -1
- package/dist/evm/artifacts/Polygon_Adapter.sol/Polygon_Adapter.json +1 -1
- package/dist/evm/artifacts/Polygon_SpokePool.sol/Polygon_SpokePool.json +1 -1
- package/dist/evm/artifacts/PrecompileLib.sol/PrecompileLib.json +1 -1
- package/dist/evm/artifacts/PrecompileSim.sol/PrecompileSim.json +1 -1
- package/dist/evm/artifacts/ProxyAdmin.sol/ProxyAdmin.json +1 -1
- package/dist/evm/artifacts/Router_Adapter.sol/Router_Adapter.json +1 -1
- package/dist/evm/artifacts/SP1AutoVerifier.sol/SP1AutoVerifier.json +1 -1
- package/dist/evm/artifacts/SP1Helios.sol/SP1Helios.json +1 -1
- package/dist/evm/artifacts/SP1MockVerifier.sol/SP1MockVerifier.json +1 -1
- package/dist/evm/artifacts/SafeCast.sol/SafeCast.json +1 -1
- package/dist/evm/artifacts/SafeERC20.sol/SafeERC20.json +1 -1
- package/dist/evm/artifacts/ShortStrings.sol/ShortStrings.json +1 -1
- package/dist/evm/artifacts/Solana_Adapter.sol/Solana_Adapter.json +1 -1
- package/dist/evm/artifacts/SpokePool.sol/SpokePool.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SwapProxy.json +1 -1
- package/dist/evm/artifacts/SpokePoolVerifier.sol/SpokePoolVerifier.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPDstPeriphery.sol/SponsoredCCTPDstPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPSrcPeriphery.sol/SponsoredCCTPSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredOFTSrcPeriphery.sol/SponsoredOFTSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/StdConfig.sol/StdConfig.json +1 -1
- package/dist/evm/artifacts/Strings.sol/Strings.json +1 -1
- package/dist/evm/artifacts/SwapHandler.sol/SwapHandler.json +1 -1
- package/dist/evm/artifacts/Timer.sol/Timer.json +1 -1
- package/dist/evm/artifacts/TransferProxy.sol/TransferProxy.json +1 -1
- package/dist/evm/artifacts/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1 -1
- package/dist/evm/artifacts/TronMulticallHandler.sol/TronMulticallHandler.json +1 -1
- package/dist/evm/artifacts/TronTransferLib.sol/TronTransferLib.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePool.sol/Tron_SpokePool.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SpokePoolPeriphery.json +1 -0
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SwapProxy.json +1 -0
- package/dist/evm/artifacts/Universal_Adapter.sol/Universal_Adapter.json +1 -1
- package/dist/evm/artifacts/Universal_SpokePool.sol/Universal_SpokePool.json +1 -1
- package/dist/evm/artifacts/UpgradeableBeacon.sol/UpgradeableBeacon.json +1 -1
- package/dist/evm/artifacts/V5SpokePoolInterface.sol/V5SpokePoolInterface.json +1 -0
- package/dist/evm/artifacts/WETH9.sol/WETH9.json +1 -1
- package/dist/evm/artifacts/WithdrawImplementation.sol/WithdrawImplementation.json +1 -1
- package/dist/evm/artifacts/WithdrawImplementationTron.sol/WithdrawImplementationTron.json +1 -1
- package/dist/evm/artifacts/ZkStack_Adapter.sol/ZkStack_Adapter.json +1 -1
- package/dist/evm/artifacts/ZkStack_CustomGasToken_Adapter.sol/ZkStack_CustomGasToken_Adapter.json +1 -1
- package/dist/evm/artifacts/ZkSyncMocks.sol/MockL2Eth.json +1 -1
- package/dist/evm/artifacts/ZkSyncMocks.sol/MockZkBridge.json +1 -1
- package/dist/evm/artifacts/ZkSync_SpokePool.sol/ZkSync_SpokePool.json +1 -1
- package/dist/evm/artifacts/Zora_Adapter.sol/Zora_Adapter.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/SimpleContract.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/SpokePoolEIP7702Test.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/TestableMockSpokePool.json +1 -1
- package/dist/src/consts.d.ts +2 -0
- package/dist/src/consts.js +21 -47
- package/dist/src/svm/assets/idl/svm_spoke.json +9 -4
- package/dist/src/svm/assets/svm_spoke.d.ts +9 -4
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.d.ts +3 -1
- package/dist/src/svm/clients/SvmSpoke/errors/svmSpoke.js +4 -1
- package/dist/src/types/svm.d.ts +44 -0
- package/dist/target/types/svm_spoke.d.ts +9 -4
- package/package.json +12 -6
- package/contracts/chain-adapters/Blast_Adapter.sol +0 -127
- package/contracts/chain-adapters/Blast_RescueAdapter.sol +0 -47
- package/contracts/chain-adapters/Boba_Adapter.sol +0 -78
- package/contracts/chain-adapters/Optimism_Adapter.sol +0 -118
- package/contracts/chain-adapters/PolygonZkEVM_Adapter.sol +0 -75
- package/contracts/chain-adapters/Scroll_Adapter.sol +0 -144
- package/contracts/external/interfaces/IPolygonZkEVMBridge.sol +0 -40
- package/contracts/hub-pool/Blast_DaiRetriever.sol +0 -59
- package/contracts/hub-pool/PermissionSplitterProxy.sol +0 -128
- package/contracts/spoke-pools/Blast_SpokePool.sol +0 -161
- package/contracts/spoke-pools/Boba_SpokePool.sol +0 -45
- package/contracts/spoke-pools/Ink_SpokePool.sol +0 -72
- package/contracts/spoke-pools/Optimism_SpokePool.sol +0 -66
- package/contracts/spoke-pools/PolygonZkEVM_SpokePool.sol +0 -217
- package/contracts/spoke-pools/Scroll_SpokePool.sol +0 -153
- package/contracts/spoke-pools/WorldChain_SpokePool.sol +0 -72
- package/contracts/test/MockBlastUsdYieldManager.sol +0 -20
- package/contracts/test/MockOptimism_SpokePool.sol +0 -22
- package/contracts/test/PolygonZkEVMMocks.sol +0 -72
- package/contracts/test/ScrollMocks.sol +0 -109
- package/dist/evm/artifacts/Blast_Adapter.sol/Blast_Adapter.json +0 -1
- package/dist/evm/artifacts/Blast_Adapter.sol/IL1ERC20Bridge.json +0 -1
- package/dist/evm/artifacts/Blast_DaiRetriever.sol/Blast_DaiRetriever.json +0 -1
- package/dist/evm/artifacts/Blast_DaiRetriever.sol/USDYieldManager.json +0 -1
- package/dist/evm/artifacts/Blast_RescueAdapter.sol/Blast_RescueAdapter.json +0 -1
- package/dist/evm/artifacts/Blast_SpokePool.sol/Blast_SpokePool.json +0 -1
- package/dist/evm/artifacts/Blast_SpokePool.sol/IBlast.json +0 -1
- package/dist/evm/artifacts/Blast_SpokePool.sol/IERC20Rebasing.json +0 -1
- package/dist/evm/artifacts/Blast_SpokePool.sol/IUSDBL2Bridge.json +0 -1
- package/dist/evm/artifacts/Boba_Adapter.sol/Boba_Adapter.json +0 -1
- package/dist/evm/artifacts/Boba_SpokePool.sol/Boba_SpokePool.json +0 -1
- package/dist/evm/artifacts/IL1ERC20Gateway.sol/IL1ERC20Gateway.json +0 -1
- package/dist/evm/artifacts/IL1ETHGateway.sol/IL1ETHGateway.json +0 -1
- package/dist/evm/artifacts/IL1GatewayRouter.sol/IL1GatewayRouter.json +0 -1
- package/dist/evm/artifacts/IL1ScrollMessenger.sol/IL1ScrollMessenger.json +0 -1
- package/dist/evm/artifacts/IL2ERC20Gateway.sol/IL2ERC20Gateway.json +0 -1
- package/dist/evm/artifacts/IL2ETHGateway.sol/IL2ETHGateway.json +0 -1
- package/dist/evm/artifacts/IL2GasPriceOracle.sol/IL2GasPriceOracle.json +0 -1
- package/dist/evm/artifacts/IL2GatewayRouter.sol/IL2GatewayRouter.json +0 -1
- package/dist/evm/artifacts/IPolygonZkEVMBridge.sol/IPolygonZkEVMBridge.json +0 -1
- package/dist/evm/artifacts/IScrollMessenger.sol/IScrollMessenger.json +0 -1
- package/dist/evm/artifacts/Ink_SpokePool.sol/Ink_SpokePool.json +0 -1
- package/dist/evm/artifacts/MockBlastUsdYieldManager.sol/MockBlastUsdYieldManager.json +0 -1
- package/dist/evm/artifacts/MockOptimism_SpokePool.sol/MockOptimism_SpokePool.json +0 -1
- package/dist/evm/artifacts/Optimism_Adapter.sol/Optimism_Adapter.json +0 -1
- package/dist/evm/artifacts/Optimism_Adapter.sol/SynthetixBridgeToOptimism.json +0 -1
- package/dist/evm/artifacts/Optimism_SpokePool.sol/Optimism_SpokePool.json +0 -1
- package/dist/evm/artifacts/Optimism_SpokePool.sol/SynthetixBridgeToBase.json +0 -1
- package/dist/evm/artifacts/PermissionSplitterProxy.sol/PermissionSplitterProxy.json +0 -1
- package/dist/evm/artifacts/PolygonZkEVMMocks.sol/MockPolygonZkEVMBridge.json +0 -1
- package/dist/evm/artifacts/PolygonZkEVM_Adapter.sol/PolygonZkEVM_Adapter.json +0 -1
- package/dist/evm/artifacts/PolygonZkEVM_SpokePool.sol/IBridgeMessageReceiver.json +0 -1
- package/dist/evm/artifacts/PolygonZkEVM_SpokePool.sol/PolygonZkEVM_SpokePool.json +0 -1
- package/dist/evm/artifacts/ScrollMocks.sol/MockScrollL2GatewayRouter.json +0 -1
- package/dist/evm/artifacts/ScrollMocks.sol/MockScrollMessenger.json +0 -1
- package/dist/evm/artifacts/Scroll_Adapter.sol/Scroll_Adapter.json +0 -1
- package/dist/evm/artifacts/Scroll_SpokePool.sol/IL2GatewayRouterExtended.json +0 -1
- package/dist/evm/artifacts/Scroll_SpokePool.sol/Scroll_SpokePool.json +0 -1
- package/dist/evm/artifacts/WorldChain_SpokePool.sol/WorldChain_SpokePool.json +0 -1
package/README.md
CHANGED
|
@@ -35,6 +35,10 @@ yarn build # Will build all code. Compile solidity & rust (local toolchain), gen
|
|
|
35
35
|
yarn build-verified # Will build all code. Compile solidity & rust (verified docker build), generate ts outputs
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
EVM builds and tests use the Foundry version pinned in `.foundry-version`; CI installs exactly that version via
|
|
39
|
+
`foundry-rs/foundry-toolchain`. Run `yarn pin-foundry` to switch your local toolchain to it (a no-op when it already
|
|
40
|
+
matches). Bump the pin by editing that file.
|
|
41
|
+
|
|
38
42
|
## Test
|
|
39
43
|
|
|
40
44
|
```shell
|
|
@@ -9,7 +9,7 @@ import { ICrossDomainMessenger } from "@eth-optimism/contracts/libraries/bridge/
|
|
|
9
9
|
* @custom:security-contact bugs@across.to
|
|
10
10
|
* @dev Helper contract for contracts performing cross-domain communications between L1 and Optimism.
|
|
11
11
|
* @dev This modifies the eth-optimism/CrossDomainEnabled contract only by changing state variables to be
|
|
12
|
-
* immutable for use in
|
|
12
|
+
* immutable for use in the OP stack adapters, which use delegateCall().
|
|
13
13
|
*/
|
|
14
14
|
contract CrossDomainEnabled {
|
|
15
15
|
// Messenger contract used to send and receive messages from the other domain.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @notice Across V5 executor interface. The Gateway calls the path-committed executor through this entrypoint
|
|
6
|
+
* after verifying the path and running the funding loop. Canonical definition lives in the Across V5 periphery
|
|
7
|
+
* repository.
|
|
8
|
+
*/
|
|
9
|
+
interface IAcrossV5Executor {
|
|
10
|
+
/// @notice Execute a path's committed message.
|
|
11
|
+
/// @param message The path-committed message.
|
|
12
|
+
/// @param executorMessage Submitter-provided dynamic data.
|
|
13
|
+
function executeAcrossV5(bytes calldata message, bytes calldata executorMessage) external payable;
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @notice Across V5 adapter interface for stateful Executor handoffs (ADAPTER_CALL command targets). Canonical
|
|
6
|
+
* definition lives in the Across V5 periphery repository.
|
|
7
|
+
* @dev No return value: the Executor invokes adapters with a raw low-level call and discards success returndata,
|
|
8
|
+
* so adapter results must be observed via state or balance requirements.
|
|
9
|
+
*/
|
|
10
|
+
interface IAcrossV5ExecutorAdapter {
|
|
11
|
+
/// @param input Tape-committed adapter input.
|
|
12
|
+
/// @param jitData Submitter-provided dynamic data.
|
|
13
|
+
function adapterExecuteAcrossV5(bytes calldata input, bytes calldata jitData) external payable;
|
|
14
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @notice Read-only subset of the Across V5 Gateway interface: the live execution-context getters the SpokePool
|
|
6
|
+
* needs to authenticate and parameterize V5 fills. The canonical, full interface lives in the Across V5
|
|
7
|
+
* periphery repository. All getters are backed by transient storage on the Gateway and return zero values when
|
|
8
|
+
* no execution is in flight.
|
|
9
|
+
*/
|
|
10
|
+
interface IGateway {
|
|
11
|
+
/// @notice Active step id (the Merkle root) for the currently executing step, or bytes32(0) when idle.
|
|
12
|
+
function currentStepId() external view returns (bytes32);
|
|
13
|
+
|
|
14
|
+
/// @notice Active path id (the path's Merkle leaf hash) for the currently executing step, or bytes32(0) when idle.
|
|
15
|
+
function currentPathId() external view returns (bytes32);
|
|
16
|
+
|
|
17
|
+
/// @notice Active submitter (the `execute()` caller) for the currently executing step, or address(0) when idle.
|
|
18
|
+
function currentSubmitter() external view returns (address);
|
|
19
|
+
|
|
20
|
+
/// @notice The committed executor of the currently executing step, or address(0) when no executor call is in
|
|
21
|
+
/// flight. The Gateway sets this immediately before calling the committed executor and clears it right after
|
|
22
|
+
/// the call returns — so it reads zero while idle AND while the uncommitted funding loop runs. That is what
|
|
23
|
+
/// makes `msg.sender == currentExecutor()` the complete funding-adapter boundary check.
|
|
24
|
+
function currentExecutor() external view returns (address);
|
|
25
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: BUSL-1.1
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ICounterfactualBeaconBase } from "./ICounterfactualBeaconBase.sol";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @title ICounterfactualBeacon
|
|
@@ -15,19 +15,7 @@ import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
|
|
|
15
15
|
* @dev `implementation()` is the **counterfactual** implementation (beacon target), not the registry's own.
|
|
16
16
|
* @custom:security-contact bugs@across.to
|
|
17
17
|
*/
|
|
18
|
-
interface ICounterfactualBeacon is
|
|
19
|
-
/// @notice Emitted when the admin sets the global implementation (the beacon target).
|
|
20
|
-
event ImplementationSet(address indexed implementation);
|
|
21
|
-
|
|
22
|
-
/// @notice Emitted when the admin sets the upgrade-tree root.
|
|
23
|
-
event UpgradeRootSet(bytes32 indexed upgradeRoot);
|
|
24
|
-
|
|
25
|
-
// `implementation()` is inherited from `IBeacon` — the canonical implementation every counterfactual
|
|
26
|
-
// proxy runs (resolved live by each `BeaconProxy`).
|
|
27
|
-
|
|
28
|
-
/// @notice Root of the `(proxy, latestRoot)` merkle tree authorizing per-proxy root updates.
|
|
29
|
-
function upgradeRoot() external view returns (bytes32);
|
|
30
|
-
|
|
18
|
+
interface ICounterfactualBeacon is ICounterfactualBeaconBase {
|
|
31
19
|
// --- Chain-specific config (immutable; read by leaf implementations under delegatecall) ---
|
|
32
20
|
|
|
33
21
|
/// @notice Off-chain signer that authorizes runtime execution fees for every leaf implementation.
|
|
@@ -61,12 +49,25 @@ interface ICounterfactualBeacon is IBeacon {
|
|
|
61
49
|
/// @notice LayerZero OFT source endpoint id for this chain.
|
|
62
50
|
function oftSrcEid() external view returns (uint32);
|
|
63
51
|
|
|
64
|
-
/// @notice USDC token address on this chain.
|
|
52
|
+
/// @notice Native (Circle-issued or chain-canonical) USDC token address on this chain.
|
|
65
53
|
function usdc() external view returns (address);
|
|
66
54
|
|
|
55
|
+
/// @notice Bridged USDC.e token address, where it exists as a token distinct from `usdc()` — a
|
|
56
|
+
/// separate input token with its own cap, serving SpokePool routes only (bridged USDC has
|
|
57
|
+
/// no CCTP burn path). Zero where USDC.e is absent or identical to native USDC.
|
|
58
|
+
function usdce() external view returns (address);
|
|
59
|
+
|
|
67
60
|
/// @notice USDT token address on this chain.
|
|
68
61
|
function usdt() external view returns (address);
|
|
69
62
|
|
|
63
|
+
/// @notice WBTC token address on this chain.
|
|
64
|
+
function wbtc() external view returns (address);
|
|
65
|
+
|
|
66
|
+
/// @notice Canonical WETH ERC-20 on this chain — an input token like `usdc`/`usdt`/`wbtc`, distinct
|
|
67
|
+
/// from `wrappedNativeToken()` (the wrapped GAS token; identical to WETH only on ETH-gas
|
|
68
|
+
/// chains). Lets leaves route actual WETH on chains whose native asset is not ETH.
|
|
69
|
+
function weth() external view returns (address);
|
|
70
|
+
|
|
70
71
|
// --- Per-(token, bridge) execution-fee caps (input-token units). A leaf names which to enforce via its
|
|
71
72
|
// `maxExecutionFeeGetter` selector. Illustrative set; for SpokePool this is the fixed fee component. ---
|
|
72
73
|
|
|
@@ -83,9 +84,17 @@ interface ICounterfactualBeacon is IBeacon {
|
|
|
83
84
|
/// @notice Max (fixed) fee for the USDC SpokePool route.
|
|
84
85
|
function usdcSpokePoolMaxExecutionFee() external view returns (uint256);
|
|
85
86
|
|
|
87
|
+
/// @notice Max (fixed) fee for the USDC.e SpokePool route, in USDC.e units.
|
|
88
|
+
function usdceSpokePoolMaxExecutionFee() external view returns (uint256);
|
|
89
|
+
|
|
86
90
|
/// @notice Max (fixed) fee for the USDT SpokePool route.
|
|
87
91
|
function usdtSpokePoolMaxExecutionFee() external view returns (uint256);
|
|
88
92
|
|
|
89
|
-
/// @notice Max (fixed) fee for the WETH
|
|
93
|
+
/// @notice Max (fixed) fee for the WETH SpokePool route, in WETH units. On ETH-gas chains this also
|
|
94
|
+
/// caps the native (msg.value) route, since the wrapped gas token IS WETH there; non-ETH-gas
|
|
95
|
+
/// chains do not get wrapped-native routes.
|
|
90
96
|
function wethSpokePoolMaxExecutionFee() external view returns (uint256);
|
|
97
|
+
|
|
98
|
+
/// @notice Max (fixed) fee for the WBTC SpokePool route.
|
|
99
|
+
function wbtcSpokePoolMaxExecutionFee() external view returns (uint256);
|
|
91
100
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title ICounterfactualBeaconBase
|
|
8
|
+
* @notice The registry/beacon's own surface: the `implementation()` every counterfactual `BeaconProxy`
|
|
9
|
+
* resolves, and the `upgradeRoot()` authorizing best-effort per-proxy root updates. This is what
|
|
10
|
+
* `CounterfactualBeaconBase` implements and all a consumer of the beacon-as-beacon needs; the
|
|
11
|
+
* chain-specific configuration lives in a config interface extending this one
|
|
12
|
+
* (`ICounterfactualBeacon` for this repo's beacon).
|
|
13
|
+
* @dev Split out from `ICounterfactualBeacon` deliberately: `CounterfactualBeaconBase` is pure registry
|
|
14
|
+
* logic and should not inherit an obligation to expose config getters it does not own. Keeping them
|
|
15
|
+
* apart is also what lets a config surface be declared independently of this repo's v4 getter set.
|
|
16
|
+
* @custom:security-contact bugs@across.to
|
|
17
|
+
*/
|
|
18
|
+
interface ICounterfactualBeaconBase is IBeacon {
|
|
19
|
+
/// @notice Emitted when the admin sets the global implementation (the beacon target).
|
|
20
|
+
event ImplementationSet(address indexed implementation);
|
|
21
|
+
|
|
22
|
+
/// @notice Emitted when the admin sets the upgrade-tree root.
|
|
23
|
+
event UpgradeRootSet(bytes32 indexed upgradeRoot);
|
|
24
|
+
|
|
25
|
+
// `implementation()` is inherited from `IBeacon` — the canonical implementation every counterfactual
|
|
26
|
+
// proxy runs (resolved live by each `BeaconProxy`).
|
|
27
|
+
|
|
28
|
+
/// @notice Root of the `(proxy, latestRoot)` merkle tree authorizing per-proxy root updates.
|
|
29
|
+
function upgradeRoot() external view returns (bytes32);
|
|
30
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// SPDX-License-Identifier: BUSL-1.1
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
+
import { ICounterfactualBeaconBase } from "./ICounterfactualBeaconBase.sol";
|
|
5
|
+
|
|
4
6
|
/**
|
|
5
7
|
* @title ICounterfactualDeposit
|
|
6
8
|
* @notice Interface for the merkle-dispatched counterfactual deposit clone.
|
|
@@ -10,6 +12,24 @@ interface ICounterfactualDeposit {
|
|
|
10
12
|
/// @dev Merkle proof verification failed.
|
|
11
13
|
error InvalidProof();
|
|
12
14
|
|
|
15
|
+
/// @dev Merkle proof against the beacon's `(proxy, latestRoot)` upgrade tree failed.
|
|
16
|
+
error InvalidUpgradeProof();
|
|
17
|
+
|
|
18
|
+
/// @dev New root equals the current `activeRoot` (no-op).
|
|
19
|
+
error RootUnchanged();
|
|
20
|
+
|
|
21
|
+
/// @notice Emitted when `activeRoot` is updated via the beacon's upgrade tree.
|
|
22
|
+
event RootUpdated(bytes32 newRoot);
|
|
23
|
+
|
|
24
|
+
/// @notice The per-chain registry/beacon this proxy resolves its implementation from, and the source
|
|
25
|
+
/// of the `upgradeRoot` that `updateRoot` proves against.
|
|
26
|
+
/// @dev Typed to the registry surface only — the dispatcher reads no chain config, so this is
|
|
27
|
+
/// `ICounterfactualBeaconBase` rather than a config interface.
|
|
28
|
+
function BEACON() external view returns (ICounterfactualBeaconBase);
|
|
29
|
+
|
|
30
|
+
/// @notice The merkle root authorizing this proxy's deposit routes.
|
|
31
|
+
function activeRoot() external view returns (bytes32);
|
|
32
|
+
|
|
13
33
|
/**
|
|
14
34
|
* @notice Execute an implementation by proving its inclusion in the clone's merkle tree.
|
|
15
35
|
* @param implementation The implementation contract to delegatecall.
|
|
@@ -44,4 +64,14 @@ interface ICounterfactualDeposit {
|
|
|
44
64
|
bytes calldata submitterData,
|
|
45
65
|
bytes32[] calldata executeProof
|
|
46
66
|
) external payable;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @notice Update `activeRoot` to `newRoot`, proving `(address(this), newRoot)` is in the beacon's
|
|
70
|
+
* upgrade tree.
|
|
71
|
+
* @dev Permissionless. Root updates are best-effort — a proxy keeps its `activeRoot` until someone
|
|
72
|
+
* updates it; there is no on-chain version or min-version gate.
|
|
73
|
+
* @param newRoot The root to bring the proxy to.
|
|
74
|
+
* @param proof Merkle proof for the (proxy, newRoot) leaf in the beacon's upgrade tree.
|
|
75
|
+
*/
|
|
76
|
+
function updateRoot(bytes32 newRoot, bytes32[] calldata proof) external;
|
|
47
77
|
}
|
|
@@ -3,80 +3,59 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @title ICounterfactualDepositFactory
|
|
6
|
-
* @notice
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* @notice The deterministic deployer for counterfactual `BeaconProxy` instances. A proxy's address is
|
|
7
|
+
* `f(salt, initialRoot)`, because the `initialize(initialRoot)` call data sits in the proxy's init
|
|
8
|
+
* code — so a depositor can be quoted an address before anything is deployed, and the proxy can be
|
|
9
|
+
* created later (or never, if funds are swept by another route).
|
|
10
|
+
* @dev Implemented by `CounterfactualDepositFactory`. Cross-chain address parity requires the factory and
|
|
11
|
+
* the beacon to sit at identical addresses on every chain, and the caller to reuse the same `salt`;
|
|
12
|
+
* `salt = 0` is the canonical choice, giving one address per `initialRoot`. Chain-specific variants
|
|
13
|
+
* (e.g. `CounterfactualDepositFactoryTron`, for Tron's 0x41 CREATE2 prefix) override prediction only.
|
|
9
14
|
* @custom:security-contact bugs@across.to
|
|
10
15
|
*/
|
|
11
16
|
interface ICounterfactualDepositFactory {
|
|
12
|
-
/// @notice Emitted when a
|
|
13
|
-
event
|
|
14
|
-
address indexed depositAddress,
|
|
15
|
-
address indexed counterfactualDepositImplementation,
|
|
16
|
-
bytes32 indexed paramsHash,
|
|
17
|
-
bytes32 salt
|
|
18
|
-
);
|
|
17
|
+
/// @notice Emitted when a counterfactual proxy is deployed.
|
|
18
|
+
event CounterfactualDeployed(address indexed counterfactual, bytes32 initialRoot);
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* @param counterfactualDepositImplementation Implementation contract address.
|
|
23
|
-
* @param paramsHash keccak256 hash of the ABI-encoded route parameters.
|
|
24
|
-
* @param salt Unique salt for address generation.
|
|
25
|
-
* @return Predicted address.
|
|
26
|
-
*/
|
|
27
|
-
function predictDepositAddress(
|
|
28
|
-
address counterfactualDepositImplementation,
|
|
29
|
-
bytes32 paramsHash,
|
|
30
|
-
bytes32 salt
|
|
31
|
-
) external view returns (address);
|
|
20
|
+
/// @notice The beacon (the `CounterfactualBeacon`) every deployed proxy points at.
|
|
21
|
+
function BEACON() external view returns (address);
|
|
32
22
|
|
|
33
23
|
/**
|
|
34
|
-
* @notice
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @
|
|
38
|
-
* @return depositAddress Address of deployed clone.
|
|
24
|
+
* @notice Predict the proxy address for a given `salt` and `initialRoot`, deployed or not.
|
|
25
|
+
* @param salt CREATE2 salt; `0` for the canonical address of this `initialRoot`.
|
|
26
|
+
* @param initialRoot The proxy's initial route tree, bound into its address via the init code.
|
|
27
|
+
* @return The counterfactual address.
|
|
39
28
|
*/
|
|
40
|
-
function
|
|
41
|
-
address counterfactualDepositImplementation,
|
|
42
|
-
bytes32 paramsHash,
|
|
43
|
-
bytes32 salt
|
|
44
|
-
) external returns (address depositAddress);
|
|
29
|
+
function predictAddress(bytes32 salt, bytes32 initialRoot) external view returns (address);
|
|
45
30
|
|
|
46
31
|
/**
|
|
47
|
-
* @notice
|
|
48
|
-
*
|
|
49
|
-
* @
|
|
32
|
+
* @notice Deploy the proxy for `salt` and `initialRoot`, already initialized and resolving its
|
|
33
|
+
* implementation live from the beacon. Reverts if it is already deployed.
|
|
34
|
+
* @return counterfactual The deployed proxy address.
|
|
50
35
|
*/
|
|
51
|
-
function
|
|
36
|
+
function deploy(bytes32 salt, bytes32 initialRoot) external returns (address counterfactual);
|
|
52
37
|
|
|
53
38
|
/**
|
|
54
|
-
* @notice
|
|
55
|
-
* @
|
|
56
|
-
* @param
|
|
57
|
-
* @
|
|
58
|
-
* @param executeCalldata Calldata to forward to the clone.
|
|
59
|
-
* @return depositAddress Address of deployed clone.
|
|
39
|
+
* @notice Deploy the proxy, then forward `executeCalldata` to it. Reverts if already deployed.
|
|
40
|
+
* @dev Any `msg.value` is forwarded with the call; a revert in the proxy is bubbled up verbatim.
|
|
41
|
+
* @param executeCalldata Calldata for the proxy (e.g. `abi.encodeCall(ICounterfactualDeposit.execute, …)`).
|
|
42
|
+
* @return counterfactual The deployed proxy address.
|
|
60
43
|
*/
|
|
61
44
|
function deployAndExecute(
|
|
62
|
-
address counterfactualDepositImplementation,
|
|
63
|
-
bytes32 paramsHash,
|
|
64
45
|
bytes32 salt,
|
|
46
|
+
bytes32 initialRoot,
|
|
65
47
|
bytes calldata executeCalldata
|
|
66
|
-
) external payable returns (address
|
|
48
|
+
) external payable returns (address counterfactual);
|
|
67
49
|
|
|
68
50
|
/**
|
|
69
|
-
* @notice
|
|
70
|
-
*
|
|
71
|
-
* @param
|
|
72
|
-
* @
|
|
73
|
-
* @param executeCalldata Calldata to forward to the clone.
|
|
74
|
-
* @return depositAddress Address of deployed clone.
|
|
51
|
+
* @notice Deploy the proxy if it does not exist yet, then forward `executeCalldata` to it. Idempotent
|
|
52
|
+
* in the deployment step, so this is the safe entry point when a proxy may already be live.
|
|
53
|
+
* @param executeCalldata Calldata for the proxy (e.g. `abi.encodeCall(ICounterfactualDeposit.execute, …)`).
|
|
54
|
+
* @return counterfactual The proxy address, newly deployed or pre-existing.
|
|
75
55
|
*/
|
|
76
56
|
function deployIfNeededAndExecute(
|
|
77
|
-
address counterfactualDepositImplementation,
|
|
78
|
-
bytes32 paramsHash,
|
|
79
57
|
bytes32 salt,
|
|
58
|
+
bytes32 initialRoot,
|
|
80
59
|
bytes calldata executeCalldata
|
|
81
|
-
) external payable returns (address
|
|
60
|
+
) external payable returns (address counterfactual);
|
|
82
61
|
}
|
|
@@ -51,9 +51,13 @@ interface SpokePoolPeripheryInterface {
|
|
|
51
51
|
// The account that can exclusively fill the deposit before the exclusivity parameter.
|
|
52
52
|
bytes32 exclusiveRelayer;
|
|
53
53
|
// Timestamp of the deposit used by system to charge fees. Must be within short window of time into the past
|
|
54
|
-
// relative to this chain's current time or deposit will revert.
|
|
54
|
+
// relative to this chain's current time or deposit will revert. If this value is at most
|
|
55
|
+
// SpokePoolPeriphery.MAX_RELATIVE_TIME_SECONDS (one year), it is instead interpreted as an age in seconds
|
|
56
|
+
// which the periphery subtracts from block.timestamp; 0 therefore means "as of the current block".
|
|
55
57
|
uint32 quoteTimestamp;
|
|
56
|
-
// The timestamp on the destination chain after which this deposit can no longer be filled.
|
|
58
|
+
// The timestamp on the destination chain after which this deposit can no longer be filled. If this value is
|
|
59
|
+
// at most SpokePoolPeriphery.MAX_RELATIVE_TIME_SECONDS (one year), it is instead interpreted as an offset
|
|
60
|
+
// which the periphery adds to block.timestamp.
|
|
57
61
|
uint32 fillDeadline;
|
|
58
62
|
// The timestamp or offset on the destination chain after which anyone can fill the deposit. A detailed description on
|
|
59
63
|
// how the parameter is interpreted by the V3 spoke pool can be found at https://github.com/across-protocol/contracts/blob/fa67f5e97eabade68c67127f2261c2d44d9b007e/contracts/SpokePool.sol#L476
|
|
@@ -122,8 +126,10 @@ interface SpokePoolPeripheryInterface {
|
|
|
122
126
|
* @param exclusiveRelayer Address (as bytes32) of the relayer who has exclusive rights to fill this deposit. Can be set to
|
|
123
127
|
* 0x0 if no period is desired. If so, then must set exclusivityParameter to 0.
|
|
124
128
|
* @param quoteTimestamp Timestamp used by relayers to compute this deposit's realizedLPFeePct which is paid
|
|
125
|
-
* to LP pool on HubPool.
|
|
126
|
-
*
|
|
129
|
+
* to LP pool on HubPool. Values at or below SpokePoolPeriphery.MAX_RELATIVE_TIME_SECONDS (one year) are interpreted as
|
|
130
|
+
* an age in seconds subtracted from block.timestamp.
|
|
131
|
+
* @param fillDeadline Timestamp after which this deposit can no longer be filled. Values at or below
|
|
132
|
+
* SpokePoolPeriphery.MAX_RELATIVE_TIME_SECONDS (one year) are interpreted as an offset added to block.timestamp.
|
|
127
133
|
* @param exclusivityParameter Timestamp or offset, after which any relayer can fill this deposit. Must set
|
|
128
134
|
* to 0 if exclusiveRelayer is set to 0x0, and vice versa.
|
|
129
135
|
* @param message Arbitrary data that can be used to pass additional information to the recipient along with the tokens.
|
|
@@ -159,6 +165,9 @@ interface SpokePoolPeripheryInterface {
|
|
|
159
165
|
* @dev If the swapToken does not implement `permit` to the specifications of EIP-2612, the permit call result will be ignored and the function will continue.
|
|
160
166
|
* @dev If the swapToken in swapData does not implement `permit` to the specifications of EIP-2612, this function will fail.
|
|
161
167
|
* @dev The nonce for the swapAndDepositData signature must be retrieved from permitNonces(signatureOwner).
|
|
168
|
+
* @dev `deadline` is bound into the swapAndDepositData signature as well as the permit, and is checked here.
|
|
169
|
+
* `permit` is called inside a try/catch, so an expired ERC-2612 signature alone would not stop a
|
|
170
|
+
* standing allowance from funding the pull; this check is what bounds the payload's lifetime.
|
|
162
171
|
* @dev Design Decision: We use separate nonce tracking for permit-based functions versus
|
|
163
172
|
* receiveWithAuthorization-based functions, which creates a theoretical replay attack that we think is
|
|
164
173
|
* incredibly unlikely because this would require:
|
|
@@ -248,6 +257,9 @@ interface SpokePoolPeripheryInterface {
|
|
|
248
257
|
* @dev If the token does not implement `permit` to the specifications of EIP-2612, the permit call result will be ignored and the function will continue.
|
|
249
258
|
* @dev If `acrossInputToken` does not implement `permit` to the specifications of EIP-2612, this function will fail.
|
|
250
259
|
* @dev The nonce for the depositData signature must be retrieved from permitNonces(signatureOwner).
|
|
260
|
+
* @dev `deadline` is bound into the depositData signature as well as the permit, and is checked here.
|
|
261
|
+
* `permit` is called inside a try/catch, so an expired ERC-2612 signature alone would not stop a
|
|
262
|
+
* standing allowance from funding the pull; this check is what bounds the payload's lifetime.
|
|
251
263
|
* @dev Design Decision: We use separate nonce tracking for permit-based functions versus
|
|
252
264
|
* receiveWithAuthorization-based functions, which creates a theoretical replay attack that we think is
|
|
253
265
|
* incredibly unlikely because this would require:
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// SPDX-License-Identifier: BUSL-1.1
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import { V3SpokePoolInterface } from "./V3SpokePoolInterface.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @notice Types and errors for Across V5 SpokePool deposits and fills.
|
|
8
|
+
*
|
|
9
|
+
* A V5 deposit carries only a witness across the bridge: `message = V5_MAGIC_PREFIX || stepId`, where `stepId`
|
|
10
|
+
* is the Merkle root of the Gateway execution allowed to consume it. Everything else the destination must honor
|
|
11
|
+
* is committed in the destination path leaf as `V5FillInput`; the submitter supplies the deposit's `V3RelayData`
|
|
12
|
+
* verbatim just-in-time as `V5FillJit`. The SpokePool validates the committed bounds — and the witness, against
|
|
13
|
+
* the live stepId read from the Gateway — before hashing the supplied relay data, so the relay hash only matches
|
|
14
|
+
* a real deposit when the committed root is the one being executed.
|
|
15
|
+
*
|
|
16
|
+
* V5 deposits are consumable in two modes:
|
|
17
|
+
* - executor mode (`executeAcrossV5`): the SpokePool is the path executor, called directly by the Gateway.
|
|
18
|
+
* - adapter mode (`adapterExecuteAcrossV5`): the SpokePool is an ADAPTER_CALL target inside a command tape,
|
|
19
|
+
* called by the live step's committed executor.
|
|
20
|
+
*
|
|
21
|
+
* V5 deposits themselves are created outside the SpokePool (e.g. by a V5 planner or adapter on the source
|
|
22
|
+
* chain) as ordinary Across deposits whose message is the stamped witness.
|
|
23
|
+
*/
|
|
24
|
+
interface V5SpokePoolInterface {
|
|
25
|
+
/// @notice Deposit-committed acceptance bounds for a V5 fill, committed in the path leaf under the
|
|
26
|
+
/// deposit's witness root rather than crossing the bridge.
|
|
27
|
+
struct V5FillInput {
|
|
28
|
+
// Account receiving the fill on this chain.
|
|
29
|
+
bytes32 recipient;
|
|
30
|
+
// Token delivered to the recipient. Must be an ERC20.
|
|
31
|
+
bytes32 outputToken;
|
|
32
|
+
// Floor for the submitter-resolved output amount.
|
|
33
|
+
uint256 minOutputAmount;
|
|
34
|
+
// handleV3AcrossMessage payload delivered to a contract recipient after the transfer. Committed under
|
|
35
|
+
// the witness, giving it V3's trust semantics. Executor mode only — adapter-mode fills have no trailing
|
|
36
|
+
// call, so it must be empty there.
|
|
37
|
+
bytes message;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// @notice Submitter-supplied relay data for a V5 fill, plus their repayment preferences.
|
|
41
|
+
struct V5FillJit {
|
|
42
|
+
// The deposit's relay data, passed verbatim. `recipient`, `outputToken` and `message` must match the
|
|
43
|
+
// committed `V5FillInput` / live Gateway stepId, and `outputAmount` must meet the committed floor; the
|
|
44
|
+
// remaining fields are competition parameters and facts the submitter proves by paying for the fill.
|
|
45
|
+
V3SpokePoolInterface.V3RelayData relayData;
|
|
46
|
+
// Chain and address where the filler wants their refund.
|
|
47
|
+
uint256 repaymentChainId;
|
|
48
|
+
bytes32 repaymentAddress;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/// @notice Thrown when `executeAcrossV5` is called by anyone other than the Gateway.
|
|
52
|
+
error V5NotGateway();
|
|
53
|
+
/// @notice Thrown when `adapterExecuteAcrossV5` is called by anyone other than the live step's committed
|
|
54
|
+
/// executor (also rejects calls while the Gateway is idle or still in its funding loop).
|
|
55
|
+
error V5NotCurrentExecutor();
|
|
56
|
+
/// @notice Thrown when a V5-tagged deposit reaches a non-V5 settlement path (regular fills, updated fills,
|
|
57
|
+
/// slow-fill requests and executions). V5 deposits are consumable only through the witness-checked V5
|
|
58
|
+
/// entrypoints.
|
|
59
|
+
error V5FillOnly();
|
|
60
|
+
/// @notice Thrown when the submitter-supplied relay data contradicts the committed `V5FillInput` or the
|
|
61
|
+
/// live Gateway stepId (recipient, output token, or witness message mismatch).
|
|
62
|
+
error V5CommitmentMismatch();
|
|
63
|
+
/// @notice Thrown when the submitter-resolved output amount is below the committed floor.
|
|
64
|
+
error V5OutputAmountTooLow();
|
|
65
|
+
/// @notice Thrown when native value is sent to a V5 fill. Fills never accept native value; the V5
|
|
66
|
+
/// entrypoints are payable only because the external V5 interfaces require it.
|
|
67
|
+
error V5UnusedMsgValue();
|
|
68
|
+
/// @notice Thrown when an adapter-mode fill commits a callback message (adapter fills have no trailing call;
|
|
69
|
+
/// delivery-then-action belongs in the tape).
|
|
70
|
+
error V5CallbackNotAllowed();
|
|
71
|
+
}
|