Documentation Index
Fetch the complete documentation index at: https://seilabs-docs-evm-reference-and-sei-js-examples.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Deploy and Verify
Sei is EVM-compatible — standard deployment tooling works without modification. This page covers deploying a contract and verifying its source on the Sei block explorer.
For a deeper look at verification options (Remix, Sourcify UI, batch verification), see the Verify Contracts page.
Deploying with viem or ethers
import { createPublicClient, createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { sei } from '@sei-js/precompiles/viem';
const account = privateKeyToAccount('0xYourPrivateKey');
const publicClient = createPublicClient({ chain: sei, transport: http() });
const walletClient = createWalletClient({ account, chain: sei, transport: http() });
const hash = await walletClient.deployContract({
abi: CONTRACT_ABI,
bytecode: '0x608060...',
args: [/* constructor args */],
});
const { contractAddress } = await publicClient.waitForTransactionReceipt({ hash });
console.log('Deployed at:', contractAddress);
Deploying with Foundry
Foundry works against Sei with the standard --rpc-url flag.
forge create src/MyContract.sol:MyContract \
--rpc-url https://evm-rpc.sei-apis.com \
--private-key $PRIVATE_KEY \
--constructor-args arg1 arg2
For testnet:
forge create src/MyContract.sol:MyContract \
--rpc-url https://evm-rpc-testnet.sei-apis.com \
--private-key $PRIVATE_KEY
Deploying with Hardhat
Add Sei networks to your hardhat.config.ts:
import { HardhatUserConfig } from 'hardhat/config';
const config: HardhatUserConfig = {
networks: {
sei: {
url: 'https://evm-rpc.sei-apis.com',
chainId: 1329,
accounts: [process.env.PRIVATE_KEY!],
},
seiTestnet: {
url: 'https://evm-rpc-testnet.sei-apis.com',
chainId: 1328,
accounts: [process.env.PRIVATE_KEY!],
},
},
};
export default config;
Then deploy:
npx hardhat run scripts/deploy.ts --network sei
Verifying Contracts
Sei’s block explorer is Seiscan. The recommended verification method is Sourcify — no API key required.
Foundry
Verify after deployment:
forge verify-contract \
--verifier sourcify \
--chain-id 1329 \
0xDeployedContractAddress \
src/MyContract.sol:MyContract
Or deploy and verify in one step:
forge create src/MyContract.sol:MyContract \
--rpc-url https://evm-rpc.sei-apis.com \
--private-key $PRIVATE_KEY \
--verify \
--verifier sourcify \
--chain-id 1329
For testnet, use --chain-id 1328 and --rpc-url https://evm-rpc-testnet.sei-apis.com.
Hardhat
Install the verify plugin:
npm install --save-dev @nomicfoundation/hardhat-verify
Add it to hardhat.config.ts — no additional Sourcify config block is needed:
import '@nomicfoundation/hardhat-verify';
const config: HardhatUserConfig = {
networks: {
sei: {
url: 'https://evm-rpc.sei-apis.com',
chainId: 1329,
accounts: [process.env.PRIVATE_KEY!],
},
seiTestnet: {
url: 'https://evm-rpc-testnet.sei-apis.com',
chainId: 1328,
accounts: [process.env.PRIVATE_KEY!],
},
},
};
Verify a deployed contract:
npx hardhat verify sourcify --network sei 0xDeployedContractAddress
If your contract has constructor arguments:
npx hardhat verify sourcify --network sei 0xDeployedContractAddress "arg1" "arg2"
Network Reference
| Network | Chain ID | RPC | Explorer |
|---|
| Mainnet | 1329 | https://evm-rpc.sei-apis.com | seiscan.io |
| Testnet | 1328 | https://evm-rpc-testnet.sei-apis.com | testnet.seiscan.io |
| Devnet | 713715 | https://evm-rpc-arctic-1.sei-apis.com | — |