diff --git a/modules/blockChain/contractAddresses.ts b/modules/blockChain/contractAddresses.ts index fe870de8..ee31a479 100644 --- a/modules/blockChain/contractAddresses.ts +++ b/modules/blockChain/contractAddresses.ts @@ -189,3 +189,13 @@ export const Stonks: ChainAddressListMap = { '0x507D0971ffd5de64Ba1fb30Ee6Bb93376035DD00', ], } + +export const StonksStethAllowedRecipientsRegistry: ChainAddressMap = { + [CHAINS.Mainnet]: '0x1a7cFA9EFB4D5BfFDE87B0FaEb1fC65d653868C0', + [CHAINS.Holesky]: '0x4283839a5a92A3A6ed39E48cAD5e4c180b97800B', +} + +export const StonksStablesAllowedRecipientsRegistry: ChainAddressMap = { + [CHAINS.Mainnet]: '0x3f0534CCcFb952470775C516DC2eff8396B8A368', + [CHAINS.Holesky]: '0xDd553C1F88EDCFc2033141Cb908eFf9189988A90', +} diff --git a/modules/blockChain/contracts.ts b/modules/blockChain/contracts.ts index 6adc925d..6211bd67 100644 --- a/modules/blockChain/contracts.ts +++ b/modules/blockChain/contracts.ts @@ -428,3 +428,25 @@ export const ContractLegoStablesTopUp = createContractHelpers({ factory: TypeChain.TopUpWithLimitsStablesAbi__factory, address: EvmAddressesByType[MotionType.LegoStablesTopUp], }) + +export const ContractStonksStethAllowedRecipientsRegistry = + createContractHelpers({ + factory: TypeChain.RegistryWithLimitsAbi__factory, + address: CONTRACT_ADDRESSES.StonksStethAllowedRecipientsRegistry, + }) + +export const ContractStonksStablesAllowedRecipientsRegistry = + createContractHelpers({ + factory: TypeChain.RegistryWithLimitsAbi__factory, + address: CONTRACT_ADDRESSES.StonksStablesAllowedRecipientsRegistry, + }) + +export const ContractStonksStethTopUp = createContractHelpers({ + factory: TypeChain.TopUpWithLimitsAbi__factory, + address: EvmAddressesByType[MotionType.StonksStethTopUp], +}) + +export const ContractStonksStablesTopUp = createContractHelpers({ + factory: TypeChain.TopUpWithLimitsStablesAbi__factory, + address: EvmAddressesByType[MotionType.StonksStablesTopUp], +}) diff --git a/modules/motions/evmAddresses.ts b/modules/motions/evmAddresses.ts index 0a510bff..aed835d8 100644 --- a/modules/motions/evmAddresses.ts +++ b/modules/motions/evmAddresses.ts @@ -65,6 +65,9 @@ export const EvmAddressesByChain: EvmAddresses = { '0x7d509BFF310d9460b1F613e4e40d342201a83Ae4', [MotionType.SDVTNodeOperatorManagerChange]: '0xE31A0599A6772BCf9b2bFc9e25cf941e793c9a7D', + [MotionType.StonksStethTopUp]: '0x6e04aED774B7c89BB43721AcDD7D03C872a51B69', + [MotionType.StonksStablesTopUp]: + '0x0d2aefA542aFa8d9D1Ec35376068B88042FEF5f6', // next motion factories are @deprecated // we are keeping them here to display history data @@ -236,6 +239,9 @@ export const EvmAddressesByChain: EvmAddresses = { [MotionType.RccStablesTopUp]: '0xD497E7e039FeFBc64dBB7b75368afb06D07Bc73F', [MotionType.PmlStablesTopUp]: '0x5BAE56ECfB616eAbbDB048AC930FA1Db82f18900', [MotionType.AtcStablesTopUp]: '0xfa54cf78474cD4A7f4408Dd0efA36e44b6269813', + [MotionType.StonksStethTopUp]: '0x1240775f1857fB8317bD9ba63f4A8A6A78D9af06', + [MotionType.StonksStablesTopUp]: + '0x65A9913467A9793Bb23726d72C99A470bb9294Ad', // next motion factories are @deprecated // we are keeping them here to display history data diff --git a/modules/motions/hooks/useContractEvmScript.ts b/modules/motions/hooks/useContractEvmScript.ts index 7ce22280..ab2b4198 100644 --- a/modules/motions/hooks/useContractEvmScript.ts +++ b/modules/motions/hooks/useContractEvmScript.ts @@ -76,6 +76,8 @@ export const EVM_CONTRACTS = { [MotionType.PmlStethTopUp]: CONTRACTS.ContractPmlStethTopUp, [MotionType.AtcStethTopUp]: CONTRACTS.ContractAtcStethTopUp, [MotionType.LegoStablesTopUp]: CONTRACTS.ContractLegoStablesTopUp, + [MotionType.StonksStethTopUp]: CONTRACTS.ContractStonksStethTopUp, + [MotionType.StonksStablesTopUp]: CONTRACTS.ContractStonksStablesTopUp, } as const export function useContractEvmScript( diff --git a/modules/motions/hooks/useEVMScriptDecoder.ts b/modules/motions/hooks/useEVMScriptDecoder.ts index d1629739..c92739c9 100644 --- a/modules/motions/hooks/useEVMScriptDecoder.ts +++ b/modules/motions/hooks/useEVMScriptDecoder.ts @@ -53,6 +53,10 @@ export function useEVMScriptDecoder() { abis.RegistryWithLimitsAbi__factory.abi, [KEYS.AtcStethAllowedRecipientsRegistry]: abis.RegistryWithLimitsAbi__factory.abi, + [KEYS.StonksStethAllowedRecipientsRegistry]: + abis.RegistryWithLimitsAbi__factory.abi, + [KEYS.StonksStablesAllowedRecipientsRegistry]: + abis.RegistryWithLimitsAbi__factory.abi, }), ) }, `evm-script-decoder-${chainId}`) diff --git a/modules/motions/hooks/useRegistryWithLimits.ts b/modules/motions/hooks/useRegistryWithLimits.ts index ac32c137..8f5c3044 100644 --- a/modules/motions/hooks/useRegistryWithLimits.ts +++ b/modules/motions/hooks/useRegistryWithLimits.ts @@ -18,6 +18,8 @@ import { ContractRccStethAllowedRecipientsRegistry, ContractPmlStethAllowedRecipientsRegistry, ContractAtcStethAllowedRecipientsRegistry, + ContractStonksStethAllowedRecipientsRegistry, + ContractStonksStablesAllowedRecipientsRegistry, } from 'modules/blockChain/contracts' import { getEventsRecipientAdded } from 'modules/motions/utils' import { MotionType } from 'modules/motions/types' @@ -69,6 +71,9 @@ export const REGISTRY_WITH_LIMITS_BY_MOTION_TYPE = { [MotionType.PmlStethTopUp]: ContractPmlStethAllowedRecipientsRegistry, [MotionType.AtcStethTopUp]: ContractAtcStethAllowedRecipientsRegistry, [MotionType.LegoStablesTopUp]: ContractLegoStablesRegistry, + [MotionType.StonksStethTopUp]: ContractStonksStethAllowedRecipientsRegistry, + [MotionType.StonksStablesTopUp]: + ContractStonksStablesAllowedRecipientsRegistry, } as const type HookArgs = { diff --git a/modules/motions/hooks/useTokenByTopUpType.ts b/modules/motions/hooks/useTokenByTopUpType.ts index 151e7157..a349da08 100644 --- a/modules/motions/hooks/useTokenByTopUpType.ts +++ b/modules/motions/hooks/useTokenByTopUpType.ts @@ -70,6 +70,10 @@ const TOKEN = { label: 'stETH', value: (chainId: CHAINS) => CONTRACT_ADDRESSES.STETH[chainId], }, + [MotionType.StonksStethTopUp]: { + label: 'stETH', + value: (chainId: CHAINS) => CONTRACT_ADDRESSES.STETH[chainId], + }, } const isTopUpType = (type: unknown): type is keyof typeof TOKEN => { diff --git a/modules/motions/types.ts b/modules/motions/types.ts index 2586567b..fb9b6d9e 100644 --- a/modules/motions/types.ts +++ b/modules/motions/types.ts @@ -40,6 +40,8 @@ export const MotionTypeForms = { PmlStethTopUp: 'PmlStethTopUp', AtcStethTopUp: 'AtcStethTopUp', LegoStablesTopUp: 'LegoStablesTopUp', + StonksStethTopUp: 'StonksStethTopUp', + StonksStablesTopUp: 'StonksStablesTopUp', } as const // intentionally // eslint-disable-next-line @typescript-eslint/no-redeclare diff --git a/modules/motions/ui/MotionDescription/MotionDescription.tsx b/modules/motions/ui/MotionDescription/MotionDescription.tsx index bd6bc1d0..063fe5ca 100644 --- a/modules/motions/ui/MotionDescription/MotionDescription.tsx +++ b/modules/motions/ui/MotionDescription/MotionDescription.tsx @@ -286,6 +286,18 @@ const MOTION_DESCRIPTIONS = { registryType={MotionType.LegoStablesTopUp} /> ), + [MotionType.StonksStablesTopUp]: (props: GenericDescProps) => ( + + ), + [MotionType.StonksStethTopUp]: (props: DescWithLimitsProps) => ( + + ), } as const type Props = { diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimits.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimits.tsx index 5d68f003..2d7711cf 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimits.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimits.tsx @@ -34,6 +34,7 @@ import { ContractRccStethTopUp, ContractPmlStethTopUp, ContractAtcStethTopUp, + ContractStonksStethTopUp, } from 'modules/blockChain/contracts' import { MotionType } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' @@ -66,6 +67,10 @@ export const TOPUP_WITH_LIMITS_MAP = { evmContract: ContractAtcStethTopUp, motionType: MotionType.AtcStethTopUp, }, + [MotionType.StonksStethTopUp]: { + evmContract: ContractStonksStethTopUp, + motionType: MotionType.StonksStethTopUp, + }, } type Program = { diff --git a/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimitsAndCustomToken.tsx b/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimitsAndCustomToken.tsx index b7d929d2..4da4075f 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimitsAndCustomToken.tsx +++ b/modules/motions/ui/MotionFormStartNew/Parts/StartNewTopUpWithLimitsAndCustomToken.tsx @@ -30,6 +30,7 @@ import { ContractEvmAtcStablesTopUp, ContractEvmSandboxStablesTopUp, ContractLegoStablesTopUp, + ContractStonksStablesTopUp, } from 'modules/blockChain/contracts' import { MotionType } from 'modules/motions/types' import { createMotionFormPart } from './createMotionFormPart' @@ -66,6 +67,10 @@ export const TOPUP_WITH_LIMITS_MAP = { evmContract: ContractLegoStablesTopUp, motionType: MotionType.LegoStablesTopUp, }, + [MotionType.StonksStablesTopUp]: { + evmContract: ContractStonksStablesTopUp, + motionType: MotionType.StonksStablesTopUp, + }, } type Program = { diff --git a/modules/motions/ui/MotionFormStartNew/Parts/index.ts b/modules/motions/ui/MotionFormStartNew/Parts/index.ts index d9a36468..33ed3065 100644 --- a/modules/motions/ui/MotionFormStartNew/Parts/index.ts +++ b/modules/motions/ui/MotionFormStartNew/Parts/index.ts @@ -112,6 +112,13 @@ export const formParts = { StartNewTopUpWithLimitsAndCustomToken.formParts({ registryType: MotionTypeForms.LegoStablesTopUp, }), + [MotionTypeForms.StonksStethTopUp]: StartNewTopUpWithLimits.formParts({ + registryType: MotionTypeForms.StonksStethTopUp, + }), + [MotionTypeForms.StonksStablesTopUp]: + StartNewTopUpWithLimitsAndCustomToken.formParts({ + registryType: MotionTypeForms.StonksStablesTopUp, + }), } as const export type FormData = { diff --git a/modules/motions/utils/getMotionTypeDisplayName.ts b/modules/motions/utils/getMotionTypeDisplayName.ts index a61cb4c3..299d35c0 100644 --- a/modules/motions/utils/getMotionTypeDisplayName.ts +++ b/modules/motions/utils/getMotionTypeDisplayName.ts @@ -66,6 +66,8 @@ export const MotionTypeDisplayNames: Record< [MotionType.SandboxStablesAdd]: 'Add sandbox stables recipient', [MotionType.SandboxStablesRemove]: 'Remove sandbox stables recipient', [MotionType.LegoDAITopUp]: 'Top up LEGO DAI', + [MotionType.StonksStablesTopUp]: 'Top up stonks stablecoins', + [MotionType.StonksStethTopUp]: 'Top up stonks stETH', } as const export function getMotionTypeDisplayName(