Test Account Impersonation Tool (Local Fork)
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Test Account Impersonation Tool (Local Fork) is a read-only developer tool that simulates account impersonation in local fork environments by reading chain state as if it were the target account. It fetches account balances via eth_getBalance, contract bytecode via eth_getCode, transaction nonces, and block metadata to provide a comprehensive view of the target account's state. The tool generates impersonation scripts for Hardhat and Anvil, enabling developers to test privileged accounts, simulate admin actions, and debug contract interactions that require specific account permissions—all without signing transactions or modifying chain state.
HOW TO USE
Connect your EVM-compatible wallet via the BGWallet bridge and select the network where your local fork is connected. Enter the address you want to impersonate and select an action to simulate (Check Balance, Check Contract Code, or Check Transaction Count). Click "Simulate Impersonation" to read the target account's state and generate impersonation scripts. Results include the account's balance in ETH and wei, contract status, transaction count, block number, chain ID, and a ready-to-use Hardhat impersonation script. The tool also provides an Anvil command for impersonation. All analysis is read-only—no signatures or transactions are submitted.
TECHNICAL MECHANISM
The tool uses ethers.js v5.7.2 to fetch chain state from the provider. It retrieves the account balance using provider.getBalance(address) and converts the result to ETH (dividing by 1e18) while preserving the wei value. Contract code is fetched via provider.getCode(address) and truncated for display. The transaction count (nonce) is retrieved via provider.getTransactionCount(address). Block number and chain ID are fetched via provider.getBlockNumber() and provider.getNetwork(). The tool identifies whether the address is a contract by checking if the bytecode is non-empty. Based on the selected action, the tool returns the relevant state data. The impersonation script generator produces: (1) a Hardhat script using hardhat_impersonateAccount and ethers.getSigner() to create a signer for the impersonated account; (2) an Anvil command for the anvil --fork-url approach. The tool does not send any transactions or modify state—it only reads data to simulate the impersonation experience.
WHAT IT CANNOT SEE
This tool has fundamental limitations that users must understand. It cannot actually impersonate accounts—the tool is a simulation only and does not execute hardhat_impersonateAccount or anvil_impersonateAccount RPC methods. It requires a local fork environment (Hardhat, Anvil, or Ganache) to perform actual impersonation. It cannot generate private keys or sign messages—the tool does not handle cryptographic operations. It cannot impersonate accounts on live networks—impersonation is only possible in local fork environments. It cannot automate multi-step transaction flows—the tool only reads state. It cannot recover funds or reverse impersonated actions after testing—the tool is read-only and does not execute transactions. It cannot impersonate accounts that do not exist on the forked chain—the address must have state on the chain. It cannot simulate interactions that require specific transaction parameters or state conditions. It cannot monitor impersonation session state across multiple calls. The tool's impersonation scripts are generated as templates and must be manually integrated into the user's test environment.
PLEASE NOTE
This tool only supports EVM-compatible blockchains (Ethereum, Polygon, BSC, Avalanche C-Chain, Optimism, Arbitrum, and their testnets). Solana, Tron, Starknet, SUI, TON, Aptos, Bitcoin, Cosmos, and XRP are not supported. The tool is free, open-source, requires no API keys, and uses the wallet's native provider for all read operations. Account impersonation is a powerful testing feature—always use it responsibly in local development environments only.