LogoLogo
Node Sale WhitelistPhron AIopenPhronDevelopers
  • Introducing Phron AI
  • AI as the Core Infrastructure Layer
  • openPhron
  • PhronZero Prototype
  • PhronZero
  • Phron AI Node Sale
    • Node Utility
    • Node Tiers
    • FAQs
  • Farming Rewards
  • Roadmap
  • Official Links
Powered by GitBook
On this page
  1. Developers
  2. Build with PhronAI
  3. Smart Contracts Development
  4. Solidity Contracts
  5. Phron API

Deployment

Deploying on a Local Network

  1. Compile the contract:

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

    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:

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

Deploying on Testnet

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

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

Last updated 6 months ago