├── .env.example ├── .github └── workflows │ └── CI.yml ├── .gitignore ├── .gitmodules ├── LICENSE ├── Makefile ├── README.md ├── codecov.yml ├── contracts ├── CoreStateRegistry.go ├── ERC4626Form.go ├── PayMaster.go ├── PaymentHelper.go ├── README.md ├── SuperPositions.go ├── SuperformFactory.go ├── SuperformRouter.go ├── SuperformRouterPlus.go ├── SuperformRouterPlusAsync.go └── VaultClaimer.go ├── foundry.toml ├── funding.json ├── go.mod ├── go.sum ├── package.json ├── renovate.json ├── script ├── deployments │ ├── cantina_deployment │ │ ├── 56 │ │ │ └── Binance-latest.json │ │ ├── 137 │ │ │ └── Polygon-latest.json │ │ └── 43114 │ │ │ └── Avalanche-latest.json │ ├── ctf_deployment │ │ ├── 1 │ │ │ └── Ethereum-latest.json │ │ ├── 10 │ │ │ └── Optimism-latest.json │ │ ├── 56 │ │ │ └── Binance-latest.json │ │ ├── 137 │ │ │ └── Polygon-latest.json │ │ ├── 8453 │ │ │ └── Base-latest.json │ │ ├── 42161 │ │ │ └── Arbitrum-latest.json │ │ └── 43114 │ │ │ └── Avalanche-latest.json │ ├── launch_deployment │ │ ├── 1 │ │ │ └── Ethereum-latest.json │ │ ├── 10 │ │ │ └── Optimism-latest.json │ │ ├── 56 │ │ │ └── Binance-latest.json │ │ ├── 137 │ │ │ └── Polygon-latest.json │ │ ├── 8453 │ │ │ └── Base-latest.json │ │ ├── 42161 │ │ │ └── Arbitrum-latest.json │ │ └── 43114 │ │ │ └── Avalanche-latest.json │ ├── pre-launch_deployment │ │ ├── 10 │ │ │ └── Optimism-latest.json │ │ ├── 8453 │ │ │ └── Base-latest.json │ │ └── 42161 │ │ │ └── Arbitrum-latest.json │ ├── v1_deployment │ │ ├── 1 │ │ │ └── Ethereum-latest.json │ │ ├── 10 │ │ │ └── Optimism-latest.json │ │ ├── 56 │ │ │ └── Binance-latest.json │ │ ├── 137 │ │ │ └── Polygon-latest.json │ │ ├── 250 │ │ │ └── Fantom-latest.json │ │ ├── 8453 │ │ │ └── Base-latest.json │ │ ├── 42161 │ │ │ └── Arbitrum-latest.json │ │ ├── 43114 │ │ │ └── Avalanche-latest.json │ │ ├── 59144 │ │ │ └── Linea-latest.json │ │ └── 81457 │ │ │ └── Blast-latest.json │ ├── v1_staging_deployment │ │ ├── 10 │ │ │ └── Optimism-latest.json │ │ ├── 56 │ │ │ └── Binance-latest.json │ │ ├── 250 │ │ │ └── Fantom-latest.json │ │ ├── 8453 │ │ │ └── Base-latest.json │ │ ├── 42161 │ │ │ └── Arbitrum-latest.json │ │ ├── 59144 │ │ │ └── Linea-latest.json │ │ └── 81457 │ │ │ └── Blast-latest.json │ └── v1_testnet_deployment │ │ └── 80084 │ │ └── BerachainBartio-latest.json ├── forge-scripts │ ├── Abstract.Deploy.Single.s.sol │ ├── EnvironmentUtils.s.sol │ ├── Mainnet.Deploy.s.sol │ ├── Tenderly.Deploy.s.sol │ ├── misc │ │ ├── Abstract.Configure.NewDVN.s.sol │ │ ├── Abstract.Configure.PreBeraLaunch.s.sol │ │ ├── Abstract.ConfigureERC5115AndDisableAMBs.s.sol │ │ ├── Abstract.Deploy.5115Form.s.sol │ │ ├── Abstract.Deploy.5115To4626Factory.s.sol │ │ ├── Abstract.Deploy.7540Form.s.sol │ │ ├── Abstract.Deploy.AsyncStateRegistry.s.sol │ │ ├── Abstract.Deploy.Axelar.s.sol │ │ ├── Abstract.Deploy.BridgeAdaptersV2.s.sol │ │ ├── Abstract.Deploy.DeBridgeValidators.s.sol │ │ ├── Abstract.Deploy.LiFiValidatorV2.s.sol │ │ ├── Abstract.Deploy.OneInchValidator.s.sol │ │ ├── Abstract.Deploy.PayloadHelper.s.sol │ │ ├── Abstract.Deploy.PaymasterV2.s.sol │ │ ├── Abstract.Deploy.PaymentHelperV2.s.sol │ │ ├── Abstract.Deploy.RescuerMissedConfig.s.sol │ │ ├── Abstract.Deploy.RewardsDistributor.s.sol │ │ ├── Abstract.Deploy.RouterPlus.s.sol │ │ ├── Abstract.Deploy.Socket1inch.s.sol │ │ ├── Abstract.EnableBroadcasting.s.sol │ │ ├── Abstract.SuperRegistry.LiFiValidatorV2Paymaster.s.sol │ │ ├── Abstract.Update.PaymentHelper.s.sol │ │ ├── Abstract.Update.PriceFeeds.s.sol │ │ ├── DecodeULNConfig.sol │ │ ├── Mainnet.Configure.NewDVN.s.sol │ │ ├── Mainnet.Configure.PreBera.s.sol │ │ ├── Mainnet.ConfigureERC5115AndDisableAMBs.s.sol │ │ ├── Mainnet.Deploy.5115Form.s.sol │ │ ├── Mainnet.Deploy.5115To4626Factory.s.sol │ │ ├── Mainnet.Deploy.7540Form.s.sol │ │ ├── Mainnet.Deploy.AsyncStateRegistry.s.sol │ │ ├── Mainnet.Deploy.NewChain.s.sol │ │ ├── Mainnet.Deploy.OneInchValidator.s.sol │ │ ├── Mainnet.Deploy.PaymentHelperV2.s.sol │ │ ├── Mainnet.Deploy.RewardsDistributor.s.sol │ │ ├── Mainnet.Deploy.SuperformRouterPlus.s.sol │ │ ├── Mainnet.Deploy1inch.s.sol │ │ ├── Mainnet.DeployAxelar.s.sol │ │ ├── Mainnet.DeployBridgeAdaptersV2.s.sol │ │ ├── Mainnet.DeployDeBridgeValidators.s.sol │ │ ├── Mainnet.DeployLiFiValidatorV2.s.sol │ │ ├── Mainnet.DeployPayloadHelper.s.sol │ │ ├── Mainnet.DeployPaymasterV2.s.sol │ │ ├── Mainnet.DeployRescuerMissedConfig.s.sol │ │ ├── Mainnet.DisableInvalidDeployment.s.sol │ │ ├── Mainnet.EnableBroadcasting.s.sol │ │ ├── Mainnet.SuperRegistryLiFiValidatorV2Paymaster.s.sol │ │ ├── Mainnet.UpdatePaymentHelper.s.sol │ │ ├── Mainnet.UpdatePriceFeeds.s.sol │ │ ├── blacklistedFacets │ │ │ ├── AcrossFacetPacked.sol │ │ │ ├── AcrossFacetPackedV3.sol │ │ │ └── AmarokFacetPacked.sol │ │ └── blast │ │ │ └── forms │ │ │ ├── BlastBaseForm.sol │ │ │ ├── BlastERC4626Form.sol │ │ │ ├── BlastERC4626FormImplementation.sol │ │ │ ├── BlastERC5115Form.sol │ │ │ ├── BlastERC7540Form.sol │ │ │ └── IBlastPoints.sol │ └── safe │ │ ├── BatchScript.sol │ │ └── lib │ │ └── DelegatePrank.sol ├── output │ ├── 1 │ │ └── Ethereum-latest.json │ ├── 10 │ │ └── Optimism-latest.json │ ├── 56 │ │ └── Binance-latest.json │ ├── 137 │ │ └── Polygon-latest.json │ ├── 250 │ │ └── Fantom-latest.json │ ├── 8453 │ │ └── Base-latest.json │ ├── 42161 │ │ └── Arbitrum-latest.json │ ├── 43114 │ │ └── Avalanche-latest.json │ ├── 59144 │ │ └── Linea-latest.json │ ├── 80084 │ │ └── BerachainBartio-latest.json │ └── 81457 │ │ └── Blast-latest.json └── utils │ ├── misc │ ├── run_script_mainnet_1inch.sh │ ├── run_script_mainnet_5115Form.sh │ ├── run_script_mainnet_5115To4626Factory.sh │ ├── run_script_mainnet_7540Form.sh │ ├── run_script_mainnet_asyncStateRegistry.sh │ ├── run_script_mainnet_axelar.sh │ ├── run_script_mainnet_bridgeAdaptersV2.sh │ ├── run_script_mainnet_config5115AMB.sh │ ├── run_script_mainnet_configDVN.sh │ ├── run_script_mainnet_configure1inch_safe.sh │ ├── run_script_mainnet_configure_rescuer.sh │ ├── run_script_mainnet_deBridge.sh │ ├── run_script_mainnet_disableInvalidDeployment.sh │ ├── run_script_mainnet_enableBroadcasting_revokeRoles_safe.sh │ ├── run_script_mainnet_enableBroadcasting_safe.sh │ ├── run_script_mainnet_lifiv2.sh │ ├── run_script_mainnet_paymasterv2.sh │ ├── run_script_mainnet_paymentHelperV2.sh │ ├── run_script_mainnet_preBera.sh │ ├── run_script_mainnet_rewardsDistributor.sh │ ├── run_script_mainnet_routerplus.sh │ ├── run_script_mainnet_socket_1inch.sh │ ├── run_script_mainnet_staging_1inch.sh │ ├── run_script_mainnet_staging_5115Form.sh │ ├── run_script_mainnet_staging_5115To4626Factory.sh │ ├── run_script_mainnet_staging_5115configureAMB.sh │ ├── run_script_mainnet_staging_7540Form.sh │ ├── run_script_mainnet_staging_asyncStateRegistry.sh │ ├── run_script_mainnet_staging_axelar.sh │ ├── run_script_mainnet_staging_bridgeAdaptersV2.sh │ ├── run_script_mainnet_staging_configDVN.sh │ ├── run_script_mainnet_staging_deBridge.sh │ ├── run_script_mainnet_staging_enableBroadcasting.sh │ ├── run_script_mainnet_staging_enableBroadcasting_revoke.sh │ ├── run_script_mainnet_staging_lifiv2.sh │ ├── run_script_mainnet_staging_payloadHelper.sh │ ├── run_script_mainnet_staging_paymasterV2.sh │ ├── run_script_mainnet_staging_paymentHelperV2.sh │ ├── run_script_mainnet_staging_rewardsDistributor.sh │ ├── run_script_mainnet_staging_socket_1inch.sh │ ├── run_script_mainnet_staging_update_paymenthelper.sh │ ├── run_script_mainnet_superRegistry_lifiValidatorV2Paymaster.sh │ ├── run_script_mainnet_update_paymenthelper.sh │ └── run_script_mainnet_update_priceFeeds.sh │ ├── retrieve-abis.sh │ ├── run_script_mainnet.sh │ ├── run_script_mainnet_new_chain.sh │ ├── run_script_mainnet_staging.sh │ ├── run_script_staging_new_chain.sh │ ├── run_script_tenderly.sh │ ├── run_script_testnet_new_chain.sh │ ├── spawn_tenderly_devnets.sh │ ├── verify_contracts.sh │ ├── verify_contracts_staging.sh │ └── verify_safe_txs │ ├── verify_all_networks.sh │ └── verify_network.sh ├── security-review ├── 2023-09-gerard-persoon.pdf ├── 2023-09-hans-friese.pdf ├── 2023-12-cantina-competition.md ├── README.md ├── report-cantinacode-superform.pdf └── report-competition-superform.pdf ├── slither.config.json ├── src ├── BaseForm.sol ├── BaseRouter.sol ├── BaseRouterImplementation.sol ├── EmergencyQueue.sol ├── RewardsDistributor.sol ├── SuperPositions.sol ├── SuperformFactory.sol ├── SuperformRouter.sol ├── VaultClaimer.sol ├── crosschain-data │ ├── BaseStateRegistry.sol │ ├── BroadcastRegistry.sol │ ├── README.md │ ├── adapters │ │ ├── axelar │ │ │ └── AxelarImplementation.sol │ │ ├── hyperlane │ │ │ └── HyperlaneImplementation.sol │ │ ├── layerzero-v2 │ │ │ └── LayerzeroV2Implementation.sol │ │ ├── layerzero │ │ │ └── LayerzeroImplementation.sol │ │ └── wormhole │ │ │ ├── automatic-relayer │ │ │ └── WormholeARImplementation.sol │ │ │ └── specialized-relayer │ │ │ └── WormholeSRImplementation.sol │ ├── extensions │ │ ├── AsyncStateRegistry.sol │ │ └── CoreStateRegistry.sol │ └── utils │ │ ├── Broadcastable.sol │ │ ├── PayloadHelper.sol │ │ ├── PayloadHelperV2.sol │ │ └── QuorumManager.sol ├── crosschain-liquidity │ ├── 1inch │ │ └── OneInchValidator.sol │ ├── BridgeValidator.sol │ ├── DstSwapper.sol │ ├── LiquidityHandler.sol │ ├── debridge │ │ ├── DeBridgeForwarderValidator.sol │ │ ├── DeBridgeValidator.sol │ │ └── libraries │ │ │ └── DeBridgeError.sol │ ├── lifi │ │ └── LiFiValidator.sol │ └── socket │ │ ├── SocketOneInchValidator.sol │ │ └── SocketValidator.sol ├── forms │ ├── ERC4626Form.sol │ ├── ERC4626FormImplementation.sol │ ├── ERC5115Form.sol │ ├── ERC7540Form.sol │ ├── README.md │ ├── interfaces │ │ ├── IERC4626Form.sol │ │ ├── IERC5115Form.sol │ │ ├── IERC5115To4626Wrapper.sol │ │ ├── IERC5115To4626WrapperFactory.sol │ │ └── IERC7540Form.sol │ └── wrappers │ │ ├── ERC5115To4626Wrapper.sol │ │ └── ERC5115To4626WrapperFactory.sol ├── interfaces │ ├── IAmbImplementation.sol │ ├── IAmbImplementationV2.sol │ ├── IAsyncStateRegistry.sol │ ├── IBaseForm.sol │ ├── IBaseRouter.sol │ ├── IBaseRouterImplementation.sol │ ├── IBaseStateRegistry.sol │ ├── IBaseSuperformRouterPlus.sol │ ├── IBridgeValidator.sol │ ├── IBroadcastAmbImplementation.sol │ ├── IBroadcastRegistry.sol │ ├── ICoreStateRegistry.sol │ ├── IDstSwapper.sol │ ├── IEmergencyQueue.sol │ ├── ILiFiValidator.sol │ ├── IPayMaster.sol │ ├── IPayloadHelper.sol │ ├── IPayloadHelperV2.sol │ ├── IPaymentHelper.sol │ ├── IPaymentHelperExtn.sol │ ├── IPaymentHelperV2.sol │ ├── IQuorumManager.sol │ ├── IRewardsDistributor.sol │ ├── ISocketValidator.sol │ ├── ISuperPositions.sol │ ├── ISuperRBAC.sol │ ├── ISuperRegistry.sol │ ├── ISuperformFactory.sol │ ├── ISuperformRouterPlus.sol │ ├── ISuperformRouterPlusAsync.sol │ ├── ITimelockStateRegistry.sol │ └── IVaultClaimer.sol ├── libraries │ ├── ArrayCastLib.sol │ ├── DataLib.sol │ ├── Error.sol │ ├── PayloadUpdaterLib.sol │ └── ProofLib.sol ├── payments │ ├── PayMaster.sol │ ├── PaymentHelper.sol │ └── PaymentHelperExtn.sol ├── router-plus │ ├── BaseSuperformRouterPlus.sol │ ├── SuperformRouterPlus.sol │ └── SuperformRouterPlusAsync.sol ├── settings │ ├── SuperRBAC.sol │ └── SuperRegistry.sol ├── types │ └── DataTypes.sol └── vendor │ ├── 1inch │ └── IAggregationRouterV6.sol │ ├── axelar │ ├── IAxelarExecutable.sol │ ├── IAxelarGasService.sol │ ├── IAxelarGateway.sol │ ├── IContractIdentifier.sol │ ├── IGovernable.sol │ ├── IImplementation.sol │ ├── IInterchainGasEstimation.sol │ ├── IOwnable.sol │ ├── IUpgradable.sol │ └── StringAddressConversion.sol │ ├── centrifuge │ ├── IERC7540.sol │ └── IERC7575.sol │ ├── chainlink │ └── AggregatorV3Interface.sol │ ├── deBridge │ ├── DlnOrderLib.sol │ ├── ICrossChainForwarder.sol │ └── IDlnSource.sol │ ├── dragonfly-xyz │ └── IPermit2.sol │ ├── hyperlane │ ├── IInterchainGasPaymaster.sol │ ├── IMailbox.sol │ ├── IMessageRecipient.sol │ └── StandardHookMetadata.sol │ ├── kycDAO │ ├── IKycDAONTNFT.sol │ └── IKycValidity.sol │ ├── layerzero │ ├── ILayerZeroEndpoint.sol │ ├── ILayerZeroReceiver.sol │ ├── ILayerZeroUserApplicationConfig.sol │ └── v2 │ │ ├── ILayerZeroEndpointV2.sol │ │ ├── ILayerZeroReceiver.sol │ │ ├── IMessageLib.sol │ │ ├── IMessageLibManager.sol │ │ ├── IMessagingChannel.sol │ │ ├── IMessagingComposer.sol │ │ └── IMessagingContext.sol │ ├── lifi │ ├── AmarokFacet.sol │ ├── CBridgeFacetPacked.sol │ ├── CelerIMFacetBase.sol │ ├── GenericSwapFacet.sol │ ├── HopFacet.sol │ ├── HopFacetOptimized.sol │ ├── HopFacetPacked.sol │ ├── IHopBridge.sol │ ├── ILiFi.sol │ ├── LiFiTxDataExtractor.sol │ ├── LibSwap.sol │ ├── StandardizedCallFacet.sol │ ├── StargateFacet.sol │ └── celer-network │ │ └── MsgDataTypes.sol │ ├── pendle │ └── IStandardizedYield.sol │ ├── socket │ ├── ISocketOneInchImpl.sol │ └── ISocketRegistry.sol │ └── wormhole │ ├── IWormhole.sol │ ├── IWormholeReceiver.sol │ ├── IWormholeRelayer.sol │ ├── README.md │ └── Utils.sol └── test ├── fuzz ├── crosschain-data │ └── adapters │ │ ├── HyperlaneImplementation.t.sol │ │ └── LayerzeroImplementation.t.sol └── scenarios │ ├── scenarios-deposit-multiDstMultiVaultDeposit │ ├── Multi.0.1.TokenInput.NoSlippage.AMB13.sol │ ├── Multi.00.00.IncludingSingleDirect.TokenInput.Slippage.AMB12.sol │ ├── Multi.00.00.TokenInput.Slippage.AMB12.Permit2.sol │ ├── Multi.00.00.TokenInput.Slippage.AMB12.sol │ ├── Multi.00.26.DstSwap.Native.Slippage.AMB23.sol │ ├── Multi.021.120.Native.Slippage.AMB23.sol │ ├── Multi.102.110.DstSwap.Native.Slippage.AMB23.sol │ ├── Multi.102.110.Native.Slippage.AMB23.sol │ ├── Multi.102.115.000.Native.Slippage.AMB13.sol │ ├── Multi.111.563.TokenInput.Slippage.AMB12.sol │ ├── Multi.111.563.TokenInput.Slippage.AMB26.sol │ ├── Multi.5115.TokenInput.Slippage.AMB26.sol │ └── Multi.55.55.Native.Slippage.AMB23.sol │ ├── scenarios-deposit-multiDstSingleVaultDeposit │ ├── 4626.Native.NoSlippage.AMB12.t.sol │ ├── 4626.Revert.Native.Slippage.AMB12.t.sol │ ├── 4626.Revert.TokenInput.Slippage.AMB1.RepeatingDstMultiAmb.t.sol │ ├── 4626.Revert.TokenInput.Slippage.AMB1.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB26.t.sol │ ├── 4626.TokenInput.NoSlippage.DeBridge.AMB23.t.sol │ └── 5115.TokenInput.NoSlippage.DeBridge.AMB23.t.sol │ ├── scenarios-deposit-singleDirectMultiVaultDeposit │ ├── Direct.Multi.0.TokenInput.NoSlippage.AMB13.sol │ ├── Direct.Multi.00.Native.NoSlippage.AMB12.sol │ ├── Direct.Multi.021.Native.Slippage.AMB13.sol │ ├── Direct.Multi.021.Native.Slippage.AMB23.sol │ ├── Direct.Multi.102.Native.Slippage.AMB12.sol │ ├── Direct.Multi.111.TokenInput.Slippage.AMB12.sol │ ├── Direct.Multi.111.TokenInput.Slippage.OneInch.sol │ ├── Direct.Multi.26.Native.NoSlippage.AMB23.sol │ ├── Direct.Multi.31.TokenInput.Slippage.AMB13.sol │ ├── Direct.Multi.4.TokenInput.NoSlippage.AMB23.sol │ └── Direct.Multi.5115.TokenInput.Slippage.sol │ ├── scenarios-deposit-singleDirectSingleVaultDeposit │ ├── 4626.NoSwap.TokenInput.Slippage.t.sol │ ├── 4626.NoSwap.TokenInput.Slippage23.t.sol │ ├── 4626.Revert.NoSwap.TokenInput.NoSlippage.t.sol │ ├── 4626.Swap.Native.Slippage.Permit2.t.sol │ ├── 4626.Swap.TokenInput.Slippage.OneInch.t.sol │ ├── 4626.Swap.TokenInput.Slippage.t.sol │ ├── 5115.Swap.TokenInput.Slippage.Permit2.t.sol │ ├── 5115.Swap.TokenInput.Slippage.t.sol │ ├── 7540.DepositAsync.Slippage.t.sol │ └── 7540.DepositAsyncRevert.Slippage.t.sol │ ├── scenarios-deposit-singleXChainMultiVaultDeposit │ ├── Multi.0.TokenInput.NoSlippage.AMB13.sol │ ├── Multi.00.Native.NoSlippage.AMB12.sol │ ├── Multi.021.Native.Slippage.AMB23.sol │ ├── Multi.102.Native.Slippage.AMB12.sol │ ├── Multi.111.RescueFailedDeposits.TokenInput.Slippage.AMB12.sol │ ├── Multi.111.TokenInput.Slippage.AMB12.sol │ ├── Multi.111.TokenInput.Slippage.AMB13.sol │ ├── Multi.111.TokenInput.Slippage.AMB15.sol │ ├── Multi.26.Native.NoSlippage.AMB23.sol │ ├── Multi.31.TokenInput.Slippage.AMB13.sol │ ├── Multi.4.TokenInput.NoSlippage.AMB23.sol │ ├── Multi.5115.TokenInput.DstSwap.AMB25.sol │ ├── Multi.5115.TokenInput.Slippage.AMB25.sol │ └── Multi.7540.TokenInput.Slippage.AMB25.sol │ ├── scenarios-deposit-singleXChainSingleVaultDeposit │ ├── 4626.Native.NoSlippage.AMB12.t.sol │ ├── 4626.Native.NoSlippage.AMB15.t.sol │ ├── 4626.Revert.Native.Slippage.AMB12.t.sol │ ├── 4626.Revert.RescueFailedDeposits.TokenInput.Slippage.AMB1.t.sol │ ├── 4626.Revert.TokenInput.Slippage.AMB1.t.sol │ ├── 4626.TokenInpu.NoSlippage.AMB26.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.DeBridge.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.DeBridgeFrwd.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.Sepolia.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.FromBera.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.Linea.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.ToBera.AMB23.t.sol │ └── 5115.Native.NoSlippage.AMB23.t.sol │ ├── scenarios-withdraw-multiDstMultiVaultWithdraw │ ├── 0000.1200.TokenInputNoSlippageAMB12.sol │ ├── 01.024.08.TokenInputSlippageAMB12.sol │ ├── 01.024.08.TokenInputSlippageAMB13.sol │ ├── 5115.TokenInputSlippageAMB23.sol │ ├── 840.024.08.TokenInputSlippageAMB12.NewDst.sol │ ├── 840.024.08.TokenInputSlippageAMB12.sol │ └── 840.024.08.TokenInputSlippageAMB13.sol │ ├── scenarios-withdraw-multiDstSingleVaultWithdraw │ ├── 010.TokenInput.Slippage.AMB12.t.sol │ ├── 10.TokenInput.Slippage.AMB23.NewDst.t.sol │ ├── 10.TokenInput.Slippage.AMB23.t.sol │ ├── 4626.Native.Slippage.AMB12.t.sol │ ├── 4626.Native.Slippage.AMB13.t.sol │ ├── 4626.Native.Slippage.AMB23.t.sol │ ├── 4626.Native.Slippage.AMB25.t.sol │ ├── 4626.Native.Slippage.AMB26.t.sol │ ├── 5115.Native.Slippage.AMB26.t.sol │ └── 70.TokenInput.Slippage.AMB13.t.sol │ ├── scenarios-withdraw-singleDirectMultiVaultWithdraw │ ├── 5115.NativeInput.Slippage.t.sol │ ├── Direct.0.TokenInput.NoSlippage.AMB13.sol │ ├── Direct.0000.TokenInputNoSlippageAMB23.sol │ ├── Direct.02.NativeInput.NoSlippage.AMB12.sol │ ├── Direct.142.TokenInput.Slippage.AMB12.sol │ ├── Direct.874.NativeInput.Slippage.AMB13.sol │ └── Direct.874.NativeInput.Slippage.AMB23.sol │ ├── scenarios-withdraw-singleDirectSingleVaultWithdraw │ └── 5115.Aave.Native.Slippage.t.sol │ ├── scenarios-withdraw-singleXChainMultiVaultWithdraw │ ├── 0.TokenInput.NoSlippage.AMB13.sol │ ├── 0.TokenInputNoSlippageAMB13Fantom.sol │ ├── 0000.TokenInputNoSlippageAMB13Fantom.sol │ ├── 0000.TokenInputNoSlippageAMB23.sol │ ├── 02.NativeInput.NoSlippage.AMB12.sol │ ├── 142.TokenInput.Slippage.AMB12.sol │ ├── 5115.NativeInput.NoSlippage.AMB13.sol │ ├── 7540.5115x2.4626AMB23.t.sol │ ├── 7540.ADepositWithdraw.5115.AMB13.t.sol │ ├── 7540.FullAsync.5115.AMB23.t.sol │ ├── 841.NativeInput.Slippage.AMB13.sol │ ├── 841.NativeInput.Slippage.AMB31.sol │ ├── 841.NativeInput.Slippage.AMB35.sol │ └── 841.NativeInput.Slippage.AMB36.sol │ └── scenarios-withdraw-singleXChainSingleVaultWithdraw │ ├── 4626.Native.Slippage.AMB23.PseudoAsync.t.sol │ ├── 4626.Native.Slippage.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB23.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB31.t.sol │ ├── 4626.TokenInput.NoSlippage.AMB36.t.sol │ ├── 5115.Native.Slippage.AMB23.t.sol │ ├── 7540.Centrifuge.Mainnet.Slippage.AMB23.t.sol │ ├── 7540.Centrifuge.Slippage.AMB23.t.sol │ ├── 7540.DepositAsyncNative.Slippage.AMB23.t.sol │ ├── 7540.DepositAsyncNative.SyncWithdrawRevert.Slippage.AMB23.t.sol │ ├── 7540.FAsyncNative.Slippage.AMB23.t.sol │ ├── 7540.WithdrawAsyncNative.Reverting.Slippage.AMB21.t.sol │ └── 7540.WithdrawAsyncNative.Slippage.AMB21.t.sol ├── invariant ├── common │ ├── Base.invariant.t.sol │ └── TimestampStore.sol ├── rewards-distributor │ ├── RewardsDistributorBase.invariant.t.sol │ ├── RewardsDistributorClaim.invariant.t.sol │ ├── RewardsDistributorClaimBatch.invariant.t.sol │ ├── handlers │ │ └── RewardsDistributorHandler.sol │ └── stores │ │ └── RewardsDistributorStore.sol └── vault-shares │ ├── VaultShares.invariant.t.sol │ ├── handlers │ └── VaultSharesHandler.sol │ └── stores │ └── VaultSharesStore.sol ├── mainnet ├── SmokeTest.Staging.t.sol └── SmokeTest.t.sol ├── mocks ├── 7540MockUtils │ ├── EIP712Lib.sol │ ├── ERC20.sol │ ├── ERC7540VaultLike.sol │ ├── IERC20.sol │ ├── ISetClaimable.sol │ ├── InvestmentManagerLike.sol │ ├── PoolManagerLike.sol │ ├── RestrictionManagerLike.sol │ ├── SafeTransferLib.sol │ ├── SignatureLib.sol │ └── TrancheTokenLike.sol ├── BaseERC7540Mock.sol ├── DeBridgeForwarderMock.sol ├── DeBridgeMock.sol ├── ERC4626FormExternal.sol ├── ERC7540AsyncDepositMock.sol ├── ERC7540AsyncDepositMockRedeemRevert.sol ├── ERC7540AsyncDepositMockRevert.sol ├── ERC7540AsyncRedeemMock.sol ├── ERC7540AsyncRedeemMockRevert.sol ├── ERC7540FullyAsyncMock.sol ├── ERC7575Mock.sol ├── InterfaceNotSupported │ ├── BaseFormInterfaceNotSupported.sol │ ├── ERC4626ImplementationInterfaceNotSupported.sol │ └── ERC4626InterFaceNotSupported.sol ├── LiFiMock.sol ├── LiFiMockBlacklisted.sol ├── LiFiMockRugpull.sol ├── LiFiMockSwapToAttacker.sol ├── MockERC20.sol ├── OneInchMock.sol ├── Permit2Clone.sol ├── SocketMock.sol ├── SocketOneInchMock.sol ├── VaultMock.sol ├── VaultMockFailedDeposit.sol ├── VaultMockFailedWithdraw.sol ├── VaultMockRevertDeposit.sol └── VaultMockRevertWithdraw.sol ├── unit ├── constructor ├── crosschain-data │ ├── BaseStateRegistry.t.sol │ ├── BroadcastRegistry.t.sol │ ├── adapters │ │ ├── AxelarImplementation.t.sol │ │ ├── HyperlaneImplementation.t.sol │ │ ├── LayerzeroImplementation.t.sol │ │ ├── LayerzeroV2Implementation.t.sol │ │ ├── WormholeARImplementation.t.sol │ │ └── WormholeSRImplementation.t.sol │ ├── extensions │ │ ├── AsyncStateRegistry.t.sol │ │ └── CoreStateRegistry.t.sol │ └── utils │ │ ├── PayloadHelper.V2.multiVault.t.sol │ │ ├── PayloadHelper.V2.singleVault.t.sol │ │ ├── PayloadHelper.multiVault.t.sol │ │ ├── PayloadHelper.singleVault.t.sol │ │ └── QuorumManager.t.sol ├── crosschain-liquidity │ ├── 1inch │ │ └── OneInchValidator.t.sol │ ├── DstSwapper.t.sol │ ├── LiquidityHandler.t.sol │ ├── deBridge │ │ ├── DeBridgeForwarderValidator.t.sol │ │ └── DeBridgeValidator.t.sol │ ├── lifi │ │ └── LiFiValidator.t.sol │ └── socket │ │ ├── SocketOneInchValidator.t.sol │ │ └── SocketValidator.t.sol ├── emergency │ └── EmergencyQueue.t.sol ├── libraries │ ├── ArrayCastLib.t.sol │ ├── DataLib.t.sol │ ├── PayloadUpdaterLib.t.sol │ └── ProofLib.t.sol ├── payments │ ├── PayMaster.t.sol │ └── PaymentHelper.t.sol ├── rewards-distributor │ └── RewardsDistributor.t.sol ├── roles │ └── SuperRBAC.t.sol ├── router-plus │ └── SuperformRouterPlus.t.sol ├── super-positions │ └── super-positions.t.sol ├── super-registry │ └── SuperRegistry.t.sol ├── superform-factory │ ├── superform-factory.addImplementation.sol │ ├── superform-factory.changeFormPauseStatus.t.sol │ ├── superform-factory.createSuperforms.t.sol │ └── superform-factory.stateSync.sol ├── superform-forms │ ├── superform-form.ERC4626Form.t.sol │ ├── superform-form.ERC5115Form.t.sol │ ├── superform-form.ERC7540Form.t.sol │ ├── superform-form.forwardDust.t.sol │ └── wrapper │ │ └── superform-form.5115To4626Factory.t.sol ├── superform-router │ ├── SuperformRouter.AA.t.sol │ └── SuperformRouter.t.sol └── vault-claimer │ └── VaultClaimer.t.sol └── utils ├── AmbParams.sol ├── BaseSetup.sol ├── CommonProtocolActions.sol ├── InvariantProtocolActions.sol ├── MainnetBaseSetup.sol ├── ProtocolActions.sol ├── TestTypes.sol ├── Utilities.sol └── merkle ├── helper └── MerkleReader.sol ├── merkle-js ├── generateMerkleTree.js └── generateMerkleTreeLite.js └── target ├── input0.json ├── input1.json ├── input2.json ├── jsGeneratedRoot0.json ├── jsGeneratedRoot1.json ├── jsGeneratedRoot2.json ├── jsTreeDump0.json ├── jsTreeDump1.json └── jsTreeDump2.json /.env.example: -------------------------------------------------------------------------------- 1 | REPORT_GAS=false 2 | PRODUCTION=false 3 | ENVIRONMENT=local 4 | OWNER_ADDRESS=0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92 5 | FOUNDRY_EXPORTS_OVERWRITE_LATEST=true 6 | RUST_BACKTRACE=full 7 | FOUNDRY_PROFILE=localdev 8 | TENDERLY_PROJECT_SLUG=v1 9 | TENDERLY_ACCOUNT_ID=superform 10 | WALLET_TYPE=keystore // can be ledger 11 | MNEMONIC_INDEX= // number you see in rabby -1 12 | DEBUG_MODE=false 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | 7 | #Hardhat files 8 | cache 9 | artifacts 10 | 11 | # Ignore all vscode settings 12 | .vscode/ 13 | 14 | # Ignore flattened files 15 | flattened.txt 16 | 17 | broadcast 18 | 19 | # Ignore local misc files 20 | .DS_Store 21 | *.pem 22 | 23 | # foundry 24 | forge-cache/ 25 | out/ 26 | localdev/ 27 | artifacts_forge 28 | bin/ 29 | 30 | **/.DS_Store 31 | 32 | lcov.info 33 | 34 | report/ 35 | 36 | package-lock.json 37 | 38 | output.txt 39 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/forge-std"] 2 | path = lib/forge-std 3 | url = https://github.com/foundry-rs/forge-std 4 | [submodule "lib/ds-test"] 5 | path = lib/ds-test 6 | url = https://github.com/dapphub/ds-test 7 | [submodule "lib/pigeon"] 8 | path = lib/pigeon 9 | url = https://github.com/exp-table/pigeon 10 | [submodule "lib/ERC1155A"] 11 | path = lib/ERC1155A 12 | url = https://github.com/superform-xyz/ERC1155A 13 | [submodule "lib/super-vaults"] 14 | path = lib/super-vaults 15 | url = https://github.com/superform-xyz/super-vaults 16 | [submodule "lib/surl"] 17 | path = lib/surl 18 | url = https://github.com/memester-xyz/surl 19 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: false 3 | comment: false 4 | coverage: 5 | status: 6 | patch: off 7 | ignore: 8 | - "script" 9 | - "test" 10 | - "src/vendor" 11 | -------------------------------------------------------------------------------- /contracts/README.md: -------------------------------------------------------------------------------- 1 | ## Notes 2 | 3 | - Some of the generated contract binding files are edited in order to remove duplicate declarations, e.g. `LiqRequest`, 4 | which would otherwise result in a compilation error. This is usually a no-no, so keep in mind if ever regenerating 5 | the contract bindings. -------------------------------------------------------------------------------- /funding.json: -------------------------------------------------------------------------------- 1 | { 2 | "opRetro": { 3 | "projectId": "0x82edc3ac2a03da21c5a6033159ba8e97aab2f61dc5d1d9813929fea6d6c35362" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/superform-xyz/superform-core 2 | 3 | go 1.22.5 4 | 5 | require github.com/ethereum/go-ethereum v1.14.8 6 | 7 | require ( 8 | github.com/Microsoft/go-winio v0.6.2 // indirect 9 | github.com/StackExchange/wmi v1.2.1 // indirect 10 | github.com/bits-and-blooms/bitset v1.10.0 // indirect 11 | github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect 12 | github.com/consensys/bavard v0.1.13 // indirect 13 | github.com/consensys/gnark-crypto v0.12.1 // indirect 14 | github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect 15 | github.com/deckarep/golang-set/v2 v2.6.0 // indirect 16 | github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect 17 | github.com/ethereum/c-kzg-4844 v1.0.0 // indirect 18 | github.com/fsnotify/fsnotify v1.6.0 // indirect 19 | github.com/go-ole/go-ole v1.3.0 // indirect 20 | github.com/google/uuid v1.3.0 // indirect 21 | github.com/gorilla/websocket v1.4.2 // indirect 22 | github.com/holiman/uint256 v1.3.1 // indirect 23 | github.com/mmcloughlin/addchain v0.4.0 // indirect 24 | github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect 25 | github.com/supranational/blst v0.3.11 // indirect 26 | github.com/tklauser/go-sysconf v0.3.12 // indirect 27 | github.com/tklauser/numcpus v0.6.1 // indirect 28 | golang.org/x/crypto v0.22.0 // indirect 29 | golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect 30 | golang.org/x/sync v0.7.0 // indirect 31 | golang.org/x/sys v0.20.0 // indirect 32 | rsc.io/tmplfunc v0.0.3 // indirect 33 | ) 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "merkle": "node test/utils/merkle/merkle-js/generateMerkleTree.js", 4 | "merkle-randomInput": "node test/utils/merkle/merkle-js/generateMerkleTreeLite.js" 5 | }, 6 | "dependencies": { 7 | "@openzeppelin/merkle-tree": "^1.0.5" 8 | } 9 | } -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /script/deployments/cantina_deployment/137/Polygon-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0x91A4a6E08401FFC5Cf155d7d6A7234AA0302B160", 3 | "CoreStateRegistry": "0xC525e2EE88E0014F46cb031C33c5148A153108eB", 4 | "DstSwapper": "0x363A6294897577522795c80447f2f2829DCc85c4", 5 | "ERC4626Form": "0x3bfEe78d526063e0207B1a55fD4B284306882247", 6 | "ERC4626KYCDaoForm": "0xd72Ec34384b1ba5bCeC852Fa88420D0f6F90363c", 7 | "ERC4626TimelockForm": "0x87D539863EaB9f3CB99B405929464f6aAb77e81B", 8 | "EmergencyQueue": "0x8Ef837576f37C29BAcd1efb2Eb0ddAadB01DA189", 9 | "HyperlaneImplementation": "0x922d821ddfA8958890d69053CA79a7E619A2790E", 10 | "LayerzeroImplementation": "0x22adbC6BBb1A8C4eFB579268772E7516869E2Cc6", 11 | "LiFiValidator": "0xe1E7b5011E0DcFb823916E8a91DBA9eC383E82C2", 12 | "PayMaster": "0x917455CE06FCD3acFB697781D5E937e1ABcb7694", 13 | "PayloadHelper": "0x3fF04DB7C5D74A544bC76BFabE37732196d56e34", 14 | "PaymentHelper": "0xa4498fa6b5f964a84432Fa007B04255610E21992", 15 | "SocketOneInchValidator": "0xceb161DAC215389B44FE15634A3e207bC886fa09", 16 | "SocketValidator": "0x156889A11Ed41fdAAF3da7394D5cF577bb69eaC4", 17 | "SuperPositions": "0xD240a9674E9a306009071Bd60966F66eA33341Fd", 18 | "SuperRBAC": "0x3487eD8b15c93138573CDC1226CC3ecBb4CD31af", 19 | "SuperRegistry": "0xB0bBFC88896c1a218fbAFab6C8dcf43eD587Ad63", 20 | "SuperformFactory": "0x7791026F1770780c00cEe224F9d0B61c962E9fF8", 21 | "SuperformRouter": "0x51d0a7a59F4e54a273FCbA4Fd4ea9E647e785d95", 22 | "TimelockStateRegistry": "0x1cbf6A3B019dAef506e13bf6A353e3C47Cd8250c", 23 | "WormholeARImplementation": "0x6f1d34A20C0d62A4Fc2eCA0919Fb6fDD73F37428", 24 | "WormholeSRImplementation": "0x63a62c7AF0Ed62C394420dBC7Aa0f803236886aC" 25 | } -------------------------------------------------------------------------------- /script/deployments/cantina_deployment/43114/Avalanche-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0x91A4a6E08401FFC5Cf155d7d6A7234AA0302B160", 3 | "CoreStateRegistry": "0xC525e2EE88E0014F46cb031C33c5148A153108eB", 4 | "DstSwapper": "0x363A6294897577522795c80447f2f2829DCc85c4", 5 | "ERC4626Form": "0x3bfEe78d526063e0207B1a55fD4B284306882247", 6 | "ERC4626KYCDaoForm": "0xd72Ec34384b1ba5bCeC852Fa88420D0f6F90363c", 7 | "ERC4626TimelockForm": "0x87D539863EaB9f3CB99B405929464f6aAb77e81B", 8 | "EmergencyQueue": "0x8Ef837576f37C29BAcd1efb2Eb0ddAadB01DA189", 9 | "HyperlaneImplementation": "0x922d821ddfA8958890d69053CA79a7E619A2790E", 10 | "LayerzeroImplementation": "0x22adbC6BBb1A8C4eFB579268772E7516869E2Cc6", 11 | "LiFiValidator": "0xe1E7b5011E0DcFb823916E8a91DBA9eC383E82C2", 12 | "PayMaster": "0x917455CE06FCD3acFB697781D5E937e1ABcb7694", 13 | "PayloadHelper": "0x3fF04DB7C5D74A544bC76BFabE37732196d56e34", 14 | "PaymentHelper": "0xa4498fa6b5f964a84432Fa007B04255610E21992", 15 | "SocketOneInchValidator": "0xceb161DAC215389B44FE15634A3e207bC886fa09", 16 | "SocketValidator": "0x156889A11Ed41fdAAF3da7394D5cF577bb69eaC4", 17 | "SuperPositions": "0xD240a9674E9a306009071Bd60966F66eA33341Fd", 18 | "SuperRBAC": "0x3487eD8b15c93138573CDC1226CC3ecBb4CD31af", 19 | "SuperRegistry": "0xB0bBFC88896c1a218fbAFab6C8dcf43eD587Ad63", 20 | "SuperformFactory": "0x7791026F1770780c00cEe224F9d0B61c962E9fF8", 21 | "SuperformRouter": "0x51d0a7a59F4e54a273FCbA4Fd4ea9E647e785d95", 22 | "TimelockStateRegistry": "0x1cbf6A3B019dAef506e13bf6A353e3C47Cd8250c", 23 | "WormholeARImplementation": "0x6f1d34A20C0d62A4Fc2eCA0919Fb6fDD73F37428", 24 | "WormholeSRImplementation": "0x63a62c7AF0Ed62C394420dBC7Aa0f803236886aC" 25 | } -------------------------------------------------------------------------------- /script/deployments/cantina_deployment/56/Binance-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0x91A4a6E08401FFC5Cf155d7d6A7234AA0302B160", 3 | "CoreStateRegistry": "0xC525e2EE88E0014F46cb031C33c5148A153108eB", 4 | "DstSwapper": "0x363A6294897577522795c80447f2f2829DCc85c4", 5 | "ERC4626Form": "0x3bfEe78d526063e0207B1a55fD4B284306882247", 6 | "ERC4626KYCDaoForm": "0xd72Ec34384b1ba5bCeC852Fa88420D0f6F90363c", 7 | "ERC4626TimelockForm": "0x87D539863EaB9f3CB99B405929464f6aAb77e81B", 8 | "EmergencyQueue": "0x8Ef837576f37C29BAcd1efb2Eb0ddAadB01DA189", 9 | "HyperlaneImplementation": "0x922d821ddfA8958890d69053CA79a7E619A2790E", 10 | "LayerzeroImplementation": "0x22adbC6BBb1A8C4eFB579268772E7516869E2Cc6", 11 | "LiFiValidator": "0xe1E7b5011E0DcFb823916E8a91DBA9eC383E82C2", 12 | "PayMaster": "0x917455CE06FCD3acFB697781D5E937e1ABcb7694", 13 | "PayloadHelper": "0x3fF04DB7C5D74A544bC76BFabE37732196d56e34", 14 | "PaymentHelper": "0xa4498fa6b5f964a84432Fa007B04255610E21992", 15 | "SocketOneInchValidator": "0xceb161DAC215389B44FE15634A3e207bC886fa09", 16 | "SocketValidator": "0x156889A11Ed41fdAAF3da7394D5cF577bb69eaC4", 17 | "SuperPositions": "0xD240a9674E9a306009071Bd60966F66eA33341Fd", 18 | "SuperRBAC": "0x3487eD8b15c93138573CDC1226CC3ecBb4CD31af", 19 | "SuperRegistry": "0xB0bBFC88896c1a218fbAFab6C8dcf43eD587Ad63", 20 | "SuperformFactory": "0x7791026F1770780c00cEe224F9d0B61c962E9fF8", 21 | "SuperformRouter": "0x51d0a7a59F4e54a273FCbA4Fd4ea9E647e785d95", 22 | "TimelockStateRegistry": "0x1cbf6A3B019dAef506e13bf6A353e3C47Cd8250c", 23 | "WormholeARImplementation": "0x6f1d34A20C0d62A4Fc2eCA0919Fb6fDD73F37428", 24 | "WormholeSRImplementation": "0x63a62c7AF0Ed62C394420dBC7Aa0f803236886aC" 25 | } -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/1/Ethereum-latest.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/script/deployments/ctf_deployment/1/Ethereum-latest.json -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/10/Optimism-latest.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/script/deployments/ctf_deployment/10/Optimism-latest.json -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/137/Polygon-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x67812f7490d0931dA9f2A47Cc402476B08f78502", 3 | "DstSwapper": "0x377E5829f552cd3435538006e754e24fA304ABd4", 4 | "ERC4626Form": "0x20aA26bC4e64F5D0Bf74e6Bb1387eba124314ca3", 5 | "EmergencyQueue": "0xBd0e276779619b8FA82041810A94B52795eFAAf7", 6 | "HyperlaneImplementation": "0x8D64B4b4be39769441dCA258AA2aD035E2A876f6", 7 | "LayerzeroImplementation": "0x40aF1811116541A62982a486A6B9E9287d1F115A", 8 | "LiFiValidator": "0x9DC12F4CCcf34Cb3CF744696b5b98D85F12D2977", 9 | "PayMaster": "0x3cA25b41bb127F43B5eC5b283457e8065138A850", 10 | "PayloadHelper": "0x962435D50C95EBf870aC9E98954b6f0170167fa6", 11 | "PaymentHelper": "0x1f03015196953f393aEb8a7bA423bE6Dd850Cf8d", 12 | "SocketValidator": "0x750f09A785cf308015EAd09D62fB0AdF92b6e56D", 13 | "SuperPositions": "0x4D4a0F29EFf9091360fd475fA3dB1Cc966faD958", 14 | "SuperRBAC": "0x5512926dfD71dFE572B8ABCf8dc16521cD8dc03C", 15 | "SuperRegistry": "0xB97612A25491E34F5fd11D521c14A042eca039Fa", 16 | "SuperformFactory": "0x5BC1905b3195A85DE0e831e0514005807765bB54", 17 | "SuperformRouter": "0xf274b178423B0A80E4c731419DcaD4363f6f9254", 18 | "WormholeARImplementation": "0x2a489b88EcA3Ace75AA0f00AFa6659EDa5e4a7Ed" 19 | } -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/42161/Arbitrum-latest.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/script/deployments/ctf_deployment/42161/Arbitrum-latest.json -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/43114/Avalanche-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x67812f7490d0931dA9f2A47Cc402476B08f78502", 3 | "DstSwapper": "0x377E5829f552cd3435538006e754e24fA304ABd4", 4 | "ERC4626Form": "0x20aA26bC4e64F5D0Bf74e6Bb1387eba124314ca3", 5 | "EmergencyQueue": "0xBd0e276779619b8FA82041810A94B52795eFAAf7", 6 | "HyperlaneImplementation": "0x8D64B4b4be39769441dCA258AA2aD035E2A876f6", 7 | "LayerzeroImplementation": "0x40aF1811116541A62982a486A6B9E9287d1F115A", 8 | "LiFiValidator": "0x9DC12F4CCcf34Cb3CF744696b5b98D85F12D2977", 9 | "PayMaster": "0x3cA25b41bb127F43B5eC5b283457e8065138A850", 10 | "PayloadHelper": "0x962435D50C95EBf870aC9E98954b6f0170167fa6", 11 | "PaymentHelper": "0x1f03015196953f393aEb8a7bA423bE6Dd850Cf8d", 12 | "SocketValidator": "0x750f09A785cf308015EAd09D62fB0AdF92b6e56D", 13 | "SuperPositions": "0x4D4a0F29EFf9091360fd475fA3dB1Cc966faD958", 14 | "SuperRBAC": "0x5512926dfD71dFE572B8ABCf8dc16521cD8dc03C", 15 | "SuperRegistry": "0xB97612A25491E34F5fd11D521c14A042eca039Fa", 16 | "SuperformFactory": "0x5BC1905b3195A85DE0e831e0514005807765bB54", 17 | "SuperformRouter": "0xf274b178423B0A80E4c731419DcaD4363f6f9254", 18 | "WormholeARImplementation": "0x2a489b88EcA3Ace75AA0f00AFa6659EDa5e4a7Ed" 19 | } -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/56/Binance-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x67812f7490d0931dA9f2A47Cc402476B08f78502", 3 | "DstSwapper": "0x377E5829f552cd3435538006e754e24fA304ABd4", 4 | "ERC4626Form": "0x20aA26bC4e64F5D0Bf74e6Bb1387eba124314ca3", 5 | "EmergencyQueue": "0xBd0e276779619b8FA82041810A94B52795eFAAf7", 6 | "HyperlaneImplementation": "0x8D64B4b4be39769441dCA258AA2aD035E2A876f6", 7 | "LayerzeroImplementation": "0x40aF1811116541A62982a486A6B9E9287d1F115A", 8 | "LiFiValidator": "0x9DC12F4CCcf34Cb3CF744696b5b98D85F12D2977", 9 | "PayMaster": "0x3cA25b41bb127F43B5eC5b283457e8065138A850", 10 | "PayloadHelper": "0x962435D50C95EBf870aC9E98954b6f0170167fa6", 11 | "PaymentHelper": "0x1f03015196953f393aEb8a7bA423bE6Dd850Cf8d", 12 | "SocketValidator": "0x750f09A785cf308015EAd09D62fB0AdF92b6e56D", 13 | "SuperPositions": "0x4D4a0F29EFf9091360fd475fA3dB1Cc966faD958", 14 | "SuperRBAC": "0x5512926dfD71dFE572B8ABCf8dc16521cD8dc03C", 15 | "SuperRegistry": "0xB97612A25491E34F5fd11D521c14A042eca039Fa", 16 | "SuperformFactory": "0x5BC1905b3195A85DE0e831e0514005807765bB54", 17 | "SuperformRouter": "0xf274b178423B0A80E4c731419DcaD4363f6f9254", 18 | "WormholeARImplementation": "0x2a489b88EcA3Ace75AA0f00AFa6659EDa5e4a7Ed" 19 | } -------------------------------------------------------------------------------- /script/deployments/ctf_deployment/8453/Base-latest.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/script/deployments/ctf_deployment/8453/Base-latest.json -------------------------------------------------------------------------------- /script/deployments/launch_deployment/1/Ethereum-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/10/Optimism-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/137/Polygon-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/42161/Arbitrum-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/43114/Avalanche-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/56/Binance-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/launch_deployment/8453/Base-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "BroadcastRegistry": "0xdded3E0fc2472eF3F1f262dbEf5DBedF7Ba11Cd1", 3 | "CoreStateRegistry": "0x884C1Da625D7E70ca1B8fA4BF7Ab535b7297CcE0", 4 | "DstSwapper": "0xc80cdE90baA1bf7f1F53562d6Ae9B6dc5b748616", 5 | "ERC4626Form": "0x457724F3E7e303A831015B09286fF18Ca9F98313", 6 | "EmergencyQueue": "0xb822502f4b9d070Be064061e5cb69815e78cF703", 7 | "HyperlaneImplementation": "0xe3e25b658373b594319bdA2fa550073193193706", 8 | "LayerzeroImplementation": "0x3D4124bF552adBd509F4Ba213B3b0af50D0d672E", 9 | "LiFiValidator": "0x7F991f7Bcad98c341Cf8c9022E64AFe2164A6073", 10 | "PayMaster": "0x44dfA7f53b2DAF12533E326E9FE8f886fdF4Eeff", 11 | "PayloadHelper": "0x01E51f95c83eAaB8148832034266D316732d551b", 12 | "PaymentHelper": "0x94b253872b866C04Ba4f8C4793425991Bfe59759", 13 | "SocketValidator": "0x108f40Eba195489065B61A19dbE064691612477a", 14 | "SuperPositions": "0x4cCDcA3266CF83420C9cc63b39A14B93b25CDa10", 15 | "SuperRBAC": "0x2e639444763e402F80A9Ec9D03361Be351b9d40c", 16 | "SuperRegistry": "0x38594203fB14f85AF738Ec1bAFe2A82a16BB48Cb", 17 | "SuperformFactory": "0x9bc1de324709d8CA71eE78fa6859C50d96D4391c", 18 | "SuperformRouter": "0x5E4F382e713534703E4BeF3F538777e088a6410e", 19 | "VaultClaimer": "0xc01e503Bf896E45B6Add3095EBA7696d5a682388", 20 | "WormholeARImplementation": "0x63567cb414A4Edf54A3a54D0f3D5DB3C2e07CB25", 21 | "WormholeSRImplementation": "0x99A4DB767Bd389Fbef3072a9ec7789F668de3fE3" 22 | } -------------------------------------------------------------------------------- /script/deployments/pre-launch_deployment/10/Optimism-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x41933290F00390578A35EEa9E8a37B5b48926b5d", 3 | "DstSwapper": "0xAD92C9A55225F3bAEE9D4f1cB807872eE8af3D18", 4 | "ERC4626Form": "0x5ed70013DA6aa2c076b2d3853Eb17704CAb8c233", 5 | "EmergencyQueue": "0x8f24b0010E18915409B7056C9f6D264503BFEa33", 6 | "HyperlaneImplementation": "0x46968109F3b193AcE4EB1a28076b372A8951345C", 7 | "LayerzeroImplementation": "0x454866FfCA61EE5C874df00b387858Da646b5ec9", 8 | "LiFiValidator": "0xE438D85618bEb99054DaeB14d2CBD976F77F360F", 9 | "PayMaster": "0x3Fdf950794Ce55088f4b708F6D5312DF79fFf585", 10 | "PayloadHelper": "0x0d002293422E020c3AE3CEF3E63e2CA4Dd31FB00", 11 | "PaymentHelper": "0xf445548FC5cC3D6a4c70bb4A0aC89241370Ba2f3", 12 | "SocketValidator": "0x63eb5584bae6dBa0610F953Ff5d2EB11e8f8B920", 13 | "SuperPositions": "0xD64e2FB22ADf73Ce1F23E93D08E93dc826C947bc", 14 | "SuperRBAC": "0x329788cd153E9874cfb65294C4B8EE7aDA329f60", 15 | "SuperRegistry": "0x617950dcf1Ca6177C06E100b7a1452c8906A9Ec5", 16 | "SuperformFactory": "0xdc072816dF2812Ab30Fce59E31B2Af27d0fAB575", 17 | "SuperformRouter": "0xF62c937ec43385152843aFa3707833bB4CfEE4E9", 18 | "VaultClaimer": "0x2EA3C881C91E1529329413D57E1B280D45E51dDD", 19 | "WormholeARImplementation": "0x039f3EBd7E0E86c235dEf8eff2FaEA8d8D974F9B" 20 | } -------------------------------------------------------------------------------- /script/deployments/pre-launch_deployment/42161/Arbitrum-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x41933290F00390578A35EEa9E8a37B5b48926b5d", 3 | "DstSwapper": "0xAD92C9A55225F3bAEE9D4f1cB807872eE8af3D18", 4 | "ERC4626Form": "0x5ed70013DA6aa2c076b2d3853Eb17704CAb8c233", 5 | "EmergencyQueue": "0x8f24b0010E18915409B7056C9f6D264503BFEa33", 6 | "HyperlaneImplementation": "0x46968109F3b193AcE4EB1a28076b372A8951345C", 7 | "LayerzeroImplementation": "0x454866FfCA61EE5C874df00b387858Da646b5ec9", 8 | "LiFiValidator": "0xE438D85618bEb99054DaeB14d2CBD976F77F360F", 9 | "PayMaster": "0x3Fdf950794Ce55088f4b708F6D5312DF79fFf585", 10 | "PayloadHelper": "0x0d002293422E020c3AE3CEF3E63e2CA4Dd31FB00", 11 | "PaymentHelper": "0xf445548FC5cC3D6a4c70bb4A0aC89241370Ba2f3", 12 | "SocketValidator": "0x63eb5584bae6dBa0610F953Ff5d2EB11e8f8B920", 13 | "SuperPositions": "0xD64e2FB22ADf73Ce1F23E93D08E93dc826C947bc", 14 | "SuperRBAC": "0x329788cd153E9874cfb65294C4B8EE7aDA329f60", 15 | "SuperRegistry": "0x617950dcf1Ca6177C06E100b7a1452c8906A9Ec5", 16 | "SuperformFactory": "0xdc072816dF2812Ab30Fce59E31B2Af27d0fAB575", 17 | "SuperformRouter": "0xF62c937ec43385152843aFa3707833bB4CfEE4E9", 18 | "VaultClaimer": "0x2EA3C881C91E1529329413D57E1B280D45E51dDD", 19 | "WormholeARImplementation": "0x039f3EBd7E0E86c235dEf8eff2FaEA8d8D974F9B" 20 | } -------------------------------------------------------------------------------- /script/deployments/pre-launch_deployment/8453/Base-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "CoreStateRegistry": "0x41933290F00390578A35EEa9E8a37B5b48926b5d", 3 | "DstSwapper": "0xAD92C9A55225F3bAEE9D4f1cB807872eE8af3D18", 4 | "ERC4626Form": "0x5ed70013DA6aa2c076b2d3853Eb17704CAb8c233", 5 | "EmergencyQueue": "0x8f24b0010E18915409B7056C9f6D264503BFEa33", 6 | "HyperlaneImplementation": "0x46968109F3b193AcE4EB1a28076b372A8951345C", 7 | "LayerzeroImplementation": "0x454866FfCA61EE5C874df00b387858Da646b5ec9", 8 | "LiFiValidator": "0xE438D85618bEb99054DaeB14d2CBD976F77F360F", 9 | "PayMaster": "0x3Fdf950794Ce55088f4b708F6D5312DF79fFf585", 10 | "PayloadHelper": "0x0d002293422E020c3AE3CEF3E63e2CA4Dd31FB00", 11 | "PaymentHelper": "0xf445548FC5cC3D6a4c70bb4A0aC89241370Ba2f3", 12 | "SocketValidator": "0x63eb5584bae6dBa0610F953Ff5d2EB11e8f8B920", 13 | "SuperPositions": "0xD64e2FB22ADf73Ce1F23E93D08E93dc826C947bc", 14 | "SuperRBAC": "0x329788cd153E9874cfb65294C4B8EE7aDA329f60", 15 | "SuperRegistry": "0x617950dcf1Ca6177C06E100b7a1452c8906A9Ec5", 16 | "SuperformFactory": "0xdc072816dF2812Ab30Fce59E31B2Af27d0fAB575", 17 | "SuperformRouter": "0xF62c937ec43385152843aFa3707833bB4CfEE4E9", 18 | "VaultClaimer": "0x2EA3C881C91E1529329413D57E1B280D45E51dDD", 19 | "WormholeARImplementation": "0x039f3EBd7E0E86c235dEf8eff2FaEA8d8D974F9B" 20 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/1/Ethereum-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/10/Optimism-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/137/Polygon-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/250/Fantom-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0x03a1480B5B6114B5D6c801bB4C71fc142488a41a", 3 | "BroadcastRegistry": "0xf631CA98f1884Ca3AD5abC510F071C54fbd3d8E9", 4 | "CoreStateRegistry": "0xc4e6b51bcE2F92666207214965CBeb0Bd9B5d6BF", 5 | "DstSwapper": "0x3c6C2D73ED864E25c2C0599F5716192a89554695", 6 | "ERC4626Form": "0x290dE2677EC5056458D60202B112ac44e9b3d90d", 7 | "EmergencyQueue": "0x898e4E8a442C079e74c9E61E956d2FD183e5Eb99", 8 | "HyperlaneImplementation": "0x0000000000000000000000000000000000000000", 9 | "LayerzeroImplementation": "0xbc558947dd89C72E4e9C3563Cfb637f8bd46CD5c", 10 | "LayerzeroV1Implementation": "0x5757dD91fcFd860aC9b7b036FF1fD3f869827e46", 11 | "LiFiValidator": "0xbB7d1453487043Aa8db8512eC22498a8F2fB652B", 12 | "PayMaster": "0xeE8695cDa4697987e1Fcd191F3c69FFF5Ef02eD0", 13 | "PayloadHelper": "0xf3960a8759A8757E1ED44dC24d5D2dF1394633F5", 14 | "PaymentHelper": "0xb69929AC813125EdFaCFad366643c3787C0d1500", 15 | "RewardsDistributor": "0xd6cea5c8853c3fb4bbd77ef5e924c4e647c03a94", 16 | "SocketOneInchValidator": "0xeb077f9CB0406667DDD7BE945f393297578372F1", 17 | "SocketValidator": "0xfDf661e1e7e8F617b383516688A8aFC9c6176A04", 18 | "SuperPositions": "0x7F1535FF0f0A099eb7D314e1655BD4dC92986aAD", 19 | "SuperRBAC": "0xd831b4ba49852F6E7246Fe7f4A7DABB5b0C56e1F", 20 | "SuperRegistry": "0x7feB31d18E43E2faeC718EEd2D7f34402c3e27b4", 21 | "SuperformFactory": "0xbc85043544CC2b3Fd095d54b6431822979BBB62A", 22 | "SuperformRouter": "0x50DFeb29B462a64867f421C585BDaE89cf4656d4", 23 | "VaultClaimer": "0x861e766B97eEE8774fA96C16Ee8cc448A3d68d1C", 24 | "WormholeARImplementation": "0x370dffFE065D820c30341C52b34Ac18C4df4C3E9", 25 | "WormholeSRImplementation": "0x0Bb3468d5b3Cd0842eEc911C735a9B128B21B0C9", 26 | "ERC5115Form": "0x168EFbe9bc32f1b4FCCbd7B0704331CBacB53e86", 27 | "ERC5115To4626WrapperFactory": "0xAcceD01769200d6Fe399b88789FC8a044e094112", 28 | "OneInchValidator": "0xf5232D46E988e4ED6E95f90748Ec1AAEd19Ec0B8", 29 | "DeBridgeForwarderValidator": "0xDEDaA19236743EfB77a20042AA5Bb8C8A005C388", 30 | "DeBridgeValidator": "0x3456E9f41a4039d127aCfff4708ffC6CE0Ca83e2", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000" 33 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/42161/Arbitrum-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/43114/Avalanche-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/56/Binance-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x9B1dE8d1Fbf77Ca949f944F718D93fdC48f218C8", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/59144/Linea-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xbf938adDB48594089B20677931f028261D25D6A2", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 6 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 7 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 8 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 9 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 10 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 11 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 12 | "HyperlaneImplementation": "0xe6f739F355f9e9e3788752e6cfBB2A6B7b18a13c", 13 | "LayerzeroImplementation": "0xB07e2B06839ECF55A1E47A52E4A14ba6D6D76fA4", 14 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 15 | "LiFiValidator": "0x717de40D4e360C678aC5e195B99605bc4aAC697E", 16 | "OneInchValidator": "0x0000000000000000000000000000000000000000", 17 | "PayMaster": "0x3639492Dc83019EA36899108B4A1A47cC3b3ecAa", 18 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 19 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 20 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 21 | "SocketOneInchValidator": "0x0000000000000000000000000000000000000000", 22 | "SocketValidator": "0x0000000000000000000000000000000000000000", 23 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 24 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 25 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 26 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 27 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 28 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 29 | "WormholeARImplementation": "0x0000000000000000000000000000000000000000", 30 | "WormholeSRImplementation": "0x0000000000000000000000000000000000000000", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/81457/Blast-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xbf938adDB48594089B20677931f028261D25D6A2", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 6 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 7 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 8 | "ERC4626Form": "0x9dbb4Ca0Ba024cd5efF6401F1d177b9de6A3Fd3E", 9 | "ERC5115Form": "0x5266958cb4b8E6A1534c6Ac19f4220909cf3F7FA", 10 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 11 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 12 | "HyperlaneImplementation": "0xe6f739F355f9e9e3788752e6cfBB2A6B7b18a13c", 13 | "LayerzeroImplementation": "0xB07e2B06839ECF55A1E47A52E4A14ba6D6D76fA4", 14 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 15 | "LiFiValidator": "0x717de40D4e360C678aC5e195B99605bc4aAC697E", 16 | "OneInchValidator": "0x0000000000000000000000000000000000000000", 17 | "PayMaster": "0x3639492Dc83019EA36899108B4A1A47cC3b3ecAa", 18 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 19 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 20 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 21 | "SocketOneInchValidator": "0x0000000000000000000000000000000000000000", 22 | "SocketValidator": "0x0000000000000000000000000000000000000000", 23 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 24 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 25 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 26 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 27 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 28 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 29 | "WormholeARImplementation": "0xbe296d633E91BD3E72f52732d80F7b28F18cDB54", 30 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/deployments/v1_deployment/8453/Base-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0xD8d5B00C1c99174897488E3dCa157B6849731E6A", 3 | "BroadcastRegistry": "0x856ddF6348fFF6B774566cD63f2e8db3796a0965", 4 | "CoreStateRegistry": "0x3721B0E122768CedDfB3Dec810E64c361177f826", 5 | "DstSwapper": "0x2691638Fa19357773C186BA34924E194B4Ab6cDa", 6 | "ERC4626Form": "0x58F8Cef0D825B1a609FaD0576d5F2b7399ab1335", 7 | "EmergencyQueue": "0xE22DCd9264086DF7B26d97A9A9d35e8dFac819dd", 8 | "HyperlaneImplementation": "0x9f1F6357284526489e8e6ce4b2cB2612Aa1d4712", 9 | "LayerzeroImplementation": "0x2a14460FEE6f73b408c6acF627190614daC97Df0", 10 | "LayerzeroV1Implementation": "0xc100592b40eeb4CBC7524092A00400917421ab64", 11 | "LiFiValidator": "0x7fA95363c82b2bACeB73627988dc12Eeb17E4C2B", 12 | "PayMaster": "0xF1b9e0E57D134B7dFede001ccE5e879D8C2b8C1B", 13 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 14 | "PaymentHelper": "0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd", 15 | "RewardsDistributor": "0xce23bD7205bF2B543F6B4eeC00Add0C111FEFc3B", 16 | "SocketOneInchValidator": "0x0000000000000000000000000000000000000000", 17 | "SocketValidator": "0x7483486862BDa9BA68Be4923E7E9945c2771Ec28", 18 | "SuperPositions": "0x01dF6fb6a28a89d6bFa53b2b3F20644AbF417678", 19 | "SuperRBAC": "0x480bec236e3d3AE33789908BF024850B2Fe71258", 20 | "SuperRegistry": "0x17A332dC7B40aE701485023b219E9D6f493a2514", 21 | "SuperformFactory": "0xD85ec15A9F814D6173bF1a89273bFB3964aAdaEC", 22 | "SuperformRouter": "0xa195608C2306A26f727d5199D5A382a4508308DA", 23 | "VaultClaimer": "0xC4A234A40aC13b02096Dd4aae1b8221541Dc5d5A", 24 | "WormholeARImplementation": "0xEa3b1027fe6dB0F01aCc73627B47fD4a5a079427", 25 | "WormholeSRImplementation": "0x2827eFf89affacf9E80D671bca6DeCf7dbdcCaCa", 26 | "ERC5115Form": "0x35E3057FF29ebC5b8dEF18EC66FEde16f1B237F5", 27 | "ERC5115To4626WrapperFactory": "0x664E1e7b8393DF4aC4EFAbEf9d56B2100098FCE2", 28 | "OneInchValidator": "0xB2B58dEfa7Dc7e26D21F58847BaEA5A6375eAf8D", 29 | "DeBridgeForwarderValidator": "0xDEa392D62cA1Edb74FB9210Aed714ad8F12b3E60", 30 | "DeBridgeValidator": "0x04A9e7318544DA4dd8c3d76E9c72d2087e285a8d", 31 | "AsyncStateRegistry": "0x0000000000000000000000000000000000000000", 32 | "ERC7540Form": "0x0000000000000000000000000000000000000000", 33 | "SuperformRouterPlus": "0xC417496D46eD390514cEABE2297ec6d65Df214a4" 34 | } -------------------------------------------------------------------------------- /script/forge-scripts/Mainnet.Deploy.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { EnvironmentUtils } from "./EnvironmentUtils.s.sol"; 5 | 6 | contract MainnetDeploy is EnvironmentUtils { 7 | /// @notice The main stage 1 script entrypoint 8 | function deployStage1(uint256 env, uint256 selectedChainIndex) external { 9 | _setEnvironment(env, false); 10 | _preDeploymentSetup(); 11 | 12 | uint256 trueIndex; 13 | for (uint256 i = 0; i < chainIds.length; i++) { 14 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 15 | trueIndex = i; 16 | 17 | break; 18 | } 19 | } 20 | 21 | _deployStage1(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS, salt); 22 | } 23 | 24 | /// @dev stage 2 must be called only after stage 1 is complete for all chains! 25 | function deployStage2(uint256 env, uint256 selectedChainIndex) external { 26 | _setEnvironment(env, false); 27 | _preDeploymentSetup(); 28 | 29 | uint256 trueIndex; 30 | for (uint256 i = 0; i < chainIds.length; i++) { 31 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 32 | trueIndex = i; 33 | break; 34 | } 35 | } 36 | 37 | _deployStage2(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS, TARGET_CHAINS); 38 | } 39 | 40 | /// @dev stage 3 must be called only after stage 1 is complete for all chains! 41 | function deployStage3(uint256 env, uint256 selectedChainIndex) external { 42 | _setEnvironment(env, false); 43 | _preDeploymentSetup(); 44 | 45 | uint256 trueIndex; 46 | for (uint256 i = 0; i < chainIds.length; i++) { 47 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 48 | trueIndex = i; 49 | break; 50 | } 51 | } 52 | 53 | _deployStage3(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS, true); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /script/forge-scripts/Tenderly.Deploy.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { EnvironmentUtils } from "./EnvironmentUtils.s.sol"; 5 | 6 | contract TenderlyDeploy is EnvironmentUtils { 7 | /// @notice The main stage 1 script entrypoint 8 | function deployStage1(uint256 env, uint256 selectedChainIndex) external { 9 | _setEnvironment(env, false); 10 | 11 | _preDeploymentSetup(); 12 | uint256 trueIndex; 13 | for (uint256 i = 0; i < chainIds.length; i++) { 14 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 15 | trueIndex = i; 16 | 17 | break; 18 | } 19 | } 20 | 21 | _deployStage1(env, selectedChainIndex, trueIndex, Cycle.Dev, TARGET_CHAINS, keccak256(abi.encode(salt))); 22 | } 23 | 24 | /// @dev stage 2 must be called only after stage 1 is complete for all chains! 25 | function deployStage2(uint256 env, uint256 selectedChainIndex) external { 26 | _setEnvironment(env, false); 27 | 28 | _preDeploymentSetup(); 29 | 30 | uint256 trueIndex; 31 | for (uint256 i = 0; i < chainIds.length; i++) { 32 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 33 | trueIndex = i; 34 | break; 35 | } 36 | } 37 | 38 | _deployStage2(env, selectedChainIndex, trueIndex, Cycle.Dev, TARGET_CHAINS, TARGET_CHAINS); 39 | } 40 | 41 | /// @dev stage 3 must be called only after stage 1 is complete for all chains! 42 | function deployStage3(uint256 env, uint256 selectedChainIndex) external { 43 | _setEnvironment(env, false); 44 | 45 | _preDeploymentSetup(); 46 | 47 | uint256 trueIndex; 48 | for (uint256 i = 0; i < chainIds.length; i++) { 49 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 50 | trueIndex = i; 51 | break; 52 | } 53 | } 54 | 55 | _deployStage3(env, selectedChainIndex, trueIndex, Cycle.Dev, TARGET_CHAINS, true); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Abstract.Deploy.5115To4626Factory.s.sol: -------------------------------------------------------------------------------- 1 | /// SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import "../EnvironmentUtils.s.sol"; 5 | 6 | struct UpdateVars { 7 | uint64 chainId; 8 | uint64 dstChainId; 9 | uint256 dstTrueIndex; 10 | SuperRegistry superRegistryC; 11 | SuperformFactory superformFactory; 12 | } 13 | 14 | abstract contract AbstractDeploy5115To4626WrapperFactory is EnvironmentUtils { 15 | function _deploy5115To4626WrapperFactory( 16 | uint256 env, 17 | uint256 i, 18 | uint256 trueIndex, 19 | Cycle cycle, 20 | uint64[] memory finalDeployedChains 21 | ) 22 | internal 23 | setEnvDeploy(cycle) 24 | { 25 | assert(salt.length > 0); 26 | UpdateVars memory vars; 27 | 28 | vars.chainId = finalDeployedChains[i]; 29 | 30 | cycle == Cycle.Dev ? vm.startBroadcast(deployerPrivateKey) : vm.startBroadcast(); 31 | 32 | address superRegistry = _readContractsV1(env, chainNames[trueIndex], vars.chainId, "SuperRegistry"); 33 | address expectedSr; 34 | if (env == 0) { 35 | expectedSr = vars.chainId == 250 36 | ? 0x7feB31d18E43E2faeC718EEd2D7f34402c3e27b4 37 | : 0x17A332dC7B40aE701485023b219E9D6f493a2514; 38 | } else { 39 | expectedSr = vars.chainId == 250 40 | ? 0x7B8d68f90dAaC67C577936d3Ce451801864EF189 41 | : 0xB2C097ac459aFAc892ae5b35f6bd6a9Dd3071F47; 42 | } 43 | 44 | assert(superRegistry == expectedSr); 45 | 46 | address newFactory = address(new ERC5115To4626WrapperFactory{ salt: salt }(superRegistry)); 47 | contracts[vars.chainId][bytes32(bytes("ERC5115To4626WrapperFactory"))] = newFactory; 48 | 49 | vm.stopBroadcast(); 50 | 51 | /// @dev we use normal export contract to not override v1 contracts 52 | for (uint256 j = 0; j < contractNames.length; j++) { 53 | _exportContract( 54 | chainNames[trueIndex], contractNames[j], getContract(vars.chainId, contractNames[j]), vars.chainId 55 | ); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Abstract.Update.PriceFeeds.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import "../EnvironmentUtils.s.sol"; 5 | 6 | struct UpdateVars { 7 | uint64 chainId; 8 | uint64 dstChainId; 9 | uint256 dstTrueIndex; 10 | } 11 | 12 | abstract contract AbstractUpdatePriceFeeds is EnvironmentUtils { 13 | function _updatePriceFeeds( 14 | uint256 env, 15 | uint256 i, 16 | uint256 trueIndex, 17 | Cycle cycle, 18 | uint64[] memory s_superFormChainIds 19 | ) 20 | internal 21 | setEnvDeploy(cycle) 22 | { 23 | assert(salt.length > 0); 24 | UpdateVars memory vars; 25 | 26 | vars.chainId = s_superFormChainIds[i]; 27 | 28 | cycle == Cycle.Dev ? vm.startBroadcast(deployerPrivateKey) : vm.startBroadcast(); 29 | 30 | address superRegistry = _readContractsV1(env, chainNames[trueIndex], vars.chainId, "SuperRegistry"); 31 | address expectedSr = 32 | env == 0 ? 0x17A332dC7B40aE701485023b219E9D6f493a2514 : 0xB2C097ac459aFAc892ae5b35f6bd6a9Dd3071F47; 33 | assert(superRegistry == expectedSr); 34 | 35 | address paymentHelper = _readContractsV1(env, chainNames[trueIndex], vars.chainId, "PaymentHelper"); 36 | address expectedPaymentHelper = 37 | env == 0 ? 0x69c531E5bdf2458FFb4f5E0dB3DE41745151b2Bd : 0xe14BCe82D4a72e4C95402a83fEF3C2299a61fD8C; 38 | assert(paymentHelper == expectedPaymentHelper); 39 | uint256 countFeeds; 40 | for (uint256 j = 0; j < s_superFormChainIds.length; j++) { 41 | vars.dstChainId = s_superFormChainIds[j]; 42 | 43 | for (uint256 k = 0; k < chainIds.length; k++) { 44 | if (vars.dstChainId == chainIds[k]) { 45 | vars.dstTrueIndex = k; 46 | 47 | break; 48 | } 49 | } 50 | if (PRICE_FEEDS[vars.chainId][vars.dstChainId] != address(0)) { 51 | IPaymentHelper(payable(paymentHelper)).updateRemoteChain( 52 | vars.dstChainId, 1, abi.encode(PRICE_FEEDS[vars.chainId][vars.dstChainId]) 53 | ); 54 | countFeeds++; 55 | } 56 | } 57 | console.log("Updated %d feeds", countFeeds); 58 | vm.stopBroadcast(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/DecodeULNConfig.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import "../EnvironmentUtils.s.sol"; 5 | import "src/vendor/layerzero/v2/ILayerZeroEndpointV2.sol"; 6 | 7 | contract DecodeULNConfig is EnvironmentUtils { 8 | function decodeULNConfig(uint64 chainid, uint64 dstChainId, bytes memory config) public { 9 | _setEnvironment(0, false); 10 | _preDeploymentSetup(); 11 | 12 | UlnConfig memory ulnConfig = abi.decode(config, (UlnConfig)); 13 | 14 | address[] memory requiredDVNsToAssert = new address[](2); 15 | requiredDVNsToAssert[0] = SuperformDVNs[_getTrueIndex(chainid)]; 16 | requiredDVNsToAssert[1] = LzDVNs[_getTrueIndex(chainid)]; 17 | 18 | if (requiredDVNsToAssert[0] > requiredDVNsToAssert[1]) { 19 | (requiredDVNsToAssert[0], requiredDVNsToAssert[1]) = (requiredDVNsToAssert[1], requiredDVNsToAssert[0]); 20 | } 21 | assert(ulnConfig.confirmations == 0); 22 | assert(requiredDVNsToAssert[0] == ulnConfig.requiredDVNs[0]); 23 | assert(requiredDVNsToAssert[1] == ulnConfig.requiredDVNs[1]); 24 | console.log("asserted, SRC, DST: ", chainid, dstChainId); 25 | } 26 | 27 | function _getTrueIndex(uint256 chainId) public view returns (uint256 index) { 28 | for (uint256 i; i < chainIds.length; i++) { 29 | if (chainId == chainIds[i]) { 30 | index = i; 31 | break; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Configure.PreBera.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractPreBeraLaunch } from "./Abstract.Configure.PreBeraLaunch.s.sol"; 5 | import "forge-std/console.sol"; 6 | 7 | contract MainnetConfigPreBeraDVN is AbstractPreBeraLaunch { 8 | function configure(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 9 | _setEnvironment(env, useNewSalt == 1 ? true : false); 10 | _preDeploymentSetup(); 11 | 12 | uint256 trueIndex; 13 | for (uint256 i = 0; i < chainIds.length; i++) { 14 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 15 | trueIndex = i; 16 | break; 17 | } 18 | } 19 | 20 | _configure(env, trueIndex, Cycle.Prod, TARGET_CHAINS); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.5115Form.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeploy5115Form } from "./Abstract.Deploy.5115Form.s.sol"; 5 | 6 | contract MainnetDeploy5115Form is AbstractDeploy5115Form { 7 | function deploy5115Form(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deploy5115Form(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configure5115Form(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | if (env == 1) { 33 | _configureSettingsStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 34 | } else { 35 | _configureSettingsProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.5115To4626Factory.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeploy5115To4626WrapperFactory } from "./Abstract.Deploy.5115To4626Factory.s.sol"; 5 | 6 | contract MainnetDeploy5115To4626Factory is AbstractDeploy5115To4626WrapperFactory { 7 | function deploy5115To4626Factory(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deploy5115To4626WrapperFactory(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.7540Form.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeploy7540Form } from "./Abstract.Deploy.7540Form.s.sol"; 5 | 6 | contract MainnetDeploy7540Form is AbstractDeploy7540Form { 7 | function deploy7540Form(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deploy7540Form(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configure7540Form(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | if (env == 1) { 33 | _configureSettingsStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 34 | } else { 35 | _configureSettingsProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.AsyncStateRegistry.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployAsyncStateRegistry } from "./Abstract.Deploy.AsyncStateRegistry.s.sol"; 5 | 6 | contract MainnetDeployAsyncStateRegistry is AbstractDeployAsyncStateRegistry { 7 | function deployAsyncStateRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployAsyncStateRegistry(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureAsyncStateRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | if (env == 1) { 33 | _configureSettingsStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 34 | } else { 35 | _configureSettingsProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.OneInchValidator.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployOneInchValidator } from "./Abstract.Deploy.OneInchValidator.s.sol"; 5 | 6 | contract MainnetDeployOneInchValidator is AbstractDeployOneInchValidator { 7 | function deployOneInchValidator(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployOneInch(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | _addOneInchValidatorToSuperRegistry(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.PaymentHelperV2.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployPaymentHelperV2 } from "./Abstract.Deploy.PaymentHelperV2.s.sol"; 5 | 6 | contract MainnetDeployPaymentHelperV2 is AbstractDeployPaymentHelperV2 { 7 | function deployPaymentHelper(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployPaymentHelper(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configurePaymentHelper(uint256 env, uint256 selectedChainIndex) external { 22 | _setEnvironment(env, false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | _configurePaymentHelper(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 33 | } 34 | 35 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex) external { 36 | _setEnvironment(env, false); 37 | 38 | uint256 trueIndex; 39 | for (uint256 i = 0; i < chainIds.length; i++) { 40 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 41 | trueIndex = i; 42 | break; 43 | } 44 | } 45 | 46 | if (env == 0) { 47 | _protocolAdminConfigsProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 48 | } else if (env == 1) { 49 | _protocolAdminConfigsStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy.RewardsDistributor.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployRewardsDistributor } from "./Abstract.Deploy.RewardsDistributor.s.sol"; 5 | 6 | contract MainnetDeployRewardsDistributor is AbstractDeployRewardsDistributor { 7 | function deployRewardsDistributor(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployRewardsDistributor(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSettings(uint256 env, uint256 selectedChainIndex) external { 22 | _setEnvironment(env, false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | if (env == 0) { 33 | _configureSettingsProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 34 | } else if (env == 1) { 35 | _configureSettingsStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.Deploy1inch.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeploySocket1inch } from "./Abstract.Deploy.Socket1inch.s.sol"; 5 | 6 | contract MainnetDeploy1inch is AbstractDeploySocket1inch { 7 | function deploy1inch(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deploySocket1inch(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function addSafeStagingProtocolAdmin(uint256 env, uint256 selectedChainIndex) external { 22 | _setEnvironment(env, false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | _addSafeStagingProtocolAdmin(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 33 | } 34 | 35 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex) external { 36 | _setEnvironment(env, false); 37 | 38 | uint256 trueIndex; 39 | for (uint256 i = 0; i < chainIds.length; i++) { 40 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 41 | trueIndex = i; 42 | break; 43 | } 44 | } 45 | 46 | _configureSuperRegistry(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployAxelar.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployAxelar } from "./Abstract.Deploy.Axelar.s.sol"; 5 | 6 | contract MainnetDeployAxelar is AbstractDeployAxelar { 7 | function deployAxelar(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployAxelar(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | assert(env == 1); 33 | 34 | _addAxelarSuperRegistryStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 35 | } 36 | 37 | function configureAxelar(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 38 | _setEnvironment(env, useNewSalt == 1 ? true : false); 39 | 40 | uint256 trueIndex; 41 | for (uint256 i = 0; i < chainIds.length; i++) { 42 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 43 | trueIndex = i; 44 | break; 45 | } 46 | } 47 | 48 | _configureAxelar(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployBridgeAdaptersV2.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployBridgeAdaptersV2 } from "./Abstract.Deploy.BridgeAdaptersV2.s.sol"; 5 | 6 | contract MainnetDeployBridgeAdaptersV2 is AbstractDeployBridgeAdaptersV2 { 7 | function deployBridgeAdaptersV2(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployBridgeAdaptersV2(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | assert(env == 1); 33 | 34 | _addNewBridgeAdaptersSuperRegistryStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 35 | } 36 | 37 | function configureDeploymentAdapters(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 38 | _setEnvironment(env, useNewSalt == 1 ? true : false); 39 | 40 | uint256 trueIndex; 41 | for (uint256 i = 0; i < chainIds.length; i++) { 42 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 43 | trueIndex = i; 44 | break; 45 | } 46 | } 47 | 48 | _configureDeployedAdapters(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployDeBridgeValidators.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployDeBridgeValidators } from "./Abstract.Deploy.DeBridgeValidators.s.sol"; 5 | 6 | contract MainnetDeployDeBridgeValidatorsV2 is AbstractDeployDeBridgeValidators { 7 | function deployDeBridgeValidator(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployDebridge(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | assert(env == 1); 33 | 34 | _addDeBridgeValidatorsToSuperRegistryStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployLiFiValidatorV2.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployLiFiValidatorV2 } from "./Abstract.Deploy.LiFiValidatorV2.s.sol"; 5 | 6 | contract MainnetDeployLiFiValidatorV2 is AbstractDeployLiFiValidatorV2 { 7 | function deployLiFiValidatorV2(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployLiFiValidatorV2(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex) external { 22 | _setEnvironment(env, false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | assert(env == 1); 33 | 34 | _addLiFiValidatorV2ToSuperRegistryStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployPayloadHelper.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployPayloadHelper } from "./Abstract.Deploy.PayloadHelper.s.sol"; 5 | 6 | contract MainnetDeployPayloadHelper is AbstractDeployPayloadHelper { 7 | function deployPayloadHelper(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployPayloadHelper(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 22 | _setEnvironment(env, useNewSalt == 1 ? true : false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | _addPayloadHelperToSuperRegistry(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployPaymasterV2.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractDeployPaymasterV2 } from "./Abstract.Deploy.PaymasterV2.s.sol"; 5 | 6 | contract MainnetDeployPaymasterV2 is AbstractDeployPaymasterV2 { 7 | function deployPaymasterV2(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _deployPaymasterV2(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | 21 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex) external { 22 | _setEnvironment(env, false); 23 | 24 | uint256 trueIndex; 25 | for (uint256 i = 0; i < chainIds.length; i++) { 26 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 27 | trueIndex = i; 28 | break; 29 | } 30 | } 31 | assert(env == 1); 32 | 33 | _addPaymasterV2ToSuperRegistryStaging(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DeployRescuerMissedConfig.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractRescuerMissedConfig } from "./Abstract.Deploy.RescuerMissedConfig.s.sol"; 5 | 6 | contract MainnetDeployRescuerMissedConfig is AbstractRescuerMissedConfig { 7 | function configureRescuer(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 8 | _setEnvironment(env, useNewSalt == 1 ? true : false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | if (TARGET_CHAINS[selectedChainIndex] == LINEA) { 19 | _configureRescuerLinea(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 20 | } else if (TARGET_CHAINS[selectedChainIndex] == BLAST) { 21 | _configureRescuerBlast(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.DisableInvalidDeployment.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { EnvironmentUtils } from "../EnvironmentUtils.s.sol"; 5 | 6 | contract DisableInvalidDeployment is EnvironmentUtils { 7 | /// @notice Disable invalid deployment 8 | function disableInvalidDeployment(uint256 env, uint256 selectedChainIndex, uint256 useNewSalt) external { 9 | _setEnvironment(env, useNewSalt == 1 ? true : false); 10 | 11 | _preDeploymentSetup(); 12 | uint256 trueIndex; 13 | for (uint256 i = 0; i < chainIds.length; i++) { 14 | if (TARGET_DEPLOYMENT_CHAINS[selectedChainIndex] == chainIds[i]) { 15 | trueIndex = i; 16 | 17 | break; 18 | } 19 | } 20 | 21 | _disableInvalidDeployment(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_DEPLOYMENT_CHAINS); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.EnableBroadcasting.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractEnableBroadcasting } from "./Abstract.EnableBroadcasting.s.sol"; 5 | 6 | contract MainnetEnableBroadcasting is AbstractEnableBroadcasting { 7 | function enableBroadcasting(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | env == 1 19 | ? _enableBroadcasting(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS) 20 | : _enableBroadcastingProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 21 | } 22 | 23 | function fixRevokeRole(uint256 env, uint256 selectedChainIndex) external { 24 | _setEnvironment(env, false); 25 | 26 | uint256 trueIndex; 27 | for (uint256 i = 0; i < chainIds.length; i++) { 28 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 29 | trueIndex = i; 30 | break; 31 | } 32 | } 33 | 34 | env == 1 35 | ? _revokeRole(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS) 36 | : _revokeRoleProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.SuperRegistryLiFiValidatorV2Paymaster.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractSuperRegistryLiFiValidatorV2 } from "./Abstract.SuperRegistry.LiFiValidatorV2Paymaster.s.sol"; 5 | 6 | contract MainnetSuperRegistryLiFiValidatorV2Paymaster is AbstractSuperRegistryLiFiValidatorV2 { 7 | function configureSuperRegistry(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | assert(env == 0); 18 | 19 | _addPaymasterLiFiValidatorV2ToSuperRegistryProd(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.UpdatePaymentHelper.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractUpdatePaymentHelper } from "./Abstract.Update.PaymentHelper.s.sol"; 5 | 6 | contract MainnetUpdatePaymentHelper is AbstractUpdatePaymentHelper { 7 | function updatePaymentHelper(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | 10 | uint256 trueIndex; 11 | for (uint256 i = 0; i < chainIds.length; i++) { 12 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 13 | trueIndex = i; 14 | break; 15 | } 16 | } 17 | 18 | _updatePaymentHelper(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/Mainnet.UpdatePriceFeeds.s.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AbstractUpdatePriceFeeds } from "./Abstract.Update.PriceFeeds.s.sol"; 5 | 6 | contract MainnetUpdatePriceFeeds is AbstractUpdatePriceFeeds { 7 | function updatePriceFeeds(uint256 env, uint256 selectedChainIndex) external { 8 | _setEnvironment(env, false); 9 | _preDeploymentSetup(); 10 | 11 | uint256 trueIndex; 12 | for (uint256 i = 0; i < chainIds.length; i++) { 13 | if (TARGET_CHAINS[selectedChainIndex] == chainIds[i]) { 14 | trueIndex = i; 15 | break; 16 | } 17 | } 18 | 19 | _updatePriceFeeds(env, selectedChainIndex, trueIndex, Cycle.Prod, TARGET_CHAINS); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /script/forge-scripts/misc/blast/forms/IBlastPoints.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | interface IBlastPoints { 5 | function configurePointsOperator(address operator) external; 6 | function configurePointsOperatorOnBehalf(address contractAddress, address operator) external; 7 | } 8 | -------------------------------------------------------------------------------- /script/forge-scripts/safe/lib/DelegatePrank.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity >=0.6.2 <0.9.0; 3 | 4 | import { CommonBase } from "forge-std/Base.sol"; 5 | import "forge-std/console.sol"; 6 | 7 | /* 8 | Make arbitrary delegatecalls to an implementation contract. 9 | 10 | Supplements vm.prank. 11 | 12 | You already know how to make a contract c call dest.fn(args): 13 | 14 | vm.prank(c); 15 | dest.fn(args); 16 | 17 | Now, to make c delegatecall dest.fn(args): 18 | 19 | delegatePrank(c,address(dest),abi.encodeCall(fn,(args))); 20 | 21 | */ 22 | contract DelegatePrank is CommonBase { 23 | Delegator delegator = makeDelegator(); 24 | function makeDelegator() internal returns (Delegator) { 25 | return new Delegator(); 26 | } 27 | 28 | function delegatePrank(address from, address to, bytes memory cd) public returns (bool success, bytes memory ret) { 29 | bytes memory code = from.code; 30 | vm.etch(from,address(delegator).code); 31 | (success, ret) = from.call(abi.encodeCall(delegator.etchCodeAndDelegateCall,(to,cd,code))); 32 | } 33 | } 34 | 35 | contract Delegator is CommonBase { 36 | function etchCodeAndDelegateCall(address dest, bytes memory cd, bytes calldata code) external payable virtual { 37 | vm.etch(address(this),code); 38 | assembly ("memory-safe") { 39 | let result := delegatecall(gas(), dest, add(cd,32), mload(cd), 0, 0) 40 | returndatacopy(0, 0, returndatasize()) 41 | switch result 42 | case 0 { revert(0, returndatasize()) } 43 | default { return(0, returndatasize()) } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /script/output/137/Polygon-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0x0000000000000000000000000000000000000000", 3 | "BroadcastRegistry": "0x0000000000000000000000000000000000000000", 4 | "CoreStateRegistry": "0x0000000000000000000000000000000000000000", 5 | "DeBridgeForwarderValidator": "0x0000000000000000000000000000000000000000", 6 | "DeBridgeValidator": "0x0000000000000000000000000000000000000000", 7 | "DstSwapper": "0x0000000000000000000000000000000000000000", 8 | "ERC4626Form": "0x0000000000000000000000000000000000000000", 9 | "ERC5115Form": "0x0000000000000000000000000000000000000000", 10 | "ERC5115To4626WrapperFactory": "0x0000000000000000000000000000000000000000", 11 | "EmergencyQueue": "0x0000000000000000000000000000000000000000", 12 | "HyperlaneImplementation": "0x0000000000000000000000000000000000000000", 13 | "LayerzeroImplementation": "0x0000000000000000000000000000000000000000", 14 | "LayerzeroV1Implementation": "0x0000000000000000000000000000000000000000", 15 | "LiFiValidator": "0x0000000000000000000000000000000000000000", 16 | "OneInchValidator": "0x0000000000000000000000000000000000000000", 17 | "PayMaster": "0x0000000000000000000000000000000000000000", 18 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 19 | "PaymentHelper": "0x0000000000000000000000000000000000000000", 20 | "RewardsDistributor": "0x0000000000000000000000000000000000000000", 21 | "SocketOneInchValidator": "0x0000000000000000000000000000000000000000", 22 | "SocketValidator": "0x0000000000000000000000000000000000000000", 23 | "SuperPositions": "0x0000000000000000000000000000000000000000", 24 | "SuperRBAC": "0x0000000000000000000000000000000000000000", 25 | "SuperRegistry": "0x0000000000000000000000000000000000000000", 26 | "SuperformFactory": "0x0000000000000000000000000000000000000000", 27 | "SuperformRouter": "0x0000000000000000000000000000000000000000", 28 | "VaultClaimer": "0x0000000000000000000000000000000000000000", 29 | "WormholeARImplementation": "0x0000000000000000000000000000000000000000", 30 | "WormholeSRImplementation": "0x0000000000000000000000000000000000000000" 31 | } -------------------------------------------------------------------------------- /script/output/43114/Avalanche-latest.json: -------------------------------------------------------------------------------- 1 | { 2 | "AxelarImplementation": "0x0000000000000000000000000000000000000000", 3 | "BroadcastRegistry": "0x0000000000000000000000000000000000000000", 4 | "CoreStateRegistry": "0x0000000000000000000000000000000000000000", 5 | "DeBridgeForwarderValidator": "0x0000000000000000000000000000000000000000", 6 | "DeBridgeValidator": "0x0000000000000000000000000000000000000000", 7 | "DstSwapper": "0x0000000000000000000000000000000000000000", 8 | "ERC4626Form": "0x0000000000000000000000000000000000000000", 9 | "ERC5115Form": "0x0000000000000000000000000000000000000000", 10 | "ERC5115To4626WrapperFactory": "0x0000000000000000000000000000000000000000", 11 | "EmergencyQueue": "0x0000000000000000000000000000000000000000", 12 | "HyperlaneImplementation": "0x0000000000000000000000000000000000000000", 13 | "LayerzeroImplementation": "0x0000000000000000000000000000000000000000", 14 | "LayerzeroV1Implementation": "0x0000000000000000000000000000000000000000", 15 | "LiFiValidator": "0x0000000000000000000000000000000000000000", 16 | "OneInchValidator": "0x0000000000000000000000000000000000000000", 17 | "PayMaster": "0x0000000000000000000000000000000000000000", 18 | "PayloadHelper": "0xAD2b7eD1315330633bc265A0109D3B12D4caed3c", 19 | "PaymentHelper": "0x0000000000000000000000000000000000000000", 20 | "RewardsDistributor": "0x0000000000000000000000000000000000000000", 21 | "SocketOneInchValidator": "0x0000000000000000000000000000000000000000", 22 | "SocketValidator": "0x0000000000000000000000000000000000000000", 23 | "SuperPositions": "0x0000000000000000000000000000000000000000", 24 | "SuperRBAC": "0x0000000000000000000000000000000000000000", 25 | "SuperRegistry": "0x0000000000000000000000000000000000000000", 26 | "SuperformFactory": "0x0000000000000000000000000000000000000000", 27 | "SuperformRouter": "0x0000000000000000000000000000000000000000", 28 | "VaultClaimer": "0x0000000000000000000000000000000000000000", 29 | "WormholeARImplementation": "0x0000000000000000000000000000000000000000", 30 | "WormholeSRImplementation": "0x0000000000000000000000000000000000000000" 31 | } -------------------------------------------------------------------------------- /script/output/80084/BerachainBartio-latest.json: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /script/utils/misc/run_script_mainnet_configure_rescuer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Note: How to set default - https://www.youtube.com/watch?v=VQe7cIpaE54 3 | 4 | export ETHEREUM_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/ETHEREUM_RPC_URL/credential) 5 | export BSC_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BSC_RPC_URL/credential) 6 | export AVALANCHE_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/AVALANCHE_RPC_URL/credential) 7 | export POLYGON_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/POLYGON_RPC_URL/credential) 8 | export ARBITRUM_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/ARBITRUM_RPC_URL/credential) 9 | export OPTIMISM_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/OPTIMISM_RPC_URL/credential) 10 | export BASE_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BASE_RPC_URL/credential) 11 | export FANTOM_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/FANTOM_RPC_URL/credential) 12 | export LINEA_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/LINEA_RPC_URL/credential) 13 | export BLAST_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BLAST_RPC_URL/credential) 14 | 15 | echo Configuring bridge rescuer: ... 16 | 17 | FOUNDRY_PROFILE=production forge script script/forge-scripts/misc/Mainnet.DeployRescuerMissedConfig.s.sol:MainnetDeployRescuerMissedConfig --sig "configureRescuer(uint256,uint256, uint256)" 0 8 0 --rpc-url $LINEA_RPC_URL --slow --broadcast --account default --sender 0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92 18 | wait 19 | 20 | < /dev/null 2>&1; then 14 | # Extract the base name of the contract (without extension) 15 | contract_name=$(basename "$json_file" .json) 16 | 17 | # Generate the ABI file path 18 | abi_file="${contract_dir}${contract_name}.abi" 19 | 20 | # Extract the ABI from the JSON and write it to the ABI file 21 | jq '.abi' "$json_file" > "$abi_file" 22 | fi 23 | fi 24 | done 25 | done -------------------------------------------------------------------------------- /script/utils/run_script_testnet_new_chain.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Note: How to set defaultKey - https://www.youtube.com/watch?v=VQe7cIpaE54 3 | 4 | export BARTIO_RPC_URL=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/BARTIO_RPC_URL/credential) 5 | export FIREBLOCKS_API_KEY=$(op read op://zry2qwhqux2w6qtjitg44xb7b4/V1_EMERGENCY_ACTION_KEY/credential) 6 | export FIREBLOCKS_API_PRIVATE_KEY_PATH=$(op read op://zry2qwhqux2w6qtjitg44xb7b4/V1_EMERGENCY_ACTION_SECRET_SSH/private_key) 7 | export FIREBLOCKS_VAULT_ACCOUNT_IDS=6 #Emergency admin prod 8 | 9 | echo Running Stage 1: ... 10 | 11 | FOUNDRY_PROFILE=production forge script script/forge-scripts/misc/Mainnet.Deploy.NewChain.s.sol:MainnetDeployNewChain --sig "deployStage1(uint256,uint256,uint256)" 3 0 0 --rpc-url $BARTIO_RPC_URL --slow --account default --sender 0x48aB8AdF869Ba9902Ad483FB1Ca2eFDAb6eabe92 --broadcast 12 | 13 | wait 14 | 15 | # All stage 1 must be done up until here, addresses must be copied to v1 folder 16 | -------------------------------------------------------------------------------- /script/utils/spawn_tenderly_devnets.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Read the RPC URL 4 | source .env 5 | 6 | if [[ $ENVIRONMENT == "local" ]]; then 7 | export TENDERLY_ACCESS_KEY=$(op read op://5ylebqljbh3x6zomdxi3qd7tsa/TENDERLY_ACCESS_KEY/credential) 8 | fi 9 | 10 | tenderly devnet spawn-rpc --project $TENDERLY_PROJECT_SLUG --template bscdevnet --account $TENDERLY_ACCOUNT_ID --access_key $TENDERLY_ACCESS_KEY 11 | tenderly devnet spawn-rpc --project $TENDERLY_PROJECT_SLUG --template polygondevnet --account $TENDERLY_ACCOUNT_ID --access_key $TENDERLY_ACCESS_KEY 12 | tenderly devnet spawn-rpc --project $TENDERLY_PROJECT_SLUG --template basedevnet --account $TENDERLY_ACCOUNT_ID --access_key $TENDERLY_ACCESS_KEY 13 | -------------------------------------------------------------------------------- /script/utils/verify_safe_txs/verify_all_networks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define array of networks 4 | NETWORKS=( 5 | "ethereum" 6 | "bsc" 7 | "avalanche" 8 | "polygon" 9 | "arbitrum" 10 | "optimism" 11 | "base" 12 | "linea" 13 | "blast" 14 | ) 15 | 16 | # Define arrays for networks and their corresponding nonces 17 | declare -A NETWORK_ADDRESSES=( 18 | ["ethereum"]="0xd26b38a64C812403fD3F87717624C80852cD6D61" 19 | ["bsc"]="0xf70A19b67ACC4169cA6136728016E04931D550ae" 20 | ["avalanche"]="0x79DD9868A1a89720981bF077A02a4A43c57080d2" 21 | ["polygon"]="0x5022b05721025159c82E02abCb0Daa87e357f437" 22 | ["arbitrum"]="0x7Fc07cAFb65d1552849BcF151F7035C5210B76f4" 23 | ["optimism"]="0x99620a926D68746D5F085B3f7cD62F4fFB71f0C1" 24 | ["base"]="0x2F973806f8863E860A553d4F2E7c2AB4A9F3b87C" 25 | ["linea"]="0x62Bbfe3ef3faAb7045d29bC388E5A0c5033D8b77" 26 | ["blast"]="0x95B5837CF46E6ab340fFf3844ca5e7d8ead5B8AF" 27 | ) 28 | 29 | declare -A NETWORK_NONCES=( 30 | ["ethereum"]="24" 31 | ["bsc"]="24" 32 | ["avalanche"]="24" 33 | ["polygon"]="24" 34 | ["arbitrum"]="23" 35 | ["optimism"]="23" 36 | ["base"]="22" 37 | ["linea"]="6" 38 | ["blast"]="5" 39 | ) 40 | 41 | # Path to the verification script 42 | VERIFY_SCRIPT="./script/utils/verify_safe_txs/verify_network.sh" 43 | 44 | # Check if the verification script exists 45 | if [ ! -f "$VERIFY_SCRIPT" ]; then 46 | echo "Error: Verification script not found at $VERIFY_SCRIPT" 47 | exit 1 48 | fi 49 | 50 | # Iterate through each network and execute the verification script 51 | for network in "${NETWORKS[@]}"; do 52 | echo "----------------------------------------" 53 | echo "Verifying network: $network" 54 | echo "Address: ${NETWORK_ADDRESSES[$network]}" 55 | echo "Nonce: ${NETWORK_NONCES[$network]}" 56 | echo "----------------------------------------" 57 | 58 | /opt/homebrew/bin/bash "$VERIFY_SCRIPT" \ 59 | --network "$network" \ 60 | --address "${NETWORK_ADDRESSES[$network]}" \ 61 | --nonce "${NETWORK_NONCES[$network]}" 62 | 63 | echo -e "\n" 64 | done 65 | 66 | echo "Verification complete for all networks!" 67 | -------------------------------------------------------------------------------- /security-review/2023-09-gerard-persoon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/security-review/2023-09-gerard-persoon.pdf -------------------------------------------------------------------------------- /security-review/2023-09-hans-friese.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/security-review/2023-09-hans-friese.pdf -------------------------------------------------------------------------------- /security-review/README.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | This directory contains information relevant to prior security reviews and the scope of bug bounties. 4 | 5 | ## Out of scope 6 | 7 | The following contracts, behaviors, and findings are out of scope: 8 | 9 | - Anything in [`src/vendor`](./src/vendor) 10 | - Prior findings in any audit report found in this directory 11 | - Exploits concerning the inappropriate behavior of keeper roles mentioned below 12 | - Superform allows for the permissionless addition of yield. We do not maintain the security of vaults added and funds bricked or lost by improper implementations 13 | - Our v1 was deployed on January 24th, 2024. Changes to the LiFi or Socket codebase after this point, implicitly used in LiFiValidator and SocketValidator, are monitored and validated off-chain and we will not consider errors specific to any added functionality 14 | - Anything related to MultiVaultSFData.extraFormData usage in relation of multi vault withdraws processing in CoreStateRegistry (the variable is ignored) 15 | 16 | ## Off-chain Architecture 17 | 18 | Superform employs a variety of keepers to support best-in-class UX of interacting cross-chain. While this introduces a degree of centralization in our protocol, these roles can be decentralized over time and have no control over user funds. These include: 19 | 20 | - PAYMENT_ADMIN_ROLE: Role for managing payment-related actions in `PayMaster.sol` 21 | - BROADCASTER_ROLE: Role for managing broadcasting payloads in `BroadcastStateRegistry.sol` 22 | - CORE_STATE_REGISTRY_PROCESSOR_ROLE: Role for managing processing operations in `CoreStateRegistry.sol` 23 | - TIMELOCK_STATE_REGISTRY_PROCESSOR_ROLE: Role for managing processing operations in `TimelockStateRegistry.sol` 24 | - BROADCAST_REGISTRY_PROCESSOR_ROLE : Role for managing processing broadcast payloads in `BroadcastStateRegistry.sol` 25 | - CORE_STATE_REGISTRY_UPDATER_ROLE: Role for managing updating operations in `CoreStateRegistry.sol` 26 | - DST_SWAPPER_ROLE: Role for managing swapping operations on `DstSwapper.sol` 27 | - CORE_STATE_REGISTRY_RESCUER_ROLE: Role for managing rescue operations in `CoreStateRegistry.sol` 28 | - CORE_STATE_REGISTRY_DISPUTER_ROLE: Role for managing dispute operations in `CoreStateRegistry.sol` 29 | - WORMHOLE_VAA_RELAYER_ROLE: Role that will be reading VAA's for broadcast functionality in `WormholeSRImplementation.sol` 30 | -------------------------------------------------------------------------------- /security-review/report-cantinacode-superform.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/security-review/report-cantinacode-superform.pdf -------------------------------------------------------------------------------- /security-review/report-competition-superform.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/superform-xyz/superform-core/0be774040de50319106dd0cd1a40b348c89f6a64/security-review/report-competition-superform.pdf -------------------------------------------------------------------------------- /slither.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "detectors_to_exclude": "solc-version,timestamp,naming-convention", 3 | "solc_remaps": [ 4 | "forge-std/=lib/forge-std/src/", 5 | "ds-test/=lib/ds-test/src/", 6 | "ERC1155A/=lib/ERC1155A/src/", 7 | "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", 8 | "pigeon/=lib/pigeon/src/", 9 | "super-vaults/=lib/super-vaults/src/", 10 | "wormhole-solidity-sdk/=lib/wormhole-solidity-sdk/src/", 11 | "solmate/=lib/ERC1155A/lib/solmate/src/", 12 | "openzeppelin-contracts/=lib/ERC1155A/lib/openzeppelin-contracts/" 13 | ], 14 | "filter_paths":"test,script,lib,utils" 15 | } 16 | -------------------------------------------------------------------------------- /src/VaultClaimer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { IVaultClaimer } from "./interfaces/IVaultClaimer.sol"; 5 | 6 | /// @title VaultClaimer 7 | /// @author Zeropoint Labs 8 | contract VaultClaimer is IVaultClaimer { 9 | ////////////////////////////////////////////////////////////// 10 | // EXTERNAL FUNCTIONS // 11 | ////////////////////////////////////////////////////////////// 12 | 13 | /// @inheritdoc IVaultClaimer 14 | function claimProtocolOwnership(string calldata protocolId_) external override { 15 | emit Claimed(msg.sender, protocolId_); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/crosschain-data/utils/Broadcastable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { IBroadcastRegistry } from "src/interfaces/IBroadcastRegistry.sol"; 5 | import { Error } from "src/libraries/Error.sol"; 6 | 7 | /// @title Broadcastable 8 | /// @dev Can be inherited in contracts that wish to support broadcasting 9 | /// @author ZeroPoint Labs 10 | abstract contract Broadcastable { 11 | ////////////////////////////////////////////////////////////// 12 | // INTERNAL FUNCTIONS // 13 | ////////////////////////////////////////////////////////////// 14 | 15 | /// @dev broadcasts state changes to all connected remote chains 16 | /// @param broadcastRegistry_ is the address of the broadcast registry contract. 17 | /// @param payMaster_ is the address of the paymaster contract. 18 | /// @param message_ is the crosschain message to be sent. 19 | /// @param extraData_ is the amb override information. 20 | function _broadcast( 21 | address broadcastRegistry_, 22 | address payMaster_, 23 | bytes memory message_, 24 | bytes memory extraData_ 25 | ) 26 | internal 27 | { 28 | (uint8 ambId, bytes memory broadcastParams) = abi.decode(extraData_, (uint8, bytes)); 29 | 30 | /// @dev if the broadcastParams are wrong this will revert 31 | (uint256 gasFee, bytes memory extraData) = abi.decode(broadcastParams, (uint256, bytes)); 32 | 33 | if (msg.value < gasFee) { 34 | revert Error.INVALID_BROADCAST_FEE(); 35 | } 36 | 37 | /// @dev ambIds are validated inside the broadcast state registry 38 | IBroadcastRegistry(broadcastRegistry_).broadcastPayload{ value: gasFee }( 39 | msg.sender, ambId, gasFee, message_, extraData 40 | ); 41 | 42 | if (msg.value > gasFee) { 43 | /// @dev forwards the rest to paymaster 44 | (bool success,) = payable(payMaster_).call{ value: msg.value - gasFee }(""); 45 | 46 | if (!success) { 47 | revert Error.FAILED_TO_SEND_NATIVE(); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/crosschain-data/utils/QuorumManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { IQuorumManager } from "src/interfaces/IQuorumManager.sol"; 5 | import { Error } from "src/libraries/Error.sol"; 6 | 7 | /// @title QuorumManager 8 | /// @dev Quorum thresholds using in sending proofs from chain to chain 9 | /// @author ZeroPoint Labs 10 | abstract contract QuorumManager is IQuorumManager { 11 | 12 | ////////////////////////////////////////////////////////////// 13 | // STATE VARIABLES // 14 | ////////////////////////////////////////////////////////////// 15 | 16 | mapping(uint64 srcChainId => uint256 quorum) internal requiredQuorum; 17 | 18 | ////////////////////////////////////////////////////////////// 19 | // EXTERNAL VIEW FUNCTIONS // 20 | ////////////////////////////////////////////////////////////// 21 | 22 | /// @inheritdoc IQuorumManager 23 | function getRequiredMessagingQuorum(uint64 srcChainId_) public view returns (uint256 quorum_) { 24 | /// @dev no chain can have chain id zero. (validates that here) 25 | if (srcChainId_ == 0) { 26 | revert Error.ZERO_INPUT_VALUE(); 27 | } 28 | return requiredQuorum[srcChainId_]; 29 | } 30 | 31 | ////////////////////////////////////////////////////////////// 32 | // EXTERNAL WRITE FUNCTIONS // 33 | ////////////////////////////////////////////////////////////// 34 | 35 | /// @inheritdoc IQuorumManager 36 | function setRequiredMessagingQuorum(uint64 srcChainId_, uint256 quorum_) external virtual; 37 | } 38 | -------------------------------------------------------------------------------- /src/crosschain-liquidity/debridge/libraries/DeBridgeError.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | library DeBridgeError { 5 | /// @dev if permit envelop length is greater than zero 6 | error INVALID_PERMIT_ENVELOP(); 7 | 8 | /// @dev if dst authority address is not CORE_STATE_REGISTRY_RESCUER_ROLE 9 | /// only the CORE_STATE_REGISTRY_RESCUER_ROLE is allowed to cancel a debridge order on destination chain 10 | error INVALID_DEBRIDGE_AUTHORITY(); 11 | 12 | /// @dev if external call is allowed 13 | error INVALID_EXTRA_CALL_DATA(); 14 | 15 | /// @dev if bridge data is invalid 16 | error INVALID_BRIDGE_DATA(); 17 | 18 | /// @dev if swap token and bridge token mismatch 19 | error INVALID_BRIDGE_TOKEN(); 20 | 21 | /// @dev debridge don't allow same chain swaps 22 | error ONLY_SWAPS_DISALLOWED(); 23 | 24 | /// @dev if dst taker is restricted 25 | error INVALID_TAKER_DST(); 26 | 27 | /// @dev if cancel beneficiary is invalid 28 | error INVALID_REFUND_ADDRESS(); 29 | 30 | /// @dev if swap permit envelope is invalid 31 | error INVALID_SWAP_PERMIT_ENVELOP(); 32 | 33 | /// @dev if the patch authority is not valid 34 | error INVALID_PATCH_ADDRESS(); 35 | 36 | /// @dev if the swap router is invalid 37 | error INVALID_SWAP_ROUTER(); 38 | } -------------------------------------------------------------------------------- /src/forms/README.md: -------------------------------------------------------------------------------- 1 | # Forms 2 | 3 | This directory contains Superform's "Form" smart contracts. These form contracts serve as fundamental components of the Superform DeFi infrastructure, acting as intermediaries for deposit and withdrawal actions to and from vaults. Each resulting Superform, created when vaults are added to Forms, is uniquely associated with a single underlying Vault. 4 | 5 | All Form contracts adhere to the [IBaseForm](../interfaces/IBaseForm.sol) standard interface and implement abstract functions defined in [BaseForm](../BaseForm.sol) for both same-chain and cross-chain operations. Apart from the standard ERC4626 Form, numerous other "custom" Form types can be created. These are extended from BaseForm and used when Superform needs to handle specific scenarios not covered by an existing Form. 6 | 7 | Interaction with Superforms happens through the four implemented external functions in BaseForm. They are split by direct chain (accessible by `SuperformRouter` only) or cross chain access (accessible by `CoreStateRegistry` only). 8 | 9 | ### In scope 10 | 11 | **ERC4626FormImplementation.sol:** Abstract implementation of a Form contract with functions that are commonly used across forms. All functions can be overridden in specific Form implementations. 12 | 13 | **ERC4626Form.sol:** The standard implementation of a Form contract. This Form interacts with a corresponding ERC4626 compliant vault. 14 | 15 | **ERC5115Form.sol:** This Form interacts with a corresponding ERC5115 compliant vault. 16 | 17 | -------------------------------------------------------------------------------- /src/forms/interfaces/IERC4626Form.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; 5 | 6 | /// @title IERC4626Form 7 | /// @dev Interface for ERC4626Form 8 | /// @author Zeropoint Labs 9 | interface IERC4626Form is IERC20 { 10 | 11 | ////////////////////////////////////////////////////////////// 12 | // EXTERNAL VIEW FUNCTIONS // 13 | ////////////////////////////////////////////////////////////// 14 | 15 | function vaultSharesIsERC20() external pure returns (bool); 16 | 17 | function vaultSharesIsERC4626() external pure returns (bool); 18 | 19 | function getVaultAsset() external view returns (address); 20 | 21 | function getVaultName() external view returns (string memory); 22 | 23 | function getVaultSymbol() external view returns (string memory); 24 | 25 | function getVaultDecimals() external view returns (uint256); 26 | 27 | function getPricePerVaultShare() external view returns (uint256); 28 | 29 | function getVaultShareBalance() external view returns (uint256); 30 | 31 | function getTotalAssets() external view returns (uint256); 32 | 33 | function getTotalSupply() external view returns (uint256); 34 | 35 | function getPreviewPricePerVaultShare() external view returns (uint256); 36 | 37 | function previewDepositTo(uint256 assets_) external view returns (uint256); 38 | 39 | function previewWithdrawFrom(uint256 assets_) external view returns (uint256); 40 | 41 | function previewRedeemFrom(uint256 shares_) external view returns (uint256); 42 | } 43 | -------------------------------------------------------------------------------- /src/interfaces/IBaseSuperformRouterPlus.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | interface IBaseSuperformRouterPlus { 5 | ////////////////////////////////////////////////////////////// 6 | // ERRORS // 7 | ////////////////////////////////////////////////////////////// 8 | 9 | /// @notice thrown if the provided selector is invalid 10 | error INVALID_REBALANCE_SELECTOR(); 11 | 12 | ////////////////////////////////////////////////////////////// 13 | // STRUCTS // 14 | ////////////////////////////////////////////////////////////// 15 | 16 | struct XChainRebalanceData { 17 | bytes4 rebalanceSelector; 18 | address interimAsset; 19 | uint256 slippage; 20 | uint256 expectedAmountInterimAsset; 21 | uint8[][] rebalanceToAmbIds; 22 | uint64[] rebalanceToDstChainIds; 23 | bytes rebalanceToSfData; 24 | } 25 | 26 | ////////////////////////////////////////////////////////////// 27 | // ENUMS // 28 | ////////////////////////////////////////////////////////////// 29 | 30 | enum Actions { 31 | DEPOSIT, 32 | REBALANCE_FROM_SINGLE, 33 | REBALANCE_FROM_MULTI, 34 | REBALANCE_X_CHAIN_FROM_SINGLE, 35 | REBALANCE_X_CHAIN_FROM_MULTI 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/interfaces/IBroadcastAmbImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title IBroadcastAmbImplementation 5 | /// @dev Interface for AMBs used in Broadcasting 6 | /// @author ZeroPoint Labs 7 | interface IBroadcastAmbImplementation { 8 | 9 | ////////////////////////////////////////////////////////////// 10 | // EVENTS // 11 | ////////////////////////////////////////////////////////////// 12 | 13 | event ChainAdded(uint64 indexed superChainId); 14 | event AuthorizedImplAdded(uint64 indexed superChainId, address indexed authImpl); 15 | 16 | ////////////////////////////////////////////////////////////// 17 | // EXTERNAL VIEW FUNCTIONS // 18 | ////////////////////////////////////////////////////////////// 19 | 20 | /// @dev returns the gas fees estimation in native tokens 21 | /// @param message_ is the cross-chain message to be broadcasted 22 | /// @param extraData_ is optional broadcast override information 23 | /// @return fees is the native_tokens to be sent along the transaction 24 | /// @notice estimation differs for different message bridges. 25 | function estimateFees(bytes memory message_, bytes memory extraData_) external view returns (uint256 fees); 26 | 27 | ////////////////////////////////////////////////////////////// 28 | // EXTERNAL WRITE FUNCTIONS // 29 | ////////////////////////////////////////////////////////////// 30 | 31 | /// @dev allows state registry to send messages to multiple dst chains 32 | /// @param srcSender_ is the caller (used for gas refunds) 33 | /// @param message_ is the cross-chain message to be broadcasted 34 | /// @param extraData_ is optional broadcast override information 35 | function broadcastPayload(address srcSender_, bytes memory message_, bytes memory extraData_) external payable; 36 | } 37 | -------------------------------------------------------------------------------- /src/interfaces/IBroadcastRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title IBroadcastRegistry 5 | /// @dev Interface for BroadcastRegistry 6 | /// @author ZeroPoint Labs 7 | interface IBroadcastRegistry { 8 | ////////////////////////////////////////////////////////////// 9 | // EXTERNAL WRITE FUNCTIONS // 10 | ////////////////////////////////////////////////////////////// 11 | 12 | /// @dev emitted when a payload is broadcasted 13 | event PayloadSent(address indexed sender); 14 | 15 | /// @dev emitted when a broadcast payload is received 16 | event PayloadReceived(uint256 indexed payloadId, uint64 indexed srcChainId); 17 | 18 | ////////////////////////////////////////////////////////////// 19 | // EXTERNAL WRITE FUNCTIONS // 20 | ////////////////////////////////////////////////////////////// 21 | 22 | /// @dev allows core contracts to send payload to all configured destination chain. 23 | /// @param srcSender_ is the caller of the function (used for gas refunds). 24 | /// @param ambId_ is the identifier of the arbitrary message bridge to be used 25 | /// @param gasFee_ is the gas fee to be used for broadcasting 26 | /// @param message_ is the crosschain payload to be broadcasted 27 | /// @param extraData_ defines all the message bridge related overrides 28 | function broadcastPayload( 29 | address srcSender_, 30 | uint8 ambId_, 31 | uint256 gasFee_, 32 | bytes memory message_, 33 | bytes memory extraData_ 34 | ) 35 | external 36 | payable; 37 | 38 | /// @dev allows ambs to write broadcasted payloads 39 | function receiveBroadcastPayload(uint64 srcChainId_, bytes memory message_) external; 40 | 41 | /// @dev allows privileged actors to process broadcasted payloads 42 | /// @param payloadId_ is the identifier of the cross-chain payload 43 | function processPayload(uint256 payloadId_) external; 44 | } 45 | -------------------------------------------------------------------------------- /src/interfaces/IEmergencyQueue.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { InitSingleVaultData } from "src/types/DataTypes.sol"; 5 | 6 | /// @title IEmergencyQueue 7 | /// @dev Interface for EmergencyQueue 8 | /// @author ZeroPoint Labs 9 | interface IEmergencyQueue { 10 | 11 | ////////////////////////////////////////////////////////////// 12 | // EVENTS // 13 | ////////////////////////////////////////////////////////////// 14 | 15 | event WithdrawalQueued( 16 | address indexed receiverAddress, 17 | uint256 indexed id, 18 | uint256 indexed superformId, 19 | uint256 amount, 20 | uint256 srcPayloadId 21 | ); 22 | 23 | event WithdrawalProcessed( 24 | address indexed refundAddress, uint256 indexed id, uint256 indexed superformId, uint256 amount 25 | ); 26 | 27 | ////////////////////////////////////////////////////////////// 28 | // EXTERNAL VIEW FUNCTIONS // 29 | ////////////////////////////////////////////////////////////// 30 | 31 | /// @dev returns the execution status of an id in the emergency queue 32 | /// @param id is the identifier of the queued action 33 | /// @return boolean representing the execution status 34 | function queuedWithdrawalStatus(uint256 id) external view returns (bool); 35 | 36 | ////////////////////////////////////////////////////////////// 37 | // EXTERNAL WRITE FUNCTIONS // 38 | ////////////////////////////////////////////////////////////// 39 | 40 | /// @dev called by paused forms to queue up withdrawals for exit 41 | /// @param data_ is the single vault data passed by the user 42 | function queueWithdrawal(InitSingleVaultData memory data_) external; 43 | 44 | /// @dev called by emergency admin to processed queued withdrawal 45 | /// @param id_ is the identifier of the queued action 46 | function executeQueuedWithdrawal(uint256 id_) external; 47 | 48 | /// @dev called by emergency admin to batch process queued withdrawals 49 | /// @param ids_ is the array of identifiers of the queued actions 50 | function batchExecuteQueuedWithdrawal(uint256[] memory ids_) external; 51 | } 52 | -------------------------------------------------------------------------------- /src/interfaces/ILiFiValidator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title LiFi Validator Interface 5 | /// @author Zeropoint Labs 6 | interface ILiFiValidator { 7 | ////////////////////////////////////////////////////////////// 8 | // EVENTS // 9 | ////////////////////////////////////////////////////////////// 10 | ///@dev emitted when a selector is added to the blacklist 11 | event AddedToBlacklist(bytes4 selector); 12 | 13 | ///@dev emitted when a selector is removed from the blacklist 14 | event RemovedFromBlacklist(bytes4 selector); 15 | 16 | ////////////////////////////////////////////////////////////// 17 | // EXTERNAL FUNCTIONS // 18 | ////////////////////////////////////////////////////////////// 19 | 20 | /// @dev Adds a selector to the blacklist 21 | /// @param selector_ the selector to add 22 | function addToBlacklist(bytes4 selector_) external; 23 | 24 | /// @dev Removes a selector from the blacklist 25 | /// @param selector_ the selector to remove 26 | function removeFromBlacklist(bytes4 selector_) external; 27 | ////////////////////////////////////////////////////////////// 28 | // EXTERNAL VIEW FUNCTIONS // 29 | ////////////////////////////////////////////////////////////// 30 | 31 | /// @dev Checks if given selector is blacklisted 32 | /// @param selector_ the selector to check 33 | /// @return blacklisted if selector is blacklisted 34 | function isSelectorBlacklisted(bytes4 selector_) external view returns (bool blacklisted); 35 | } 36 | -------------------------------------------------------------------------------- /src/interfaces/IQuorumManager.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title IQuorumManager 5 | /// @dev Interface for QuorumManager 6 | /// @author ZeroPoint Labs 7 | interface IQuorumManager { 8 | 9 | ////////////////////////////////////////////////////////////// 10 | // EVENTS // 11 | ////////////////////////////////////////////////////////////// 12 | 13 | /// @dev emitted when a new quorum is set for a specific chain 14 | /// @param srcChainId the chain id from which the message (payload) is sent 15 | /// @param quorum the minimum number of message bridges required for processing 16 | event QuorumSet(uint64 indexed srcChainId, uint256 indexed quorum); 17 | 18 | ////////////////////////////////////////////////////////////// 19 | // EXTERNAL VIEW FUNCTIONS // 20 | ////////////////////////////////////////////////////////////// 21 | 22 | /// @dev returns the required quorum for the srcChain & dstChain 23 | /// @param srcChainId_ is the chain id from which the message (payload) is sent 24 | /// @return quorum_ the minimum number of message bridges required for processing 25 | function getRequiredMessagingQuorum(uint64 srcChainId_) external view returns (uint256 quorum_); 26 | 27 | ////////////////////////////////////////////////////////////// 28 | // EXTERNAL WRITE FUNCTIONS // 29 | ////////////////////////////////////////////////////////////// 30 | 31 | /// @dev allows inheriting contracts to set the messaging quorum for a specific sender chain 32 | /// @notice quorum is the number of extra ambs a message proof must go through and be validated 33 | /// @param srcChainId_ is the chain id from which the message (payload) is sent 34 | /// @param quorum_ the minimum number of message bridges required for processing 35 | /// NOTE: overriding child contracts should handle the sender validation & setting of message quorum 36 | function setRequiredMessagingQuorum(uint64 srcChainId_, uint256 quorum_) external; 37 | } 38 | -------------------------------------------------------------------------------- /src/interfaces/ISocketValidator.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title LiFi Validator Interface 5 | /// @author Zeropoint Labs 6 | interface ISocketValidator { 7 | ////////////////////////////////////////////////////////////// 8 | // EVENTS // 9 | ////////////////////////////////////////////////////////////// 10 | ///@dev emitted when a route id is added to the blacklist 11 | event AddedToBlacklist(uint256 indexed id); 12 | 13 | ///@dev emitted when a route id is removed from the blacklist 14 | event RemovedFromBlacklist(uint256 indexed id); 15 | 16 | ////////////////////////////////////////////////////////////// 17 | // EXTERNAL FUNCTIONS // 18 | ////////////////////////////////////////////////////////////// 19 | 20 | /// @dev Adds a route id to the blacklist 21 | /// @param id_ the route id to add 22 | function addToBlacklist(uint256 id_) external; 23 | 24 | /// @dev Removes a route id from the blacklist 25 | /// @param id_ the route id to remove 26 | function removeFromBlacklist(uint256 id_) external; 27 | ////////////////////////////////////////////////////////////// 28 | // EXTERNAL VIEW FUNCTIONS // 29 | ////////////////////////////////////////////////////////////// 30 | 31 | /// @dev Checks if given route id is blacklisted 32 | /// @param id_ the route id to check 33 | /// @return blacklisted if the route is blacklisted 34 | function isRouteBlacklisted(uint256 id_) external view returns (bool blacklisted); 35 | } 36 | -------------------------------------------------------------------------------- /src/interfaces/ITimelockStateRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { InitSingleVaultData, TimelockPayload } from "src/types/DataTypes.sol"; 5 | 6 | /// @title ITimelockStateRegistry 7 | /// @dev Interface for TimelockStateRegistry 8 | /// @author ZeroPoint Labs 9 | interface ITimelockStateRegistry { 10 | ////////////////////////////////////////////////////////////// 11 | // EXTERNAL VIEW FUNCTIONS // 12 | ////////////////////////////////////////////////////////////// 13 | 14 | /// @dev allows users to read the timeLockPayload_ stored per payloadId_ 15 | /// @param payloadId_ is the unique payload identifier allocated on the destination chain 16 | /// @return timeLockPayload_ the timelock payload stored 17 | function getTimelockPayload(uint256 payloadId_) external view returns (TimelockPayload memory timeLockPayload_); 18 | 19 | /// @dev allows users to read the timelockPayloadCounter 20 | function timelockPayloadCounter() external view returns (uint256); 21 | 22 | ////////////////////////////////////////////////////////////// 23 | // EXTERNAL WRITE FUNCTIONS // 24 | ////////////////////////////////////////////////////////////// 25 | 26 | /// @notice Receives request (payload) from timelock form to process later 27 | /// @param type_ is the nature of transaction (xChain: 1 or same chain: 0) 28 | /// @param srcChainId_ is the chainId of the source chain 29 | /// @param lockedTill_ is the deadline for timelock (after which we can call `finalizePayload`) 30 | /// @param data_ is the basic information of superformId, amount to withdraw of type InitSingleVaultData 31 | function receivePayload( 32 | uint8 type_, 33 | uint64 srcChainId_, 34 | uint256 lockedTill_, 35 | InitSingleVaultData memory data_ 36 | ) 37 | external; 38 | 39 | /// @notice Form Keeper finalizes payload to process timelock withdraw fully 40 | /// @param payloadId_ is the id of the payload to finalize 41 | /// @param txData_ is the off-chain generated transaction data 42 | function finalizePayload(uint256 payloadId_, bytes memory txData_) external payable; 43 | } 44 | -------------------------------------------------------------------------------- /src/interfaces/IVaultClaimer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title IVaultClaimer 5 | /// @author Zeropoint Labs 6 | interface IVaultClaimer { 7 | ////////////////////////////////////////////////////////////// 8 | // EVENTS // 9 | ////////////////////////////////////////////////////////////// 10 | event Claimed(address indexed claimer, string protocolId); 11 | 12 | ////////////////////////////////////////////////////////////// 13 | // EXTERNAL FUNCTIONS // 14 | ////////////////////////////////////////////////////////////// 15 | 16 | /// @notice helps users claim ownership of a protocol id 17 | /// @param protocolId_ unique identifier of the protocol to claim ownership 18 | /// @dev actual validation of ownership happens offchain 19 | /// calling this function, triggers ownership verification 20 | function claimProtocolOwnership(string calldata protocolId_) external; 21 | } 22 | -------------------------------------------------------------------------------- /src/libraries/ArrayCastLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { InitSingleVaultData, InitMultiVaultData, LiqRequest } from "src/types/DataTypes.sol"; 5 | 6 | /// @dev library to cast single values into array for streamlining helper functions 7 | /// @notice not gas optimized, suggested for usage only in view/pure functions 8 | library ArrayCastLib { 9 | function castLiqRequestToArray(LiqRequest memory value_) internal pure returns (LiqRequest[] memory values) { 10 | values = new LiqRequest[](1); 11 | 12 | values[0] = value_; 13 | } 14 | 15 | function castBoolToArray(bool value_) internal pure returns (bool[] memory values) { 16 | values = new bool[](1); 17 | 18 | values[0] = value_; 19 | } 20 | 21 | function castToMultiVaultData(InitSingleVaultData memory data_) 22 | internal 23 | pure 24 | returns (InitMultiVaultData memory castedData_) 25 | { 26 | uint256[] memory superformIds = new uint256[](1); 27 | superformIds[0] = data_.superformId; 28 | 29 | uint256[] memory amounts = new uint256[](1); 30 | amounts[0] = data_.amount; 31 | 32 | uint256[] memory outputAmounts = new uint256[](1); 33 | outputAmounts[0] = data_.outputAmount; 34 | 35 | uint256[] memory maxSlippage = new uint256[](1); 36 | maxSlippage[0] = data_.maxSlippage; 37 | 38 | LiqRequest[] memory liqData = new LiqRequest[](1); 39 | liqData[0] = data_.liqData; 40 | 41 | castedData_ = InitMultiVaultData( 42 | data_.payloadId, 43 | superformIds, 44 | amounts, 45 | outputAmounts, 46 | maxSlippage, 47 | liqData, 48 | castBoolToArray(data_.hasDstSwap), 49 | castBoolToArray(data_.retain4626), 50 | data_.receiverAddress, 51 | data_.extraFormData 52 | ); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/libraries/PayloadUpdaterLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { DataLib } from "src/libraries/DataLib.sol"; 5 | import { Error } from "src/libraries/Error.sol"; 6 | import { PayloadState, CallbackType, LiqRequest } from "src/types/DataTypes.sol"; 7 | 8 | /// @dev library to validate slippage updation 9 | library PayloadUpdaterLib { 10 | function validateSlippage( 11 | uint256 newAmount_, 12 | uint256 maxAmount_, 13 | uint256 slippage_ 14 | ) 15 | internal 16 | pure 17 | returns (bool valid_) 18 | { 19 | /// @dev args validation 20 | if (newAmount_ > maxAmount_) { 21 | revert Error.NEGATIVE_SLIPPAGE(); 22 | } 23 | 24 | uint256 minAmount = (maxAmount_ * (10_000 - slippage_)) / 10_000; 25 | 26 | /// @dev amount must fall within the slippage bounds 27 | if (newAmount_ < minAmount) { 28 | return false; 29 | } 30 | 31 | return true; 32 | } 33 | 34 | function validateLiqReq(LiqRequest memory req_) internal pure { 35 | /// revert if token is address(0) -> user wants settlement without any liq data 36 | /// revert if token is not address(0) and txData is already present 37 | if (req_.token == address(0) || req_.txData.length != 0) { 38 | revert Error.CANNOT_UPDATE_WITHDRAW_TX_DATA(); 39 | } 40 | } 41 | 42 | function validatePayloadUpdate( 43 | uint256 txInfo_, 44 | uint8 txType_, 45 | PayloadState currentPayloadState_, 46 | uint8 isMulti_ 47 | ) 48 | internal 49 | pure 50 | { 51 | (uint256 txType, uint256 callbackType, uint8 multi,,,) = DataLib.decodeTxInfo(txInfo_); 52 | 53 | if (!(txType == txType_ && callbackType == uint256(CallbackType.INIT))) { 54 | revert Error.INVALID_PAYLOAD_UPDATE_REQUEST(); 55 | } 56 | 57 | if (currentPayloadState_ != PayloadState.STORED) { 58 | revert Error.PAYLOAD_ALREADY_UPDATED(); 59 | } 60 | 61 | if (multi != isMulti_) { 62 | revert Error.INVALID_PAYLOAD_UPDATE_REQUEST(); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/libraries/ProofLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { AMBMessage } from "src/types/DataTypes.sol"; 5 | 6 | /// @dev generates proof for amb message and bytes encoded message 7 | library ProofLib { 8 | function computeProof(AMBMessage memory message_) internal pure returns (bytes32) { 9 | return keccak256(abi.encode(message_)); 10 | } 11 | 12 | function computeProofBytes(AMBMessage memory message_) internal pure returns (bytes memory) { 13 | return abi.encode(keccak256(abi.encode(message_))); 14 | } 15 | 16 | function computeProof(bytes memory message_) internal pure returns (bytes32) { 17 | return keccak256(message_); 18 | } 19 | 20 | function computeProofBytes(bytes memory message_) internal pure returns (bytes memory) { 21 | return abi.encode(keccak256(message_)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/vendor/axelar/IAxelarExecutable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import { IAxelarGateway } from "./IAxelarGateway.sol"; 6 | 7 | interface IAxelarExecutable { 8 | error InvalidAddress(); 9 | error NotApprovedByGateway(); 10 | 11 | function gateway() external view returns (IAxelarGateway); 12 | 13 | function execute( 14 | bytes32 commandId, 15 | string calldata sourceChain, 16 | string calldata sourceAddress, 17 | bytes calldata payload 18 | ) 19 | external; 20 | } 21 | -------------------------------------------------------------------------------- /src/vendor/axelar/IContractIdentifier.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | // General interface for upgradable contracts 6 | interface IContractIdentifier { 7 | /** 8 | * @notice Returns the contract ID. It can be used as a check during upgrades. 9 | * @dev Meant to be overridden in derived contracts. 10 | * @return bytes32 The contract ID 11 | */ 12 | function contractId() external pure returns (bytes32); 13 | } 14 | -------------------------------------------------------------------------------- /src/vendor/axelar/IGovernable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @title IGovernable Interface 7 | * @notice This is an interface used by the AxelarGateway contract to manage governance and mint limiter roles. 8 | */ 9 | interface IGovernable { 10 | error NotGovernance(); 11 | error NotMintLimiter(); 12 | error InvalidGovernance(); 13 | error InvalidMintLimiter(); 14 | 15 | event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance); 16 | event MintLimiterTransferred(address indexed previousGovernance, address indexed newGovernance); 17 | 18 | /** 19 | * @notice Returns the governance address. 20 | * @return address of the governance 21 | */ 22 | function governance() external view returns (address); 23 | 24 | /** 25 | * @notice Returns the mint limiter address. 26 | * @return address of the mint limiter 27 | */ 28 | function mintLimiter() external view returns (address); 29 | 30 | /** 31 | * @notice Transfer the governance role to another address. 32 | * @param newGovernance The new governance address 33 | */ 34 | function transferGovernance(address newGovernance) external; 35 | 36 | /** 37 | * @notice Transfer the mint limiter role to another address. 38 | * @param newGovernance The new mint limiter address 39 | */ 40 | function transferMintLimiter(address newGovernance) external; 41 | } 42 | -------------------------------------------------------------------------------- /src/vendor/axelar/IImplementation.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import { IContractIdentifier } from "./IContractIdentifier.sol"; 6 | 7 | interface IImplementation is IContractIdentifier { 8 | error NotProxy(); 9 | 10 | function setup(bytes calldata data) external; 11 | } 12 | -------------------------------------------------------------------------------- /src/vendor/axelar/IOwnable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | /** 6 | * @title IOwnable Interface 7 | * @notice IOwnable is an interface that abstracts the implementation of a 8 | * contract with ownership control features. It's commonly used in upgradable 9 | * contracts and includes the functionality to get current owner, transfer 10 | * ownership, and propose and accept ownership. 11 | */ 12 | interface IOwnable { 13 | error NotOwner(); 14 | error InvalidOwner(); 15 | error InvalidOwnerAddress(); 16 | 17 | event OwnershipTransferStarted(address indexed newOwner); 18 | event OwnershipTransferred(address indexed newOwner); 19 | 20 | /** 21 | * @notice Returns the current owner of the contract. 22 | * @return address The address of the current owner 23 | */ 24 | function owner() external view returns (address); 25 | 26 | /** 27 | * @notice Returns the address of the pending owner of the contract. 28 | * @return address The address of the pending owner 29 | */ 30 | function pendingOwner() external view returns (address); 31 | 32 | /** 33 | * @notice Transfers ownership of the contract to a new address 34 | * @param newOwner The address to transfer ownership to 35 | */ 36 | function transferOwnership(address newOwner) external; 37 | 38 | /** 39 | * @notice Proposes to transfer the contract's ownership to a new address. 40 | * The new owner needs to accept the ownership explicitly. 41 | * @param newOwner The address to transfer ownership to 42 | */ 43 | function proposeOwnership(address newOwner) external; 44 | 45 | /** 46 | * @notice Transfers ownership to the pending owner. 47 | * @dev Can only be called by the pending owner 48 | */ 49 | function acceptOwnership() external; 50 | } 51 | -------------------------------------------------------------------------------- /src/vendor/axelar/IUpgradable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.0; 4 | 5 | import { IOwnable } from "./IOwnable.sol"; 6 | import { IImplementation } from "./IImplementation.sol"; 7 | 8 | // General interface for upgradable contracts 9 | interface IUpgradable is IOwnable, IImplementation { 10 | error InvalidCodeHash(); 11 | error InvalidImplementation(); 12 | error SetupFailed(); 13 | 14 | event Upgraded(address indexed newImplementation); 15 | 16 | function implementation() external view returns (address); 17 | 18 | function upgrade(address newImplementation, bytes32 newImplementationCodeHash, bytes calldata params) external; 19 | } 20 | -------------------------------------------------------------------------------- /src/vendor/axelar/StringAddressConversion.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | library StringToAddress { 5 | error InvalidAddressString(); 6 | 7 | function toAddress(string memory addressString) internal pure returns (address) { 8 | bytes memory stringBytes = bytes(addressString); 9 | uint160 addressNumber = 0; 10 | uint8 stringByte; 11 | 12 | if (stringBytes.length != 42 || stringBytes[0] != "0" || stringBytes[1] != "x") revert InvalidAddressString(); 13 | 14 | for (uint256 i = 2; i < 42; ++i) { 15 | stringByte = uint8(stringBytes[i]); 16 | 17 | if ((stringByte >= 97) && (stringByte <= 102)) stringByte -= 87; 18 | else if ((stringByte >= 65) && (stringByte <= 70)) stringByte -= 55; 19 | else if ((stringByte >= 48) && (stringByte <= 57)) stringByte -= 48; 20 | else revert InvalidAddressString(); 21 | 22 | addressNumber |= uint160(uint256(stringByte) << ((41 - i) << 2)); 23 | } 24 | 25 | return address(addressNumber); 26 | } 27 | } 28 | 29 | library AddressToString { 30 | function toString(address address_) internal pure returns (string memory) { 31 | bytes memory addressBytes = abi.encodePacked(address_); 32 | bytes memory characters = "0123456789abcdef"; 33 | bytes memory stringBytes = new bytes(42); 34 | 35 | stringBytes[0] = "0"; 36 | stringBytes[1] = "x"; 37 | 38 | for (uint256 i; i < 20; ++i) { 39 | stringBytes[2 + i * 2] = characters[uint8(addressBytes[i] >> 4)]; 40 | stringBytes[3 + i * 2] = characters[uint8(addressBytes[i] & 0x0f)]; 41 | } 42 | 43 | return string(stringBytes); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/vendor/chainlink/AggregatorV3Interface.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.0; 3 | 4 | interface AggregatorV3Interface { 5 | function decimals() external view returns (uint8); 6 | 7 | function description() external view returns (string memory); 8 | 9 | function version() external view returns (uint256); 10 | 11 | function getRoundData(uint80 _roundId) 12 | external 13 | view 14 | returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); 15 | 16 | function latestRoundData() 17 | external 18 | view 19 | returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound); 20 | } 21 | -------------------------------------------------------------------------------- /src/vendor/deBridge/ICrossChainForwarder.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.7; 3 | 4 | /// @notice is usually used for swap + bridge. 5 | /// @dev interface built from their CrossChainForwarder 6 | /// @dev refer: https://docs.dln.trade/the-core-protocol/trusted-smart-contracts#evm-chains 7 | interface ICrossChainForwarder { 8 | /// @dev Performs swap against arbitrary input token, refunds excessive outcome of such swap (if any), 9 | /// and calls the specified receiver supplying the outcome of the swap 10 | /// @param _srcTokenIn arbitrary input token to swap from 11 | /// @param _srcAmountIn amount of input token to swap 12 | /// @param _srcTokenInPermitEnvelope optional permit envelope to grab the token from the caller. bytes (amount + 13 | /// deadline + signature) 14 | /// @param _srcSwapRouter contract to call that performs swap from the input token to the output token 15 | /// @param _srcSwapCalldata calldata to call against _srcSwapRouter 16 | /// @param _srcTokenOut arbitrary output token to swap to 17 | /// @param _srcTokenExpectedAmountOut minimum acceptable outcome of the swap to provide to _target 18 | /// @param _srcTokenRefundRecipient address to send excessive outcome of the swap 19 | /// @param _target contract to call after successful swap 20 | /// @param _targetData calldata to call against _target 21 | function strictlySwapAndCall( 22 | address _srcTokenIn, 23 | uint256 _srcAmountIn, 24 | bytes memory _srcTokenInPermitEnvelope, 25 | address _srcSwapRouter, 26 | bytes calldata _srcSwapCalldata, 27 | address _srcTokenOut, 28 | uint256 _srcTokenExpectedAmountOut, 29 | address _srcTokenRefundRecipient, 30 | address _target, 31 | bytes calldata _targetData 32 | ) 33 | external 34 | payable; 35 | 36 | /// @dev returns whether a swap router is whitelisted 37 | function supportedRouters(address router_) external view returns (bool); 38 | } 39 | -------------------------------------------------------------------------------- /src/vendor/dragonfly-xyz/IPermit2.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | pragma solidity ^0.8.23; 3 | 4 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 5 | 6 | /// @title Liquidity Handler. 7 | /// @author https://github.com/dragonfly-xyz/useful-solidity-patterns/blob/main/patterns/permit2/Permit2Vault.sol 8 | /// @dev Minimal Permit2 interface, derived from 9 | /// @dev https://github.com/Uniswap/permit2/blob/main/src/interfaces/ISignatureTransfer.sol 10 | interface IPermit2 { 11 | // Token and amount in a permit message. 12 | struct TokenPermissions { 13 | // Token to transfer. 14 | IERC20 token; 15 | // Amount to transfer. 16 | uint256 amount; 17 | } 18 | 19 | // The permit2 message. 20 | struct PermitTransferFrom { 21 | // Permitted token and amount. 22 | TokenPermissions permitted; 23 | // Unique identifier for this permit. 24 | uint256 nonce; 25 | // Expiration for this permit. 26 | uint256 deadline; 27 | } 28 | 29 | // Transfer details for permitTransferFrom(). 30 | struct SignatureTransferDetails { 31 | // Recipient of tokens. 32 | address to; 33 | // Amount to transfer. 34 | uint256 requestedAmount; 35 | } 36 | 37 | // Consume a permit2 message and transfer tokens. 38 | function permitTransferFrom( 39 | PermitTransferFrom calldata permit, 40 | SignatureTransferDetails calldata transferDetails, 41 | address owner, 42 | bytes calldata signature 43 | ) 44 | external; 45 | } 46 | -------------------------------------------------------------------------------- /src/vendor/hyperlane/IInterchainGasPaymaster.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Apache-2.0 2 | pragma solidity >=0.6.11; 3 | 4 | /// @dev is imported from 5 | /// (https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/interfaces/IInterchainGasPaymaster.sol) 6 | interface IInterchainGasPaymaster { 7 | /// @notice Emitted when a payment is made for a message's gas costs. 8 | /// @param messageId The ID of the message to pay for. 9 | /// @param gasAmount The amount of destination gas paid for. 10 | /// @param payment The amount of native tokens paid. 11 | event GasPayment(bytes32 indexed messageId, uint256 gasAmount, uint256 payment); 12 | 13 | function payForGas( 14 | bytes32 _messageId, 15 | uint32 _destinationDomain, 16 | uint256 _gasAmount, 17 | address _refundAddress 18 | ) 19 | external 20 | payable; 21 | 22 | function quoteGasPayment(uint32 _destinationDomain, uint256 _gasAmount) external view returns (uint256); 23 | } 24 | -------------------------------------------------------------------------------- /src/vendor/hyperlane/IMessageRecipient.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT OR Apache-2.0 2 | pragma solidity >=0.6.11; 3 | 4 | /// @dev is imported from 5 | /// (https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/solidity/contracts/interfaces/IMessageRecipient.sol) 6 | interface IMessageRecipient { 7 | /// @param _origin Domain ID of the chain from which the message came 8 | /// @param _sender Address of the message sender on the origin chain as bytes32 9 | /// @param _message Raw bytes content of message body 10 | function handle(uint32 _origin, bytes32 _sender, bytes calldata _message) external payable; 11 | } 12 | -------------------------------------------------------------------------------- /src/vendor/kycDAO/IKycValidity.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | pragma solidity ^0.8.23; 4 | 5 | interface IKycValidity { 6 | /// @dev Check whether a given address has a valid kycNFT token 7 | /// @param _addr Address to check for tokens 8 | /// @return valid Whether the address has a valid token 9 | function hasValidToken(address _addr) external view returns (bool valid); 10 | } 11 | -------------------------------------------------------------------------------- /src/vendor/layerzero/ILayerZeroReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity >=0.5.0; 3 | 4 | /// @dev is imported from 5 | /// (https://github.com/LayerZero-Labs/LayerZero/blob/main/contracts/interfaces/ILayerZeroReceiver.sol) 6 | interface ILayerZeroReceiver { 7 | // @notice LayerZero endpoint will invoke this function to deliver the message on the destination 8 | // @param _srcChainId - the source endpoint identifier 9 | // @param _srcAddress - the source sending contract address from the source chain 10 | // @param _nonce - the ordered message nonce 11 | // @param _payload - the signed payload is the UA bytes has encoded to be sent 12 | function lzReceive( 13 | uint16 _srcChainId, 14 | bytes calldata _srcAddress, 15 | uint64 _nonce, 16 | bytes calldata _payload 17 | ) 18 | external; 19 | } 20 | -------------------------------------------------------------------------------- /src/vendor/layerzero/ILayerZeroUserApplicationConfig.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity >=0.5.0; 3 | 4 | /// @dev is imported from 5 | /// (https://github.com/LayerZero-Labs/LayerZero/blob/main/contracts/interfaces/ILayerZeroUserApplicationConfig.sol) 6 | interface ILayerZeroUserApplicationConfig { 7 | // @notice set the configuration of the LayerZero messaging library of the specified version 8 | // @param _version - messaging library version 9 | // @param _chainId - the chainId for the pending config change 10 | // @param _configType - type of configuration. every messaging library has its own convention. 11 | // @param _config - configuration in the bytes. can encode arbitrary content. 12 | function setConfig(uint16 _version, uint16 _chainId, uint256 _configType, bytes calldata _config) external; 13 | 14 | // @notice set the send() LayerZero messaging library version to _version 15 | // @param _version - new messaging library version 16 | function setSendVersion(uint16 _version) external; 17 | 18 | // @notice set the lzReceive() LayerZero messaging library version to _version 19 | // @param _version - new messaging library version 20 | function setReceiveVersion(uint16 _version) external; 21 | 22 | // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload 23 | // @param _srcChainId - the chainId of the source chain 24 | // @param _srcAddress - the contract address of the source contract at the source chain 25 | function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external; 26 | } 27 | -------------------------------------------------------------------------------- /src/vendor/layerzero/v2/ILayerZeroReceiver.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.8.0; 4 | 5 | import { Origin } from "./ILayerZeroEndpointV2.sol"; 6 | 7 | interface ILayerZeroReceiver { 8 | function allowInitializePath(Origin calldata _origin) external view returns (bool); 9 | 10 | function nextNonce(uint32 _eid, bytes32 _sender) external view returns (uint64); 11 | 12 | function lzReceive( 13 | Origin calldata _origin, 14 | bytes32 _guid, 15 | bytes calldata _message, 16 | address _executor, 17 | bytes calldata _extraData 18 | ) 19 | external 20 | payable; 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor/layerzero/v2/IMessageLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.8.0; 4 | 5 | import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; 6 | 7 | import { SetConfigParam } from "./IMessageLibManager.sol"; 8 | 9 | enum MessageLibType { 10 | Send, 11 | Receive, 12 | SendAndReceive 13 | } 14 | 15 | interface IMessageLib is IERC165 { 16 | function setConfig(address _oapp, SetConfigParam[] calldata _config) external; 17 | 18 | function getConfig(uint32 _eid, address _oapp, uint32 _configType) external view returns (bytes memory config); 19 | 20 | function isSupportedEid(uint32 _eid) external view returns (bool); 21 | 22 | // message libs of same major version are compatible 23 | function version() external view returns (uint64 major, uint8 minor, uint8 endpointVersion); 24 | 25 | function messageLibType() external view returns (MessageLibType); 26 | } 27 | -------------------------------------------------------------------------------- /src/vendor/layerzero/v2/IMessagingChannel.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.8.0; 4 | 5 | interface IMessagingChannel { 6 | event InboundNonceSkipped(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce); 7 | event PacketNilified(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); 8 | event PacketBurnt(uint32 srcEid, bytes32 sender, address receiver, uint64 nonce, bytes32 payloadHash); 9 | 10 | function eid() external view returns (uint32); 11 | 12 | // this is an emergency function if a message cannot be verified for some reasons 13 | // required to provide _nextNonce to avoid race condition 14 | function skip(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce) external; 15 | 16 | function nilify(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; 17 | 18 | function burn(address _oapp, uint32 _srcEid, bytes32 _sender, uint64 _nonce, bytes32 _payloadHash) external; 19 | 20 | function nextGuid(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (bytes32); 21 | 22 | function inboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); 23 | 24 | function outboundNonce(address _sender, uint32 _dstEid, bytes32 _receiver) external view returns (uint64); 25 | 26 | function inboundPayloadHash( 27 | address _receiver, 28 | uint32 _srcEid, 29 | bytes32 _sender, 30 | uint64 _nonce 31 | ) 32 | external 33 | view 34 | returns (bytes32); 35 | 36 | function lazyInboundNonce(address _receiver, uint32 _srcEid, bytes32 _sender) external view returns (uint64); 37 | } 38 | -------------------------------------------------------------------------------- /src/vendor/layerzero/v2/IMessagingComposer.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.8.0; 4 | 5 | interface IMessagingComposer { 6 | event ComposeSent(address from, address to, bytes32 guid, uint16 index, bytes message); 7 | event ComposeDelivered(address from, address to, bytes32 guid, uint16 index); 8 | event LzComposeAlert( 9 | address indexed from, 10 | address indexed to, 11 | address indexed executor, 12 | bytes32 guid, 13 | uint16 index, 14 | uint256 gas, 15 | uint256 value, 16 | bytes message, 17 | bytes extraData, 18 | bytes reason 19 | ); 20 | 21 | function composeQueue( 22 | address _from, 23 | address _to, 24 | bytes32 _guid, 25 | uint16 _index 26 | ) 27 | external 28 | view 29 | returns (bytes32 messageHash); 30 | 31 | function sendCompose(address _to, bytes32 _guid, uint16 _index, bytes calldata _message) external; 32 | 33 | function lzCompose( 34 | address _from, 35 | address _to, 36 | bytes32 _guid, 37 | uint16 _index, 38 | bytes calldata _message, 39 | bytes calldata _extraData 40 | ) 41 | external 42 | payable; 43 | } 44 | -------------------------------------------------------------------------------- /src/vendor/layerzero/v2/IMessagingContext.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity >=0.8.0; 4 | 5 | interface IMessagingContext { 6 | function isSendingMessage() external view returns (bool); 7 | 8 | function getSendContext() external view returns (uint32 dstEid, address sender); 9 | } 10 | -------------------------------------------------------------------------------- /src/vendor/lifi/CBridgeFacetPacked.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title CBridge Facet Packed 5 | /// @author LI.FI (https://li.fi) 6 | /// @notice Provides functionality for bridging through CBridge 7 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs 8 | /// @custom:version 1.0.3 9 | contract CBridgeFacetPacked { 10 | /// @notice Bridges Native tokens via cBridge (packed) 11 | /// No params, all data will be extracted from manually encoded callData 12 | function startBridgeTokensViaCBridgeNativePacked() external payable { } 13 | 14 | /// @notice Bridges native tokens via cBridge 15 | /// @param transactionId Custom transaction ID for tracking 16 | /// @param receiver Receiving wallet address 17 | /// @param destinationChainId Receiving chain 18 | /// @param nonce A number input to guarantee uniqueness of transferId. 19 | /// @param maxSlippage Destination swap minimal accepted amount 20 | function startBridgeTokensViaCBridgeNativeMin( 21 | bytes32 transactionId, 22 | address receiver, 23 | uint64 destinationChainId, 24 | uint64 nonce, 25 | uint32 maxSlippage 26 | ) 27 | external 28 | payable 29 | { } 30 | 31 | /// @notice Bridges ERC20 tokens via cBridge 32 | /// No params, all data will be extracted from manually encoded callData 33 | function startBridgeTokensViaCBridgeERC20Packed() external { } 34 | 35 | /// @notice Bridges ERC20 tokens via cBridge 36 | /// @param transactionId Custom transaction ID for tracking 37 | /// @param receiver Receiving wallet address 38 | /// @param destinationChainId Receiving chain 39 | /// @param sendingAssetId Address of the source asset to bridge 40 | /// @param amount Amount of the source asset to bridge 41 | /// @param nonce A number input to guarantee uniqueness of transferId 42 | /// @param maxSlippage Destination swap minimal accepted amount 43 | function startBridgeTokensViaCBridgeERC20Min( 44 | bytes32 transactionId, 45 | address receiver, 46 | uint64 destinationChainId, 47 | address sendingAssetId, 48 | uint256 amount, 49 | uint64 nonce, 50 | uint32 maxSlippage 51 | ) 52 | external 53 | { } 54 | } 55 | -------------------------------------------------------------------------------- /src/vendor/lifi/GenericSwapFacet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import { LibSwap } from "./LibSwap.sol"; 5 | 6 | /// @title Generic Swap Facet 7 | /// @author LI.FI (https://li.fi) 8 | /// @notice Provides functionality for swapping through ANY APPROVED DEX 9 | /// @dev Uses calldata to execute APPROVED arbitrary methods on DEXs 10 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs 11 | /// @custom:version 1.0.0 12 | contract GenericSwapFacet { 13 | /// External Methods /// 14 | 15 | /// @notice Performs multiple swaps in one transaction 16 | /// @param _transactionId the transaction id associated with the operation 17 | /// @param _integrator the name of the integrator 18 | /// @param _referrer the address of the referrer 19 | /// @param _receiver the address to receive the swapped tokens into (also excess tokens) 20 | /// @param _minAmount the minimum amount of the final asset to receive 21 | /// @param _swapData an object containing swap related data to perform swaps before bridging 22 | function swapTokensGeneric( 23 | bytes32 _transactionId, 24 | string calldata _integrator, 25 | string calldata _referrer, 26 | address payable _receiver, 27 | uint256 _minAmount, 28 | LibSwap.SwapData[] calldata _swapData 29 | ) 30 | external 31 | payable 32 | { } 33 | } 34 | -------------------------------------------------------------------------------- /src/vendor/lifi/HopFacet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import { ILiFi } from "./ILiFi.sol"; 5 | import { LibSwap } from "./LibSwap.sol"; 6 | 7 | /// @title Hop Facet 8 | /// @author LI.FI (https://li.fi) 9 | /// @notice Provides functionality for bridging through Hop 10 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs 11 | /// @custom:version 2.0.0 12 | contract HopFacet { 13 | struct HopData { 14 | uint256 bonderFee; 15 | uint256 amountOutMin; 16 | uint256 deadline; 17 | uint256 destinationAmountOutMin; 18 | uint256 destinationDeadline; 19 | address relayer; 20 | uint256 relayerFee; 21 | uint256 nativeFee; 22 | } 23 | 24 | /// @notice Bridges tokens via Hop Protocol 25 | /// @param _bridgeData the core information needed for bridging 26 | /// @param _hopData data specific to Hop Protocol 27 | function startBridgeTokensViaHop(ILiFi.BridgeData memory _bridgeData, HopData calldata _hopData) external payable { } 28 | 29 | /// @notice Performs a swap before bridging via Hop Protocol 30 | /// @param _bridgeData the core information needed for bridging 31 | /// @param _swapData an array of swap related data for performing swaps before bridging 32 | /// @param _hopData data specific to Hop Protocol 33 | function swapAndStartBridgeTokensViaHop( 34 | ILiFi.BridgeData memory _bridgeData, 35 | LibSwap.SwapData[] calldata _swapData, 36 | HopData calldata _hopData 37 | ) 38 | external 39 | payable 40 | { } 41 | } 42 | -------------------------------------------------------------------------------- /src/vendor/lifi/IHopBridge.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs 5 | 6 | interface IHopBridge { 7 | function sendToL2( 8 | uint256 chainId, 9 | address recipient, 10 | uint256 amount, 11 | uint256 amountOutMin, 12 | uint256 deadline, 13 | address relayer, 14 | uint256 relayerFee 15 | ) 16 | external 17 | payable; 18 | 19 | function swapAndSend( 20 | uint256 chainId, 21 | address recipient, 22 | uint256 amount, 23 | uint256 bonderFee, 24 | uint256 amountOutMin, 25 | uint256 deadline, 26 | uint256 destinationAmountOutMin, 27 | uint256 destinationDeadline 28 | ) 29 | external 30 | payable; 31 | 32 | function send( 33 | uint256 chainId, 34 | address recipient, 35 | uint256 amount, 36 | uint256 bonderFee, 37 | uint256 amountOutMin, 38 | uint256 deadline 39 | ) 40 | external; 41 | } 42 | -------------------------------------------------------------------------------- /src/vendor/lifi/ILiFi.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title ILiFi 5 | /// @notice Interface containing useful structs when using LiFi as a bridge 6 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts 7 | interface ILiFi { 8 | struct BridgeData { 9 | bytes32 transactionId; 10 | string bridge; 11 | string integrator; 12 | address referrer; 13 | address sendingAssetId; 14 | address receiver; 15 | uint256 minAmount; 16 | uint256 destinationChainId; 17 | bool hasSourceSwaps; 18 | bool hasDestinationCall; // is there a destination call? we should disable this 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/vendor/lifi/LibSwap.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | library LibSwap { 5 | struct SwapData { 6 | address callTo; 7 | address approveTo; 8 | address sendingAssetId; 9 | address receivingAssetId; 10 | uint256 fromAmount; 11 | bytes callData; 12 | bool requiresDeposit; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/vendor/lifi/StandardizedCallFacet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title StandardizedCallFacet 5 | /// @author LI.FI (https://li.fi) 6 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts 7 | /// @custom:version 2.2.0 8 | contract StandardizedCallFacet { 9 | /// External Methods /// 10 | 11 | /// @notice Make a standardized call to a facet 12 | /// @param callData The calldata to forward to the facet 13 | function standardizedCall(bytes memory callData) external payable { } 14 | } 15 | -------------------------------------------------------------------------------- /src/vendor/lifi/StargateFacet.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | pragma solidity ^0.8.23; 3 | 4 | import { ILiFi } from "./ILiFi.sol"; 5 | import { LibSwap } from "./LibSwap.sol"; 6 | 7 | /// @title Stargate Facet 8 | /// @author Li.Finance (https://li.finance) 9 | /// @notice Provides functionality for bridging through Stargate 10 | /// @notice taken from LiFi contracts https://github.com/lifinance/contracts and stripped down to needs 11 | /// @custom:version 2.2.0 12 | contract StargateFacet { 13 | /// @param srcPoolId Source pool id. 14 | /// @param dstPoolId Dest pool id. 15 | /// @param minAmountLD The min qty you would accept on the destination. 16 | /// @param dstGasForCall Additional gas fee for extral call on the destination. 17 | /// @param lzFee Estimated message fee. 18 | /// @param refundAddress Refund adddress. Extra gas (if any) is returned to this address 19 | /// @param callTo The address to send the tokens to on the destination. 20 | /// @param callData Additional payload. 21 | struct StargateData { 22 | uint256 srcPoolId; 23 | uint256 dstPoolId; 24 | uint256 minAmountLD; 25 | uint256 dstGasForCall; 26 | uint256 lzFee; 27 | address payable refundAddress; 28 | bytes callTo; 29 | bytes callData; 30 | } 31 | 32 | /// External Methods /// 33 | 34 | /// @notice Bridges tokens via Stargate Bridge 35 | /// @param _bridgeData Data used purely for tracking and analytics 36 | /// @param _stargateData Data specific to Stargate Bridge 37 | function startBridgeTokensViaStargate( 38 | ILiFi.BridgeData calldata _bridgeData, 39 | StargateData calldata _stargateData 40 | ) 41 | external 42 | payable 43 | { } 44 | 45 | /// @notice Performs a swap before bridging via Stargate Bridge 46 | /// @param _bridgeData Data used purely for tracking and analytics 47 | /// @param _swapData An array of swap related data for performing swaps before bridging 48 | /// @param _stargateData Data specific to Stargate Bridge 49 | function swapAndStartBridgeTokensViaStargate( 50 | ILiFi.BridgeData memory _bridgeData, 51 | LibSwap.SwapData[] calldata _swapData, 52 | StargateData calldata _stargateData 53 | ) 54 | external 55 | payable 56 | { } 57 | } 58 | -------------------------------------------------------------------------------- /src/vendor/socket/ISocketOneInchImpl.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity >=0.8.4; 3 | 4 | /// @title ISocketOneInchImpl 5 | /// @notice Interface for Socket's One Inch Impl 6 | /// @notice used for swaps without bridge 7 | /// @notice taken from https://polygonscan.com/address/0x2ddf16BA6d0180e5357d5e170eF1917a01b41fc0 8 | interface ISocketOneInchImpl { 9 | struct SwapInput { 10 | address fromToken; 11 | address toToken; 12 | address receiver; 13 | uint256 amount; 14 | bytes swapExtraData; 15 | } 16 | 17 | function performDirectAction( 18 | address fromToken, 19 | address toToken, 20 | address receiver, 21 | uint256 amount, 22 | bytes memory swapExtraData 23 | ) 24 | external 25 | payable; 26 | } 27 | -------------------------------------------------------------------------------- /src/vendor/socket/ISocketRegistry.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity >=0.8.4; 3 | 4 | /// @title ISocketRegistry 5 | /// @notice Interface for socket's Router contract 6 | /// @notice taken from 7 | /// https://github.com/SocketDotTech/socket-v2-verifier-contracts/blob/master/contracts/SocketV2Verifier.sol 8 | interface ISocketRegistry { 9 | /// @param id route id of middleware to be used 10 | /// @param optionalNativeAmount is the amount of native asset that the route requires 11 | /// @param inputToken token address which will be swapped to BridgeRequest inputToken 12 | /// @param data to be used by middleware 13 | struct MiddlewareRequest { 14 | uint256 id; 15 | uint256 optionalNativeAmount; 16 | address inputToken; 17 | bytes data; 18 | } 19 | 20 | /// @param id route id of bridge to be used 21 | /// @param optionalNativeAmount optional native amount, to be used when bridge needs native token along with ERC20 22 | /// @param inputToken token addresss which will be bridged 23 | /// @param data bridgeData to be used by bridge 24 | struct BridgeRequest { 25 | uint256 id; 26 | uint256 optionalNativeAmount; 27 | address inputToken; 28 | bytes data; 29 | } 30 | 31 | /// @param receiverAddress Recipient address to recieve funds on destination chain 32 | /// @param toChainId Destination ChainId 33 | /// @param amount amount to be swapped if middlewareId is 0 it will be 34 | /// the amount to be bridged 35 | /// @param middlewareRequest middleware Requestdata 36 | /// @param bridgeRequest bridge request data 37 | struct UserRequest { 38 | address receiverAddress; 39 | uint256 toChainId; 40 | uint256 amount; 41 | MiddlewareRequest middlewareRequest; 42 | BridgeRequest bridgeRequest; 43 | } 44 | 45 | function outboundTransferTo(UserRequest calldata _userRequest) external payable; 46 | } 47 | -------------------------------------------------------------------------------- /src/vendor/wormhole/README.md: -------------------------------------------------------------------------------- 1 | NOTE: all wormhole related interfaces are directly imported using the [wormhole-sdk](https://github.com/wormhole-foundation/wormhole-solidity-sdk) -------------------------------------------------------------------------------- /src/vendor/wormhole/Utils.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache 2 2 | pragma solidity ^0.8.0; 3 | 4 | /// @notice imported from 5 | /// https://github.com/wormhole-foundation/wormhole/blob/738486138462680dfeac5dec94fb0ce376154b94/ethereum/contracts/relayer/libraries/Utils.sol 6 | 7 | error NotAnEvmAddress(bytes32); 8 | 9 | function fromWormholeFormat(bytes32 whFormatAddress) pure returns (address) { 10 | if (uint256(whFormatAddress) >> 160 != 0) { 11 | revert NotAnEvmAddress(whFormatAddress); 12 | } 13 | return address(uint160(uint256(whFormatAddress))); 14 | } 15 | 16 | function fromWormholeFormatUnchecked(bytes32 whFormatAddress) pure returns (address) { 17 | return address(uint160(uint256(whFormatAddress))); 18 | } 19 | -------------------------------------------------------------------------------- /test/invariant/common/TimestampStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @dev Because Foundry does not commit the state changes between invariant runs, we need to 5 | /// save the current timestamp in a contract with persistent storage. 6 | contract TimestampStore { 7 | uint256 public currentTimestamp; 8 | 9 | constructor() { 10 | currentTimestamp = block.timestamp; 11 | } 12 | 13 | function increaseCurrentTimestamp(uint256 timeJump) external { 14 | currentTimestamp += timeJump; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/invariant/rewards-distributor/RewardsDistributorClaim.invariant.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { RewardsDistributorHandler } from "./handlers/RewardsDistributorHandler.sol"; 5 | import { RewardsDistributorBase } from "./RewardsDistributorBase.invariant.t.sol"; 6 | 7 | contract RewardsDistributorClaim is RewardsDistributorBase { 8 | function setUp() public override { 9 | super.setUp(); 10 | 11 | /// @dev Note: disable some of the selectors to test a bunch of them only 12 | bytes4[] memory selectors = new bytes4[](1); 13 | selectors[0] = RewardsDistributorHandler.full_claim.selector; 14 | targetSelector(FuzzSelector({ addr: address(rewardsDistributorHandler), selectors: selectors })); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/invariant/rewards-distributor/RewardsDistributorClaimBatch.invariant.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { RewardsDistributorHandler } from "./handlers/RewardsDistributorHandler.sol"; 5 | import { RewardsDistributorBase } from "./RewardsDistributorBase.invariant.t.sol"; 6 | 7 | contract RewardsDistributorClaimBatch is RewardsDistributorBase { 8 | function setUp() public override { 9 | super.setUp(); 10 | 11 | /// @dev Note: disable some of the selectors to test a bunch of them only 12 | bytes4[] memory selectors = new bytes4[](1); 13 | selectors[0] = RewardsDistributorHandler.full_batch_claim.selector; 14 | targetSelector(FuzzSelector({ addr: address(rewardsDistributorHandler), selectors: selectors })); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/invariant/rewards-distributor/stores/RewardsDistributorStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @dev Storage variables needed by all vault shares handlers. 5 | contract RewardsDistributorStore { 6 | /*////////////////////////////////////////////////////////////////////////// 7 | VARIABLES 8 | //////////////////////////////////////////////////////////////////////////*/ 9 | uint256 public usdcBalanceAfter; 10 | uint256 public daiBalanceAfter; 11 | 12 | mapping(uint256 => uint256) public totalSelectedUsersPeriod; 13 | mapping(uint256 => uint256) public totalTestUsersPeriod; 14 | 15 | uint256 public totalPeriodsSelected; 16 | 17 | /*////////////////////////////////////////////////////////////////////////// 18 | HELPERS 19 | //////////////////////////////////////////////////////////////////////////*/ 20 | 21 | function setUSDCBalanceAfter(uint256 _usdcBalanceAfter) external { 22 | usdcBalanceAfter = _usdcBalanceAfter; 23 | } 24 | 25 | function setDAIBalanceAfter(uint256 _daiBalanceAfter) external { 26 | daiBalanceAfter = _daiBalanceAfter; 27 | } 28 | 29 | function setTotalSelectedUsers(uint256 periodId, uint256 _totalSelectedUsers) external { 30 | totalSelectedUsersPeriod[periodId] = _totalSelectedUsers; 31 | } 32 | 33 | function setTotalTestUsers(uint256 periodId, uint256 _totalTestUsers) external { 34 | totalTestUsersPeriod[periodId] = _totalTestUsers; 35 | } 36 | 37 | function setTotalPeriodsSelected(uint256 _totalPeriodsSelected) external { 38 | totalPeriodsSelected = _totalPeriodsSelected; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/invariant/vault-shares/stores/VaultSharesStore.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | /// @dev Storage variables needed by all vault shares handlers. 5 | contract VaultSharesStore { 6 | /*////////////////////////////////////////////////////////////////////////// 7 | VARIABLES 8 | //////////////////////////////////////////////////////////////////////////*/ 9 | 10 | uint256 public vaultShares; 11 | uint256 public superPositionsSum; 12 | 13 | /*////////////////////////////////////////////////////////////////////////// 14 | HELPERS 15 | //////////////////////////////////////////////////////////////////////////*/ 16 | 17 | function setSuperPositions(uint256 _superPositionsSum) external { 18 | // Store the results 19 | superPositionsSum = _superPositionsSum; 20 | } 21 | 22 | function setVaultShares(uint256 _vaultShares) external { 23 | vaultShares = _vaultShares; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/EIP712Lib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | /// @title EIP712 Lib 5 | library EIP712Lib { 6 | // keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)") 7 | bytes32 public constant EIP712_DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f; 8 | 9 | function calculateDomainSeparator(bytes32 nameHash, bytes32 versionHash) internal view returns (bytes32) { 10 | uint256 chainId; 11 | assembly { 12 | chainId := chainid() 13 | } 14 | 15 | return keccak256(abi.encode(EIP712_DOMAIN_TYPEHASH, nameHash, versionHash, chainId, address(this))); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/ERC7540VaultLike.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.5.0; 3 | 4 | interface ERC7540VaultLike { 5 | function manager() external view returns (address); 6 | 7 | function poolId() external view returns (uint64); 8 | 9 | function trancheId() external view returns (bytes16); 10 | 11 | function priceLastUpdated() external view returns (uint64); 12 | } 13 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/ISetClaimable.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | interface ISetClaimable { 5 | function moveSharesToClaimable(uint256 requestId, address controller) external; 6 | function moveAssetsToClaimable(uint256 requestId, address controller) external; 7 | } 8 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/InvestmentManagerLike.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.5.0; 3 | 4 | interface InvestmentManagerLike { 5 | function fulfillDepositRequest( 6 | uint64 poolId, 7 | bytes16 trancheId, 8 | address user, 9 | uint128 assetId, 10 | uint128 assets, 11 | uint128 shares 12 | ) 13 | external; 14 | 15 | function fulfillRedeemRequest( 16 | uint64 poolId, 17 | bytes16 trancheId, 18 | address user, 19 | uint128 assetId, 20 | uint128 assets, 21 | uint128 shares 22 | ) 23 | external; 24 | 25 | function poolManager() external view returns (address); 26 | 27 | function root() external view returns (address); 28 | } 29 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/PoolManagerLike.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.5.0; 3 | 4 | interface PoolManagerLike { 5 | function assetToId(address) external view returns (uint128 assetId); 6 | 7 | function getTranchePrice( 8 | uint64 poolId, 9 | bytes16 trancheId, 10 | address asset 11 | ) 12 | external 13 | view 14 | returns (uint128 price, uint64 computedAt); 15 | } 16 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/RestrictionManagerLike.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.5.0; 3 | 4 | interface RestrictionManagerLike { 5 | function root() external view returns (address); 6 | 7 | function updateMember(address token, address user, uint64 validUntil) external; 8 | } 9 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/SignatureLib.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | interface IERC1271 { 5 | function isValidSignature(bytes32, bytes memory) external view returns (bytes4); 6 | } 7 | 8 | /// @title Signature Lib 9 | library SignatureLib { 10 | function isValidSignature( 11 | address signer, 12 | bytes32 digest, 13 | bytes memory signature 14 | ) 15 | internal 16 | view 17 | returns (bool valid) 18 | { 19 | if (signature.length == 65) { 20 | bytes32 r; 21 | bytes32 s; 22 | uint8 v; 23 | assembly { 24 | r := mload(add(signature, 0x20)) 25 | s := mload(add(signature, 0x40)) 26 | v := byte(0, mload(add(signature, 0x60))) 27 | } 28 | if (signer == ecrecover(digest, v, r, s)) { 29 | return true; 30 | } 31 | } 32 | 33 | if (signer.code.length > 0) { 34 | (bool success, bytes memory result) = 35 | signer.staticcall(abi.encodeCall(IERC1271.isValidSignature, (digest, signature))); 36 | valid = 37 | (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/mocks/7540MockUtils/TrancheTokenLike.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity >=0.5.0; 3 | 4 | interface TrancheTokenLike { 5 | function hook() external view returns (address); 6 | } 7 | -------------------------------------------------------------------------------- /test/mocks/DeBridgeMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | /// Types Imports 7 | import "src/vendor/deBridge/IDlnSource.sol"; 8 | import "./MockERC20.sol"; 9 | 10 | /// @title DeBridge Dln Source Mock 11 | /// @dev eventually replace this by using a fork of the real dln source contract 12 | contract DeBridgeMock is Test { 13 | address constant NATIVE = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; 14 | 15 | receive() external payable { } 16 | 17 | function globalFixedNativeFee() external pure returns (uint88) { 18 | return type(uint88).max; 19 | } 20 | 21 | function createSaltedOrder( 22 | DlnOrderLib.OrderCreation calldata _orderCreation, 23 | uint64, 24 | bytes calldata, 25 | uint32, 26 | bytes calldata, 27 | bytes calldata _metadata 28 | ) 29 | external 30 | payable 31 | returns (bytes32) 32 | { 33 | (, uint256 fromChainId, uint256 toChainId) = abi.decode(_metadata, (address, uint256, uint256)); 34 | 35 | // vm.selectFork(fromChainId); 36 | // MockERC20(_orderCreation.giveTokenAddress).transferFrom(from, address(this), _orderCreation.giveAmount); 37 | 38 | vm.selectFork(toChainId); 39 | deal( 40 | _castToAddress(_orderCreation.takeTokenAddress), 41 | _castToAddress(_orderCreation.receiverDst), 42 | _orderCreation.takeAmount 43 | ); 44 | 45 | vm.selectFork(fromChainId); 46 | 47 | /// just returning a random key here 48 | return keccak256(abi.encode(_orderCreation)); 49 | } 50 | 51 | function _castToAddress(bytes memory address_) internal pure returns (address) { 52 | return address(uint160(bytes20(address_))); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /test/mocks/ERC7575Mock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC20 } from "./7540MockUtils/ERC20.sol"; 5 | import { IERC20Callback } from "./7540MockUtils/IERC20.sol"; 6 | import { IERC7575Share, IERC165 } from "src/vendor/centrifuge/IERC7575.sol"; 7 | 8 | /// @title Tranche ERC7575Mock 9 | contract ERC7575Mock is ERC20, IERC7575Share { 10 | /// @inheritdoc IERC7575Share 11 | mapping(address asset => address) public vault; 12 | 13 | constructor(uint8 decimals_) ERC20(decimals_) { } 14 | 15 | function updateVault(address asset, address vault_) external { 16 | vault[asset] = vault_; 17 | emit VaultUpdate(asset, vault_); 18 | } 19 | 20 | // --- ERC165 support --- 21 | /// @inheritdoc IERC165 22 | function supportsInterface(bytes4 interfaceId) external pure override returns (bool) { 23 | return interfaceId == type(IERC7575Share).interfaceId || interfaceId == type(IERC165).interfaceId; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/mocks/MockERC20.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 5 | 6 | contract MockERC20 is ERC20 { 7 | constructor( 8 | string memory _name, 9 | string memory _symbol, 10 | address initialAccount, 11 | uint256 initialBalance 12 | ) 13 | ERC20(_name, _symbol) 14 | { 15 | _mint(initialAccount, initialBalance); 16 | } 17 | 18 | function mint(address to, uint256 amount) public { 19 | _mint(to, amount); 20 | } 21 | 22 | function burn(address account, uint256 amount) public { 23 | _burn(account, amount); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/mocks/VaultMock.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC4626 } from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol"; 5 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 6 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 7 | import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; 8 | 9 | contract VaultMock is ERC4626 { 10 | using SafeERC20 for IERC20; 11 | 12 | constructor(IERC20 asset_, string memory name_, string memory symbol_) ERC4626(asset_) ERC20(name_, symbol_) { } 13 | } 14 | -------------------------------------------------------------------------------- /test/mocks/VaultMockFailedDeposit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC4626 } from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol"; 5 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 6 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 7 | import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; 8 | 9 | contract VaultMockFailedDeposit is ERC4626 { 10 | using SafeERC20 for IERC20; 11 | 12 | constructor(IERC20 asset_, string memory name_, string memory symbol_) ERC4626(asset_) ERC20(name_, symbol_) { } 13 | 14 | function deposit(uint256, /*assets*/ address /*receiver*/ ) public pure override returns (uint256) { 15 | return 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/mocks/VaultMockFailedWithdraw.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC4626 } from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol"; 5 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 6 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 7 | import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; 8 | 9 | contract VaultMockFailedWithdraw is ERC4626 { 10 | using SafeERC20 for IERC20; 11 | 12 | constructor(IERC20 asset_, string memory name_, string memory symbol_) ERC4626(asset_) ERC20(name_, symbol_) { } 13 | 14 | function redeem(uint256, address, address) public virtual override returns (uint256) { 15 | return 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/mocks/VaultMockRevertDeposit.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC4626 } from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol"; 5 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 6 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 7 | import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; 8 | 9 | contract VaultMockRevertDeposit is ERC4626 { 10 | using SafeERC20 for IERC20; 11 | 12 | constructor(IERC20 asset_, string memory name_, string memory symbol_) ERC4626(asset_) ERC20(name_, symbol_) { } 13 | 14 | function deposit(uint256, /*assets*/ address /*receiver*/ ) public pure override returns (uint256) { 15 | revert(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/mocks/VaultMockRevertWithdraw.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: AGPL-3.0-only 2 | pragma solidity ^0.8.23; 3 | 4 | import { ERC4626 } from "openzeppelin-contracts/contracts/token/ERC20/extensions/ERC4626.sol"; 5 | import { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol"; 6 | import { IERC20 } from "openzeppelin-contracts/contracts/interfaces/IERC20.sol"; 7 | import { SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol"; 8 | 9 | contract VaultMockRevertWithdraw is ERC4626 { 10 | using SafeERC20 for IERC20; 11 | 12 | constructor(IERC20 asset_, string memory name_, string memory symbol_) ERC4626(asset_) ERC20(name_, symbol_) { } 13 | 14 | function redeem(uint256, address, address) public virtual override returns (uint256) { 15 | revert(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/unit/constructor/Constructor.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.23; 3 | 4 | import "test/utils/BaseSetup.sol"; 5 | 6 | contract ConstructorsTest is BaseSetup { 7 | function setUp() public override { 8 | super.setUp(); 9 | 10 | vm.selectFork(FORKS[ETH]); 11 | } 12 | 13 | function test_superRegistry_address_0() public { 14 | bytes32 saltT = keccak256(abi.encodePacked("test")); 15 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 16 | new PayMaster{ salt: saltT }(address(0)); 17 | 18 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 19 | new PaymentHelper{ salt: saltT }(address(0)); 20 | 21 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 22 | new SuperformRouter{ salt: saltT }(address(0)); 23 | 24 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 25 | new EmergencyQueue{ salt: saltT }(address(0)); 26 | 27 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 28 | new RewardsDistributor{ salt: saltT }(address(0)); 29 | 30 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 31 | new LiFiValidator{ salt: saltT }(address(0)); 32 | 33 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 34 | new SocketOneInchValidator{ salt: saltT }(address(0)); 35 | 36 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 37 | new SocketValidator{ salt: saltT }(address(0)); 38 | 39 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 40 | new DstSwapper{ salt: saltT }(address(0)); 41 | 42 | vm.expectRevert(Error.ZERO_ADDRESS.selector); 43 | new SuperformFactory{ salt: saltT }(address(0)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /test/unit/crosschain-data/utils/QuorumManager.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.23; 3 | 4 | import "test/utils/BaseSetup.sol"; 5 | import { SuperRegistry } from "src/settings/SuperRegistry.sol"; 6 | import { Error } from "src/libraries/Error.sol"; 7 | 8 | contract QuorumManagerTest is BaseSetup { 9 | SuperRegistry public superRegistry; 10 | 11 | function setUp() public override { 12 | super.setUp(); 13 | 14 | vm.selectFork(FORKS[ETH]); 15 | superRegistry = SuperRegistry(payable(getContract(ETH, "SuperRegistry"))); 16 | } 17 | 18 | function test_getRequiredMessagingQuorum() public { 19 | vm.selectFork(FORKS[ETH]); 20 | 21 | vm.expectRevert(Error.ZERO_INPUT_VALUE.selector); 22 | superRegistry.getRequiredMessagingQuorum(0); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/unit/libraries/ArrayCastLib.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | import { ArrayCastLib } from "src/libraries/ArrayCastLib.sol"; 7 | import { InitSingleVaultData, InitMultiVaultData, LiqRequest } from "src/types/DataTypes.sol"; 8 | 9 | contract ArrayCastLibUser { 10 | function castLiqRequestToArray(LiqRequest memory a) external pure returns (LiqRequest[] memory) { 11 | return ArrayCastLib.castLiqRequestToArray(a); 12 | } 13 | 14 | function castBoolToArray(bool a) external pure returns (bool[] memory) { 15 | return ArrayCastLib.castBoolToArray(a); 16 | } 17 | 18 | function castToMultiVaultData(InitSingleVaultData memory a) 19 | external 20 | pure 21 | returns (InitMultiVaultData memory castedData_) 22 | { 23 | return ArrayCastLib.castToMultiVaultData(a); 24 | } 25 | } 26 | 27 | contract ArrayCastLibTest is Test { 28 | ArrayCastLibUser arrayCastLib; 29 | 30 | function setUp() external { 31 | arrayCastLib = new ArrayCastLibUser(); 32 | } 33 | 34 | function test_castLiqRequestToArray() public view { 35 | LiqRequest memory req = LiqRequest("", address(0), address(0), 1, 1, 1 wei); 36 | 37 | LiqRequest[] memory castedReq = arrayCastLib.castLiqRequestToArray(req); 38 | assertEq(castedReq.length, 1); 39 | } 40 | 41 | function test_castBoolToArray() public view { 42 | bool value = true; 43 | bool[] memory castedValue = arrayCastLib.castBoolToArray(value); 44 | assertEq(castedValue.length, 1); 45 | } 46 | 47 | function test_castToMultiVaultData() public view { 48 | InitSingleVaultData memory data = InitSingleVaultData( 49 | 1, 1, 1e18, 1e18, 100, LiqRequest(bytes(""), address(0), address(0), 1, 1, 0), true, true, address(0), "" 50 | ); 51 | InitMultiVaultData memory castedValue = arrayCastLib.castToMultiVaultData(data); 52 | assertEq(castedValue.superformIds.length, 1); 53 | 54 | assertEq(castedValue.hasDstSwaps[0], data.hasDstSwap); 55 | assertEq(castedValue.retain4626s[0], data.retain4626); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /test/unit/libraries/ProofLib.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | pragma solidity ^0.8.23; 3 | 4 | import "forge-std/Test.sol"; 5 | 6 | import { ProofLib } from "src/libraries/ProofLib.sol"; 7 | import { AMBMessage } from "src/types/DataTypes.sol"; 8 | 9 | contract ProofLibUser { 10 | function computeProof(AMBMessage memory message_) external pure returns (bytes32) { 11 | return ProofLib.computeProof(message_); 12 | } 13 | 14 | function computeProofBytes(AMBMessage memory message_) external pure returns (bytes memory) { 15 | return ProofLib.computeProofBytes(message_); 16 | } 17 | 18 | function computeProof(bytes memory message_) external pure returns (bytes32) { 19 | return ProofLib.computeProof(message_); 20 | } 21 | 22 | function computeProofBytes(bytes memory message_) external pure returns (bytes memory) { 23 | return ProofLib.computeProofBytes(message_); 24 | } 25 | } 26 | 27 | contract ProofLibTest is Test { 28 | ProofLibUser proofLib; 29 | 30 | function setUp() external { 31 | proofLib = new ProofLibUser(); 32 | } 33 | 34 | function test_castLiqRequestToArray() public view { 35 | AMBMessage memory message = AMBMessage(1, ""); 36 | 37 | bytes memory msgBytes = abi.encode(message); 38 | 39 | assertEq(keccak256(abi.encode(message)), proofLib.computeProof(message)); 40 | assertEq(abi.encode(keccak256(abi.encode(message))), proofLib.computeProofBytes(message)); 41 | assertEq(keccak256(msgBytes), proofLib.computeProof(msgBytes)); 42 | assertEq(abi.encode(keccak256(msgBytes)), proofLib.computeProofBytes(msgBytes)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /test/unit/vault-claimer/VaultClaimer.t.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: UNLICENSED 2 | pragma solidity ^0.8.23; 3 | 4 | import { Test } from "forge-std/Test.sol"; 5 | import { VaultClaimer } from "src/VaultClaimer.sol"; 6 | 7 | contract VaultClaimerTest is Test { 8 | string public constant TEST_PROTOCOL_ID = "vault_420"; 9 | address public constant CLAIMER = address(69); 10 | 11 | VaultClaimer public vaultClaimer; 12 | 13 | // test event 14 | event Claimed(address indexed claimer, string protocolId); 15 | 16 | /// test error case 17 | error AlreadyClaimed(); 18 | 19 | function setUp() public { 20 | vaultClaimer = new VaultClaimer(); 21 | } 22 | 23 | // case: successful claiming of TEST_PROTOCOL_ADMIN 24 | function test_successfulClaim() public { 25 | vm.prank(CLAIMER); 26 | 27 | vm.expectEmit(true, true, true, true); 28 | emit Claimed(CLAIMER, TEST_PROTOCOL_ID); 29 | 30 | vaultClaimer.claimProtocolOwnership(TEST_PROTOCOL_ID); 31 | } 32 | 33 | /// case: duplicate claiming of TEST_PROTOCOL_ADMIN 34 | function test_duplicateClaim() public { 35 | vm.prank(CLAIMER); 36 | vaultClaimer.claimProtocolOwnership(TEST_PROTOCOL_ID); 37 | 38 | vm.prank(CLAIMER); 39 | 40 | vm.expectEmit(true, true, true, true); 41 | emit Claimed(CLAIMER, TEST_PROTOCOL_ID); 42 | 43 | vaultClaimer.claimProtocolOwnership(TEST_PROTOCOL_ID); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /test/utils/AmbParams.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BUSL-1.1 2 | import { AMBExtraData, BroadCastAMBExtraData } from "src/types/DataTypes.sol"; 3 | 4 | pragma solidity ^0.8.23; 5 | 6 | function generateBroadcastParams(uint256 gasFee_) pure returns (bytes memory) { 7 | uint8 ambId = 4; 8 | 9 | uint256 gasFee = gasFee_; 10 | bytes memory extraData; 11 | 12 | return abi.encode(ambId, abi.encode(gasFee, extraData)); 13 | } 14 | -------------------------------------------------------------------------------- /test/utils/Utilities.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Unlicense 2 | pragma solidity ^0.8.23; 3 | 4 | import { Test } from "forge-std/Test.sol"; 5 | 6 | //common utilities for forge tests 7 | contract Utilities is Test { 8 | bytes32 internal nextUser = keccak256(abi.encodePacked("user address")); 9 | 10 | function getNextUserAddress() external returns (address payable) { 11 | //bytes32 to address conversion 12 | address payable user = payable(address(uint160(uint256(nextUser)))); 13 | nextUser = keccak256(abi.encodePacked(nextUser)); 14 | return user; 15 | } 16 | 17 | //create users with 100 ether balance 18 | function createUsers(uint256 userNum) public returns (address payable[] memory) { 19 | address payable[] memory users = new address payable[](userNum); 20 | for (uint256 i = 0; i < userNum; ++i) { 21 | address payable user = this.getNextUserAddress(); 22 | vm.deal(user, 100 ether); 23 | users[i] = user; 24 | } 25 | return users; 26 | } 27 | 28 | //move block.number forward by a given number of blocks 29 | function mineBlocks(uint256 numBlocks) public { 30 | uint256 targetBlock = block.number + numBlocks; 31 | vm.roll(targetBlock); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/utils/merkle/merkle-js/generateMerkleTree.js: -------------------------------------------------------------------------------- 1 | const { StandardMerkleTree } = require("@openzeppelin/merkle-tree"); 2 | const fs = require("fs"); 3 | 4 | 5 | /// read all the files in target folder 6 | let files = fs.readdirSync('test/utils/merkle/target/'); 7 | let filteredFiles = files.filter(file => file.startsWith("input")) 8 | let constructedData = []; 9 | 10 | for (let i = 0; i < filteredFiles.length; ++i) { 11 | const jsonTreeData = require(`../target/${filteredFiles[i]}`); 12 | console.log(`Processing file: ${filteredFiles[i]}`); 13 | for (let j = 0; j < jsonTreeData.count; ++j) { 14 | if (jsonTreeData.values[j][2].length != jsonTreeData.values[j][3].length) { 15 | throw new Error("Invalid input data"); 16 | } 17 | constructedData.push( 18 | [jsonTreeData.values[j][0].toString(), jsonTreeData.values[j][1].toString(), jsonTreeData.values[j][2], jsonTreeData.values[j][3], jsonTreeData.values[j][4].toString()] 19 | ) 20 | } 21 | 22 | /// step 2: construct the merkle tree 23 | const tree = StandardMerkleTree.of(constructedData, ["address", "uint256", "address[]", "uint256[]", "uint256"]); 24 | 25 | /// step 3: construct the root 26 | const root = tree.root; 27 | const treeDump = tree.dump(); 28 | 29 | /// step 4: construct the root for each index 30 | for (const [i, v] of tree.entries()) { 31 | const proof = tree.getProof(i); 32 | treeDump.values[i].claimer = treeDump.values[i].value[0]; 33 | treeDump.values[i].periodId = parseInt(treeDump.values[i].value[1]); 34 | treeDump.values[i].rewardTokens = treeDump.values[i].value[2].map((value) => value.toString()); 35 | treeDump.values[i].amountsClaimed = treeDump.values[i].value[3].map((value) => parseInt(value)); 36 | treeDump.values[i].chainId = parseInt(treeDump.values[i].value[4]); 37 | treeDump.values[i].proof = proof; 38 | 39 | } 40 | 41 | /// step 4: write the tree and root for further use 42 | fs.writeFileSync(`test/utils/merkle/target/jsGeneratedRoot${i}.json`, JSON.stringify({ "root": root })); 43 | fs.writeFileSync(`test/utils/merkle/target/jsTreeDump${i}.json`, JSON.stringify(treeDump)); 44 | constructedData = []; 45 | console.log(' Processed ') 46 | } -------------------------------------------------------------------------------- /test/utils/merkle/target/jsGeneratedRoot0.json: -------------------------------------------------------------------------------- 1 | {"root":"0xf5d9e300f214ac7c9a21a9be4c88db8ac3af824a60e0c55591a472dcd84c785c"} -------------------------------------------------------------------------------- /test/utils/merkle/target/jsGeneratedRoot1.json: -------------------------------------------------------------------------------- 1 | {"root":"0xb59bf802ccd74c09dabb6c42401f300140bfd6f8e2a9b35b71ea534c327303e6"} -------------------------------------------------------------------------------- /test/utils/merkle/target/jsGeneratedRoot2.json: -------------------------------------------------------------------------------- 1 | {"root":"0x27e3f92a6e0dac076065ae873c0ec9dda018e00e4ad157e22840447b1c067534"} --------------------------------------------------------------------------------