diff --git a/netlify.toml b/netlify.toml index 43a88a46..348b0ebd 100644 --- a/netlify.toml +++ b/netlify.toml @@ -7,6 +7,18 @@ REACT_APP_IS_MERGE = "true" REACT_APP_COMPOUNDING_CONTRACT_ADDRESS = "0x0000BBdDc7CE488642fb579F8B00f3a590007251" REACT_APP_WITHDRAWAL_CONTRACT_ADDRESS = "0x00000961Ef480Eb55e80D19ad83579A64c007002" + REACT_APP_IS_MAINNET = "false" + REACT_APP_CONTRACT_ADDRESS = "0x4242424242424242424242424242424242424242" + REACT_APP_ETH_REQUIREMENT = "524288" + REACT_APP_ETH_DEPOSIT_OFFSET = "0" + REACT_APP_TESTNET_LAUNCHPAD_NAME = "devnet7" + REACT_APP_EL_EXPLORER_URL = "https://explorer.pectra-devnet-7.ethpandaops.io" + REACT_APP_GENESIS_FORK_VERSION = "0x10952561" + REACT_APP_RPC_URL = "https://rpc.pectra-devnet-7.ethpandaops.io" + REACT_APP_BEACONCHAIN_URL = "https://dora.pectra-devnet-7.ethpandaops.io/" + REACT_APP_FAUCET_URL = "https://www.holeskyfaucet.io/" + REACT_APP_MIN_GENESIS_TIME = "1740610800000" + [context.branch-deploy.environment] NODE_VERSION = "14.19.2" [context.dev.environment] diff --git a/src/components/TransactionStatusModal/TransactionProgress.tsx b/src/components/TransactionStatusModal/TransactionProgress.tsx index 6b7faac5..4fc2ad02 100644 --- a/src/components/TransactionStatusModal/TransactionProgress.tsx +++ b/src/components/TransactionStatusModal/TransactionProgress.tsx @@ -118,12 +118,17 @@ export const TransactionProgress: React.FC<TransactionProgressProps> = ({ <FormattedMessage defaultMessage="Sign transaction with your wallet" /> </Text> </Item> - <Item> - <ProgressCircle step={2} status={confirmOnChainStatus} /> - <Text> - <FormattedMessage defaultMessage="Confirm on-chain" /> + <div> + <Item> + <ProgressCircle step={2} status={confirmOnChainStatus} /> + <Text> + <FormattedMessage defaultMessage="Confirm on execution layer" /> + </Text> + </Item> + <Text style={{ fontSize: '0.875rem' }}> + <FormattedMessage defaultMessage="Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)." /> </Text> - </Item> + </div> </div> ); }; diff --git a/src/intl/compiled/en.json b/src/intl/compiled/en.json index 484b57d7..299c9f88 100644 --- a/src/intl/compiled/en.json +++ b/src/intl/compiled/en.json @@ -2079,6 +2079,12 @@ "value": "Exiting" } ], + "Ab1qjD": [ + { + "type": 0, + "value": "Confirm on execution layer" + } + ], "AbBgEs": [ { "type": 0, @@ -2287,6 +2293,12 @@ "value": "Proof of stake" } ], + "CFjSbY": [ + { + "type": 0, + "value": "Available to withdrawal" + } + ], "CPl2hh": [ { "type": 0, @@ -3125,6 +3137,12 @@ "value": "Formerly TurboGeth, Erigon is an Ethereum client built to enable performance optimizations." } ], + "I7N/DN": [ + { + "type": 0, + "value": "Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)." + } + ], "ICbItT": [ { "type": 0, @@ -3381,12 +3399,6 @@ "value": "Further reading" } ], - "Jge1Sx": [ - { - "type": 0, - "value": "Force exit" - } - ], "JhUYU3": [ { "type": 0, @@ -6223,6 +6235,12 @@ "value": "Setup" } ], + "dyfKG1": [ + { + "type": 0, + "value": "Exit fully" + } + ], "dzdAcD": [ { "type": 0, @@ -7343,12 +7361,6 @@ "value": "Advisories" } ], - "l5kq/q": [ - { - "type": 0, - "value": "Confirm on-chain" - } - ], "l6OJpv": [ { "type": 0, diff --git a/src/intl/en.json b/src/intl/en.json index affd2069..4404d734 100644 --- a/src/intl/en.json +++ b/src/intl/en.json @@ -765,6 +765,9 @@ "AZaw+B": { "message": "Exiting" }, + "Ab1qjD": { + "message": "Confirm on execution layer" + }, "AbBgEs": { "message": "understanding validator effective balance" }, @@ -856,6 +859,9 @@ "CF9vMR": { "message": "Proof of stake" }, + "CFjSbY": { + "message": "Available to withdrawal" + }, "CPl2hh": { "message": "I have reviewed the checklist and understand how withdrawals work." }, @@ -1184,6 +1190,9 @@ "I7MjRD": { "message": "Formerly TurboGeth, Erigon is an Ethereum client built to enable performance optimizations." }, + "I7N/DN": { + "message": "Confirmation on the execution layer does not guarantee that the request will be valid on the consensus layer. Please check the beacon explorer to confirm if the request is successful after 13 minutes (under normal finalization period)." + }, "ICbItT": { "message": "This approach creates a single compounding account. Requires at least {MIN_ACTIVATION_BALANCE} {TICKER_NAME}, and can hold up to {MAX_EFFECTIVE_BALANCE}." }, @@ -1265,9 +1274,6 @@ "Ja5vXW": { "message": "Further reading" }, - "Jge1Sx": { - "message": "Force exit" - }, "JhUYU3": { "message": "Download CLI app" }, @@ -2352,6 +2358,9 @@ "dvr19k": { "message": "Setup" }, + "dyfKG1": { + "message": "Exit fully" + }, "dzdAcD": { "message": "Default Port" }, @@ -2785,9 +2794,6 @@ "l5XCJW": { "message": "Advisories" }, - "l5kq/q": { - "message": "Confirm on-chain" - }, "l6OJpv": { "message": "First, create a venv virtualenv under repository directory:" }, diff --git a/src/pages/Actions/components/ForceExit.tsx b/src/pages/Actions/components/ForceExit.tsx index 0511723a..5977e5a5 100644 --- a/src/pages/Actions/components/ForceExit.tsx +++ b/src/pages/Actions/components/ForceExit.tsx @@ -78,7 +78,7 @@ const ForceExit: React.FC<Props> = ({ validator }) => { const walletProvider = await (connector as AbstractConnector).getProvider(); const web3 = new Web3(walletProvider); - // Force exits have withdrawal amount of 0 + // Full exits have withdrawal amount of 0 const { transactionParams, queue: withdrawalQueue, @@ -111,7 +111,7 @@ const ForceExit: React.FC<Props> = ({ validator }) => { return ( <> <Button - label={<FormattedMessage defaultMessage="Force exit" />} + label={<FormattedMessage defaultMessage="Exit fully" />} onClick={handleOpen} destructive /> diff --git a/src/pages/Actions/components/PartialWithdraw.tsx b/src/pages/Actions/components/PartialWithdraw.tsx index 26c1553d..4ef5304d 100644 --- a/src/pages/Actions/components/PartialWithdraw.tsx +++ b/src/pages/Actions/components/PartialWithdraw.tsx @@ -232,7 +232,8 @@ const PartialWithdraw: React.FC<Props> = ({ validator }) => { }} > <div> - <FormattedMessage defaultMessage="Available" />: + <FormattedMessage defaultMessage="Available to withdrawal" /> + : </div> <div style={{ textAlign: 'end', fontFamily: 'monospace' }} diff --git a/src/pages/ConnectWallet/web3Utils.ts b/src/pages/ConnectWallet/web3Utils.ts index 1b34ac6c..ee9fdad7 100644 --- a/src/pages/ConnectWallet/web3Utils.ts +++ b/src/pages/ConnectWallet/web3Utils.ts @@ -18,12 +18,14 @@ export enum NetworkChainId { 'Mainnet' = 1, 'Sepolia' = 11155111, 'Holesky' = 17000, + 'devnet7' = 7032118028, } export const NetworkChainIdDict: { [id: string]: number } = { Mainnet: 1, Sepolia: 11155111, Holesky: 17000, + devnet7: 7032118028, }; /* @@ -35,11 +37,13 @@ const supportedNetworks = [ NetworkChainId.Mainnet, NetworkChainId.Sepolia, NetworkChainId.Holesky, + NetworkChainId.devnet7, ]; enum Testnet { 'Sepolia', 'Holesky', + 'devnet7', } enum Mainnet { @@ -50,6 +54,7 @@ export const NetworkNameToChainId: { [key: string]: NetworkChainId } = { Holesky: NetworkChainId.Holesky, Mainnet: NetworkChainId.Mainnet, Sepolia: NetworkChainId.Sepolia, + devnet7: NetworkChainId.devnet7, }; export const TARGET_NETWORK_CHAIN_ID = IS_MAINNET diff --git a/src/utils/beaconchain.ts b/src/utils/beaconchain.ts index 757ddfdf..360b9d9a 100644 --- a/src/utils/beaconchain.ts +++ b/src/utils/beaconchain.ts @@ -4,13 +4,33 @@ import { SLOTS_PER_EPOCH, } from './envVars'; +export const getEpochMsSinceGenesis = (epoch: number) => + epoch * SLOTS_PER_EPOCH * MS_PER_SLOT; + /** * Converts an epoch number to it's unix time in ms * * @param epoch - The epoch number to convert. * @returns The corresponding unix time in ms. */ -export const epochToDate = (epoch: number): Date => { - const msSinceGenesis = epoch * SLOTS_PER_EPOCH * MS_PER_SLOT; - return new Date(BEACON_CHAIN_GENESIS_TIME + msSinceGenesis); +export const epochToDate = (epoch: number): Date => + new Date(BEACON_CHAIN_GENESIS_TIME + getEpochMsSinceGenesis(epoch)); + +/** + * Calculate current epoch using current time + * + * @returns The current epoch number + */ +export const getCurrentEpoch = (): number => { + const msElapsed = Date.now() - BEACON_CHAIN_GENESIS_TIME; + return Math.floor(msElapsed / MS_PER_SLOT / SLOTS_PER_EPOCH); }; + +/** + * Calculate current epoch using current time + * + * @returns The current epoch number + */ +export const currentEpoch = Math.floor( + (Date.now() - BEACON_CHAIN_GENESIS_TIME) / MS_PER_SLOT / SLOTS_PER_EPOCH +);