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. waitForDeployment() returning means the block is committed and will not be reorganised. There is no reason to wait for more confirmations.
Blocks are half a second. 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.