Deploy with Hardhat
NetZero Chain is a standard EVM chain (Shanghai). Whatever you deploy on Ethereum, BNB Chain or Arbitrum deploys here with a network entry and nothing else.
Hardhat
// hardhat.config.js
require("@nomicfoundation/hardhat-toolbox");
module.exports = {
solidity: { version: "0.8.24", settings: { evmVersion: "shanghai" } },
networks: {
netzeroTestnet: {
url: process.env.NZC_RPC ?? "http://127.0.0.1:8545",
chainId: 20500,
accounts: [process.env.NZC_TEST_KEY], // a test key with test-USDn
},
},
};npx hardhat run scripts/deploy.js --network netzeroTestnetFoundry
forge create --rpc-url http://127.0.0.1:8545 --private-key $NZC_TEST_KEY \
--evm-version shanghai src/MyContract.sol:MyContractcast chain-id --rpc-url http://127.0.0.1:8545 # 20500
cast block finalized --rpc-url http://127.0.0.1:8545Fees
Set nothing special. Libraries read eth_feeHistory and pick a maxFeePerGas above the 1,000 gwei USDn floor. If you set fees by hand, use at least 1,000 gwei plus a small tip. Because USDn is a dollar, the gas cost Hardhat prints is the dollar cost.
Typical deployment costs: about 1 USDn per 4 KB of runtime code. Half of it funds carbon removals.
Verification
Contract verification on the explorer is on the roadmap. Until then, publish source and compiler settings in your repository and reference the deployment transaction.
Differences from Ethereum you might notice
| Ethereum | NetZero Chain |
|---|---|
block.coinbase is the validator/builder | block.coinbase is the fee sink 0x…1006; the proposer is in extraData |
| Base fee is burned | Base fee is distributed (50/40/10) |
finalized tag lags 2 epochs (~13 min) | finalized lags one block (~3 s) |
| 12 s blocks, 30M gas | 3 s blocks, 30M gas |
| Withdrawals in blocks | Withdrawals field carries mining shares (amount always 0); empty before block 29400 |
PREVRANDAO from the beacon chain | PREVRANDAO (difficulty) is 1 or 2; do not use it for randomness |
Everything else, opcodes, precompiles, gas schedule, ABI, tooling, is the same.
