A working Hardhat setup for chain 2800.
Configuration
// hardhat.config.js
require('@nomicfoundation/hardhat-toolbox');
module.exports = {
solidity: {
version: '0.8.24',
settings: { optimizer: { enabled: true, runs: 200 }, evmVersion: 'cancun' },
},
networks: {
aere: {
url: 'https://rpc.aere.network',
chainId: 2800,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
},
};
evmVersion can be cancun, prague, osaka or anything earlier. Chain 2800 activates through Osaka.
Deploy
export PRIVATE_KEY=0x…
npx hardhat compile
npx hardhat run scripts/deploy.js --network aere
// scripts/deploy.js
const hre = require('hardhat');
async function main() {
const Counter = await hre.ethers.getContractFactory('Counter');
const counter = await Counter.deploy();
await counter.waitForDeployment();
console.log('deployed at', await counter.getAddress());
}
main().catch((e) => { console.error(e); process.exit(1); });
Notes that save time
One confirmation is final for a validator. waitForDeployment() returning means the node you asked has the block; on a validator it is committed and will not be reorganised. From block 25,080,000 (AIP-22 stage 5) the public endpoint is a node outside consensus, whose latest block is final once the next anchor covers it, so a deployment that must not be reversed is checked against the finalized block, at most one anchor interval (32 blocks, about 20 seconds) behind the head, not against more confirmations.
Blocks arrive about every 0.62 seconds. Tests that poll with long intervals spend most of their time waiting.
Gas estimation works, but the base fee has a floor of 1 Gwei. If you pin gasPrice manually to something below the floor the transaction is rejected as underpriced. Let the toolchain read fee data from the chain. See Fees.
Forking. hardhat_reset against https://rpc.aere.network works for recent blocks only, because the public endpoint keeps state for 512 blocks. Forking at an older height needs an archive node of your own.