Skip to content

Instantly share code, notes, and snippets.

@thaarok
Last active April 1, 2025 17:45
Show Gist options
  • Save thaarok/729872437ba67ae630bd652ed1d05656 to your computer and use it in GitHub Desktop.
Save thaarok/729872437ba67ae630bd652ed1d05656 to your computer and use it in GitHub Desktop.
Sonic and Sonic Blaze testnet configuration for Hardhat/Foundry
[rpc_endpoints]
mainnet = "https://rpc.soniclabs.com/"
testnet = "https://rpc.blaze.soniclabs.com"
[etherscan]
mainnet = { chain = 146, key = "...sonicscan key...", url = "https://api.sonicscan.org/api" }
testnet = { chain = 57054, key = "...sonicscan key...", url = "https://api-testnet.sonicscan.org/api" }
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
import * as dotenv from "dotenv";
dotenv.config();
const config: HardhatUserConfig = {
solidity: {
version: "0.8.27",
settings: {
evmVersion: "cancun",
optimizer: {
enabled: true,
runs: 200,
},
},
},
networks: {
sonic: {
url: "https://rpc.soniclabs.com/",
accounts: [process.env.PRIVATE_KEY!!],
//ledgerAccounts: [process.env.LEDGER_ADDR],
},
blaze: {
url: "https://rpc.blaze.soniclabs.com",
accounts: [process.env.PRIVATE_KEY!!],
//ledgerAccounts: [process.env.LEDGER_ADDR],
},
},
etherscan: {
apiKey: {
mainnet: process.env.ETHERSCAN_API_KEY!!,
sonic: process.env.SONICSCAN_API_KEY!!,
sepolia: process.env.ETHERSCAN_API_KEY!!,
blaze: process.env.SONICSCAN_API_KEY!!,
},
customChains: [
{
network: "sonic",
chainId: 146,
urls: {
apiURL: "https://api.sonicscan.org/api",
browserURL: "https://sonicscan.org/"
}
},
{
network: "blaze",
chainId: 57054,
urls: {
apiURL: "https://api-testnet.sonicscan.org/api",
browserURL: "https://testnet.sonicscan.org/"
}
}
],
},
ignition: {
requiredConfirmations: 3, // sufficient for testing
},
};
export default config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment