Using Hardhat
Guide on deploying a smart contract on DuckChain using Hardhat, a popular framework for deploying and verifying smart contracts.
Initial Setup:
Get some test TON from the DuckChain testnet faucet.
Install Hardhat and its dependencies:
npm install --save-dev ethers hardhat @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers dotenvInitialize the project:
npx hardhat initOpen
hardhat.config.jsand add the following:require("dotenv").config(); require("@nomicfoundation/hardhat-toolbox"); module.exports = { solidity: "0.8.9", paths: { artifacts: "./src", }, networks: { DuckChainTestnet: { url: `https://testnet-rpc.duckchain.io`, accounts: [process.env.ACCOUNT_PRIVATE_KEY], }, }, };
Add Contract Code and Deployment Script:
Create
Storage.solin thecontractsfolder with the following code:Create a deployment script
deploy-storage.js:Install Hardhat toolbox if not already installed:
Compile and deploy the contract:
Last updated