Install Hardhat:
npm install --save-dev hardhat
npx hardhat
Update hardhat.config.js:
require("@nomicfoundation/hardhat-toolbox");
module.exports = {
solidity: "0.8.20",
networks: {
vsc: {
url: "<https://rpc.vscblockchain.org>",
chainId: 420042,
accounts: ["YOUR_PRIVATE_KEY"]
}
}
};
Create contracts/MyContract.sol:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract MyContract {
string public message = "Hello, Vector Smart Chain!";
}
Deploy Script scripts/deploy.js:
async function main() {
const Contract = await ethers.getContractFactory("MyContract");
const contract = await Contract.deploy();
console.log("Deployed to:", contract.target);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
Run Deployment:
npx hardhat run scripts/deploy.js --network vsc