This repo should serve as an example of the config and manual gas-override required for hardhat-based contract deployments on Berachain Bepolia. The repo also should help you verify contracts via hardhat (Routescan api and configs have been provided in the repo).
- The default Hardhat
deployContractis having issue. But crafting the deploy transaction manually withgasLimitandgasPricespecified works. - Removing the gas: “auto” setting in hardhat config file.
- Building the transaction manually and setting a forced gas limit override (this may be more expensive gas-wise, but not significantly).
- npm init --y
- npm install --save-dev hardhat
- npm install --save-dev dotenv
- create .env - and add WALLET_KEY=0x
- npx hardhat run scripts/deploy.ts --network berachain-bepolia
npx hardhat run scripts/deploy.ts --network berachain-bepolianpm install --save-dev @nomicfoundation/hardhat-verifynpx hardhat verify --network berachain-bepolia <0x...>Make sure to replace the whole " <0xaddress> ". A correct example would be:-
✅ npx hardhat verify --network berachain-bepolia 0x3229075dd6F75bD879F7af07d384A0856c30a806
❌ npx hardhat verify --network berachain-bepolia <0x3229075dd6F75bD879F7af07d384A0856c30a806> (This is incorrect)
Spin up a local fork:
npx hardhat node --fork https://bepolia.rpc.berachain.com/Run the deploy script in a new terminal:
npx hardhat run scripts/deploy.ts --network berachain-local