Contract Migration Data Copier
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
The Contract Migration Data Copier enables developers to copy contract state data from old contract versions to new contract versions during protocol migrations. When smart contracts are upgraded, the new contract often needs access to the state data stored in the old contract—including user positions, token balances, storage slots, contract variables, mapping data, array data, and struct data. This tool provides a streamlined interface to copy this data across contracts with configurable modes.
The tool reads old contract state, new contract state, storage slots, contract variables, mapping data, array data, struct data, and state variables. It supports multiple copy modes: Single (copy individual data keys), Batch (copy multiple keys in a single transaction), and Full State (copy all contract state). The tool handles different data types including mappings, arrays, and nested structs, ensuring that complex data structures are correctly transferred.
HOW TO USE
1. Connect your wallet using the Connect button. The tool automatically detects your connected address and network.
2. Select the network where your contracts are deployed using the network dropdown.
3. Enter the old contract address (source) and the new contract address (destination).
4. Enter the data mapping keys (comma-separated) you want to copy.
5. Select the copy mode: Single, Batch, or Full State.
6. Set a gas limit appropriate for the data being copied.
7. Click "Preview data copy" to verify the copy parameters.
8. Review the copy details in the preview panel including both contracts, data keys, and mode.
9. Click "Copy Data" to submit the data copy transaction through your wallet.
10. The tool will read data from the old contract and write it to the new contract.
TECHNICAL MECHANISM
The tool interacts with the old contract to read state data using view functions or direct storage slot reads. For mappings, the tool reads the value at each specified key. For arrays, it reads all elements or a range of elements. For structs, it deserializes the data and writes it to the new contract. The tool then calls the data copy function on the new contract, passing the retrieved data as parameters. The new contract validates the data and updates its internal state accordingly. For Full State mode, the tool iterates through all known storage slots and copies them to the new contract. The copy process uses the sender contract to handle the transaction, with configurable gas limits to accommodate large data sets. Each data key is processed sequentially, with progress reporting for batch operations.
WHAT IT CANNOT SEE
This tool cannot verify that the price feed is accurate or reliable; it relies on the contracts' internal state. It cannot detect if the oracle has been compromised or manipulated. It cannot ensure that data copying will execute at the optimal price due to gas costs. It cannot guarantee that data copying will complete successfully if the new contract has not been audited or contains bugs. It cannot verify that the contracts have not been modified beyond the intended migration. It cannot detect if the data mapping is optimal or if the data structure is correctly aligned. It cannot recover funds if execution fails due to contract bugs, insufficient gas, out-of-gas errors, or blockchain reorgs. It cannot verify that data being copied is legitimate or has not been tampered with. It cannot predict storage slot collisions or conflicts between the old and new contracts. It cannot guarantee execution during extreme network congestion or high gas price conditions. It cannot detect if the new contract has been compromised. It cannot prevent the user from canceling or modifying data copy parameters through other interfaces. It cannot ensure that data copying is economically optimal or that gas costs do not exceed the migration value. It cannot guarantee that all data mappings will be correctly copied or that the new contract state will be consistent after copying.
PLEASE NOTE
This tool is designed for EVM-compatible blockchains (Ethereum, Polygon, Arbitrum, Optimism, Base, BSC, Avalanche, Fantom, and others). It requires an active wallet connection and sufficient native currency for gas fees. Always verify the old and new contract addresses, data keys, and copy mode before executing. Full State mode may be extremely gas-intensive and should be used with caution. The tool is provided as-is with no warranty; users assume full responsibility for their transactions and should exercise caution when copying contract state data. For mainnet usage, ensure both contract versions have been audited and you understand the risks of state copying including gas costs and data consistency.