Verify Contract
Verify your deployed contract using flattened source code, JSON input, Sourcify and more. Verifying your deployed contract ensures transparency and trust by making the source code publicly available and verifiable.
Benefits of Verification
- Transparency: Publicly available source code.
- Trust: Community can verify the contract’s functionality.
- Security: Greater confidence in the contract’s integrity.
Sourcify
Sourcify provides decentralized, open-source contract verification. Sei has full Sourcify support on both mainnet (chain ID 1329) and testnet (chain ID 1328).
Sourcify performs byte-by-byte verification by recompiling your source code with the exact same compiler settings and comparing the output against the on-chain bytecode. No API key is required.
Verify with Foundry
After deploying your contract with Foundry, verify it on Sourcify:
forge verify-contract \
--verifier sourcify \
--chain-id <CHAIN_ID> \
<DEPLOYED_CONTRACT_ADDRESS> \
<PATH:CONTRACT_NAME>Testnet example:
forge verify-contract \
--verifier sourcify \
--chain-id 1328 \
0x1234567890abcdef1234567890abcdef12345678 \
src/Counter.sol:CounterMainnet example:
forge verify-contract \
--verifier sourcify \
--chain-id 1329 \
0x1234567890abcdef1234567890abcdef12345678 \
src/Counter.sol:CounterTo check verification status:
forge verify-check \
--verifier sourcify \
--chain-id 1328 \
<VERIFICATION_JOB_ID>You can also deploy and verify in a single step using forge create:
forge create src/Counter.sol:Counter \
--rpc-url https://evm-rpc-testnet.sei-apis.com \
--private-key $PRIVATE_KEY \
--verify \
--verifier sourcify \
--chain-id 1328forge create src/Token.sol:Token --constructor-args "MyToken" "MTK" 18Verify with Hardhat
The hardhat-verify plugin supports Sourcify out of the box with no additional configuration or API key.
1. Install dependencies
npm install --save-dev hardhat @nomicfoundation/hardhat-verify2. Configure hardhat.config.ts
import { defineConfig, configVariable } from "hardhat/config";
import hardhatVerify from "@nomicfoundation/hardhat-verify";
export default defineConfig({
networks: {
sei_testnet: {
type: "http",
chainId: 1328,
url: "https://evm-rpc-testnet.sei-apis.com",
accounts: [configVariable("PRIVATE_KEY")],
},
sei_mainnet: {
type: "http",
chainId: 1329,
url: "https://evm-rpc.sei-apis.com",
accounts: [configVariable("PRIVATE_KEY")],
},
},
solidity: {
compilers: [
{
version: "0.8.28",
settings: {
optimizer: { enabled: true, runs: 200 },
},
},
],
},
plugins: [hardhatVerify],
});hardhat-verify. No verify config block is needed for Sourcify.3. Deploy
npx hardhat ignition deploy ignition/modules/Counter.ts --network sei_testnet4. Verify with Sourcify
npx hardhat verify sourcify --network sei_testnet <CONTRACT_ADDRESS>If your contract has constructor arguments:
npx hardhat verify sourcify --network sei_testnet <CONTRACT_ADDRESS> "arg1" "arg2"Running npx hardhat verify without a subtask will attempt verification on all enabled providers (Etherscan, Blockscout, and Sourcify) simultaneously.
Verify via Sourcify UI
You can also verify contracts directly through the Sourcify web interface :
- Go to verify.sourcify.dev
- Select Sei (chain ID 1329) or Sei Testnet (chain ID 1328)
- Enter your contract address
- Upload your source files or standard JSON input
- Click Verify
Remix Contract Verification Plugin
Remix IDE offers an automated contract verification solution through its Contract Verification plugin, which integrates with both Sourcify and Etherscan verification services.
Setup and Configuration
-
Activate the Plugin: In Remix IDE, navigate to the Plugin Manager and activate the Contract Verification plugin.
-
Configure Network Settings:
- Search for and select Sei as your blockchain
- Choose your deployment environment:
- Testnet (1328) for development
- Mainnet (1329) for production
-
Enable Verification Services: Activate both verification methods:
- ✅ Sourcify
- ✅ Etherscan
-
Etherscan Configuration: Configure the following settings:
- API Key: Obtain from seiscan.io
- URL:
https://seiscan.io
Deploy and Verify
Once configured, deploy your contract through Remix as usual. The Contract Verification plugin will automatically verify your contract upon successful deployment, submitting to both Sourcify and Seiscan simultaneously.
Verification status will be displayed in the plugin interface, and your verified contract will be publicly viewable on Seiscan explorer.
Verify via 0xngmi Etherscan Verification (third‑party)
You can batch‑verify a contract that is already verified on another chain using the community tool Etherscan Verification by 0xngmi . This copies the verified source from a “source chain” and submits it to Seiscan , as long as the bytecode and compiler settings match.
Steps:
- Open Etherscan Verification by 0xngmi .
- In “Source Contract”, paste the address of the contract that is already verified and select its chain.
- In “Target Contracts”, add your Sei deployment address and select “Sei” as the target chain.
- Click “Verify Contracts” and wait for the result.
- Confirm the result on Seiscan by visiting the contract page and checking the Contract tab.