Complete guide to deploying Solidity smart contracts to Ethereum, Polygon, and other EVM chains using Hardhat, Foundry, or the KuberNodes IDE.
KuberNodes supports three deployment workflows: Hardhat (most popular), Foundry (fastest), and our cloud IDE (zero setup). All use your KuberNodes RPC endpoint as the network provider.
Configure your KuberNodes RPC URL in hardhat.config.ts and deploy with npx hardhat ignition deploy.
// hardhat.config.ts
import { HardhatUserConfig } from "hardhat/config"
const config: HardhatUserConfig = {
solidity: "0.8.24",
networks: {
ethereum: {
url: "https://rpc.kubernodes.com/ethereum?apiKey=YOUR_KEY",
accounts: [process.env.PRIVATE_KEY!],
},
polygon: {
url: "https://rpc.kubernodes.com/polygon?apiKey=YOUR_KEY",
accounts: [process.env.PRIVATE_KEY!],
},
sepolia: {
url: "https://rpc.kubernodes.com/ethereum?apiKey=YOUR_KEY&network=sepolia",
accounts: [process.env.PRIVATE_KEY!],
},
},
}
export default configUse forge create or forge script with your KuberNodes RPC URL for fast deployments.
# Deploy a contract with forge forge create --rpc-url "https://rpc.kubernodes.com/ethereum?apiKey=YOUR_KEY" \ --private-key $PRIVATE_KEY \ src/MyContract.sol:MyContract \ --constructor-args "arg1" 42 # Or use a deployment script forge script script/Deploy.s.sol \ --rpc-url "https://rpc.kubernodes.com/ethereum?apiKey=YOUR_KEY" \ --broadcast \ --verify
The easiest path — write, compile, and deploy from your browser with zero local setup. Open a workspace, write your contract, and click Deploy.
// In the KuberNodes IDE terminal: // 1. Your contract is auto-compiled on save // 2. Click "Deploy" or use the CLI: kubernodes deploy --chain polygon --network mainnet --contract MyToken
After deployment, verify on Etherscan/Polygonscan for transparency. KuberNodes IDE does this automatically; with Hardhat use the verify task.
# Hardhat verification npx hardhat verify --network ethereum DEPLOYED_ADDRESS "arg1" 42 # Foundry verification (included in --verify flag above) forge verify-contract DEPLOYED_ADDRESS src/MyContract.sol:MyContract \ --chain-id 1 --etherscan-api-key YOUR_ETHERSCAN_KEY
Get a free API key and start making requests in under 5 minutes.
Create free account