Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
- Deploy a simple smart contract to Monad mainnet using Hardhat
- Verify contracts on MonadExplorer (Sourcify) and Monadscan (Etherscan-based)
- Alternative deployment using Foundry
- Understand Monad’s 1-second finality benefits for deployment
Prerequisites
- Chainstack account with a Monad node endpoint
- Node.js v16+ (for Hardhat) or Foundry installed
- Basic Solidity knowledge
- MON tokens for gas fees
Overview
Monad is EVM-compatible at the bytecode level, so your existing Ethereum development tools work without modification. The main differences you’ll notice:- 1-second finality: Your contract is confirmed immediately after deployment
- No reorganizations: Once deployed, your contract address is permanent
- 300M gas limit: Complex contracts deploy without hitting gas limits
Deploy with Hardhat
Set up the project
Create a new directory and initialize a Hardhat project:Configure environment variables
Create a.env file in your project root:
.env
Configure Hardhat for Monad
Replace the contents ofhardhat.config.js:
hardhat.config.js
Write the smart contract
Createcontracts/Counter.sol:
contracts/Counter.sol
Create the deployment script
Createscripts/deploy.js:
scripts/deploy.js
Deploy the contract
Run the deployment:Verify on Monadscan
Verify using the Etherscan-compatible API:CONTRACT_ADDRESS with your deployed address. The 0 is the constructor argument (initial count).
Verify on MonadExplorer (Sourcify)
Verify using Sourcify:Deploy with Foundry
Foundry offers faster compilation and a streamlined CLI experience.Set up the project
Write the contract
Replacesrc/Counter.sol:
src/Counter.sol
Deploy with forge
Verify on MonadExplorer (Sourcify)
Verify on Monadscan
Interact with your contract
After deployment, interact with your contract using cast (Foundry) or a script.Using cast
Using ethers.js
Monad-specific notes
Key differences from other EVM chains:
- 1-second finality: No need to wait for multiple confirmations. Once the transaction is included in a block, it’s final.
- No pending state: Transactions go directly from submitted to confirmed. The mempool works differently than Ethereum.
- High throughput: You can deploy multiple contracts in rapid succession without congestion.
- Same tooling: All Ethereum tools (Hardhat, Foundry, Remix, etc.) work without modification.
Block explorers
After deployment, view your contract on:- MonadExplorer (BlockVision):
https://monadexplorer.com/address/CONTRACT_ADDRESS - Monadscan:
https://monadscan.com/address/CONTRACT_ADDRESS - MonVision:
https://monvision.io/address/CONTRACT_ADDRESS
Troubleshooting
Verification fails with “contract not found”
Wait 10-15 seconds after deployment before verifying. Monad’s fast finality means the contract is deployed quickly, but explorers may need time to index it.Gas estimation errors
Monad has a 300M gas limit per block. If you’re hitting gas errors, check:- Your contract isn’t infinite looping
- Constructor logic is reasonable
- You have enough MON for gas fees
RPC connection issues
Ensure your Chainstack endpoint is correct and includes the full URL with any authentication.Next steps
Now that you can deploy and verify contracts, you can:- Build more complex smart contracts
- Create a frontend to interact with your contract
- Set up continuous deployment pipelines
- Explore Monad’s high-throughput capabilities with batch transactions