lumera-testnet-2) only. Mainnet gains the EVM with its upgrade, so deploy to testnet for now.
Prerequisites
- The MetaMask browser extension, configured with the Lumera testnet network. Follow Connect MetaMask first.
- Testnet LUME in your MetaMask account for gas. Get some from the faucet.
https://evm-rpc.testnet.lumera.io with chain ID 76857769 and currency symbol LUME. A Cosmos LCD or CometBFT RPC URL cannot answer eth_chainId and will not work.
Deploy the counter contract
1
Create the contract in Remix
Open Remix IDE. In the File Explorer panel on the left, create a new file called
Counter.sol and paste this code.Counter.sol
2
Compile the contract
Open the Solidity Compiler tab (second icon in the left sidebar). Set the compiler version to
0.8.20 or later to match the pragma, then click “Compile Counter.sol”. A green checkmark appears next to the file name when compilation succeeds.3
Connect Remix to MetaMask
Open the Deploy and Run Transactions tab (third icon in the left sidebar). In the Environment dropdown, select “Injected Provider - MetaMask”. MetaMask prompts you to connect. Pick the account you want to use and click “Connect”.Verify three things before deploying.
- The Account field shows your MetaMask address.
- The Balance shows your LUME balance.
- The network indicator shows
Custom (76857769), the Lumera EVM chain ID.
4
Deploy
Select
Counter in the Contract dropdown. Enter 0 (or any initial count) as the constructor argument next to the Deploy button, then click “Deploy”. MetaMask opens a contract creation transaction. Review the gas estimate and click “Confirm”. When the transaction confirms, the contract appears under Deployed Contracts at the bottom of the panel.Interact with the contract
Expand the deployed contract to see its functions. Remix color codes them. Blue buttons are read-onlyview functions with no gas cost and no MetaMask popup. Orange buttons change state, cost gas, and trigger a MetaMask confirmation.
1
Read the current count
Click “get”. The result appears below the button.
2
Increment the counter
Click “increase” and confirm the transaction in MetaMask. Click “get” again to verify the count is now
1.3
Set a specific value
Enter a value such as
42 in the input next to “set”, click “set”, and confirm in MetaMask. “get” now returns 42.4
Decrement the counter
Click “decrease” and confirm in MetaMask. “get” returns
41.5
Test the underflow guard
Set the counter to
0, then click “decrease”. The transaction reverts with Counter: cannot decrease below zero. MetaMask may warn about the likely failure before you confirm.6
Check the owner
The contract records the deployer as
owner. Click the blue “owner” button, the auto generated getter for the public state variable. It returns your MetaMask address.Inspect transactions
In Remix
Each transaction appears in the Remix terminal at the bottom of the screen. Click an entry to expand its details.- Transaction hash, click to copy
- From and to addresses
- Gas used
- Decoded input showing the function called and its arguments
- Logs showing the emitted
CountChangedevents
Over JSON-RPC
Query the transaction receipt from the node.CountChanged event fires on every state change. Count the logs for your contract.
Troubleshooting
MetaMask shows the wrong chain ID
Confirm the MetaMask network uses chain ID76857769. If you run your own node and upgraded it from a pre-EVM binary, the config migration adds the [evm] section to app.toml automatically on first startup. The node configuration details live in the EVM user guides on GitHub.
Transaction fails with “nonce too low”
MetaMask may cache nonces. Open MetaMask settings, go to Advanced, and use “Clear activity tab data” to reset the nonce cache for the current network.Transaction pending indefinitely
Check that the node is producing blocks.Gas estimation fails
The Lumera EVM uses an EIP-1559 fee market. If estimation fails, set the gas parameters manually in MetaMask’s advanced transaction settings.”Internal JSON-RPC error” on deploy
Check the Remix console for the full error. Common causes include the following.- Insufficient LUME balance for gas
- Contract code exceeds the block gas limit
- Constructor arguments missing or of the wrong type
Going further
Deploy an OpenZeppelin ERC-20 template the same way to create a token on Lumera. For production workflows, point Hardhat or Foundry at the same JSON-RPC endpoint. Contracts can also call native chain features like staking, governance, and Cascade through precompiles.Next steps
Precompiles
Call native Lumera modules from Solidity at fixed addresses.
OpenRPC playground
Explore every JSON-RPC method the node supports.
EVM JSON-RPC reference
Endpoints and methods for scripting against the EVM.