# Deploying a Smart Contract on the Base Network > Using Hardhat **Published by:** [kevang30](https://paragraph.com/@kevang30/) **Published on:** 2024-08-25 **Categories:** devs, programming, blog, basic **URL:** https://paragraph.com/@kevang30/deploying-a-smart-contract-on-the-base-network ## Content I must clarify that I have no business or work relationship with any project mentioned here, and that I am making this tutorial with the sole purpose of informing my way of understanding things and disclaiming responsibility to the project for any error in my perception or any poorly presented concept. The codes described are examples and do not represent any professional opinion that should function as anything more than that.Having said this and being clear, we continue. Deploying a Smart Contract on the Base Network 1. Install Node.js: Ensure you have Node.js installed. You can download it from [nodejs.org](https://nodejs.org/). 2. Set Up Your Project: Create a new Node.js project: ```bash mkdir my-smart-contract cd my-smart-contract npm init -y ``` 3. Install Hardhat: Install Hardhat and create a new Hardhat project: ```bash npm install --save-dev hardhat npx hardhat ``` Follow the prompts to set up your project. 4. Install Dependencies: Install the necessary dependencies: ```bash npm install --save-dev @nomicfoundation/hardhat-toolbox ``` 5. Configure Hardhat: Update your `hardhat.config.js` to include the Base network: ```javascript require("@nomicfoundation/hardhat-toolbox"); require("dotenv").config(); module.exports = { solidity: "0.8.23", networks: { base: { url: "https://mainnet.base.org", accounts: [process.env.PRIVATE_KEY], }, }, }; ``` 6. Write Your Smart Contract: Create a new file in the `contracts` directory, e.g., `MyContract.sol`: ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.23; contract MyContract { string public message; constructor(string memory _message) { message = _message; } function setMessage(string memory _message) public { message = _message; } } ``` 7. Compile Your Contract: Compile your smart contract: ```bash npx hardhat compile ``` 8. Create a Deployment Script: Create a new file in the `scripts` directory, e.g., `deploy.js`: ```javascript async function main() { const [deployer] = await ethers.getSigners(); console.log("Deploying contracts with the account:", deployer.address); const MyContract = await ethers.getContractFactory("MyContract"); const myContract = await MyContract.deploy("Hello, Base!"); console.log("Contract deployed to address:", myContract.address); } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); ``` 9. Deploy Your Contract: Deploy your smart contract to the Base network: ```bash npx hardhat run scripts/deploy.js --network base ``` 10. Verify Deployment: Check the deployment status and interact with your contract using tools like Etherscan or a web3 wallet. I hope you like this tutorial, it will be modified as more information becomes available and is subject to change without prior notice. Written and developed by: @kevang30.eth Follow me on Warpcast https://warpcast.com/kevang30.eth if you like my content! ## Publication Information - [kevang30](https://paragraph.com/@kevang30/): Publication homepage - [All Posts](https://paragraph.com/@kevang30/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@kevang30): Subscribe to updates ## Optional - [Collect as NFT](https://paragraph.com/@kevang30/deploying-a-smart-contract-on-the-base-network): Support the author by collecting this post - [View Collectors](https://paragraph.com/@kevang30/deploying-a-smart-contract-on-the-base-network/collectors): See who has collected this post