# Deployment

#### Deploying on a Local Network

1. **Compile the contract**:

   ```bash
   npx hardhat compile
   ```
2. **Deploy the contract**: Create a script `/scripts/deploy.js`:

   ```javascript
   async function main() {
     const Contract = await ethers.getContractFactory("MyContract");
     const contract = await Contract.deploy();
     console.log("Contract deployed to:", contract.address);
   }

   main()
     .then(() => process.exit(0))
     .catch((error) => {
       console.error(error);
       process.exit(1);
     });
   ```
3. **Run the deployment script**:

   ```bash
   npx hardhat run scripts/deploy.js --network localhost
   ```

#### Deploying on Testnet&#x20;

1. **Configure Networks in Hardhat**: Edit `hardhat.config.js` to include testnet configurations:

   ```javascript
   codemodule.exports = {
     networks: {
       phron: {
         url: "https://testnet.phron.ai",
       }
     },
     solidity: "0.8.4",
   };
   ```
