TRON with Foundry is now practical through a lightweight JSON-RPC proxy that bridges Ethereum-style tooling with TRONโs native transaction flow.
If you are used to forge build, forge test, and forge create, you already know how powerful Foundry is for Solidity development.
The challenge has always been that TRON is not a full Ethereum JSON-RPC clone. Some eth_* methods Forge expects either behave differently or do not exist on standard TRON endpoints. That mismatch is what causes direct Foundry deployments to fail on TRON.
This solution introduces a small local Node.js proxy that sits between Foundry and TRON. It accepts Ethereum-style deployment requests from Forge and translates them into TRON-native transactions using TronWeb, then broadcasts them to TRON Nile through TronGrid. The result is a workflow that feels close to Ethereum while deploying directly to TRON.
Here is how it works in simple terms:
โซ๏ธ Run a local JSON-RPC server (for example http://127.0.0.1:8545)
โซ๏ธ Implement or stub the minimal eth_* methods Forge needs
โซ๏ธ Forward read-only calls to a real TRON JSON-RPC endpoint
โซ๏ธ Translate eth_sendRawTransaction into TRON-native build, sign, and broadcast calls
What you need to get started:
โซ๏ธ A TronGrid endpoint (Nile recommended for testing)
โซ๏ธ TRX on Nile for your deployer wallet
โซ๏ธ Foundry installed (forge and cast)
โซ๏ธ Node.js installed
โซ๏ธ Tron-solc for your OS
โซ๏ธ Optional: OpenZeppelin for dependency testing
Setup flow:
โซ๏ธ Install Foundry and verify forge --version and cast --version
โซ๏ธ Clone the repository
โซ๏ธ Install Node dependencies
โซ๏ธ Configure .env using .env.sample
โซ๏ธ Run the proxy with node proxy/index.js
โซ๏ธ Configure foundry.toml to point eth_rpc_url to your local proxy
โซ๏ธ Build with forge clean and forge build before deployment
โซ๏ธ Create a keystore using cast wallet import
From there, deployments work as expected:
โซ๏ธ Deploy simple contracts without constructors
โซ๏ธ Deploy contracts with constructor arguments
โซ๏ธ Deploy contracts importing OpenZeppelin
โซ๏ธ Use --legacy and --broadcast flags
โซ๏ธ Check transaction hash on Tronscan after removing the 0x prefix
Testing remains clean and structured:
โซ๏ธ Unit tests run inside Foundryโs local EVM runner
โซ๏ธ Use standard solc output for tests
โซ๏ธ Always run forge clean before forge test
โซ๏ธ Interactive debugging works with --debug
Current support includes:
โซ๏ธ forge create deployments
โซ๏ธ Constructor arguments
โซ๏ธ Local imports and OpenZeppelin
โซ๏ธ forge coverage
โซ๏ธ forge fmt
โซ๏ธ Standard solc-based testing
Limitations today:
โซ๏ธ TRON solc output is not compatible with Foundryโs local EVM runner
โซ๏ธ Forking via anvil --fork-url is not supported
โซ๏ธ forge verify-contract requires using Tronscan instead
โซ๏ธ Broader Ethereum RPC parity is not fully implemented
A planned improvement is adding minimal eth_call support to provide more consistent read calls.
From a developer perspective, this proxy removes the friction between Ethereum-native tooling and TRONโs transaction model. Instead of rewriting workflows, you keep your familiar Foundry commands and insert a compatibility layer that handles the TRON-specific details behind the scenes.
If you build Solidity contracts and want to deploy on TRON without abandoning your Ethereum toolchain habits, this is a clean and practical approach.
If you are building on TRON or planning to migrate Solidity workflows, test this setup on Nile, explore the repo, and start deploying with Foundry today.
Learn more ๐