After deploying your smart contract on the XRPL EVM, it is essential to verify the contract source code on the XRPL EVM Explorer. Verification ensures transparency and allows users to interact with your contract directly through the explorer.
This guide provides step-by-step instructions for verifying a smart contract using Remix IDE, Hardhat, and Foundry, with a recommended approach of using Standard JSON Input for seamless verification.
Following the upgrade from legacy evmOS to Cosmos EVM, the XRPL EVM is compatible with:
- EVM Version: Prague
- Solidity Compiler:
solcup to 0.8.30 works out of the box (its default EVM target isprague)
Contracts compiled for earlier EVM versions (Paris, Shanghai, Cancun) remain fully compatible. If you use a newer compiler release, set evmVersion to prague (or lower) in your compiler settings.
- Open the XRPL EVM Mainnet Explorer:
https://explorer.xrplevm.org - Search for your deployed contract by contract address.
- Go to the Contract tab and click Verify & Publish.
The XRPL EVM Explorer supports multiple methods. For the most reliable results, use Standard JSON Input exported from Remix, Hardhat, or Foundry.
Why Standard JSON Input?
- Captures all compiler settings (version, optimizer, metadata).
- Minimizes bytecode mismatches.
Open your contract in Remix IDE (remix.ethereum.org).
Compile under Solidity Compiler:
- Match the compiler version and optimizer settings from deployment.
Under Compilation Details, copy COMPILER INPUT.
Save it as
input.jsonlocally.
- In the XRPL EVM Explorer’s Verify & Publish page, choose Standard JSON Input.
- Upload
input.json. - Select your License Type.
- Click Verify.
Two approaches work on both Mainnet and Testnet: Standard JSON Input and the Hardhat Verify Plugin.
Compile:
npx hardhat compileHardhat writes the compiler input to a build-info file:
artifacts/build-info/<hash>.jsonThe Standard JSON Input is the
inputfield of that file. Extract it with:jq .input artifacts/build-info/<hash>.json > standard-input.jsonOn the Verify & Publish page, choose Standard JSON Input, upload
standard-input.json, pick license, and click Verify.
Automate via CLI. The examples below use Hardhat 2 (hardhat@hh2), where @nomicfoundation/hardhat-toolbox@hh2 already includes the verify plugin. They extend the hardhat.config.js and .env (XRPL_EVM_URL, PRIVATE_KEY) from Deploy the Smart Contract, keeping the same xrplEVM network name. The explorer runs Blockscout, which accepts any non-empty API key.
// hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
module.exports = {
solidity: "0.8.24",
networks: {
xrplEVM: {
url: process.env.XRPL_EVM_URL, // set in .env, see Deploy the Smart Contract
chainId: 1440000,
accounts: [process.env.PRIVATE_KEY],
},
},
etherscan: {
apiKey: { xrplEVM: "blockscout" },
customChains: [
{
network: "xrplEVM",
chainId: 1440000,
urls: {
apiURL: "https://explorer.xrplevm.org/api",
browserURL: "https://explorer.xrplevm.org",
},
},
],
},
};Replace <ADDRESS> and the constructor arguments. The command is the same on both networks; the target is set by XRPL_EVM_URL and the config above:
npx hardhat verify --network xrplEVM <ADDRESS> [constructorArg1] …If no constructor parameters, omit the args. Use
--forceto reverify.
Foundry’s forge can both generate Standard JSON and verify directly against the explorer, which runs Blockscout.
Build:
forge buildGenerate JSON input:
forge inspect src/HelloWorld.sol:HelloWorld standardJson > input.jsonOn the Explorer’s Verify & Publish, choose Standard JSON Input, upload
input.json, pick license, and click Verify.
No plugin is needed. Constructor arguments must be ABI-encoded, so pass them through cast abi-encode:
# Mainnet
forge verify-contract \
--rpc-url https://rpc.xrplevm.org \
--verifier blockscout \
--verifier-url https://explorer.xrplevm.org/api/ \
--constructor-args $(cast abi-encode "constructor(string)" "Hello, XRPL EVM!") \
<DEPLOYED_ADDRESS> \
src/HelloWorld.sol:HelloWorld- Replace
<DEPLOYED_ADDRESS>with your contract address andsrc/HelloWorld.sol:HelloWorldwith your contract path and name. - For Testnet, use
--rpc-url https://rpc.testnet.xrplevm.organd--verifier-url https://explorer.testnet.xrplevm.org/api/. - For Devnet, use
--rpc-url https://rpc.devnet.xrplevm.organd--verifier-url https://explorer.devnet.xrplevm.org/api/. - If the contract has no constructor arguments, drop
--constructor-args.
- Compiler Settings: Match version & optimizer exactly.
- License: Choose MIT, GPL, or Unlicense.
- Explorer Indexing: Wait about 10 to 15 seconds or retry on “no bytecode” errors.
- Cross-chain Ready: Plan for Axelar GMP, Wormhole or Cosmos IBC if you need interoperability.
- Transparency: Users can audit your code on-chain.
- Trust: Builds community confidence.
- Interaction: Enables Read/Write directly in the explorer UI.
By following these steps across Mainnet and Testnet, with Remix, Hardhat, or Foundry, you’ll have a fully verified contract visible and interactable on the XRPL EVM Explorer.