inj-examples to deploy Solidity contracts and test Injective’s native precompiles through Ethereum JSON-RPC. The example starts a real Injective node with pre-funded development accounts and a local Blockscout explorer.
Use Anvil or Hardhat’s in-memory chain for standard EVM unit tests. Use the Injective localnet when your contract calls native precompiles. For custom genesis, Cosmos SDK modules, or native protocol changes, see Run a Local Native Node.
Start the Localnet
Install Docker with Docker Compose,jq, and Foundry. Clone the example and initialize the chain once.
Check that your client is connected:
Deploy and Test
Use the precompiles example to deploy a standard contract or a Bank-backed ERC20. If you want to start a new project, the Foundry template includes the same local environment. The local chain starts with an empty swap allowlist. For a complete test that creates and allowlists a market, seeds its order book, and executes swaps, use the swap localnet demo. Runmake local-stop to stop the services. Run make local-start to resume with the same state.